]> gitweb.factorcode.org Git - factor.git/blob - basis/gdk/ffi/ffi.factor
factor: trim using lists
[factor.git] / basis / gdk / ffi / ffi.factor
1 ! Copyright (C) 2010 Anton Gorenko.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien alien.c-types alien.destructors alien.libraries
4 alien.syntax cairo.ffi classes.struct combinators
5 gobject-introspection gobject-introspection.standard-types
6 kernel system vocabs ;
7 IN: gdk.ffi
8
9 <<
10 "pango.ffi" require
11 "gdk.pixbuf.ffi" require
12 >>
13
14 LIBRARY: gdk
15
16 <<
17 "gdk" {
18     { [ os windows? ] [ "libgdk-win32-2.0-0.dll" cdecl add-library ] }
19     { [ os macosx? ] [ drop ] }
20     { [ os unix? ] [ "libgdk-x11-2.0.so" cdecl add-library ] }
21 } cond
22 >>
23
24 ! <workaround these types are from cairo 1.10
25 STRUCT: cairo_rectangle_int_t
26     { x int } { y int } { width int } { height int } ;
27
28 C-TYPE: cairo_region_t
29 ! workaround>
30
31 FOREIGN-RECORD-TYPE: cairo.RectangleInt cairo_rectangle_int_t
32 FOREIGN-RECORD-TYPE: cairo.Region cairo_region_t
33 FOREIGN-RECORD-TYPE: cairo.FontOptions cairo_font_options_t
34 FOREIGN-RECORD-TYPE: cairo.Surface cairo_surface_t
35 FOREIGN-RECORD-TYPE: cairo.Pattern cairo_pattern_t
36 FOREIGN-RECORD-TYPE: cairo.Context cairo_t
37 FOREIGN-ENUM-TYPE: cairo.Content cairo_content_t
38
39 GIR: vocab:gdk/Gdk-3.0.gir
40
41 DESTRUCTOR: gdk_cursor_unref
42
43 STRUCT: GdkEventButton
44     { type GdkEventType }
45     { window GdkWindow* }
46     { send_event gint8 }
47     { time guint32 }
48     { x gdouble }
49     { y gdouble }
50     { axes gdouble* }
51     { state guint }
52     { button guint }
53     { device GdkDevice* }
54     { x_root gdouble }
55     { y_root gdouble } ;
56
57 STRUCT: GdkEventConfigure
58     { type GdkEventType }
59     { window GdkWindow* }
60     { send_event gint8 }
61     { x gint }
62     { y gint }
63     { width gint }
64     { height gint } ;
65
66 STRUCT: GdkEventKey
67     { type GdkEventType }
68     { window GdkWindow* }
69     { send_event gint8 }
70     { time guint32 }
71     { state guint }
72     { keyval guint }
73     { length gint }
74     { string gchar* }
75     { hardware_keycode guint16 }
76     { group guint8 }
77     { is_modifier uint bits: 1 } ;
78
79 STRUCT: GdkEventMotion
80     { type GdkEventType }
81     { window GdkWindow* }
82     { send_event gint8 }
83     { time guint32 }
84     { x gdouble }
85     { y gdouble }
86     { axes gdouble* }
87     { state guint }
88     { is_hint gint16 }
89     { device GdkDevice* }
90     { x_root gdouble }
91     { y_root gdouble } ;
92
93 STRUCT: GdkEventScroll
94     { type GdkEventType }
95     { window GdkWindow* }
96     { send_event gint8 }
97     { time guint32 }
98     { x gdouble }
99     { y gdouble }
100     { state guint }
101     { direction GdkScrollDirection }
102     { device GdkDevice* }
103     { x_root gdouble }
104     { y_root gdouble } ;