xinput2-so_wrap.c 15 KB

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