aboutsummaryrefslogblamecommitdiffstats
path: root/libaxl-requests.h
blob: f0a62794def2f3672c377f40848b6de9f0b50f6b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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
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
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445














                                                                                                                                 
                                                                                             

































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                                                     
                                         

















































































































































































































































































































































































































































                                                                                                                                  
/* See LICENSE file for copyright and license details. */

struct libaxl_request_create_window {
#define LIBAXL_REQUEST_CREATE_WINDOW 1
	uint8_t                   opcode;
	uint8_t                   depth;
	uint16_t                  _request_length;
	libaxl_window_t           wid;
	libaxl_window_t           parent;
	int16_t                   x;
	int16_t                   y;
	uint16_t                  width;
	uint16_t                  height;
	uint16_t                  border_width;
	uint16_t                  class;                 /* LIBAXL_COPY_FROM_PARENT, LIBAXL_INPUT_OUTPUT, or LIBAXL_INPUT_ONLY */
	libaxl_visual_t           visual;                /* Can be LIBAXL_COPY_FROM_PARENT */
	uint32_t                  value_mask;            /* Determines which below are included, all are encoded as uint32_t */
#define LIBAXL_REQUEST_CREATE_WINDOW_BACKGROUND_PIXMAP     0x00000001UL
#define LIBAXL_REQUEST_CREATE_WINDOW_BACKGROUND_PIXEL      0x00000002UL
#define LIBAXL_REQUEST_CREATE_WINDOW_BORDER_PIXMAP         0x00000004UL
#define LIBAXL_REQUEST_CREATE_WINDOW_BORDER_PIXEL          0x00000008UL
#define LIBAXL_REQUEST_CREATE_WINDOW_BIT_GRAVITY           0x00000010UL
#define LIBAXL_REQUEST_CREATE_WINDOW_WIN_GRAVITY           0x00000020UL
#define LIBAXL_REQUEST_CREATE_WINDOW_BACKING_STORE         0x00000040UL
#define LIBAXL_REQUEST_CREATE_WINDOW_BACKING_PLANES        0x00000080UL
#define LIBAXL_REQUEST_CREATE_WINDOW_BACKING_PIXEL         0x00000100UL
#define LIBAXL_REQUEST_CREATE_WINDOW_OVERRIDE_REDIRECT     0x00000200UL
#define LIBAXL_REQUEST_CREATE_WINDOW_SAVE_UNDER            0x00000400UL
#define LIBAXL_REQUEST_CREATE_WINDOW_EVENT_MASK            0x00000800UL
#define LIBAXL_REQUEST_CREATE_WINDOW_DO_NOT_PROPAGATE_MASK 0x00001000UL
#define LIBAXL_REQUEST_CREATE_WINDOW_COLORMAP              0x00002000UL
#define LIBAXL_REQUEST_CREATE_WINDOW_CURSOR                0x00004000UL
	libaxl_pixmap_t           background_pixmap;     /* Can be LIBAXL_NONE or LIBAXL_PARENT_RELATIVE */
	uint32_t                  background_pixel;
	libaxl_pixmap_t           border_pixmap;         /* Can be LIBAXL_COPY_FROM_PARENT */
	uint32_t                  border_pixel;
	uint8_t                   bit_gravity;
	uint8_t                   win_gravity;
	uint8_t                   backing_store;         /* LIBAXL_NOT_USEFUL, LIBAXL_WHEN_MAPPED, or LIBAXL_ALWAYS */
	uint8_t                   __omitted1;
	uint32_t                  backing_planes;
	uint32_t                  backing_pixel;
	libaxl_bool_t             override_redirect;
	libaxl_bool_t             save_under;
	uint16_t                  __omitted2;
	uint32_t                  event_mask;            /* TODO SETofEVENT */
	uint32_t                  do_not_propagate_mask; /* TODO SETofDEVICEEVENT */
	libaxl_colormap_t         colormap;              /* Can be LIBAXL_COPY_FROM_PARENT */
	libaxl_cursor_t           cursor;                /* Can be LIBAXL_NONE */
};

struct libaxl_request_change_window_attributes {
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES 2
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_window_t           window;
	uint32_t                  value_mask;            /* Determines which below are included, all are encoded as uint32_t */
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_BACKGROUND_PIXMAP     0x00000001UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_BACKGROUND_PIXEL      0x00000002UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_BORDER_PIXMAP         0x00000004UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_BORDER_PIXEL          0x00000008UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_BIT_GRAVITY           0x00000010UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_WIN_GRAVITY           0x00000020UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_BACKING_STORE         0x00000040UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_BACKING_PLANES        0x00000080UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_BACKING_PIXEL         0x00000100UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_OVERRIDE_REDIRECT     0x00000200UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_SAVE_UNDER            0x00000400UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_EVENT_MASK            0x00000800UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_DO_NOT_PROPAGATE_MASK 0x00001000UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_COLORMAP              0x00002000UL
#define LIBAXL_REQUEST_CHANGE_WINDOW_ATTRIBUTES_CURSOR                0x00004000UL
	libaxl_pixmap_t           background_pixmap;     /* Can be LIBAXL_NONE or LIBAXL_PARENT_RELATIVE */
	uint32_t                  background_pixel;
	libaxl_pixmap_t           border_pixmap;         /* Can be LIBAXL_COPY_FROM_PARENT */
	uint32_t                  border_pixel;
	uint8_t                   bit_gravity;
	uint8_t                   win_gravity;
	uint8_t                   backing_store;         /* LIBAXL_NOT_USEFUL, LIBAXL_WHEN_MAPPED, or LIBAXL_ALWAYS */
	uint8_t                   __omitted1;
	uint32_t                  backing_planes;
	uint32_t                  backing_pixel;
	libaxl_bool_t             override_redirect;
	libaxl_bool_t             save_under;
	uint16_t                  __omitted2;
	uint32_t                  event_mask;            /* TODO SETofEVENT */
	uint32_t                  do_not_propagate_mask; /* TODO SETofDEVICEEVENT */
	libaxl_colormap_t         colormap;              /* Can be LIBAXL_COPY_FROM_PARENT */
	libaxl_cursor_t           cursor;                /* Can be LIBAXL_NONE */
};

