123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157 |
- /* 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/Xmd.h>
- #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 Window CARD32
- #define Drawable CARD32
- #define Font CARD32
- #define Pixmap CARD32
- #define Cursor CARD32
- #define Colormap CARD32
- #define GContext CARD32
- #define Atom CARD32
- #define VisualID CARD32
- #define Time CARD32
- #define KeyCode CARD8
- #define KeySym CARD32
- #define X_TCP_PORT 6000 /* add display number */
- #define xTrue 1
- #define xFalse 0
- 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.
- */
- typedef struct {
- CARD8 byteOrder;
- BYTE pad;
- CARD16 majorVersion B16, minorVersion B16;
- CARD16 nbytesAuthProto B16; /* Authorization protocol */
- CARD16 nbytesAuthString B16; /* Authorization string */
- CARD16 pad2 B16;
- } xConnClientPrefix;
- /* 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.
- */
- typedef struct {
- CARD8 success;
- BYTE lengthReason; /*num bytes in string following if failure */
- CARD16 majorVersion B16,
- minorVersion B16;
- CARD16 length B16; /* 1/4 additional bytes in setup info */
- } xConnSetupPrefix;
- typedef struct {
- CARD32 release B32;
- CARD32 ridBase B32,
- ridMask B32;
- CARD32 motionBufferSize B32;
- CARD16 nbytesVendor B16; /* number of bytes in vendor string */
- CARD16 maxRequestSize B16;
- 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;
- CARD32 pad2 B32;
- } xConnSetup;
- typedef struct {
- CARD8 depth;
- CARD8 bitsPerPixel;
- CARD8 scanLinePad;
- CARD8 pad1;
- CARD32 pad2 B32;
- } xPixmapFormat;
- /* window root */
- typedef struct {
- CARD8 depth;
- CARD8 pad1;
- CARD16 nVisuals B16; /* number of xVisualType structures following */
- CARD32 pad2 B32;
- } xDepth;
- typedef struct {
- VisualID visualID B32;
- #if defined(__cplusplus) || defined(c_plusplus)
- CARD8 c_class;
- #else
- CARD8 class;
- #endif
- CARD8 bitsPerRGB;
- CARD16 colormapEntries B16;
- CARD32 redMask B32, greenMask B32, blueMask B32;
- CARD32 pad B32;
- } xVisualType;
- typedef struct {
- Window windowId B32;
- Colormap defaultColormap B32;
- CARD32 whitePixel B32, blackPixel B32;
- CARD32 currentInputMask B32;
- CARD16 pixWidth B16, pixHeight B16;
- CARD16 mmWidth B16, mmHeight B16;
- CARD16 minInstalledMaps B16, maxInstalledMaps B16;
- VisualID rootVisualID B32;
- CARD8 backingStore;
- BOOL saveUnders;
- CARD8 rootDepth;
- CARD8 nDepths; /* number of xDepth structures following */
- } xWindowRoot;
- /*****************************************************************
- * Structure Defns
- * Structures needed for replies
- *****************************************************************/
- /* Used in GetMotionEvents */
- typedef struct {
- CARD32 time B32;
- INT16 x B16, y B16;
- } xTimecoord;
- typedef struct {
- CARD8 family;
- BYTE pad;
- CARD16 length B16;
- } xHostEntry;
- typedef struct {
- INT16 leftSideBearing B16,
- rightSideBearing B16,
- characterWidth B16,
- ascent B16,
- descent B16;
- CARD16 attributes B16;
- } xCharInfo;
- typedef struct {
- Atom name B32;
- CARD32 value B32;
- } xFontProp;
- /*
- * 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 */
- INT8 delta;
- } xTextElt;
- typedef struct {
- CARD32 pixel B32;
- CARD16 red B16, green B16, blue B16;
- CARD8 flags; /* DoRed, DoGreen, DoBlue booleans */
- CARD8 pad;
- } xColorItem;
- typedef struct {
- CARD16 red B16, green B16, blue B16, pad B16;
- } xrgb;
- typedef CARD8 KEYCODE;
- /*****************
- * 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 {
- BYTE type; /* X_Reply */
- BYTE data1; /* depends on reply type */
- CARD16 sequenceNumber B16; /* of last request received by server */
- CARD32 length B32; /* 4 byte quantities beyond size of GenericReply */
- CARD32 data00 B32;
- CARD32 data01 B32;
- CARD32 data02 B32;
- CARD32 data03 B32;
- CARD32 data04 B32;
- CARD32 data05 B32;
- } xGenericReply;
- /* Individual reply formats. */
- typedef struct {
- BYTE type; /* X_Reply */
- CARD8 backingStore;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* NOT 0; this is an extra-large reply */
- VisualID visualID B32;
- #if defined(__cplusplus) || defined(c_plusplus)
- CARD16 c_class B16;
- #else
- CARD16 class B16;
- #endif
- CARD8 bitGravity;
- CARD8 winGravity;
- CARD32 backingBitPlanes B32;
- CARD32 backingPixel B32;
- BOOL saveUnder;
- BOOL mapInstalled;
- CARD8 mapState;
- BOOL override;
- Colormap colormap B32;
- CARD32 allEventMasks B32;
- CARD32 yourEventMask B32;
- CARD16 doNotPropagateMask B16;
- CARD16 pad B16;
- } xGetWindowAttributesReply;
- typedef struct {
- BYTE type; /* X_Reply */
- CARD8 depth;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- Window root B32;
- INT16 x B16, y B16;
- CARD16 width B16, height B16;
- CARD16 borderWidth B16;
- CARD16 pad1 B16;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- } xGetGeometryReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- Window root B32, parent B32;
- CARD16 nChildren B16;
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- } xQueryTreeReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- Atom atom B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- } xInternAtomReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* of additional bytes */
- CARD16 nameLength B16; /* # of characters in name */
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xGetAtomNameReply;
- typedef struct {
- BYTE type; /* X_Reply */
- CARD8 format;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* of additional bytes */
- Atom propertyType B32;
- CARD32 bytesAfter B32;
- CARD32 nItems B32; /* # of 8, 16, or 32-bit entities in reply */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- } xGetPropertyReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 nProperties B16;
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xListPropertiesReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- Window owner B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- } xGetSelectionOwnerReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE status;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- } xGrabPointerReply;
- typedef xGrabPointerReply xGrabKeyboardReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BOOL sameScreen;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- Window root B32, child B32;
- INT16 rootX B16, rootY B16, winX B16, winY B16;
- CARD16 mask B16;
- CARD16 pad1 B16;
- CARD32 pad B32;
- } xQueryPointerReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 nEvents B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- } xGetMotionEventsReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BOOL sameScreen;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- Window child B32;
- INT16 dstX B16, dstY B16;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- } xTranslateCoordsReply;
- typedef struct {
- BYTE type; /* X_Reply */
- CARD8 revertTo;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- Window focus B32;
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- } xGetInputFocusReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 2, NOT 0; this is an extra-large reply */
- BYTE map[32];
- } xQueryKeymapReply;
- /* Warning: this MUST match (up to component renaming) xListFontsWithInfoReply */
- typedef struct _xQueryFontReply {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* definitely > 0, even if "nCharInfos" is 0 */
- xCharInfo minBounds;
- CARD32 walign1 B32;
- xCharInfo maxBounds;
- CARD32 walign2 B32;
- CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
- CARD16 defaultChar B16;
- CARD16 nFontProps B16; /* followed by this many xFontProp structures */
- CARD8 drawDirection;
- CARD8 minByte1, maxByte1;
- BOOL allCharsExist;
- INT16 fontAscent B16, fontDescent B16;
- CARD32 nCharInfos B32; /* followed by this many xCharInfo structures */
- } xQueryFontReply;
- typedef struct {
- BYTE type; /* X_Reply */
- CARD8 drawDirection;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- INT16 fontAscent B16, fontDescent B16;
- INT16 overallAscent B16, overallDescent B16;
- INT32 overallWidth B32, overallLeft B32, overallRight B32;
- CARD32 pad B32;
- } xQueryTextExtentsReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 nFonts B16;
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xListFontsReply;
- /* Warning: this MUST match (up to component renaming) xQueryFontReply */
- typedef struct {
- BYTE type; /* X_Reply */
- CARD8 nameLength; /* 0 indicates end-of-reply-sequence */
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* definitely > 0, even if "nameLength" is 0 */
- xCharInfo minBounds;
- CARD32 walign1 B32;
- xCharInfo maxBounds;
- CARD32 walign2 B32;
- CARD16 minCharOrByte2 B16, maxCharOrByte2 B16;
- CARD16 defaultChar B16;
- CARD16 nFontProps B16; /* followed by this many xFontProp structures */
- CARD8 drawDirection;
- CARD8 minByte1, maxByte1;
- BOOL allCharsExist;
- INT16 fontAscent B16, fontDescent B16;
- CARD32 nReplies B32; /* hint as to how many more replies might be coming */
- } xListFontsWithInfoReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 nPaths B16;
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xGetFontPathReply;
- typedef struct {
- BYTE type; /* X_Reply */
- CARD8 depth;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- VisualID visual B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xGetImageReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 nColormaps B16;
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xListInstalledColormapsReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- CARD16 red B16, green B16, blue B16;
- CARD16 pad2 B16;
- CARD32 pixel B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- } xAllocColorReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- CARD32 pixel B32;
- CARD16 exactRed B16, exactGreen B16, exactBlue B16;
- CARD16 screenRed B16, screenGreen B16, screenBlue B16;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- } xAllocNamedColorReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 nPixels B16, nMasks B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xAllocColorCellsReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 nPixels B16;
- CARD16 pad2 B16;
- CARD32 redMask B32, greenMask B32, blueMask B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- } xAllocColorPlanesReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 nColors B16;
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xQueryColorsReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- CARD16 exactRed B16, exactGreen B16, exactBlue B16;
- CARD16 screenRed B16, screenGreen B16, screenBlue B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- } xLookupColorReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- CARD16 width B16, height B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xQueryBestSizeReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- BOOL present;
- CARD8 major_opcode;
- CARD8 first_event;
- CARD8 first_error;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xQueryExtensionReply;
- typedef struct {
- BYTE type; /* X_Reply */
- CARD8 nExtensions;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xListExtensionsReply;
- typedef struct {
- BYTE type; /* X_Reply */
- CARD8 success;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xSetMappingReply;
- typedef xSetMappingReply xSetPointerMappingReply;
- typedef xSetMappingReply xSetModifierMappingReply;
- typedef struct {
- BYTE type; /* X_Reply */
- CARD8 nElts; /* how many elements does the map have */
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xGetPointerMappingReply;
- typedef struct {
- BYTE type;
- CARD8 keySymsPerKeyCode;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xGetKeyboardMappingReply;
- typedef struct {
- BYTE type;
- CARD8 numKeyPerModifier;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD32 pad1 B32;
- CARD32 pad2 B32;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- } xGetModifierMappingReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BOOL globalAutoRepeat;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 5 */
- CARD32 ledMask B32;
- CARD8 keyClickPercent, bellPercent;
- CARD16 bellPitch B16, bellDuration B16;
- CARD16 pad B16;
- BYTE map[32]; /* bit masks start here */
- } xGetKeyboardControlReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- CARD16 accelNumerator B16, accelDenominator B16;
- CARD16 threshold B16;
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- } xGetPointerControlReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BYTE pad1;
- CARD16 sequenceNumber B16;
- CARD32 length B32; /* 0 */
- CARD16 timeout B16, interval B16;
- BOOL preferBlanking;
- BOOL allowExposures;
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- } xGetScreenSaverReply;
- typedef struct {
- BYTE type; /* X_Reply */
- BOOL enabled;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 nHosts B16;
- CARD16 pad1 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xListHostsReply;
- /*****************************************************************
- * Xerror
- * All errors are 32 bytes
- *****************************************************************/
- typedef struct {
- BYTE type; /* X_Error */
- BYTE errorCode;
- CARD16 sequenceNumber B16; /* the nth request from this client */
- CARD32 resourceID B32;
- CARD16 minorCode B16;
- CARD8 majorCode;
- BYTE pad1;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xError;
- /*****************************************************************
- * xEvent
- * All events are 32 bytes
- *****************************************************************/
- typedef struct _xEvent {
- union {
- struct {
- BYTE type;
- BYTE detail;
- CARD16 sequenceNumber B16;
- } u;
- struct {
- CARD32 pad00 B32;
- Time time B32;
- Window root B32, event B32, child B32;
- INT16 rootX B16, rootY B16, eventX B16, eventY B16;
- KeyButMask state B16;
- BOOL sameScreen;
- BYTE pad1;
- } keyButtonPointer;
- struct {
- CARD32 pad00 B32;
- Time time B32;
- Window root B32, event B32, child B32;
- INT16 rootX B16, rootY B16, eventX B16, eventY B16;
- KeyButMask state B16;
- BYTE mode; /* really XMode */
- BYTE flags; /* sameScreen and focus booleans, packed together */
- #define ELFlagFocus (1<<0)
- #define ELFlagSameScreen (1<<1)
- } enterLeave;
- struct {
- CARD32 pad00 B32;
- Window window B32;
- BYTE mode; /* really XMode */
- BYTE pad1, pad2, pad3;
- } focus;
- struct {
- CARD32 pad00 B32;
- Window window B32;
- CARD16 x B16, y B16, width B16, height B16;
- CARD16 count B16;
- CARD16 pad2 B16;
- } expose;
- struct {
- CARD32 pad00 B32;
- Drawable drawable B32;
- CARD16 x B16, y B16, width B16, height B16;
- CARD16 minorEvent B16;
- CARD16 count B16;
- BYTE majorEvent;
- BYTE pad1, pad2, pad3;
- } graphicsExposure;
- struct {
- CARD32 pad00 B32;
- Drawable drawable B32;
- CARD16 minorEvent B16;
- BYTE majorEvent;
- BYTE bpad;
- } noExposure;
- struct {
- CARD32 pad00 B32;
- Window window B32;
- CARD8 state;
- BYTE pad1, pad2, pad3;
- } visibility;
- struct {
- CARD32 pad00 B32;
- Window parent B32, window B32;
- INT16 x B16, y B16;
- CARD16 width B16, height B16, borderWidth B16;
- BOOL override;
- BYTE bpad;
- } 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 {
- CARD32 pad00 B32;
- Window event B32, window B32;
- } destroyNotify;
- struct {
- CARD32 pad00 B32;
- Window event B32, window B32;
- BOOL fromConfigure;
- BYTE pad1, pad2, pad3;
- } unmapNotify;
- struct {
- CARD32 pad00 B32;
- Window event B32, window B32;
- BOOL override;
- BYTE pad1, pad2, pad3;
- } mapNotify;
- struct {
- CARD32 pad00 B32;
- Window parent B32, window B32;
- } mapRequest;
- struct {
- CARD32 pad00 B32;
- Window event B32, window B32, parent B32;
- INT16 x B16, y B16;
- BOOL override;
- BYTE pad1, pad2, pad3;
- } reparent;
- struct {
- CARD32 pad00 B32;
- Window event B32, window B32, aboveSibling B32;
- INT16 x B16, y B16;
- CARD16 width B16, height B16, borderWidth B16;
- BOOL override;
- BYTE bpad;
- } configureNotify;
- struct {
- CARD32 pad00 B32;
- Window parent B32, window B32, sibling B32;
- INT16 x B16, y B16;
- CARD16 width B16, height B16, borderWidth B16;
- CARD16 valueMask B16;
- CARD32 pad1 B32;
- } configureRequest;
- struct {
- CARD32 pad00 B32;
- Window event B32, window B32;
- INT16 x B16, y B16;
- CARD32 pad1 B32, pad2 B32, pad3 B32, pad4 B32;
- } gravity;
- struct {
- CARD32 pad00 B32;
- Window window B32;
- CARD16 width B16, height B16;
- } resizeRequest;
- struct {
- /* The event field in the circulate record is really the parent when this
- is used as a CirculateRequest instead of a CirculateNotify */
- CARD32 pad00 B32;
- Window event B32, window B32, parent B32;
- BYTE place; /* Top or Bottom */
- BYTE pad1, pad2, pad3;
- } circulate;
- struct {
- CARD32 pad00 B32;
- Window window B32;
- Atom atom B32;
- Time time B32;
- BYTE state; /* NewValue or Deleted */
- BYTE pad1;
- CARD16 pad2 B16;
- } property;
- struct {
- CARD32 pad00 B32;
- Time time B32;
- Window window B32;
- Atom atom B32;
- } selectionClear;
- struct {
- CARD32 pad00 B32;
- Time time B32;
- Window owner B32, requestor B32;
- Atom selection B32, target B32, property B32;
- } selectionRequest;
- struct {
- CARD32 pad00 B32;
- Time time B32;
- Window requestor B32;
- Atom selection B32, target B32, property B32;
- } selectionNotify;
- struct {
- CARD32 pad00 B32;
- Window window B32;
- Colormap colormap B32;
- #if defined(__cplusplus) || defined(c_plusplus)
- BOOL c_new;
- #else
- BOOL new;
- #endif
- BYTE state; /* Installed or UnInstalled */
- BYTE pad1, pad2;
- } colormap;
- struct {
- CARD32 pad00 B32;
- CARD8 request;
- KeyCode firstKeyCode;
- CARD8 count;
- BYTE pad1;
- } mappingNotify;
- struct {
- CARD32 pad00 B32;
- Window window B32;
- union {
- struct {
- Atom type B32;
- INT32 longs0 B32;
- INT32 longs1 B32;
- INT32 longs2 B32;
- INT32 longs3 B32;
- INT32 longs4 B32;
- } l;
- struct {
- Atom type B32;
- INT16 shorts0 B16;
- INT16 shorts1 B16;
- INT16 shorts2 B16;
- INT16 shorts3 B16;
- INT16 shorts4 B16;
- INT16 shorts5 B16;
- INT16 shorts6 B16;
- INT16 shorts7 B16;
- INT16 shorts8 B16;
- INT16 shorts9 B16;
- } s;
- struct {
- Atom type B32;
- INT8 bytes[20];
- } b;
- } u;
- } clientMessage;
- } 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
- {
- BYTE type;
- CARD8 extension;
- CARD16 sequenceNumber B16;
- CARD32 length B32;
- CARD16 evtype B16;
- CARD16 pad2 B16;
- CARD32 pad3 B32;
- CARD32 pad4 B32;
- CARD32 pad5 B32;
- CARD32 pad6 B32;
- CARD32 pad7 B32;
- } xGenericEvent;
- /* 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 {
- BYTE type;
- BYTE map[31];
- } 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 {
- xGenericReply generic;
- xGetGeometryReply geom;
- xQueryTreeReply tree;
- xInternAtomReply atom;
- xGetAtomNameReply atomName;
- xGetPropertyReply property;
- xListPropertiesReply listProperties;
- xGetSelectionOwnerReply selection;
- xGrabPointerReply grabPointer;
- xGrabKeyboardReply grabKeyboard;
- xQueryPointerReply pointer;
- xGetMotionEventsReply motionEvents;
- xTranslateCoordsReply coords;
- xGetInputFocusReply inputFocus;
- xQueryTextExtentsReply textExtents;
- xListFontsReply fonts;
- xGetFontPathReply fontPath;
- xGetImageReply image;
- xListInstalledColormapsReply colormaps;
- xAllocColorReply allocColor;
- xAllocNamedColorReply allocNamedColor;
- xAllocColorCellsReply colorCells;
- xAllocColorPlanesReply colorPlanes;
- xQueryColorsReply colors;
- xLookupColorReply lookupColor;
- xQueryBestSizeReply bestSize;
- xQueryExtensionReply extension;
- xListExtensionsReply extensions;
- xSetModifierMappingReply setModifierMapping;
- xGetModifierMappingReply getModifierMapping;
- xSetPointerMappingReply setPointerMapping;
- xGetKeyboardMappingReply getKeyboardMapping;
- xGetPointerMappingReply getPointerMapping;
- xGetPointerControlReply pointerControl;
- xGetScreenSaverReply screenSaver;
- xListHostsReply hosts;
- xError error;
- xEvent event;
- } xReply;
- /*****************************************************************
- * REQUESTS
- *****************************************************************/
- /* Request structure */
- typedef struct _xReq {
- CARD8 reqType;
- CARD8 data; /* meaning depends on request type */
- CARD16 length B16; /* length in 4 bytes quantities
- 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 {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- CARD32 id B32; /* a Window, Drawable, Font, GContext, Pixmap, etc. */
- } xResourceReq;
- typedef struct {
- CARD8 reqType;
- CARD8 depth;
- CARD16 length B16;
- Window wid B32, parent B32;
- INT16 x B16, y B16;
- CARD16 width B16, height B16, borderWidth B16;
- #if defined(__cplusplus) || defined(c_plusplus)
- CARD16 c_class B16;
- #else
- CARD16 class B16;
- #endif
- VisualID visual B32;
- CARD32 mask B32;
- } xCreateWindowReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Window window B32;
- CARD32 valueMask B32;
- } xChangeWindowAttributesReq;
- typedef struct {
- CARD8 reqType;
- BYTE mode;
- CARD16 length B16;
- Window window B32;
- } xChangeSaveSetReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Window window B32, parent B32;
- INT16 x B16, y B16;
- } xReparentWindowReq;
- typedef struct {
- CARD8 reqType;
- CARD8 pad;
- CARD16 length B16;
- Window window B32;
- CARD16 mask B16;
- CARD16 pad2 B16;
- } xConfigureWindowReq;
- typedef struct {
- CARD8 reqType;
- CARD8 direction;
- CARD16 length B16;
- Window window B32;
- } xCirculateWindowReq;
- typedef struct { /* followed by padded string */
- CARD8 reqType;
- BOOL onlyIfExists;
- CARD16 length B16;
- CARD16 nbytes B16; /* number of bytes in string */
- CARD16 pad B16;
- } xInternAtomReq;
- typedef struct {
- CARD8 reqType;
- CARD8 mode;
- CARD16 length B16;
- Window window B32;
- Atom property B32, type B32;
- CARD8 format;
- BYTE pad[3];
- CARD32 nUnits B32; /* length of stuff following, depends on format */
- } xChangePropertyReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Window window B32;
- Atom property B32;
- } xDeletePropertyReq;
- typedef struct {
- CARD8 reqType;
- #if defined(__cplusplus) || defined(c_plusplus)
- BOOL c_delete;
- #else
- BOOL delete;
- #endif
- CARD16 length B16;
- Window window B32;
- Atom property B32, type B32;
- CARD32 longOffset B32;
- CARD32 longLength B32;
- } xGetPropertyReq;
-
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Window window B32;
- Atom selection B32;
- Time time B32;
- } xSetSelectionOwnerReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Window requestor B32;
- Atom selection B32, target B32, property B32;
- Time time B32;
- } xConvertSelectionReq;
- typedef struct {
- CARD8 reqType;
- BOOL propagate;
- CARD16 length B16;
- Window destination B32;
- CARD32 eventMask B32;
- xEvent event;
- } xSendEventReq;
- typedef struct {
- CARD8 reqType;
- BOOL ownerEvents;
- CARD16 length B16;
- Window grabWindow B32;
- CARD16 eventMask B16;
- BYTE pointerMode, keyboardMode;
- Window confineTo B32;
- Cursor cursor B32;
- Time time B32;
- } xGrabPointerReq;
- typedef struct {
- CARD8 reqType;
- BOOL ownerEvents;
- CARD16 length B16;
- Window grabWindow B32;
- CARD16 eventMask B16;
- BYTE pointerMode, keyboardMode;
- Window confineTo B32;
- Cursor cursor B32;
- CARD8 button;
- BYTE pad;
- CARD16 modifiers B16;
- } xGrabButtonReq;
- typedef struct {
- CARD8 reqType;
- CARD8 button;
- CARD16 length B16;
- Window grabWindow B32;
- CARD16 modifiers B16;
- CARD16 pad B16;
- } xUngrabButtonReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Cursor cursor B32;
- Time time B32;
- CARD16 eventMask B16;
- CARD16 pad2 B16;
- } xChangeActivePointerGrabReq;
- typedef struct {
- CARD8 reqType;
- BOOL ownerEvents;
- CARD16 length B16;
- Window grabWindow B32;
- Time time B32;
- BYTE pointerMode, keyboardMode;
- CARD16 pad B16;
- } xGrabKeyboardReq;
- typedef struct {
- CARD8 reqType;
- BOOL ownerEvents;
- CARD16 length B16;
- Window grabWindow B32;
- CARD16 modifiers B16;
- CARD8 key;
- BYTE pointerMode, keyboardMode;
- BYTE pad1, pad2, pad3;
- } xGrabKeyReq;
- typedef struct {
- CARD8 reqType;
- CARD8 key;
- CARD16 length B16;
- Window grabWindow B32;
- CARD16 modifiers B16;
- CARD16 pad B16;
- } xUngrabKeyReq;
- typedef struct {
- CARD8 reqType;
- CARD8 mode;
- CARD16 length B16;
- Time time B32;
- } xAllowEventsReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Window window B32;
- Time start B32, stop B32;
- } xGetMotionEventsReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Window srcWid B32, dstWid B32;
- INT16 srcX B16, srcY B16;
- } xTranslateCoordsReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Window srcWid B32, dstWid B32;
- INT16 srcX B16, srcY B16;
- CARD16 srcWidth B16, srcHeight B16;
- INT16 dstX B16, dstY B16;
- } xWarpPointerReq;
- typedef struct {
- CARD8 reqType;
- CARD8 revertTo;
- CARD16 length B16;
- Window focus B32;
- Time time B32;
- } xSetInputFocusReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Font fid B32;
- CARD16 nbytes B16;
- BYTE pad1, pad2; /* string follows on word boundary */
- } xOpenFontReq;
- typedef struct {
- CARD8 reqType;
- BOOL oddLength;
- CARD16 length B16;
- Font fid B32;
- } xQueryTextExtentsReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- CARD16 maxNames B16;
- CARD16 nbytes B16; /* followed immediately by string bytes */
- } xListFontsReq;
- typedef xListFontsReq xListFontsWithInfoReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- CARD16 nFonts B16;
- BYTE pad1, pad2; /* LISTofSTRING8 follows on word boundary */
- } xSetFontPathReq;
- typedef struct {
- CARD8 reqType;
- CARD8 depth;
- CARD16 length B16;
- Pixmap pid B32;
- Drawable drawable B32;
- CARD16 width B16, height B16;
- } xCreatePixmapReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- GContext gc B32;
- Drawable drawable B32;
- CARD32 mask B32;
- } xCreateGCReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- GContext gc B32;
- CARD32 mask B32;
- } xChangeGCReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- GContext srcGC B32, dstGC B32;
- CARD32 mask B32;
- } xCopyGCReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- GContext gc B32;
- CARD16 dashOffset B16;
- CARD16 nDashes B16; /* length LISTofCARD8 of values following */
- } xSetDashesReq;
- typedef struct {
- CARD8 reqType;
- BYTE ordering;
- CARD16 length B16;
- GContext gc B32;
- INT16 xOrigin B16, yOrigin B16;
- } xSetClipRectanglesReq;
- typedef struct {
- CARD8 reqType;
- BOOL exposures;
- CARD16 length B16;
- Window window B32;
- INT16 x B16, y B16;
- CARD16 width B16, height B16;
- } xClearAreaReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Drawable srcDrawable B32, dstDrawable B32;
- GContext gc B32;
- INT16 srcX B16, srcY B16, dstX B16, dstY B16;
- CARD16 width B16, height B16;
- } xCopyAreaReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Drawable srcDrawable B32, dstDrawable B32;
- GContext gc B32;
- INT16 srcX B16, srcY B16, dstX B16, dstY B16;
- CARD16 width B16, height B16;
- CARD32 bitPlane B32;
- } xCopyPlaneReq;
- typedef struct {
- CARD8 reqType;
- BYTE coordMode;
- CARD16 length B16;
- Drawable drawable B32;
- GContext gc B32;
- } xPolyPointReq;
- typedef xPolyPointReq xPolyLineReq; /* same request structure */
- /* The following used for PolySegment, PolyRectangle, PolyArc, PolyFillRectangle, PolyFillArc */
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Drawable drawable B32;
- GContext gc B32;
- } xPolySegmentReq;
- typedef xPolySegmentReq xPolyArcReq;
- typedef xPolySegmentReq xPolyRectangleReq;
- typedef xPolySegmentReq xPolyFillRectangleReq;
- typedef xPolySegmentReq xPolyFillArcReq;
- typedef struct _FillPolyReq {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Drawable drawable B32;
- GContext gc B32;
- BYTE shape;
- BYTE coordMode;
- CARD16 pad1 B16;
- } xFillPolyReq;
- typedef struct _PutImageReq {
- CARD8 reqType;
- CARD8 format;
- CARD16 length B16;
- Drawable drawable B32;
- GContext gc B32;
- CARD16 width B16, height B16;
- INT16 dstX B16, dstY B16;
- CARD8 leftPad;
- CARD8 depth;
- CARD16 pad B16;
- } xPutImageReq;
- typedef struct {
- CARD8 reqType;
- CARD8 format;
- CARD16 length B16;
- Drawable drawable B32;
- INT16 x B16, y B16;
- CARD16 width B16, height B16;
- CARD32 planeMask B32;
- } xGetImageReq;
- /* the following used by PolyText8 and PolyText16 */
- typedef struct {
- CARD8 reqType;
- CARD8 pad;
- CARD16 length B16;
- Drawable drawable B32;
- GContext gc B32;
- INT16 x B16, y B16; /* items (xTextElt) start after struct */
- } xPolyTextReq;
- typedef xPolyTextReq xPolyText8Req;
- typedef xPolyTextReq xPolyText16Req;
- typedef struct {
- CARD8 reqType;
- BYTE nChars;
- CARD16 length B16;
- Drawable drawable B32;
- GContext gc B32;
- INT16 x B16, y B16;
- } xImageTextReq;
- typedef xImageTextReq xImageText8Req;
- typedef xImageTextReq xImageText16Req;
- typedef struct {
- CARD8 reqType;
- BYTE alloc;
- CARD16 length B16;
- Colormap mid B32;
- Window window B32;
- VisualID visual B32;
- } xCreateColormapReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Colormap mid B32;
- Colormap srcCmap B32;
- } xCopyColormapAndFreeReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Colormap cmap B32;
- CARD16 red B16, green B16, blue B16;
- CARD16 pad2 B16;
- } xAllocColorReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Colormap cmap B32;
- CARD16 nbytes B16; /* followed by structure */
- BYTE pad1, pad2;
- } xAllocNamedColorReq;
- typedef struct {
- CARD8 reqType;
- BOOL contiguous;
- CARD16 length B16;
- Colormap cmap B32;
- CARD16 colors B16, planes B16;
- } xAllocColorCellsReq;
- typedef struct {
- CARD8 reqType;
- BOOL contiguous;
- CARD16 length B16;
- Colormap cmap B32;
- CARD16 colors B16, red B16, green B16, blue B16;
- } xAllocColorPlanesReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Colormap cmap B32;
- CARD32 planeMask B32;
- } xFreeColorsReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Colormap cmap B32;
- } xStoreColorsReq;
- typedef struct {
- CARD8 reqType;
- CARD8 flags; /* DoRed, DoGreen, DoBlue, as in xColorItem */
- CARD16 length B16;
- Colormap cmap B32;
- CARD32 pixel B32;
- CARD16 nbytes B16; /* number of name string bytes following structure */
- BYTE pad1, pad2;
- } xStoreNamedColorReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Colormap cmap B32;
- } xQueryColorsReq;
- typedef struct { /* followed by string of length len */
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Colormap cmap B32;
- CARD16 nbytes B16; /* number of string bytes following structure*/
- BYTE pad1, pad2;
- } xLookupColorReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Cursor cid B32;
- Pixmap source B32, mask B32;
- CARD16 foreRed B16, foreGreen B16, foreBlue B16;
- CARD16 backRed B16, backGreen B16, backBlue B16;
- CARD16 x B16, y B16;
- } xCreateCursorReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Cursor cid B32;
- Font source B32, mask B32;
- CARD16 sourceChar B16, maskChar B16;
- CARD16 foreRed B16, foreGreen B16, foreBlue B16;
- CARD16 backRed B16, backGreen B16, backBlue B16;
- } xCreateGlyphCursorReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Cursor cursor B32;
- CARD16 foreRed B16, foreGreen B16, foreBlue B16;
- CARD16 backRed B16, backGreen B16, backBlue B16;
- } xRecolorCursorReq;
- typedef struct {
- CARD8 reqType;
- #if defined(__cplusplus) || defined(c_plusplus)
- CARD8 c_class;
- #else
- CARD8 class;
- #endif
- CARD16 length B16;
- Drawable drawable B32;
- CARD16 width B16, height B16;
- } xQueryBestSizeReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- CARD16 nbytes B16; /* number of string bytes following structure */
- BYTE pad1, pad2;
- } xQueryExtensionReq;
- typedef struct {
- CARD8 reqType;
- CARD8 numKeyPerModifier;
- CARD16 length B16;
- } xSetModifierMappingReq;
- typedef struct {
- CARD8 reqType;
- CARD8 nElts; /* how many elements in the map */
- CARD16 length B16;
- } xSetPointerMappingReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- KeyCode firstKeyCode;
- CARD8 count;
- CARD16 pad1 B16;
- } xGetKeyboardMappingReq;
- typedef struct {
- CARD8 reqType;
- CARD8 keyCodes;
- CARD16 length B16;
- KeyCode firstKeyCode;
- CARD8 keySymsPerKeyCode;
- CARD16 pad1 B16;
- } xChangeKeyboardMappingReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- CARD32 mask B32;
- } xChangeKeyboardControlReq;
- typedef struct {
- CARD8 reqType;
- INT8 percent; /* -100 to 100 */
- CARD16 length B16;
- } xBellReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- INT16 accelNum B16, accelDenum B16;
- INT16 threshold B16;
- BOOL doAccel, doThresh;
- } xChangePointerControlReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- INT16 timeout B16, interval B16;
- BYTE preferBlank, allowExpose;
- CARD16 pad2 B16;
- } xSetScreenSaverReq;
- typedef struct {
- CARD8 reqType;
- BYTE mode;
- CARD16 length B16;
- CARD8 hostFamily;
- BYTE pad;
- CARD16 hostLength B16;
- } xChangeHostsReq;
- typedef struct {
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- } xListHostsReq;
- typedef struct {
- CARD8 reqType;
- BYTE mode;
- CARD16 length B16;
- } xChangeModeReq;
- typedef xChangeModeReq xSetAccessControlReq;
- typedef xChangeModeReq xSetCloseDownModeReq;
- typedef xChangeModeReq xForceScreenSaverReq;
- typedef struct { /* followed by LIST of ATOM */
- CARD8 reqType;
- BYTE pad;
- CARD16 length B16;
- Window window B32;
- CARD16 nAtoms B16;
- INT16 nPositions B16;
- } xRotatePropertiesReq;
-
- /* Reply codes */
- #define X_Reply 1 /* Normal reply */
- #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 */
- #undef Window
- #undef Drawable
- #undef Font
- #undef Pixmap
- #undef Cursor
- #undef Colormap
- #undef GContext
- #undef Atom
- #undef VisualID
- #undef Time
- #undef KeyCode
- #undef KeySym
- #endif /* XPROTO_H */
|