1// included by gdk2.pp
2
3{$IFDEF read_forward_definitions}
4   PGdkDevice = ^TGdkDevice;
5   PGdkTimeCoord = ^TGdkTimeCoord;
6   PPGdkTimeCoord = ^PGdkTimeCoord;
7{$ENDIF read_forward_definitions}
8
9//------------------------------------------------------------------------------
10
11{$IFDEF read_interface_types}
12   PGdkExtensionMode = ^TGdkExtensionMode;
13   TGdkExtensionMode = (
14     GDK_EXTENSION_EVENTS_NONE,
15     GDK_EXTENSION_EVENTS_ALL,
16     GDK_EXTENSION_EVENTS_CURSOR
17   );
18
19   PGdkInputSource = ^TGdkInputSource;
20   TGdkInputSource = (
21     GDK_SOURCE_MOUSE,
22     GDK_SOURCE_PEN,
23     GDK_SOURCE_ERASER,
24     GDK_SOURCE_CURSOR
25   );
26
27   PGdkInputMode = ^TGdkInputMode;
28   TGdkInputMode = (
29     GDK_MODE_DISABLED,
30     GDK_MODE_SCREEN,
31     GDK_MODE_WINDOW
32     );
33
34   PGdkAxisUse = ^TGdkAxisUse;
35   TGdkAxisUse = longint;
36
37   PGdkDeviceKey = ^TGdkDeviceKey;
38   TGdkDeviceKey = record
39        keyval : guint;
40        modifiers : TGdkModifierType;
41     end;
42
43   PGdkDeviceAxis = ^TGdkDeviceAxis;
44   TGdkDeviceAxis = record
45        use : TGdkAxisUse;
46        min : gdouble;
47        max : gdouble;
48     end;
49
50{ All fields are read-only  }
51{ TRUE if the X pointer follows device motion  }
52   TGdkDevice = record
53        parent_instance : TGObject;
54        name : Pgchar;
55        source : TGdkInputSource;
56        mode : TGdkInputMode;
57        has_cursor : gboolean;
58        num_axes : gint;
59        axes : PGdkDeviceAxis;
60        num_keys : gint;
61        keys : PGdkDeviceKey;
62     end;
63
64{ We don't allocate each coordinate this big, but we use it to
65   be ANSI compliant and avoid accessing past the defined limits.
66  }
67
68   TGdkTimeCoord = record
69        time : guint32;
70        axes : array[0..(GDK_MAX_TIMECOORD_AXES)-1] of gdouble;
71     end;
72
73{$ENDIF read_interface_types}
74
75//------------------------------------------------------------------------------
76
77{$IFDEF read_interface_rest}
78const
79   GDK_AXIS_IGNORE = 0;
80   GDK_AXIS_X = 1;
81   GDK_AXIS_Y = 2;
82   GDK_AXIS_PRESSURE = 3;
83   GDK_AXIS_XTILT = 4;
84   GDK_AXIS_YTILT = 5;
85   GDK_AXIS_WHEEL = 6;
86   GDK_AXIS_LAST = 7;
87
88
89function GDK_TYPE_DEVICE : GType;
90function GDK_DEVICE(anObject : Pointer) : PGdkDevice;
91function GDK_DEVICE_CLASS(klass : Pointer) : PGdkDeviceClass;
92function GDK_IS_DEVICE(anObject : Pointer) : boolean;
93function GDK_IS_DEVICE_CLASS(klass : Pointer) : boolean;
94function GDK_DEVICE_GET_CLASS(obj : Pointer) : PGdkDeviceClass;
95
96
97function gdk_device_get_type:GType; cdecl; external gdklib;
98
99{$ifndef GDK_MULTIHEAD_SAFE}
100{ Returns a list of GdkDevice    }
101function gdk_devices_list:PGList; cdecl; external gdklib;
102{$endif}
103{ GDK_MULTIHEAD_SAFE  }
104
105
106{ Functions to configure a device  }
107
108procedure gdk_device_set_source(device:PGdkDevice; source:TGdkInputSource); cdecl; external gdklib;
109function gdk_device_set_mode(device:PGdkDevice; mode:TGdkInputMode):gboolean; cdecl; external gdklib;
110procedure gdk_device_set_key(device:PGdkDevice; index:guint; keyval:guint; modifiers:TGdkModifierType); cdecl; external gdklib;
111procedure gdk_device_set_axis_use(device:PGdkDevice; index:guint; use:TGdkAxisUse); cdecl; external gdklib;
112procedure gdk_device_get_state(device:PGdkDevice; window:PGdkWindow; axes:Pgdouble; mask:PGdkModifierType); cdecl; external gdklib;
113function gdk_device_get_history(device:PGdkDevice; window:PGdkWindow; start:guint32; stop:guint32; var events:PPGdkTimeCoord;
114           n_events:Pgint):gboolean; cdecl; external gdklib;
115procedure gdk_device_free_history(events:PPGdkTimeCoord; n_events:gint); cdecl; external gdklib;
116function gdk_device_get_axis(device:PGdkDevice; axes:Pgdouble; use:TGdkAxisUse; value:Pgdouble):gboolean; cdecl; external gdklib;
117procedure gdk_input_set_extension_events(window:PGdkWindow; mask:gint; mode:TGdkExtensionMode); cdecl; external gdklib;
118function gdk_device_get_core_pointer:PGdkDevice; cdecl; external gdklib;
119{$endif read_interface_rest}
120
121//------------------------------------------------------------------------------
122
123{$IFDEF read_implementation}
124function GDK_TYPE_DEVICE : GType;
125begin
126  GDK_TYPE_DEVICE:=gdk_device_get_type;
127end;
128
129function GDK_DEVICE(anObject : Pointer) : PGdkDevice;
130begin
131  GDK_DEVICE:=PGdkDevice(G_TYPE_CHECK_INSTANCE_CAST(anObject,GDK_TYPE_DEVICE));
132end;
133
134function GDK_DEVICE_CLASS(klass : Pointer) : PGdkDeviceClass;
135begin
136  GDK_DEVICE_CLASS:=PGdkDeviceClass(G_TYPE_CHECK_CLASS_CAST(klass,GDK_TYPE_DEVICE));
137end;
138
139function GDK_IS_DEVICE(anObject : Pointer) : boolean;
140begin
141  GDK_IS_DEVICE:=G_TYPE_CHECK_INSTANCE_TYPE(anObject,GDK_TYPE_DEVICE);
142end;
143
144function GDK_IS_DEVICE_CLASS(klass : Pointer) : boolean;
145begin
146  GDK_IS_DEVICE_CLASS:=G_TYPE_CHECK_CLASS_TYPE(klass,GDK_TYPE_DEVICE);
147end;
148
149function GDK_DEVICE_GET_CLASS(obj : Pointer) : PGdkDeviceClass;
150begin
151  GDK_DEVICE_GET_CLASS:=PGdkDeviceClass(G_TYPE_INSTANCE_GET_CLASS(obj,GDK_TYPE_DEVICE));
152end;
153{$ENDIF}
154
155