]> gitweb.factorcode.org Git - factor.git/commitdiff
gdk.ffi: fix incorrect GdkEvent* structures' definitions;
authorAnton Gorenko <ex.rzrjck@gmail.com>
Mon, 15 Nov 2010 15:47:36 +0000 (21:47 +0600)
committerAnton Gorenko <ex.rzrjck@gmail.com>
Mon, 15 Nov 2010 15:47:36 +0000 (21:47 +0600)
basis/gdk/ffi/ffi.factor

index 1e779befa6ed4ad7c22f3042b3ab23ed0a1476e8..7107b52aa8bfa42fa630331019008364bdc4b0a2 100644 (file)
@@ -2,7 +2,8 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: alien alien.c-types alien.destructors alien.libraries
 alien.syntax cairo.ffi classes.struct combinators
-gobject-introspection kernel system vocabs.loader ;
+gobject-introspection gobject-introspection.standard-types
+kernel system vocabs.loader ;
 IN: gdk.ffi
 
 <<
@@ -20,13 +21,6 @@ LIBRARY: gdk
 } cond
 >>
 
-IMPLEMENT-STRUCTS: GdkEventAny GdkEventKey GdkEventButton
-GdkEventScroll GdkEventMotion GdkEventExpose GdkEventVisibility
-GdkEventCrossing GdkEventFocus GdkEventConfigure GdkEventProperty
-GdkEventSelection GdkEventDND GdkEventProximity GdkEventClient
-GdkEventNoExpose GdkEventWindowState GdkEventSetting
-GdkEventOwnerChange GdkEventGrabBroken GdkRectangle ;
-
 ! <workaround these types are from cairo 1.10
 STRUCT: cairo_rectangle_int_t
     { x int } { y int } { width int } { height int } ;
@@ -45,3 +39,66 @@ FOREIGN-ENUM-TYPE: cairo.Content cairo_content_t
 GIR: vocab:gdk/Gdk-3.0.gir
 
 DESTRUCTOR: gdk_cursor_unref
+
+STRUCT: GdkEventButton
+    { type GdkEventType }
+    { window GdkWindow* }
+    { send_event gint8 }
+    { time guint32 }
+    { x gdouble }
+    { y gdouble }
+    { axes* gdouble }
+    { state guint }
+    { button guint }
+    { device GdkDevice* }
+    { x_root gdouble }
+    { y_root gdouble } ;
+
+STRUCT: GdkEventConfigure
+    { type GdkEventType }
+    { window GdkWindow* }
+    { send_event gint8 }
+    { x gint }
+    { y gint }
+    { width gint }
+    { height gint } ;
+
+STRUCT: GdkEventKey
+    { type GdkEventType }
+    { window GdkWindow* }
+    { send_event gint8 }
+    { time guint32 }
+    { state guint }
+    { keyval guint }
+    { length gint }
+    { string gchar* }
+    { hardware_keycode guint16 }
+    { group guint8 }
+    { is_modifier uint bits: 1 } ;
+
+STRUCT: GdkEventMotion
+    { type GdkEventType }
+    { window GdkWindow* }
+    { send_event gint8 }
+    { time guint32 }
+    { x gdouble }
+    { y gdouble }
+    { axes gdouble* }
+    { state guint }
+    { is_hint gint16 }
+    { device GdkDevice* }
+    { x_root gdouble }
+    { y_root gdouble } ;
+
+STRUCT: GdkEventScroll
+    { type GdkEventType }
+    { window GdkWindow* }
+    { send_event gint8 }
+    { time guint32 }
+    { x gdouble }
+    { y gdouble }
+    { state guint }
+    { direction GdkScrollDirection }
+    { device GdkDevice* }
+    { x_root gdouble }
+    { y_root gdouble } ;