Re: gobject introspection



Matthias Clasen wrote:

[snip]

So, how do language bindings handle GdkEvent currently ?

The Xfce Foundation Classes, a C++ binding, wraps a GdkEvent pointer in a C++ wrapper class called Gdk::Event. Each event type then has its own class that derives from Gdk::Event, via an intermediate class called Gdk::EventAny. Gdk::Event provides public accessor functions that cast the Gdk::Event base class to the correct derived event class type, or null, depending on the GdkEventType field.

Each derived event class has an accessor function that returns the base class' stored GdkEvent pointer cast to a pointer the corresponding GDK event struct type, such as a GdkEventButton or GdkEventMotion pointer. Each event class type provides accessor functions for the corresponding GDK struct fields. In the XFC Gtk::Widget event signal handlers each GdkEvent pointer is wrapped in the appropriate XFC event class type before passing it to the user defined event signal handling function.

Jeff.




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