Input-Handling

Mario Torre neugens.limasoftware at gmail.com
Thu Mar 3 12:16:30 PST 2011


Il giorno gio, 03/03/2011 alle 14.19 +0100, Clemens Eisserer ha scritto:
> Hi,
> 
> I am working on a small university-project where the goal is to
> execute awt/java2d applications directly on an application server and
> re-direct its output to a web-browser.
> My plan would be to render to a BufferedImage and send only updated
> areas using dirty tracking.
> Caciocavallo seems like a perfect fit with its lightweight
> peer-implementation and the PlatformScreen abstraction, dirty tracking
> could be done through the surface-locking functions.
> 
> I had a look at the SDL implementation, but I haven't found how
> input-handling is done.
> If this isn't a part Cacio cares about, do you have some pointers
> where to start?
> 
> Thanks, Clemens

Hi Clemens,

The SDL backend was never done, because all the backends were (sadly)
developed under closed doors at aicas.

We wanted to revive the SDL backend but so far we didn't have time.

Anyway, Cacio handles the events by passing back and forth around the
"fake" AWT widget and the peer widget.

You should look at two things, CacioComponentPeer and CacioEventPump.

Anyway, for a managed window component, things are really easy,  search
for  SDLScreen and in particular, search for the native implementation,
it's very basic in the sdl peer, but it dispatches mouse events:
 
Java_net_java_openjdk_awt_peer_sdl_SDLScreen_nativeGetEvent

This is where we dispatch the events. The screen implements the
CacioEventSource, which is taken care by the FullScreenEventPump. For
non managed windows things are a bit more complicated in the sense that
you have to provide what this event pump does (see also dispatchEvent in
AbstractManagedWindowContainer).

We need to fix up things so that they work on current JDK though...

Cheers,
Mario
-- 
pgp key: http://subkeys.pgp.net/ PGP Key ID: 80F240CF
Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF

IcedRobot: www.icedrobot.org
Proud GNU Classpath developer: http://www.classpath.org/
Read About us at: http://planet.classpath.org
OpenJDK: http://openjdk.java.net/projects/caciocavallo/

Please, support open standards:
http://endsoftpatents.org/




More information about the caciocavallo-dev mailing list