1{%MainUnit ../gdk2x.pas}
2
3{$IFDEF read_forward_definitions}
4   PPPGdkTimeCoord = ^PPGdkTimeCoord;
5{$ENDIF read_forward_definitions}
6
7{$IFDEF read_interface_rest}
8
9type
10{ information about a device axis  }
11{ reported x resolution  }
12{ reported x minimum/maximum values  }
13{ calibrated resolution (for aspect ration) - only relative values
14     between axes used  }
15{ calibrated minimum/maximum values  }
16   PGdkAxisInfo = ^TGdkAxisInfo;
17   TGdkAxisInfo = record
18        xresolution : gint;
19        xmin_value : gint;
20        xmax_value : gint;
21        resolution : gint;
22        min_value : gint;
23        max_value : gint;
24     end;
25
26
27const
28   GDK_INPUT_NUM_EVENTC = 6;
29{$ifndef XINPUT_NONE}
30{ information about the axes  }
31{ Information about XInput device  }
32{ minimum key code for device  }
33{ true if we need to select a different set of events, but
34     can't because this is the core pointer  }
35{ Mask of buttons (used for button grabs)  }
36{ true if we've claimed the device as active. (used only for XINPUT_GXI)  }
37{$endif}
38{ !XINPUT_NONE  }
39
40type
41   PGdkDevicePrivate = ^TGdkDevicePrivate;
42   TGdkDevicePrivate = record
43        info : TGdkDevice;
44        deviceid : guint32;
45        display : PGdkDisplay;
46        axes : PGdkAxisInfo;
47        xdevice : Pointer; // PXDevice;
48        min_keycode : gint;
49        buttonpress_type : longint;
50        buttonrelease_type : longint;
51        keypress_type : longint;
52        keyrelease_type : longint;
53        motionnotify_type : longint;
54        proximityin_type : longint;
55        proximityout_type : longint;
56        changenotify_type : longint;
57        needs_update : gint;
58        button_state : gint;
59        claimed : gint;
60     end;
61
62   P_GdkDeviceClass = ^T_GdkDeviceClass;
63   T_GdkDeviceClass = record
64        parent_class : TGObjectClass;
65     end;
66
67{ gdk window  }
68{ Extension mode (GDK_EXTENSION_EVENTS_ALL/CURSOR)  }
69{ position relative to root window  }
70{ rectangles relative to window of windows obscuring this one  }
71{ Is there a pointer grab for this window ?  }
72   PGdkInputWindow = ^TGdkInputWindow;
73   TGdkInputWindow = record
74        window : PGdkWindow;
75        mode : TGdkExtensionMode;
76        root_x : gint;
77        root_y : gint;
78        obscuring : PGdkRectangle;
79        num_obscuring : gint;
80        grabbed : gint;
81     end;
82
83{ Global data  }
84// Private function GDK_IS_CORE(d : pointer) : boolean;
85
86{ Function declarations  }
87function gdk_input_window_find(window:PGdkWindow):PGdkInputWindow;cdecl;external;
88
89procedure gdk_input_window_destroy(window:PGdkWindow);cdecl;external;
90
91function _gdk_device_allocate_history(device:PGdkDevice; n_events:gint):PPGdkTimeCoord;cdecl;external;
92
93procedure _gdk_init_input_core;cdecl;external;
94
95{ The following functions are provided by each implementation
96   (xfree, gxi, and none)
97  }
98function _gdk_input_enable_window(window:PGdkWindow; gdkdev:PGdkDevicePrivate):gint;cdecl;external;
99
100function _gdk_input_disable_window(window:PGdkWindow; gdkdev:PGdkDevicePrivate):gint;cdecl;external;
101
102function _gdk_input_window_none_event(event:PGdkEvent; xevent:PXEvent):gint;cdecl;external;
103
104procedure _gdk_input_configure_event(xevent:PXConfigureEvent; window:PGdkWindow);cdecl;external;
105
106procedure _gdk_input_enter_event(xevent:PXCrossingEvent; window:PGdkWindow);cdecl;external;
107
108function _gdk_input_other_event(event:PGdkEvent; xevent:PXEvent; window:PGdkWindow):gint;cdecl;external;
109
110function _gdk_input_grab_pointer(window:PGdkWindow; owner_events:gint; event_mask:TGdkEventMask; confine_to:PGdkWindow; time:guint32):gint;cdecl;external;
111
112procedure _gdk_input_ungrab_pointer(display:PGdkDisplay; time:guint32);cdecl;external;
113
114function _gdk_device_get_history(device:PGdkDevice; window:PGdkWindow; start:guint32; stop:guint32; events:PPPGdkTimeCoord;
115           n_events:Pgint):gboolean;cdecl;external;
116
117{$ifndef XINPUT_NONE}
118
119const
120   GDK_MAX_DEVICE_CLASSES = 13;
121
122function gdk_input_common_init(display:PGdkDisplay; include_core:gint):gint;cdecl;external;
123
124function gdk_input_find_device(display:PGdkDisplay; id:guint32):PGdkDevicePrivate;cdecl;external;
125
126procedure gdk_input_get_root_relative_geometry(display:PDisplay; w:TWindow; x_ret:Plongint; y_ret:Plongint; width_ret:Plongint;
127            height_ret:Plongint);cdecl;external;
128
129procedure gdk_input_common_find_events(window:PGdkWindow; gdkdev:PGdkDevicePrivate; mask:gint; classes:Pointer {PXEventClass}; num_classes:Plongint);cdecl;external;
130
131procedure gdk_input_common_select_events(window:PGdkWindow; gdkdev:PGdkDevicePrivate);cdecl;external;
132
133function gdk_input_common_other_event(event:PGdkEvent; xevent:PXEvent; input_window:PGdkInputWindow; gdkdev:PGdkDevicePrivate):gint;cdecl;external;
134
135{$endif}
136{$ENDIF read_interface_rest}
137
138//------------------------------------------------------------------------------
139
140{$IFDEF read_implementation}
141{ Private
142function GDK_IS_CORE(d : pointer) : boolean;
143begin
144   GDK_IS_CORE:= (PGdkDevice(d)) = _gdk_core_pointer;
145end;}
146
147{$ENDIF read_implementation}
148
149