xinput2.pp 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. (*
  2. * Copyright © 2009 Red Hat, Inc.
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice (including the next
  12. * paragraph) shall be included in all copies or substantial portions of the
  13. * Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21. * DEALINGS IN THE SOFTWARE.
  22. *
  23. *)
  24. {$IFNDEF FPC_DOTTEDUNITS}
  25. unit xinput2;
  26. {$ENDIF FPC_DOTTEDUNITS}
  27. interface
  28. {$PACKRECORDS C}
  29. { Definitions used by the library and client }
  30. {$IFDEF FPC_DOTTEDUNITS}
  31. uses
  32. System.CTypes, Api.X11.X, Api.X11.Xlib, Api.X11.Xi2, Api.X11.Xge, Api.X11.Xfixes;
  33. {$ELSE FPC_DOTTEDUNITS}
  34. uses
  35. ctypes, X, Xlib, XI2, Xge, Xfixes;
  36. {$ENDIF FPC_DOTTEDUNITS}
  37. const
  38. libXi = 'Xi';
  39. type
  40. (*******************************************************************
  41. *
  42. *)
  43. PXIAddMasterInfo = ^TXIAddMasterInfo;
  44. TXIAddMasterInfo = record
  45. _type: cint;
  46. name: PAnsiChar;
  47. send_core: TBool;
  48. enable: TBool;
  49. end;
  50. PXIRemoveMasterInfo = ^TXIRemoveMasterInfo;
  51. TXIRemoveMasterInfo = record
  52. _type: cint;
  53. deviceid: cint;
  54. return_mode: cint; { AttachToMaster, Floating }
  55. return_pointer: cint;
  56. return_keyboard: cint;
  57. end;
  58. PXIAttachSlaveInfo = ^TXIAttachSlaveInfo;
  59. TXIAttachSlaveInfo = record
  60. _type: cint;
  61. deviceid: cint;
  62. new_master: cint;
  63. end;
  64. PXIDetachSlaveInfo = ^TXIDetachSlaveInfo;
  65. TXIDetachSlaveInfo = record
  66. _type: cint;
  67. deviceid: cint;
  68. end;
  69. PXIAnyHierarchyChangeInfo = ^TXIAnyHierarchyChangeInfo;
  70. TXIAnyHierarchyChangeInfo = record
  71. case Integer of
  72. 0: (_type: cint); { must be first element }
  73. 1: (add: TXIAddMasterInfo);
  74. 2: (remove: TXIRemoveMasterInfo);
  75. 3: (attach: TXIAttachSlaveInfo);
  76. 4: (detach: TXIDetachSlaveInfo);
  77. end;
  78. PXIModifierState = ^TXIModifierState;
  79. TXIModifierState = record
  80. base: cint;
  81. latched: cint;
  82. locked: cint;
  83. effective: cint;
  84. end;
  85. PXIGroupState = ^TXIGroupState;
  86. TXIGroupState = TXIModifierState;
  87. PXIButtonState = ^TXIButtonState;
  88. TXIButtonState = record
  89. mask_len: cint;
  90. mask: Pcuchar;
  91. end;
  92. PXIValuatorState = ^TXIValuatorState;
  93. TXIValuatorState = record
  94. mask_len: cint;
  95. mask: Pcuchar;
  96. values: Pcdouble;
  97. end;
  98. PXIEventMask = ^TXIEventMask;
  99. TXIEventMask = record
  100. deviceid: cint;
  101. mask_len: cint;
  102. mask: Pcuchar;
  103. end;
  104. PPXIAnyClassInfo = ^PXIAnyClassInfo;
  105. PXIAnyClassInfo = ^TXIAnyClassInfo;
  106. TXIAnyClassInfo = record
  107. _type: cint;
  108. sourceid: cint;
  109. end;
  110. PXIButtonClassInfo = ^TXIButtonClassInfo;
  111. TXIButtonClassInfo = record
  112. _type: cint;
  113. sourceid: cint;
  114. num_buttons: cint;
  115. labels: PAtom;
  116. state: TXIButtonState;
  117. end;
  118. PXIKeyClassInfo = ^TXIKeyClassInfo;
  119. TXIKeyClassInfo = record
  120. _type: cint;
  121. sourceid: cint;
  122. num_keycodes: cint;
  123. keycodes: Pcint;
  124. end;
  125. PXIValuatorClassInfo = ^TXIValuatorClassInfo;
  126. TXIValuatorClassInfo = record
  127. _type: cint;
  128. sourceid: cint;
  129. number: cint;
  130. _label: TAtom;
  131. min: cdouble;
  132. max: cdouble;
  133. value: cdouble;
  134. resolution: cint;
  135. mode: cint;
  136. end;
  137. { new in XI 2.1 }
  138. PXIScrollClassInfo = ^TXIScrollClassInfo;
  139. TXIScrollClassInfo = record
  140. _type: cint;
  141. sourceid: cint;
  142. number: cint;
  143. scroll_type: cint;
  144. increment: cdouble;
  145. flags: cint;
  146. end;
  147. PXITouchClassInfo = ^TXITouchClassInfo;
  148. TXITouchClassInfo = record
  149. _type: cint;
  150. sourceid: cint;
  151. mode: cint;
  152. num_touches: cint;
  153. end;
  154. PXIDeviceInfo = ^TXIDeviceInfo;
  155. TXIDeviceInfo = record
  156. deviceid: cint;
  157. name: PAnsiChar;
  158. use: cint;
  159. attachment: cint;
  160. enabled: TBool;
  161. num_classes: cint;
  162. classes: PPXIAnyClassInfo;
  163. end;
  164. PXIGrabModifiers = ^TXIGrabModifiers;
  165. TXIGrabModifiers = record
  166. modifiers: cint;
  167. status: cint;
  168. end;
  169. PBarrierEventID = ^TBarrierEventID;
  170. TBarrierEventID = cuint;
  171. PXIBarrierReleasePointerInfo = ^TXIBarrierReleasePointerInfo;
  172. TXIBarrierReleasePointerInfo = record
  173. deviceid: cint;
  174. barrier: TPointerBarrier;
  175. eventid: TBarrierEventID;
  176. end;
  177. (**
  178. * Generic XI2 event. All XI2 events have the same header.
  179. *)
  180. PXIEvent = ^TXIEvent;
  181. TXIEvent = record
  182. _type: cint; { GenericEvent }
  183. serial: culong; { # of last request processed by server }
  184. send_event: TBool; { true if this came from a SendEvent request }
  185. display: PDisplay; { Display the event was read from }
  186. extension: cint; { XI extension offset }
  187. evtype: cint;
  188. time: TTime;
  189. end;
  190. PXIHierarchyInfo = ^TXIHierarchyInfo;
  191. TXIHierarchyInfo = record
  192. deviceid: cint;
  193. attachment: cint;
  194. use: cint;
  195. enabled: TBool;
  196. flags: cint;
  197. end;
  198. (*
  199. * Notifies the client that the device hierarchy has been changed. The client
  200. * is expected to re-query the server for the device hierarchy.
  201. *)
  202. PXIHierarchyEvent = ^TXIHierarchyEvent;
  203. TXIHierarchyEvent = record
  204. _type: cint; { GenericEvent }
  205. serial: culong; { # of last request processed by server }
  206. send_event: TBool; { true if this came from a SendEvent request }
  207. display: PDisplay; { Display the event was read from }
  208. extension: cint; { XI extension offset }
  209. evtype: cint; { XI_HierarchyChanged }
  210. time: TTime;
  211. flags: cint;
  212. num_info: cint;
  213. info: PXIHierarchyInfo;
  214. end;
  215. (*
  216. * Notifies the client that the classes have been changed. This happens when
  217. * the slave device that sends through the master changes.
  218. *)
  219. PXIDeviceChangedEvent = ^TXIDeviceChangedEvent;
  220. TXIDeviceChangedEvent = record
  221. _type: cint; { GenericEvent }
  222. serial: culong; { # of last request processed by server }
  223. send_event: TBool; { true if this came from a SendEvent request }
  224. display: PDisplay; { Display the event was read from }
  225. extension: cint; { XI extension offset }
  226. evtype: cint; { XI_DeviceChanged }
  227. time: TTime;
  228. deviceid: cint; { id of the device that changed }
  229. sourceid: cint; { Source for the new classes. }
  230. reason: cint; { Reason for the change }
  231. num_classes: cint;
  232. classes: PPXIAnyClassInfo; { same as in XIDeviceInfo }
  233. end;
  234. PXIDeviceEvent = ^TXIDeviceEvent;
  235. TXIDeviceEvent = record
  236. _type: cint; { GenericEvent }
  237. serial: culong; { # of last request processed by server }
  238. send_event: TBool; { true if this came from a SendEvent request }
  239. display: PDisplay; { Display the event was read from }
  240. extension: cint; { XI extension offset }
  241. evtype: cint;
  242. time: TTime;
  243. deviceid: cint;
  244. sourceid: cint;
  245. detail: cint;
  246. root: TWindow;
  247. event: TWindow;
  248. child: TWindow;
  249. root_x: cdouble;
  250. root_y: cdouble;
  251. event_x: cdouble;
  252. event_y: cdouble;
  253. flags: cint;
  254. buttons: TXIButtonState;
  255. valuators: TXIValuatorState;
  256. mods: TXIModifierState;
  257. group: TXIGroupState;
  258. end;
  259. PXIRawEvent = ^TXIRawEvent;
  260. TXIRawEvent = record
  261. _type: cint; { GenericEvent }
  262. serial: culong; { # of last request processed by server }
  263. send_event: TBool; { true if this came from a SendEvent request }
  264. display: PDisplay; { Display the event was read from }
  265. extension: cint; { XI extension offset }
  266. evtype: cint; { XI_RawKeyPress, XI_RawKeyRelease, etc. }
  267. time: TTime;
  268. deviceid: cint;
  269. sourceid: cint; { Bug: Always 0. https://bugs.freedesktop.org//show_bug.cgi?id=34240 }
  270. detail: cint;
  271. flags: cint;
  272. valuators: TXIValuatorState;
  273. raw_values: Pcdouble;
  274. end;
  275. PXIEnterEvent = ^TXIEnterEvent;
  276. TXIEnterEvent = record
  277. _type: cint; { GenericEvent }
  278. serial: culong; { # of last request processed by server }
  279. send_event: TBool; { true if this came from a SendEvent request }
  280. display: PDisplay; { Display the event was read from }
  281. extension: cint; { XI extension offset }
  282. evtype: cint;
  283. time: TTime;
  284. deviceid: cint;
  285. sourceid: cint;
  286. detail: cint;
  287. root: TWindow;
  288. event: TWindow;
  289. child: TWindow;
  290. root_x: cdouble;
  291. root_y: cdouble;
  292. event_x: cdouble;
  293. event_y: cdouble;
  294. mode: cint;
  295. focus: TBool;
  296. same_screen: TBool;
  297. buttons: TXIButtonState;
  298. mods: TXIModifierState;
  299. group: TXIGroupState;
  300. end;
  301. PXILeaveEvent = ^TXILeaveEvent;
  302. TXILeaveEvent = TXIEnterEvent;
  303. PXIFocusInEvent = ^TXIFocusInEvent;
  304. TXIFocusInEvent = TXIEnterEvent;
  305. PXIFocusOutEvent = ^TXIFocusOutEvent;
  306. TXIFocusOutEvent = TXIEnterEvent;
  307. PXIPropertyEvent = ^TXIPropertyEvent;
  308. TXIPropertyEvent = record
  309. _type: cint; { GenericEvent }
  310. serial: culong; { # of last request processed by server }
  311. send_event: TBool; { true if this came from a SendEvent request }
  312. display: PDisplay; { Display the event was read from }
  313. extension: cint; { XI extension offset }
  314. evtype: cint; { XI_PropertyEvent }
  315. time: TTime;
  316. deviceid: cint; { id of the device that changed }
  317. _property: TAtom;
  318. what: cint;
  319. end;
  320. PXITouchOwnershipEvent = ^TXITouchOwnershipEvent;
  321. TXITouchOwnershipEvent = record
  322. _type: cint; { GenericEvent }
  323. serial: culong; { # of last request processed by server }
  324. send_event: TBool; { true if this came from a SendEvent request }
  325. display: PDisplay; { Display the event was read from }
  326. extension: cint; { XI extension offset }
  327. evtype: cint;
  328. time: TTime;
  329. deviceid: cint;
  330. sourceid: cint;
  331. touchid: cuint;
  332. root: TWindow;
  333. event: TWindow;
  334. child: TWindow;
  335. flags: cint;
  336. end;
  337. PXIBarrierEvent = ^TXIBarrierEvent;
  338. TXIBarrierEvent = record
  339. _type: cint; { GenericEvent }
  340. serial: culong; { # of last request processed by server }
  341. send_event: TBool; { true if this came from a SendEvent request }
  342. display: PDisplay; { Display the event was read from }
  343. extension: cint; { XI extension offset }
  344. evtype: cint;
  345. time: TTime;
  346. deviceid: cint;
  347. sourceid: cint;
  348. event: TWindow;
  349. root: TWindow;
  350. root_x: cdouble;
  351. root_y: cdouble;
  352. dx: cdouble;
  353. dy: cdouble;
  354. dtime: cint;
  355. flags: cint;
  356. barrier: TPointerBarrier;
  357. eventid: TBarrierEventID;
  358. end;
  359. //_XFUNCPROTOBEGIN
  360. function XIQueryPointer(
  361. display: PDisplay;
  362. deviceid: cint;
  363. win: TWindow;
  364. root: PWindow;
  365. child: PWindow;
  366. root_x: Pcdouble;
  367. root_y: Pcdouble;
  368. win_x: Pcdouble;
  369. win_y: Pcdouble;
  370. buttons: PXIButtonState;
  371. mods: PXIModifierState;
  372. group: PXIGroupState
  373. ): TBoolResult; cdecl; external libXi;
  374. function XIWarpPointer(
  375. display: PDisplay;
  376. deviceid: cint;
  377. src_win: TWindow;
  378. dst_win: TWindow;
  379. src_x: cdouble;
  380. src_y: cdouble;
  381. src_width: cuint;
  382. src_height: cuint;
  383. dst_x: cdouble;
  384. dst_y: cdouble
  385. ): TBoolResult; cdecl; external libXi;
  386. function XIDefineCursor(
  387. display: PDisplay;
  388. deviceid: cint;
  389. win: TWindow;
  390. cursor: TCursor
  391. ): TStatus; cdecl; external libXi;
  392. function XIUndefineCursor(
  393. display: PDisplay;
  394. deviceid: cint;
  395. win: TWindow
  396. ): TStatus; cdecl; external libXi;
  397. function XIChangeHierarchy(
  398. display: PDisplay;
  399. changes: PXIAnyHierarchyChangeInfo;
  400. num_changes: cint
  401. ): TStatus; cdecl; external libXi;
  402. function XISetClientPointer(
  403. dpy: PDisplay;
  404. win: TWindow;
  405. deviceid: cint
  406. ): TStatus; cdecl; external libXi;
  407. function XIGetClientPointer(
  408. dpy: PDisplay;
  409. win: TWindow;
  410. deviceid: Pcint
  411. ): TBoolResult; cdecl; external libXi;
  412. function XISelectEvents(
  413. dpy: PDisplay;
  414. win: TWindow;
  415. masks: PXIEventMask;
  416. num_masks: cint
  417. ): cint; cdecl; external libXi;
  418. function XIGetSelectedEvents(
  419. dpy: PDisplay;
  420. win: TWindow;
  421. num_masks_return: Pcint
  422. ): PXIEventMask; cdecl; external libXi;
  423. function XIQueryVersion(
  424. dpy: PDisplay;
  425. major_version_inout: Pcint;
  426. minor_version_inout: Pcint
  427. ): TStatus; cdecl; external libXi;
  428. function XIQueryDevice(
  429. dpy: PDisplay;
  430. deviceid: cint;
  431. ndevices_return: Pcint
  432. ): PXIDeviceInfo; cdecl; external libXi;
  433. function XISetFocus(
  434. dpy: PDisplay;
  435. deviceid: cint;
  436. focus: TWindow;
  437. time: TTime
  438. ): TStatus; cdecl; external libXi;
  439. function XIGetFocus(
  440. dpy: PDisplay;
  441. deviceid: cint;
  442. focus_return: PWindow): TStatus; cdecl; external libXi;
  443. function XIGrabDevice(
  444. dpy: PDisplay;
  445. deviceid: cint;
  446. grab_window: TWindow;
  447. time: TTime;
  448. cursor: TCursor;
  449. grab_mode: cint;
  450. paired_device_mode: cint;
  451. owner_events: TBool;
  452. mask: PXIEventMask
  453. ): TStatus; cdecl; external libXi;
  454. { boolean overload for the TBool parameter }
  455. function XIGrabDevice(
  456. dpy: PDisplay;
  457. deviceid: cint;
  458. grab_window: TWindow;
  459. time: TTime;
  460. cursor: TCursor;
  461. grab_mode: cint;
  462. paired_device_mode: cint;
  463. owner_events: Boolean;
  464. mask: PXIEventMask
  465. ): TStatus; inline;
  466. function XIUngrabDevice(
  467. dpy: PDisplay;
  468. deviceid: cint;
  469. time: TTime
  470. ): TStatus; cdecl; external libXi;
  471. function XIAllowEvents(
  472. display: PDisplay;
  473. deviceid: cint;
  474. event_mode: cint;
  475. time: TTime
  476. ): TStatus; cdecl; external libXi;
  477. function XIAllowTouchEvents(
  478. display: PDisplay;
  479. deviceid: cint;
  480. touchid: cuint;
  481. grab_window: TWindow;
  482. event_mode: cint
  483. ): TStatus; cdecl; external libXi;
  484. function XIGrabButton(
  485. display: PDisplay;
  486. deviceid: cint;
  487. button: cint;
  488. grab_window: TWindow;
  489. cursor: TCursor;
  490. grab_mode: cint;
  491. paired_device_mode: cint;
  492. owner_events: cint;
  493. mask: PXIEventMask;
  494. num_modifiers: cint;
  495. modifiers_inout: PXIGrabModifiers
  496. ): cint; cdecl; external libXi;
  497. function XIGrabKeycode(
  498. display: PDisplay;
  499. deviceid: cint;
  500. keycode: cint;
  501. grab_window: TWindow;
  502. grab_mode: cint;
  503. paired_device_mode: cint;
  504. owner_events: cint;
  505. mask: PXIEventMask;
  506. num_modifiers: cint;
  507. modifiers_inout: PXIGrabModifiers
  508. ): cint; cdecl; external libXi;
  509. function XIGrabEnter(
  510. display: PDisplay;
  511. deviceid: cint;
  512. grab_window: TWindow;
  513. cursor: TCursor;
  514. grab_mode: cint;
  515. paired_device_mode: cint;
  516. owner_events: cint;
  517. mask: PXIEventMask;
  518. num_modifiers: cint;
  519. modifiers_inout: PXIGrabModifiers
  520. ): cint; cdecl; external libXi;
  521. function XIGrabFocusIn(
  522. display: PDisplay;
  523. deviceid: cint;
  524. grab_window: TWindow;
  525. grab_mode: cint;
  526. paired_device_mode: cint;
  527. owner_events: cint;
  528. mask: PXIEventMask;
  529. num_modifiers: cint;
  530. modifiers_inout: PXIGrabModifiers
  531. ): cint; cdecl; external libXi;
  532. function XIGrabTouchBegin(
  533. display: PDisplay;
  534. deviceid: cint;
  535. grab_window: TWindow;
  536. owner_events: cint;
  537. mask: PXIEventMask;
  538. num_modifiers: cint;
  539. modifiers_inout: PXIGrabModifiers
  540. ): cint; cdecl; external libXi;
  541. function XIUngrabButton(
  542. display: PDisplay;
  543. deviceid: cint;
  544. button: cint;
  545. grab_window: TWindow;
  546. num_modifiers: cint;
  547. modifiers: PXIGrabModifiers
  548. ): TStatus; cdecl; external libXi;
  549. function XIUngrabKeycode(
  550. display: PDisplay;
  551. deviceid: cint;
  552. keycode: cint;
  553. grab_window: TWindow;
  554. num_modifiers: cint;
  555. modifiers: PXIGrabModifiers
  556. ): TStatus; cdecl; external libXi;
  557. function XIUngrabEnter(
  558. display: PDisplay;
  559. deviceid: cint;
  560. grab_window: TWindow;
  561. num_modifiers: cint;
  562. modifiers: PXIGrabModifiers
  563. ): TStatus; cdecl; external libXi;
  564. function XIUngrabFocusIn(
  565. display: PDisplay;
  566. deviceid: cint;
  567. grab_window: TWindow;
  568. num_modifiers: cint;
  569. modifiers: PXIGrabModifiers
  570. ): TStatus; cdecl; external libXi;
  571. function XIUngrabTouchBegin(
  572. display: PDisplay;
  573. deviceid: cint;
  574. grab_window: TWindow;
  575. num_modifiers: cint;
  576. modifiers: PXIGrabModifiers
  577. ): TStatus; cdecl; external libXi;
  578. function XIListProperties(
  579. display: PDisplay;
  580. deviceid: cint;
  581. num_props_return: Pcint
  582. ): PAtom; cdecl; external libXi;
  583. procedure XIChangeProperty(
  584. display: PDisplay;
  585. deviceid: cint;
  586. _property: TAtom;
  587. _type: TAtom;
  588. format: cint;
  589. mode: cint;
  590. data: Pcuchar;
  591. num_items: cint
  592. ); cdecl; external libXi;
  593. procedure XIDeleteProperty(
  594. display: PDisplay;
  595. deviceid: cint;
  596. _property: TAtom
  597. ); cdecl; external libXi;
  598. function XIGetProperty(
  599. display: PDisplay;
  600. deviceid: cint;
  601. _property: TAtom;
  602. offset: clong;
  603. length: clong;
  604. delete_property: TBool;
  605. _type: TAtom;
  606. type_return: PAtom;
  607. format_return: Pcint;
  608. num_items_return: Pculong;
  609. bytes_after_return: Pculong;
  610. data: PPcuchar
  611. ): TStatus; cdecl; external libXi;
  612. { boolean overload for the TBool parameter }
  613. function XIGetProperty(
  614. display: PDisplay;
  615. deviceid: cint;
  616. _property: TAtom;
  617. offset: clong;
  618. length: clong;
  619. delete_property: Boolean;
  620. _type: TAtom;
  621. type_return: PAtom;
  622. format_return: Pcint;
  623. num_items_return: Pculong;
  624. bytes_after_return: Pculong;
  625. data: PPcuchar
  626. ): TStatus; inline;
  627. procedure XIBarrierReleasePointers(
  628. display: PDisplay;
  629. barriers: PXIBarrierReleasePointerInfo;
  630. num_barriers: cint
  631. ); cdecl; external libXi;
  632. procedure XIBarrierReleasePointer(
  633. display: PDisplay;
  634. deviceid: cint;
  635. barrier: TPointerBarrier;
  636. eventid: TBarrierEventID
  637. ); cdecl; external libXi;
  638. procedure XIFreeDeviceInfo(info: PXIDeviceInfo); cdecl; external libXi;
  639. //_XFUNCPROTOEND
  640. implementation
  641. function XIGrabDevice(dpy: PDisplay; deviceid: cint; grab_window: TWindow;
  642. time: TTime; cursor: TCursor; grab_mode: cint; paired_device_mode: cint;
  643. owner_events: Boolean; mask: PXIEventMask): TStatus; inline;
  644. begin
  645. XIGrabDevice := XIGrabDevice(dpy, deviceid, grab_window, time, cursor, grab_mode, paired_device_mode, Ord(owner_events), mask);
  646. end;
  647. function XIGetProperty(display: PDisplay; deviceid: cint; _property: TAtom;
  648. offset: clong; length: clong; delete_property: Boolean; _type: TAtom;
  649. type_return: PAtom; format_return: Pcint; num_items_return: Pculong;
  650. bytes_after_return: Pculong; data: PPcuchar): TStatus;
  651. begin
  652. XIGetProperty := XIGetProperty(display, deviceid, _property, offset, length, Ord(delete_property), _type, type_return, format_return,
  653. num_items_return, bytes_after_return, data);
  654. end;
  655. end.