xi.pp 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. {
  2. $Xorg: XI.h,v 1.4 2001/02/09 02:03:23 xorgcvs Exp $
  3. ************************************************************
  4. Copyright 1989, 1998 The Open Group
  5. Permission to use, copy, modify, distribute, and sell this software and its
  6. documentation for any purpose is hereby granted without fee, provided that
  7. the above copyright notice appear in all copies and that both that
  8. copyright notice and this permission notice appear in supporting
  9. documentation.
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  16. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  17. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  18. Except as contained in this notice, the name of The Open Group shall not be
  19. used in advertising or otherwise to promote the sale, use or other dealings
  20. in this Software without prior written authorization from The Open Group.
  21. Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
  22. All Rights Reserved
  23. Permission to use, copy, modify, and distribute this software and its
  24. documentation for any purpose and without fee is hereby granted,
  25. provided that the above copyright notice appear in all copies and that
  26. both that copyright notice and this permission notice appear in
  27. supporting documentation, and that the name of Hewlett-Packard not be
  28. used in advertising or publicity pertaining to distribution of the
  29. software without specific, written prior permission.
  30. HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  31. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  32. HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  33. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  34. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  35. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  36. SOFTWARE.
  37. ********************************************************/
  38. $XFree86: xc/include/extensions/XI.h,v 1.5 2001/12/14 19:53:28 dawes Exp $
  39. Definitions used by the server, library and client
  40. Pascal Convertion was made by Ido Kannner - [email protected]
  41. Histroy:
  42. 2004/10/15 - Fixed a bug of accessing second based records by removing "paced record" and chnaged it to
  43. "reocrd" only.
  44. 2004/10/07 - Removed the "uses X;" line. The unit does not need it.
  45. 2004/10/03 - Conversion from C header to Pascal unit.
  46. }
  47. {$PACKRECORDS C} {$MACRO ON} {$DEFINE MACROS}
  48. {$MODE OBJFPC}
  49. unit xi;
  50. interface
  51. uses
  52. ctypes;
  53. const
  54. sz_xGetExtensionVersionReq = 8;
  55. sz_xGetExtensionVersionReply = 32;
  56. sz_xListInputDevicesReq = 4;
  57. sz_xListInputDevicesReply = 32;
  58. sz_xOpenDeviceReq = 8;
  59. sz_xOpenDeviceReply = 32;
  60. sz_xCloseDeviceReq = 8;
  61. sz_xSetDeviceModeReq = 8;
  62. sz_xSetDeviceModeReply = 32;
  63. sz_xSelectExtensionEventReq = 12;
  64. sz_xGetSelectedExtensionEventsReq = 8;
  65. sz_xGetSelectedExtensionEventsReply = 32;
  66. sz_xChangeDeviceDontPropagateListReq = 12;
  67. sz_xGetDeviceDontPropagateListReq = 8;
  68. sz_xGetDeviceDontPropagateListReply = 32;
  69. sz_xGetDeviceMotionEventsReq = 16;
  70. sz_xGetDeviceMotionEventsReply = 32;
  71. sz_xChangeKeyboardDeviceReq = 8;
  72. sz_xChangeKeyboardDeviceReply = 32;
  73. sz_xChangePointerDeviceReq = 8;
  74. sz_xChangePointerDeviceReply = 32;
  75. sz_xGrabDeviceReq = 20;
  76. sz_xGrabDeviceReply = 32;
  77. sz_xUngrabDeviceReq = 12;
  78. sz_xGrabDeviceKeyReq = 20;
  79. sz_xGrabDeviceKeyReply = 32;
  80. sz_xUngrabDeviceKeyReq = 16;
  81. sz_xGrabDeviceButtonReq = 20;
  82. sz_xGrabDeviceButtonReply = 32;
  83. sz_xUngrabDeviceButtonReq = 16;
  84. sz_xAllowDeviceEventsReq = 12;
  85. sz_xGetDeviceFocusReq = 8;
  86. sz_xGetDeviceFocusReply = 32;
  87. sz_xSetDeviceFocusReq = 16;
  88. sz_xGetFeedbackControlReq = 8;
  89. sz_xGetFeedbackControlReply = 32;
  90. sz_xChangeFeedbackControlReq = 12;
  91. sz_xGetDeviceKeyMappingReq = 8;
  92. sz_xGetDeviceKeyMappingReply = 32;
  93. sz_xChangeDeviceKeyMappingReq = 8;
  94. sz_xGetDeviceModifierMappingReq = 8;
  95. sz_xSetDeviceModifierMappingReq = 8;
  96. sz_xSetDeviceModifierMappingReply = 32;
  97. sz_xGetDeviceButtonMappingReq = 8;
  98. sz_xGetDeviceButtonMappingReply = 32;
  99. sz_xSetDeviceButtonMappingReq = 8;
  100. sz_xSetDeviceButtonMappingReply = 32;
  101. sz_xQueryDeviceStateReq = 8;
  102. sz_xQueryDeviceStateReply = 32;
  103. sz_xSendExtensionEventReq = 16;
  104. sz_xDeviceBellReq = 8;
  105. sz_xSetDeviceValuatorsReq = 8;
  106. sz_xSetDeviceValuatorsReply = 32;
  107. sz_xGetDeviceControlReq = 8;
  108. sz_xGetDeviceControlReply = 32;
  109. sz_xChangeDeviceControlReq = 8;
  110. sz_xChangeDeviceControlReply = 32;
  111. sz_xListDevicePropertiesReq = 8;
  112. sz_xListDevicePropertiesReply = 32;
  113. sz_xChangeDevicePropertyReq = 20;
  114. sz_xDeleteDevicePropertyReq = 12;
  115. sz_xGetDevicePropertyReq = 24;
  116. sz_xGetDevicePropertyReply = 32;
  117. const
  118. INAME = 'XInputExtension';
  119. const
  120. XI_KEYBOARD = 'KEYBOARD';
  121. XI_MOUSE = 'MOUSE';
  122. XI_TABLET = 'TABLET';
  123. XI_TOUCHSCREEN = 'TOUCHSCREEN';
  124. XI_TOUCHPAD = 'TOUCHPAD';
  125. XI_BARCODE = 'BARCODE';
  126. XI_BUTTONBOX = 'BUTTONBOX';
  127. XI_KNOB_BOX = 'KNOB_BOX';
  128. XI_ONE_KNOB = 'ONE_KNOB';
  129. XI_NINE_KNOB = 'NINE_KNOB';
  130. XI_TRACKBALL = 'TRACKBALL';
  131. XI_QUADRATURE = 'QUADRATURE';
  132. XI_ID_MODULE = 'ID_MODULE';
  133. XI_SPACEBALL = 'SPACEBALL';
  134. XI_DATAGLOVE = 'DATAGLOVE';
  135. XI_EYETRACKER = 'EYETRACKER';
  136. XI_CURSORKEYS = 'CURSORKEYS';
  137. XI_FOOTMOUSE = 'FOOTMOUSE';
  138. XI_JOYSTICK = 'JOYSTICK';
  139. const
  140. Dont_Check = 0;
  141. XInput_Initial_Release = 1;
  142. XInput_Add_XDeviceBell = 2;
  143. XInput_Add_XSetDeviceValuators = 3;
  144. XInput_Add_XChangeDeviceControl = 4;
  145. XInput_Add_DevicePresenceNotify = 5;
  146. XInput_Add_DeviceProperties = 6;
  147. const
  148. XI_Absent = 0;
  149. XI_Present = 1;
  150. const
  151. XI_Initial_Release_Major = 1;
  152. XI_Initial_Release_Minor = 0;
  153. const
  154. XI_Add_XDeviceBell_Major = 1;
  155. XI_Add_XDeviceBell_Minor = 1;
  156. const
  157. XI_Add_XSetDeviceValuators_Major = 1;
  158. XI_Add_XSetDeviceValuators_Minor = 2;
  159. const
  160. XI_Add_XChangeDeviceControl_Major = 1;
  161. XI_Add_XChangeDeviceControl_Minor = 3;
  162. const
  163. XI_Add_DevicePresenceNotify_Major = 1;
  164. XI_Add_DevicePresenceNotify_Minor = 4;
  165. const
  166. XI_Add_DeviceProperties_Major = 1;
  167. XI_Add_DeviceProperties_Minor = 5;
  168. const
  169. DEVICE_RESOLUTION = 1;
  170. DEVICE_ABS_CALIB = 2;
  171. DEVICE_CORE = 3;
  172. DEVICE_ENABLE = 4;
  173. DEVICE_ABS_AREA = 5;
  174. const
  175. NoSuchExtension = 1;
  176. const
  177. COUNT = 0;
  178. CREATE = 1;
  179. const
  180. NewPointer = 0;
  181. NewKeyboard = 1;
  182. const
  183. XPOINTER = 0;
  184. XKEYBOARD = 1;
  185. const
  186. UseXKeyboard = $FF;
  187. const
  188. IsXPointer = 0;
  189. IsXKeyboard = 1;
  190. IsXExtensionDevice = 2;
  191. IsXExtensionKeyboard = 3;
  192. IsXExtensionPointer = 4;
  193. const
  194. AsyncThisDevice = 0;
  195. SyncThisDevice = 1;
  196. ReplayThisDevice = 2;
  197. AsyncOtherDevices = 3;
  198. AsyncAll = 4;
  199. SyncAll = 5;
  200. const
  201. FollowKeyboard = 3;
  202. {$ifndef RevertToFollowKeyboard}
  203. {$IFDEF MACROS}
  204. {$define RevertToFollowKeyboard := 3}
  205. {$ELSE}
  206. RevertToFollowKeyboard = 3;
  207. {$ENDIF}
  208. {$ENDIF}
  209. const
  210. DvAccelNum = Cardinal(1) shl 0;
  211. DvAccelDenom = Cardinal(1) shl 1;
  212. DvThreshold = Cardinal(1) shl 2;
  213. const
  214. DvKeyClickPercent = Cardinal(1) shl 0;
  215. DvPercent = Cardinal(1) shl 1;
  216. DvPitch = Cardinal(1) shl 2;
  217. DvDuration = Cardinal(1) shl 3;
  218. DvLed = Cardinal(1) shl 4;
  219. DvLedMode = Cardinal(1) shl 5;
  220. DvKey = Cardinal(1) shl 6;
  221. DvAutoRepeatMode = Cardinal(1) shl 7;
  222. const
  223. DvString = Cardinal(1) shl 0;
  224. const
  225. DvInteger = Cardinal(1) shl 0;
  226. const
  227. DeviceMode = Cardinal(1) shl 0;
  228. Relative = 0;
  229. Absolute = 1;
  230. { Merged from Metrolink tree for XINPUT stuff }
  231. TS_Raw = 57;
  232. TS_Scaled = 58;
  233. SendCoreEvents = 59;
  234. DontSendCoreEvents = 60;
  235. { End of merged section }
  236. const
  237. ProximityState = Cardinal(1) shl 1;
  238. InProximity = Cardinal(0) shl 1;
  239. OutOfProximity = Cardinal(1) shl 1;
  240. const
  241. AddToList = 0;
  242. DeleteFromList = 1;
  243. const
  244. KeyClass = 0;
  245. ButtonClass = 1;
  246. ValuatorClass = 2;
  247. FeedbackClass = 3;
  248. ProximityClass = 4;
  249. FocusClass = 5;
  250. OtherClass = 6;
  251. AttachClass = 7;
  252. const
  253. KbdFeedbackClass = 0;
  254. PtrFeedbackClass = 1;
  255. StringFeedbackClass = 2;
  256. IntegerFeedbackClass = 3;
  257. LedFeedbackClass = 4;
  258. BellFeedbackClass = 5;
  259. const
  260. _devicePointerMotionHint = 0;
  261. _deviceButton1Motion = 1;
  262. _deviceButton2Motion = 2;
  263. _deviceButton3Motion = 3;
  264. _deviceButton4Motion = 4;
  265. _deviceButton5Motion = 5;
  266. _deviceButtonMotion = 6;
  267. _deviceButtonGrab = 7;
  268. _deviceOwnerGrabButton = 8;
  269. _noExtensionEvent = 9;
  270. const
  271. _devicePresence = 0;
  272. const
  273. _deviceEnter = 0;
  274. _deviceLeave = 1;
  275. const
  276. DeviceAdded = 0;
  277. DeviceRemoved = 1;
  278. DeviceEnabled = 2;
  279. DeviceDisabled = 3;
  280. DeviceUnrecoverable = 4;
  281. DeviceControlChanged = 5;
  282. const
  283. XI_BadDevice = 0;
  284. XI_BadEvent = 1;
  285. XI_BadMode = 2;
  286. XI_DeviceBusy = 3;
  287. XI_BadClass = 4;
  288. { Make XEventClass be a CARD32 for 64 bit servers. Don't affect client
  289. definition of XEventClass since that would be a library interface change.
  290. See the top of X.h for more _XSERVER64 magic.
  291. But, don't actually use the CARD32 type. We can't get it defined here
  292. without polluting the namespace.
  293. }
  294. type
  295. {$ifdef _XSERVER64}
  296. XEventClass = cuint;
  297. {$ELSE}
  298. XEventClass = culong;
  299. {$ENDIF}
  300. PPXEventClass = ^PXEventClass;
  301. PXEventClass = ^TXEventClass;
  302. TXEventClass = XEventClass;
  303. (*******************************************************************
  304. *
  305. * Extension version structure.
  306. *
  307. *)
  308. type
  309. PXExtensionVersion = ^TXExtensionVersion;
  310. TXExtensionVersion = record
  311. present : cint;
  312. major_version : cshort;
  313. minor_version : cshort;
  314. end;
  315. implementation
  316. end.