xinput2-so_wrap.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. // This file is generated. Do not edit!
  2. // see https://github.com/hpvb/dynload-wrapper for details
  3. // generated by generate-wrapper.py 0.3 on 2023-01-23 15:12:16
  4. // flags: generate-wrapper.py --include ./thirdparty/linuxbsd_headers/X11/extensions/XInput2.h --sys-include "thirdparty/linuxbsd_headers/X11/extensions/XInput2.h" --soname libXi.so.6 --init-name xinput2 --output-header ./platform/linuxbsd/x11/dynwrappers/xinput2-so_wrap.h --output-implementation ./platform/linuxbsd/x11/dynwrappers/xinput2-so_wrap.c
  5. //
  6. // NOTE: Generated from Xi 1.7.10.
  7. // This has been handpatched to workaround some issues with the generator that
  8. // will be eventually fixed. In this case, non-existent symbols inherited from
  9. // libX11, liXext and libXfixes, but absent in libXi.so.6, were removed.
  10. #include <stdint.h>
  11. #define XIQueryPointer XIQueryPointer_dylibloader_orig_xinput2
  12. #define XIWarpPointer XIWarpPointer_dylibloader_orig_xinput2
  13. #define XIDefineCursor XIDefineCursor_dylibloader_orig_xinput2
  14. #define XIUndefineCursor XIUndefineCursor_dylibloader_orig_xinput2
  15. #define XIChangeHierarchy XIChangeHierarchy_dylibloader_orig_xinput2
  16. #define XISetClientPointer XISetClientPointer_dylibloader_orig_xinput2
  17. #define XIGetClientPointer XIGetClientPointer_dylibloader_orig_xinput2
  18. #define XISelectEvents XISelectEvents_dylibloader_orig_xinput2
  19. #define XIGetSelectedEvents XIGetSelectedEvents_dylibloader_orig_xinput2
  20. #define XIQueryVersion XIQueryVersion_dylibloader_orig_xinput2
  21. #define XIQueryDevice XIQueryDevice_dylibloader_orig_xinput2
  22. #define XISetFocus XISetFocus_dylibloader_orig_xinput2
  23. #define XIGetFocus XIGetFocus_dylibloader_orig_xinput2
  24. #define XIGrabDevice XIGrabDevice_dylibloader_orig_xinput2
  25. #define XIUngrabDevice XIUngrabDevice_dylibloader_orig_xinput2
  26. #define XIAllowEvents XIAllowEvents_dylibloader_orig_xinput2
  27. #define XIAllowTouchEvents XIAllowTouchEvents_dylibloader_orig_xinput2
  28. #define XIGrabButton XIGrabButton_dylibloader_orig_xinput2
  29. #define XIGrabKeycode XIGrabKeycode_dylibloader_orig_xinput2
  30. #define XIGrabEnter XIGrabEnter_dylibloader_orig_xinput2
  31. #define XIGrabFocusIn XIGrabFocusIn_dylibloader_orig_xinput2
  32. #define XIGrabTouchBegin XIGrabTouchBegin_dylibloader_orig_xinput2
  33. #define XIUngrabButton XIUngrabButton_dylibloader_orig_xinput2
  34. #define XIUngrabKeycode XIUngrabKeycode_dylibloader_orig_xinput2
  35. #define XIUngrabEnter XIUngrabEnter_dylibloader_orig_xinput2
  36. #define XIUngrabFocusIn XIUngrabFocusIn_dylibloader_orig_xinput2
  37. #define XIUngrabTouchBegin XIUngrabTouchBegin_dylibloader_orig_xinput2
  38. #define XIListProperties XIListProperties_dylibloader_orig_xinput2
  39. #define XIChangeProperty XIChangeProperty_dylibloader_orig_xinput2
  40. #define XIDeleteProperty XIDeleteProperty_dylibloader_orig_xinput2
  41. #define XIGetProperty XIGetProperty_dylibloader_orig_xinput2
  42. #define XIBarrierReleasePointers XIBarrierReleasePointers_dylibloader_orig_xinput2
  43. #define XIBarrierReleasePointer XIBarrierReleasePointer_dylibloader_orig_xinput2
  44. #define XIFreeDeviceInfo XIFreeDeviceInfo_dylibloader_orig_xinput2
  45. #include "thirdparty/linuxbsd_headers/X11/extensions/XInput2.h"
  46. #undef XIQueryPointer
  47. #undef XIWarpPointer
  48. #undef XIDefineCursor
  49. #undef XIUndefineCursor
  50. #undef XIChangeHierarchy
  51. #undef XISetClientPointer
  52. #undef XIGetClientPointer
  53. #undef XISelectEvents
  54. #undef XIGetSelectedEvents
  55. #undef XIQueryVersion
  56. #undef XIQueryDevice
  57. #undef XISetFocus
  58. #undef XIGetFocus
  59. #undef XIGrabDevice
  60. #undef XIUngrabDevice
  61. #undef XIAllowEvents
  62. #undef XIAllowTouchEvents
  63. #undef XIGrabButton
  64. #undef XIGrabKeycode
  65. #undef XIGrabEnter
  66. #undef XIGrabFocusIn
  67. #undef XIGrabTouchBegin
  68. #undef XIUngrabButton
  69. #undef XIUngrabKeycode
  70. #undef XIUngrabEnter
  71. #undef XIUngrabFocusIn
  72. #undef XIUngrabTouchBegin
  73. #undef XIListProperties
  74. #undef XIChangeProperty
  75. #undef XIDeleteProperty
  76. #undef XIGetProperty
  77. #undef XIBarrierReleasePointers
  78. #undef XIBarrierReleasePointer
  79. #undef XIFreeDeviceInfo
  80. #include <dlfcn.h>
  81. #include <stdio.h>
  82. int (*XIQueryPointer_dylibloader_wrapper_xinput2)( Display*, int, Window, Window*, Window*, double*, double*, double*, double*, XIButtonState*, XIModifierState*, XIGroupState*);
  83. int (*XIWarpPointer_dylibloader_wrapper_xinput2)( Display*, int, Window, Window, double, double, unsigned int, unsigned int, double, double);
  84. int (*XIDefineCursor_dylibloader_wrapper_xinput2)( Display*, int, Window, Cursor);
  85. int (*XIUndefineCursor_dylibloader_wrapper_xinput2)( Display*, int, Window);
  86. int (*XIChangeHierarchy_dylibloader_wrapper_xinput2)( Display*, XIAnyHierarchyChangeInfo*, int);
  87. int (*XISetClientPointer_dylibloader_wrapper_xinput2)( Display*, Window, int);
  88. int (*XIGetClientPointer_dylibloader_wrapper_xinput2)( Display*, Window, int*);
  89. int (*XISelectEvents_dylibloader_wrapper_xinput2)( Display*, Window, XIEventMask*, int);
  90. XIEventMask* (*XIGetSelectedEvents_dylibloader_wrapper_xinput2)( Display*, Window, int*);
  91. int (*XIQueryVersion_dylibloader_wrapper_xinput2)( Display*, int*, int*);
  92. XIDeviceInfo* (*XIQueryDevice_dylibloader_wrapper_xinput2)( Display*, int, int*);
  93. int (*XISetFocus_dylibloader_wrapper_xinput2)( Display*, int, Window, Time);
  94. int (*XIGetFocus_dylibloader_wrapper_xinput2)( Display*, int, Window*);
  95. int (*XIGrabDevice_dylibloader_wrapper_xinput2)( Display*, int, Window, Time, Cursor, int, int, int, XIEventMask*);
  96. int (*XIUngrabDevice_dylibloader_wrapper_xinput2)( Display*, int, Time);
  97. int (*XIAllowEvents_dylibloader_wrapper_xinput2)( Display*, int, int, Time);
  98. int (*XIAllowTouchEvents_dylibloader_wrapper_xinput2)( Display*, int, unsigned int, Window, int);
  99. int (*XIGrabButton_dylibloader_wrapper_xinput2)( Display*, int, int, Window, Cursor, int, int, int, XIEventMask*, int, XIGrabModifiers*);
  100. int (*XIGrabKeycode_dylibloader_wrapper_xinput2)( Display*, int, int, Window, int, int, int, XIEventMask*, int, XIGrabModifiers*);
  101. int (*XIGrabEnter_dylibloader_wrapper_xinput2)( Display*, int, Window, Cursor, int, int, int, XIEventMask*, int, XIGrabModifiers*);
  102. int (*XIGrabFocusIn_dylibloader_wrapper_xinput2)( Display*, int, Window, int, int, int, XIEventMask*, int, XIGrabModifiers*);
  103. int (*XIGrabTouchBegin_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIEventMask*, int, XIGrabModifiers*);
  104. int (*XIUngrabButton_dylibloader_wrapper_xinput2)( Display*, int, int, Window, int, XIGrabModifiers*);
  105. int (*XIUngrabKeycode_dylibloader_wrapper_xinput2)( Display*, int, int, Window, int, XIGrabModifiers*);
  106. int (*XIUngrabEnter_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIGrabModifiers*);
  107. int (*XIUngrabFocusIn_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIGrabModifiers*);
  108. int (*XIUngrabTouchBegin_dylibloader_wrapper_xinput2)( Display*, int, Window, int, XIGrabModifiers*);
  109. Atom* (*XIListProperties_dylibloader_wrapper_xinput2)( Display*, int, int*);
  110. void (*XIChangeProperty_dylibloader_wrapper_xinput2)( Display*, int, Atom, Atom, int, int, unsigned char*, int);
  111. void (*XIDeleteProperty_dylibloader_wrapper_xinput2)( Display*, int, Atom);
  112. int (*XIGetProperty_dylibloader_wrapper_xinput2)( Display*, int, Atom, long, long, int, Atom, Atom*, int*, unsigned long*, unsigned long*, unsigned char**);
  113. void (*XIBarrierReleasePointers_dylibloader_wrapper_xinput2)( Display*, XIBarrierReleasePointerInfo*, int);
  114. void (*XIBarrierReleasePointer_dylibloader_wrapper_xinput2)( Display*, int, PointerBarrier, BarrierEventID);
  115. void (*XIFreeDeviceInfo_dylibloader_wrapper_xinput2)( XIDeviceInfo*);
  116. int initialize_xinput2(int verbose) {
  117. void *handle;
  118. char *error;
  119. handle = dlopen("libXi.so.6", RTLD_LAZY);
  120. if (!handle) {
  121. if (verbose) {
  122. fprintf(stderr, "%s\n", dlerror());
  123. }
  124. return(1);
  125. }
  126. dlerror();
  127. // XIQueryPointer
  128. *(void **) (&XIQueryPointer_dylibloader_wrapper_xinput2) = dlsym(handle, "XIQueryPointer");
  129. if (verbose) {
  130. error = dlerror();
  131. if (error != NULL) {
  132. fprintf(stderr, "%s\n", error);
  133. }
  134. }
  135. // XIWarpPointer
  136. *(void **) (&XIWarpPointer_dylibloader_wrapper_xinput2) = dlsym(handle, "XIWarpPointer");
  137. if (verbose) {
  138. error = dlerror();
  139. if (error != NULL) {
  140. fprintf(stderr, "%s\n", error);
  141. }
  142. }
  143. // XIDefineCursor
  144. *(void **) (&XIDefineCursor_dylibloader_wrapper_xinput2) = dlsym(handle, "XIDefineCursor");
  145. if (verbose) {
  146. error = dlerror();
  147. if (error != NULL) {
  148. fprintf(stderr, "%s\n", error);
  149. }
  150. }
  151. // XIUndefineCursor
  152. *(void **) (&XIUndefineCursor_dylibloader_wrapper_xinput2) = dlsym(handle, "XIUndefineCursor");
  153. if (verbose) {
  154. error = dlerror();
  155. if (error != NULL) {
  156. fprintf(stderr, "%s\n", error);
  157. }
  158. }
  159. // XIChangeHierarchy
  160. *(void **) (&XIChangeHierarchy_dylibloader_wrapper_xinput2) = dlsym(handle, "XIChangeHierarchy");
  161. if (verbose) {
  162. error = dlerror();
  163. if (error != NULL) {
  164. fprintf(stderr, "%s\n", error);
  165. }
  166. }
  167. // XISetClientPointer
  168. *(void **) (&XISetClientPointer_dylibloader_wrapper_xinput2) = dlsym(handle, "XISetClientPointer");
  169. if (verbose) {
  170. error = dlerror();
  171. if (error != NULL) {
  172. fprintf(stderr, "%s\n", error);
  173. }
  174. }
  175. // XIGetClientPointer
  176. *(void **) (&XIGetClientPointer_dylibloader_wrapper_xinput2) = dlsym(handle, "XIGetClientPointer");
  177. if (verbose) {
  178. error = dlerror();
  179. if (error != NULL) {
  180. fprintf(stderr, "%s\n", error);
  181. }
  182. }
  183. // XISelectEvents
  184. *(void **) (&XISelectEvents_dylibloader_wrapper_xinput2) = dlsym(handle, "XISelectEvents");
  185. if (verbose) {
  186. error = dlerror();
  187. if (error != NULL) {
  188. fprintf(stderr, "%s\n", error);
  189. }
  190. }
  191. // XIGetSelectedEvents
  192. *(void **) (&XIGetSelectedEvents_dylibloader_wrapper_xinput2) = dlsym(handle, "XIGetSelectedEvents");
  193. if (verbose) {
  194. error = dlerror();
  195. if (error != NULL) {
  196. fprintf(stderr, "%s\n", error);
  197. }
  198. }
  199. // XIQueryVersion
  200. *(void **) (&XIQueryVersion_dylibloader_wrapper_xinput2) = dlsym(handle, "XIQueryVersion");
  201. if (verbose) {
  202. error = dlerror();
  203. if (error != NULL) {
  204. fprintf(stderr, "%s\n", error);
  205. }
  206. }
  207. // XIQueryDevice
  208. *(void **) (&XIQueryDevice_dylibloader_wrapper_xinput2) = dlsym(handle, "XIQueryDevice");
  209. if (verbose) {
  210. error = dlerror();
  211. if (error != NULL) {
  212. fprintf(stderr, "%s\n", error);
  213. }
  214. }
  215. // XISetFocus
  216. *(void **) (&XISetFocus_dylibloader_wrapper_xinput2) = dlsym(handle, "XISetFocus");
  217. if (verbose) {
  218. error = dlerror();
  219. if (error != NULL) {
  220. fprintf(stderr, "%s\n", error);
  221. }
  222. }
  223. // XIGetFocus
  224. *(void **) (&XIGetFocus_dylibloader_wrapper_xinput2) = dlsym(handle, "XIGetFocus");
  225. if (verbose) {
  226. error = dlerror();
  227. if (error != NULL) {
  228. fprintf(stderr, "%s\n", error);
  229. }
  230. }
  231. // XIGrabDevice
  232. *(void **) (&XIGrabDevice_dylibloader_wrapper_xinput2) = dlsym(handle, "XIGrabDevice");
  233. if (verbose) {
  234. error = dlerror();
  235. if (error != NULL) {
  236. fprintf(stderr, "%s\n", error);
  237. }
  238. }
  239. // XIUngrabDevice
  240. *(void **) (&XIUngrabDevice_dylibloader_wrapper_xinput2) = dlsym(handle, "XIUngrabDevice");
  241. if (verbose) {
  242. error = dlerror();
  243. if (error != NULL) {
  244. fprintf(stderr, "%s\n", error);
  245. }
  246. }
  247. // XIAllowEvents
  248. *(void **) (&XIAllowEvents_dylibloader_wrapper_xinput2) = dlsym(handle, "XIAllowEvents");
  249. if (verbose) {
  250. error = dlerror();
  251. if (error != NULL) {
  252. fprintf(stderr, "%s\n", error);
  253. }
  254. }
  255. // XIAllowTouchEvents
  256. *(void **) (&XIAllowTouchEvents_dylibloader_wrapper_xinput2) = dlsym(handle, "XIAllowTouchEvents");
  257. if (verbose) {
  258. error = dlerror();
  259. if (error != NULL) {
  260. fprintf(stderr, "%s\n", error);
  261. }
  262. }
  263. // XIGrabButton
  264. *(void **) (&XIGrabButton_dylibloader_wrapper_xinput2) = dlsym(handle, "XIGrabButton");
  265. if (verbose) {
  266. error = dlerror();
  267. if (error != NULL) {
  268. fprintf(stderr, "%s\n", error);
  269. }
  270. }
  271. // XIGrabKeycode
  272. *(void **) (&XIGrabKeycode_dylibloader_wrapper_xinput2) = dlsym(handle, "XIGrabKeycode");
  273. if (verbose) {
  274. error = dlerror();
  275. if (error != NULL) {
  276. fprintf(stderr, "%s\n", error);
  277. }
  278. }
  279. // XIGrabEnter
  280. *(void **) (&XIGrabEnter_dylibloader_wrapper_xinput2) = dlsym(handle, "XIGrabEnter");
  281. if (verbose) {
  282. error = dlerror();
  283. if (error != NULL) {
  284. fprintf(stderr, "%s\n", error);
  285. }
  286. }
  287. // XIGrabFocusIn
  288. *(void **) (&XIGrabFocusIn_dylibloader_wrapper_xinput2) = dlsym(handle, "XIGrabFocusIn");
  289. if (verbose) {
  290. error = dlerror();
  291. if (error != NULL) {
  292. fprintf(stderr, "%s\n", error);
  293. }
  294. }
  295. // XIGrabTouchBegin
  296. *(void **) (&XIGrabTouchBegin_dylibloader_wrapper_xinput2) = dlsym(handle, "XIGrabTouchBegin");
  297. if (verbose) {
  298. error = dlerror();
  299. if (error != NULL) {
  300. fprintf(stderr, "%s\n", error);
  301. }
  302. }
  303. // XIUngrabButton
  304. *(void **) (&XIUngrabButton_dylibloader_wrapper_xinput2) = dlsym(handle, "XIUngrabButton");
  305. if (verbose) {
  306. error = dlerror();
  307. if (error != NULL) {
  308. fprintf(stderr, "%s\n", error);
  309. }
  310. }
  311. // XIUngrabKeycode
  312. *(void **) (&XIUngrabKeycode_dylibloader_wrapper_xinput2) = dlsym(handle, "XIUngrabKeycode");
  313. if (verbose) {
  314. error = dlerror();
  315. if (error != NULL) {
  316. fprintf(stderr, "%s\n", error);
  317. }
  318. }
  319. // XIUngrabEnter
  320. *(void **) (&XIUngrabEnter_dylibloader_wrapper_xinput2) = dlsym(handle, "XIUngrabEnter");
  321. if (verbose) {
  322. error = dlerror();
  323. if (error != NULL) {
  324. fprintf(stderr, "%s\n", error);
  325. }
  326. }
  327. // XIUngrabFocusIn
  328. *(void **) (&XIUngrabFocusIn_dylibloader_wrapper_xinput2) = dlsym(handle, "XIUngrabFocusIn");
  329. if (verbose) {
  330. error = dlerror();
  331. if (error != NULL) {
  332. fprintf(stderr, "%s\n", error);
  333. }
  334. }
  335. // XIUngrabTouchBegin
  336. *(void **) (&XIUngrabTouchBegin_dylibloader_wrapper_xinput2) = dlsym(handle, "XIUngrabTouchBegin");
  337. if (verbose) {
  338. error = dlerror();
  339. if (error != NULL) {
  340. fprintf(stderr, "%s\n", error);
  341. }
  342. }
  343. // XIListProperties
  344. *(void **) (&XIListProperties_dylibloader_wrapper_xinput2) = dlsym(handle, "XIListProperties");
  345. if (verbose) {
  346. error = dlerror();
  347. if (error != NULL) {
  348. fprintf(stderr, "%s\n", error);
  349. }
  350. }
  351. // XIChangeProperty
  352. *(void **) (&XIChangeProperty_dylibloader_wrapper_xinput2) = dlsym(handle, "XIChangeProperty");
  353. if (verbose) {
  354. error = dlerror();
  355. if (error != NULL) {
  356. fprintf(stderr, "%s\n", error);
  357. }
  358. }
  359. // XIDeleteProperty
  360. *(void **) (&XIDeleteProperty_dylibloader_wrapper_xinput2) = dlsym(handle, "XIDeleteProperty");
  361. if (verbose) {
  362. error = dlerror();
  363. if (error != NULL) {
  364. fprintf(stderr, "%s\n", error);
  365. }
  366. }
  367. // XIGetProperty
  368. *(void **) (&XIGetProperty_dylibloader_wrapper_xinput2) = dlsym(handle, "XIGetProperty");
  369. if (verbose) {
  370. error = dlerror();
  371. if (error != NULL) {
  372. fprintf(stderr, "%s\n", error);
  373. }
  374. }
  375. // XIBarrierReleasePointers
  376. *(void **) (&XIBarrierReleasePointers_dylibloader_wrapper_xinput2) = dlsym(handle, "XIBarrierReleasePointers");
  377. if (verbose) {
  378. error = dlerror();
  379. if (error != NULL) {
  380. fprintf(stderr, "%s\n", error);
  381. }
  382. }
  383. // XIBarrierReleasePointer
  384. *(void **) (&XIBarrierReleasePointer_dylibloader_wrapper_xinput2) = dlsym(handle, "XIBarrierReleasePointer");
  385. if (verbose) {
  386. error = dlerror();
  387. if (error != NULL) {
  388. fprintf(stderr, "%s\n", error);
  389. }
  390. }
  391. // XIFreeDeviceInfo
  392. *(void **) (&XIFreeDeviceInfo_dylibloader_wrapper_xinput2) = dlsym(handle, "XIFreeDeviceInfo");
  393. if (verbose) {
  394. error = dlerror();
  395. if (error != NULL) {
  396. fprintf(stderr, "%s\n", error);
  397. }
  398. }
  399. return 0;
  400. }