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