Home | History | Annotate | Line # | 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 structures.  See Chapter 8: Connection Setup
    263    of the X Window System Protocol specification for details.
    264 *****************/
    265 
    266 /* Client initiates handshake with this data, followed by the strings
    267  * for the auth protocol & data.
    268  */
    269 typedef struct {
    270     CARD8	byteOrder;
    271     BYTE	pad;
    272     CARD16	majorVersion, minorVersion;
    273     CARD16	nbytesAuthProto;	/* Authorization protocol */
    274     CARD16	nbytesAuthString;	/* Authorization string */
    275     CARD16	pad2;
    276 } xConnClientPrefix;
    277 
    278 /* Server response to xConnClientPrefix.
    279  *
    280  * If success == Success, this is followed by xConnSetup and
    281  * numRoots xWindowRoot structs.
    282  *
    283  * If success == Failure, this is followed by a reason string.
    284  *
    285  * The protocol also defines a case of success == Authenticate, but
    286  * that doesn't seem to have ever been implemented by the X Consortium.
    287  */
    288 typedef struct {
    289     CARD8          success;
    290     BYTE           lengthReason; /*num bytes in string following if failure */
    291     CARD16         majorVersion,
    292                    minorVersion;
    293     CARD16         length;       /* 1/4 additional bytes in setup info */
    294 } xConnSetupPrefix;
    295 
    296 
    297 typedef struct {
    298     CARD32         release;
    299     CARD32         ridBase,
    300                    ridMask;
    301     CARD32         motionBufferSize;
    302     CARD16         nbytesVendor;      /* number of bytes in vendor string */
    303     CARD16         maxRequestSize;
    304     CARD8          numRoots;          /* number of roots structs to follow */
    305     CARD8          numFormats;        /* number of pixmap formats */
    306     CARD8          imageByteOrder;        /* LSBFirst, MSBFirst */
    307     CARD8          bitmapBitOrder;        /* LeastSignificant, MostSign...*/
    308     CARD8          bitmapScanlineUnit,     /* 8, 16, 32 */
    309                    bitmapScanlinePad;     /* 8, 16, 32 */
    310     KeyCode	   minKeyCode, maxKeyCode;
    311     CARD32	   pad2;
    312 } xConnSetup;
    313 
    314 typedef struct {
    315     CARD8          depth;
    316     CARD8          bitsPerPixel;
    317     CARD8          scanLinePad;
    318     CARD8          pad1;
    319     CARD32	   pad2;
    320 } xPixmapFormat;
    321 
    322 /* window root */
    323 
    324 typedef struct {
    325     CARD8 	depth;
    326     CARD8 	pad1;
    327     CARD16	nVisuals;  /* number of xVisualType structures following */
    328     CARD32	pad2;
    329     } xDepth;
    330 
    331 typedef struct {
    332     VisualID visualID;
    333 #if defined(__cplusplus) || defined(c_plusplus)
    334     CARD8 c_class;
    335 #else
    336     CARD8 class;
    337 #endif
    338     CARD8 bitsPerRGB;
    339     CARD16 colormapEntries;
    340     CARD32 redMask, greenMask, blueMask;
    341     CARD32 pad;
    342     } xVisualType;
    343 
    344 typedef struct {
    345     Window         windowId;
    346     Colormap       defaultColormap;
    347     CARD32         whitePixel, blackPixel;
    348     CARD32         currentInputMask;
    349     CARD16         pixWidth, pixHeight;
    350     CARD16         mmWidth, mmHeight;
    351     CARD16         minInstalledMaps, maxInstalledMaps;
    352     VisualID       rootVisualID;
    353     CARD8          backingStore;
    354     BOOL           saveUnders;
    355     CARD8          rootDepth;
    356     CARD8          nDepths;  /* number of xDepth structures following */
    357 } xWindowRoot;
    358 
    359 
    361 /*****************************************************************
    362  * Structure Defns
    363  *   Structures needed for replies
    364  *****************************************************************/
    365 
    366 /* Used in GetMotionEvents */
    367 
    368 typedef struct {
    369     CARD32 time;
    370     INT16 x, y;
    371 } xTimecoord;
    372 
    373 typedef struct {
    374     CARD8 family;
    375     BYTE pad;
    376     CARD16 length;
    377 } xHostEntry;
    378 
    379 typedef struct {
    380     INT16 leftSideBearing,
    381 	  rightSideBearing,
    382 	  characterWidth,
    383 	  ascent,
    384 	  descent;
    385     CARD16 attributes;
    386 } xCharInfo;
    387 
    388 typedef struct {
    389     Atom name;
    390     CARD32 value;
    391 } xFontProp;
    392 
    393 /*
    394  * non-aligned big-endian font ID follows this struct
    395  */
    396 typedef struct {           /* followed by string */
    397     CARD8 len;	/* number of *characters* in string, or FontChange (255)
    398 		   for font change, or 0 if just delta given */
    399     INT8 delta;
    400 } xTextElt;
    401 
    402 
    403 typedef struct {
    404     CARD32 pixel;
    405     CARD16 red, green, blue;
    406     CARD8 flags;  /* DoRed, DoGreen, DoBlue booleans */
    407     CARD8 pad;
    408 } xColorItem;
    409 
    410 
    411 typedef struct {
    412     CARD16 red, green, blue, pad;
    413 } xrgb;
    414 
    415 typedef CARD8 KEYCODE;
    416 
    417 
    419 /*****************
    420  * XRep:
    421  *    meant to be 32 byte quantity
    422  *****************/
    423 
    424 /* GenericReply is the common format of all replies.  The "data" items
    425    are specific to each individual reply type. */
    426 
    427 typedef struct {
    428     BYTE type;              /* X_Reply */
    429     BYTE data1;             /* depends on reply type */
    430     CARD16 sequenceNumber;  /* of last request received by server */
    431     CARD32 length;          /* 4 byte quantities beyond size of GenericReply */
    432     CARD32 data00;
    433     CARD32 data01;
    434     CARD32 data02;
    435     CARD32 data03;
    436     CARD32 data04;
    437     CARD32 data05;
    438     } xGenericReply;
    439 
    440 /* Individual reply formats. */
    441 
    442 typedef struct {
    443     BYTE type;  /* X_Reply */
    444     CARD8 backingStore;
    445     CARD16 sequenceNumber;
    446     CARD32 length;	/* NOT 0; this is an extra-large reply */
    447     VisualID visualID;
    448 #if defined(__cplusplus) || defined(c_plusplus)
    449     CARD16 c_class;
    450 #else
    451     CARD16 class;
    452 #endif
    453     CARD8 bitGravity;
    454     CARD8 winGravity;
    455     CARD32 backingBitPlanes;
    456     CARD32 backingPixel;
    457     BOOL saveUnder;
    458     BOOL mapInstalled;
    459     CARD8 mapState;
    460     BOOL override;
    461     Colormap colormap;
    462     CARD32 allEventMasks;
    463     CARD32 yourEventMask;
    464     CARD16 doNotPropagateMask;
    465     CARD16 pad;
    466     } xGetWindowAttributesReply;
    467 
    468 typedef struct {
    469     BYTE type;   /* X_Reply */
    470     CARD8 depth;
    471     CARD16 sequenceNumber;
    472     CARD32 length;  /* 0 */
    473     Window root;
    474     INT16 x, y;
    475     CARD16 width, height;
    476     CARD16 borderWidth;
    477     CARD16 pad1;
    478     CARD32 pad2;
    479     CARD32 pad3;
    480     } xGetGeometryReply;
    481 
    482 typedef struct {
    483     BYTE type;  /* X_Reply */
    484     BYTE pad1;
    485     CARD16 sequenceNumber;
    486     CARD32 length;
    487     Window root, parent;
    488     CARD16 nChildren;
    489     CARD16 pad2;
    490     CARD32 pad3;
    491     CARD32 pad4;
    492     CARD32 pad5;
    493     } xQueryTreeReply;
    494 
    495 typedef struct {
    496     BYTE type;  /* X_Reply */
    497     BYTE pad1;
    498     CARD16 sequenceNumber;
    499     CARD32 length; /* 0 */
    500     Atom atom;
    501     CARD32 pad2;
    502     CARD32 pad3;
    503     CARD32 pad4;
    504     CARD32 pad5;
    505     CARD32 pad6;
    506     } xInternAtomReply;
    507 
    508 typedef struct {
    509     BYTE type;  /* X_Reply */
    510     BYTE pad1;
    511     CARD16 sequenceNumber;
    512     CARD32 length;  /* of additional bytes */
    513     CARD16 nameLength;  /* # of characters in name */
    514     CARD16 pad2;
    515     CARD32 pad3;
    516     CARD32 pad4;
    517     CARD32 pad5;
    518     CARD32 pad6;
    519     CARD32 pad7;
    520     } xGetAtomNameReply;
    521 
    522 typedef struct {
    523     BYTE type;  /* X_Reply */
    524     CARD8 format;
    525     CARD16 sequenceNumber;
    526     CARD32 length; /* of additional bytes */
    527     Atom propertyType;
    528     CARD32 bytesAfter;
    529     CARD32 nItems; /* # of 8, 16, or 32-bit entities in reply */
    530     CARD32 pad1;
    531     CARD32 pad2;
    532     CARD32 pad3;
    533     } xGetPropertyReply;
    534 
    535 typedef struct {
    536     BYTE type;  /* X_Reply */
    537     BYTE pad1;
    538     CARD16 sequenceNumber;
    539     CARD32 length;
    540     CARD16 nProperties;
    541     CARD16 pad2;
    542     CARD32 pad3;
    543     CARD32 pad4;
    544     CARD32 pad5;
    545     CARD32 pad6;
    546     CARD32 pad7;
    547     } xListPropertiesReply;
    548 
    549 typedef struct {
    550     BYTE type;  /* X_Reply */
    551     BYTE pad1;
    552     CARD16 sequenceNumber;
    553     CARD32 length;  /* 0 */
    554     Window owner;
    555     CARD32 pad2;
    556     CARD32 pad3;
    557     CARD32 pad4;
    558     CARD32 pad5;
    559     CARD32 pad6;
    560     } xGetSelectionOwnerReply;
    561 
    562 typedef struct {
    563     BYTE type;  /* X_Reply */
    564     BYTE status;
    565     CARD16 sequenceNumber;
    566     CARD32 length;  /* 0 */
    567     CARD32 pad1;
    568     CARD32 pad2;
    569     CARD32 pad3;
    570     CARD32 pad4;
    571     CARD32 pad5;
    572     CARD32 pad6;
    573     } xGrabPointerReply;
    574 
    575 typedef xGrabPointerReply xGrabKeyboardReply;
    576 
    577 typedef struct {
    578     BYTE type;  /* X_Reply */
    579     BOOL sameScreen;
    580     CARD16 sequenceNumber;
    581     CARD32 length;  /* 0 */
    582     Window root, child;
    583     INT16 rootX, rootY, winX, winY;
    584     CARD16 mask;
    585     CARD16 pad1;
    586     CARD32 pad;
    587     } xQueryPointerReply;
    588 
    589 typedef struct {
    590     BYTE type;  /* X_Reply */
    591     BYTE pad1;
    592     CARD16 sequenceNumber;
    593     CARD32 length;
    594     CARD32 nEvents;
    595     CARD32 pad2;
    596     CARD32 pad3;
    597     CARD32 pad4;
    598     CARD32 pad5;
    599     CARD32 pad6;
    600     } xGetMotionEventsReply;
    601 
    602 typedef struct {
    603     BYTE type;  /* X_Reply */
    604     BOOL sameScreen;
    605     CARD16 sequenceNumber;
    606     CARD32 length; /* 0 */
    607     Window child;
    608     INT16 dstX, dstY;
    609     CARD32 pad2;
    610     CARD32 pad3;
    611     CARD32 pad4;
    612     CARD32 pad5;
    613     } xTranslateCoordsReply;
    614 
    615 typedef struct {
    616     BYTE type;  /* X_Reply */
    617     CARD8 revertTo;
    618     CARD16 sequenceNumber;
    619     CARD32 length;  /* 0 */
    620     Window focus;
    621     CARD32 pad1;
    622     CARD32 pad2;
    623     CARD32 pad3;
    624     CARD32 pad4;
    625     CARD32 pad5;
    626     } xGetInputFocusReply;
    627 
    628 typedef struct {
    629     BYTE type;  /* X_Reply */
    630     BYTE pad1;
    631     CARD16 sequenceNumber;
    632     CARD32 length;  /* 2, NOT 0; this is an extra-large reply */
    633     BYTE map[32];
    634     } xQueryKeymapReply;
    635 
    636 /* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */
    637 typedef struct _xQueryFontReply {
    638     BYTE type;  /* X_Reply */
    639     BYTE pad1;
    640     CARD16 sequenceNumber;
    641     CARD32 length;  /* definitely > 0, even if "nCharInfos" is 0 */
    642     xCharInfo minBounds;
    643     CARD32 walign1;
    644     xCharInfo maxBounds;
    645     CARD32 walign2;
    646     CARD16 minCharOrByte2, maxCharOrByte2;
    647     CARD16 defaultChar;
    648     CARD16 nFontProps;  /* followed by this many xFontProp structures */
    649     CARD8 drawDirection;
    650     CARD8 minByte1, maxByte1;
    651     BOOL allCharsExist;
    652     INT16 fontAscent, fontDescent;
    653     CARD32 nCharInfos; /* followed by this many xCharInfo structures */
    654 } xQueryFontReply;
    655 
    656 typedef struct {
    657     BYTE type;  /* X_Reply */
    658     CARD8 drawDirection;
    659     CARD16 sequenceNumber;
    660     CARD32 length;  /* 0 */
    661     INT16 fontAscent, fontDescent;
    662     INT16 overallAscent, overallDescent;
    663     INT32 overallWidth, overallLeft, overallRight;
    664     CARD32 pad;
    665     } xQueryTextExtentsReply;
    666 
    667 typedef struct {
    668     BYTE type;  /* X_Reply */
    669     BYTE pad1;
    670     CARD16 sequenceNumber;
    671     CARD32 length;
    672     CARD16 nFonts;
    673     CARD16 pad2;
    674     CARD32 pad3;
    675     CARD32 pad4;
    676     CARD32 pad5;
    677     CARD32 pad6;
    678     CARD32 pad7;
    679     } xListFontsReply;
    680 
    681 /* Warning: this MUST match (up to component renaming) xQueryFontReply */
    682 typedef struct {
    683     BYTE type;  /* X_Reply */
    684     CARD8 nameLength;  /* 0 indicates end-of-reply-sequence */
    685     CARD16 sequenceNumber;
    686     CARD32 length;  /* definitely > 0, even if "nameLength" is 0 */
    687     xCharInfo minBounds;
    688     CARD32 walign1;
    689     xCharInfo maxBounds;
    690     CARD32 walign2;
    691     CARD16 minCharOrByte2, maxCharOrByte2;
    692     CARD16 defaultChar;
    693     CARD16 nFontProps;  /* followed by this many xFontProp structures */
    694     CARD8 drawDirection;
    695     CARD8 minByte1, maxByte1;
    696     BOOL allCharsExist;
    697     INT16 fontAscent, fontDescent;
    698     CARD32 nReplies;   /* hint as to how many more replies might be coming */
    699 } xListFontsWithInfoReply;
    700 
    701 typedef struct {
    702     BYTE type;  /* X_Reply */
    703     BYTE pad1;
    704     CARD16 sequenceNumber;
    705     CARD32 length;
    706     CARD16 nPaths;
    707     CARD16 pad2;
    708     CARD32 pad3;
    709     CARD32 pad4;
    710     CARD32 pad5;
    711     CARD32 pad6;
    712     CARD32 pad7;
    713     } xGetFontPathReply;
    714 
    715 typedef struct {
    716     BYTE type;  /* X_Reply */
    717     CARD8 depth;
    718     CARD16 sequenceNumber;
    719     CARD32 length;
    720     VisualID visual;
    721     CARD32 pad3;
    722     CARD32 pad4;
    723     CARD32 pad5;
    724     CARD32 pad6;
    725     CARD32 pad7;
    726     } xGetImageReply;
    727 
    728 typedef struct {
    729     BYTE type;  /* X_Reply */
    730     BYTE pad1;
    731     CARD16 sequenceNumber;
    732     CARD32 length;
    733     CARD16 nColormaps;
    734     CARD16 pad2;
    735     CARD32 pad3;
    736     CARD32 pad4;
    737     CARD32 pad5;
    738     CARD32 pad6;
    739     CARD32 pad7;
    740     } xListInstalledColormapsReply;
    741 
    742 typedef struct {
    743     BYTE type; /* X_Reply */
    744     BYTE pad1;
    745     CARD16 sequenceNumber;
    746     CARD32 length;   /* 0 */
    747     CARD16 red, green, blue;
    748     CARD16 pad2;
    749     CARD32 pixel;
    750     CARD32 pad3;
    751     CARD32 pad4;
    752     CARD32 pad5;
    753     } xAllocColorReply;
    754 
    755 typedef struct {
    756     BYTE type; /* X_Reply */
    757     BYTE pad1;
    758     CARD16 sequenceNumber;
    759     CARD32 length;  /* 0 */
    760     CARD32 pixel;
    761     CARD16 exactRed, exactGreen, exactBlue;
    762     CARD16 screenRed, screenGreen, screenBlue;
    763     CARD32 pad2;
    764     CARD32 pad3;
    765     } xAllocNamedColorReply;
    766 
    767 typedef struct {
    768     BYTE type;  /* X_Reply */
    769     BYTE pad1;
    770     CARD16 sequenceNumber;
    771     CARD32 length;
    772     CARD16 nPixels, nMasks;
    773     CARD32 pad3;
    774     CARD32 pad4;
    775     CARD32 pad5;
    776     CARD32 pad6;
    777     CARD32 pad7;
    778     } xAllocColorCellsReply;
    779 
    780 typedef struct {
    781     BYTE type; /* X_Reply */
    782     BYTE pad1;
    783     CARD16 sequenceNumber;
    784     CARD32 length;
    785     CARD16 nPixels;
    786     CARD16 pad2;
    787     CARD32 redMask, greenMask, blueMask;
    788     CARD32 pad3;
    789     CARD32 pad4;
    790     } xAllocColorPlanesReply;
    791 
    792 typedef struct {
    793     BYTE type; /* X_Reply */
    794     BYTE pad1;
    795     CARD16 sequenceNumber;
    796     CARD32 length;
    797     CARD16 nColors;
    798     CARD16 pad2;
    799     CARD32 pad3;
    800     CARD32 pad4;
    801     CARD32 pad5;
    802     CARD32 pad6;
    803     CARD32 pad7;
    804     } xQueryColorsReply;
    805 
    806 typedef struct {
    807     BYTE type;  /* X_Reply */
    808     BYTE pad1;
    809     CARD16 sequenceNumber;
    810     CARD32 length;  /* 0 */
    811     CARD16 exactRed, exactGreen, exactBlue;
    812     CARD16 screenRed, screenGreen, screenBlue;
    813     CARD32 pad3;
    814     CARD32 pad4;
    815     CARD32 pad5;
    816     } xLookupColorReply;
    817 
    818 typedef struct {
    819     BYTE type;  /* X_Reply */
    820     BYTE pad1;
    821     CARD16 sequenceNumber;
    822     CARD32 length;  /* 0 */
    823     CARD16 width, height;
    824     CARD32 pad3;
    825     CARD32 pad4;
    826     CARD32 pad5;
    827     CARD32 pad6;
    828     CARD32 pad7;
    829     } xQueryBestSizeReply;
    830 
    831 typedef struct {
    832     BYTE type;  /* X_Reply */
    833     BYTE pad1;
    834     CARD16 sequenceNumber;
    835     CARD32 length; /* 0 */
    836     BOOL  present;
    837     CARD8 major_opcode;
    838     CARD8 first_event;
    839     CARD8 first_error;
    840     CARD32 pad3;
    841     CARD32 pad4;
    842     CARD32 pad5;
    843     CARD32 pad6;
    844     CARD32 pad7;
    845     } xQueryExtensionReply;
    846 
    847 typedef struct {
    848     BYTE type;  /* X_Reply */
    849     CARD8 nExtensions;
    850     CARD16 sequenceNumber;
    851     CARD32 length;
    852     CARD32 pad2;
    853     CARD32 pad3;
    854     CARD32 pad4;
    855     CARD32 pad5;
    856     CARD32 pad6;
    857     CARD32 pad7;
    858     } xListExtensionsReply;
    859 
    860 
    861 typedef struct {
    862     BYTE   type;  /* X_Reply */
    863     CARD8  success;
    864     CARD16 sequenceNumber;
    865     CARD32 length;
    866     CARD32 pad2;
    867     CARD32 pad3;
    868     CARD32 pad4;
    869     CARD32 pad5;
    870     CARD32 pad6;
    871     CARD32 pad7;
    872     } xSetMappingReply;
    873 typedef xSetMappingReply xSetPointerMappingReply;
    874 typedef xSetMappingReply xSetModifierMappingReply;
    875 
    876 typedef struct {
    877     BYTE type;  /* X_Reply */
    878     CARD8 nElts;  /* how many elements does the map have */
    879     CARD16 sequenceNumber;
    880     CARD32 length;
    881     CARD32 pad2;
    882     CARD32 pad3;
    883     CARD32 pad4;
    884     CARD32 pad5;
    885     CARD32 pad6;
    886     CARD32 pad7;
    887     } xGetPointerMappingReply;
    888 
    889 typedef struct {
    890     BYTE type;
    891     CARD8 keySymsPerKeyCode;
    892     CARD16 sequenceNumber;
    893     CARD32 length;
    894     CARD32 pad2;
    895     CARD32 pad3;
    896     CARD32 pad4;
    897     CARD32 pad5;
    898     CARD32 pad6;
    899     CARD32 pad7;
    900 } xGetKeyboardMappingReply;
    901 
    902 typedef struct {
    903     BYTE type;
    904     CARD8 numKeyPerModifier;
    905     CARD16 sequenceNumber;
    906     CARD32 length;
    907     CARD32 pad1;
    908     CARD32 pad2;
    909     CARD32 pad3;
    910     CARD32 pad4;
    911     CARD32 pad5;
    912     CARD32 pad6;
    913 } xGetModifierMappingReply;
    914 
    915 typedef struct {
    916     BYTE type;  /* X_Reply */
    917     BOOL globalAutoRepeat;
    918     CARD16 sequenceNumber;
    919     CARD32 length;  /* 5 */
    920     CARD32 ledMask;
    921     CARD8 keyClickPercent, bellPercent;
    922     CARD16 bellPitch, bellDuration;
    923     CARD16 pad;
    924     BYTE map[32];  /* bit masks start here */
    925     } xGetKeyboardControlReply;
    926 
    927 typedef struct {
    928     BYTE type;  /* X_Reply */
    929     BYTE pad1;
    930     CARD16 sequenceNumber;
    931     CARD32 length;  /* 0 */
    932     CARD16 accelNumerator, accelDenominator;
    933     CARD16 threshold;
    934     CARD16 pad2;
    935     CARD32 pad3;
    936     CARD32 pad4;
    937     CARD32 pad5;
    938     CARD32 pad6;
    939     } xGetPointerControlReply;
    940 
    941 typedef struct {
    942     BYTE type;  /* X_Reply */
    943     BYTE pad1;
    944     CARD16 sequenceNumber;
    945     CARD32 length;  /* 0 */
    946     CARD16 timeout, interval;
    947     BOOL preferBlanking;
    948     BOOL allowExposures;
    949     CARD16 pad2;
    950     CARD32 pad3;
    951     CARD32 pad4;
    952     CARD32 pad5;
    953     CARD32 pad6;
    954     } xGetScreenSaverReply;
    955 
    956 typedef struct {
    957     BYTE type;  /* X_Reply */
    958     BOOL enabled;
    959     CARD16 sequenceNumber;
    960     CARD32 length;
    961     CARD16 nHosts;
    962     CARD16 pad1;
    963     CARD32 pad3;
    964     CARD32 pad4;
    965     CARD32 pad5;
    966     CARD32 pad6;
    967     CARD32 pad7;
    968     } xListHostsReply;
    969 
    970 
    971 
    973 
    974 /*****************************************************************
    975  * Xerror
    976  *    All errors  are 32 bytes
    977  *****************************************************************/
    978 
    979 typedef struct {
    980     BYTE type;                  /* X_Error */
    981     BYTE errorCode;
    982     CARD16 sequenceNumber;       /* the nth request from this client */
    983     CARD32 resourceID;
    984     CARD16 minorCode;
    985     CARD8 majorCode;
    986     BYTE pad1;
    987     CARD32 pad3;
    988     CARD32 pad4;
    989     CARD32 pad5;
    990     CARD32 pad6;
    991     CARD32 pad7;
    992 } xError;
    993 
    994 /*****************************************************************
    995  * xEvent
    996  *    All events are 32 bytes
    997  *****************************************************************/
    998 
    999 typedef struct _xEvent {
   1000     union {
   1001 	struct {
   1002 	    BYTE type;
   1003 	    BYTE detail;
   1004 	    CARD16 sequenceNumber;
   1005 	    } u;
   1006 	struct {
   1007 	    CARD32 pad00;
   1008 	    Time time;
   1009 	    Window root, event, child;
   1010 	    INT16 rootX, rootY, eventX, eventY;
   1011 	    KeyButMask state;
   1012 	    BOOL sameScreen;
   1013 	    BYTE pad1;
   1014 	} keyButtonPointer;
   1015 	struct {
   1016 	    CARD32 pad00;
   1017 	    Time time;
   1018 	    Window root, event, child;
   1019 	    INT16 rootX, rootY, eventX, eventY;
   1020 	    KeyButMask state;
   1021 	    BYTE mode; 			/* really XMode */
   1022 	    BYTE flags;		/* sameScreen and focus booleans, packed together */
   1023 #define ELFlagFocus        (1<<0)
   1024 #define ELFlagSameScreen   (1<<1)
   1025 	} enterLeave;
   1026 	struct {
   1027 	    CARD32 pad00;
   1028 	    Window window;
   1029 	    BYTE mode; 			/* really XMode */
   1030 	    BYTE pad1, pad2, pad3;
   1031 	} focus;
   1032 	struct {
   1033 	    CARD32 pad00;
   1034 	    Window window;
   1035 	    CARD16 x, y, width, height;
   1036 	    CARD16 count;
   1037 	    CARD16 pad2;
   1038 	} expose;
   1039 	struct {
   1040 	    CARD32 pad00;
   1041 	    Drawable drawable;
   1042 	    CARD16 x, y, width, height;
   1043 	    CARD16 minorEvent;
   1044 	    CARD16 count;
   1045 	    BYTE majorEvent;
   1046 	    BYTE pad1, pad2, pad3;
   1047 	} graphicsExposure;
   1048 	struct {
   1049 	    CARD32 pad00;
   1050 	    Drawable drawable;
   1051 	    CARD16 minorEvent;
   1052 	    BYTE majorEvent;
   1053 	    BYTE bpad;
   1054 	} noExposure;
   1055 	struct {
   1056 	    CARD32 pad00;
   1057 	    Window window;
   1058 	    CARD8 state;
   1059 	    BYTE pad1, pad2, pad3;
   1060 	} visibility;
   1061 	struct {
   1062 	    CARD32 pad00;
   1063 	    Window parent, window;
   1064 	    INT16 x, y;
   1065 	    CARD16 width, height, borderWidth;
   1066 	    BOOL override;
   1067 	    BYTE bpad;
   1068         } createNotify;
   1069 /*
   1070  * The event fields in the structures for DestroyNotify, UnmapNotify,
   1071  * MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify,
   1072  * must be at the same offset because server internal code is depending upon
   1073  * this to patch up the events before they are delivered.
   1074  * Also note that MapRequest, ConfigureRequest and CirculateRequest have
   1075  * the same offset for the event window.
   1076  */
   1077 	struct {
   1078 	    CARD32 pad00;
   1079 	    Window event, window;
   1080 	} destroyNotify;
   1081 	struct {
   1082 	    CARD32 pad00;
   1083 	    Window event, window;
   1084 	    BOOL fromConfigure;
   1085 	    BYTE pad1, pad2, pad3;
   1086         } unmapNotify;
   1087 	struct {
   1088 	    CARD32 pad00;
   1089 	    Window event, window;
   1090 	    BOOL override;
   1091 	    BYTE pad1, pad2, pad3;
   1092         } mapNotify;
   1093 	struct {
   1094 	    CARD32 pad00;
   1095 	    Window parent, window;
   1096         } mapRequest;
   1097 	struct {
   1098 	    CARD32 pad00;
   1099 	    Window event, window, parent;
   1100 	    INT16 x, y;
   1101 	    BOOL override;
   1102 	    BYTE pad1, pad2, pad3;
   1103 	} reparent;
   1104 	struct {
   1105 	    CARD32 pad00;
   1106 	    Window event, window, aboveSibling;
   1107 	    INT16 x, y;
   1108 	    CARD16 width, height, borderWidth;
   1109 	    BOOL override;
   1110 	    BYTE bpad;
   1111 	} configureNotify;
   1112 	struct {
   1113 	    CARD32 pad00;
   1114 	    Window parent, window, sibling;
   1115 	    INT16 x, y;
   1116 	    CARD16 width, height, borderWidth;
   1117 	    CARD16 valueMask;
   1118 	    CARD32 pad1;
   1119 	} configureRequest;
   1120 	struct {
   1121 	    CARD32 pad00;
   1122 	    Window event, window;
   1123 	    INT16 x, y;
   1124 	    CARD32 pad1, pad2, pad3, pad4;
   1125 	} gravity;
   1126 	struct {
   1127 	    CARD32 pad00;
   1128 	    Window window;
   1129 	    CARD16 width, height;
   1130 	} resizeRequest;
   1131 	struct {
   1132 /* The event field in the circulate record is really the parent when this
   1133    is used as a CirculateRequest instead of a CirculateNotify */
   1134 	    CARD32 pad00;
   1135 	    Window event, window, parent;
   1136 	    BYTE place;			/* Top or Bottom */
   1137 	    BYTE pad1, pad2, pad3;
   1138 	} circulate;
   1139 	struct {
   1140 	    CARD32 pad00;
   1141 	    Window window;
   1142 	    Atom atom;
   1143 	    Time time;
   1144 	    BYTE state;			/* NewValue or Deleted */
   1145 	    BYTE pad1;
   1146 	    CARD16 pad2;
   1147 	} property;
   1148 	struct {
   1149 	    CARD32 pad00;
   1150 	    Time time;
   1151 	    Window window;
   1152 	    Atom atom;
   1153 	} selectionClear;
   1154 	struct {
   1155 	    CARD32 pad00;
   1156 	    Time time;
   1157 	    Window owner, requestor;
   1158 	    Atom selection, target, property;
   1159 	} selectionRequest;
   1160 	struct {
   1161 	    CARD32 pad00;
   1162 	    Time time;
   1163 	    Window requestor;
   1164 	    Atom selection, target, property;
   1165 	} selectionNotify;
   1166 	struct {
   1167 	    CARD32 pad00;
   1168 	    Window window;
   1169 	    Colormap colormap;
   1170 #if defined(__cplusplus) || defined(c_plusplus)
   1171 	    BOOL c_new;
   1172 #else
   1173 	    BOOL new;
   1174 #endif
   1175 	    BYTE state;			/* Installed or UnInstalled */
   1176 	    BYTE pad1, pad2;
   1177 	} colormap;
   1178 	struct {
   1179 	    CARD32 pad00;
   1180 	    CARD8 request;
   1181 	    KeyCode firstKeyCode;
   1182 	    CARD8 count;
   1183 	    BYTE pad1;
   1184 	} mappingNotify;
   1185 	struct {
   1186 	    CARD32 pad00;
   1187 	    Window window;
   1188 	    union {
   1189 		struct {
   1190 		    Atom type;
   1191 		    INT32 longs0;
   1192 		    INT32 longs1;
   1193 		    INT32 longs2;
   1194 		    INT32 longs3;
   1195 		    INT32 longs4;
   1196 		} l;
   1197 		struct {
   1198 		    Atom type;
   1199 		    INT16 shorts0;
   1200 		    INT16 shorts1;
   1201 		    INT16 shorts2;
   1202 		    INT16 shorts3;
   1203 		    INT16 shorts4;
   1204 		    INT16 shorts5;
   1205 		    INT16 shorts6;
   1206 		    INT16 shorts7;
   1207 		    INT16 shorts8;
   1208 		    INT16 shorts9;
   1209 		} s;
   1210 		struct {
   1211 		    Atom type;
   1212 		    INT8 bytes[20];
   1213 		} b;
   1214 	    } u;
   1215 	} clientMessage;
   1216     } u;
   1217 } xEvent;
   1218 
   1219 /*********************************************************
   1220  *
   1221  * Generic event
   1222  *
   1223  * Those events are not part of the core protocol spec and can be used by
   1224  * various extensions.
   1225  * type is always GenericEvent
   1226  * extension is the minor opcode of the extension the event belongs to.
   1227  * evtype is the actual event type, unique __per extension__.
   1228  *
   1229  * GenericEvents can be longer than 32 bytes, with the length field
   1230  * specifying the number of 4 byte blocks after the first 32 bytes.
   1231  *
   1232  *
   1233  */
   1234 typedef struct
   1235 {
   1236     BYTE    type;
   1237     CARD8   extension;
   1238     CARD16  sequenceNumber;
   1239     CARD32  length;
   1240     CARD16  evtype;
   1241     CARD16  pad2;
   1242     CARD32  pad3;
   1243     CARD32  pad4;
   1244     CARD32  pad5;
   1245     CARD32  pad6;
   1246     CARD32  pad7;
   1247 } xGenericEvent;
   1248 
   1249 
   1250 
   1251 /* KeymapNotify events are not included in the above union because they
   1252    are different from all other events: they do not have a "detail"
   1253    or "sequenceNumber", so there is room for a 248-bit key mask. */
   1254 
   1255 typedef struct {
   1256     BYTE type;
   1257     BYTE map[31];
   1258     } xKeymapEvent;
   1259 
   1260 #define XEventSize (sizeof(xEvent))
   1261 
   1262 /* XReply is the union of all the replies above whose "fixed part"
   1263 fits in 32 bytes.  It does NOT include GetWindowAttributesReply,
   1264 QueryFontReply, QueryKeymapReply, or GetKeyboardControlReply
   1265 ListFontsWithInfoReply */
   1266 
   1267 typedef union {
   1268     xGenericReply generic;
   1269     xGetGeometryReply geom;
   1270     xQueryTreeReply tree;
   1271     xInternAtomReply atom;
   1272     xGetAtomNameReply atomName;
   1273     xGetPropertyReply property;
   1274     xListPropertiesReply listProperties;
   1275     xGetSelectionOwnerReply selection;
   1276     xGrabPointerReply grabPointer;
   1277     xGrabKeyboardReply grabKeyboard;
   1278     xQueryPointerReply pointer;
   1279     xGetMotionEventsReply motionEvents;
   1280     xTranslateCoordsReply coords;
   1281     xGetInputFocusReply inputFocus;
   1282     xQueryTextExtentsReply textExtents;
   1283     xListFontsReply fonts;
   1284     xGetFontPathReply fontPath;
   1285     xGetImageReply image;
   1286     xListInstalledColormapsReply colormaps;
   1287     xAllocColorReply allocColor;
   1288     xAllocNamedColorReply allocNamedColor;
   1289     xAllocColorCellsReply colorCells;
   1290     xAllocColorPlanesReply colorPlanes;
   1291     xQueryColorsReply colors;
   1292     xLookupColorReply lookupColor;
   1293     xQueryBestSizeReply bestSize;
   1294     xQueryExtensionReply extension;
   1295     xListExtensionsReply extensions;
   1296     xSetModifierMappingReply setModifierMapping;
   1297     xGetModifierMappingReply getModifierMapping;
   1298     xSetPointerMappingReply setPointerMapping;
   1299     xGetKeyboardMappingReply getKeyboardMapping;
   1300     xGetPointerMappingReply getPointerMapping;
   1301     xGetPointerControlReply pointerControl;
   1302     xGetScreenSaverReply screenSaver;
   1303     xListHostsReply hosts;
   1304     xError error;
   1305     xEvent event;
   1306 } xReply;
   1307 
   1308 
   1309 
   1311 /*****************************************************************
   1312  * REQUESTS
   1313  *****************************************************************/
   1314 
   1315 
   1316 /* Request structure */
   1317 
   1318 typedef struct _xReq {
   1319 	CARD8 reqType;
   1320 	CARD8 data;            /* meaning depends on request type */
   1321 	CARD16 length;         /* length in 4 bytes quantities
   1322 				  of whole request, including this header */
   1323 } xReq;
   1324 
   1325 /*****************************************************************
   1326  *  structures that follow request.
   1327  *****************************************************************/
   1328 
   1329 /* ResourceReq is used for any request which has a resource ID
   1330    (or Atom or Time) as its one and only argument.  */
   1331 
   1332 typedef struct {
   1333     CARD8 reqType;
   1334     BYTE pad;
   1335     CARD16 length;
   1336     CARD32 id;  /* a Window, Drawable, Font, GContext, Pixmap, etc. */
   1337     } xResourceReq;
   1338 
   1339 typedef struct {
   1340     CARD8 reqType;
   1341     CARD8 depth;
   1342     CARD16 length;
   1343     Window wid, parent;
   1344     INT16 x, y;
   1345     CARD16 width, height, borderWidth;
   1346 #if defined(__cplusplus) || defined(c_plusplus)
   1347     CARD16 c_class;
   1348 #else
   1349     CARD16 class;
   1350 #endif
   1351     VisualID visual;
   1352     CARD32 mask;
   1353 } xCreateWindowReq;
   1354 
   1355 typedef struct {
   1356     CARD8 reqType;
   1357     BYTE pad;
   1358     CARD16 length;
   1359     Window window;
   1360     CARD32 valueMask;
   1361 } xChangeWindowAttributesReq;
   1362 
   1363 typedef struct {
   1364     CARD8 reqType;
   1365     BYTE mode;
   1366     CARD16 length;
   1367     Window window;
   1368 } xChangeSaveSetReq;
   1369 
   1370 typedef struct {
   1371     CARD8 reqType;
   1372     BYTE pad;
   1373     CARD16 length;
   1374     Window window, parent;
   1375     INT16 x, y;
   1376 } xReparentWindowReq;
   1377 
   1378 typedef struct {
   1379     CARD8 reqType;
   1380     CARD8 pad;
   1381     CARD16 length;
   1382     Window window;
   1383     CARD16 mask;
   1384     CARD16 pad2;
   1385 } xConfigureWindowReq;
   1386 
   1387 typedef struct {
   1388     CARD8 reqType;
   1389     CARD8 direction;
   1390     CARD16 length;
   1391     Window window;
   1392 } xCirculateWindowReq;
   1393 
   1394 typedef struct {    /* followed by padded string */
   1395     CARD8 reqType;
   1396     BOOL onlyIfExists;
   1397     CARD16 length;
   1398     CARD16 nbytes;    /* number of bytes in string */
   1399     CARD16 pad;
   1400 } xInternAtomReq;
   1401 
   1402 typedef struct {
   1403     CARD8 reqType;
   1404     CARD8 mode;
   1405     CARD16 length;
   1406     Window window;
   1407     Atom property, type;
   1408     CARD8 format;
   1409     BYTE pad[3];
   1410     CARD32 nUnits;     /* length of stuff following, depends on format */
   1411 } xChangePropertyReq;
   1412 
   1413 typedef struct {
   1414     CARD8 reqType;
   1415     BYTE pad;
   1416     CARD16 length;
   1417     Window window;
   1418     Atom property;
   1419 } xDeletePropertyReq;
   1420 
   1421 typedef struct {
   1422     CARD8 reqType;
   1423 #if defined(__cplusplus) || defined(c_plusplus)
   1424     BOOL c_delete;
   1425 #else
   1426     BOOL delete;
   1427 #endif
   1428     CARD16 length;
   1429     Window window;
   1430     Atom property, type;
   1431     CARD32 longOffset;
   1432     CARD32 longLength;
   1433 } xGetPropertyReq;
   1434 
   1435 typedef struct {
   1436     CARD8 reqType;
   1437     BYTE pad;
   1438     CARD16 length;
   1439     Window window;
   1440     Atom selection;
   1441     Time time;
   1442 } xSetSelectionOwnerReq;
   1443 
   1444 typedef struct {
   1445     CARD8 reqType;
   1446     BYTE pad;
   1447     CARD16 length;
   1448     Window requestor;
   1449     Atom selection, target, property;
   1450     Time time;
   1451     } xConvertSelectionReq;
   1452 
   1453 typedef struct {
   1454     CARD8 reqType;
   1455     BOOL propagate;
   1456     CARD16 length;
   1457     Window destination;
   1458     CARD32 eventMask;
   1459     xEvent event;
   1460 } xSendEventReq;
   1461 
   1462 typedef struct {
   1463     CARD8 reqType;
   1464     BOOL ownerEvents;
   1465     CARD16 length;
   1466     Window grabWindow;
   1467     CARD16 eventMask;
   1468     BYTE pointerMode, keyboardMode;
   1469     Window confineTo;
   1470     Cursor cursor;
   1471     Time time;
   1472 } xGrabPointerReq;
   1473 
   1474 typedef struct {
   1475     CARD8 reqType;
   1476     BOOL ownerEvents;
   1477     CARD16 length;
   1478     Window grabWindow;
   1479     CARD16 eventMask;
   1480     BYTE pointerMode, keyboardMode;
   1481     Window confineTo;
   1482     Cursor cursor;
   1483     CARD8 button;
   1484     BYTE pad;
   1485     CARD16 modifiers;
   1486 } xGrabButtonReq;
   1487 
   1488 typedef struct {
   1489     CARD8 reqType;
   1490     CARD8 button;
   1491     CARD16 length;
   1492     Window grabWindow;
   1493     CARD16 modifiers;
   1494     CARD16 pad;
   1495 } xUngrabButtonReq;
   1496 
   1497 typedef struct {
   1498     CARD8 reqType;
   1499     BYTE pad;
   1500     CARD16 length;
   1501     Cursor cursor;
   1502     Time time;
   1503     CARD16 eventMask;
   1504     CARD16 pad2;
   1505 } xChangeActivePointerGrabReq;
   1506 
   1507 typedef struct {
   1508     CARD8 reqType;
   1509     BOOL ownerEvents;
   1510     CARD16 length;
   1511     Window grabWindow;
   1512     Time time;
   1513     BYTE pointerMode, keyboardMode;
   1514     CARD16 pad;
   1515 } xGrabKeyboardReq;
   1516 
   1517 typedef struct {
   1518     CARD8 reqType;
   1519     BOOL ownerEvents;
   1520     CARD16 length;
   1521     Window grabWindow;
   1522     CARD16 modifiers;
   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;
   1532     Window grabWindow;
   1533     CARD16 modifiers;
   1534     CARD16 pad;
   1535 } xUngrabKeyReq;
   1536 
   1537 typedef struct {
   1538     CARD8 reqType;
   1539     CARD8 mode;
   1540     CARD16 length;
   1541     Time time;
   1542 } xAllowEventsReq;
   1543 
   1544 typedef struct {
   1545     CARD8 reqType;
   1546     BYTE pad;
   1547     CARD16 length;
   1548     Window window;
   1549     Time start, stop;
   1550 } xGetMotionEventsReq;
   1551 
   1552 typedef struct {
   1553     CARD8 reqType;
   1554     BYTE pad;
   1555     CARD16 length;
   1556     Window srcWid, dstWid;
   1557     INT16 srcX, srcY;
   1558 } xTranslateCoordsReq;
   1559 
   1560 typedef struct {
   1561     CARD8 reqType;
   1562     BYTE pad;
   1563     CARD16 length;
   1564     Window srcWid, dstWid;
   1565     INT16 srcX, srcY;
   1566     CARD16 srcWidth, srcHeight;
   1567     INT16 dstX, dstY;
   1568 } xWarpPointerReq;
   1569 
   1570 typedef struct {
   1571     CARD8 reqType;
   1572     CARD8 revertTo;
   1573     CARD16 length;
   1574     Window focus;
   1575     Time time;
   1576 } xSetInputFocusReq;
   1577 
   1578 typedef struct {
   1579     CARD8 reqType;
   1580     BYTE pad;
   1581     CARD16 length;
   1582     Font fid;
   1583     CARD16 nbytes;
   1584     BYTE pad1, pad2;	/* string follows on word boundary */
   1585 } xOpenFontReq;
   1586 
   1587 typedef struct {
   1588     CARD8 reqType;
   1589     BOOL oddLength;
   1590     CARD16 length;
   1591     Font fid;
   1592     } xQueryTextExtentsReq;
   1593 
   1594 typedef struct {
   1595     CARD8 reqType;
   1596     BYTE pad;
   1597     CARD16 length;
   1598     CARD16 maxNames;
   1599     CARD16 nbytes;	/* 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;
   1608     CARD16 nFonts;
   1609     BYTE pad1, pad2;	/* LISTofSTRING8 follows on word boundary */
   1610 } xSetFontPathReq;
   1611 
   1612 typedef struct {
   1613     CARD8 reqType;
   1614     CARD8 depth;
   1615     CARD16 length;
   1616     Pixmap pid;
   1617     Drawable drawable;
   1618     CARD16 width, height;
   1619 } xCreatePixmapReq;
   1620 
   1621 typedef struct {
   1622     CARD8 reqType;
   1623     BYTE pad;
   1624     CARD16 length;
   1625     GContext gc;
   1626     Drawable drawable;
   1627     CARD32 mask;
   1628 } xCreateGCReq;
   1629 
   1630 typedef struct {
   1631     CARD8 reqType;
   1632     BYTE pad;
   1633     CARD16 length;
   1634     GContext gc;
   1635     CARD32 mask;
   1636 } xChangeGCReq;
   1637 
   1638 typedef struct {
   1639     CARD8 reqType;
   1640     BYTE pad;
   1641     CARD16 length;
   1642     GContext srcGC, dstGC;
   1643     CARD32 mask;
   1644 } xCopyGCReq;
   1645 
   1646 typedef struct {
   1647     CARD8 reqType;
   1648     BYTE pad;
   1649     CARD16 length;
   1650     GContext gc;
   1651     CARD16 dashOffset;
   1652     CARD16 nDashes;	/* length LISTofCARD8 of values following */
   1653 } xSetDashesReq;
   1654 
   1655 typedef struct {
   1656     CARD8 reqType;
   1657     BYTE ordering;
   1658     CARD16 length;
   1659     GContext gc;
   1660     INT16 xOrigin, yOrigin;
   1661 } xSetClipRectanglesReq;
   1662 
   1663 typedef struct {
   1664     CARD8 reqType;
   1665     BOOL exposures;
   1666     CARD16 length;
   1667     Window window;
   1668     INT16 x, y;
   1669     CARD16 width, height;
   1670 } xClearAreaReq;
   1671 
   1672 typedef struct {
   1673     CARD8 reqType;
   1674     BYTE pad;
   1675     CARD16 length;
   1676     Drawable srcDrawable, dstDrawable;
   1677     GContext gc;
   1678     INT16 srcX, srcY, dstX, dstY;
   1679     CARD16 width, height;
   1680 } xCopyAreaReq;
   1681 
   1682 typedef struct {
   1683     CARD8 reqType;
   1684     BYTE pad;
   1685     CARD16 length;
   1686     Drawable srcDrawable, dstDrawable;
   1687     GContext gc;
   1688     INT16 srcX, srcY, dstX, dstY;
   1689     CARD16 width, height;
   1690     CARD32 bitPlane;
   1691 } xCopyPlaneReq;
   1692 
   1693 typedef struct {
   1694     CARD8 reqType;
   1695     BYTE coordMode;
   1696     CARD16 length;
   1697     Drawable drawable;
   1698     GContext gc;
   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;
   1709     Drawable drawable;
   1710     GContext gc;
   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;
   1722     Drawable drawable;
   1723     GContext gc;
   1724     BYTE shape;
   1725     BYTE coordMode;
   1726     CARD16 pad1;
   1727 } xFillPolyReq;
   1728 
   1729 
   1730 typedef struct _PutImageReq {
   1731     CARD8 reqType;
   1732     CARD8 format;
   1733     CARD16 length;
   1734     Drawable drawable;
   1735     GContext gc;
   1736     CARD16 width, height;
   1737     INT16 dstX, dstY;
   1738     CARD8 leftPad;
   1739     CARD8 depth;
   1740     CARD16 pad;
   1741 } xPutImageReq;
   1742 
   1743 typedef struct {
   1744     CARD8 reqType;
   1745     CARD8 format;
   1746     CARD16 length;
   1747     Drawable drawable;
   1748     INT16 x, y;
   1749     CARD16 width, height;
   1750     CARD32 planeMask;
   1751 } xGetImageReq;
   1752 
   1753 /* the following used by PolyText8 and PolyText16 */
   1754 
   1755 typedef struct {
   1756     CARD8 reqType;
   1757     CARD8 pad;
   1758     CARD16 length;
   1759     Drawable drawable;
   1760     GContext gc;
   1761     INT16 x, y;		/* 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;
   1771     Drawable drawable;
   1772     GContext gc;
   1773     INT16 x, y;
   1774 } xImageTextReq;
   1775 
   1776 typedef xImageTextReq xImageText8Req;
   1777 typedef xImageTextReq xImageText16Req;
   1778 
   1779 typedef struct {
   1780     CARD8 reqType;
   1781     BYTE alloc;
   1782     CARD16 length;
   1783     Colormap mid;
   1784     Window window;
   1785     VisualID visual;
   1786 } xCreateColormapReq;
   1787 
   1788 typedef struct {
   1789     CARD8 reqType;
   1790     BYTE pad;
   1791     CARD16 length;
   1792     Colormap mid;
   1793     Colormap srcCmap;
   1794 } xCopyColormapAndFreeReq;
   1795 
   1796 typedef struct {
   1797     CARD8 reqType;
   1798     BYTE pad;
   1799     CARD16 length;
   1800     Colormap cmap;
   1801     CARD16 red, green, blue;
   1802     CARD16 pad2;
   1803 } xAllocColorReq;
   1804 
   1805 typedef struct {
   1806     CARD8 reqType;
   1807     BYTE pad;
   1808     CARD16 length;
   1809     Colormap cmap;
   1810     CARD16 nbytes;	/* followed by structure */
   1811     BYTE pad1, pad2;
   1812 } xAllocNamedColorReq;
   1813 
   1814 typedef struct {
   1815     CARD8 reqType;
   1816     BOOL contiguous;
   1817     CARD16 length;
   1818     Colormap cmap;
   1819     CARD16 colors, planes;
   1820 } xAllocColorCellsReq;
   1821 
   1822 typedef struct {
   1823     CARD8 reqType;
   1824     BOOL contiguous;
   1825     CARD16 length;
   1826     Colormap cmap;
   1827     CARD16 colors, red, green, blue;
   1828 } xAllocColorPlanesReq;
   1829 
   1830 typedef struct {
   1831     CARD8 reqType;
   1832     BYTE pad;
   1833     CARD16 length;
   1834     Colormap cmap;
   1835     CARD32 planeMask;
   1836 } xFreeColorsReq;
   1837 
   1838 typedef struct {
   1839     CARD8 reqType;
   1840     BYTE pad;
   1841     CARD16 length;
   1842     Colormap cmap;
   1843 } xStoreColorsReq;
   1844 
   1845 typedef struct {
   1846     CARD8 reqType;
   1847     CARD8 flags;   /* DoRed, DoGreen, DoBlue, as in xColorItem */
   1848     CARD16 length;
   1849     Colormap cmap;
   1850     CARD32 pixel;
   1851     CARD16 nbytes;  /* 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;
   1859     Colormap cmap;
   1860 } xQueryColorsReq;
   1861 
   1862 typedef struct {    /* followed  by string of length len */
   1863     CARD8 reqType;
   1864     BYTE pad;
   1865     CARD16 length;
   1866     Colormap cmap;
   1867     CARD16 nbytes;  /* 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;
   1875     Cursor cid;
   1876     Pixmap source, mask;
   1877     CARD16 foreRed, foreGreen, foreBlue;
   1878     CARD16 backRed, backGreen, backBlue;
   1879     CARD16 x, y;
   1880 } xCreateCursorReq;
   1881 
   1882 typedef struct {
   1883     CARD8 reqType;
   1884     BYTE pad;
   1885     CARD16 length;
   1886     Cursor cid;
   1887     Font source, mask;
   1888     CARD16 sourceChar, maskChar;
   1889     CARD16 foreRed, foreGreen, foreBlue;
   1890     CARD16 backRed, backGreen, backBlue;
   1891 } xCreateGlyphCursorReq;
   1892 
   1893 typedef struct {
   1894     CARD8 reqType;
   1895     BYTE pad;
   1896     CARD16 length;
   1897     Cursor cursor;
   1898     CARD16 foreRed, foreGreen, foreBlue;
   1899     CARD16 backRed, backGreen, backBlue;
   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;
   1910     Drawable drawable;
   1911     CARD16 width, height;
   1912 } xQueryBestSizeReq;
   1913 
   1914 typedef struct {
   1915     CARD8 reqType;
   1916     BYTE pad;
   1917     CARD16 length;
   1918     CARD16 nbytes;	/* 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;
   1926 } xSetModifierMappingReq;
   1927 
   1928 typedef struct {
   1929     CARD8 reqType;
   1930     CARD8 nElts;	/* how many elements in the map */
   1931     CARD16 length;
   1932 } xSetPointerMappingReq;
   1933 
   1934 typedef struct {
   1935     CARD8 reqType;
   1936     BYTE pad;
   1937     CARD16 length;
   1938     KeyCode firstKeyCode;
   1939     CARD8 count;
   1940     CARD16 pad1;
   1941 } xGetKeyboardMappingReq;
   1942 
   1943 typedef struct {
   1944     CARD8 reqType;
   1945     CARD8 keyCodes;
   1946     CARD16 length;
   1947     KeyCode firstKeyCode;
   1948     CARD8 keySymsPerKeyCode;
   1949     CARD16 pad1;
   1950 } xChangeKeyboardMappingReq;
   1951 
   1952 typedef struct {
   1953     CARD8 reqType;
   1954     BYTE pad;
   1955     CARD16 length;
   1956     CARD32 mask;
   1957 } xChangeKeyboardControlReq;
   1958 
   1959 typedef struct {
   1960     CARD8 reqType;
   1961     INT8 percent;  /* -100 to 100 */
   1962     CARD16 length;
   1963 } xBellReq;
   1964 
   1965 typedef struct {
   1966     CARD8 reqType;
   1967     BYTE pad;
   1968     CARD16 length;
   1969     INT16 accelNum, accelDenum;
   1970     INT16 threshold;
   1971     BOOL doAccel, doThresh;
   1972 } xChangePointerControlReq;
   1973 
   1974 typedef struct {
   1975     CARD8 reqType;
   1976     BYTE pad;
   1977     CARD16 length;
   1978     INT16 timeout, interval;
   1979     BYTE preferBlank, allowExpose;
   1980     CARD16 pad2;
   1981 } xSetScreenSaverReq;
   1982 
   1983 typedef struct {
   1984     CARD8 reqType;
   1985     BYTE mode;
   1986     CARD16 length;
   1987     CARD8 hostFamily;
   1988     BYTE pad;
   1989     CARD16 hostLength;
   1990 } xChangeHostsReq;
   1991 
   1992 typedef struct {
   1993     CARD8 reqType;
   1994     BYTE pad;
   1995     CARD16 length;
   1996     } xListHostsReq;
   1997 
   1998 typedef struct {
   1999     CARD8 reqType;
   2000     BYTE mode;
   2001     CARD16 length;
   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;
   2012     Window window;
   2013     CARD16 nAtoms;
   2014     INT16 nPositions;
   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