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