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