/* Definitions for the X window system used by server and c bindings */
* This packet-construction scheme makes the following assumptions:
* 1. The compiler is able
* to generate code which addresses one- and two-byte quantities.
* In the worst case, this would be done with bit-fields. If bit-fields
* are used it may be necessary to reorder the request fields in this file,
* depending on the order in which the machine assigns bit fields to
* machine words. There may also be a problem with sign extension,
* as K+R specify that bitfields are always unsigned.
* 2. 2- and 4-byte fields in packet structures must be ordered by hand
* such that they are naturally-aligned, so that no compiler will ever
* 3. All packets are hand-padded to a multiple of 4 bytes, for
/***********************************************************
Copyright 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
******************************************************************/
#include <X11/Xprotostr.h>
* Define constants for the sizes of the network packets. The sz_ prefix is
* used instead of something more descriptive so that the symbols are no more
* than 32 characters in length (which causes problems for some compilers).
#define sz_xConnClientPrefix 12
#define sz_xConnSetupPrefix 8
#define sz_xPixmapFormat 8
#define sz_xVisualType 24
#define sz_xWindowRoot 40
#define sz_xGenericReply 32
#define sz_xGetWindowAttributesReply 44
#define sz_xGetGeometryReply 32
#define sz_xQueryTreeReply 32
#define sz_xInternAtomReply 32
#define sz_xGetAtomNameReply 32
#define sz_xGetPropertyReply 32
#define sz_xListPropertiesReply 32
#define sz_xGetSelectionOwnerReply 32
#define sz_xGrabPointerReply 32
#define sz_xQueryPointerReply 32
#define sz_xGetMotionEventsReply 32
#define sz_xTranslateCoordsReply 32
#define sz_xGetInputFocusReply 32
#define sz_xQueryKeymapReply 40
#define sz_xQueryFontReply 60
#define sz_xQueryTextExtentsReply 32
#define sz_xListFontsReply 32
#define sz_xGetFontPathReply 32
#define sz_xGetImageReply 32
#define sz_xListInstalledColormapsReply 32
#define sz_xAllocColorReply 32
#define sz_xAllocNamedColorReply 32
#define sz_xAllocColorCellsReply 32
#define sz_xAllocColorPlanesReply 32
#define sz_xQueryColorsReply 32
#define sz_xLookupColorReply 32
#define sz_xQueryBestSizeReply 32
#define sz_xQueryExtensionReply 32
#define sz_xListExtensionsReply 32
#define sz_xSetMappingReply 32
#define sz_xGetKeyboardControlReply 52
#define sz_xGetPointerControlReply 32
#define sz_xGetScreenSaverReply 32
#define sz_xListHostsReply 32
#define sz_xSetModifierMappingReply 32
#define sz_xKeymapEvent 32
#define sz_xResourceReq 8
#define sz_xCreateWindowReq 32
#define sz_xChangeWindowAttributesReq 12
#define sz_xChangeSaveSetReq 8
#define sz_xReparentWindowReq 16
#define sz_xConfigureWindowReq 12
#define sz_xCirculateWindowReq 8
#define sz_xInternAtomReq 8
#define sz_xChangePropertyReq 24
#define sz_xDeletePropertyReq 12
#define sz_xGetPropertyReq 24
#define sz_xSetSelectionOwnerReq 16
#define sz_xConvertSelectionReq 24
#define sz_xSendEventReq 44
#define sz_xGrabPointerReq 24
#define sz_xGrabButtonReq 24
#define sz_xUngrabButtonReq 12
#define sz_xChangeActivePointerGrabReq 16
#define sz_xGrabKeyboardReq 16
#define sz_xGrabKeyReq 16
#define sz_xUngrabKeyReq 12
#define sz_xAllowEventsReq 8
#define sz_xGetMotionEventsReq 16
#define sz_xTranslateCoordsReq 16
#define sz_xWarpPointerReq 24
#define sz_xSetInputFocusReq 12
#define sz_xOpenFontReq 12
#define sz_xQueryTextExtentsReq 8
#define sz_xListFontsReq 8
#define sz_xSetFontPathReq 8
#define sz_xCreatePixmapReq 16
#define sz_xCreateGCReq 16
#define sz_xChangeGCReq 12
#define sz_xSetDashesReq 12
#define sz_xSetClipRectanglesReq 12
#define sz_xCopyAreaReq 28
#define sz_xCopyPlaneReq 32
#define sz_xPolyPointReq 12
#define sz_xPolySegmentReq 12
#define sz_xFillPolyReq 16
#define sz_xPutImageReq 24
#define sz_xGetImageReq 20
#define sz_xPolyTextReq 16
#define sz_xImageTextReq 16
#define sz_xCreateColormapReq 16
#define sz_xCopyColormapAndFreeReq 12
#define sz_xAllocColorReq 16
#define sz_xAllocNamedColorReq 12
#define sz_xAllocColorCellsReq 12
#define sz_xAllocColorPlanesReq 16
#define sz_xFreeColorsReq 12
#define sz_xStoreColorsReq 8
#define sz_xStoreNamedColorReq 16
#define sz_xQueryColorsReq 8
#define sz_xLookupColorReq 12
#define sz_xCreateCursorReq 32
#define sz_xCreateGlyphCursorReq 32
#define sz_xRecolorCursorReq 20
#define sz_xQueryBestSizeReq 12
#define sz_xQueryExtensionReq 8
#define sz_xChangeKeyboardControlReq 8
#define sz_xChangePointerControlReq 12
#define sz_xSetScreenSaverReq 12
#define sz_xChangeHostsReq 8
#define sz_xListHostsReq 4
#define sz_xChangeModeReq 4
#define sz_xRotatePropertiesReq 12
#define sz_xGrabKeyboardReply 32
#define sz_xListFontsWithInfoReply 60
#define sz_xSetPointerMappingReply 32
#define sz_xGetKeyboardMappingReply 32
#define sz_xGetPointerMappingReply 32
#define sz_xGetModifierMappingReply 32
#define sz_xListFontsWithInfoReq 8
#define sz_xPolyLineReq 12
#define sz_xPolyArcReq 12
#define sz_xPolyRectangleReq 12
#define sz_xPolyFillRectangleReq 12
#define sz_xPolyFillArcReq 12
#define sz_xPolyText8Req 16
#define sz_xPolyText16Req 16
#define sz_xImageText8Req 16
#define sz_xImageText16Req 16
#define sz_xSetPointerMappingReq 4
#define sz_xForceScreenSaverReq 4
#define sz_xSetCloseDownModeReq 4
#define sz_xClearAreaReq 16
#define sz_xSetAccessControlReq 4
#define sz_xGetKeyboardMappingReq 8
#define sz_xSetModifierMappingReq 4
#define sz_xPropIconSize 24
#define sz_xChangeKeyboardMappingReq 8
/* For the purpose of the structure definitions in this file,
we must redefine the following types in terms of Xmd.h's types, which may
include bit fields. All of these are #undef'd at the end of this file,
restoring the definitions in X.h. */
#define X_TCP_PORT 6000 /* add display number */
typedef CARD16 KeyButMask;
Connection setup structures. See Chapter 8: Connection Setup
of the X Window System Protocol specification for details.
/* Client initiates handshake with this data, followed by the strings
* for the auth protocol & data.
CARD16 majorVersion, minorVersion;
CARD16 nbytesAuthProto; /* Authorization protocol */
CARD16 nbytesAuthString; /* Authorization string */
/* Server response to xConnClientPrefix.
* If success == Success, this is followed by xConnSetup and
* numRoots xWindowRoot structs.
* If success == Failure, this is followed by a reason string.
* The protocol also defines a case of success == Authenticate, but
* that doesn't seem to have ever been implemented by the X Consortium.
BYTE lengthReason; /*num bytes in string following if failure */
CARD16 length; /* 1/4 additional bytes in setup info */
CARD16 nbytesVendor; /* number of bytes in vendor string */
CARD8 numRoots; /* number of roots structs to follow */
CARD8 numFormats; /* number of pixmap formats */
CARD8 imageByteOrder; /* LSBFirst, MSBFirst */
CARD8 bitmapBitOrder; /* LeastSignificant, MostSign...*/
CARD8 bitmapScanlineUnit, /* 8, 16, 32 */
bitmapScanlinePad; /* 8, 16, 32 */
KeyCode minKeyCode, maxKeyCode;
CARD16 nVisuals; /* number of xVisualType structures following */
#if defined(__cplusplus) || defined(c_plusplus)
CARD32 redMask, greenMask, blueMask;
Colormap defaultColormap;
CARD32 whitePixel, blackPixel;
CARD16 pixWidth, pixHeight;
CARD16 mmWidth, mmHeight;
CARD16 minInstalledMaps, maxInstalledMaps;
CARD8 nDepths; /* number of xDepth structures following */
/*****************************************************************
* Structures needed for replies
*****************************************************************/
/* Used in GetMotionEvents */
* non-aligned big-endian font ID follows this struct
typedef struct { /* followed by string */
CARD8 len; /* number of *characters* in string, or FontChange (255)
for font change, or 0 if just delta given */
CARD8 flags; /* DoRed, DoGreen, DoBlue booleans */
CARD16 red, green, blue, pad;
* meant to be 32 byte quantity
/* GenericReply is the common format of all replies. The "data" items
are specific to each individual reply type. */
BYTE data1; /* depends on reply type */
CARD16 sequenceNumber; /* of last request received by server */
CARD32 length; /* 4 byte quantities beyond size of GenericReply */
/* Individual reply formats. */
CARD32 length; /* NOT 0; this is an extra-large reply */
#if defined(__cplusplus) || defined(c_plusplus)
CARD16 doNotPropagateMask;
} xGetWindowAttributesReply;