xinput2.pp 19 KB

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