gdkevents.inc 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. // included by gdk2.pp
  2. {$IFDEF read_interface_types}
  3. PGdkEvent = ^TGdkEvent;
  4. TGdkEventFunc = procedure (event:PGdkEvent; data:gpointer); cdecl;
  5. { Event filtering }
  6. PGdkXEvent = ^TGdkXEvent;
  7. TGdkXEvent = procedure;
  8. { Can be cast to window system specific
  9. even type, XEvent on X11, MSG on Win32.
  10. }
  11. { Event not handled, continue processesing }
  12. { Translated event stored }
  13. { Terminate processing, removing event }
  14. PGdkFilterReturn = ^TGdkFilterReturn;
  15. TGdkFilterReturn = (
  16. GDK_FILTER_CONTINUE,
  17. GDK_FILTER_TRANSLATE,
  18. GDK_FILTER_REMOVE
  19. );
  20. TGdkFilterFunc = function (xevent:PGdkXEvent; event:PGdkEvent;
  21. data:gpointer):TGdkFilterReturn; cdecl;
  22. { Event types.
  23. Nothing: No event occurred.
  24. Delete: A window delete event was sent by the window manager.
  25. The specified window should be deleted.
  26. Destroy: A window has been destroyed.
  27. Expose: Part of a window has been uncovered.
  28. NoExpose: Same as expose, but no expose event was generated.
  29. VisibilityNotify: A window has become fully/partially/not obscured.
  30. MotionNotify: The mouse has moved.
  31. ButtonPress: A mouse button was pressed.
  32. ButtonRelease: A mouse button was release.
  33. KeyPress: A key was pressed.
  34. KeyRelease: A key was released.
  35. EnterNotify: A window was entered.
  36. LeaveNotify: A window was exited.
  37. FocusChange: The focus window has changed. (The focus window gets
  38. keyboard events).
  39. Resize: A window has been resized.
  40. Map: A window has been mapped. (It is now visible on the screen).
  41. Unmap: A window has been unmapped. (It is no longer visible on
  42. the screen).
  43. Scroll: A mouse wheel was scrolled either up or down.
  44. }
  45. PGdkEventType = ^TGdkEventType;
  46. TGdkEventType = gint;
  47. { Event masks. (Used to select what types of events a window
  48. will receive).
  49. }
  50. PGdkEventMask = ^TGdkEventMask;
  51. TGdkEventMask = gint32;
  52. PGdkVisibilityState = ^TGdkVisibilityState;
  53. TGdkVisibilityState = (
  54. GDK_VISIBILITY_UNOBSCURED,
  55. GDK_VISIBILITY_PARTIAL,
  56. GDK_VISIBILITY_FULLY_OBSCURED
  57. );
  58. PGdkScrollDirection = ^TGdkScrollDirection;
  59. TGdkScrollDirection = (
  60. GDK_SCROLL_UP,
  61. GDK_SCROLL_DOWN,
  62. GDK_SCROLL_LEFT,
  63. GDK_SCROLL_RIGHT
  64. );
  65. { Types of enter/leave notifications.
  66. Ancestor:
  67. Virtual:
  68. Inferior:
  69. Nonlinear:
  70. NonlinearVirtual:
  71. Unknown: An unknown type of enter/leave event occurred.
  72. }
  73. PGdkNotifyType = ^TGdkNotifyType;
  74. TGdkNotifyType = integer; // see below for possible values
  75. { Enter/leave event modes.
  76. NotifyNormal
  77. NotifyGrab
  78. NotifyUngrab
  79. }
  80. PGdkCrossingMode = ^TGdkCrossingMode;
  81. TGdkCrossingMode = (
  82. GDK_CROSSING_NORMAL,
  83. GDK_CROSSING_GRAB,
  84. GDK_CROSSING_UNGRAB
  85. );
  86. PGdkPropertyState = ^TGdkPropertyState;
  87. TGdkPropertyState = (
  88. GDK_PROPERTY_NEW_VALUE,
  89. GDK_PROPERTY_STATE_DELETE // was GDK_PROPERTY_DELETE, but there is also a function
  90. );
  91. PGdkWindowState = ^TGdkWindowState;
  92. TGdkWindowState = gint;
  93. PGdkSettingAction = ^TGdkSettingAction;
  94. TGdkSettingAction = (
  95. GDK_SETTING_ACTION_NEW,
  96. GDK_SETTING_ACTION_CHANGED,
  97. GDK_SETTING_ACTION_DELETED
  98. );
  99. PGdkEventAny = ^TGdkEventAny;
  100. TGdkEventAny = record
  101. _type : TGdkEventType;
  102. window : PGdkWindow;
  103. send_event : gint8;
  104. end;
  105. { If non-zero, how many more events follow. }
  106. PGdkEventExpose = ^TGdkEventExpose;
  107. TGdkEventExpose = record
  108. _type : TGdkEventType;
  109. window : PGdkWindow;
  110. send_event : gint8;
  111. area : TGdkRectangle;
  112. region : PGdkRegion;
  113. count : gint;
  114. end;
  115. { XXX: does anyone need the X major_code or minor_code fields? }
  116. PGdkEventNoExpose = ^TGdkEventNoExpose;
  117. TGdkEventNoExpose = record
  118. _type : TGdkEventType;
  119. window : PGdkWindow;
  120. send_event : gint8;
  121. end;
  122. PGdkEventVisibility = ^TGdkEventVisibility;
  123. TGdkEventVisibility = record
  124. _type : TGdkEventType;
  125. window : PGdkWindow;
  126. send_event : gint8;
  127. state : TGdkVisibilityState;
  128. end;
  129. PGdkEventMotion = ^TGdkEventMotion;
  130. TGdkEventMotion = record
  131. _type : TGdkEventType;
  132. window : PGdkWindow;
  133. send_event : gint8;
  134. time : guint32;
  135. x : gdouble;
  136. y : gdouble;
  137. axes : Pgdouble;
  138. state : guint;
  139. is_hint : gint16;
  140. device : PGdkDevice;
  141. x_root : gdouble;
  142. y_root : gdouble;
  143. end;
  144. PGdkEventButton = ^TGdkEventButton;
  145. TGdkEventButton = record
  146. _type : TGdkEventType;
  147. window : PGdkWindow;
  148. send_event : gint8;
  149. time : guint32;
  150. x : gdouble;
  151. y : gdouble;
  152. axes : Pgdouble;
  153. state : guint;
  154. button : guint;
  155. device : PGdkDevice;
  156. x_root : gdouble;
  157. y_root : gdouble;
  158. end;
  159. PGdkEventScroll = ^TGdkEventScroll;
  160. TGdkEventScroll = record
  161. _type : TGdkEventType;
  162. window : PGdkWindow;
  163. send_event : gint8;
  164. time : guint32;
  165. x : gdouble;
  166. y : gdouble;
  167. state : guint;
  168. direction : TGdkScrollDirection;
  169. device : PGdkDevice;
  170. x_root : gdouble;
  171. y_root : gdouble;
  172. end;
  173. PGdkEventKey = ^TGdkEventKey;
  174. TGdkEventKey = record
  175. _type : TGdkEventType;
  176. window : PGdkWindow;
  177. send_event : gint8;
  178. time : guint32;
  179. state : guint;
  180. keyval : guint;
  181. length : gint;
  182. _string : Pgchar;
  183. hardware_keycode : guint16;
  184. group : guint8;
  185. end;
  186. PGdkEventCrossing = ^TGdkEventCrossing;
  187. TGdkEventCrossing = record
  188. _type : TGdkEventType;
  189. window : PGdkWindow;
  190. send_event : gint8;
  191. subwindow : PGdkWindow;
  192. time : guint32;
  193. x : gdouble;
  194. y : gdouble;
  195. x_root : gdouble;
  196. y_root : gdouble;
  197. mode : TGdkCrossingMode;
  198. detail : TGdkNotifyType;
  199. focus : gboolean;
  200. state : guint;
  201. end;
  202. PGdkEventFocus = ^TGdkEventFocus;
  203. TGdkEventFocus = record
  204. _type : TGdkEventType;
  205. window : PGdkWindow;
  206. send_event : gint8;
  207. _in : gint16;
  208. end;
  209. PGdkEventConfigure = ^TGdkEventConfigure;
  210. TGdkEventConfigure = record
  211. _type : TGdkEventType;
  212. window : PGdkWindow;
  213. send_event : gint8;
  214. x : gint;
  215. y : gint;
  216. width : gint;
  217. height : gint;
  218. end;
  219. PGdkEventProperty = ^TGdkEventProperty;
  220. TGdkEventProperty = record
  221. _type : TGdkEventType;
  222. window : PGdkWindow;
  223. send_event : gint8;
  224. atom : TGdkAtom;
  225. time : guint32;
  226. state : guint;
  227. end;
  228. PGdkEventSelection = ^TGdkEventSelection;
  229. TGdkEventSelection = record
  230. _type : TGdkEventType;
  231. window : PGdkWindow;
  232. send_event : gint8;
  233. selection : TGdkAtom;
  234. target : TGdkAtom;
  235. _property : TGdkAtom;
  236. time : guint32;
  237. requestor : TGdkNativeWindow;
  238. end;
  239. { This event type will be used pretty rarely. It only is important
  240. for XInput aware programs that are drawing their own cursor }
  241. PGdkEventProximity = ^TGdkEventProximity;
  242. TGdkEventProximity = record
  243. _type : TGdkEventType;
  244. window : PGdkWindow;
  245. send_event : gint8;
  246. time : guint32;
  247. device : PGdkDevice;
  248. end;
  249. PmatDUMMY = ^TmatDUMMY;
  250. TmatDUMMY = record
  251. case longint of
  252. 0 : ( b : array[0..19] of char );
  253. 1 : ( s : array[0..9] of smallint );
  254. 2 : ( li : array[0..4] of longint );
  255. end;
  256. PGdkEventClient = ^TGdkEventClient;
  257. TGdkEventClient = record
  258. _type : TGdkEventType;
  259. window : PGdkWindow;
  260. send_event : gint8;
  261. message_type : TGdkAtom;
  262. data_format : gushort;
  263. data : record
  264. case longint of
  265. 0 : ( b : array[0..19] of char );
  266. 1 : ( s : array[0..9] of smallint );
  267. 2 : ( l : array[0..4] of longint );
  268. end;
  269. end;
  270. PGdkEventSetting = ^TGdkEventSetting;
  271. TGdkEventSetting = record
  272. _type : TGdkEventType;
  273. window : PGdkWindow;
  274. send_event : gint8;
  275. action : TGdkSettingAction;
  276. name : Pchar;
  277. end;
  278. PGdkEventWindowState = ^TGdkEventWindowState;
  279. TGdkEventWindowState = record
  280. _type : TGdkEventType;
  281. window : PGdkWindow;
  282. send_event : gint8;
  283. changed_mask : TGdkWindowState;
  284. new_window_state : TGdkWindowState;
  285. end;
  286. { Event types for DND }
  287. PGdkEventDND = ^TGdkEventDND;
  288. TGdkEventDND = record
  289. _type : TGdkEventType;
  290. window : PGdkWindow;
  291. send_event : gint8;
  292. context : PGdkDragContext;
  293. time : guint32;
  294. x_root : gshort;
  295. y_root : gshort;
  296. end;
  297. TGdkEvent = record
  298. case longint of
  299. 0 : ( _type : TGdkEventType );
  300. 1 : ( any : TGdkEventAny );
  301. 2 : ( expose : TGdkEventExpose );
  302. 3 : ( no_expose : TGdkEventNoExpose );
  303. 4 : ( visibility : TGdkEventVisibility );
  304. 5 : ( motion : TGdkEventMotion );
  305. 6 : ( button : TGdkEventButton );
  306. 7 : ( scroll : TGdkEventScroll );
  307. 8 : ( key : TGdkEventKey );
  308. 9 : ( crossing : TGdkEventCrossing );
  309. 10 : ( focus_change : TGdkEventFocus );
  310. 11 : ( configure : TGdkEventConfigure );
  311. 12 : ( _property : TGdkEventProperty );
  312. 13 : ( selection : TGdkEventSelection );
  313. 14 : ( proximity : TGdkEventProximity );
  314. 15 : ( client : TGdkEventClient );
  315. 16 : ( dnd : TGdkEventDND );
  316. 17 : ( window_state : TGdkEventWindowState );
  317. 18 : ( setting : TGdkEventSetting );
  318. end;
  319. {$ENDIF read_interface_types}
  320. //------------------------------------------------------------------------------
  321. {$IFDEF read_interface_rest}
  322. const
  323. GDK_NOTHING = -(1);
  324. GDK_DELETE = 0;
  325. GDK_DESTROY = 1;
  326. GDK_EXPOSE = 2;
  327. GDK_MOTION_NOTIFY = 3;
  328. GDK_BUTTON_PRESS = 4;
  329. GDK_2BUTTON_PRESS = 5;
  330. GDK_3BUTTON_PRESS = 6;
  331. GDK_BUTTON_RELEASE = 7;
  332. GDK_KEY_PRESS = 8;
  333. GDK_KEY_RELEASE = 9;
  334. GDK_ENTER_NOTIFY = 10;
  335. GDK_LEAVE_NOTIFY = 11;
  336. GDK_FOCUS_CHANGE = 12;
  337. GDK_CONFIGURE = 13;
  338. GDK_MAP = 14;
  339. GDK_UNMAP = 15;
  340. GDK_PROPERTY_NOTIFY = 16;
  341. GDK_SELECTION_CLEAR = 17;
  342. GDK_SELECTION_REQUEST = 18;
  343. GDK_SELECTION_NOTIFY = 19;
  344. GDK_PROXIMITY_IN = 20;
  345. GDK_PROXIMITY_OUT = 21;
  346. GDK_DRAG_ENTER = 22;
  347. GDK_DRAG_LEAVE = 23;
  348. GDK_DRAG_MOTION_EVENT = 24; // was GDK_DRAG_MOTION, which bites gdk_drag_motion
  349. GDK_DRAG_STATUS_EVENT = 25; // was GDK_DRAG_STATUS, which bites gdk_drag_status
  350. GDK_DROP_START = 26;
  351. GDK_DROP_FINISHED = 27;
  352. GDK_CLIENT_EVENT = 28;
  353. GDK_VISIBILITY_NOTIFY = 29;
  354. GDK_NO_EXPOSE = 30;
  355. GDK_SCROLL = 31;
  356. GDK_WINDOW_STATE = 32;
  357. GDK_SETTING = 33;
  358. // values for TGdkNotifyType
  359. GDK_NOTIFY_ANCESTOR = 0;
  360. GDK_NOTIFY_VIRTUAL = 1;
  361. GDK_NOTIFY_INFERIOR = 2;
  362. GDK_NOTIFY_NONLINEAR = 3;
  363. GDK_NOTIFY_NONLINEAR_VIRTUAL = 4;
  364. GDK_NOTIFY_UNKNOWN = 5;
  365. function GDK_TYPE_EVENT : GType;
  366. const
  367. GDK_PRIORITY_EVENTS = G_PRIORITY_DEFAULT;
  368. GDK_PRIORITY_REDRAW = G_PRIORITY_HIGH_IDLE + 20;
  369. GDK_EXPOSURE_MASK = 1 shl 1;
  370. GDK_POINTER_MOTION_MASK = 1 shl 2;
  371. GDK_POINTER_MOTION_HINT_MASK = 1 shl 3;
  372. GDK_BUTTON_MOTION_MASK = 1 shl 4;
  373. GDK_BUTTON1_MOTION_MASK = 1 shl 5;
  374. GDK_BUTTON2_MOTION_MASK = 1 shl 6;
  375. GDK_BUTTON3_MOTION_MASK = 1 shl 7;
  376. GDK_BUTTON_PRESS_MASK = 1 shl 8;
  377. GDK_BUTTON_RELEASE_MASK = 1 shl 9;
  378. GDK_KEY_PRESS_MASK = 1 shl 10;
  379. GDK_KEY_RELEASE_MASK = 1 shl 11;
  380. GDK_ENTER_NOTIFY_MASK = 1 shl 12;
  381. GDK_LEAVE_NOTIFY_MASK = 1 shl 13;
  382. GDK_FOCUS_CHANGE_MASK = 1 shl 14;
  383. GDK_STRUCTURE_MASK = 1 shl 15;
  384. GDK_PROPERTY_CHANGE_MASK = 1 shl 16;
  385. GDK_VISIBILITY_NOTIFY_MASK = 1 shl 17;
  386. GDK_PROXIMITY_IN_MASK = 1 shl 18;
  387. GDK_PROXIMITY_OUT_MASK = 1 shl 19;
  388. GDK_SUBSTRUCTURE_MASK = 1 shl 20;
  389. GDK_SCROLL_MASK = 1 shl 21;
  390. GDK_ALL_EVENTS_MASK = $3FFFFE;
  391. GDK_WINDOW_STATE_WITHDRAWN = 1 shl 0;
  392. GDK_WINDOW_STATE_ICONIFIED = 1 shl 1;
  393. GDK_WINDOW_STATE_MAXIMIZED = 1 shl 2;
  394. GDK_WINDOW_STATE_STICKY = 1 shl 3;
  395. function gdk_event_get_type:GType; cdecl; external gdklib;
  396. function gdk_events_pending:gboolean; cdecl; external gdklib;
  397. function gdk_event_get:PGdkEvent; cdecl; external gdklib;
  398. function gdk_event_peek:PGdkEvent; cdecl; external gdklib;
  399. function gdk_event_get_graphics_expose(window:PGdkWindow):PGdkEvent; cdecl; external gdklib;
  400. procedure gdk_event_put(event:PGdkEvent); cdecl; external gdklib;
  401. function gdk_event_copy(event:PGdkEvent):PGdkEvent; cdecl; external gdklib;
  402. procedure gdk_event_free(event:PGdkEvent); cdecl; external gdklib;
  403. function gdk_event_get_time(event:PGdkEvent):guint32; cdecl; external gdklib;
  404. function gdk_event_get_state(event:PGdkEvent; state:PGdkModifierType):gboolean; cdecl; external gdklib;
  405. function gdk_event_get_coords(event:PGdkEvent; x_win:Pgdouble; y_win:Pgdouble):gboolean; cdecl; external gdklib;
  406. function gdk_event_get_root_coords(event:PGdkEvent; x_root:Pgdouble; y_root:Pgdouble):gboolean; cdecl; external gdklib;
  407. function gdk_event_get_axis(event:PGdkEvent; axis_use:TGdkAxisUse; value:Pgdouble):gboolean; cdecl; external gdklib;
  408. procedure gdk_event_handler_set(func:TGdkEventFunc; data:gpointer; notify:TGDestroyNotify); cdecl; external gdklib;
  409. procedure gdk_set_show_events(show_events:gboolean); cdecl; external gdklib;
  410. function gdk_get_show_events:gboolean; cdecl; external gdklib;
  411. {$ifndef GDK_MULTIHEAD_SAFE}
  412. procedure gdk_add_client_message_filter(message_type:TGdkAtom; func:TGdkFilterFunc; data:gpointer); cdecl; external gdklib;
  413. function gdk_setting_get(name:Pgchar; var value:TGValue):gboolean; cdecl; external gdklib;
  414. {$endif}
  415. { GDK_MULTIHEAD_SAFE }
  416. {$endif read_interface_rest}
  417. //------------------------------------------------------------------------------
  418. {$IFDEF read_implementation}
  419. function GDK_TYPE_EVENT : GType;
  420. begin
  421. GDK_TYPE_EVENT:=gdk_event_get_type;
  422. end;
  423. {$ENDIF}