forked from emscripten-core/emscripten
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXproto.h
More file actions
2157 lines (1952 loc) · 55.3 KB
/
Xproto.h
File metadata and controls
2157 lines (1952 loc) · 55.3 KB
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
/* Definitions for the X window system used by server and c bindings */
/*
* This packet-construction scheme makes the following assumptions:
*
* 1. The compiler is able
* to generate code which addresses one- and two-byte quantities.
* In the worst case, this would be done with bit-fields. If bit-fields
* are used it may be necessary to reorder the request fields in this file,
* depending on the order in which the machine assigns bit fields to
* machine words. There may also be a problem with sign extension,
* as K+R specify that bitfields are always unsigned.
*
* 2. 2- and 4-byte fields in packet structures must be ordered by hand
* such that they are naturally-aligned, so that no compiler will ever
* insert padding bytes.
*
* 3. All packets are hand-padded to a multiple of 4 bytes, for
* the same reason.
*/
#ifndef XPROTO_H
#define XPROTO_H
/***********************************************************
Copyright 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#include <X11/Xmd.h>
#include <X11/Xprotostr.h>
/*
* Define constants for the sizes of the network packets. The sz_ prefix is
* used instead of something more descriptive so that the symbols are no more
* than 32 characters in length (which causes problems for some compilers).
*/
#define sz_xSegment 8
#define sz_xPoint 4
#define sz_xRectangle 8
#define sz_xArc 12
#define sz_xConnClientPrefix 12
#define sz_xConnSetupPrefix 8
#define sz_xConnSetup 32
#define sz_xPixmapFormat 8
#define sz_xDepth 8
#define sz_xVisualType 24
#define sz_xWindowRoot 40
#define sz_xTimecoord 8
#define sz_xHostEntry 4
#define sz_xCharInfo 12
#define sz_xFontProp 8
#define sz_xTextElt 2
#define sz_xColorItem 12
#define sz_xrgb 8
#define sz_xGenericReply 32
#define sz_xGetWindowAttributesReply 44
#define sz_xGetGeometryReply 32
#define sz_xQueryTreeReply 32
#define sz_xInternAtomReply 32
#define sz_xGetAtomNameReply 32
#define sz_xGetPropertyReply 32
#define sz_xListPropertiesReply 32
#define sz_xGetSelectionOwnerReply 32
#define sz_xGrabPointerReply 32
#define sz_xQueryPointerReply 32
#define sz_xGetMotionEventsReply 32
#define sz_xTranslateCoordsReply 32
#define sz_xGetInputFocusReply 32
#define sz_xQueryKeymapReply 40
#define sz_xQueryFontReply 60
#define sz_xQueryTextExtentsReply 32
#define sz_xListFontsReply 32
#define sz_xGetFontPathReply 32
#define sz_xGetImageReply 32
#define sz_xListInstalledColormapsReply 32
#define sz_xAllocColorReply 32
#define sz_xAllocNamedColorReply 32
#define sz_xAllocColorCellsReply 32
#define sz_xAllocColorPlanesReply 32
#define sz_xQueryColorsReply 32
#define sz_xLookupColorReply 32
#define sz_xQueryBestSizeReply 32
#define sz_xQueryExtensionReply 32
#define sz_xListExtensionsReply 32
#define sz_xSetMappingReply 32
#define sz_xGetKeyboardControlReply 52
#define sz_xGetPointerControlReply 32
#define sz_xGetScreenSaverReply 32
#define sz_xListHostsReply 32
#define sz_xSetModifierMappingReply 32
#define sz_xError 32
#define sz_xEvent 32
#define sz_xKeymapEvent 32
#define sz_xReq 4
#define sz_xResourceReq 8
#define sz_xCreateWindowReq 32
#define sz_xChangeWindowAttributesReq 12
#define sz_xChangeSaveSetReq 8
#define sz_xReparentWindowReq 16
#define sz_xConfigureWindowReq 12
#define sz_xCirculateWindowReq 8
#define sz_xInternAtomReq 8
#define sz_xChangePropertyReq 24
#define sz_xDeletePropertyReq 12
#define sz_xGetPropertyReq 24
#define sz_xSetSelectionOwnerReq 16
#define sz_xConvertSelectionReq 24
#define sz_xSendEventReq 44
#define sz_xGrabPointerReq 24
#define sz_xGrabButtonReq 24
#define sz_xUngrabButtonReq 12
#define sz_xChangeActivePointerGrabReq 16
#define sz_xGrabKeyboardReq 16
#define sz_xGrabKeyReq 16
#define sz_xUngrabKeyReq 12
#define sz_xAllowEventsReq 8
#define sz_xGetMotionEventsReq 16
#define sz_xTranslateCoordsReq 16
#define sz_xWarpPointerReq 24
#define sz_xSetInputFocusReq 12
#define sz_xOpenFontReq 12
#define sz_xQueryTextExtentsReq 8
#define sz_xListFontsReq 8
#define sz_xSetFontPathReq 8
#define sz_xCreatePixmapReq 16
#define sz_xCreateGCReq 16
#define sz_xChangeGCReq 12
#define sz_xCopyGCReq 16
#define sz_xSetDashesReq 12
#define sz_xSetClipRectanglesReq 12
#define sz_xCopyAreaReq 28
#define sz_xCopyPlaneReq 32
#define sz_xPolyPointReq 12
#define sz_xPolySegmentReq 12
#define sz_xFillPolyReq 16
#define sz_xPutImageReq 24
#define sz_xGetImageReq 20
#define sz_xPolyTextReq 16
#define sz_xImageTextReq 16
#define sz_xCreateColormapReq 16
#define sz_xCopyColormapAndFreeReq 12
#define sz_xAllocColorReq 16
#define sz_xAllocNamedColorReq 12
#define sz_xAllocColorCellsReq 12
#define sz_xAllocColorPlanesReq 16
#define sz_xFreeColorsReq 12
#define sz_xStoreColorsReq 8
#define sz_xStoreNamedColorReq 16
#define sz_xQueryColorsReq 8
#define sz_xLookupColorReq 12
#define sz_xCreateCursorReq 32
#define sz_xCreateGlyphCursorReq 32
#define sz_xRecolorCursorReq 20
#define sz_xQueryBestSizeReq 12
#define sz_xQueryExtensionReq 8
#define sz_xChangeKeyboardControlReq 8
#define sz_xBellReq 4
#define sz_xChangePointerControlReq 12
#define sz_xSetScreenSaverReq 12
#define sz_xChangeHostsReq 8
#define sz_xListHostsReq 4
#define sz_xChangeModeReq 4
#define sz_xRotatePropertiesReq 12
#define sz_xReply 32
#define sz_xGrabKeyboardReply 32
#define sz_xListFontsWithInfoReply 60
#define sz_xSetPointerMappingReply 32
#define sz_xGetKeyboardMappingReply 32
#define sz_xGetPointerMappingReply 32
#define sz_xGetModifierMappingReply 32
#define sz_xListFontsWithInfoReq 8
#define sz_xPolyLineReq 12
#define sz_xPolyArcReq 12
#define sz_xPolyRectangleReq 12
#define sz_xPolyFillRectangleReq 12
#define sz_xPolyFillArcReq 12
#define sz_xPolyText8Req 16
#define sz_xPolyText16Req 16
#define sz_xImageText8Req 16
#define sz_xImageText16Req 16
#define sz_xSetPointerMappingReq 4
#define sz_xForceScreenSaverReq 4
#define sz_xSetCloseDownModeReq 4
#define sz_xClearAreaReq 16
#define sz_xSetAccessControlReq 4
#define sz_xGetKeyboardMappingReq 8
#define sz_xSetModifierMappingReq 4
#define sz_xPropIconSize 24
#define sz_xChangeKeyboardMappingReq 8
/* For the purpose of the structure definitions in this file,
we must redefine the following types in terms of Xmd.h's types, which may
include bit fields. All of these are #undef'd at the end of this file,
restoring the definitions in X.h. */
#define Window CARD32
#define Drawable CARD32
#define Font CARD32
#define Pixmap CARD32
#define Cursor CARD32
#define Colormap CARD32
#define GContext CARD32
#define Atom CARD32
#define VisualID CARD32
#define Time CARD32
#define KeyCode CARD8
#define KeySym CARD32
#define X_TCP_PORT 6000 /* add display number */
#define xTrue 1
#define xFalse 0
typedef CARD16 KeyButMask;
/*****************
connection setup structure. This is followed by
numRoots xWindowRoot structs.
*****************/
typedef struct {
CARD8 byteOrder;
BYTE pad;
CARD16 majorVersion B16, minorVersion B16;
CARD16 nbytesAuthProto B16; /* Authorization protocol */
CARD16 nbytesAuthString B16; /* Authorization string */
CARD16 pad2 B16;
} xConnClientPrefix;
typedef struct {
CARD8 success;
BYTE lengthReason; /*num bytes in string following if failure */
CARD16 majorVersion B16,
minorVersion B16;
CARD16 length B16; /* 1/4 additional bytes in setup info */
} xConnSetupPrefix;
typedef struct {
CARD32 release B32;
CARD32 ridBase B32,
ridMask B32;
CARD32 motionBufferSize B32;
CARD16 nbytesVendor B16; /* number of bytes in vendor string */
CARD16 maxRequestSize B16;
CARD8 numRoots; /* number of roots structs to follow */
CARD8 numFormats; /* number of pixmap formats */
CARD8 imageByteOrder; /* LSBFirst, MSBFirst */
CARD8 bitmapBitOrder; /* LeastSignificant, MostSign...*/
CARD8 bitmapScanlineUnit, /* 8, 16, 32 */
bitmapScanlinePad; /* 8, 16, 32 */
KeyCode minKeyCode, maxKeyCode;
CARD32 pad2 B32;
} xConnSetup;
typedef struct {
CARD8 depth;
CARD8 bitsPerPixel;
CARD8 scanLinePad;
CARD8 pad1;
CARD32 pad2 B32;
} xPixmapFormat;
/* window root */
typedef struct {
CARD8 depth;
CARD8 pad1;
CARD16 nVisuals B16; /* number of xVisualType structures following */
CARD32 pad2 B32;
} xDepth;
typedef struct {
VisualID visualID B32;
#if defined(__cplusplus) || defined(c_plusplus)
CARD8 c_class;
#else
CARD8 class;
#endif
CARD8 bitsPerRGB;
CARD16 colormapEntries B16;
CARD32 redMask B32, greenMask B32, blueMask B32;
CARD32 pad B32;
} xVisualType;
typedef struct {
Window windowId B32;
Colormap defaultColormap B32;
CARD32 whitePixel B32, blackPixel B32;
CARD32 currentInputMask B32;
CARD16 pixWidth B16, pixHeight B16;
CARD16 mmWidth B16, mmHeight B16;
CARD16 minInstalledMaps B16, maxInstalledMaps B16;
VisualID rootVisualID B32;
CARD8 backingStore;
BOOL saveUnders;
CARD8 rootDepth;
CARD8 nDepths; /* number of xDepth structures following */
} xWindowRoot;
/*****************************************************************
* Structure Defns
* Structures needed for replies
*****************************************************************/
/* Used in GetMotionEvents */
typedef struct {
CARD32 time B32;
INT16 x B16, y B16;
} xTimecoord;
typedef struct {
CARD8 family;
BYTE pad;
CARD16 length B16;
} xHostEntry;
typedef struct {
INT16 leftSideBearing B16,
rightSideBearing B16,
characterWidth B16,
ascent B16,
descent B16;
CARD16 attributes B16;
} xCharInfo;
typedef struct {
Atom name B32;
CARD32 value B32;
} xFontProp;
/*
* non-aligned big-endian font ID follows this struct
*/
typedef struct { /* followed by string */
CARD8 len; /* number of *characters* in string, or FontChange (255)
for font change, or 0 if just delta given */
INT8 delta;
} xTextElt;
typedef struct {
CARD32 pixel B32;
CARD16 red B16, green B16, blue B16;
CARD8 flags; /* DoRed, DoGreen, DoBlue booleans */
CARD8 pad;
} xColorItem;
typedef struct {
CARD16 red B16, green B16, blue B16, pad B16;
} xrgb;
typedef CARD8 KEYCODE;
/*****************
* XRep:
* meant to be 32 byte quantity
*****************/
/* GenericReply is the common format of all replies. The "data" items
are specific to each individual reply type. */
typedef struct {
BYTE type; /* X_Reply */
BYTE data1; /* depends on reply type */
CARD16 sequenceNumber B16; /* of last request received by server */
CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */
CARD32 data00 B32;
CARD32 data01 B32;
CARD32 data02 B32;
CARD32 data03 B32;
CARD32 data04 B32;
CARD32 data05 B32;
} xGenericReply;
/* Individual reply formats. */
typedef struct {
BYTE type; /* X_Reply */
CARD8 backingStore;
CARD16 sequenceNumber B16;
CARD32 length B32; /* NOT 0; this is an extra-large reply */
VisualID visualID B32;
#if defined(__cplusplus) || defined(c_plusplus)
CARD16 c_class B16;
#else
CARD16 class B16;
#endif
CARD8 bitGravity;
CARD8 winGravity;
CARD32 backingBitPlanes B32;
CARD32 backingPixel B32;
BOOL saveUnder;
BOOL mapInstalled;
CARD8 mapState;
BOOL override;
Colormap colormap B32;
CARD32 allEventMasks B32;
CARD32 yourEventMask B32;
CARD16 doNotPropagateMask B16;
CARD16 pad B16;
} xGetWindowAttributesReply;
typedef struct {
BYTE type; /* X_Reply */
CARD8 depth;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
Window root B32;
INT16 x B16, y B16;
CARD16 width B16, height B16;
CARD16 borderWidth B16;
CARD16 pad1 B16;
CARD32 pad2 B32;
CARD32 pad3 B32;
} xGetGeometryReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
Window root B32, parent B32;
CARD16 nChildren B16;
CARD16 pad2 B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
} xQueryTreeReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
Atom atom B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
} xInternAtomReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* of additional bytes */
CARD16 nameLength B16; /* # of characters in name */
CARD16 pad2 B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xGetAtomNameReply;
typedef struct {
BYTE type; /* X_Reply */
CARD8 format;
CARD16 sequenceNumber B16;
CARD32 length B32; /* of additional bytes */
Atom propertyType B32;
CARD32 bytesAfter B32;
CARD32 nItems B32; /* # of 8, 16, or 32-bit entities in reply */
CARD32 pad1 B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
} xGetPropertyReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 nProperties B16;
CARD16 pad2 B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xListPropertiesReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
Window owner B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
} xGetSelectionOwnerReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE status;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
CARD32 pad1 B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
} xGrabPointerReply;
typedef xGrabPointerReply xGrabKeyboardReply;
typedef struct {
BYTE type; /* X_Reply */
BOOL sameScreen;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
Window root B32, child B32;
INT16 rootX B16, rootY B16, winX B16, winY B16;
CARD16 mask B16;
CARD16 pad1 B16;
CARD32 pad B32;
} xQueryPointerReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 nEvents B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
} xGetMotionEventsReply;
typedef struct {
BYTE type; /* X_Reply */
BOOL sameScreen;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
Window child B32;
INT16 dstX B16, dstY B16;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
} xTranslateCoordsReply;
typedef struct {
BYTE type; /* X_Reply */
CARD8 revertTo;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
Window focus B32;
CARD32 pad1 B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
} xGetInputFocusReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 2, NOT 0; this is an extra-large reply */
BYTE map[32];
} xQueryKeymapReply;
/* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */
typedef struct _xQueryFontReply {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* definitely > 0, even if "nCharInfos" is 0 */
xCharInfo minBounds;
#ifndef WORD64
CARD32 walign1 B32;
#endif
xCharInfo maxBounds;
#ifndef WORD64
CARD32 walign2 B32;
#endif
CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
CARD16 defaultChar B16;
CARD16 nFontProps B16; /* followed by this many xFontProp structures */
CARD8 drawDirection;
CARD8 minByte1, maxByte1;
BOOL allCharsExist;
INT16 fontAscent B16, fontDescent B16;
CARD32 nCharInfos B32; /* followed by this many xCharInfo structures */
} xQueryFontReply;
typedef struct {
BYTE type; /* X_Reply */
CARD8 drawDirection;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
INT16 fontAscent B16, fontDescent B16;
INT16 overallAscent B16, overallDescent B16;
INT32 overallWidth B32, overallLeft B32, overallRight B32;
CARD32 pad B32;
} xQueryTextExtentsReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 nFonts B16;
CARD16 pad2 B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xListFontsReply;
/* Warning: this MUST match (up to component renaming) xQueryFontReply */
typedef struct {
BYTE type; /* X_Reply */
CARD8 nameLength; /* 0 indicates end-of-reply-sequence */
CARD16 sequenceNumber B16;
CARD32 length B32; /* definitely > 0, even if "nameLength" is 0 */
xCharInfo minBounds;
#ifndef WORD64
CARD32 walign1 B32;
#endif
xCharInfo maxBounds;
#ifndef WORD64
CARD32 walign2 B32;
#endif
CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
CARD16 defaultChar B16;
CARD16 nFontProps B16; /* followed by this many xFontProp structures */
CARD8 drawDirection;
CARD8 minByte1, maxByte1;
BOOL allCharsExist;
INT16 fontAscent B16, fontDescent B16;
CARD32 nReplies B32; /* hint as to how many more replies might be coming */
} xListFontsWithInfoReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 nPaths B16;
CARD16 pad2 B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xGetFontPathReply;
typedef struct {
BYTE type; /* X_Reply */
CARD8 depth;
CARD16 sequenceNumber B16;
CARD32 length B32;
VisualID visual B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xGetImageReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 nColormaps B16;
CARD16 pad2 B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xListInstalledColormapsReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
CARD16 red B16, green B16, blue B16;
CARD16 pad2 B16;
CARD32 pixel B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
} xAllocColorReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
CARD32 pixel B32;
CARD16 exactRed B16, exactGreen B16, exactBlue B16;
CARD16 screenRed B16, screenGreen B16, screenBlue B16;
CARD32 pad2 B32;
CARD32 pad3 B32;
} xAllocNamedColorReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 nPixels B16, nMasks B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xAllocColorCellsReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 nPixels B16;
CARD16 pad2 B16;
CARD32 redMask B32, greenMask B32, blueMask B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
} xAllocColorPlanesReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 nColors B16;
CARD16 pad2 B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xQueryColorsReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
CARD16 exactRed B16, exactGreen B16, exactBlue B16;
CARD16 screenRed B16, screenGreen B16, screenBlue B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
} xLookupColorReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
CARD16 width B16, height B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xQueryBestSizeReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
BOOL present;
CARD8 major_opcode;
CARD8 first_event;
CARD8 first_error;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xQueryExtensionReply;
typedef struct {
BYTE type; /* X_Reply */
CARD8 nExtensions;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xListExtensionsReply;
typedef struct {
BYTE type; /* X_Reply */
CARD8 success;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xSetMappingReply;
typedef xSetMappingReply xSetPointerMappingReply;
typedef xSetMappingReply xSetModifierMappingReply;
typedef struct {
BYTE type; /* X_Reply */
CARD8 nElts; /* how many elements does the map have */
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xGetPointerMappingReply;
typedef struct {
BYTE type;
CARD8 keySymsPerKeyCode;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xGetKeyboardMappingReply;
typedef struct {
BYTE type;
CARD8 numKeyPerModifier;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD32 pad1 B32;
CARD32 pad2 B32;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
} xGetModifierMappingReply;
typedef struct {
BYTE type; /* X_Reply */
BOOL globalAutoRepeat;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 5 */
CARD32 ledMask B32;
CARD8 keyClickPercent, bellPercent;
CARD16 bellPitch B16, bellDuration B16;
CARD16 pad B16;
BYTE map[32]; /* bit masks start here */
} xGetKeyboardControlReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
CARD16 accelNumerator B16, accelDenominator B16;
CARD16 threshold B16;
CARD16 pad2 B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
} xGetPointerControlReply;
typedef struct {
BYTE type; /* X_Reply */
BYTE pad1;
CARD16 sequenceNumber B16;
CARD32 length B32; /* 0 */
CARD16 timeout B16, interval B16;
BOOL preferBlanking;
BOOL allowExposures;
CARD16 pad2 B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
} xGetScreenSaverReply;
typedef struct {
BYTE type; /* X_Reply */
BOOL enabled;
CARD16 sequenceNumber B16;
CARD32 length B32;
CARD16 nHosts B16;
CARD16 pad1 B16;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xListHostsReply;
/*****************************************************************
* Xerror
* All errors are 32 bytes
*****************************************************************/
typedef struct {
BYTE type; /* X_Error */
BYTE errorCode;
CARD16 sequenceNumber B16; /* the nth request from this client */
CARD32 resourceID B32;
CARD16 minorCode B16;
CARD8 majorCode;
BYTE pad1;
CARD32 pad3 B32;
CARD32 pad4 B32;
CARD32 pad5 B32;
CARD32 pad6 B32;
CARD32 pad7 B32;
} xError;
/*****************************************************************
* xEvent
* All events are 32 bytes
*****************************************************************/
typedef struct _xEvent {
union {
struct {
BYTE type;
BYTE detail;
CARD16 sequenceNumber B16;
} u;
struct {
CARD32 pad00 B32;
Time time B32;