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
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include <dlfcn.h>
#include <stdarg.h>
#include "wrappedlibs.h"
#include "debug.h"
#include "wrapper.h"
#include "bridge.h"
#include "librarian/library_private.h"
#include "x64emu.h"
#include "emu/x64emu_private.h"
#include "callback.h"
#include "box64context.h"
#include "librarian.h"
#include "myalign.h"
const char* waylandclientName = "libwayland-client.so.0";
#define LIBNAME waylandclient
#define ADDED_FUNCTIONS() \
#include "generated/wrappedwaylandclienttypes.h"
#include "wrappercallback.h"
#define SUPER() \
GO(0) \
GO(1) \
GO(2) \
GO(3) \
GO(4) \
GO(5) \
GO(6) \
GO(7) \
GO(8) \
GO(9) \
//wl_log_func_t
#ifdef CONVERT_VALIST
#define GO(A) \
static uintptr_t my_wl_log_func_t_fct_##A = 0; \
static void my_wl_log_func_t_##A(void* fmt, x64_va_list_t args) \
{ \
CONVERT_VALIST(args) \
RunFunction(my_wl_log_func_t_fct_##A, 2, fmt, VARARGS); \
}
#else
#define GO(A) \
static uintptr_t my_wl_log_func_t_fct_##A = 0; \
static void my_wl_log_func_t_##A(void* fmt, x64_va_list_t args) \
{ \
CREATE_VALIST_FROM_VALIST(args, thread_get_emu()->scratch); \
RunFunction(my_wl_log_func_t_fct_##A, 2, fmt, VARARGS); \
}
#endif
SUPER()
#undef GO
static void* find_wl_log_func_t_Fct(void* fct)
{
if(!fct) return fct;
if(GetNativeFnc((uintptr_t)fct)) return GetNativeFnc((uintptr_t)fct);
#define GO(A) if(my_wl_log_func_t_fct_##A == (uintptr_t)fct) return my_wl_log_func_t_##A;
SUPER()
#undef GO
#define GO(A) if(my_wl_log_func_t_fct_##A == 0) {my_wl_log_func_t_fct_##A = (uintptr_t)fct; return my_wl_log_func_t_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_log_func_t callback\n");
return NULL;
}
// wl_registry_listener ...
typedef struct my_wl_registry_listener_s {
uintptr_t global; //vFppupu
uintptr_t global_remove; //vFppu
} my_wl_registry_listener_t;
#define GO(A) \
static my_wl_registry_listener_t* ref_wl_registry_listener_##A = NULL; \
static void my_wl_registry_listener_global_##A(void* a, void* b, uint32_t c, void* d, uint32_t e) \
{ \
RunFunctionFmt(ref_wl_registry_listener_##A->global, "ppupu", a, b, c, d, e); \
} \
static void my_wl_registry_listener_global_remove_##A(void* a, void* b, uint32_t c) \
{ \
RunFunctionFmt(ref_wl_registry_listener_##A->global_remove, "ppu", a, b, c); \
} \
static my_wl_registry_listener_t my_wl_registry_listener_fct_##A = { \
(uintptr_t)my_wl_registry_listener_global_##A, \
(uintptr_t)my_wl_registry_listener_global_remove_##A \
};
SUPER()
#undef GO
static void* find_wl_registry_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_registry_listener_##A == fct) return &my_wl_registry_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_registry_listener_##A == 0) {ref_wl_registry_listener_##A = fct; return &my_wl_registry_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_registry_listener callback\n");
return NULL;
}
// xdg_surface_listener ...
typedef struct my_xdg_surface_listener_s {
uintptr_t configure; //vFppiipu
uintptr_t close; //vFpp
} my_xdg_surface_listener_t;
#define GO(A) \
static my_xdg_surface_listener_t* ref_xdg_surface_listener_##A = NULL; \
static void my_xdg_surface_listener_configure_##A(void* a, void* b, int c, int d, void* e, uint32_t f) \
{ \
RunFunctionFmt(ref_xdg_surface_listener_##A->configure, "ppiipu", a, b, c, d, e, f); \
} \
static void my_xdg_surface_listener_close_##A(void* a, void* b) \
{ \
RunFunctionFmt(ref_xdg_surface_listener_##A->close, "pp", a, b); \
} \
static my_xdg_surface_listener_t my_xdg_surface_listener_fct_##A = { \
(uintptr_t)my_xdg_surface_listener_configure_##A, \
(uintptr_t)my_xdg_surface_listener_close_##A \
};
SUPER()
#undef GO
static void* find_xdg_surface_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_xdg_surface_listener_##A == fct) return &my_xdg_surface_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_xdg_surface_listener_##A == 0) {ref_xdg_surface_listener_##A = fct; return &my_xdg_surface_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client xdg_surface_listener callback\n");
return NULL;
}
// xdg_toplevel_listener ...
typedef struct my_xdg_toplevel_listener_s {
uintptr_t configure; //vFppiip
uintptr_t close; //vFpp
} my_xdg_toplevel_listener_t;
#define GO(A) \
static my_xdg_toplevel_listener_t* ref_xdg_toplevel_listener_##A = NULL; \
static void my_xdg_toplevel_listener_configure_##A(void* a, void* b, int c, int d, void* e) \
{ \
RunFunctionFmt(ref_xdg_toplevel_listener_##A->configure, "ppiip", a, b, c, d, e); \
} \
static void my_xdg_toplevel_listener_close_##A(void* a, void* b) \
{ \
RunFunctionFmt(ref_xdg_toplevel_listener_##A->close, "pp", a, b); \
} \
static my_xdg_toplevel_listener_t my_xdg_toplevel_listener_fct_##A = { \
(uintptr_t)my_xdg_toplevel_listener_configure_##A, \
(uintptr_t)my_xdg_toplevel_listener_close_##A \
};
SUPER()
#undef GO
static void* find_xdg_toplevel_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_xdg_toplevel_listener_##A == fct) return &my_xdg_toplevel_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_xdg_toplevel_listener_##A == 0) {ref_xdg_toplevel_listener_##A = fct; return &my_xdg_toplevel_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client xdg_toplevel_listener callback\n");
return NULL;
}
// xdg_wm_base_listener ...
typedef struct my_xdg_wm_base_listener_s {
uintptr_t ping; //vFppu
} my_xdg_wm_base_listener_t;
#define GO(A) \
static my_xdg_wm_base_listener_t* ref_xdg_wm_base_listener_##A = NULL; \
static void my_xdg_wm_base_listener_ping_##A(void* a, void* b, uint32_t c) \
{ \
RunFunctionFmt(ref_xdg_wm_base_listener_##A->ping, "ppu", a, b, c); \
} \
static my_xdg_wm_base_listener_t my_xdg_wm_base_listener_fct_##A = { \
(uintptr_t)my_xdg_wm_base_listener_ping_##A, \
};
SUPER()
#undef GO
static void* find_xdg_wm_base_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_xdg_wm_base_listener_##A == fct) return &my_xdg_wm_base_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_xdg_wm_base_listener_##A == 0) {ref_xdg_wm_base_listener_##A = fct; return &my_xdg_wm_base_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client xdg_wm_base_listener callback\n");
return NULL;
}
// wl_shm_listener ...
typedef struct my_wl_shm_listener_s {
uintptr_t format; //vFppu
} my_wl_shm_listener_t;
#define GO(A) \
static my_wl_shm_listener_t* ref_wl_shm_listener_##A = NULL; \
static void my_wl_shm_listener_format_##A(void* a, void* b, uint32_t c) \
{ \
RunFunctionFmt(ref_wl_shm_listener_##A->format, "ppu", a, b, c); \
} \
static my_wl_shm_listener_t my_wl_shm_listener_fct_##A = { \
(uintptr_t)my_wl_shm_listener_format_##A, \
};
SUPER()
#undef GO
static void* find_wl_shm_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_shm_listener_##A == fct) return &my_wl_shm_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_shm_listener_##A == 0) {ref_wl_shm_listener_##A = fct; return &my_wl_shm_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_shm_listener callback\n");
return NULL;
}
// wl_output_listener ...
typedef struct my_wl_output_listener_s {
uintptr_t geometry; //vFppiiiiippi
uintptr_t mode; //vFppuiii
uintptr_t done; //vFpp
uintptr_t scale; //vFppi
uintptr_t name; //vFppp
uintptr_t description; //vFppp
} my_wl_output_listener_t;
#define GO(A) \
static my_wl_output_listener_t* ref_wl_output_listener_##A = NULL; \
static void my_wl_output_listener_geometry_##A(void* a, void* b, int c, int d, int e, int f, int g, void* h, void* i, int j) \
{ \
RunFunctionFmt(ref_wl_output_listener_##A->geometry, "ppiiiiippi", a, b, c, d, e, f, g, h, i, j); \
} \
static void my_wl_output_listener_mode_##A(void* a, void* b, uint32_t c, int d, int e, int f) \
{ \
RunFunctionFmt(ref_wl_output_listener_##A->mode, "ppuiii", a, b, c, d, e, f); \
} \
static void my_wl_output_listener_done_##A(void* a, void* b) \
{ \
RunFunctionFmt(ref_wl_output_listener_##A->done, "pp", a, b); \
} \
static void my_wl_output_listener_scale_##A(void* a, void* b, int c) \
{ \
RunFunctionFmt(ref_wl_output_listener_##A->scale, "ppi", a, b, c); \
} \
static void my_wl_output_listener_name_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_wl_output_listener_##A->name, "ppp", a, b, c); \
} \
static void my_wl_output_listener_description_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_wl_output_listener_##A->description, "ppp", a, b, c); \
} \
static my_wl_output_listener_t my_wl_output_listener_fct_##A = { \
(uintptr_t)my_wl_output_listener_geometry_##A, \
(uintptr_t)my_wl_output_listener_mode_##A, \
(uintptr_t)my_wl_output_listener_done_##A, \
(uintptr_t)my_wl_output_listener_scale_##A, \
(uintptr_t)my_wl_output_listener_name_##A, \
(uintptr_t)my_wl_output_listener_description_##A \
};
SUPER()
#undef GO
static void* find_wl_output_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_output_listener_##A == fct) return &my_wl_output_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_output_listener_##A == 0) {ref_wl_output_listener_##A = fct; return &my_wl_output_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_output_listener callback\n");
return NULL;
}
// wl_seat_listener ...
typedef struct my_wl_seat_listener_s {
uintptr_t capabilities; //vFppu
uintptr_t name; //vFppp
} my_wl_seat_listener_t;
#define GO(A) \
static my_wl_seat_listener_t* ref_wl_seat_listener_##A = NULL; \
static void my_wl_seat_listener_capabilities_##A(void* a, void* b, uint32_t c) \
{ \
RunFunctionFmt(ref_wl_seat_listener_##A->capabilities, "ppu", a, b, c); \
} \
static void my_wl_seat_listener_name_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_wl_seat_listener_##A->name, "ppp", a, b, c); \
} \
static my_wl_seat_listener_t my_wl_seat_listener_fct_##A = { \
(uintptr_t)my_wl_seat_listener_capabilities_##A, \
(uintptr_t)my_wl_seat_listener_name_##A \
};
SUPER()
#undef GO
static void* find_wl_seat_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_seat_listener_##A == fct) return &my_wl_seat_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_seat_listener_##A == 0) {ref_wl_seat_listener_##A = fct; return &my_wl_seat_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_seat_listener callback\n");
return NULL;
}
// wl_pointer_listener ...
typedef struct my_wl_pointer_listener_s {
uintptr_t enter; //vFppupii
uintptr_t leave; //vFppup
uintptr_t motion; //vFppuii
uintptr_t button; //vFppuuuu
uintptr_t axis; //vFppuui
uintptr_t frame; //vFpp
uintptr_t axis_source; //vFppu
uintptr_t axis_stop; //vFppuu
uintptr_t axis_discrete; //vFppui
uintptr_t axis_value120; //vFppui
uintptr_t axis_relative_direction; //vFppuu
} my_wl_pointer_listener_t;
#define GO(A) \
static my_wl_pointer_listener_t* ref_wl_pointer_listener_##A = NULL; \
static void my_wl_pointer_listener_enter_##A(void* a, void* b, uint32_t c, void* d, int e, int f) \
{ \
RunFunctionFmt(ref_wl_pointer_listener_##A->enter, "ppupii", a, b, c, d, e, f); \
} \
static void my_wl_pointer_listener_leave_##A(void* a, void* b, uint32_t c, void* d) \
{ \
RunFunctionFmt(ref_wl_pointer_listener_##A->leave, "ppup", a, b, c, d); \
} \
static void my_wl_pointer_listener_motion_##A(void* a, void* b, uint32_t c, int d, int e) \
{ \
RunFunctionFmt(ref_wl_pointer_listener_##A->motion, "ppuii", a, b, c, d, e); \
} \
static void my_wl_pointer_listener_button_##A(void* a, void* b, uint32_t c, uint32_t d, uint32_t e, uint32_t f) \
{ \
RunFunctionFmt(ref_wl_pointer_listener_##A->button, "ppuuuu", a, b, c, d, e, f); \
} \
static void my_wl_pointer_listener_axis_##A(void* a, void* b, uint32_t c, uint32_t d, int e) \
{ \
RunFunctionFmt(ref_wl_pointer_listener_##A->axis, "ppuui", a, b, c, d, e); \
} \
static void my_wl_pointer_listener_frame_##A(void* a, void* b) \
{ \
RunFunctionFmt(ref_wl_pointer_listener_##A->frame, "pp", a, b); \
} \
static void my_wl_pointer_listener_axis_source_##A(void* a, void* b, uint32_t c) \
{ \
RunFunctionFmt(ref_wl_pointer_listener_##A->axis_source, "ppu", a, b, c); \
} \
static void my_wl_pointer_listener_axis_stop_##A(void* a, void* b, uint32_t c, uint32_t d) \
{ \
RunFunctionFmt(ref_wl_pointer_listener_##A->axis_stop, "ppuu", a, b, c, d); \
} \
static void my_wl_pointer_listener_axis_discrete_##A(void* a, void* b, uint32_t c, int d) \
{ \
RunFunctionFmt(ref_wl_pointer_listener_##A->axis_discrete, "ppui", a, b, c, d); \
} \
static void my_wl_pointer_listener_axis_value120_##A(void* a, void* b, uint32_t c, int d) \
{ \
RunFunctionFmt(ref_wl_pointer_listener_##A->axis_value120, "ppui", a, b, c, d); \
} \
static void my_wl_pointer_listener_axis_relative_direction_##A(void* a, void* b, uint32_t c, uint32_t d) \
{ \
RunFunctionFmt(ref_wl_pointer_listener_##A->axis_relative_direction, "ppuu", a, b, c, d); \
} \
static my_wl_pointer_listener_t my_wl_pointer_listener_fct_##A = { \
(uintptr_t)my_wl_pointer_listener_enter_##A, \
(uintptr_t)my_wl_pointer_listener_leave_##A, \
(uintptr_t)my_wl_pointer_listener_motion_##A, \
(uintptr_t)my_wl_pointer_listener_button_##A, \
(uintptr_t)my_wl_pointer_listener_axis_##A, \
(uintptr_t)my_wl_pointer_listener_frame_##A, \
(uintptr_t)my_wl_pointer_listener_axis_source_##A, \
(uintptr_t)my_wl_pointer_listener_axis_stop_##A, \
(uintptr_t)my_wl_pointer_listener_axis_discrete_##A, \
(uintptr_t)my_wl_pointer_listener_axis_value120_##A, \
(uintptr_t)my_wl_pointer_listener_axis_relative_direction_##A \
};
SUPER()
#undef GO
static void* find_wl_pointer_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_pointer_listener_##A == fct) return &my_wl_pointer_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_pointer_listener_##A == 0) {ref_wl_pointer_listener_##A = fct; return &my_wl_pointer_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_pointer_listener callback\n");
return NULL;
}
// wl_keyboard_listener ...
typedef struct my_wl_keyboard_listener_s {
uintptr_t keymap; //vFppuiu
uintptr_t enter; //vFppupp
uintptr_t leave; //vFppup
uintptr_t key; //vFppuuuuu
uintptr_t modifiers; //vFppuuuuu
uintptr_t repeat_info; //vFppii
} my_wl_keyboard_listener_t;
#define GO(A) \
static my_wl_keyboard_listener_t* ref_wl_keyboard_listener_##A = NULL; \
static void my_wl_keyboard_listener_keymap_##A(void* a, void* b, uint32_t c, int d, uint32_t e) \
{ \
RunFunctionFmt(ref_wl_keyboard_listener_##A->keymap, "ppuiu", a, b, c, d, e); \
} \
static void my_wl_keyboard_listener_enter_##A(void* a, void* b, uint32_t c, void* d, void* e) \
{ \
RunFunctionFmt(ref_wl_keyboard_listener_##A->enter, "ppupp", a, b, c, d, e); \
} \
static void my_wl_keyboard_listener_leave_##A(void* a, void* b, uint32_t c, void* d) \
{ \
RunFunctionFmt(ref_wl_keyboard_listener_##A->leave, "ppup", a, b, c, d); \
} \
static void my_wl_keyboard_listener_key_##A(void* a, void* b, uint32_t c, uint32_t d, uint32_t e, uint32_t f, uint32_t g) \
{ \
RunFunctionFmt(ref_wl_keyboard_listener_##A->key, "ppuuuuu", a, b, c, d, e, f, g); \
} \
static void my_wl_keyboard_listener_modifiers_##A(void* a, void* b, uint32_t c, uint32_t d, uint32_t e, uint32_t f, uint32_t g) \
{ \
RunFunctionFmt(ref_wl_keyboard_listener_##A->modifiers, "ppuuuuu", a, b, c, d, e, f, g); \
} \
static void my_wl_keyboard_listener_repeat_info_##A(void* a, void* b, int c, int d) \
{ \
RunFunctionFmt(ref_wl_keyboard_listener_##A->repeat_info, "ppii", a, b, c, d); \
} \
static my_wl_keyboard_listener_t my_wl_keyboard_listener_fct_##A = { \
(uintptr_t)my_wl_keyboard_listener_keymap_##A, \
(uintptr_t)my_wl_keyboard_listener_enter_##A, \
(uintptr_t)my_wl_keyboard_listener_leave_##A, \
(uintptr_t)my_wl_keyboard_listener_key_##A, \
(uintptr_t)my_wl_keyboard_listener_modifiers_##A, \
(uintptr_t)my_wl_keyboard_listener_repeat_info_##A \
};
SUPER()
#undef GO
static void* find_wl_keyboard_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_keyboard_listener_##A == fct) return &my_wl_keyboard_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_keyboard_listener_##A == 0) {ref_wl_keyboard_listener_##A = fct; return &my_wl_keyboard_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_keyboard_listener callback\n");
return NULL;
}
// wl_buffer_listener ...
typedef struct my_wl_buffer_listener_s {
uintptr_t release; //vFpp
} my_wl_buffer_listener_t;
#define GO(A) \
static my_wl_buffer_listener_t* ref_wl_buffer_listener_##A = NULL; \
static void my_wl_buffer_listener_release_##A(void* a, void* b) \
{ \
RunFunctionFmt(ref_wl_buffer_listener_##A->release, "pp", a, b); \
} \
static my_wl_buffer_listener_t my_wl_buffer_listener_fct_##A = { \
(uintptr_t)my_wl_buffer_listener_release_##A, \
};
SUPER()
#undef GO
static void* find_wl_buffer_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_buffer_listener_##A == fct) return &my_wl_buffer_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_buffer_listener_##A == 0) {ref_wl_buffer_listener_##A = fct; return &my_wl_buffer_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_buffer_listener callback\n");
return NULL;
}
// zwp_relative_pointer_v1_listener ...
typedef struct my_zwp_relative_pointer_v1_listener_s {
uintptr_t relative_motion; //vFppuuiiii
} my_zwp_relative_pointer_v1_listener_t;
#define GO(A) \
static my_zwp_relative_pointer_v1_listener_t* ref_zwp_relative_pointer_v1_listener_##A = NULL; \
static void my_zwp_relative_pointer_v1_listener_relative_motion_##A(void* a, void* b, uint32_t c, uint32_t d, int e, int f, int g, int h) \
{ \
RunFunctionFmt(ref_zwp_relative_pointer_v1_listener_##A->relative_motion, "ppuuiiii", a, b, c, d, e, f, g, h); \
} \
static my_zwp_relative_pointer_v1_listener_t my_zwp_relative_pointer_v1_listener_fct_##A = { \
(uintptr_t)my_zwp_relative_pointer_v1_listener_relative_motion_##A, \
};
SUPER()
#undef GO
static void* find_zwp_relative_pointer_v1_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_zwp_relative_pointer_v1_listener_##A == fct) return &my_zwp_relative_pointer_v1_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_zwp_relative_pointer_v1_listener_##A == 0) {ref_zwp_relative_pointer_v1_listener_##A = fct; return &my_zwp_relative_pointer_v1_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client zwp_relative_pointer_v1_listener callback\n");
return NULL;
}
// zxdg_output_v1_listener ...
typedef struct my_zxdg_output_v1_listener_s {
uintptr_t logical_position; //vFppii
uintptr_t logical_size; //vFppii
uintptr_t done; //vFpp
uintptr_t name; //vFppp
uintptr_t description; //vFppp
} my_zxdg_output_v1_listener_t;
#define GO(A) \
static my_zxdg_output_v1_listener_t* ref_zxdg_output_v1_listener_##A = NULL; \
static void my_zxdg_output_v1_listener_logical_position_##A(void* a, void* b, int32_t c, int32_t d) \
{ \
RunFunctionFmt(ref_zxdg_output_v1_listener_##A->logical_position, "ppii", a, b, c, d); \
} \
static void my_zxdg_output_v1_listener_logical_size_##A(void* a, void* b, int32_t c, int32_t d) \
{ \
RunFunctionFmt(ref_zxdg_output_v1_listener_##A->logical_size, "ppii", a, b, c, d); \
} \
static void my_zxdg_output_v1_listener_done_##A(void* a, void* b) \
{ \
RunFunctionFmt(ref_zxdg_output_v1_listener_##A->done, "pp", a, b); \
} \
static void my_zxdg_output_v1_listener_name_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_zxdg_output_v1_listener_##A->name, "ppp", a, b, c); \
} \
static void my_zxdg_output_v1_listener_description_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_zxdg_output_v1_listener_##A->description, "ppp", a, b, c); \
} \
static my_zxdg_output_v1_listener_t my_zxdg_output_v1_listener_fct_##A = { \
(uintptr_t)my_zxdg_output_v1_listener_logical_position_##A, \
(uintptr_t)my_zxdg_output_v1_listener_logical_size_##A, \
(uintptr_t)my_zxdg_output_v1_listener_done_##A, \
(uintptr_t)my_zxdg_output_v1_listener_name_##A, \
(uintptr_t)my_zxdg_output_v1_listener_description_##A, \
};
SUPER()
#undef GO
static void* find_zxdg_output_v1_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_zxdg_output_v1_listener_##A == fct) return &my_zxdg_output_v1_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_zxdg_output_v1_listener_##A == 0) {ref_zxdg_output_v1_listener_##A = fct; return &my_zxdg_output_v1_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client zxdg_output_v1_listener callback\n");
return NULL;
}
// wl_data_device_listener ...
typedef struct my_wl_data_device_listener_s {
uintptr_t data_offer; //vFppp
uintptr_t enter; //vFppupiip
uintptr_t leave; //vFpp
uintptr_t motion; //vFppuii
uintptr_t drop; //vFpp
uintptr_t selection; //vFppp
} my_wl_data_device_listener_t;
#define GO(A) \
static my_wl_data_device_listener_t* ref_wl_data_device_listener_##A = NULL; \
static void my_wl_data_device_listener_data_offer_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_wl_data_device_listener_##A->data_offer, "ppp", a, b, c); \
} \
static void my_wl_data_device_listener_enter_##A(void* a, void* b, uint32_t c, void* d, int e, int f, void* g) \
{ \
RunFunctionFmt(ref_wl_data_device_listener_##A->enter, "ppupiip", a, b, c, d, e, f, g); \
} \
static void my_wl_data_device_listener_leave_##A(void* a, void* b) \
{ \
RunFunctionFmt(ref_wl_data_device_listener_##A->leave, "pp", a, b); \
} \
static void my_wl_data_device_listener_motion_##A(void* a, void* b, uint32_t c, int d, int e) \
{ \
RunFunctionFmt(ref_wl_data_device_listener_##A->motion, "ppuii", a, b, c, d, e); \
} \
static void my_wl_data_device_listener_drop_##A(void* a, void* b) \
{ \
RunFunctionFmt(ref_wl_data_device_listener_##A->drop, "pp", a, b); \
} \
static void my_wl_data_device_listener_selection_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_wl_data_device_listener_##A->selection, "ppp", a, b, c); \
} \
static my_wl_data_device_listener_t my_wl_data_device_listener_fct_##A = { \
(uintptr_t)my_wl_data_device_listener_data_offer_##A, \
(uintptr_t)my_wl_data_device_listener_enter_##A, \
(uintptr_t)my_wl_data_device_listener_leave_##A, \
(uintptr_t)my_wl_data_device_listener_motion_##A, \
(uintptr_t)my_wl_data_device_listener_drop_##A, \
(uintptr_t)my_wl_data_device_listener_selection_##A, \
};
SUPER()
#undef GO
static void* find_wl_data_device_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_data_device_listener_##A == fct) return &my_wl_data_device_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_data_device_listener_##A == 0) {ref_wl_data_device_listener_##A = fct; return &my_wl_data_device_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_data_device_listener callback\n");
return NULL;
}
// wl_touch_listener ...
typedef struct my_wl_touch_listener_s {
uintptr_t down; //vFppuupiii
uintptr_t up; //vFppuui
uintptr_t motion; //vFppuiii
uintptr_t frame; //vFpp
uintptr_t cancel; //vFpp
} my_wl_touch_listener_t;
#define GO(A) \
static my_wl_touch_listener_t* ref_wl_touch_listener_##A = NULL; \
static void my_wl_touch_listener_down_##A(void* a, void* b, uint32_t c, uint32_t d, void* e, int f, int g, int h) \
{ \
RunFunctionFmt(ref_wl_touch_listener_##A->down, "ppuuppiii", a, b, c, d, e, f, g, h); \
} \
static void my_wl_touch_listener_up_##A(void* a, void* b, uint32_t c, uint32_t d, int e) \
{ \
RunFunctionFmt(ref_wl_touch_listener_##A->up, "ppuui", a, b, c, d, e); \
} \
static void my_wl_touch_listener_motion_##A(void* a, void* b, uint32_t c, int d, int e, int f) \
{ \
RunFunctionFmt(ref_wl_touch_listener_##A->motion, "ppuiii", a, b, c, d, e, f); \
} \
static void my_wl_touch_listener_frame_##A(void* a, void* b) \
{ \
RunFunctionFmt(ref_wl_touch_listener_##A->frame, "pp", a, b); \
} \
static void my_wl_touch_listener_cancel_##A(void* a, void* b) \
{ \
RunFunctionFmt(ref_wl_touch_listener_##A->cancel, "pp", a, b); \
} \
static my_wl_touch_listener_t my_wl_touch_listener_fct_##A = { \
(uintptr_t)my_wl_touch_listener_down_##A, \
(uintptr_t)my_wl_touch_listener_up_##A, \
(uintptr_t)my_wl_touch_listener_motion_##A, \
(uintptr_t)my_wl_touch_listener_frame_##A, \
(uintptr_t)my_wl_touch_listener_cancel_##A, \
};
SUPER()
#undef GO
static void* find_wl_touch_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_touch_listener_##A == fct) return &my_wl_touch_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_touch_listener_##A == 0) {ref_wl_touch_listener_##A = fct; return &my_wl_touch_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_touch_listener callback\n");
return NULL;
}
// zwp_text_input_v3_listener ...
typedef struct my_zwp_text_input_v3_listener_s {
uintptr_t enter; //vFppp
uintptr_t leave; //vFppp
uintptr_t preedit_string; //vFpppii
uintptr_t commit_string; //vFppp
uintptr_t delete_surrounding_text; //vFpppuu
uintptr_t done; //vFppu
} my_zwp_text_input_v3_listener_t;
#define GO(A) \
static my_zwp_text_input_v3_listener_t* ref_zwp_text_input_v3_listener_##A = NULL; \
static void my_zwp_text_input_v3_listener_enter_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->enter, "ppp", a, b, c); \
} \
static void my_zwp_text_input_v3_listener_leave_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->leave, "ppp", a, b, c); \
} \
static void my_zwp_text_input_v3_listener_preedit_string_##A(void* a, void* b, void* c, int d, int e) \
{ \
RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->preedit_string, "pppii", a, b, c, d, e); \
} \
static void my_zwp_text_input_v3_listener_commit_string_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->commit_string, "ppp", a, b, c); \
} \
static void my_zwp_text_input_v3_listener_delete_surrounding_text_##A(void* a, void* b, void* c, uint32_t d, uint32_t e) \
{ \
RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->delete_surrounding_text, "pppuu", a, b, c, d, e); \
} \
static void my_zwp_text_input_v3_listener_done_##A(void* a, void* b, uint32_t c) \
{ \
RunFunctionFmt(ref_zwp_text_input_v3_listener_##A->done, "ppu", a, b, c); \
} \
static my_zwp_text_input_v3_listener_t my_zwp_text_input_v3_listener_fct_##A = { \
(uintptr_t)my_zwp_text_input_v3_listener_enter_##A, \
(uintptr_t)my_zwp_text_input_v3_listener_leave_##A, \
(uintptr_t)my_zwp_text_input_v3_listener_preedit_string_##A, \
(uintptr_t)my_zwp_text_input_v3_listener_commit_string_##A, \
(uintptr_t)my_zwp_text_input_v3_listener_delete_surrounding_text_##A, \
(uintptr_t)my_zwp_text_input_v3_listener_done_##A, \
};
SUPER()
#undef GO
static void* find_zwp_text_input_v3_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_zwp_text_input_v3_listener_##A == fct) return &my_zwp_text_input_v3_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_zwp_text_input_v3_listener_##A == 0) {ref_zwp_text_input_v3_listener_##A = fct; return &my_zwp_text_input_v3_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client zwp_text_input_v3_listener callback\n");
return NULL;
}
// zwp_tablet_seat_v2_listener ...
typedef struct my_zwp_tablet_seat_v2_listener_s {
uintptr_t tablet_added; //vFppp
uintptr_t tool_added; //vFppp
uintptr_t pad_added; //vFppp
} my_zwp_tablet_seat_v2_listener_t;
#define GO(A) \
static my_zwp_tablet_seat_v2_listener_t* ref_zwp_tablet_seat_v2_listener_##A = NULL; \
static void my_zwp_tablet_seat_v2_listener_tablet_added_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_zwp_tablet_seat_v2_listener_##A->tablet_added, "ppp", a, b, c); \
} \
static void my_zwp_tablet_seat_v2_listener_tool_added_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_zwp_tablet_seat_v2_listener_##A->tool_added, "ppp", a, b, c); \
} \
static void my_zwp_tablet_seat_v2_listener_pad_added_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_zwp_tablet_seat_v2_listener_##A->pad_added, "ppp", a, b, c); \
} \
static my_zwp_tablet_seat_v2_listener_t my_zwp_tablet_seat_v2_listener_fct_##A = { \
(uintptr_t)my_zwp_tablet_seat_v2_listener_tablet_added_##A, \
(uintptr_t)my_zwp_tablet_seat_v2_listener_tool_added_##A, \
(uintptr_t)my_zwp_tablet_seat_v2_listener_pad_added_##A, \
};
SUPER()
#undef GO
static void* find_zwp_tablet_seat_v2_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_zwp_tablet_seat_v2_listener_##A == fct) return &my_zwp_tablet_seat_v2_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_zwp_tablet_seat_v2_listener_##A == 0) {ref_zwp_tablet_seat_v2_listener_##A = fct; return &my_zwp_tablet_seat_v2_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client zwp_tablet_seat_v2_listener callback\n");
return NULL;
}
// xdg_activation_token_v1_listener ...
typedef struct my_xdg_activation_token_v1_listener_s {
uintptr_t done; //vFppp
} my_xdg_activation_token_v1_listener_t;
#define GO(A) \
static my_xdg_activation_token_v1_listener_t* ref_xdg_activation_token_v1_listener_##A = NULL; \
static void my_xdg_activation_token_v1_listener_done_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_xdg_activation_token_v1_listener_##A->done, "ppp", a, b, c); \
} \
static my_xdg_activation_token_v1_listener_t my_xdg_activation_token_v1_listener_fct_##A = { \
(uintptr_t)my_xdg_activation_token_v1_listener_done_##A, \
};
SUPER()
#undef GO
static void* find_xdg_activation_token_v1_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_xdg_activation_token_v1_listener_##A == fct) return &my_xdg_activation_token_v1_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_xdg_activation_token_v1_listener_##A == 0) {ref_xdg_activation_token_v1_listener_##A = fct; return &my_xdg_activation_token_v1_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client xdg_activation_token_v1_listener callback\n");
return NULL;
}
// wl_surface_listener ...
typedef struct my_wl_surface_listener_s {
uintptr_t enter; //vFppp
uintptr_t leave; //vFppp
} my_wl_surface_listener_t;
#define GO(A) \
static my_wl_surface_listener_t* ref_wl_surface_listener_##A = NULL; \
static void my_wl_surface_listener_enter_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_wl_surface_listener_##A->enter, "ppp", a, b, c); \
} \
static void my_wl_surface_listener_leave_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_wl_surface_listener_##A->leave, "ppp", a, b, c); \
} \
static my_wl_surface_listener_t my_wl_surface_listener_fct_##A = { \
(uintptr_t)my_wl_surface_listener_enter_##A, \
(uintptr_t)my_wl_surface_listener_leave_##A, \
};
SUPER()
#undef GO
static void* find_wl_surface_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_surface_listener_##A == fct) return &my_wl_surface_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_surface_listener_##A == 0) {ref_wl_surface_listener_##A = fct; return &my_wl_surface_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_surface_listener callback\n");
return NULL;
}
// wl_callback_listener ...
typedef struct my_wl_callback_listener_s {
uintptr_t done; //vFppp
} my_wl_callback_listener_t;
#define GO(A) \
static my_wl_callback_listener_t* ref_wl_callback_listener_##A = NULL; \
static void my_wl_callback_listener_done_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_wl_callback_listener_##A->done, "ppp", a, b, c); \
} \
static my_wl_callback_listener_t my_wl_callback_listener_fct_##A = { \
(uintptr_t)my_wl_callback_listener_done_##A, \
};
SUPER()
#undef GO
static void* find_wl_callback_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_callback_listener_##A == fct) return &my_wl_callback_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_callback_listener_##A == 0) {ref_wl_callback_listener_##A = fct; return &my_wl_callback_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_callback_listener callback\n");
return NULL;
}
// wp_fractional_scale_v1_listener ...
typedef struct my_wp_fractional_scale_v1_listener_s {
uintptr_t prefered_scale; //vFppu
} my_wp_fractional_scale_v1_listener_t;
#define GO(A) \
static my_wp_fractional_scale_v1_listener_t* ref_wp_fractional_scale_v1_listener_##A = NULL; \
static void my_wp_fractional_scale_v1_listener_prefered_scale_##A(void* a, void* b, uint32_t c) \
{ \
RunFunctionFmt(ref_wp_fractional_scale_v1_listener_##A->prefered_scale, "ppu", a, b, c); \
} \
static my_wp_fractional_scale_v1_listener_t my_wp_fractional_scale_v1_listener_fct_##A = { \
(uintptr_t)my_wp_fractional_scale_v1_listener_prefered_scale_##A, \
};
SUPER()
#undef GO
static void* find_wp_fractional_scale_v1_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wp_fractional_scale_v1_listener_##A == fct) return &my_wp_fractional_scale_v1_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wp_fractional_scale_v1_listener_##A == 0) {ref_wp_fractional_scale_v1_listener_##A = fct; return &my_wp_fractional_scale_v1_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wp_fractional_scale_v1_listener callback\n");
return NULL;
}
// zwp_primary_selection_device_v1_listener ...
typedef struct my_zwp_primary_selection_device_v1_listener_s {
uintptr_t data_offer; //vFppp
uintptr_t selection; //vFppp
} my_zwp_primary_selection_device_v1_listener_t;
#define GO(A) \
static my_zwp_primary_selection_device_v1_listener_t* ref_zwp_primary_selection_device_v1_listener_##A = NULL; \
static void my_zwp_primary_selection_device_v1_listener_data_offer_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_zwp_primary_selection_device_v1_listener_##A->data_offer, "ppp", a, b, c); \
} \
static void my_zwp_primary_selection_device_v1_listener_selection_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_zwp_primary_selection_device_v1_listener_##A->selection, "ppp", a, b, c); \
} \
static my_zwp_primary_selection_device_v1_listener_t my_zwp_primary_selection_device_v1_listener_fct_##A = { \
(uintptr_t)my_zwp_primary_selection_device_v1_listener_data_offer_##A, \
(uintptr_t)my_zwp_primary_selection_device_v1_listener_selection_##A, \
};
SUPER()
#undef GO
static void* find_zwp_primary_selection_device_v1_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_zwp_primary_selection_device_v1_listener_##A == fct) return &my_zwp_primary_selection_device_v1_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_zwp_primary_selection_device_v1_listener_##A == 0) {ref_zwp_primary_selection_device_v1_listener_##A = fct; return &my_zwp_primary_selection_device_v1_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client zwp_primary_selection_device_v1_listener callback\n");
return NULL;
}
// wl_data_offer_listener ...
typedef struct my_wl_data_offer_listener_s {
uintptr_t offer; //vFppp
uintptr_t source_actions; //vFppu
uintptr_t action; //vFppu
} my_wl_data_offer_listener_t;
#define GO(A) \
static my_wl_data_offer_listener_t* ref_wl_data_offer_listener_##A = NULL; \
static void my_wl_data_offer_listener_offer_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_wl_data_offer_listener_##A->offer, "ppp", a, b, c); \
} \
static void my_wl_data_offer_listener_source_actions_##A(void* a, void* b, uint32_t c) \
{ \
RunFunctionFmt(ref_wl_data_offer_listener_##A->source_actions, "ppu", a, b, c); \
} \
static void my_wl_data_offer_listener_action_##A(void* a, void* b, uint32_t c) \
{ \
RunFunctionFmt(ref_wl_data_offer_listener_##A->action, "ppu", a, b, c); \
} \
static my_wl_data_offer_listener_t my_wl_data_offer_listener_fct_##A = { \
(uintptr_t)my_wl_data_offer_listener_offer_##A, \
(uintptr_t)my_wl_data_offer_listener_source_actions_##A, \
(uintptr_t)my_wl_data_offer_listener_action_##A, \
};
SUPER()
#undef GO
static void* find_wl_data_offer_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_wl_data_offer_listener_##A == fct) return &my_wl_data_offer_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_wl_data_offer_listener_##A == 0) {ref_wl_data_offer_listener_##A = fct; return &my_wl_data_offer_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client wl_data_offer_listener callback\n");
return NULL;
}
// zwp_primary_selection_offer_v1_listener ...
typedef struct my_zwp_primary_selection_offer_v1_listener_s {
uintptr_t primary_offer; //vFppp
} my_zwp_primary_selection_offer_v1_listener_t;
#define GO(A) \
static my_zwp_primary_selection_offer_v1_listener_t* ref_zwp_primary_selection_offer_v1_listener_##A = NULL; \
static void my_zwp_primary_selection_offer_v1_listener_primary_offer_##A(void* a, void* b, void* c) \
{ \
RunFunctionFmt(ref_zwp_primary_selection_offer_v1_listener_##A->primary_offer, "ppp", a, b, c); \
} \
static my_zwp_primary_selection_offer_v1_listener_t my_zwp_primary_selection_offer_v1_listener_fct_##A = { \
(uintptr_t)my_zwp_primary_selection_offer_v1_listener_primary_offer_##A, \
};
SUPER()
#undef GO
static void* find_zwp_primary_selection_offer_v1_listener_Fct(void* fct)
{
if(!fct) return fct;
#define GO(A) if(ref_zwp_primary_selection_offer_v1_listener_##A == fct) return &my_zwp_primary_selection_offer_v1_listener_fct_##A;
SUPER()
#undef GO
#define GO(A) if(ref_zwp_primary_selection_offer_v1_listener_##A == 0) {ref_zwp_primary_selection_offer_v1_listener_##A = fct; return &my_zwp_primary_selection_offer_v1_listener_fct_##A; }
SUPER()
#undef GO
printf_log(LOG_NONE, "Warning, no more slot for wayland-client zwp_primary_selection_offer_v1_listener callback\n");
return NULL;
}
#undef SUPER
EXPORT int my_wl_proxy_add_listener(x64emu_t* emu, void* proxy, void** l, void* data)
{
const char* proxy_name = **(const char***)proxy;
if(!strcmp(proxy_name, "wl_registry")) {
l = find_wl_registry_listener_Fct(l);
} else if(!strcmp(proxy_name, "xdg_surface")) {
l = find_xdg_surface_listener_Fct(l);
} else if(!strcmp(proxy_name, "xdg_toplevel")) {
l = find_xdg_toplevel_listener_Fct(l);
} else if(!strcmp(proxy_name, "xdg_wm_base")) {
l = find_xdg_wm_base_listener_Fct(l);
} else if(!strcmp(proxy_name, "wl_shm")) {
l = find_wl_shm_listener_Fct(l);
} else if(!strcmp(proxy_name, "wl_output")) {
l = find_wl_output_listener_Fct(l);
} else if(!strcmp(proxy_name, "wl_seat")) {
l = find_wl_seat_listener_Fct(l);
} else if(!strcmp(proxy_name, "wl_pointer")) {
l = find_wl_pointer_listener_Fct(l);
} else if(!strcmp(proxy_name, "wl_keyboard")) {
l = find_wl_keyboard_listener_Fct(l);
} else if(!strcmp(proxy_name, "wl_buffer")) {
l = find_wl_buffer_listener_Fct(l);
} else if(!strcmp(proxy_name, "zwp_relative_pointer_v1")) {
l = find_zwp_relative_pointer_v1_listener_Fct(l);
} else if(!strcmp(proxy_name, "zxdg_output_v1")) {
l = find_zxdg_output_v1_listener_Fct(l);
} else if(!strcmp(proxy_name, "wl_data_device")) {
l = find_wl_data_device_listener_Fct(l);
} else if(!strcmp(proxy_name, "wl_touch")) {
l = find_wl_touch_listener_Fct(l);
} else if(!strcmp(proxy_name, "zwp_text_input_v3")) {
l = find_zwp_text_input_v3_listener_Fct(l);
} else if(!strcmp(proxy_name, "zwp_tablet_seat_v2")) {
l = find_zwp_tablet_seat_v2_listener_Fct(l);
} else if(!strcmp(proxy_name, "xdg_activation_token_v1")) {
l = find_xdg_activation_token_v1_listener_Fct(l);
} else if(!strcmp(proxy_name, "wl_surface")) {
l = find_wl_surface_listener_Fct(l);
} else if(!strcmp(proxy_name, "wl_callback")) {
l = find_wl_callback_listener_Fct(l);
} else if(!strcmp(proxy_name, "wp_fractional_scale_v1")) {
l = find_wp_fractional_scale_v1_listener_Fct(l);
} else if(!strcmp(proxy_name, "zwp_primary_selection_device_v1")) {
l = find_zwp_primary_selection_device_v1_listener_Fct(l);
} else if(!strcmp(proxy_name, "wl_data_offer")) {
l = find_wl_data_offer_listener_Fct(l);
} else if(!strcmp(proxy_name, "zwp_primary_selection_offer_v1")) {
l = find_zwp_primary_selection_offer_v1_listener_Fct(l);
} else
printf_log(LOG_INFO, "Error, Wayland-client, add_listener to %s unknown, will crash soon!\n", proxy_name);
return my->wl_proxy_add_listener(proxy, l, data);
}
EXPORT void my_wl_log_set_handler_client(x64emu_t* emu, void* f)
{
my->wl_log_set_handler_client(find_wl_log_func_t_Fct(f));
}
#include "wrappedlib_init.h"
|