Xproto.h revision cabde247f900dcf6e58d009bbdd15099c028c6fc
/* Definitions for the X window system used by server and c bindings */
/*
* This packet-construction scheme makes the following assumptions:
*
* 1. The compiler is able
* to generate code which addresses one- and two-byte quantities.
* In the worst case, this would be done with bit-fields. If bit-fields
* are used it may be necessary to reorder the request fields in this file,
* depending on the order in which the machine assigns bit fields to
* machine words. There may also be a problem with sign extension,
* as K+R specify that bitfields are always unsigned.
*
* 2. 2- and 4-byte fields in packet structures must be ordered by hand
* such that they are naturally-aligned, so that no compiler will ever
* insert padding bytes.
*
* 3. All packets are hand-padded to a multiple of 4 bytes, for
* the same reason.
*/
#ifndef XPROTO_H
#define XPROTO_H
/***********************************************************
Copyright 1987, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.
Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved
Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
******************************************************************/
#include <X11/Xprotostr.h>
/*
* Define constants for the sizes of the network packets. The sz_ prefix is
* used instead of something more descriptive so that the symbols are no more
* than 32 characters in length (which causes problems for some compilers).
*/
#define sz_xSegment 8
#define sz_xPoint 4
#define sz_xRectangle 8
#define sz_xArc 12
#define sz_xConnClientPrefix 12
#define sz_xConnSetupPrefix 8
#define sz_xConnSetup 32
#define sz_xPixmapFormat 8
#define sz_xDepth 8
#define sz_xVisualType 24
#define sz_xWindowRoot 40
#define sz_xTimecoord 8
#define sz_xHostEntry 4
#define sz_xCharInfo 12
#define sz_xFontProp 8
#define sz_xTextElt 2
#define sz_xColorItem 12
#define sz_xrgb 8
#define sz_xGenericReply 32
#define sz_xGetWindowAttributesReply 44
#define sz_xGetGeometryReply 32
#define sz_xQueryTreeReply 32
#define sz_xInternAtomReply 32
#define sz_xGetAtomNameReply 32
#define sz_xGetPropertyReply 32
#define sz_xListPropertiesReply 32
#define sz_xGetSelectionOwnerReply 32
#define sz_xGrabPointerReply 32
#define sz_xQueryPointerReply 32
#define sz_xGetMotionEventsReply 32
#define sz_xTranslateCoordsReply 32
#define sz_xGetInputFocusReply 32
#define sz_xQueryKeymapReply 40
#define sz_xQueryFontReply 60
#define sz_xQueryTextExtentsReply 32
#define sz_xListFontsReply 32
#define sz_xGetFontPathReply 32
#define sz_xGetImageReply 32
#define sz_xListInstalledColormapsReply 32
#define sz_xAllocColorReply 32
#define sz_xAllocNamedColorReply 32
#define sz_xAllocColorCellsReply 32
#define sz_xAllocColorPlanesReply 32
#define sz_xQueryColorsReply 32
#define sz_xLookupColorReply 32
#define sz_xQueryBestSizeReply 32
#define sz_xQueryExtensionReply 32
#define sz_xListExtensionsReply 32
#define sz_xSetMappingReply 32
#define sz_xGetKeyboardControlReply 52
#define sz_xGetPointerControlReply 32
#define sz_xGetScreenSaverReply 32
#define sz_xListHostsReply 32
#define sz_xSetModifierMappingReply 32
#define sz_xError 32
#define sz_xEvent 32
#define sz_xKeymapEvent 32
#define sz_xReq 4
#define sz_xResourceReq 8
#define sz_xCreateWindowReq 32
#define sz_xChangeWindowAttributesReq 12
#define sz_xChangeSaveSetReq 8
#define sz_xReparentWindowReq 16
#define sz_xConfigureWindowReq 12
#define sz_xCirculateWindowReq 8
#define sz_xInternAtomReq 8
#define sz_xChangePropertyReq 24
#define sz_xDeletePropertyReq 12
#define sz_xGetPropertyReq 24
#define sz_xSetSelectionOwnerReq 16
#define sz_xConvertSelectionReq 24
#define sz_xSendEventReq 44
#define sz_xGrabPointerReq 24
#define sz_xGrabButtonReq 24
#define sz_xUngrabButtonReq 12
#define sz_xChangeActivePointerGrabReq 16
#define sz_xGrabKeyboardReq 16
#define sz_xGrabKeyReq 16
#define sz_xUngrabKeyReq 12
#define sz_xAllowEventsReq 8
#define sz_xGetMotionEventsReq 16
#define sz_xTranslateCoordsReq 16
#define sz_xWarpPointerReq 24
#define sz_xSetInputFocusReq 12
#define sz_xOpenFontReq 12
#define sz_xQueryTextExtentsReq 8
#define sz_xListFontsReq 8
#define sz_xSetFontPathReq 8
#define sz_xCreatePixmapReq 16
#define sz_xCreateGCReq 16
#define sz_xChangeGCReq 12
#define sz_xCopyGCReq 16
#define sz_xSetDashesReq 12
#define sz_xSetClipRectanglesReq 12
#define sz_xCopyAreaReq 28
#define sz_xCopyPlaneReq 32
#define sz_xPolyPointReq 12
#define sz_xPolySegmentReq 12
#define sz_xFillPolyReq 16
#define sz_xPutImageReq 24
#define sz_xGetImageReq 20
#define sz_xPolyTextReq 16
#define sz_xImageTextReq 16
#define sz_xCreateColormapReq 16
#define sz_xCopyColormapAndFreeReq 12
#define sz_xAllocColorReq 16
#define sz_xAllocNamedColorReq 12
#define sz_xAllocColorCellsReq 12
#define sz_xAllocColorPlanesReq 16
#define sz_xFreeColorsReq 12
#define sz_xStoreColorsReq 8
#define sz_xStoreNamedColorReq 16
#define sz_xQueryColorsReq 8
#define sz_xLookupColorReq 12
#define sz_xCreateCursorReq 32
#define sz_xCreateGlyphCursorReq 32
#define sz_xRecolorCursorReq 20
#define sz_xQueryBestSizeReq 12
#define sz_xQueryExtensionReq 8
#define sz_xChangeKeyboardControlReq 8
#define sz_xBellReq 4
#define sz_xChangePointerControlReq 12
#define sz_xSetScreenSaverReq 12
#define sz_xChangeHostsReq 8
#define sz_xListHostsReq 4
#define sz_xChangeModeReq 4
#define sz_xRotatePropertiesReq 12
#define sz_xReply 32
#define sz_xGrabKeyboardReply 32
#define sz_xListFontsWithInfoReply 60
#define sz_xSetPointerMappingReply 32
#define sz_xGetKeyboardMappingReply 32
#define sz_xGetPointerMappingReply 32
#define sz_xGetModifierMappingReply 32
#define sz_xListFontsWithInfoReq 8
#define sz_xPolyLineReq 12
#define sz_xPolyArcReq 12
#define sz_xPolyRectangleReq 12
#define sz_xPolyFillRectangleReq 12
#define sz_xPolyFillArcReq 12
#define sz_xPolyText8Req 16
#define sz_xPolyText16Req 16
#define sz_xImageText8Req 16
#define sz_xImageText16Req 16
#define sz_xSetPointerMappingReq 4
#define sz_xForceScreenSaverReq 4
#define sz_xSetCloseDownModeReq 4
#define sz_xClearAreaReq 16
#define sz_xSetAccessControlReq 4
#define sz_xGetKeyboardMappingReq 8
#define sz_xSetModifierMappingReq 4
#define sz_xPropIconSize 24
#define sz_xChangeKeyboardMappingReq 8
/* For the purpose of the structure definitions in this file,
we must redefine the following types in terms of Xmd.h's types, which may
include bit fields. All of these are #undef'd at the end of this file,
restoring the definitions in X.h. */
#define xTrue 1
#define xFalse 0
typedef CARD16 KeyButMask;
/*****************
connection setup structure. This is followed by
numRoots xWindowRoot structs.
*****************/
typedef struct {
typedef struct {
typedef struct {
bitmapScanlinePad; /* 8, 16, 32 */
} xConnSetup;
typedef struct {
/* window root */
typedef struct {
} xDepth;
typedef struct {
#if defined(__cplusplus) || defined(c_plusplus)
#else
#endif
} xVisualType;
typedef struct {
} xWindowRoot;
/*****************************************************************
* Structure Defns
* Structures needed for replies
*****************************************************************/
/* Used in GetMotionEvents */
typedef struct {
} xTimecoord;
typedef struct {
} xHostEntry;
typedef struct {
} xCharInfo;
typedef struct {
} xFontProp;
/*
* non-aligned big-endian font ID follows this struct
*/
typedef struct { /* followed by string */
for font change, or 0 if just delta given */
} xTextElt;
typedef struct {
} xColorItem;
typedef struct {
} xrgb;
/*****************
* XRep:
* meant to be 32 byte quantity
*****************/
/* GenericReply is the common format of all replies. The "data" items
are specific to each individual reply type. */
typedef struct {
/* Individual reply formats. */
typedef struct {
#if defined(__cplusplus) || defined(c_plusplus)
#else
#endif
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef xGrabPointerReply xGrabKeyboardReply;
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
/* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */
typedef struct _xQueryFontReply {
#ifndef WORD64
#endif
#ifndef WORD64
#endif
typedef struct {
typedef struct {
/* Warning: this MUST match (up to component renaming) xQueryFontReply */
typedef struct {
#ifndef WORD64
#endif
#ifndef WORD64
#endif
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef xSetMappingReply xSetPointerMappingReply;
typedef xSetMappingReply xSetModifierMappingReply;
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
/*****************************************************************
* Xerror
* All errors are 32 bytes
*****************************************************************/
typedef struct {
} xError;
/*****************************************************************
* xEvent
* All events are 32 bytes
*****************************************************************/
typedef struct _xEvent {
union {
struct {
} u;
struct {
struct {
#define ELFlagFocus (1<<0)
} enterLeave;
struct {
} focus;
struct {
} expose;
struct {
struct {
} noExposure;
struct {
} visibility;
struct {
} createNotify;
/*
* The event fields in the structures for DestroyNotify, UnmapNotify,
* MapNotify, ReparentNotify, ConfigureNotify, CirculateNotify, GravityNotify,
* must be at the same offset because server internal code is depending upon
* this to patch up the events before they are delivered.
* Also note that MapRequest, ConfigureRequest and CirculateRequest have
* the same offset for the event window.
*/
struct {
struct {
} unmapNotify;
struct {
} mapNotify;
struct {
} mapRequest;
struct {
} reparent;
struct {
struct {
struct {
} gravity;
struct {
struct {
/* The event field in the circulate record is really the parent when this
is used as a CirculateRequest instead of a CirculateNotify */
} circulate;
struct {
} property;
struct {
struct {
struct {
struct {
#if defined(__cplusplus) || defined(c_plusplus)
#else
#endif
} colormap;
struct {
struct {
union {
struct {
} l;
struct {
} s;
struct {
} b;
} u;
} u;
} xEvent;
/*********************************************************
*
* Generic event
*
* Those events are not part of the core protocol spec and can be used by
* various extensions.
* type is always GenericEvent
* extension is the minor opcode of the extension the event belongs to.
* evtype is the actual event type, unique __per extension__.
*
* GenericEvents can be longer than 32 bytes, with the length field
* specifying the number of 4 byte blocks after the first 32 bytes.
*
*
*/
typedef struct
{
/* KeymapNotify events are not included in the above union because they
are different from all other events: they do not have a "detail"
or "sequenceNumber", so there is room for a 248-bit key mask. */
typedef struct {
} xKeymapEvent;
#define XEventSize (sizeof(xEvent))
/* XReply is the union of all the replies above whose "fixed part"
fits in 32 bytes. It does NOT include GetWindowAttributesReply,
QueryFontReply, QueryKeymapReply, or GetKeyboardControlReply
ListFontsWithInfoReply */
typedef union {
} xReply;
/*****************************************************************
* REQUESTS
*****************************************************************/
/* Request structure */
typedef struct _xReq {
of whole request, including this header */
} xReq;
/*****************************************************************
* structures that follow request.
*****************************************************************/
/* ResourceReq is used for any request which has a resource ID
(or Atom or Time) as its one and only argument. */
typedef struct {
} xResourceReq;
typedef struct {
#if defined(__cplusplus) || defined(c_plusplus)
#else
#endif
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct { /* followed by padded string */
typedef struct {
typedef struct {
typedef struct {
#if defined(__cplusplus) || defined(c_plusplus)
#else
#endif
typedef struct {
typedef struct {
typedef struct {
#ifdef WORD64
/* the structure should have been quad-aligned */
#else
#endif /* WORD64 */
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
} xGrabKeyReq;
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
} xOpenFontReq;
typedef struct {
typedef struct {
typedef xListFontsReq xListFontsWithInfoReq;
typedef struct {
typedef struct {
typedef struct {
} xCreateGCReq;
typedef struct {
} xChangeGCReq;
typedef struct {
} xCopyGCReq;
typedef struct {
typedef struct {
typedef struct {
typedef struct {
} xCopyAreaReq;
typedef struct {
typedef struct {
/* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */
typedef struct {
typedef xPolySegmentReq xPolyArcReq;
typedef xPolySegmentReq xPolyRectangleReq;
typedef xPolySegmentReq xPolyFillRectangleReq;
typedef xPolySegmentReq xPolyFillArcReq;
typedef struct _FillPolyReq {
} xFillPolyReq;
typedef struct _PutImageReq {
} xPutImageReq;
typedef struct {
} xGetImageReq;
/* the following used by PolyText8 and PolyText16 */
typedef struct {
} xPolyTextReq;
typedef xPolyTextReq xPolyText8Req;
typedef xPolyTextReq xPolyText16Req;
typedef struct {
typedef xImageTextReq xImageText8Req;
typedef xImageTextReq xImageText16Req;
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct { /* followed by string of length len */
typedef struct {
typedef struct {
typedef struct {
typedef struct {
#if defined(__cplusplus) || defined(c_plusplus)
#else
#endif
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
} xBellReq;
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef struct {
typedef xChangeModeReq xSetAccessControlReq;
typedef xChangeModeReq xSetCloseDownModeReq;
typedef xChangeModeReq xForceScreenSaverReq;
typedef struct { /* followed by LIST of ATOM */
/* Reply codes */
#define X_Error 0 /* Error */
/* Request codes */
#define X_CreateWindow 1
#define X_ChangeWindowAttributes 2
#define X_GetWindowAttributes 3
#define X_DestroyWindow 4
#define X_DestroySubwindows 5
#define X_ChangeSaveSet 6
#define X_ReparentWindow 7
#define X_MapWindow 8
#define X_MapSubwindows 9
#define X_UnmapWindow 10
#define X_UnmapSubwindows 11
#define X_ConfigureWindow 12
#define X_CirculateWindow 13
#define X_GetGeometry 14
#define X_QueryTree 15
#define X_InternAtom 16
#define X_GetAtomName 17
#define X_ChangeProperty 18
#define X_DeleteProperty 19
#define X_GetProperty 20
#define X_ListProperties 21
#define X_SetSelectionOwner 22
#define X_GetSelectionOwner 23
#define X_ConvertSelection 24
#define X_SendEvent 25
#define X_GrabPointer 26
#define X_UngrabPointer 27
#define X_GrabButton 28
#define X_UngrabButton 29
#define X_ChangeActivePointerGrab 30
#define X_GrabKeyboard 31
#define X_UngrabKeyboard 32
#define X_GrabKey 33
#define X_UngrabKey 34
#define X_AllowEvents 35
#define X_GrabServer 36
#define X_UngrabServer 37
#define X_QueryPointer 38
#define X_GetMotionEvents 39
#define X_TranslateCoords 40
#define X_WarpPointer 41
#define X_SetInputFocus 42
#define X_GetInputFocus 43
#define X_QueryKeymap 44
#define X_OpenFont 45
#define X_CloseFont 46
#define X_QueryFont 47
#define X_QueryTextExtents 48
#define X_ListFonts 49
#define X_ListFontsWithInfo 50
#define X_SetFontPath 51
#define X_GetFontPath 52
#define X_CreatePixmap 53
#define X_FreePixmap 54
#define X_CreateGC 55
#define X_ChangeGC 56
#define X_CopyGC 57
#define X_SetDashes 58
#define X_SetClipRectangles 59
#define X_FreeGC 60
#define X_ClearArea 61
#define X_CopyArea 62
#define X_CopyPlane 63
#define X_PolyPoint 64
#define X_PolyLine 65
#define X_PolySegment 66
#define X_PolyRectangle 67
#define X_PolyArc 68
#define X_FillPoly 69
#define X_PolyFillRectangle 70
#define X_PolyFillArc 71
#define X_PutImage 72
#define X_GetImage 73
#define X_PolyText8 74
#define X_PolyText16 75
#define X_ImageText8 76
#define X_ImageText16 77
#define X_CreateColormap 78
#define X_FreeColormap 79
#define X_CopyColormapAndFree 80
#define X_InstallColormap 81
#define X_UninstallColormap 82
#define X_ListInstalledColormaps 83
#define X_AllocColor 84
#define X_AllocNamedColor 85
#define X_AllocColorCells 86
#define X_AllocColorPlanes 87
#define X_FreeColors 88
#define X_StoreColors 89
#define X_StoreNamedColor 90
#define X_QueryColors 91
#define X_LookupColor 92
#define X_CreateCursor 93
#define X_CreateGlyphCursor 94
#define X_FreeCursor 95
#define X_RecolorCursor 96
#define X_QueryBestSize 97
#define X_QueryExtension 98
#define X_ListExtensions 99
#define X_ChangeKeyboardMapping 100
#define X_GetKeyboardMapping 101
#define X_ChangeKeyboardControl 102
#define X_GetKeyboardControl 103
#define X_Bell 104
#define X_ChangePointerControl 105
#define X_GetPointerControl 106
#define X_SetScreenSaver 107
#define X_GetScreenSaver 108
#define X_ChangeHosts 109
#define X_ListHosts 110
#define X_SetAccessControl 111
#define X_SetCloseDownMode 112
#define X_KillClient 113
#define X_RotateProperties 114
#define X_ForceScreenSaver 115
#define X_SetPointerMapping 116
#define X_GetPointerMapping 117
#define X_SetModifierMapping 118
#define X_GetModifierMapping 119
#define X_NoOperation 127
/* restore these definitions back to the typedefs in X.h */
#endif /* XPROTO_H */