Merge branch 'upstream' into tizen
[platform/upstream/xproto.git] / Xproto.h
1 /* Definitions for the X window system used by server and c bindings */
2
3 /*
4  * This packet-construction scheme makes the following assumptions:
5  *
6  * 1. The compiler is able
7  * to generate code which addresses one- and two-byte quantities.
8  * In the worst case, this would be done with bit-fields.  If bit-fields
9  * are used it may be necessary to reorder the request fields in this file,
10  * depending on the order in which the machine assigns bit fields to
11  * machine words.  There may also be a problem with sign extension,
12  * as K+R specify that bitfields are always unsigned.
13  *
14  * 2. 2- and 4-byte fields in packet structures must be ordered by hand
15  * such that they are naturally-aligned, so that no compiler will ever
16  * insert padding bytes.
17  *
18  * 3. All packets are hand-padded to a multiple of 4 bytes, for
19  * the same reason.
20  */
21
22 #ifndef XPROTO_H
23 #define XPROTO_H
24
25 /***********************************************************
26
27 Copyright 1987, 1998  The Open Group
28
29 Permission to use, copy, modify, distribute, and sell this software and its
30 documentation for any purpose is hereby granted without fee, provided that
31 the above copyright notice appear in all copies and that both that
32 copyright notice and this permission notice appear in supporting
33 documentation.
34
35 The above copyright notice and this permission notice shall be included in
36 all copies or substantial portions of the Software.
37
38 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
39 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
40 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
41 OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
42 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
43 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
44
45 Except as contained in this notice, the name of The Open Group shall not be
46 used in advertising or otherwise to promote the sale, use or other dealings
47 in this Software without prior written authorization from The Open Group.
48
49
50 Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
51
52                         All Rights Reserved
53
54 Permission to use, copy, modify, and distribute this software and its 
55 documentation for any purpose and without fee is hereby granted, 
56 provided that the above copyright notice appear in all copies and that
57 both that copyright notice and this permission notice appear in 
58 supporting documentation, and that the name of Digital not be
59 used in advertising or publicity pertaining to distribution of the
60 software without specific, written prior permission.  
61
62 DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
63 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
64 DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
65 ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
66 WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
67 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
68 SOFTWARE.
69
70 ******************************************************************/
71
72 #include <X11/Xmd.h>
73 #include <X11/Xprotostr.h>
74
75 /*
76  * Define constants for the sizes of the network packets.  The sz_ prefix is
77  * used instead of something more descriptive so that the symbols are no more
78  * than 32 characters in length (which causes problems for some compilers).
79  */
80 #define sz_xSegment 8
81 #define sz_xPoint 4
82 #define sz_xRectangle 8
83 #define sz_xArc 12
84 #define sz_xConnClientPrefix 12
85 #define sz_xConnSetupPrefix 8
86 #define sz_xConnSetup 32
87 #define sz_xPixmapFormat 8
88 #define sz_xDepth 8
89 #define sz_xVisualType 24
90 #define sz_xWindowRoot 40
91 #define sz_xTimecoord 8
92 #define sz_xHostEntry 4
93 #define sz_xCharInfo 12
94 #define sz_xFontProp 8
95 #define sz_xTextElt 2
96 #define sz_xColorItem 12
97 #define sz_xrgb 8
98 #define sz_xGenericReply 32
99 #define sz_xGetWindowAttributesReply 44
100 #define sz_xGetGeometryReply 32
101 #define sz_xQueryTreeReply 32
102 #define sz_xInternAtomReply 32
103 #define sz_xGetAtomNameReply 32
104 #define sz_xGetPropertyReply 32
105 #define sz_xListPropertiesReply 32
106 #define sz_xGetSelectionOwnerReply 32
107 #define sz_xGrabPointerReply 32
108 #define sz_xQueryPointerReply 32
109 #define sz_xGetMotionEventsReply 32
110 #define sz_xTranslateCoordsReply 32
111 #define sz_xGetInputFocusReply 32
112 #define sz_xQueryKeymapReply 40
113 #define sz_xQueryFontReply 60
114 #define sz_xQueryTextExtentsReply 32
115 #define sz_xListFontsReply 32
116 #define sz_xGetFontPathReply 32
117 #define sz_xGetImageReply 32
118 #define sz_xListInstalledColormapsReply 32
119 #define sz_xAllocColorReply 32
120 #define sz_xAllocNamedColorReply 32
121 #define sz_xAllocColorCellsReply 32
122 #define sz_xAllocColorPlanesReply 32
123 #define sz_xQueryColorsReply 32
124 #define sz_xLookupColorReply 32
125 #define sz_xQueryBestSizeReply 32
126 #define sz_xQueryExtensionReply 32
127 #define sz_xListExtensionsReply 32
128 #define sz_xSetMappingReply 32
129 #define sz_xGetKeyboardControlReply 52
130 #define sz_xGetPointerControlReply 32
131 #define sz_xGetScreenSaverReply 32
132 #define sz_xListHostsReply 32
133 #define sz_xSetModifierMappingReply 32
134 #define sz_xError 32
135 #define sz_xEvent 32
136 #define sz_xKeymapEvent 32
137 #define sz_xReq 4
138 #define sz_xResourceReq 8
139 #define sz_xCreateWindowReq 32
140 #define sz_xChangeWindowAttributesReq 12
141 #define sz_xChangeSaveSetReq 8
142 #define sz_xReparentWindowReq 16
143 #define sz_xConfigureWindowReq 12
144 #define sz_xCirculateWindowReq 8
145 #define sz_xInternAtomReq 8
146 #define sz_xChangePropertyReq 24
147 #define sz_xDeletePropertyReq 12
148 #define sz_xGetPropertyReq 24
149 #define sz_xSetSelectionOwnerReq 16
150 #define sz_xConvertSelectionReq 24
151 #define sz_xSendEventReq 44
152 #define sz_xGrabPointerReq 24
153 #define sz_xGrabButtonReq 24
154 #define sz_xUngrabButtonReq 12
155 #define sz_xChangeActivePointerGrabReq 16
156 #define sz_xGrabKeyboardReq 16
157 #define sz_xGrabKeyReq 16
158 #define sz_xUngrabKeyReq 12
159 #define sz_xAllowEventsReq 8
160 #define sz_xGetMotionEventsReq 16
161 #define sz_xTranslateCoordsReq 16
162 #define sz_xWarpPointerReq 24
163 #define sz_xSetInputFocusReq 12
164 #define sz_xOpenFontReq 12
165 #define sz_xQueryTextExtentsReq 8
166 #define sz_xListFontsReq 8
167 #define sz_xSetFontPathReq 8
168 #define sz_xCreatePixmapReq 16
169 #define sz_xCreateGCReq 16
170 #define sz_xChangeGCReq 12
171 #define sz_xCopyGCReq 16
172 #define sz_xSetDashesReq 12
173 #define sz_xSetClipRectanglesReq 12
174 #define sz_xCopyAreaReq 28
175 #define sz_xCopyPlaneReq 32
176 #define sz_xPolyPointReq 12
177 #define sz_xPolySegmentReq 12
178 #define sz_xFillPolyReq 16
179 #define sz_xPutImageReq 24
180 #define sz_xGetImageReq 20
181 #define sz_xPolyTextReq 16
182 #define sz_xImageTextReq 16
183 #define sz_xCreateColormapReq 16
184 #define sz_xCopyColormapAndFreeReq 12
185 #define sz_xAllocColorReq 16
186 #define sz_xAllocNamedColorReq 12
187 #define sz_xAllocColorCellsReq 12
188 #define sz_xAllocColorPlanesReq 16
189 #define sz_xFreeColorsReq 12
190 #define sz_xStoreColorsReq 8
191 #define sz_xStoreNamedColorReq 16
192 #define sz_xQueryColorsReq 8
193 #define sz_xLookupColorReq 12
194 #define sz_xCreateCursorReq 32
195 #define sz_xCreateGlyphCursorReq 32
196 #define sz_xRecolorCursorReq 20
197 #define sz_xQueryBestSizeReq 12
198 #define sz_xQueryExtensionReq 8
199 #define sz_xChangeKeyboardControlReq 8
200 #define sz_xBellReq 4
201 #define sz_xChangePointerControlReq 12
202 #define sz_xSetScreenSaverReq 12
203 #define sz_xChangeHostsReq 8
204 #define sz_xListHostsReq 4
205 #define sz_xChangeModeReq 4
206 #define sz_xRotatePropertiesReq 12
207 #define sz_xReply 32
208 #define sz_xGrabKeyboardReply 32
209 #define sz_xListFontsWithInfoReply 60
210 #define sz_xSetPointerMappingReply 32
211 #define sz_xGetKeyboardMappingReply 32
212 #define sz_xGetPointerMappingReply 32
213 #define sz_xGetModifierMappingReply 32
214 #define sz_xListFontsWithInfoReq 8
215 #define sz_xPolyLineReq 12
216 #define sz_xPolyArcReq 12
217 #define sz_xPolyRectangleReq 12
218 #define sz_xPolyFillRectangleReq 12
219 #define sz_xPolyFillArcReq 12
220 #define sz_xPolyText8Req 16
221 #define sz_xPolyText16Req 16
222 #define sz_xImageText8Req 16
223 #define sz_xImageText16Req 16
224 #define sz_xSetPointerMappingReq 4
225 #define sz_xForceScreenSaverReq 4
226 #define sz_xSetCloseDownModeReq 4
227 #define sz_xClearAreaReq 16
228 #define sz_xSetAccessControlReq 4
229 #define sz_xGetKeyboardMappingReq 8
230 #define sz_xSetModifierMappingReq 4
231 #define sz_xPropIconSize 24
232 #define sz_xChangeKeyboardMappingReq 8
233
234
235 /* For the purpose of the structure definitions in this file,
236 we must redefine the following types in terms of Xmd.h's types, which may
237 include bit fields.  All of these are #undef'd at the end of this file,
238 restoring the definitions in X.h.  */
239
240 #define Window CARD32
241 #define Drawable CARD32
242 #define Font CARD32
243 #define Pixmap CARD32
244 #define Cursor CARD32
245 #define Colormap CARD32
246 #define GContext CARD32
247 #define Atom CARD32
248 #define VisualID CARD32
249 #define Time CARD32
250 #define KeyCode CARD8
251 #define KeySym CARD32
252
253 #define X_TCP_PORT 6000     /* add display number */
254
255 #define xTrue        1
256 #define xFalse       0
257
258
259 typedef CARD16 KeyButMask;
260
261 /***************** 
262    connection setup structure.  This is followed by
263    numRoots xWindowRoot structs.
264 *****************/
265
266 typedef struct {
267     CARD8       byteOrder;
268     BYTE        pad;
269     CARD16      majorVersion B16, minorVersion B16;
270     CARD16      nbytesAuthProto B16;    /* Authorization protocol */
271     CARD16      nbytesAuthString B16;   /* Authorization string */
272     CARD16      pad2 B16;
273 } xConnClientPrefix;
274
275 typedef struct {
276     CARD8          success;
277     BYTE           lengthReason; /*num bytes in string following if failure */
278     CARD16         majorVersion B16, 
279                    minorVersion B16;
280     CARD16         length B16;  /* 1/4 additional bytes in setup info */
281 } xConnSetupPrefix;
282
283
284 typedef struct {
285     CARD32         release B32;
286     CARD32         ridBase B32, 
287                    ridMask B32;
288     CARD32         motionBufferSize B32;
289     CARD16         nbytesVendor B16;  /* number of bytes in vendor string */
290     CARD16         maxRequestSize B16;
291     CARD8          numRoots;          /* number of roots structs to follow */
292     CARD8          numFormats;        /* number of pixmap formats */
293     CARD8          imageByteOrder;        /* LSBFirst, MSBFirst */
294     CARD8          bitmapBitOrder;        /* LeastSignificant, MostSign...*/
295     CARD8          bitmapScanlineUnit,     /* 8, 16, 32 */
296                    bitmapScanlinePad;     /* 8, 16, 32 */
297     KeyCode        minKeyCode, maxKeyCode;
298     CARD32         pad2 B32;
299 } xConnSetup;
300
301 typedef struct {
302     CARD8          depth;
303     CARD8          bitsPerPixel;
304     CARD8          scanLinePad;
305     CARD8          pad1;
306     CARD32         pad2 B32;
307 } xPixmapFormat;
308
309 /* window root */
310
311 typedef struct {
312     CARD8       depth;
313     CARD8       pad1;
314     CARD16      nVisuals B16;  /* number of xVisualType structures following */
315     CARD32      pad2 B32;
316     } xDepth;
317
318 typedef struct {
319     VisualID visualID B32;
320 #if defined(__cplusplus) || defined(c_plusplus)
321     CARD8 c_class;
322 #else
323     CARD8 class;
324 #endif
325     CARD8 bitsPerRGB;
326     CARD16 colormapEntries B16;
327     CARD32 redMask B32, greenMask B32, blueMask B32;
328     CARD32 pad B32;
329     } xVisualType;
330
331 typedef struct {
332     Window         windowId B32;
333     Colormap       defaultColormap B32;
334     CARD32         whitePixel B32, blackPixel B32;
335     CARD32         currentInputMask B32;   
336     CARD16         pixWidth B16, pixHeight B16;
337     CARD16         mmWidth B16, mmHeight B16;
338     CARD16         minInstalledMaps B16, maxInstalledMaps B16;
339     VisualID       rootVisualID B32;
340     CARD8          backingStore;
341     BOOL           saveUnders;
342     CARD8          rootDepth;
343     CARD8          nDepths;  /* number of xDepth structures following */
344 } xWindowRoot;
345 \f
346
347 /*****************************************************************
348  * Structure Defns
349  *   Structures needed for replies 
350  *****************************************************************/
351
352 /* Used in GetMotionEvents */
353
354 typedef struct {
355     CARD32 time B32;
356     INT16 x B16, y B16;
357 } xTimecoord;
358
359 typedef struct {
360     CARD8 family;
361     BYTE pad;
362     CARD16 length B16;
363 } xHostEntry;
364
365 typedef struct {
366     INT16 leftSideBearing B16,
367           rightSideBearing B16,
368           characterWidth B16,
369           ascent B16,
370           descent B16;
371     CARD16 attributes B16;
372 } xCharInfo;
373
374 typedef struct {
375     Atom name B32;
376     CARD32 value B32;
377 } xFontProp;
378
379 /*
380  * non-aligned big-endian font ID follows this struct
381  */
382 typedef struct {           /* followed by string */
383     CARD8 len;  /* number of *characters* in string, or FontChange (255)
384                    for font change, or 0 if just delta given */
385     INT8 delta;
386 } xTextElt;
387
388
389 typedef struct {        
390     CARD32 pixel B32;
391     CARD16 red B16, green B16, blue B16;
392     CARD8 flags;  /* DoRed, DoGreen, DoBlue booleans */
393     CARD8 pad;
394 } xColorItem;
395
396
397 typedef struct {
398     CARD16 red B16, green B16, blue B16, pad B16;
399 } xrgb;
400
401 typedef CARD8 KEYCODE;
402 \f
403
404 /*****************
405  * XRep:
406  *    meant to be 32 byte quantity 
407  *****************/
408
409 /* GenericReply is the common format of all replies.  The "data" items
410    are specific to each individual reply type. */
411
412 typedef struct {        
413     BYTE type;              /* X_Reply */
414     BYTE data1;             /* depends on reply type */
415     CARD16 sequenceNumber B16;  /* of last request received by server */
416     CARD32 length B32;      /* 4 byte quantities beyond size of GenericReply */
417     CARD32 data00 B32;
418     CARD32 data01 B32;
419     CARD32 data02 B32;
420     CARD32 data03 B32;
421     CARD32 data04 B32;
422     CARD32 data05 B32;
423     } xGenericReply;
424
425 /* Individual reply formats. */
426
427 typedef struct {
428     BYTE type;  /* X_Reply */
429     CARD8 backingStore;
430     CARD16 sequenceNumber B16;
431     CARD32 length B32;  /* NOT 0; this is an extra-large reply */
432     VisualID visualID B32;
433 #if defined(__cplusplus) || defined(c_plusplus)
434     CARD16 c_class B16;
435 #else
436     CARD16 class B16;
437 #endif
438     CARD8 bitGravity;
439     CARD8 winGravity;
440     CARD32 backingBitPlanes B32;
441     CARD32 backingPixel B32;
442     BOOL saveUnder;
443     BOOL mapInstalled;
444     CARD8 mapState;
445     BOOL override;
446     Colormap colormap B32;
447     CARD32 allEventMasks B32;
448     CARD32 yourEventMask B32;
449     CARD16 doNotPropagateMask B16;
450     CARD16 pad B16;
451     } xGetWindowAttributesReply;
452
453 typedef struct {
454     BYTE type;   /* X_Reply */
455     CARD8 depth;
456     CARD16 sequenceNumber B16;
457     CARD32 length B32;  /* 0 */
458     Window root B32;
459     INT16 x B16, y B16;
460     CARD16 width B16, height B16;
461     CARD16 borderWidth B16;
462     CARD16 pad1 B16;
463     CARD32 pad2 B32;
464     CARD32 pad3 B32;
465     } xGetGeometryReply;
466
467 typedef struct {
468     BYTE type;  /* X_Reply */
469     BYTE pad1;
470     CARD16 sequenceNumber B16;
471     CARD32 length B32;
472     Window root B32, parent B32;
473     CARD16 nChildren B16;
474     CARD16 pad2 B16;
475     CARD32 pad3 B32;
476     CARD32 pad4 B32;
477     CARD32 pad5 B32;
478     } xQueryTreeReply;
479
480 typedef struct {
481     BYTE type;  /* X_Reply */
482     BYTE pad1;
483     CARD16 sequenceNumber B16;
484     CARD32 length B32; /* 0 */
485     Atom atom B32;
486     CARD32 pad2 B32;
487     CARD32 pad3 B32;
488     CARD32 pad4 B32;
489     CARD32 pad5 B32;
490     CARD32 pad6 B32;
491     } xInternAtomReply;
492
493 typedef struct {
494     BYTE type;  /* X_Reply */
495     BYTE pad1;
496     CARD16 sequenceNumber B16;
497     CARD32 length B32;  /* of additional bytes */
498     CARD16 nameLength B16;  /* # of characters in name */
499     CARD16 pad2 B16;
500     CARD32 pad3 B32;
501     CARD32 pad4 B32;
502     CARD32 pad5 B32;
503     CARD32 pad6 B32;
504     CARD32 pad7 B32;
505     } xGetAtomNameReply;
506
507 typedef struct {
508     BYTE type;  /* X_Reply */
509     CARD8 format;
510     CARD16 sequenceNumber B16;
511     CARD32 length B32; /* of additional bytes */
512     Atom propertyType B32;
513     CARD32 bytesAfter B32;
514     CARD32 nItems B32; /* # of 8, 16, or 32-bit entities in reply */
515     CARD32 pad1 B32;
516     CARD32 pad2 B32;
517     CARD32 pad3 B32;
518     } xGetPropertyReply;
519
520 typedef struct {
521     BYTE type;  /* X_Reply */
522     BYTE pad1;
523     CARD16 sequenceNumber B16;
524     CARD32 length B32;
525     CARD16 nProperties B16;
526     CARD16 pad2 B16;
527     CARD32 pad3 B32;
528     CARD32 pad4 B32;
529     CARD32 pad5 B32;
530     CARD32 pad6 B32;
531     CARD32 pad7 B32;
532     } xListPropertiesReply;
533
534 typedef struct {
535     BYTE type;  /* X_Reply */
536     BYTE pad1;
537     CARD16 sequenceNumber B16;
538     CARD32 length B32;  /* 0 */
539     Window owner B32;
540     CARD32 pad2 B32;
541     CARD32 pad3 B32;
542     CARD32 pad4 B32;
543     CARD32 pad5 B32;
544     CARD32 pad6 B32;
545     } xGetSelectionOwnerReply;
546
547 typedef struct {
548     BYTE type;  /* X_Reply */
549     BYTE status;
550     CARD16 sequenceNumber B16;
551     CARD32 length B32;  /* 0 */
552     CARD32 pad1 B32;
553     CARD32 pad2 B32;
554     CARD32 pad3 B32;
555     CARD32 pad4 B32;
556     CARD32 pad5 B32;
557     CARD32 pad6 B32;
558     } xGrabPointerReply;
559
560 typedef xGrabPointerReply xGrabKeyboardReply;
561
562 typedef struct {
563     BYTE type;  /* X_Reply */
564     BOOL sameScreen;
565     CARD16 sequenceNumber B16;
566     CARD32 length B32;  /* 0 */
567     Window root B32, child B32;
568     INT16 rootX B16, rootY B16, winX B16, winY B16;
569     CARD16 mask B16;
570     CARD16 pad1 B16;
571     CARD32 pad B32;
572     } xQueryPointerReply;
573
574 typedef struct {
575     BYTE type;  /* X_Reply */
576     BYTE pad1;
577     CARD16 sequenceNumber B16;
578     CARD32 length B32;
579     CARD32 nEvents B32;
580     CARD32 pad2 B32;
581     CARD32 pad3 B32;
582     CARD32 pad4 B32;
583     CARD32 pad5 B32;
584     CARD32 pad6 B32;
585     } xGetMotionEventsReply;
586
587 typedef struct {
588     BYTE type;  /* X_Reply */
589     BOOL sameScreen;
590     CARD16 sequenceNumber B16;
591     CARD32 length B32; /* 0 */
592     Window child B32;
593     INT16 dstX B16, dstY B16;
594     CARD32 pad2 B32;
595     CARD32 pad3 B32;
596     CARD32 pad4 B32;
597     CARD32 pad5 B32;
598     } xTranslateCoordsReply;
599
600 typedef struct {
601     BYTE type;  /* X_Reply */
602     CARD8 revertTo;
603     CARD16 sequenceNumber B16;
604     CARD32 length B32;  /* 0 */
605     Window focus B32;
606     CARD32 pad1 B32;
607     CARD32 pad2 B32;
608     CARD32 pad3 B32;
609     CARD32 pad4 B32;
610     CARD32 pad5 B32;
611     } xGetInputFocusReply;
612
613 typedef struct {
614     BYTE type;  /* X_Reply */
615     BYTE pad1;
616     CARD16 sequenceNumber B16;
617     CARD32 length B32;  /* 2, NOT 0; this is an extra-large reply */
618     BYTE map[32];
619     } xQueryKeymapReply;
620
621 /* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */
622 typedef struct _xQueryFontReply {
623     BYTE type;  /* X_Reply */
624     BYTE pad1;
625     CARD16 sequenceNumber B16;
626     CARD32 length B32;  /* definitely > 0, even if "nCharInfos" is 0 */
627     xCharInfo minBounds; 
628     CARD32 walign1 B32;
629     xCharInfo maxBounds; 
630     CARD32 walign2 B32;
631     CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
632     CARD16 defaultChar B16;
633     CARD16 nFontProps B16;  /* followed by this many xFontProp structures */
634     CARD8 drawDirection;
635     CARD8 minByte1, maxByte1;
636     BOOL allCharsExist;
637     INT16 fontAscent B16, fontDescent B16;
638     CARD32 nCharInfos B32; /* followed by this many xCharInfo structures */
639 } xQueryFontReply;
640
641 typedef struct {
642     BYTE type;  /* X_Reply */
643     CARD8 drawDirection;
644     CARD16 sequenceNumber B16;
645     CARD32 length B32;  /* 0 */
646     INT16 fontAscent B16, fontDescent B16;
647     INT16 overallAscent B16, overallDescent B16;
648     INT32 overallWidth B32, overallLeft B32, overallRight B32;
649     CARD32 pad B32;
650     } xQueryTextExtentsReply;
651
652 typedef struct {
653     BYTE type;  /* X_Reply */
654     BYTE pad1;
655     CARD16 sequenceNumber B16;
656     CARD32 length B32;
657     CARD16 nFonts B16;
658     CARD16 pad2 B16;
659     CARD32 pad3 B32;
660     CARD32 pad4 B32;
661     CARD32 pad5 B32;
662     CARD32 pad6 B32;
663     CARD32 pad7 B32;
664     } xListFontsReply;
665
666 /* Warning: this MUST match (up to component renaming) xQueryFontReply */
667 typedef struct {
668     BYTE type;  /* X_Reply */
669     CARD8 nameLength;  /* 0 indicates end-of-reply-sequence */
670     CARD16 sequenceNumber B16;
671     CARD32 length B32;  /* definitely > 0, even if "nameLength" is 0 */
672     xCharInfo minBounds; 
673     CARD32 walign1 B32;
674     xCharInfo maxBounds; 
675     CARD32 walign2 B32;
676     CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
677     CARD16 defaultChar B16;
678     CARD16 nFontProps B16;  /* followed by this many xFontProp structures */
679     CARD8 drawDirection;
680     CARD8 minByte1, maxByte1;
681     BOOL allCharsExist;
682     INT16 fontAscent B16, fontDescent B16;
683     CARD32 nReplies B32;   /* hint as to how many more replies might be coming */
684 } xListFontsWithInfoReply;
685
686 typedef struct {
687     BYTE type;  /* X_Reply */
688     BYTE pad1;
689     CARD16 sequenceNumber B16;
690     CARD32 length B32;
691     CARD16 nPaths B16;
692     CARD16 pad2 B16;
693     CARD32 pad3 B32;
694     CARD32 pad4 B32;
695     CARD32 pad5 B32;
696     CARD32 pad6 B32;
697     CARD32 pad7 B32;
698     } xGetFontPathReply;
699
700 typedef struct {
701     BYTE type;  /* X_Reply */
702     CARD8 depth;
703     CARD16 sequenceNumber B16;
704     CARD32 length B32;
705     VisualID visual B32;
706     CARD32 pad3 B32;
707     CARD32 pad4 B32;
708     CARD32 pad5 B32;
709     CARD32 pad6 B32;
710     CARD32 pad7 B32;
711     } xGetImageReply;
712
713 typedef struct {
714     BYTE type;  /* X_Reply */
715     BYTE pad1;
716     CARD16 sequenceNumber B16;
717     CARD32 length B32;
718     CARD16 nColormaps B16;
719     CARD16 pad2 B16;
720     CARD32 pad3 B32;
721     CARD32 pad4 B32;
722     CARD32 pad5 B32;
723     CARD32 pad6 B32;
724     CARD32 pad7 B32;
725     } xListInstalledColormapsReply;
726
727 typedef struct {
728     BYTE type; /* X_Reply */
729     BYTE pad1;
730     CARD16 sequenceNumber B16;
731     CARD32 length B32;   /* 0 */
732     CARD16 red B16, green B16, blue B16;
733     CARD16 pad2 B16;
734     CARD32 pixel B32;
735     CARD32 pad3 B32;
736     CARD32 pad4 B32;
737     CARD32 pad5 B32;
738     } xAllocColorReply;
739
740 typedef struct {
741     BYTE type; /* X_Reply */
742     BYTE pad1;
743     CARD16 sequenceNumber B16;
744     CARD32 length B32;  /* 0 */
745     CARD32 pixel B32;
746     CARD16 exactRed B16, exactGreen B16, exactBlue B16;
747     CARD16 screenRed B16, screenGreen B16, screenBlue B16;
748     CARD32 pad2 B32;
749     CARD32 pad3 B32;
750     } xAllocNamedColorReply;
751
752 typedef struct {
753     BYTE type;  /* X_Reply */
754     BYTE pad1;
755     CARD16 sequenceNumber B16;
756     CARD32 length B32;
757     CARD16 nPixels B16, nMasks B16;
758     CARD32 pad3 B32;
759     CARD32 pad4 B32;
760     CARD32 pad5 B32;
761     CARD32 pad6 B32;
762     CARD32 pad7 B32;
763     } xAllocColorCellsReply;
764
765 typedef struct {
766     BYTE type; /* X_Reply */
767     BYTE pad1;
768     CARD16 sequenceNumber B16;
769     CARD32 length B32;
770     CARD16 nPixels B16;
771     CARD16 pad2 B16;
772     CARD32 redMask B32, greenMask B32, blueMask B32;
773     CARD32 pad3 B32;
774     CARD32 pad4 B32;
775     } xAllocColorPlanesReply;
776
777 typedef struct {
778     BYTE type; /* X_Reply */
779     BYTE pad1;
780     CARD16 sequenceNumber B16;
781     CARD32 length B32;
782     CARD16 nColors B16;
783     CARD16 pad2 B16;
784     CARD32 pad3 B32;
785     CARD32 pad4 B32;
786     CARD32 pad5 B32;
787     CARD32 pad6 B32;
788     CARD32 pad7 B32;
789     } xQueryColorsReply;
790
791 typedef struct {
792     BYTE type;  /* X_Reply */
793     BYTE pad1;
794     CARD16 sequenceNumber B16;
795     CARD32 length B32;  /* 0 */
796     CARD16 exactRed B16, exactGreen B16, exactBlue B16;
797     CARD16 screenRed B16, screenGreen B16, screenBlue B16;
798     CARD32 pad3 B32;
799     CARD32 pad4 B32;
800     CARD32 pad5 B32;
801     } xLookupColorReply;
802
803 typedef struct {
804     BYTE type;  /* X_Reply */
805     BYTE pad1;
806     CARD16 sequenceNumber B16;
807     CARD32 length B32;  /* 0 */
808     CARD16 width B16, height B16;
809     CARD32 pad3 B32;
810     CARD32 pad4 B32;
811     CARD32 pad5 B32;
812     CARD32 pad6 B32;
813     CARD32 pad7 B32;
814     } xQueryBestSizeReply;
815
816 typedef struct {
817     BYTE type;  /* X_Reply */
818     BYTE pad1;
819     CARD16 sequenceNumber B16;
820     CARD32 length B32; /* 0 */
821     BOOL  present;
822     CARD8 major_opcode;
823     CARD8 first_event;
824     CARD8 first_error;
825     CARD32 pad3 B32;
826     CARD32 pad4 B32;
827     CARD32 pad5 B32;
828     CARD32 pad6 B32;
829     CARD32 pad7 B32;
830     } xQueryExtensionReply;
831
832 typedef struct {
833     BYTE type;  /* X_Reply */
834     CARD8 nExtensions;
835     CARD16 sequenceNumber B16;
836     CARD32 length B32;
837     CARD32 pad2 B32;
838     CARD32 pad3 B32;
839     CARD32 pad4 B32;
840     CARD32 pad5 B32;
841     CARD32 pad6 B32;
842     CARD32 pad7 B32;
843     } xListExtensionsReply;
844
845
846 typedef struct {
847     BYTE   type;  /* X_Reply */
848     CARD8  success;
849     CARD16 sequenceNumber B16;
850     CARD32 length B32;
851     CARD32 pad2 B32;
852     CARD32 pad3 B32;
853     CARD32 pad4 B32;
854     CARD32 pad5 B32;
855     CARD32 pad6 B32;
856     CARD32 pad7 B32;
857     } xSetMappingReply;
858 typedef xSetMappingReply xSetPointerMappingReply;
859 typedef xSetMappingReply xSetModifierMappingReply;
860
861 typedef struct {
862     BYTE type;  /* X_Reply */
863     CARD8 nElts;  /* how many elements does the map have */
864     CARD16 sequenceNumber B16;
865     CARD32 length B32;
866     CARD32 pad2 B32;
867     CARD32 pad3 B32;
868     CARD32 pad4 B32;
869     CARD32 pad5 B32;
870     CARD32 pad6 B32;
871     CARD32 pad7 B32;
872     } xGetPointerMappingReply;
873
874 typedef struct {
875     BYTE type;
876     CARD8 keySymsPerKeyCode;
877     CARD16 sequenceNumber B16;
878     CARD32 length B32;
879     CARD32 pad2 B32;
880     CARD32 pad3 B32;
881     CARD32 pad4 B32;
882     CARD32 pad5 B32;
883     CARD32 pad6 B32;
884     CARD32 pad7 B32;
885 } xGetKeyboardMappingReply;    
886
887 typedef struct {
888     BYTE type;
889     CARD8 numKeyPerModifier;
890     CARD16 sequenceNumber B16;
891     CARD32 length B32;
892     CARD32 pad1 B32;
893     CARD32 pad2 B32;
894     CARD32 pad3 B32;
895     CARD32 pad4 B32;
896     CARD32 pad5 B32;
897     CARD32 pad6 B32;
898 } xGetModifierMappingReply;
899
900 typedef struct {
901     BYTE type;  /* X_Reply */
902     BOOL globalAutoRepeat;
903     CARD16 sequenceNumber B16;
904     CARD32 length B32;  /* 5 */
905     CARD32 ledMask B32;
906     CARD8 keyClickPercent, bellPercent;
907     CARD16 bellPitch B16, bellDuration B16;
908     CARD16 pad B16;
909     BYTE map[32];  /* bit masks start here */
910     } xGetKeyboardControlReply;
911
912 typedef struct {
913     BYTE type;  /* X_Reply */
914     BYTE pad1;
915     CARD16 sequenceNumber B16;
916     CARD32 length B32;  /* 0 */
917     CARD16 accelNumerator B16, accelDenominator B16;
918     CARD16 threshold B16;
919     CARD16 pad2 B16;
920     CARD32 pad3 B32;
921     CARD32 pad4 B32;
922     CARD32 pad5 B32;
923     CARD32 pad6 B32;
924     } xGetPointerControlReply;
925
926 typedef struct {
927     BYTE type;  /* X_Reply */
928     BYTE pad1;
929     CARD16 sequenceNumber B16;
930     CARD32 length B32;  /* 0 */
931     CARD16 timeout B16, interval B16;
932     BOOL preferBlanking;
933     BOOL allowExposures;
934     CARD16 pad2 B16;
935     CARD32 pad3 B32;
936     CARD32 pad4 B32;
937     CARD32 pad5 B32;
938     CARD32 pad6 B32;
939     } xGetScreenSaverReply;
940
941 typedef struct {
942     BYTE type;  /* X_Reply */
943     BOOL enabled;
944     CARD16 sequenceNumber B16;
945     CARD32 length B32;
946     CARD16 nHosts B16;
947     CARD16 pad1 B16;
948     CARD32 pad3 B32;
949     CARD32 pad4 B32;
950     CARD32 pad5 B32;
951     CARD32 pad6 B32;
952     CARD32 pad7 B32;
953     } xListHostsReply;
954
955 \f
956
957
958 /*****************************************************************
959  * Xerror
960  *    All errors  are 32 bytes 
961  *****************************************************************/
962
963 typedef struct {
964     BYTE type;                  /* X_Error */
965     BYTE errorCode;
966     CARD16 sequenceNumber B16;       /* the nth request from this client */
967     CARD32 resourceID B32;
968     CARD16 minorCode B16;
969     CARD8 majorCode;
970     BYTE pad1;
971     CARD32 pad3 B32;
972     CARD32 pad4 B32;
973     CARD32 pad5 B32;
974     CARD32 pad6 B32;
975     CARD32 pad7 B32;
976 } xError;
977
978 /*****************************************************************
979  * xEvent
980  *    All events are 32 bytes
981  *****************************************************************/
982
983 typedef struct _xEvent {
984     union {
985         struct {
986             BYTE type;
987             BYTE detail;
988             CARD16 sequenceNumber B16;
989             } u;
990         struct {
991             CARD32 pad00 B32;
992             Time time B32;
993             Window root B32, event B32, child B32;
994             INT16 rootX B16, rootY B16, eventX B16, eventY B16;
995             KeyButMask state B16;
996             BOOL sameScreen;            
997             BYTE pad1;
998         } keyButtonPointer;
999         struct {
1000             CARD32 pad00 B32;
1001             Time time B32;
1002             Window root B32, event B32, child B32;
1003             INT16 rootX B16, rootY B16, eventX B16, eventY B16;
1004             KeyButMask state B16;
1005             BYTE mode;                  /* really XMode */
1006             BYTE flags;         /* sameScreen and focus booleans, packed together */
1007 #define ELFlagFocus        (1<<0)
1008 #define ELFlagSameScreen   (1<<1)
1009         } enterLeave;
1010         struct {
1011             CARD32 pad00 B32;
1012             Window window B32;
1013             BYTE mode;                  /* really XMode */
1014             BYTE pad1, pad2, pad3;
1015         } focus;
1016         struct {
1017             CARD32 pad00 B32;
1018             Window window B32;
1019             CARD16 x B16, y B16, width B16, height B16;
1020             CARD16 count B16;
1021             CARD16 pad2 B16;
1022         } expose;
1023         struct {
1024             CARD32 pad00 B32;
1025             Drawable drawable B32;
1026             CARD16 x B16, y B16, width B16, height B16;
1027             CARD16 minorEvent B16;
1028             CARD16 count B16;
1029             BYTE majorEvent;
1030             BYTE pad1, pad2, pad3;
1031         } graphicsExposure;
1032         struct {
1033             CARD32 pad00 B32;
1034             Drawable drawable B32;
1035             CARD16 minorEvent B16;
1036             BYTE majorEvent;
1037             BYTE bpad;
1038         } noExposure;
1039         struct {
1040             CARD32 pad00 B32;
1041             Window window B32;
1042             CARD8 state;
1043             BYTE pad1, pad2, pad3;
1044         } visibility;
1045         struct {
1046             CARD32 pad00 B32;
1047             Window parent B32, window B32;
1048             INT16 x B16, y B16;
1049             CARD16 width B16, height B16, borderWidth B16;
1050             BOOL override;
1051             BYTE bpad;
1052         } createNotify;
1053 /*
1054  * The event fields in the structures for DestroyNotify, UnmapNotify,
1055  * MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify,
1056  * must be at the same offset because server internal code is depending upon
1057  * this to patch up the events before they are delivered.
1058  * Also note that MapRequest, ConfigureRequest and CirculateRequest have
1059  * the same offset for the event window.
1060  */
1061         struct {
1062             CARD32 pad00 B32;
1063             Window event B32, window B32;
1064         } destroyNotify;
1065         struct {
1066             CARD32 pad00 B32;
1067             Window event B32, window B32;
1068             BOOL fromConfigure;
1069             BYTE pad1, pad2, pad3;
1070         } unmapNotify;
1071         struct {
1072             CARD32 pad00 B32;
1073             Window event B32, window B32;
1074             BOOL override;
1075             BYTE pad1, pad2, pad3;
1076         } mapNotify;
1077         struct {
1078             CARD32 pad00 B32;
1079             Window parent B32, window B32;
1080         } mapRequest;
1081         struct {
1082             CARD32 pad00 B32;
1083             Window event B32, window B32, parent B32;
1084             INT16 x B16, y B16;
1085             BOOL override;
1086             BYTE pad1, pad2, pad3;
1087         } reparent;
1088         struct {
1089             CARD32 pad00 B32;
1090             Window event B32, window B32, aboveSibling B32;
1091             INT16 x B16, y B16;
1092             CARD16 width B16, height B16, borderWidth B16;
1093             BOOL override;              
1094             BYTE bpad;
1095         } configureNotify;
1096         struct {
1097             CARD32 pad00 B32;
1098             Window parent B32, window B32, sibling B32;
1099             INT16 x B16, y B16;
1100             CARD16 width B16, height B16, borderWidth B16;
1101             CARD16 valueMask B16;
1102             CARD32 pad1 B32;
1103         } configureRequest;
1104         struct {
1105             CARD32 pad00 B32;
1106             Window event B32, window B32;
1107             INT16 x B16, y B16;
1108             CARD32 pad1 B32, pad2 B32, pad3 B32, pad4 B32;
1109         } gravity;
1110         struct {
1111             CARD32 pad00 B32;
1112             Window window B32;
1113             CARD16 width B16, height B16;
1114         } resizeRequest;
1115         struct {
1116 /* The event field in the circulate record is really the parent when this
1117    is used as a CirculateRequest instead of a CirculateNotify */
1118             CARD32 pad00 B32;
1119             Window event B32, window B32, parent B32;
1120             BYTE place;                 /* Top or Bottom */
1121             BYTE pad1, pad2, pad3;
1122         } circulate;
1123         struct {
1124             CARD32 pad00 B32;
1125             Window window B32;
1126             Atom atom B32;
1127             Time time B32;
1128             BYTE state;                 /* NewValue or Deleted */
1129             BYTE pad1;
1130             CARD16 pad2 B16;
1131         } property;
1132         struct {
1133             CARD32 pad00 B32;
1134             Time time B32;     
1135             Window window B32;
1136             Atom atom B32;
1137         } selectionClear;
1138         struct {
1139             CARD32 pad00 B32;
1140             Time time B32;    
1141             Window owner B32, requestor B32;
1142             Atom selection B32, target B32, property B32;
1143         } selectionRequest;
1144         struct {
1145             CARD32 pad00 B32;
1146             Time time B32;   
1147             Window requestor B32;
1148             Atom selection B32, target B32, property B32;
1149         } selectionNotify;
1150         struct {
1151             CARD32 pad00 B32;
1152             Window window B32;
1153             Colormap colormap B32;
1154 #if defined(__cplusplus) || defined(c_plusplus)
1155             BOOL c_new;
1156 #else
1157             BOOL new;
1158 #endif
1159             BYTE state;                 /* Installed or UnInstalled */
1160             BYTE pad1, pad2;
1161         } colormap;
1162         struct {
1163             CARD32 pad00 B32;
1164             CARD8 request;
1165             KeyCode firstKeyCode;
1166             CARD8 count;
1167             BYTE pad1;
1168         } mappingNotify;
1169         struct {
1170             CARD32 pad00 B32;
1171             Window window B32;
1172             union {
1173                 struct {
1174                     Atom type B32;
1175                     INT32 longs0 B32;
1176                     INT32 longs1 B32;
1177                     INT32 longs2 B32;
1178                     INT32 longs3 B32;
1179                     INT32 longs4 B32;
1180                 } l;
1181                 struct {
1182                     Atom type B32;
1183                     INT16 shorts0 B16;
1184                     INT16 shorts1 B16;
1185                     INT16 shorts2 B16;
1186                     INT16 shorts3 B16;
1187                     INT16 shorts4 B16;
1188                     INT16 shorts5 B16;
1189                     INT16 shorts6 B16;
1190                     INT16 shorts7 B16;
1191                     INT16 shorts8 B16;
1192                     INT16 shorts9 B16;
1193                 } s;
1194                 struct {
1195                     Atom type B32;
1196                     INT8 bytes[20];
1197                 } b;
1198             } u; 
1199         } clientMessage;
1200     } u;
1201 } xEvent;
1202
1203 /*********************************************************
1204  *
1205  * Generic event
1206  * 
1207  * Those events are not part of the core protocol spec and can be used by
1208  * various extensions.
1209  * type is always GenericEvent
1210  * extension is the minor opcode of the extension the event belongs to.
1211  * evtype is the actual event type, unique __per extension__. 
1212  *
1213  * GenericEvents can be longer than 32 bytes, with the length field
1214  * specifying the number of 4 byte blocks after the first 32 bytes. 
1215  *
1216  *
1217  */
1218 typedef struct 
1219 {
1220     BYTE    type;
1221     CARD8   extension;
1222     CARD16  sequenceNumber B16;
1223     CARD32  length B32;
1224     CARD16  evtype B16;
1225     CARD16  pad2 B16;
1226     CARD32  pad3 B32;
1227     CARD32  pad4 B32;
1228     CARD32  pad5 B32;
1229     CARD32  pad6 B32;
1230     CARD32  pad7 B32;
1231 } xGenericEvent;
1232
1233
1234
1235 /* KeymapNotify events are not included in the above union because they
1236    are different from all other events: they do not have a "detail"
1237    or "sequenceNumber", so there is room for a 248-bit key mask. */
1238
1239 typedef struct {
1240     BYTE type;
1241     BYTE map[31];
1242     } xKeymapEvent;
1243
1244 #define XEventSize (sizeof(xEvent))
1245
1246 /* XReply is the union of all the replies above whose "fixed part"
1247 fits in 32 bytes.  It does NOT include GetWindowAttributesReply,
1248 QueryFontReply, QueryKeymapReply, or GetKeyboardControlReply 
1249 ListFontsWithInfoReply */
1250
1251 typedef union {
1252     xGenericReply generic;
1253     xGetGeometryReply geom;
1254     xQueryTreeReply tree;
1255     xInternAtomReply atom;
1256     xGetAtomNameReply atomName;
1257     xGetPropertyReply property;
1258     xListPropertiesReply listProperties;
1259     xGetSelectionOwnerReply selection;
1260     xGrabPointerReply grabPointer;
1261     xGrabKeyboardReply grabKeyboard;
1262     xQueryPointerReply pointer;
1263     xGetMotionEventsReply motionEvents;
1264     xTranslateCoordsReply coords;
1265     xGetInputFocusReply inputFocus;
1266     xQueryTextExtentsReply textExtents;
1267     xListFontsReply fonts;
1268     xGetFontPathReply fontPath;
1269     xGetImageReply image;
1270     xListInstalledColormapsReply colormaps;
1271     xAllocColorReply allocColor;
1272     xAllocNamedColorReply allocNamedColor;
1273     xAllocColorCellsReply colorCells;
1274     xAllocColorPlanesReply colorPlanes;
1275     xQueryColorsReply colors;
1276     xLookupColorReply lookupColor;
1277     xQueryBestSizeReply bestSize;
1278     xQueryExtensionReply extension;
1279     xListExtensionsReply extensions;
1280     xSetModifierMappingReply setModifierMapping;
1281     xGetModifierMappingReply getModifierMapping;
1282     xSetPointerMappingReply setPointerMapping;
1283     xGetKeyboardMappingReply getKeyboardMapping;
1284     xGetPointerMappingReply getPointerMapping;
1285     xGetPointerControlReply pointerControl;
1286     xGetScreenSaverReply screenSaver;
1287     xListHostsReply hosts;
1288     xError error;
1289     xEvent event;
1290 } xReply;
1291
1292 \f
1293
1294 /*****************************************************************
1295  * REQUESTS
1296  *****************************************************************/
1297
1298
1299 /* Request structure */
1300
1301 typedef struct _xReq {
1302         CARD8 reqType;
1303         CARD8 data;            /* meaning depends on request type */
1304         CARD16 length B16;         /* length in 4 bytes quantities 
1305                                   of whole request, including this header */
1306 } xReq;
1307
1308 /*****************************************************************
1309  *  structures that follow request. 
1310  *****************************************************************/
1311
1312 /* ResourceReq is used for any request which has a resource ID 
1313    (or Atom or Time) as its one and only argument.  */
1314
1315 typedef struct {
1316     CARD8 reqType;
1317     BYTE pad;
1318     CARD16 length B16;
1319     CARD32 id B32;  /* a Window, Drawable, Font, GContext, Pixmap, etc. */
1320     } xResourceReq;
1321
1322 typedef struct {
1323     CARD8 reqType;
1324     CARD8 depth;
1325     CARD16 length B16;
1326     Window wid B32, parent B32;
1327     INT16 x B16, y B16;
1328     CARD16 width B16, height B16, borderWidth B16;  
1329 #if defined(__cplusplus) || defined(c_plusplus)
1330     CARD16 c_class B16;
1331 #else
1332     CARD16 class B16;
1333 #endif
1334     VisualID visual B32;
1335     CARD32 mask B32;
1336 } xCreateWindowReq;
1337
1338 typedef struct {
1339     CARD8 reqType;
1340     BYTE pad;
1341     CARD16 length B16;
1342     Window window B32;
1343     CARD32 valueMask B32; 
1344 } xChangeWindowAttributesReq;
1345
1346 typedef struct {
1347     CARD8 reqType;
1348     BYTE mode;
1349     CARD16 length B16;
1350     Window window B32;
1351 } xChangeSaveSetReq;
1352
1353 typedef struct {
1354     CARD8 reqType;
1355     BYTE pad;
1356     CARD16 length B16;
1357     Window window B32, parent B32;
1358     INT16 x B16, y B16;
1359 } xReparentWindowReq;
1360
1361 typedef struct {
1362     CARD8 reqType;
1363     CARD8 pad;
1364     CARD16 length B16;
1365     Window window B32;
1366     CARD16 mask B16;
1367     CARD16 pad2 B16;
1368 } xConfigureWindowReq;
1369
1370 typedef struct {
1371     CARD8 reqType;
1372     CARD8 direction;
1373     CARD16 length B16;
1374     Window window B32;
1375 } xCirculateWindowReq;
1376
1377 typedef struct {    /* followed by padded string */
1378     CARD8 reqType;
1379     BOOL onlyIfExists;
1380     CARD16 length B16;
1381     CARD16 nbytes  B16;    /* number of bytes in string */
1382     CARD16 pad B16;
1383 } xInternAtomReq;
1384
1385 typedef struct {
1386     CARD8 reqType;
1387     CARD8 mode;
1388     CARD16 length B16;
1389     Window window B32;
1390     Atom property B32, type B32;
1391     CARD8 format;
1392     BYTE pad[3];
1393     CARD32 nUnits B32;     /* length of stuff following, depends on format */
1394 } xChangePropertyReq;
1395
1396 typedef struct {
1397     CARD8 reqType;
1398     BYTE pad;
1399     CARD16 length B16;
1400     Window window B32;
1401     Atom property B32;
1402 } xDeletePropertyReq;
1403
1404 typedef struct {
1405     CARD8 reqType;
1406 #if defined(__cplusplus) || defined(c_plusplus)
1407     BOOL c_delete;
1408 #else
1409     BOOL delete;
1410 #endif
1411     CARD16 length B16;
1412     Window window B32;
1413     Atom property B32, type B32;
1414     CARD32 longOffset B32;
1415     CARD32 longLength B32;
1416 } xGetPropertyReq;
1417  
1418 typedef struct {
1419     CARD8 reqType;
1420     BYTE pad;
1421     CARD16 length B16;
1422     Window window B32;
1423     Atom selection B32;
1424     Time time B32;
1425 } xSetSelectionOwnerReq;
1426
1427 typedef struct {
1428     CARD8 reqType;
1429     BYTE pad;
1430     CARD16 length B16;
1431     Window requestor B32;
1432     Atom selection B32, target B32, property B32;
1433     Time time B32;
1434     } xConvertSelectionReq;
1435
1436 typedef struct {
1437     CARD8 reqType;
1438     BOOL propagate;
1439     CARD16 length B16;
1440     Window destination B32;
1441     CARD32 eventMask B32;
1442     xEvent event;
1443 } xSendEventReq;
1444
1445 typedef struct {
1446     CARD8 reqType;
1447     BOOL ownerEvents;
1448     CARD16 length B16;
1449     Window grabWindow B32;
1450     CARD16 eventMask B16;
1451     BYTE pointerMode, keyboardMode;
1452     Window confineTo B32;
1453     Cursor cursor B32;
1454     Time time B32;
1455 } xGrabPointerReq;
1456
1457 typedef struct {
1458     CARD8 reqType;
1459     BOOL ownerEvents;
1460     CARD16 length B16;
1461     Window grabWindow B32;
1462     CARD16 eventMask B16;
1463     BYTE pointerMode, keyboardMode;
1464     Window confineTo B32;
1465     Cursor cursor B32;
1466     CARD8 button;
1467     BYTE pad;
1468     CARD16 modifiers B16;
1469 } xGrabButtonReq;
1470
1471 typedef struct {
1472     CARD8 reqType;
1473     CARD8 button;
1474     CARD16 length B16;
1475     Window grabWindow B32;
1476     CARD16 modifiers B16;
1477     CARD16 pad B16;
1478 } xUngrabButtonReq;
1479
1480 typedef struct {
1481     CARD8 reqType;
1482     BYTE pad;
1483     CARD16 length B16;
1484     Cursor cursor B32;
1485     Time time B32;
1486     CARD16 eventMask B16;
1487     CARD16 pad2 B16;
1488 } xChangeActivePointerGrabReq;
1489
1490 typedef struct {
1491     CARD8 reqType;
1492     BOOL ownerEvents;
1493     CARD16 length B16;
1494     Window grabWindow B32;
1495     Time time B32;
1496     BYTE pointerMode, keyboardMode;  
1497     CARD16 pad B16;
1498 } xGrabKeyboardReq;
1499
1500 typedef struct {
1501     CARD8 reqType;
1502     BOOL ownerEvents;
1503     CARD16 length B16;
1504     Window grabWindow B32;
1505     CARD16 modifiers B16;
1506     CARD8 key;
1507     BYTE pointerMode, keyboardMode;  
1508     BYTE pad1, pad2, pad3;
1509 } xGrabKeyReq;
1510
1511 typedef struct {
1512     CARD8 reqType;
1513     CARD8 key;
1514     CARD16 length B16;
1515     Window grabWindow B32;
1516     CARD16 modifiers B16;
1517     CARD16 pad B16;
1518 } xUngrabKeyReq;
1519
1520 typedef struct {
1521     CARD8 reqType;
1522     CARD8 mode;
1523     CARD16 length B16;
1524     Time time B32;
1525 } xAllowEventsReq;
1526
1527 typedef struct {
1528     CARD8 reqType;
1529     BYTE pad;
1530     CARD16 length B16;
1531     Window window B32;
1532     Time start B32, stop B32;
1533 } xGetMotionEventsReq;
1534
1535 typedef struct {
1536     CARD8 reqType;
1537     BYTE pad;
1538     CARD16 length B16;
1539     Window srcWid B32, dstWid B32;
1540     INT16 srcX B16, srcY B16;
1541 } xTranslateCoordsReq;
1542
1543 typedef struct {
1544     CARD8 reqType;
1545     BYTE pad;
1546     CARD16 length B16;
1547     Window srcWid B32, dstWid B32;
1548     INT16 srcX B16, srcY B16;
1549     CARD16 srcWidth B16, srcHeight B16;
1550     INT16 dstX B16, dstY B16;
1551 } xWarpPointerReq;
1552
1553 typedef struct {
1554     CARD8 reqType;
1555     CARD8 revertTo;
1556     CARD16 length B16;
1557     Window focus B32;
1558     Time time B32;
1559 } xSetInputFocusReq;
1560
1561 typedef struct {
1562     CARD8 reqType;
1563     BYTE pad;
1564     CARD16 length B16;
1565     Font fid B32;
1566     CARD16 nbytes B16;
1567     BYTE pad1, pad2;    /* string follows on word boundary */
1568 } xOpenFontReq;
1569
1570 typedef struct {
1571     CARD8 reqType;
1572     BOOL oddLength;
1573     CARD16 length B16;
1574     Font fid B32;
1575     } xQueryTextExtentsReq;
1576
1577 typedef struct {
1578     CARD8 reqType;
1579     BYTE pad;
1580     CARD16 length B16;
1581     CARD16 maxNames B16;
1582     CARD16 nbytes B16;  /* followed immediately by string bytes */
1583 } xListFontsReq;
1584
1585 typedef xListFontsReq xListFontsWithInfoReq;
1586
1587 typedef struct {
1588     CARD8 reqType;
1589     BYTE pad;
1590     CARD16 length B16;
1591     CARD16 nFonts B16;
1592     BYTE pad1, pad2;    /* LISTofSTRING8 follows on word boundary */
1593 } xSetFontPathReq;
1594
1595 typedef struct {
1596     CARD8 reqType;
1597     CARD8 depth;
1598     CARD16 length B16;
1599     Pixmap pid B32;
1600     Drawable drawable B32;
1601     CARD16 width B16, height B16;
1602 } xCreatePixmapReq;
1603
1604 typedef struct {
1605     CARD8 reqType;
1606     BYTE pad;
1607     CARD16 length B16;
1608     GContext gc B32;
1609     Drawable drawable B32;
1610     CARD32 mask B32;
1611 } xCreateGCReq;
1612
1613 typedef struct {
1614     CARD8 reqType;
1615     BYTE pad;
1616     CARD16 length B16;
1617     GContext gc B32;
1618     CARD32 mask B32;
1619 } xChangeGCReq;    
1620
1621 typedef struct {
1622     CARD8 reqType;
1623     BYTE pad;
1624     CARD16 length B16;
1625     GContext srcGC B32, dstGC B32;
1626     CARD32 mask B32;
1627 } xCopyGCReq;    
1628
1629 typedef struct {
1630     CARD8 reqType;
1631     BYTE pad;
1632     CARD16 length B16;
1633     GContext gc B32;
1634     CARD16 dashOffset B16;
1635     CARD16 nDashes B16;        /* length LISTofCARD8 of values following */
1636 } xSetDashesReq;    
1637
1638 typedef struct {
1639     CARD8 reqType;
1640     BYTE ordering;
1641     CARD16 length B16;
1642     GContext gc B32;
1643     INT16 xOrigin B16, yOrigin B16;
1644 } xSetClipRectanglesReq;    
1645
1646 typedef struct {
1647     CARD8 reqType;
1648     BOOL exposures;
1649     CARD16 length B16;
1650     Window window B32;
1651     INT16 x B16, y B16;
1652     CARD16 width B16, height B16;
1653 } xClearAreaReq;
1654
1655 typedef struct {
1656     CARD8 reqType;
1657     BYTE pad;
1658     CARD16 length B16;
1659     Drawable srcDrawable B32, dstDrawable B32;
1660     GContext gc B32;
1661     INT16 srcX B16, srcY B16, dstX B16, dstY B16;
1662     CARD16 width B16, height B16;
1663 } xCopyAreaReq;    
1664
1665 typedef struct {
1666     CARD8 reqType;
1667     BYTE pad;
1668     CARD16 length B16;
1669     Drawable srcDrawable B32, dstDrawable B32;
1670     GContext gc B32;
1671     INT16 srcX B16, srcY B16, dstX B16, dstY B16;
1672     CARD16 width B16, height B16;
1673     CARD32 bitPlane B32;
1674 } xCopyPlaneReq;    
1675
1676 typedef struct {
1677     CARD8 reqType;
1678     BYTE coordMode;
1679     CARD16 length B16;
1680     Drawable drawable B32;
1681     GContext gc B32;
1682 } xPolyPointReq;    
1683
1684 typedef xPolyPointReq xPolyLineReq;  /* same request structure */
1685
1686 /* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */
1687
1688 typedef struct {
1689     CARD8 reqType;
1690     BYTE pad;
1691     CARD16 length B16;
1692     Drawable drawable B32;
1693     GContext gc B32;
1694 } xPolySegmentReq;    
1695
1696 typedef xPolySegmentReq xPolyArcReq;
1697 typedef xPolySegmentReq xPolyRectangleReq;
1698 typedef xPolySegmentReq xPolyFillRectangleReq;
1699 typedef xPolySegmentReq xPolyFillArcReq;
1700
1701 typedef struct _FillPolyReq {
1702     CARD8 reqType;
1703     BYTE pad;
1704     CARD16 length B16;
1705     Drawable drawable B32;
1706     GContext gc B32;
1707     BYTE shape;
1708     BYTE coordMode;
1709     CARD16 pad1 B16;
1710 } xFillPolyReq;    
1711
1712
1713 typedef struct _PutImageReq {
1714     CARD8 reqType;
1715     CARD8 format;
1716     CARD16 length B16;
1717     Drawable drawable B32;
1718     GContext gc B32;
1719     CARD16 width B16, height B16;
1720     INT16 dstX B16, dstY B16;
1721     CARD8 leftPad;
1722     CARD8 depth;
1723     CARD16 pad B16;
1724 } xPutImageReq;    
1725
1726 typedef struct {
1727     CARD8 reqType;
1728     CARD8 format;
1729     CARD16 length B16;
1730     Drawable drawable B32;
1731     INT16 x B16, y B16;
1732     CARD16 width B16, height B16;
1733     CARD32 planeMask B32;
1734 } xGetImageReq;    
1735
1736 /* the following used by PolyText8 and PolyText16 */
1737
1738 typedef struct {
1739     CARD8 reqType;
1740     CARD8 pad;
1741     CARD16 length B16;
1742     Drawable drawable B32;
1743     GContext gc B32;
1744     INT16 x B16, y B16;         /* items (xTextElt) start after struct */
1745 } xPolyTextReq;    
1746
1747 typedef xPolyTextReq xPolyText8Req;
1748 typedef xPolyTextReq xPolyText16Req;
1749
1750 typedef struct {
1751     CARD8 reqType;
1752     BYTE nChars;
1753     CARD16 length B16;
1754     Drawable drawable B32;
1755     GContext gc B32;
1756     INT16 x B16, y B16;
1757 } xImageTextReq;    
1758
1759 typedef xImageTextReq xImageText8Req;
1760 typedef xImageTextReq xImageText16Req;
1761
1762 typedef struct {
1763     CARD8 reqType;
1764     BYTE alloc;
1765     CARD16 length B16;
1766     Colormap mid B32;
1767     Window window B32;
1768     VisualID visual B32;
1769 } xCreateColormapReq;    
1770
1771 typedef struct {
1772     CARD8 reqType;
1773     BYTE pad;
1774     CARD16 length B16;
1775     Colormap mid B32;
1776     Colormap srcCmap B32;
1777 } xCopyColormapAndFreeReq;    
1778
1779 typedef struct {
1780     CARD8 reqType;
1781     BYTE pad;
1782     CARD16 length B16;
1783     Colormap cmap B32;
1784     CARD16 red B16, green B16, blue B16;
1785     CARD16 pad2 B16;
1786 } xAllocColorReq;    
1787
1788 typedef struct {
1789     CARD8 reqType;
1790     BYTE pad;
1791     CARD16 length B16;
1792     Colormap cmap B32;
1793     CARD16 nbytes B16;  /* followed by structure */
1794     BYTE pad1, pad2;
1795 } xAllocNamedColorReq;    
1796
1797 typedef struct {
1798     CARD8 reqType;
1799     BOOL contiguous;
1800     CARD16 length B16;
1801     Colormap cmap B32;
1802     CARD16 colors B16, planes B16;
1803 } xAllocColorCellsReq;    
1804
1805 typedef struct {
1806     CARD8 reqType;
1807     BOOL contiguous;
1808     CARD16 length B16;
1809     Colormap cmap B32;
1810     CARD16 colors B16, red B16, green B16, blue B16;
1811 } xAllocColorPlanesReq;    
1812
1813 typedef struct {
1814     CARD8 reqType;
1815     BYTE pad;
1816     CARD16 length B16;
1817     Colormap cmap B32;
1818     CARD32 planeMask B32;
1819 } xFreeColorsReq;    
1820
1821 typedef struct {
1822     CARD8 reqType;
1823     BYTE pad;
1824     CARD16 length B16;
1825     Colormap cmap B32;
1826 } xStoreColorsReq;    
1827
1828 typedef struct {
1829     CARD8 reqType;
1830     CARD8 flags;   /* DoRed, DoGreen, DoBlue, as in xColorItem */
1831     CARD16 length B16;
1832     Colormap cmap B32;
1833     CARD32 pixel B32;
1834     CARD16 nbytes B16;  /* number of name string bytes following structure */
1835     BYTE pad1, pad2;
1836     } xStoreNamedColorReq;
1837
1838 typedef struct {
1839     CARD8 reqType;
1840     BYTE pad;
1841     CARD16 length B16;
1842     Colormap cmap B32;
1843 } xQueryColorsReq;    
1844
1845 typedef struct {    /* followed  by string of length len */
1846     CARD8 reqType;
1847     BYTE pad;
1848     CARD16 length B16;
1849     Colormap cmap B32;
1850     CARD16 nbytes B16;  /* number of string bytes following structure*/
1851     BYTE pad1, pad2;
1852 } xLookupColorReq;    
1853
1854 typedef struct {
1855     CARD8 reqType;
1856     BYTE pad;
1857     CARD16 length B16;
1858     Cursor cid B32;
1859     Pixmap source B32, mask B32;
1860     CARD16 foreRed B16, foreGreen B16, foreBlue B16;
1861     CARD16 backRed B16, backGreen B16, backBlue B16;
1862     CARD16 x B16, y B16;
1863 } xCreateCursorReq;    
1864
1865 typedef struct {
1866     CARD8 reqType;
1867     BYTE pad;
1868     CARD16 length B16;
1869     Cursor cid B32;
1870     Font source B32, mask B32;
1871     CARD16 sourceChar B16, maskChar B16;
1872     CARD16 foreRed B16, foreGreen B16, foreBlue B16;
1873     CARD16 backRed B16, backGreen B16, backBlue B16;
1874 } xCreateGlyphCursorReq;    
1875
1876 typedef struct {
1877     CARD8 reqType;
1878     BYTE pad;
1879     CARD16 length B16;
1880     Cursor cursor B32;
1881     CARD16 foreRed B16, foreGreen B16, foreBlue B16;
1882     CARD16 backRed B16, backGreen B16, backBlue B16;
1883 } xRecolorCursorReq;    
1884
1885 typedef struct {
1886     CARD8 reqType;
1887 #if defined(__cplusplus) || defined(c_plusplus)
1888     CARD8 c_class;
1889 #else
1890     CARD8 class;
1891 #endif
1892     CARD16 length B16;
1893     Drawable drawable B32;
1894     CARD16 width B16, height B16;
1895 } xQueryBestSizeReq;    
1896
1897 typedef struct {
1898     CARD8 reqType;
1899     BYTE pad;
1900     CARD16 length B16;
1901     CARD16 nbytes B16;  /* number of string bytes following structure */
1902     BYTE pad1, pad2;
1903 } xQueryExtensionReq;
1904
1905 typedef struct {
1906     CARD8   reqType;
1907     CARD8   numKeyPerModifier;
1908     CARD16  length B16;
1909 } xSetModifierMappingReq;
1910
1911 typedef struct {
1912     CARD8 reqType;
1913     CARD8 nElts;  /* how many elements in the map */
1914     CARD16 length B16;
1915 } xSetPointerMappingReq;
1916
1917 typedef struct {
1918     CARD8 reqType;
1919     BYTE pad;
1920     CARD16 length B16;
1921     KeyCode firstKeyCode;
1922     CARD8 count;
1923     CARD16 pad1 B16;
1924 } xGetKeyboardMappingReq;    
1925
1926 typedef struct {
1927     CARD8 reqType;
1928     CARD8 keyCodes;
1929     CARD16 length B16;
1930     KeyCode firstKeyCode;
1931     CARD8 keySymsPerKeyCode;
1932     CARD16 pad1 B16;
1933 } xChangeKeyboardMappingReq;
1934
1935 typedef struct {
1936     CARD8 reqType;
1937     BYTE pad;
1938     CARD16 length B16;
1939     CARD32 mask B32;
1940 } xChangeKeyboardControlReq;    
1941
1942 typedef struct {
1943     CARD8 reqType;
1944     INT8 percent;  /* -100 to 100 */
1945     CARD16 length B16;
1946 } xBellReq;    
1947
1948 typedef struct {
1949     CARD8 reqType;
1950     BYTE pad;
1951     CARD16 length B16;
1952     INT16 accelNum B16, accelDenum B16;
1953     INT16 threshold B16;             
1954     BOOL doAccel, doThresh;
1955 } xChangePointerControlReq;    
1956
1957 typedef struct {
1958     CARD8 reqType;
1959     BYTE pad;
1960     CARD16 length B16;
1961     INT16 timeout B16, interval B16;
1962     BYTE preferBlank, allowExpose;  
1963     CARD16 pad2 B16;
1964 } xSetScreenSaverReq;    
1965
1966 typedef struct {
1967     CARD8 reqType;
1968     BYTE mode;
1969     CARD16 length B16;
1970     CARD8 hostFamily;
1971     BYTE pad;
1972     CARD16 hostLength B16;
1973 } xChangeHostsReq;    
1974
1975 typedef struct {
1976     CARD8 reqType;
1977     BYTE pad;
1978     CARD16 length B16;
1979     } xListHostsReq;
1980
1981 typedef struct {
1982     CARD8 reqType;
1983     BYTE mode;
1984     CARD16 length B16;
1985     } xChangeModeReq;
1986
1987 typedef xChangeModeReq xSetAccessControlReq;
1988 typedef xChangeModeReq xSetCloseDownModeReq;
1989 typedef xChangeModeReq xForceScreenSaverReq;
1990
1991 typedef struct { /* followed by LIST of ATOM */
1992     CARD8 reqType;
1993     BYTE pad;
1994     CARD16 length B16;
1995     Window window B32;
1996     CARD16 nAtoms B16;
1997     INT16 nPositions B16;
1998     } xRotatePropertiesReq;
1999     
2000 \f
2001
2002 /* Reply codes */
2003
2004 #define X_Reply         1               /* Normal reply */
2005 #define X_Error         0               /* Error */
2006
2007 /* Request codes */
2008
2009 #define X_CreateWindow                  1              
2010 #define X_ChangeWindowAttributes        2        
2011 #define X_GetWindowAttributes           3     
2012 #define X_DestroyWindow                 4
2013 #define X_DestroySubwindows             5   
2014 #define X_ChangeSaveSet                 6
2015 #define X_ReparentWindow                7
2016 #define X_MapWindow                     8
2017 #define X_MapSubwindows                 9
2018 #define X_UnmapWindow                  10
2019 #define X_UnmapSubwindows              11  
2020 #define X_ConfigureWindow              12  
2021 #define X_CirculateWindow              13  
2022 #define X_GetGeometry                  14
2023 #define X_QueryTree                    15
2024 #define X_InternAtom                   16
2025 #define X_GetAtomName                  17
2026 #define X_ChangeProperty               18 
2027 #define X_DeleteProperty               19 
2028 #define X_GetProperty                  20
2029 #define X_ListProperties               21 
2030 #define X_SetSelectionOwner            22    
2031 #define X_GetSelectionOwner            23    
2032 #define X_ConvertSelection             24   
2033 #define X_SendEvent                    25
2034 #define X_GrabPointer                  26
2035 #define X_UngrabPointer                27
2036 #define X_GrabButton                   28
2037 #define X_UngrabButton                 29
2038 #define X_ChangeActivePointerGrab      30          
2039 #define X_GrabKeyboard                 31
2040 #define X_UngrabKeyboard               32 
2041 #define X_GrabKey                      33
2042 #define X_UngrabKey                    34
2043 #define X_AllowEvents                  35       
2044 #define X_GrabServer                   36      
2045 #define X_UngrabServer                 37        
2046 #define X_QueryPointer                 38        
2047 #define X_GetMotionEvents              39           
2048 #define X_TranslateCoords              40                
2049 #define X_WarpPointer                  41       
2050 #define X_SetInputFocus                42         
2051 #define X_GetInputFocus                43         
2052 #define X_QueryKeymap                  44       
2053 #define X_OpenFont                     45    
2054 #define X_CloseFont                    46     
2055 #define X_QueryFont                    47
2056 #define X_QueryTextExtents             48     
2057 #define X_ListFonts                    49  
2058 #define X_ListFontsWithInfo            50 
2059 #define X_SetFontPath                  51 
2060 #define X_GetFontPath                  52 
2061 #define X_CreatePixmap                 53        
2062 #define X_FreePixmap                   54      
2063 #define X_CreateGC                     55    
2064 #define X_ChangeGC                     56    
2065 #define X_CopyGC                       57  
2066 #define X_SetDashes                    58     
2067 #define X_SetClipRectangles            59             
2068 #define X_FreeGC                       60  
2069 #define X_ClearArea                    61             
2070 #define X_CopyArea                     62    
2071 #define X_CopyPlane                    63     
2072 #define X_PolyPoint                    64     
2073 #define X_PolyLine                     65    
2074 #define X_PolySegment                  66       
2075 #define X_PolyRectangle                67         
2076 #define X_PolyArc                      68   
2077 #define X_FillPoly                     69    
2078 #define X_PolyFillRectangle            70             
2079 #define X_PolyFillArc                  71       
2080 #define X_PutImage                     72    
2081 #define X_GetImage                     73 
2082 #define X_PolyText8                    74     
2083 #define X_PolyText16                   75      
2084 #define X_ImageText8                   76      
2085 #define X_ImageText16                  77       
2086 #define X_CreateColormap               78          
2087 #define X_FreeColormap                 79        
2088 #define X_CopyColormapAndFree          80               
2089 #define X_InstallColormap              81           
2090 #define X_UninstallColormap            82             
2091 #define X_ListInstalledColormaps       83                  
2092 #define X_AllocColor                   84      
2093 #define X_AllocNamedColor              85           
2094 #define X_AllocColorCells              86           
2095 #define X_AllocColorPlanes             87            
2096 #define X_FreeColors                   88      
2097 #define X_StoreColors                  89       
2098 #define X_StoreNamedColor              90           
2099 #define X_QueryColors                  91       
2100 #define X_LookupColor                  92       
2101 #define X_CreateCursor                 93        
2102 #define X_CreateGlyphCursor            94             
2103 #define X_FreeCursor                   95      
2104 #define X_RecolorCursor                96         
2105 #define X_QueryBestSize                97         
2106 #define X_QueryExtension               98          
2107 #define X_ListExtensions               99          
2108 #define X_ChangeKeyboardMapping        100
2109 #define X_GetKeyboardMapping           101
2110 #define X_ChangeKeyboardControl        102                
2111 #define X_GetKeyboardControl           103             
2112 #define X_Bell                         104
2113 #define X_ChangePointerControl         105
2114 #define X_GetPointerControl            106
2115 #define X_SetScreenSaver               107          
2116 #define X_GetScreenSaver               108          
2117 #define X_ChangeHosts                  109       
2118 #define X_ListHosts                    110     
2119 #define X_SetAccessControl             111               
2120 #define X_SetCloseDownMode             112
2121 #define X_KillClient                   113 
2122 #define X_RotateProperties             114
2123 #define X_ForceScreenSaver             115
2124 #define X_SetPointerMapping            116
2125 #define X_GetPointerMapping            117
2126 #define X_SetModifierMapping           118
2127 #define X_GetModifierMapping           119
2128 #define X_NoOperation                  127
2129
2130 /* restore these definitions back to the typedefs in X.h */
2131 #undef Window
2132 #undef Drawable
2133 #undef Font
2134 #undef Pixmap
2135 #undef Cursor
2136 #undef Colormap
2137 #undef GContext
2138 #undef Atom
2139 #undef VisualID
2140 #undef Time
2141 #undef KeyCode
2142 #undef KeySym
2143
2144 #endif /* XPROTO_H */