struct libaxl_request_get_window_attributes {
#define LIBAXL_REQUEST_GET_WINDOW_ATTRIBUTES 3
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_destroy_window {
#define LIBAXL_REQUEST_DESTROY_WINDOW 4
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_destroy_subwindows {
#define LIBAXL_REQUEST_DESTROY_SUBWINDOWS 5
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_change_save_set {
#define LIBAXL_REQUEST_CHANGE_SAVE_SET 6
	uint8_t                   opcode;
	uint8_t                   mode;                  /* LIBAXL_INSERT or LIBAXL_DELETE */
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_reparent_window {
#define LIBAXL_REQUEST_REPARENT_WINDOW 7
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_window_t           window;
	libaxl_window_t           parent;
	int16_t                   x;
	int16_t                   y;
};

struct libaxl_request_map_window {
#define LIBAXL_REQUEST_MAP_WINDOW 8
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_map_subwindows {
#define LIBAXL_REQUEST_MAP_SUBWINDOWS 9
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_unmap_window {
#define LIBAXL_REQUEST_UNMAP_WINDOW 10
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_unmap_subwindows {
#define LIBAXL_REQUEST_UNMAP_SUBWINDOWS 11
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_configure_window {
#define LIBAXL_REQUEST_CONFIGURE_WINDOW 12
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;
	libaxl_window_t           window;
	uint16_t                  value_mask;            /* Determines which below are included, all are encoded as uint32_t */
#define LIBAXL_REQUEST_CONFIGURE_WINDOW_X            0x0001U
#define LIBAXL_REQUEST_CONFIGURE_WINDOW_Y            0x0002U
#define LIBAXL_REQUEST_CONFIGURE_WINDOW_WIDTH        0x0004U
#define LIBAXL_REQUEST_CONFIGURE_WINDOW_HEIGHT       0x0008U
#define LIBAXL_REQUEST_CONFIGURE_WINDOW_BORDER_WIDTH 0x0010U
#define LIBAXL_REQUEST_CONFIGURE_WINDOW_SIBLING      0x0020U
#define LIBAXL_REQUEST_CONFIGURE_WINDOW_STACK_MODE   0x0040U
	uint16_t                  __pad2;
	int16_t                   x;
	int16_t                   y;
	uint16_t                  width;
	uint16_t                  height;
	uint16_t                  border_width;
	uint16_t                  __omitted1;
	libaxl_window_t           sibling;
	uint8_t                   stack_mode;            /* See "stack mode" in libaxl-consts.h */
	uint8_t                   __omitted2[3];
};

struct libaxl_request_circulate_window {
#define LIBAXL_REQUEST_CIRCULATE_WINDOW 13
	uint8_t                   opcode;
	uint8_t                   direction;             /* LIBAXL_RAISE_LOWEST or LIBAXL_LOWER_HIGHEST */
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_get_geometry {
#define LIBAXL_REQUEST_GET_GEOMETRY 14
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_drawable_t         drawable;
};

struct libaxl_request_query_tree {
#define LIBAXL_REQUEST_QUERY_TREE 15
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_intern_atom {
#define LIBAXL_REQUEST_INTERN_ATOM 16
	uint8_t                   opcode;
	libaxl_bool_t             only_if_exists;
	uint16_t                  _request_length;
	uint16_t                  length_of_name;
	uint16_t                  __pad;
	char                     *name;
};

struct libaxl_request_get_atom_name {
#define LIBAXL_REQUEST_GET_ATOM_NAME 17
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_atom_t             atom;
};

struct libaxl_request_change_property {
#define LIBAXL_REQUEST_CHANGE_PROPERTY 18
	uint8_t                   opcode;
	uint8_t                   mode;                  /* See libaxl-consts.h */
	uint16_t                  _request_length;
	libaxl_window_t           window;
	libaxl_atom_t             property;
	libaxl_atom_t             type;
	uint8_t                   format;                /* {8, 16, 32} */
	uint8_t                   __pad[3];
	uint32_t                  length_of_data;        /* in format units */
	union {
		char             *data;
		uint8_t          *data8;
		uint16_t         *data16;
		uint32_t         *data32;
	};
};

struct libaxl_request_delete_property {
#define LIBAXL_REQUEST_DELETE_PROPERTY 19
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 3 */
	libaxl_window_t           window;
	libaxl_atom_t             property;
};

struct libaxl_request_get_property {
#define LIBAXL_REQUEST_GET_PROPERTY 20
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 6 */
	libaxl_window_t           window;
	libaxl_atom_t             property;
	libaxl_atom_t             type;                  /* Can be LIBAXL_ANY_PROPERTY_TYPE */
	uint32_t                  offset;
	uint32_t                  length;
};

struct libaxl_request_list_properties {
#define LIBAXL_REQUEST_LIST_PROPERTIES 21
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length; /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_set_selection_owner {
#define LIBAXL_REQUEST_SET_SELECTION_OWNER 22
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_window_t           owner;                 /* Can be LIBAXL_NONE */
	libaxl_atom_t             selection;
	libaxl_timestamp_t        time;                  /* Can be LIBAXL_CURRENT_TIME */
};

struct libaxl_request_get_selection_owner {
#define LIBAXL_REQUEST_GET_SELECTION_OWNER 23
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_atom_t             selection;
};

struct libaxl_request_convert_selection {
#define LIBAXL_REQUEST_CONVERT_SELECTION 24
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 5 */
	libaxl_atom_t             selection;
	libaxl_atom_t             target;
	libaxl_atom_t             property;              /* Can be LIBAXL_NONE */
	libaxl_timestamp_t        time;                  /* Can be LIBAXL_CURRENT_TIME */
};

struct libaxl_request_send_event {
#define LIBAXL_REQUEST_SEND_EVENT 25
	uint8_t                   opcode;
	libaxl_bool_t             propagate;
	uint16_t                  _request_length;       /* = 11 */
	libaxl_window_t           destination;           /* Can be LIBAXL_POINTER_WINDOW or LIBAXL_INPUT_FOCUS */
	uint32_t                  event_mask;            /* TODO SETofEVENT */
	union libaxl_event        event;
};

struct libaxl_request_grab_pointer {
#define LIBAXL_REQUEST_GRAB_POINTER 26
	uint8_t                   opcode;
	libaxl_bool_t             owner_events;
	uint16_t                  _request_length;       /* = 6 */
	libaxl_window_t           grab_window;
	uint16_t                  event_mask;            /* TODO SETofPOINTEREVENT */
	uint8_t                   pointer_mode;          /* LIBAXL_SYNCHRONOUS or LIBAXL_ASYNCHRONOUS */
	uint8_t                   keyboard_mode;         /* LIBAXL_SYNCHRONOUS or LIBAXL_ASYNCHRONOUS */
	libaxl_window_t           confine_to;            /* Can be LIBAXL_NONE */
	libaxl_cursor_t           cursor;                /* Can be LIBAXL_NONE */
	libaxl_timestamp_t        time;                  /* Can be LIBAXL_CURRENT_TIME */
};

struct libaxl_request_ungrab_pointer {
#define LIBAXL_REQUEST_UNGRAB_POINTER 27
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_timestamp_t        time;                  /* Can be LIBAXL_CURRENT_TIME */
};

struct libaxl_request_grab_button {
#define LIBAXL_REQUEST_GRAB_BUTTON 28
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;       /* = 6 */
	libaxl_window_t           grab_window;
	uint16_t                  event_mask;            /* TODO SETofPOINTEREVENT */
	uint8_t                   pointer_mode;          /* LIBAXL_SYNCHRONOUS or LIBAXL_ASYNCHRONOUS */
	uint8_t                   keyboard_mode;         /* LIBAXL_SYNCHRONOUS or LIBAXL_ASYNCHRONOUS */
	libaxl_window_t           confine_to;            /* Can be LIBAXL_NONE */
	libaxl_cursor_t           cursor;                /* Can be LIBAXL_NONE */
	uint8_t                   button;                /* Can be LIBAXL_ANY_BUTTON */
	uint8_t                   __pad2;
	uint16_t                  modifiers;             /* TODO SETofKEYMASK, #x8000 = AnyModifier */
};

struct libaxl_request_ungrab_button {
#define LIBAXL_REQUEST_UNGRAB_BUTTON 29
	uint8_t                   opcode;
	uint8_t                   button;                /* Can be LIBAXL_ANY_BUTTON */
	uint16_t                  _request_length;       /* = 3 */
	libaxl_window_t           grab_window;
	uint16_t                  modifiers;             /* TODO SETofKEYMASK, #x8000 = AnyModifier */
	uint16_t                  __pad;
};

struct libaxl_request_change_active_pointer_grab {
#define LIBAXL_REQUEST_CHANGE_ACTIVE_POINTER_GRAB 30
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_cursor_t           cursor;                /* Can be LIBAXL_NONE */
	libaxl_timestamp_t        time;                  /* Can be LIBAXL_CURRENT_TIME */
	uint16_t                  event_mask;            /* TODO SETofPOINTEREVENT */
	uint16_t                  __pad2;
};

struct libaxl_request_grab_keyboard {
#define LIBAXL_REQUEST_GRAB_KEYBOARD 31
	uint8_t                   opcode;
	libaxl_bool_t             owner_events;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_window_t           grab_window;
	libaxl_timestamp_t        time;                  /* Can be LIBAXL_CURRENT_TIME */
	uint8_t                   pointer_mode;          /* LIBAXL_SYNCHRONOUS or LIBAXL_ASYNCHRONOUS */
	uint8_t                   keyboard_mode;         /* LIBAXL_SYNCHRONOUS or LIBAXL_ASYNCHRONOUS */
	uint16_t                  __pad;
};

struct libaxl_request_ungrab_keyboard {
#define LIBAXL_REQUEST_UNGRAB_KEYBOARD 32
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_timestamp_t        time;                  /* Can be LIBAXL_CURRENT_TIME */
};

struct libaxl_request_grab_key {
#define LIBAXL_REQUEST_GRAB_KEY 33
	uint8_t                   opcode;
	libaxl_bool_t             owner_events;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_window_t           grab_window;
	uint16_t                  modifiers;             /* TODO SETofKEYMASK, #x8000 = AnyModifier */
	libaxl_keycode_t          key;                   /* Can be LIBAXL_ANY_KEY */
	uint8_t                   pointer_mode;          /* LIBAXL_SYNCHRONOUS or LIBAXL_ASYNCHRONOUS */
	uint8_t                   keyboard_mode;         /* LIBAXL_SYNCHRONOUS or LIBAXL_ASYNCHRONOUS */
	uint8_t                   __pad[3];
};

struct libaxl_request_ungrab_key {
#define LIBAXL_REQUEST_UNGRAB_KEY 34
	uint8_t                   opcode;
	libaxl_keycode_t          key;                   /* Can be LIBAXL_ANY_KEY */
	uint16_t                  _request_length;       /* = 3 */
	libaxl_window_t           grab_window;
	uint16_t                  modifiers;             /* TODO SETofKEYMASK, #x8000 = AnyModifier */
	uint16_t                  __pad;
};

struct libaxl_request_allow_events {
#define LIBAXL_REQUEST_ALLOW_EVENTS 35
	uint8_t                   opcode;
	uint8_t                   mode;                  /* See libaxl-consts.h */
	uint16_t                  _request_length;       /* = 2 */
	libaxl_timestamp_t        time;                  /* Can be LIBAXL_CURRENT_TIME */
};

struct libaxl_request_grab_server {
#define LIBAXL_REQUEST_GRAB_SERVER 36
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_ungrab_server {
#define LIBAXL_REQUEST_UNGRAB_SERVER 37
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_query_pointer {
#define LIBAXL_REQUEST_QUERY_POINTER 38
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_get_motion_events {
#define LIBAXL_REQUEST_GET_MOTION_EVENTS 39
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_window_t           window;
	libaxl_timestamp_t        start;                 /* Can be LIBAXL_CURRENT_TIME */
	libaxl_timestamp_t        end;                   /* Can be LIBAXL_CURRENT_TIME */
};

struct libaxl_request_translate_coordinates {
#define LIBAXL_REQUEST_TRANSLATE_COORDINATES 40
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_window_t           src_window;
	libaxl_window_t           dest_window;
	int16_t                   src_x;
	int16_t                   src_y;
};

struct libaxl_request_warp_pointer {
#define LIBAXL_REQUEST_WARP_POINTER 41
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 6 */
	libaxl_window_t           src_window;            /* Can be LIBAXL_NONE */
	libaxl_window_t           dest_window;           /* Can be LIBAXL_NONE */
	int16_t                   src_x;
	int16_t                   src_y;
	uint16_t                  src_width;
	uint16_t                  src_height;
	int16_t                   dest_x;
	int16_t                   dest_y;
};

struct libaxl_request_set_input_focus {
#define LIBAXL_REQUEST_SET_INPUT_FOCUS 42
	uint8_t                   opcode;
	uint8_t                   revert_to;             /* LIBAXL_NONE, LIBAXL_POINTER_ROOT, or LIBAXL_PARENT */
	uint16_t                  _request_length;       /* = 3 */
	libaxl_window_t           focus;                 /* Can be LIBAXL_NONE or LIBAXL_POINTER_ROOT */
	libaxl_timestamp_t        time;                  /* Can be LIBAXL_CURRENT_TIME */
};

struct libaxl_request_get_input_focus {
#define LIBAXL_REQUEST_GET_INPUT_FOCUS 43
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_query_keymap {
#define LIBAXL_REQUEST_QUERY_KEYMAP 44
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_open_font {
#define LIBAXL_REQUEST_OPEN_FONT 45
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;
	libaxl_font_t             fid;
	uint16_t                  length_of_name;
	uint16_t                  __pad2;
	char                     *name;
};

struct libaxl_request_close_font {
#define LIBAXL_REQUEST_CLOSE_FONT 46
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_font_t             font;
};

struct libaxl_request_query_font {
#define LIBAXL_REQUEST_QUERY_FONT 47
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_fontable_t         font;
};

struct libaxl_request_query_text_extents {
#define LIBAXL_REQUEST_QUERY_TEXT_EXTENTS 48
	uint8_t                   opcode;
	libaxl_bool_t             _odd_length;
	uint16_t                  _request_length;
	libaxl_fontable_t         font;
	size_t                    length_of_string;
	uint16_t                 *string;
};

struct libaxl_request_list_fonts {
#define LIBAXL_REQUEST_LIST_FONTS 49
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	uint16_t                  max_names;
	uint16_t                  length_of_pattern;
	char                     *pattern;
};

struct libaxl_request_list_fonts_with_info {
#define LIBAXL_REQUEST_LIST_FONTS_WITH_INFO 50
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	uint16_t                  max_names;
	uint16_t                  length_of_pattern;
	char                     *pattern;
};

struct libaxl_request_set_font_path {
#define LIBAXL_REQUEST_SET_FONT_PATH 51
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;
	uint16_t                  number_of_strs;        /* in path */
	uint16_t                  __pad2;
	struct libaxl_str8       *path;
};

struct libaxl_request_get_font_path {
#define LIBAXL_REQUEST_GET_FONT_PATH 52
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_create_pixmap {
#define LIBAXL_REQUEST_CREATE_PIXMAP 53
	uint8_t                   opcode;
	uint8_t                   depth;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_pixmap_t           pid;
	libaxl_drawable_t         drawable;
	uint16_t                  width;
	uint16_t                  height;
};

struct libaxl_request_free_pixmap {
#define LIBAXL_REQUEST_FREE_PIXMAP 54
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_pixmap_t           pixmap;
};

struct libaxl_request_create_gc {
#define LIBAXL_REQUEST_CREATE_GC 55
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_gcontext_t         cid;
	libaxl_drawable_t         drawable;
	uint32_t                  value_mask;            /* Determines which below are included, all are encoded as uint32_t */
#define LIBAXL_REQUEST_CREATE_GC_FUNCTION              0x00000001UL
#define LIBAXL_REQUEST_CREATE_GC_PLANE_MASK            0x00000002UL
#define LIBAXL_REQUEST_CREATE_GC_FOREGROUND            0x00000004UL
#define LIBAXL_REQUEST_CREATE_GC_BACKGROUND            0x00000008UL
#define LIBAXL_REQUEST_CREATE_GC_LINE_WIDTH            0x00000010UL
#define LIBAXL_REQUEST_CREATE_GC_LINE_STYLE            0x00000020UL
#define LIBAXL_REQUEST_CREATE_GC_CAP_STYLE             0x00000040UL
#define LIBAXL_REQUEST_CREATE_GC_JOIN_STYLE            0x00000080UL
#define LIBAXL_REQUEST_CREATE_GC_FILL_STYLE            0x00000100UL
#define LIBAXL_REQUEST_CREATE_GC_FILL_RULE             0x00000200UL
#define LIBAXL_REQUEST_CREATE_GC_TILE                  0x00000400UL
#define LIBAXL_REQUEST_CREATE_GC_STIPPLE               0x00000800UL
#define LIBAXL_REQUEST_CREATE_GC_TILE_STIPPLE_X_ORIGIN 0x00001000UL
#define LIBAXL_REQUEST_CREATE_GC_TILE_STIPPLE_Y_ORIGIN 0x00002000UL
#define LIBAXL_REQUEST_CREATE_GC_FONT                  0x00004000UL
#define LIBAXL_REQUEST_CREATE_GC_SUBWINDOW_MODE        0x00008000UL
#define LIBAXL_REQUEST_CREATE_GC_GRAPHICS_EXPOSURES    0x00010000UL
#define LIBAXL_REQUEST_CREATE_GC_CLIP_X_ORIGIN         0x00020000UL
#define LIBAXL_REQUEST_CREATE_GC_CLIP_Y_ORIGIN         0x00040000UL
#define LIBAXL_REQUEST_CREATE_GC_CLIP_MASK             0x00080000UL
#define LIBAXL_REQUEST_CREATE_GC_DASH_OFFSET           0x00100000UL
#define LIBAXL_REQUEST_CREATE_GC_DASHES                0x00200000UL
#define LIBAXL_REQUEST_CREATE_GC_ARC_MODE              0x00400000UL
	uint8_t                   function;              /* See "gcontext function" in libaxl-consts.h */
	uint8_t                   __omitted1[3];
	uint32_t                  plane_mask;
	uint32_t                  foreground;
	uint32_t                  background;
	uint16_t                  line_width;
	uint8_t                   line_style;            /* LIBAXL_SOLID, LIBAXL_ON_OFF_DASH, or LIBAXL_DOUBLE_DASH */
	uint8_t                   cap_style;             /* See "cap style" in libaxl-consts.h (Beware of namespacing) */
	uint8_t                   join_style;            /* See "join style" in libaxl-consts.h (Beware of namespacing) */
	uint8_t                   fill_style;            /* LIBAXL_SOLID, LIBAXL_TILED, LIBAXL_STIPPLED, or LIBAXL_OPAQUE_STIPPLED */
	uint8_t                   fill_rule;             /* LIBAXL_EVEN_ODD or LIBAXL_WINDING */
	uint8_t                   __omitted2;
	libaxl_pixmap_t           tile;
	libaxl_pixmap_t           stipple;
	int16_t                   tile_stipple_x_origin;
	int16_t                   tile_stipple_y_origin;
	libaxl_font_t             font;
	uint8_t                   subwindow_mode;        /* CLIP_BY_CHILDREN or INCLUDE_INFERIORS */
	libaxl_bool_t             graphics_exposures;
	uint16_t                  __omitted3;
	int16_t                   clip_x_origin;
	int16_t                   clip_y_origin;
	libaxl_pixmap_t           clip_mask;             /* Can be LIBAXL_NONE */
	uint16_t                  dash_offset;
	uint8_t                   dashes;
	uint8_t                   arc_mode;              /* LIBAXL_CHORD or LIBAXL_PIE_SLICE */
};

struct libaxl_request_change_gc {
#define LIBAXL_REQUEST_CHANGE_GC 56
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_gcontext_t         gc;
	uint32_t                  value_mask;            /* Determines which below are included, all are encoded as uint32_t */
#define LIBAXL_REQUEST_CHANGE_GC_FUNCTION              0x00000001UL
#define LIBAXL_REQUEST_CHANGE_GC_PLANE_MASK            0x00000002UL
#define LIBAXL_REQUEST_CHANGE_GC_FOREGROUND            0x00000004UL
#define LIBAXL_REQUEST_CHANGE_GC_BACKGROUND            0x00000008UL
#define LIBAXL_REQUEST_CHANGE_GC_LINE_WIDTH            0x00000010UL
#define LIBAXL_REQUEST_CHANGE_GC_LINE_STYLE            0x00000020UL
#define LIBAXL_REQUEST_CHANGE_GC_CAP_STYLE             0x00000040UL
#define LIBAXL_REQUEST_CHANGE_GC_JOIN_STYLE            0x00000080UL
#define LIBAXL_REQUEST_CHANGE_GC_FILL_STYLE            0x00000100UL
#define LIBAXL_REQUEST_CHANGE_GC_FILL_RULE             0x00000200UL
#define LIBAXL_REQUEST_CHANGE_GC_TILE                  0x00000400UL
#define LIBAXL_REQUEST_CHANGE_GC_STIPPLE               0x00000800UL
#define LIBAXL_REQUEST_CHANGE_GC_TILE_STIPPLE_X_ORIGIN 0x00001000UL
#define LIBAXL_REQUEST_CHANGE_GC_TILE_STIPPLE_Y_ORIGIN 0x00002000UL
#define LIBAXL_REQUEST_CHANGE_GC_FONT                  0x00004000UL
#define LIBAXL_REQUEST_CHANGE_GC_SUBWINDOW_MODE        0x00008000UL
#define LIBAXL_REQUEST_CHANGE_GC_GRAPHICS_EXPOSURES    0x00010000UL
#define LIBAXL_REQUEST_CHANGE_GC_CLIP_X_ORIGIN         0x00020000UL
#define LIBAXL_REQUEST_CHANGE_GC_CLIP_Y_ORIGIN         0x00040000UL
#define LIBAXL_REQUEST_CHANGE_GC_CLIP_MASK             0x00080000UL
#define LIBAXL_REQUEST_CHANGE_GC_DASH_OFFSET           0x00100000UL
#define LIBAXL_REQUEST_CHANGE_GC_DASHES                0x00200000UL
#define LIBAXL_REQUEST_CHANGE_GC_ARC_MODE              0x00400000UL
	uint8_t                   function;              /* See "gcontext function" in libaxl-consts.h */
	uint8_t                   __omitted1[3];
	uint32_t                  plane_mask;
	uint32_t                  foreground;
	uint32_t                  background;
	uint16_t                  line_width;
	uint8_t                   line_style;            /* LIBAXL_SOLID, LIBAXL_ON_OFF_DASH, or LIBAXL_DOUBLE_DASH */
	uint8_t                   cap_style;             /* See "cap style" in libaxl-consts.h (Beware of namespacing) */
	uint8_t                   join_style;            /* See "join style" in libaxl-consts.h (Beware of namespacing) */
	uint8_t                   fill_style;            /* LIBAXL_SOLID, LIBAXL_TILED, LIBAXL_STIPPLED, or LIBAXL_OPAQUE_STIPPLED */
	uint8_t                   fill_rule;             /* LIBAXL_EVEN_ODD or LIBAXL_WINDING */
	uint8_t                   __omitted2;
	libaxl_pixmap_t           tile;
	libaxl_pixmap_t           stipple;
	int16_t                   tile_stipple_x_origin;
	int16_t                   tile_stipple_y_origin;
	libaxl_font_t             font;
	uint8_t                   subwindow_mode;        /* CLIP_BY_CHILDREN or INCLUDE_INFERIORS */
	libaxl_bool_t             graphics_exposures;
	uint16_t                  __omitted3;
	int16_t                   clip_x_origin;
	int16_t                   clip_y_origin;
	libaxl_pixmap_t           clip_mask;             /* Can be LIBAXL_NONE */
	uint16_t                  dash_offset;
	uint8_t                   dashes;
	uint8_t                   arc_mode;              /* LIBAXL_CHORD or LIBAXL_PIE_SLICE */
};

struct libaxl_request_copy_gc {
#define LIBAXL_REQUEST_COPY_GC 57
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_gcontext_t         src_gc;
	libaxl_gcontext_t         dest_gc;
	uint32_t                  value_mask;
#define LIBAXL_REQUEST_COPY_GC_FUNCTION              0x00000001UL
#define LIBAXL_REQUEST_COPY_GC_PLANE_MASK            0x00000002UL
#define LIBAXL_REQUEST_COPY_GC_FOREGROUND            0x00000004UL
#define LIBAXL_REQUEST_COPY_GC_BACKGROUND            0x00000008UL
#define LIBAXL_REQUEST_COPY_GC_LINE_WIDTH            0x00000010UL
#define LIBAXL_REQUEST_COPY_GC_LINE_STYLE            0x00000020UL
#define LIBAXL_REQUEST_COPY_GC_CAP_STYLE             0x00000040UL
#define LIBAXL_REQUEST_COPY_GC_JOIN_STYLE            0x00000080UL
#define LIBAXL_REQUEST_COPY_GC_FILL_STYLE            0x00000100UL
#define LIBAXL_REQUEST_COPY_GC_FILL_RULE             0x00000200UL
#define LIBAXL_REQUEST_COPY_GC_TILE                  0x00000400UL
#define LIBAXL_REQUEST_COPY_GC_STIPPLE               0x00000800UL
#define LIBAXL_REQUEST_COPY_GC_TILE_STIPPLE_X_ORIGIN 0x00001000UL
#define LIBAXL_REQUEST_COPY_GC_TILE_STIPPLE_Y_ORIGIN 0x00002000UL
#define LIBAXL_REQUEST_COPY_GC_FONT                  0x00004000UL
#define LIBAXL_REQUEST_COPY_GC_SUBWINDOW_MODE        0x00008000UL
#define LIBAXL_REQUEST_COPY_GC_GRAPHICS_EXPOSURES    0x00010000UL
#define LIBAXL_REQUEST_COPY_GC_CLIP_X_ORIGIN         0x00020000UL
#define LIBAXL_REQUEST_COPY_GC_CLIP_Y_ORIGIN         0x00040000UL
#define LIBAXL_REQUEST_COPY_GC_CLIP_MASK             0x00080000UL
#define LIBAXL_REQUEST_COPY_GC_DASH_OFFSET           0x00100000UL
#define LIBAXL_REQUEST_COPY_GC_DASHES                0x00200000UL
#define LIBAXL_REQUEST_COPY_GC_ARC_MODE              0x00400000UL
};

struct libaxl_request_set_dashes {
#define LIBAXL_REQUEST_SET_DASHES 58
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_gcontext_t         gc;
	uint16_t                  dash_offset;
	uint16_t                  length_of_dashes;
	uint8_t                  *dashes;
};

struct libaxl_request_set_clip_rectangles {
#define LIBAXL_REQUEST_SET_CLIP_RECTANGLES 59
	uint8_t                   opcode;
	uint8_t                   ordering;              /* LIBAXL_UNSORTED, LIBAXL_YSORTED, LIBAXL_YXSORTED, or LIBAXL_YXBANDED */
	uint16_t                  _request_length;
	libaxl_gcontext_t         gc;
	int16_t                   clip_x_origin;
	int16_t                   clip_y_origin;
	size_t                    number_of_rectangles;
	struct libaxl_rectangle  *rectangles;
};

struct libaxl_request_free_gc {
#define LIBAXL_REQUEST_FREE_GC 60
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_gcontext_t         gc;
};

struct libaxl_request_clear_area {
#define LIBAXL_REQUEST_CLEAR_AREA 61
	uint8_t                   opcode;
	libaxl_bool_t             exposures;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_window_t           window;
	int16_t                   x;
	int16_t                   y;
	uint16_t                  width;
	uint16_t                  height;
};

struct libaxl_request_copy_area {
#define LIBAXL_REQUEST_COPY_AREA 62
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 7 */
	libaxl_drawable_t         src_drawable;
	libaxl_drawable_t         dest_drawable;
	libaxl_gcontext_t         gc;
	int16_t                   src_x;
	int16_t                   src_y;
	int16_t                   dest_x;
	int16_t                   dest_y;
	uint16_t                  width;
	uint16_t                  height;
};

struct libaxl_request_copy_plane {
#define LIBAXL_REQUEST_COPY_PLANE 63
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 8 */
	libaxl_drawable_t         src_drawable;
	libaxl_drawable_t         dest_drawable;
	libaxl_gcontext_t         gc;
	int16_t                   src_x;
	int16_t                   src_y;
	int16_t                   dest_x;
	int16_t                   dest_y;
	uint16_t                  width;
	uint16_t                  height;
	uint32_t                  bit_plane;
};

struct libaxl_request_poly_point {
#define LIBAXL_REQUEST_POLY_POINT 64
	uint8_t                   opcode;
	uint8_t                   coordinate_mode;       /* LIBAXL_ORIGIN or LIBAXL_PREVIOUS */
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	size_t                    number_of_points;
	struct libaxl_point      *points;
};

struct libaxl_request_poly_line {
#define LIBAXL_REQUEST_POLY_LINE 65
	uint8_t                   opcode;
	uint8_t                   coordinate_mode;       /* LIBAXL_ORIGIN or LIBAXL_PREVIOUS */
	uint16_t                  _request_length;
	libaxl_drawable_t          drawable;
	libaxl_gcontext_t         gc;
	struct libaxl_point      *points;
};

struct libaxl_request_poly_segment {
#define LIBAXL_REQUEST_POLY_SEGMENT 66
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	size_t                    number_of_segments;
	struct libaxl_segment    *segments;
};

struct libaxl_request_poly_rectangle {
#define LIBAXL_REQUEST_POLY_RECTANGLE 67
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	size_t                    number_of_rectangles;
	struct libaxl_rectangle  *rectangle;
};

struct libaxl_request_poly_arc {
#define LIBAXL_REQUEST_POLY_ARC 68
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	size_t                    number_of_arcs;
	struct libaxl_arc        *arc;
};

struct libaxl_request_fill_poly {
#define LIBAXL_REQUEST_FILL_POLY 69
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	uint8_t                   shape;                 /* LIBAXL_COMPLEX, LIBAXL_NONCONVEX, or LIBAXL_CONVEX */
	uint8_t                   coordinate_mode;       /* LIBAXL_ORIGIN or LIBAXL_PREVIOUS */
	uint16_t                  __pad2;
	size_t                    number_of_pointss;
	struct libaxl_point      *points;
};

struct libaxl_request_poly_fill_rectangle {
#define LIBAXL_REQUEST_POLY_FILL_RECTANGLE 70
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	size_t                    number_of_rectangles;
	struct libaxl_rectangle  *rectangles;
};

struct libaxl_request_poly_fill_arc {
#define LIBAXL_REQUEST_POLY_FILL_ARC 71
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	size_t                    number_of_arcs;
	struct libaxl_arc        *arcs;
};

struct libaxl_request_put_image {
#define LIBAXL_REQUEST_PUT_IMAGE 72
	uint8_t                   opcode;
	uint8_t                   format;                /* LIBAXL_BITMAP, LIBAXL_XYPIXMAP, or LIBAXL_ZPIXMAP */
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	uint16_t                  width;
	uint16_t                  height;
	int16_t                   dest_x;
	int16_t                   dest_y;
	uint8_t                   left_pad;
	uint8_t                   depth;
	uint16_t                  __pad;
	size_t                    data_size;
	uint8_t                  *data;
};

struct libaxl_request_get_image {
#define LIBAXL_REQUEST_GET_IMAGE 73
	uint8_t                   opcode;
	uint8_t                   format;                /* LIBAXL_XYPIXMAP (= 1) or LIBAXL_ZPIXMAP (= 2) */
	uint16_t                  _request_length;       /* = 5 */
	libaxl_drawable_t         drawable;
	int16_t                   x;
	int16_t                   y;
	uint16_t                  width;
	uint16_t                  height;
	uint32_t                  plane_mask;
};

struct libaxl_request_poly_text8 {
#define LIBAXL_REQUEST_POLY_TEXT8 74
	uint8_t                   opcode;
	uint8_t                   __unused;
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	int16_t                   x;
	int16_t                   y;
	size_t                    number_of_items;
	union libaxl_text_item8  *items;
};

struct libaxl_request_poly_text16 {
#define LIBAXL_REQUEST_POLY_TEXT16 75
	uint8_t                   opcode;
	uint8_t                   __unused;
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	int16_t                   x;
	int16_t                   y;
	size_t                    number_of_items;
	union libaxl_text_item16 *items;
};

struct libaxl_request_image_text8 {
#define LIBAXL_REQUEST_IMAGE_TEXT8 76
	uint8_t                   opcode;
	uint8_t                   length_of_string;
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	int16_t                   x;
	int16_t                   y;
	char                     *string;
};

struct libaxl_request_image_text16 {
#define LIBAXL_REQUEST_IMAGE_TEXT16 77
	uint8_t                   opcode;
	uint8_t                   length_of_string;
	uint16_t                  _request_length;
	libaxl_drawable_t         drawable;
	libaxl_gcontext_t         gc;
	int16_t                   x;
	int16_t                   y;
	uint16_t                 *string;
};

struct libaxl_request_create_colormap {
#define LIBAXL_REQUEST_CREATE_COLORMAP 78
	uint8_t                   opcode;
	uint8_t                   alloc;                 /* LIBAXL_NONE or LIBAXL_ALL */
	uint16_t                  _request_length;       /* = 4 */
	libaxl_colormap_t         mid;
	libaxl_window_t           window;
	libaxl_visual_t           visual;
};

struct libaxl_request_free_colormap {
#define LIBAXL_REQUEST_FREE_COLORMAP 79
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_colormap_t         cmap;
};

struct libaxl_request_copy_colormap_and_free {
#define LIBAXL_REQUEST_COPY_COLORMAP_AND_FREE 80
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 3 */
	libaxl_colormap_t         mid;
	libaxl_colormap_t         src_cmap;
};

struct libaxl_request_install_colormap {
#define LIBAXL_REQUEST_INSTALL_COLORMAP 81
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_colormap_t         cmap;
};

struct libaxl_request_uninstall_colormap {
#define LIBAXL_REQUEST_UNINSTALL_COLORMAP 82
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_colormap_t         cmap;
};

struct libaxl_request_list_installed_colormaps {
#define LIBAXL_REQUEST_LIST_INSTALLED_COLORMAPS 83
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_window_t           window;
};

struct libaxl_request_alloc_color {
#define LIBAXL_REQUEST_ALLOC_COLOR 84
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_colormap_t         cmap;
	uint16_t                  red;
	uint16_t                  green;
	uint16_t                  blue;
	uint16_t                  __pad2;
};

struct libaxl_request_alloc_named_color {
#define LIBAXL_REQUEST_ALLOC_NAMED_COLOR 85
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;
	libaxl_colormap_t         cmap;
	uint16_t                  length_of_name;
	uint16_t                  __pad2;
	char                     *name;
};

struct libaxl_request_alloc_color_cells {
#define LIBAXL_REQUEST_ALLOC_COLOR_CELLS 86
	uint8_t                   opcode;
	libaxl_bool_t             contiguous;
	uint16_t                  _request_length;       /* = 3 */
	libaxl_colormap_t         cmap;
	uint16_t                  colors;
	uint16_t                  planes;
};

struct libaxl_request_alloc_color_planes {
#define LIBAXL_REQUEST_ALLOC_COLOR_PLANES 87
	uint8_t                   opcode;
	libaxl_bool_t             contiguous;
	uint16_t                  _request_length;       /* = 4 */
	libaxl_colormap_t         cmap;
	uint16_t                  colors;
	uint16_t                  reds;
	uint16_t                  greens;
	uint16_t                  blues;
};

struct libaxl_request_free_colors {
#define LIBAXL_REQUEST_FREE_COLORS 88
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_colormap_t         cmap;
	uint32_t                  plane_mask;
	size_t                    number_of_pixels;
	uint32_t                 *pixels;
};

struct libaxl_request_store_colors {
#define LIBAXL_REQUEST_STORE_COLORS 89
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_colormap_t         cmap;
	size_t                    number_of_items;
	struct libaxl_coloritem  *items;
};

struct libaxl_request_store_named_color {
#define LIBAXL_REQUEST_STORE_NAMED_COLOR 90
	uint8_t                   opcode;
	uint8_t                   flags;                 /* See libaxl-consts.h */
	uint16_t                  _request_length;
	libaxl_colormap_t         cmap;
	uint32_t                  pixel;
	uint16_t                  length_of_name;
	uint16_t                  __unused;
	char                     *name;
};

struct libaxl_request_query_colors {
#define LIBAXL_REQUEST_QUERY_COLORS 91
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_colormap_t         cmap;
	size_t                    number_of_pixels;
	uint32_t                 *pixels;
};

struct libaxl_request_lookup_color {
#define LIBAXL_REQUEST_LOOKUP_COLOR 92
	uint8_t                   opcode;
	uint8_t                   __unused;
	uint16_t                  _request_length;
	libaxl_colormap_t         cmap;
	uint16_t                  length_of_name;
	uint16_t                  __pad;
	char                     *name;
};

struct libaxl_request_create_cursor {
#define LIBAXL_REQUEST_CREATE_CURSOR 93
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 8 */
	libaxl_cursor_t           cid;
	libaxl_pixmap_t           source;
	libaxl_pixmap_t           mask;                  /* Can be LIBAXL_NONE */
	uint16_t                  fore_red;
	uint16_t                  fore_green;
	uint16_t                  fore_blue;
	uint16_t                  back_red;
	uint16_t                  back_green;
	uint16_t                  back_blue;
	uint16_t                  x;
	uint16_t                  y;
};

struct libaxl_request_create_glyph_cursor {
#define LIBAXL_REQUEST_CREATE_GLYPH_CURSOR 94
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 8 */
	libaxl_cursor_t           cid;
	libaxl_font_t             source_font;
	libaxl_font_t             mask_font;             /* Can be LIBAXL_NONE */
	uint16_t                  source_char;
	uint16_t                  mask_char;
	uint16_t                  fore_red;
	uint16_t                  fore_green;
	uint16_t                  fore_blue;
	uint16_t                  back_red;
	uint16_t                  back_green;
	uint16_t                  back_blue;
};

struct libaxl_request_free_cursor {
#define LIBAXL_REQUEST_FREE_CURSOR 95
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_cursor_t           cursor;
};

struct libaxl_request_recolor_cursor {
#define LIBAXL_REQUEST_RECOLOR_CURSOR 96
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 5 */
	libaxl_cursor_t           cursor;
	uint16_t                  fore_red;
	uint16_t                  fore_green;
	uint16_t                  fore_blue;
	uint16_t                  back_red;
	uint16_t                  back_green;
	uint16_t                  back_blue;
};

struct libaxl_request_query_best_size {
#define LIBAXL_REQUEST_QUERY_BEST_SIZE 97
	uint8_t                   opcode;
	uint8_t                   class;                 /* LIBAXL_CURSOR, LIBAXL_TILE, or LIBAXL_STIPPLE */
	uint16_t                  _request_length;       /* = 3 */
	libaxl_drawable_t         drawable;
	uint16_t                  width;
	uint16_t                  height;
};

struct libaxl_request_query_extension {
#define LIBAXL_REQUEST_QUERY_EXTENSION 98
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	uint16_t                  length_of_name;
	uint16_t                  __unused;
	char                     *name;
};

struct libaxl_request_list_extensions {
#define LIBAXL_REQUEST_LIST_EXTENSIONS 99
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_change_keyboard_mapping {
#define LIBAXL_REQUEST_CHANGE_KEYBOARD_MAPPING 100
	uint8_t                   opcode;
	uint8_t                   keycode_count;
	uint16_t                  _request_length;
	libaxl_keycode_t          first_keycode;
	uint8_t                   keysyms_per_keycode;
	uint16_t                  __pad;
	libaxl_keysym_t          *keysyms;
};

struct libaxl_request_get_keyboard_mapping {
#define LIBAXL_REQUEST_GET_KEYBOARD_MAPPING 101
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_keycode_t          first_keycode;
	uint8_t                   count;
	uint16_t                  __pad2;
};

struct libaxl_request_change_keyboard_control {
#define LIBAXL_REQUEST_CHANGE_KEYBOARD_CONTROL 102
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	uint32_t                  value_mask;            /* Determines which below are included, all are encoded as uint32_t */
#define LIBAXL_REQUEST_CHANGE_KEYBOARD_CONTROL_KEY_CLICK_PERCENT 0x0001U
#define LIBAXL_REQUEST_CHANGE_KEYBOARD_CONTROL_BELL_PERCENT      0x0002U
#define LIBAXL_REQUEST_CHANGE_KEYBOARD_CONTROL_BELL_PITCH        0x0004U
#define LIBAXL_REQUEST_CHANGE_KEYBOARD_CONTROL_BELL_DURATION     0x0008U
#define LIBAXL_REQUEST_CHANGE_KEYBOARD_CONTROL_LED               0x0010U
#define LIBAXL_REQUEST_CHANGE_KEYBOARD_CONTROL_LED_MODE          0x0020U
#define LIBAXL_REQUEST_CHANGE_KEYBOARD_CONTROL_KEY               0x0040U
#define LIBAXL_REQUEST_CHANGE_KEYBOARD_CONTROL_AUTO_REPEAT_MODE  0x0080U
	int8_t                    key_click_percent;
	int8_t                    bell_percent;
	int16_t                   bell_pitch;
	int16_t                   bell_duration;
	uint8_t                   led;
	uint8_t                   led_mode;              /* LIBAXL_OFF or LIBAXL_ON */
	libaxl_keycode_t          key;
	uint8_t                   auto_repeat_mode;      /* LIBAXL_OFF, LIBAXL_ON, or LIBAXL_DEFAULT */
	uint16_t                  __omitted;
};

struct libaxl_request_get_keyboard_control {
#define LIBAXL_REQUEST_GET_KEYBOARD_CONTROL 103
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_bell {
#define LIBAXL_REQUEST_BELL 104
	uint8_t                   opcode;
	int8_t                    percent;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_change_pointer_control {
#define LIBAXL_REQUEST_CHANGE_POINTER_CONTROL 105
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 3 */
	int16_t                   acceleration_numerator;
	int16_t                   acceleration_denominator;
	int16_t                   threshold;
	libaxl_bool_t             do_acceleration;
	libaxl_bool_t             do_threshold;
};

struct libaxl_request_get_pointer_control {
#define LIBAXL_REQUEST_GET_POINTER_CONTROL 106
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_set_screen_saver {
#define LIBAXL_REQUEST_SET_SCREEN_SAVER 107
	uint8_t                   opcode;
	uint8_t                   __pad1;
	uint16_t                  _request_length;       /* = 3 */
	int16_t                   timeout;
	int16_t                   interval;
	uint8_t                   prefer_blanking;       /* LIBAXL_NO, LIBAXL_YES, or LIBAXL_DEFAULT */
	uint8_t                   allow_exposures;       /* LIBAXL_NO, LIBAXL_YES, or LIBAXL_DEFAULT */
	uint16_t                  __pad2;
};

struct libaxl_request_get_screen_saver {
#define LIBAXL_REQUEST_GET_SCREEN_SAVER 108
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_change_hosts {
#define LIBAXL_REQUEST_CHANGE_HOSTS 109
	uint8_t                   opcode;
	uint8_t                   mode;                  /* LIBAXL_INSERT or LIBAXL_DELETE */
	uint16_t                  _request_length;
	uint8_t                   family;                /* See libaxl-consts.h */
	uint8_t                   __pad;
	uint16_t                  length_of_address;
	uint8_t                  *address;
};

struct libaxl_request_list_hosts {
#define LIBAXL_REQUEST_LIST_HOSTS 110
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_set_access_control {
#define LIBAXL_REQUEST_SET_ACCESS_CONTROL 111
	uint8_t                   opcode;
	uint8_t                   mode;                  /* LIBAXL_DISABLE or LIBAXL_ENABLE */
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_set_close_down_mode {
#define LIBAXL_REQUEST_SET_CLOSE_DOWN_MODE 112
	uint8_t                   opcode;
	uint8_t                   mode;                  /* LIBAXL_DESTROY, LIBAXL_RETAIN_PERMANENT, or LIBAXL_RETAIN_TEMPORARY */
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_kill_client {
#define LIBAXL_REQUEST_KILL_CLIENT 113
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 2 */
	libaxl_id_t               resource;              /* Can be LIBAXL_ALL_TEMPORARY */
};

struct libaxl_request_rotate_properties {
#define LIBAXL_REQUEST_ROTATE_PROPERTIES 114
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;
	libaxl_window_t           window;
	uint16_t                  number_of_properties;
	int16_t                   delta;
	libaxl_atom_t            *properties;
};

struct libaxl_request_force_screen_saver {
#define LIBAXL_REQUEST_FORCE_SCREEN_SAVER 115
	uint8_t                   opcode;
	uint8_t                   mode;                  /* LIBAXL_RESET or LIBAXL_ACTIVATE */
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_set_pointer_mapping {
#define LIBAXL_REQUEST_SET_POINTER_MAPPING 116
	uint8_t                   opcode;
	uint8_t                   length_of_map;
	uint16_t                  _request_length;
	uint8_t                  *map;
};

struct libaxl_request_get_pointer_mapping {
#define LIBAXL_REQUEST_GET_POINTER_MAPPING 117
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_set_modifier_mapping {
#define LIBAXL_REQUEST_SET_MODIFIER_MAPPING 118
	uint8_t                   opcode;
	uint8_t                   keycodes_per_modifier; /* number of pairs */
	uint16_t                  _request_length;
	libaxl_keycode_t         *keycodes;
};

struct libaxl_request_get_modifier_mapping {
#define LIBAXL_REQUEST_GET_MODIFIER_MAPPING 119
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  _request_length;       /* = 1 */
};

struct libaxl_request_no_operation {
#define LIBAXL_REQUEST_NO_OPERATION 127
	uint8_t                   opcode;
	uint8_t                   __pad;
	uint16_t                  request_length;
};

union libaxl_request { /* TODO man page */
	struct {
		uint8_t           opcode;
		uint8_t           __data;
		uint16_t          _request_length;
	};
# include "libaxl-requests-structs.h"
};

union libaxl_request_const_ptr { /* TODO man page */
	void                     *as_voidptr;
	union libaxl_request     *as_union;
# include "libaxl-requests-ptr-structs.h"
} _LIBAXL_GCC_ONLY(__attribute__((__transparent_union__)));