Re: GdkEvent --> XEvent



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tristan Van Berkom wrote:
Hi all,
    As usual, I'm trying to do something that just wasnt' meant to be
done :)  (otherwise when would I have any fun ?)

I'm trying to write a widget that will display a netscape gecko plugin
stream on linux, the plugin framework delivers an XEvent to the plugin
and lets the plugin "react", essentially; I want to do this:

gint
widget_event_handler (GtkWidget *widget,
                      GdkEvent  *event,
                      gpointer   data)
{
    FunkyPointer fptr = gdk_get_some_obscure_internal_thingy ();
    XEvent *event = fptr->walk->the->obscure->structures;

    deliver_event_to_plugin (plugin, event);
}

Hmmm,
    surly the XEvent isnt "gone" during the emission is it ?

I'm relatively sure the XEvent is indeed "lost" by the time you see it
in your event handler.  If you'll look at the various XEvent and
GdkEvent structures, however, you'll note that they're fairly similar (I
think it's safe to assume GdkEvent was originally based on XEvent).  You
can construct XEvents from GdkEvents, though there's a little work
involved, especially if you care about all event types and not just a
few particular events.

        -brian


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)

iD8DBQFC7+VP6XyW6VEeAnsRAvVhAKDCp6Gx1WhaoWZZ5mOFsuWbiZ9VugCfSWsn
tsbGl6OQds+93MXTEC4lYYk=
=9b9u
-----END PGP SIGNATURE-----



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]