xi.nim 8.4 KB

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