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
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
|
#ifndef MY_X11_DEFS_32
#define MY_X11_DEFS_32
#include <stdint.h>
#include "box32.h"
typedef ulong_t XID_32;
typedef struct ximage_32_s {
ptr_t create_image;
ptr_t destroy_image;
ptr_t get_pixel;
ptr_t put_pixel;
ptr_t sub_image;
ptr_t add_pixel;
} ximage_32_t;
typedef struct _XImage_32 {
int32_t width, height;
int32_t xoffset;
int32_t format;
ptr_t data;
int byte_order;
int bitmap_unit;
int bitmap_bit_order;
int bitmap_pad;
int depth;
int bytes_per_line;
int bits_per_pixel;
ulong_t red_mask;
ulong_t green_mask;
ulong_t blue_mask;
ptr_t obdata;
ximage_32_t f;
} XImage_32;
struct my_XFreeFuncs_32 {
ptr_t atoms; // void*
ptr_t modifiermap; // void*
ptr_t key_bindings; // void*
ptr_t context_db; // void*
ptr_t defaultCCCs; // void*
ptr_t clientCmaps; // void*
ptr_t intensityMaps; // void*
ptr_t im_filters; // void*
ptr_t xkb; // void*
};
struct my_XExten_32 {
ptr_t next; //struct my_XExten *
ptr_t codes; // XExtCodes
ptr_t create_GC; // CreateGCType
ptr_t copy_GC; // CopyGCType
ptr_t flush_GC; // FlushGCType
ptr_t free_GC; // FreeGCType
ptr_t create_Font; // CreateFontType
ptr_t free_Font; // FreeFontType
ptr_t close_display; // CloseDisplayType
ptr_t error; // ErrorType
ptr_t error_string; // ErrorStringType
ptr_t name; //char*
ptr_t error_values; // PrintErrorType
ptr_t before_flush; // BeforeFlushType
ptr_t next_flush; //struct my_XExten *
};
struct my_XInternalAsync_32 {
ptr_t next; //struct my_XInternalAsync_32 *
ptr_t handler; //int (*handler)(void*, void*, char*, int, void*);
ptr_t data; //void*
};
struct my_XLockPtrs_32 {
ptr_t lock_display;// void (*lock_display)(void* dpy);
ptr_t unlock_display;// void (*unlock_display)(void *dpy);
};
struct my_XConnectionInfo_32 {
int fd;
ptr_t read_callback; // _XInternalConnectionProc
ptr_t call_data;
ptr_t watch_data; // void**
struct my_XConnectionInfo *next;
};
struct my_XConnWatchInfo_32 {
ptr_t fn; // XConnectionWatchProc
ptr_t client_data;
ptr_t next; //struct _XConnWatchInfo *
};
typedef struct my_Visual_32_s {
ptr_t ext_data; //XExtData*
XID_32 visualid;
int c_class;
ulong_t red_mask, green_mask, blue_mask;
int bits_per_rgb;
int map_entries;
} my_Visual_32_t;
typedef struct my_Screen_32_s {
ptr_t ext_data; //XExtData *
ptr_t display; //struct my_XDisplay_s *
XID_32 root;
int width, height;
int mwidth, mheight;
int ndepths;
ptr_t depths; //Depth *
int root_depth; /* bits per pixel */
ptr_t root_visual; //Visual *
ptr_t default_gc; //GC == struct _XGC*
XID_32 cmap;
ulong_t white_pixel;
ulong_t black_pixel;
int max_maps, min_maps;
int backing_store;
int save_unders;
long_t root_input_mask;
} my_Screen_32_t;
typedef struct my_XDisplay_32_s
{
ptr_t ext_data; //void * //offset = 0x00
ptr_t free_funcs; //struct my_XFreeFuncs_32 *
int fd;
int conn_checker;
int proto_major_version; //offset = 0x10
int proto_minor_version;
ptr_t vendor; //char *
XID_32 resource_base;
XID_32 resource_mask; // offset = 0x20
XID_32 resource_id;
int resource_shift;
ptr_t resource_alloc;//XID_32 (*resource_alloc)(void*);
int byte_order; // offset = 0x30
int bitmap_unit;
int bitmap_pad;
int bitmap_bit_order;
int nformats; //offset = 0x40
ptr_t pixmap_format; //void *
int vnumber;
int release;
ptr_t head, tail; //ofsset = 0x50
int qlen;
ulong_t last_request_read;
ulong_t request; //offset = 0x60
ptr_t last_req; //char *
ptr_t buffer; //char *
ptr_t bufptr; //char *
ptr_t bufmax; //char * //offset = 0x70
unsigned max_request_size;
ptr_t db; //void* *
ptr_t synchandler; //int (*synchandler)(void*);
ptr_t display_name;//char * //offset = 0x80
int default_screen;
int nscreens;
ptr_t screens;//void *
ulong_t motion_buffer; //offset = 0x90
volatile ulong_t flags;
int min_keycode;
int max_keycode;
ptr_t keysyms; //void * //offset = 0xA0
ptr_t modifiermap; //void *
int keysyms_per_keycode;
ptr_t xdefaults; //char *
ptr_t scratch_buffer; //char * //offset = 0xB0
ulong_t scratch_length;
int ext_number;
ptr_t ext_procs; //struct my_XExten *
ptr_t event_vec[128]; //int (*event_vec[128])(void *, void *, void *); // start at 0xC0
ptr_t wire_vec[128]; //int (*wire_vec[128])(void *, void *, void *);
XID_32 lock_meaning; //offset = 0x4C0
ptr_t lock; //void*
ptr_t async_handlers; //struct my_XInternalAsync *
ulong_t bigreq_size;
ptr_t lock_fns; //struct my_XLockPtrs * //offset = 0x4D0
ptr_t idlist_alloc; //void (*idlist_alloc)(void *, void *, int);
ptr_t key_bindings; //void*
XID_32 cursor_font;
ptr_t atoms; //void* *
unsigned int mode_switch;
unsigned int num_lock;
ptr_t context_db; //void*
ptr_t error_vec; //int (**error_vec)(void*, void*, void*);
struct {
ptr_t defaultCCCs; //void*
ptr_t clientCmaps; //void*
ptr_t perVisualIntensityMaps; //void*
} cms;
ptr_t im_filters; //void*
ptr_t qfree; //void*
ulong_t next_event_32_serial_num;
ptr_t flushes; //struct my_XExten *
ptr_t im_fd_info; //struct my_XConnectionInfo *
int im_fd_length;
ptr_t conn_watchers; //struct my_XConnWatchInfo *
int watcher_count;
ptr_t filedes; //void*
ptr_t savedsynchandler; //int (*savedsynchandler)(void *);
XID_32 resource_max;
int xcmisc_opcode;
ptr_t xkb_info; //void* *
ptr_t trans_conn; //void* *
ptr_t xcb; //void* *
unsigned int next_cookie;
ptr_t generic_event_vec[128]; //int (*generic_event_vec[128])(void*, void*, void*);
ptr_t generic_event_copy_vec[128]; //int (*generic_event_copy_vec[128])(void*, void*, void*);
ptr_t cookiejar; //void *
ptr_t error_threads; //void *
ptr_t exit_handler; //void *
ptr_t exit_handler_data; //void *
} my_XDisplay_32_t;
typedef struct my_XSetWindowAttributes_32_s {
XID_32 background_pixmap;
ulong_t background_pixel;
XID_32 border_pixmap;
ulong_t border_pixel;
int bit_gravity;
int win_gravity;
int backing_store;
ulong_t backing_planes;
ulong_t backing_pixel;
int save_under;
long_t event_mask;
long_t do_not_propagate_mask;
int override_redirect;
XID_32 colormap;
XID_32 cursor;
} my_XSetWindowAttributes_32_t;
// Events
typedef struct my_XKeyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 root;
XID_32 subwindow;
ulong_t time;
int x, y;
int x_root, y_root;
unsigned int state;
unsigned int keycode;
int same_screen;
} my_XKeyEvent_32_t;
typedef my_XKeyEvent_32_t my_XKeyPressedEvent_32_t;
typedef my_XKeyEvent_32_t my_XKeyReleasedEvent_32_t;
typedef struct my_XButtonEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 root;
XID_32 subwindow;
ulong_t time;
int x, y;
int x_root, y_root;
unsigned int state;
unsigned int button;
int same_screen;
} my_XButtonEvent_32_t;
typedef my_XButtonEvent_32_t my_XButtonPressedEvent_32_t;
typedef my_XButtonEvent_32_t my_XButtonReleasedEvent_32_t;
typedef struct my_XMotionEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 root;
XID_32 subwindow;
ulong_t time;
int x, y;
int x_root, y_root;
unsigned int state;
char is_hint;
int same_screen;
} my_XMotionEvent_32_t;
typedef my_XMotionEvent_32_t my_XPointerMovedEvent_32_t;
typedef struct my_XCrossingEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 root;
XID_32 subwindow;
ulong_t time;
int x, y;
int x_root, y_root;
int mode;
int detail;
int same_screen;
int focus;
unsigned int state;
} my_XCrossingEvent_32_t;
typedef my_XCrossingEvent_32_t my_XEnterWindowEvent_32_t;
typedef my_XCrossingEvent_32_t my_XLeaveWindowEvent_32_t;
typedef struct my_XFocusChangeEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
int mode;
int detail;
} my_XFocusChangeEvent_32_t;
typedef my_XFocusChangeEvent_32_t my_XFocusInEvent_32_t;
typedef my_XFocusChangeEvent_32_t my_XFocusOutEvent_32_t;
typedef struct my_XKeymapEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
char key_vector[32];
} my_XKeymapEvent_32_t;
typedef struct my_XExposeEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
int x, y;
int width, height;
int count;
} my_XExposeEvent_32_t;
typedef struct my_XGraphicsExposeEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 drawable;
int x, y;
int width, height;
int count;
int major_code;
int minor_code;
} my_XGraphicsExposeEvent_32_t;
typedef struct my_XNoExposeEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 drawable;
int major_code;
int minor_code;
} my_XNoExposeEvent_32_t;
typedef struct my_XVisibilityEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
int state;
} my_XVisibilityEvent_32_t;
typedef struct my_XCreateWindowEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 parent;
XID_32 window;
int x, y;
int width, height;
int border_width;
int override_redirect;
} my_XCreateWindowEvent_32_t;
typedef struct my_XDestroyWindowEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 event;
XID_32 window;
} my_XDestroyWindowEvent_32_t;
typedef struct my_XUnmapEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 event;
XID_32 window;
int from_configure;
} my_XUnmapEvent_32_t;
typedef struct my_XMapEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 event;
XID_32 window;
int override_redirect;
} my_XMapEvent_32_t;
typedef struct my_XMapRequestEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 parent;
XID_32 window;
} my_XMapRequestEvent_32_t;
typedef struct my_XReparentEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 event;
XID_32 window;
XID_32 parent;
int x, y;
int override_redirect;
} my_XReparentEvent_32_t;
typedef struct my_XConfigureEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 event;
XID_32 window;
int x, y;
int width, height;
int border_width;
XID_32 above;
int override_redirect;
} my_XConfigureEvent_32_t;
typedef struct my_XGravityEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 event;
XID_32 window;
int x, y;
} my_XGravityEvent_32_t;
typedef struct my_XResizeRequestEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
int width, height;
} my_XResizeRequestEvent_32_t;
typedef struct my_XConfigureRequestEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 parent;
XID_32 window;
int x, y;
int width, height;
int border_width;
XID_32 above;
int detail;
ulong_t value_mask;
} my_XConfigureRequestEvent_32_t;
typedef struct my_XCirculateEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 event;
XID_32 window;
int place;
} my_XCirculateEvent_32_t;
typedef struct my_XCirculateRequestEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 parent;
XID_32 window;
int place;
} my_XCirculateRequestEvent_32_t;
typedef struct my_XPropertyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 atom;
ulong_t time;
int state;
} my_XPropertyEvent_32_t;
typedef struct my_XSelectionClearEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 selection;
ulong_t time;
} my_XSelectionClearEvent_32_t;
typedef struct my_XSelectionRequestEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 owner;
XID_32 requestor;
XID_32 selection;
XID_32 target;
XID_32 property;
ulong_t time;
} my_XSelectionRequestEvent_32_t;
typedef struct my_XSelectionEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 requestor;
XID_32 selection;
XID_32 target;
XID_32 property;
ulong_t time;
} my_XSelectionEvent_32_t;
typedef struct my_XColormapEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 colormap;
int c_new;
int state;
} my_XColormapEvent_32_t;
typedef struct my_XClientMessageEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 message_type;
int format;
union {
char b[20];
short s[10];
long_t l[5];
} data;
} my_XClientMessageEvent_32_t;
typedef struct my_XMappingEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
int request;
int first_keycode;
int count;
} my_XMappingEvent_32_t;
typedef struct my_XErrorEvent_32_s
{
int type;
ptr_t display; //Display*
XID_32 resourceid;
ulong_t serial;
unsigned char error_code;
unsigned char request_code;
unsigned char minor_code;
} my_XErrorEvent_32_t;
typedef struct my_XAnyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
} my_XAnyEvent_32_t;
typedef struct my_XGenericEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
int extension;
int evtype;
} my_XGenericEvent_32_t;
typedef struct my_XGenericEventCookie_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
int extension;
int evtype;
unsigned int cookie;
ptr_t data; //void*
} my_XGenericEventCookie_32_t;
typedef union my_XEvent_32_s {
int type;
my_XAnyEvent_32_t xany;
my_XKeyEvent_32_t xkey;
my_XButtonEvent_32_t xbutton;
my_XMotionEvent_32_t xmotion;
my_XCrossingEvent_32_t xcrossing;
my_XFocusChangeEvent_32_t xfocus;
my_XExposeEvent_32_t xexpose;
my_XGraphicsExposeEvent_32_t xgraphicsexpose;
my_XNoExposeEvent_32_t xnoexpose;
my_XVisibilityEvent_32_t xvisibility;
my_XCreateWindowEvent_32_t xcreatewindow;
my_XDestroyWindowEvent_32_t xdestroywindow;
my_XUnmapEvent_32_t xunmap;
my_XMapEvent_32_t xmap;
my_XMapRequestEvent_32_t xmaprequest;
my_XReparentEvent_32_t xreparent;
my_XConfigureEvent_32_t xconfigure;
my_XGravityEvent_32_t xgravity;
my_XResizeRequestEvent_32_t xresizerequest;
my_XConfigureRequestEvent_32_t xconfigurerequest;
my_XCirculateEvent_32_t xcirculate;
my_XCirculateRequestEvent_32_t xcirculaterequest;
my_XPropertyEvent_32_t xproperty;
my_XSelectionClearEvent_32_t xselectionclear;
my_XSelectionRequestEvent_32_t xselectionrequest;
my_XSelectionEvent_32_t xselection;
my_XColormapEvent_32_t xcolormap;
my_XClientMessageEvent_32_t xclient;
my_XMappingEvent_32_t xmapping;
my_XErrorEvent_32_t xerror;
my_XKeymapEvent_32_t xkeymap;
my_XGenericEvent_32_t xgeneric;
my_XGenericEventCookie_32_t xcookie;
long_t pad[24];
} my_XEvent_32_t;
// WMHints
typedef struct my_XWMHints_32_s {
long_t flags;
int input;
int initial_state;
XID_32 icon_pixmap;
XID_32 icon_window;
int icon_x;
int icon_y;
XID_32 icon_mask;
XID_32 window_group;
} my_XWMHints_32_t;
typedef struct my_XRRModeInfo_32_s {
XID_32 id;
unsigned int width;
unsigned int height;
ulong_t dotClock;
unsigned int hSyncStart;
unsigned int hSyncEnd;
unsigned int hTotal;
unsigned int hSkew;
unsigned int vSyncStart;
unsigned int vSyncEnd;
unsigned int vTotal;
ptr_t name; //char*
unsigned int nameLength;
ulong_t modeFlags;
} my_XRRModeInfo_32_t;
typedef struct my_XRRScreenResources_32_s {
ulong_t timestamp;
ulong_t configTimestamp;
int ncrtc;
ptr_t crtcs; //XID_32*
int noutput;
ptr_t outputs; //XID_32*
int nmode;
ptr_t modes; //my_XRRModeInfo_32_t *
} my_XRRScreenResources_32_t;
typedef struct my_XRRCrtcInfo_32_s {
ulong_t timestamp;
int x, y;
unsigned int width, height;
XID_32 mode;
uint16_t rotation;
int noutput;
ptr_t outputs; //XID_32*
uint16_t rotations;
int npossible;
ptr_t possible; //XID_32*
} my_XRRCrtcInfo_32_t;
typedef struct my_XRROutputInfo_32_s {
ulong_t timestamp;
XID_32 crtc;
ptr_t name; //char*
int nameLen;
ulong_t mm_width;
ulong_t mm_height;
uint16_t connection;
uint16_t subpixel_order;
int ncrtc;
ptr_t crtcs; //XID_32*
int nclone;
ptr_t clones; //XID_32*
int nmode;
int npreferred;
ptr_t modes; //XID_32*
} my_XRROutputInfo_32_t;
typedef struct my_XWindowAttributes_32_s {
int x, y;
int width, height;
int border_width;
int depth;
ptr_t visual; //Visual*
XID_32 root;
int c_class;
int bit_gravity;
int win_gravity;
int backing_store;
ulong_t backing_planes;
ulong_t backing_pixel;
int save_under;
XID_32 colormap;
int map_installed;
int map_state;
long_t all_event_masks;
long_t your_event_mask;
long_t do_not_propagate_mask;
int override_redirect;
ptr_t screen; //Screen*
} my_XWindowAttributes_32_t;
typedef struct my_XVisualInfo_32_s {
ptr_t visual; //Visual*
ulong_t visualid;
int screen;
int depth;
int c_class;
ulong_t red_mask;
ulong_t green_mask;
ulong_t blue_mask;
int colormap_size;
int bits_per_rgb;
} my_XVisualInfo_32_t;
typedef struct my_XModifierKeymap_32_s {
int max_keypermod;
ptr_t modifiermap; //uint8_t*
} my_XModifierKeymap_32_t;
typedef struct my_XdbeVisualInfo_32_s
{
XID_32 visual;
int depth;
int perflevel;
} my_XdbeVisualInfo_32_t;
typedef struct my_XdbeScreenVisualInfo_32_s
{
int count;
ptr_t visinfo; //my_XdbeVisualInfo_t*
} my_XdbeScreenVisualInfo_32_t;
typedef struct my_XF86VidModeModeInfo_32_s
{
unsigned int dotclock;
unsigned short hdisplay;
unsigned short hsyncstart;
unsigned short hsyncend;
unsigned short htotal;
unsigned short hskew;
unsigned short vdisplay;
unsigned short vsyncstart;
unsigned short vsyncend;
unsigned short vtotal;
unsigned int flags;
int privsize;
ptr_t tc_private;
} my_XF86VidModeModeInfo_32_t;
typedef struct my_XColor_32_s {
ulong_t pixel;
unsigned short red, green, blue;
char flags;
char pad;
} my_XColor_32_t;
typedef struct my_XRRProviderInfo_32_s {
unsigned int capabilities;
int ncrtcs;
ptr_t crtcs; //XID*
int noutputs;
ptr_t outputs; //XID*
ptr_t name; //char*
int nassociatedproviders;
ptr_t associated_providers; //XID*
ptr_t associated_capability; //unsigned int*
int nameLen;
} my_XRRProviderInfo_32_t;
typedef struct my_XRRProviderResources_32_t {
ulong_t timestamp;
int nproviders;
ptr_t providers; //XID*
} my_XRRProviderResources_32_t;
typedef struct my_XIAnyClassInfo_32_s
{
int type;
int sourceid;
} my_XIAnyClassInfo_32_t;
typedef struct my_XIDeviceInfo_32_s
{
int deviceid;
ptr_t name; //char*
int use;
int attachment;
int enabled;
int num_classes;
ptr_t classes; //my_XIAnyClassInfo_t**
} my_XIDeviceInfo_32_t;
typedef struct my_XIEventMask_32_s {
int deviceid;
int mask_len;
ptr_t mask; //unsigned char*
} my_XIEventMask_32_t;
typedef struct my_XInputClassInfo_32_s {
unsigned char input_class;
unsigned char event_type_base;
} my_XInputClassInfo_32_t;
typedef struct my_XDevice_32_s {
XID_32 device_id;
int num_classes;
ptr_t classes; //my_XInputClassInfo_t*
} my_XDevice_32_t;
typedef struct my_XDeviceKeyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 deviceid;
XID_32 root;
XID_32 subwindow;
ulong_t time;
int x, y;
int x_root;
int y_root;
unsigned int state;
unsigned int keycode;
int same_screen;
unsigned int device_state;
unsigned char axes_count;
unsigned char first_axis;
int axis_data[6];
} my_XDeviceKeyEvent_32_t;
typedef my_XDeviceKeyEvent_32_t my_XDeviceButtonEvent_32_t;
typedef struct my_XDeviceMotionEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 deviceid;
XID_32 root;
XID_32 subwindow;
ulong_t time;
int x, y;
int x_root;
int y_root;
unsigned int state;
char is_hint;
int same_screen;
unsigned int device_state;
unsigned char axes_count;
unsigned char first_axis;
int axis_data[6];
} my_XDeviceMotionEvent_32_t;
typedef struct my_XDeviceFocusChangeEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 deviceid;
int mode;
int detail;
ulong_t time;
} my_XDeviceFocusChangeEvent_32_t;
typedef struct my_XProximityNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 deviceid;
XID_32 root;
XID_32 subwindow;
ulong_t time;
int x, y;
int x_root;
int y_root;
unsigned int state;
int same_screen;
unsigned int device_state;
unsigned char axes_count;
unsigned char first_axis;
int axis_data[6];
} my_XProximityNotifyEvent_32_t;
typedef struct my_XDeviceStateNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display; //Display*
XID_32 window;
XID_32 deviceid;
ulong_t time;
int num_classes;
char data[64];
} my_XDeviceStateNotifyEvent_32_t;
typedef struct my_XDeviceMappingEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
XID_32 deviceid;
ulong_t time;
int request;
int first_keycode;
int count;
} my_XDeviceMappingEvent_32_t;
typedef struct my_XChangeDeviceNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
XID_32 deviceid;
ulong_t time;
int request;
} my_XChangeDeviceNotifyEvent_32_t;
typedef struct my_XDevicePresenceNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
ulong_t time;
int devchange;
XID_32 deviceid;
XID_32 control;
} my_XDevicePresenceNotifyEvent_32_t;
typedef struct my_XDevicePropertyNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
ulong_t time;
XID_32 deviceid;
XID_32 atom;
int state;
} my_XDevicePropertyNotifyEvent_32_t;
typedef struct my_XInputClass_32_s {
unsigned char class;
unsigned char length;
} my_XInputClass_32_t;
typedef struct my_XDeviceState_32_s {
XID_32 device_id;
int num_classes;
ptr_t data; //my_XInputClass_32_t*
} my_XDeviceState_32_t;
typedef struct my_XFixesSelectionNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
int subtype;
ulong_t selection_timestamp;
XID_32 owner;
XID_32 selection;
ulong_t timestamp;
} my_XFixesSelectionNotifyEvent_32_t;
typedef struct my_XFixesCursorNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
int subtype;
ulong_t cursor_serial;
ulong_t timestamp;
XID_32 cursor_name;
} my_XFixesCursorNotifyEvent_32_t;
typedef struct my_XRRScreenChangeNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
XID_32 root;
ulong_t timestamp;
ulong_t config_timestamp;
uint16_t size_index;
uint16_t subpixel_order;
uint16_t rotation;
int width;
int height;
int mwidth;
int mheight;
} my_XRRScreenChangeNotifyEvent_32_t;
typedef struct my_XRRNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
int subtype;
} my_XRRNotifyEvent_32_t;
typedef struct my_XRROutputChangeNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
int subtype;
XID_32 output;
XID_32 crtc;
XID_32 mode;
uint16_t rotation;
uint16_t connection;
uint16_t subpixel_order;
} my_XRROutputChangeNotifyEvent_32_t;
typedef struct my_XRRCrtcChangeNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
int subtype;
XID_32 crtc;
XID_32 mode;
uint16_t rotation;
int x, y;
unsigned int width, height;
} my_XRRCrtcChangeNotifyEvent_32_t;
typedef struct my_XRROutputPropertyNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
int subtype;
XID_32 output;
XID_32 property;
ulong_t timestamp;
int state;
} my_XRROutputPropertyNotifyEvent_32_t;
typedef struct my_XRRProviderChangeNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
int subtype;
XID_32 provider;
ulong_t timestamp;
unsigned int current_role;
} my_XRRProviderChangeNotifyEvent_32_t;
typedef struct my_XRRProviderPropertyNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
int subtype;
XID_32 provider;
XID_32 property;
ulong_t timestamp;
int state;
} my_XRRProviderPropertyNotifyEvent_32_t;
typedef struct my_XRRResourceChangeNotifyEvent_32_s
{
int type;
ulong_t serial;
int send_event;
ptr_t display;
XID_32 window;
int subtype;
ulong_t timestamp;
} my_XRRResourceChangeNotifyEvent_32_t;
typedef struct my_XcursorCursors_32_s {
ptr_t dpy; //Display*
int ref;
int ncursor;
ptr_t cursors; //Cursor*
} my_XcursorCursors_32_t;
typedef struct my_XcursorImage_32_s {
uint32_t version;
uint32_t size;
uint32_t width;
uint32_t height;
uint32_t xhot;
uint32_t yhot;
uint32_t delay;
ptr_t pixels; //XcursorPixel*
} my_XcursorImage_32_t;
typedef struct my_XcursorImages_32_s {
int nimage;
ptr_t images; //my_XcursorImage_t**
ptr_t name; //char*
} my_XcursorImages_32_t;
typedef struct my_XExtCodes_32_s {
int extension;
int major_opcode;
int first_event;
int first_error;
} my_XExtCodes_32_t;
typedef struct my_XExtDisplayInfo_32_s {
ptr_t next; //struct my_XExtDisplayInfo_s*
ptr_t display; //Didsplay*
ptr_t codes; //my_XExtCodes_t*
ptr_t data; //void*
} my_XExtDisplayInfo_32_t;
typedef struct my_XExtensionInfo_32_s {
ptr_t head; //my_XExtDisplayInfo_t*
ptr_t cur; //my_XExtDisplayInfo_t*
int ndisplays;
} my_XExtensionInfo_32_t;
typedef struct my_XCharStruct_32_t {
short lbearing;
short rbearing;
short width;
short ascent;
short descent;
unsigned short attributes;
} my_XCharStruct_32_t;
typedef struct my_XFontProp_32_s {
XID_32 name;
ulong_t card32;
} my_XFontProp_32_t;
typedef struct my_XFontStruct_32_s {
ptr_t ext_data; //XExtData*
XID_32 fid;
unsigned direction;
unsigned min_char_or_byte2;
unsigned max_char_or_byte2;
unsigned min_byte1;
unsigned max_byte1;
int all_chars_exist;
unsigned default_char;
int n_properties;
ptr_t properties; //my_XFontProp_t*
my_XCharStruct_32_t min_bounds;
my_XCharStruct_32_t max_bounds;
ptr_t per_char; //my_XCharStruct_t*
int ascent;
int descent;
} my_XFontStruct_32_t;
typedef struct my_XExtensionHooks_32_s {
ptr_t create_gc; //int (*create_gc)(void* dpy, void* gc, my_XExtCodes_t* e);
ptr_t copy_gc; //int (*copy_gc)(void* dpy, void* gc, my_XExtCodes_t* e);
ptr_t flush_gc; //int (*flush_gc)(void* dpy, void* gc, my_XExtCodes_t* e);
ptr_t free_gc; //int (*free_gc)(void* dpy, void* gc, my_XExtCodes_t* e);
ptr_t create_font; //int (*create_font)(void* dpy, my_XFontStruct_t* f, my_XExtCodes_t* e);
ptr_t free_font; //int (*free_font)(void* dpy, my_XFontStruct_t* f, my_XExtCodes_t* e);
ptr_t close_display; //int (*close_display)(void* dpy, my_XExtCodes_t* e);
ptr_t wire_to_event; //int (*wire_to_event)(void* dpy, my_XEvent_t* evt, void* xEvent);
ptr_t event_to_wire; //int (*event_to_wire)(void* dpy, my_XEvent_t* evt, void* xEvent);
ptr_t error; //int (*error)(void* dpy, void* xError, my_XExtCodes_t* e, int* n);
ptr_t error_string; //char*(*error_string)(void* dpy, int, my_XExtCodes_t* e, char* s, int n);
} my_XExtensionHooks_32_t;
typedef struct my_XRRPropertyInfo_32_s {
int pending;
int range;
int immutable;
int num_values;
ptr_t values; //long*
} my_XRRPropertyInfo_32_t;
typedef struct my_XShmSegmentInfo_32_s {
XID_32 shmseg;
int shmid;
ptr_t shmaddr;
int readOnly;
} my_XShmSegmentInfo_32_t;
typedef struct my_XkbNamesRec_32_s {
XID_32 keycodes;
XID_32 geometry;
XID_32 symbols;
XID_32 types;
XID_32 compat;
XID_32 vmods[16];
XID_32 indicators[32];
XID_32 groups[4];
ptr_t keys; //XkbKeyNameRec* as array[xkb->max_key_code + 1]
ptr_t key_aliases; //XkbKeyAliasRec* as array[num_key_aliases]
ptr_t radio_groups; //XID*
XID_32 phys_symbols;
unsigned char num_keys;
unsigned char num_key_aliases;
unsigned short num_rg;
} my_XkbNamesRec_32_t;
typedef struct my_XkbClientMapRec_32_s {
unsigned char size_types;
unsigned char num_types;
ptr_t types; //XkbKeyTypePtr
unsigned short size_syms;
unsigned short num_syms;
ptr_t syms; //KeySym*
ptr_t key_sym_map; //XkbSymMapPtr
ptr_t modmap; //unsigned char*
} my_XkbClientMapRec_32_t;
typedef struct my_XkbDescRec_32_s {
ptr_t display; //my_XDisplay_32_t*
unsigned short flags;
unsigned short device_spec;
uint8_t min_key_code;
uint8_t max_key_code;
ptr_t ctrls; //XkbControlsPtr
ptr_t server; //XkbServerMapPtr
ptr_t map; //XkbClientMapPtr
ptr_t indicators; //XkbIndicatorPtr
ptr_t names; //my_XkbNamesRec_32_t*
ptr_t compat; //XkbCompatMapPtr
ptr_t geom; //XkbGeometryPtr
} my_XkbDescRec_32_t;
typedef struct my_XmbTextItem_32_s {
ptr_t chars; //char*
int nchars;
int delta;
ptr_t font_set; //XFontSet
} my_XmbTextItem_32_t;
typedef struct my_XwcTextItem_32_s {
ptr_t chars; //wchar_t*
int nchars;
int delta;
ptr_t font_set; //XFontSet
} my_XwcTextItem_32_t;
// virtual structure
typedef struct my_XFontSet_32_s {
void* fontset; // the actual fontset
ptr_t** names; // arrays of array of names
int names_size; // size of names
ptr_t** fonts; // array of array of fonts
int fonts_size; // soze of fonts
} my_XFontSet_32_t;
typedef struct my_XAnyClassinfo_32_s {
XID_32 c_class;
int length;
} my_XAnyClassInfo_32_t;
typedef struct my_XKeyInfo_32_s
{
XID_32 c_class;
int length;
unsigned short min_keycode;
unsigned short max_keycode;
unsigned short num_keys;
} my_XKeyInfo_32_t;
typedef struct my_XButtonInfo_32_s
{
XID_32 c_class;
int length;
short num_buttons;
} my_XButtonInfo_32_t;
typedef struct my_XValuatorInfo_32_s
{
XID_32 c_class;
int length;
unsigned char num_axes;
unsigned char mode;
ulong_t motion_buffer;
ptr_t axes; //XAxisInfoPtr
} my_XValuatorInfo_32_t;
typedef struct my_XDeviceInfo_32_s
{
XID_32 id;
XID_32 type;
ptr_t name; //char*
int num_classes;
int use;
ptr_t inputclassinfo; //my_XAnyClassInfo_32_t*
} my_XDeviceInfo_32_t;
typedef struct my_XTimeCoord_32_s {
ulong_t time;
short x, y;
} my_XTimeCoord_32_t;
typedef struct my_XDeviceTimeCoord_32_s {
ulong_t time;
ptr_t data; //int*
} my_XDeviceTimeCoord_32_t;
typedef struct my_XFixesCursorImage_32_s {
short x, y;
unsigned short width, height;
unsigned short xhot, yhot;
ulong_t cursor_serial;
ptr_t pixels; //unsigned long*
XID_32 atom; /* Version >= 2 only */
ptr_t name; /* Version >= 2 only */
} my_XFixesCursorImage_32_t;
typedef struct my_XFilters_32_s {
int nfilter;
ptr_t filter; //char **
int nalias;
ptr_t alias; //short *
} my_XFilters_32_t;
typedef struct my__XRRMonitorInfo_32_s {
XID_32 name;
int primary;
int automatic;
int noutput;
int x;
int y;
int width;
int height;
int mwidth;
int mheight;
ptr_t outputs; //XID*
} my_XRRMonitorInfo_32_t;
#endif//MY_X11_DEFS_32
|