Path: blob/master/thirdparty/linuxbsd_headers/X11/X.h
9898 views
/* Definitions for the X window system likely to be used by applications */12#ifndef X_H3#define X_H45/***********************************************************67Copyright 1987, 1998 The Open Group89Permission to use, copy, modify, distribute, and sell this software and its10documentation for any purpose is hereby granted without fee, provided that11the above copyright notice appear in all copies and that both that12copyright notice and this permission notice appear in supporting13documentation.1415The above copyright notice and this permission notice shall be included in16all copies or substantial portions of the Software.1718THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR19IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,20FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE21OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN22AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN23CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.2425Except as contained in this notice, the name of The Open Group shall not be26used in advertising or otherwise to promote the sale, use or other dealings27in this Software without prior written authorization from The Open Group.282930Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.3132All Rights Reserved3334Permission to use, copy, modify, and distribute this software and its35documentation for any purpose and without fee is hereby granted,36provided that the above copyright notice appear in all copies and that37both that copyright notice and this permission notice appear in38supporting documentation, and that the name of Digital not be39used in advertising or publicity pertaining to distribution of the40software without specific, written prior permission.4142DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING43ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL44DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR45ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,46WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,47ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS48SOFTWARE.4950******************************************************************/5152#define X_PROTOCOL 11 /* current protocol version */53#define X_PROTOCOL_REVISION 0 /* current minor version */5455/* Resources */5657/*58* _XSERVER64 must ONLY be defined when compiling X server sources on59* systems where unsigned long is not 32 bits, must NOT be used in60* client or library code.61*/62#ifndef _XSERVER6463# ifndef _XTYPEDEF_XID64# define _XTYPEDEF_XID65typedef unsigned long XID;66# endif67# ifndef _XTYPEDEF_MASK68# define _XTYPEDEF_MASK69typedef unsigned long Mask;70# endif71# ifndef _XTYPEDEF_ATOM72# define _XTYPEDEF_ATOM73typedef unsigned long Atom; /* Also in Xdefs.h */74# endif75typedef unsigned long VisualID;76typedef unsigned long Time;77#else78# include <X11/Xmd.h>79# ifndef _XTYPEDEF_XID80# define _XTYPEDEF_XID81typedef CARD32 XID;82# endif83# ifndef _XTYPEDEF_MASK84# define _XTYPEDEF_MASK85typedef CARD32 Mask;86# endif87# ifndef _XTYPEDEF_ATOM88# define _XTYPEDEF_ATOM89typedef CARD32 Atom;90# endif91typedef CARD32 VisualID;92typedef CARD32 Time;93#endif9495typedef XID Window;96typedef XID Drawable;97#ifndef _XTYPEDEF_FONT98# define _XTYPEDEF_FONT99typedef XID Font;100#endif101typedef XID Pixmap;102typedef XID Cursor;103typedef XID Colormap;104typedef XID GContext;105typedef XID KeySym;106107typedef unsigned char KeyCode;108109/*****************************************************************110* RESERVED RESOURCE AND CONSTANT DEFINITIONS111*****************************************************************/112113#ifndef None114#define None 0L /* universal null resource or null atom */115#endif116117#define ParentRelative 1L /* background pixmap in CreateWindow118and ChangeWindowAttributes */119120#define CopyFromParent 0L /* border pixmap in CreateWindow121and ChangeWindowAttributes122special VisualID and special window123class passed to CreateWindow */124125#define PointerWindow 0L /* destination window in SendEvent */126#define InputFocus 1L /* destination window in SendEvent */127128#define PointerRoot 1L /* focus window in SetInputFocus */129130#define AnyPropertyType 0L /* special Atom, passed to GetProperty */131132#define AnyKey 0L /* special Key Code, passed to GrabKey */133134#define AnyButton 0L /* special Button Code, passed to GrabButton */135136#define AllTemporary 0L /* special Resource ID passed to KillClient */137138#define CurrentTime 0L /* special Time */139140#define NoSymbol 0L /* special KeySym */141142/*****************************************************************143* EVENT DEFINITIONS144*****************************************************************/145146/* Input Event Masks. Used as event-mask window attribute and as arguments147to Grab requests. Not to be confused with event names. */148149#define NoEventMask 0L150#define KeyPressMask (1L<<0)151#define KeyReleaseMask (1L<<1)152#define ButtonPressMask (1L<<2)153#define ButtonReleaseMask (1L<<3)154#define EnterWindowMask (1L<<4)155#define LeaveWindowMask (1L<<5)156#define PointerMotionMask (1L<<6)157#define PointerMotionHintMask (1L<<7)158#define Button1MotionMask (1L<<8)159#define Button2MotionMask (1L<<9)160#define Button3MotionMask (1L<<10)161#define Button4MotionMask (1L<<11)162#define Button5MotionMask (1L<<12)163#define ButtonMotionMask (1L<<13)164#define KeymapStateMask (1L<<14)165#define ExposureMask (1L<<15)166#define VisibilityChangeMask (1L<<16)167#define StructureNotifyMask (1L<<17)168#define ResizeRedirectMask (1L<<18)169#define SubstructureNotifyMask (1L<<19)170#define SubstructureRedirectMask (1L<<20)171#define FocusChangeMask (1L<<21)172#define PropertyChangeMask (1L<<22)173#define ColormapChangeMask (1L<<23)174#define OwnerGrabButtonMask (1L<<24)175176/* Event names. Used in "type" field in XEvent structures. Not to be177confused with event masks above. They start from 2 because 0 and 1178are reserved in the protocol for errors and replies. */179180#define KeyPress 2181#define KeyRelease 3182#define ButtonPress 4183#define ButtonRelease 5184#define MotionNotify 6185#define EnterNotify 7186#define LeaveNotify 8187#define FocusIn 9188#define FocusOut 10189#define KeymapNotify 11190#define Expose 12191#define GraphicsExpose 13192#define NoExpose 14193#define VisibilityNotify 15194#define CreateNotify 16195#define DestroyNotify 17196#define UnmapNotify 18197#define MapNotify 19198#define MapRequest 20199#define ReparentNotify 21200#define ConfigureNotify 22201#define ConfigureRequest 23202#define GravityNotify 24203#define ResizeRequest 25204#define CirculateNotify 26205#define CirculateRequest 27206#define PropertyNotify 28207#define SelectionClear 29208#define SelectionRequest 30209#define SelectionNotify 31210#define ColormapNotify 32211#define ClientMessage 33212#define MappingNotify 34213#define GenericEvent 35214#define LASTEvent 36 /* must be bigger than any event # */215216217/* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,218state in various key-, mouse-, and button-related events. */219220#define ShiftMask (1<<0)221#define LockMask (1<<1)222#define ControlMask (1<<2)223#define Mod1Mask (1<<3)224#define Mod2Mask (1<<4)225#define Mod3Mask (1<<5)226#define Mod4Mask (1<<6)227#define Mod5Mask (1<<7)228229/* modifier names. Used to build a SetModifierMapping request or230to read a GetModifierMapping request. These correspond to the231masks defined above. */232#define ShiftMapIndex 0233#define LockMapIndex 1234#define ControlMapIndex 2235#define Mod1MapIndex 3236#define Mod2MapIndex 4237#define Mod3MapIndex 5238#define Mod4MapIndex 6239#define Mod5MapIndex 7240241242/* button masks. Used in same manner as Key masks above. Not to be confused243with button names below. */244245#define Button1Mask (1<<8)246#define Button2Mask (1<<9)247#define Button3Mask (1<<10)248#define Button4Mask (1<<11)249#define Button5Mask (1<<12)250251#define AnyModifier (1<<15) /* used in GrabButton, GrabKey */252253254/* button names. Used as arguments to GrabButton and as detail in ButtonPress255and ButtonRelease events. Not to be confused with button masks above.256Note that 0 is already defined above as "AnyButton". */257258#define Button1 1259#define Button2 2260#define Button3 3261#define Button4 4262#define Button5 5263264/* Notify modes */265266#define NotifyNormal 0267#define NotifyGrab 1268#define NotifyUngrab 2269#define NotifyWhileGrabbed 3270271#define NotifyHint 1 /* for MotionNotify events */272273/* Notify detail */274275#define NotifyAncestor 0276#define NotifyVirtual 1277#define NotifyInferior 2278#define NotifyNonlinear 3279#define NotifyNonlinearVirtual 4280#define NotifyPointer 5281#define NotifyPointerRoot 6282#define NotifyDetailNone 7283284/* Visibility notify */285286#define VisibilityUnobscured 0287#define VisibilityPartiallyObscured 1288#define VisibilityFullyObscured 2289290/* Circulation request */291292#define PlaceOnTop 0293#define PlaceOnBottom 1294295/* protocol families */296297#define FamilyInternet 0 /* IPv4 */298#define FamilyDECnet 1299#define FamilyChaos 2300#define FamilyInternet6 6 /* IPv6 */301302/* authentication families not tied to a specific protocol */303#define FamilyServerInterpreted 5304305/* Property notification */306307#define PropertyNewValue 0308#define PropertyDelete 1309310/* Color Map notification */311312#define ColormapUninstalled 0313#define ColormapInstalled 1314315/* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */316317#define GrabModeSync 0318#define GrabModeAsync 1319320/* GrabPointer, GrabKeyboard reply status */321322#define GrabSuccess 0323#define AlreadyGrabbed 1324#define GrabInvalidTime 2325#define GrabNotViewable 3326#define GrabFrozen 4327328/* AllowEvents modes */329330#define AsyncPointer 0331#define SyncPointer 1332#define ReplayPointer 2333#define AsyncKeyboard 3334#define SyncKeyboard 4335#define ReplayKeyboard 5336#define AsyncBoth 6337#define SyncBoth 7338339/* Used in SetInputFocus, GetInputFocus */340341#define RevertToNone (int)None342#define RevertToPointerRoot (int)PointerRoot343#define RevertToParent 2344345/*****************************************************************346* ERROR CODES347*****************************************************************/348349#define Success 0 /* everything's okay */350#define BadRequest 1 /* bad request code */351#define BadValue 2 /* int parameter out of range */352#define BadWindow 3 /* parameter not a Window */353#define BadPixmap 4 /* parameter not a Pixmap */354#define BadAtom 5 /* parameter not an Atom */355#define BadCursor 6 /* parameter not a Cursor */356#define BadFont 7 /* parameter not a Font */357#define BadMatch 8 /* parameter mismatch */358#define BadDrawable 9 /* parameter not a Pixmap or Window */359#define BadAccess 10 /* depending on context:360- key/button already grabbed361- attempt to free an illegal362cmap entry363- attempt to store into a read-only364color map entry.365- attempt to modify the access control366list from other than the local host.367*/368#define BadAlloc 11 /* insufficient resources */369#define BadColor 12 /* no such colormap */370#define BadGC 13 /* parameter not a GC */371#define BadIDChoice 14 /* choice not in range or already used */372#define BadName 15 /* font or color name doesn't exist */373#define BadLength 16 /* Request length incorrect */374#define BadImplementation 17 /* server is defective */375376#define FirstExtensionError 128377#define LastExtensionError 255378379/*****************************************************************380* WINDOW DEFINITIONS381*****************************************************************/382383/* Window classes used by CreateWindow */384/* Note that CopyFromParent is already defined as 0 above */385386#define InputOutput 1387#define InputOnly 2388389/* Window attributes for CreateWindow and ChangeWindowAttributes */390391#define CWBackPixmap (1L<<0)392#define CWBackPixel (1L<<1)393#define CWBorderPixmap (1L<<2)394#define CWBorderPixel (1L<<3)395#define CWBitGravity (1L<<4)396#define CWWinGravity (1L<<5)397#define CWBackingStore (1L<<6)398#define CWBackingPlanes (1L<<7)399#define CWBackingPixel (1L<<8)400#define CWOverrideRedirect (1L<<9)401#define CWSaveUnder (1L<<10)402#define CWEventMask (1L<<11)403#define CWDontPropagate (1L<<12)404#define CWColormap (1L<<13)405#define CWCursor (1L<<14)406407/* ConfigureWindow structure */408409#define CWX (1<<0)410#define CWY (1<<1)411#define CWWidth (1<<2)412#define CWHeight (1<<3)413#define CWBorderWidth (1<<4)414#define CWSibling (1<<5)415#define CWStackMode (1<<6)416417418/* Bit Gravity */419420#define ForgetGravity 0421#define NorthWestGravity 1422#define NorthGravity 2423#define NorthEastGravity 3424#define WestGravity 4425#define CenterGravity 5426#define EastGravity 6427#define SouthWestGravity 7428#define SouthGravity 8429#define SouthEastGravity 9430#define StaticGravity 10431432/* Window gravity + bit gravity above */433434#define UnmapGravity 0435436/* Used in CreateWindow for backing-store hint */437438#define NotUseful 0439#define WhenMapped 1440#define Always 2441442/* Used in GetWindowAttributes reply */443444#define IsUnmapped 0445#define IsUnviewable 1446#define IsViewable 2447448/* Used in ChangeSaveSet */449450#define SetModeInsert 0451#define SetModeDelete 1452453/* Used in ChangeCloseDownMode */454455#define DestroyAll 0456#define RetainPermanent 1457#define RetainTemporary 2458459/* Window stacking method (in configureWindow) */460461#define Above 0462#define Below 1463#define TopIf 2464#define BottomIf 3465#define Opposite 4466467/* Circulation direction */468469#define RaiseLowest 0470#define LowerHighest 1471472/* Property modes */473474#define PropModeReplace 0475#define PropModePrepend 1476#define PropModeAppend 2477478/*****************************************************************479* GRAPHICS DEFINITIONS480*****************************************************************/481482/* graphics functions, as in GC.alu */483484#define GXclear 0x0 /* 0 */485#define GXand 0x1 /* src AND dst */486#define GXandReverse 0x2 /* src AND NOT dst */487#define GXcopy 0x3 /* src */488#define GXandInverted 0x4 /* NOT src AND dst */489#define GXnoop 0x5 /* dst */490#define GXxor 0x6 /* src XOR dst */491#define GXor 0x7 /* src OR dst */492#define GXnor 0x8 /* NOT src AND NOT dst */493#define GXequiv 0x9 /* NOT src XOR dst */494#define GXinvert 0xa /* NOT dst */495#define GXorReverse 0xb /* src OR NOT dst */496#define GXcopyInverted 0xc /* NOT src */497#define GXorInverted 0xd /* NOT src OR dst */498#define GXnand 0xe /* NOT src OR NOT dst */499#define GXset 0xf /* 1 */500501/* LineStyle */502503#define LineSolid 0504#define LineOnOffDash 1505#define LineDoubleDash 2506507/* capStyle */508509#define CapNotLast 0510#define CapButt 1511#define CapRound 2512#define CapProjecting 3513514/* joinStyle */515516#define JoinMiter 0517#define JoinRound 1518#define JoinBevel 2519520/* fillStyle */521522#define FillSolid 0523#define FillTiled 1524#define FillStippled 2525#define FillOpaqueStippled 3526527/* fillRule */528529#define EvenOddRule 0530#define WindingRule 1531532/* subwindow mode */533534#define ClipByChildren 0535#define IncludeInferiors 1536537/* SetClipRectangles ordering */538539#define Unsorted 0540#define YSorted 1541#define YXSorted 2542#define YXBanded 3543544/* CoordinateMode for drawing routines */545546#define CoordModeOrigin 0 /* relative to the origin */547#define CoordModePrevious 1 /* relative to previous point */548549/* Polygon shapes */550551#define Complex 0 /* paths may intersect */552#define Nonconvex 1 /* no paths intersect, but not convex */553#define Convex 2 /* wholly convex */554555/* Arc modes for PolyFillArc */556557#define ArcChord 0 /* join endpoints of arc */558#define ArcPieSlice 1 /* join endpoints to center of arc */559560/* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into561GC.stateChanges */562563#define GCFunction (1L<<0)564#define GCPlaneMask (1L<<1)565#define GCForeground (1L<<2)566#define GCBackground (1L<<3)567#define GCLineWidth (1L<<4)568#define GCLineStyle (1L<<5)569#define GCCapStyle (1L<<6)570#define GCJoinStyle (1L<<7)571#define GCFillStyle (1L<<8)572#define GCFillRule (1L<<9)573#define GCTile (1L<<10)574#define GCStipple (1L<<11)575#define GCTileStipXOrigin (1L<<12)576#define GCTileStipYOrigin (1L<<13)577#define GCFont (1L<<14)578#define GCSubwindowMode (1L<<15)579#define GCGraphicsExposures (1L<<16)580#define GCClipXOrigin (1L<<17)581#define GCClipYOrigin (1L<<18)582#define GCClipMask (1L<<19)583#define GCDashOffset (1L<<20)584#define GCDashList (1L<<21)585#define GCArcMode (1L<<22)586587#define GCLastBit 22588/*****************************************************************589* FONTS590*****************************************************************/591592/* used in QueryFont -- draw direction */593594#define FontLeftToRight 0595#define FontRightToLeft 1596597#define FontChange 255598599/*****************************************************************600* IMAGING601*****************************************************************/602603/* ImageFormat -- PutImage, GetImage */604605#define XYBitmap 0 /* depth 1, XYFormat */606#define XYPixmap 1 /* depth == drawable depth */607#define ZPixmap 2 /* depth == drawable depth */608609/*****************************************************************610* COLOR MAP STUFF611*****************************************************************/612613/* For CreateColormap */614615#define AllocNone 0 /* create map with no entries */616#define AllocAll 1 /* allocate entire map writeable */617618619/* Flags used in StoreNamedColor, StoreColors */620621#define DoRed (1<<0)622#define DoGreen (1<<1)623#define DoBlue (1<<2)624625/*****************************************************************626* CURSOR STUFF627*****************************************************************/628629/* QueryBestSize Class */630631#define CursorShape 0 /* largest size that can be displayed */632#define TileShape 1 /* size tiled fastest */633#define StippleShape 2 /* size stippled fastest */634635/*****************************************************************636* KEYBOARD/POINTER STUFF637*****************************************************************/638639#define AutoRepeatModeOff 0640#define AutoRepeatModeOn 1641#define AutoRepeatModeDefault 2642643#define LedModeOff 0644#define LedModeOn 1645646/* masks for ChangeKeyboardControl */647648#define KBKeyClickPercent (1L<<0)649#define KBBellPercent (1L<<1)650#define KBBellPitch (1L<<2)651#define KBBellDuration (1L<<3)652#define KBLed (1L<<4)653#define KBLedMode (1L<<5)654#define KBKey (1L<<6)655#define KBAutoRepeatMode (1L<<7)656657#define MappingSuccess 0658#define MappingBusy 1659#define MappingFailed 2660661#define MappingModifier 0662#define MappingKeyboard 1663#define MappingPointer 2664665/*****************************************************************666* SCREEN SAVER STUFF667*****************************************************************/668669#define DontPreferBlanking 0670#define PreferBlanking 1671#define DefaultBlanking 2672673#define DisableScreenSaver 0674#define DisableScreenInterval 0675676#define DontAllowExposures 0677#define AllowExposures 1678#define DefaultExposures 2679680/* for ForceScreenSaver */681682#define ScreenSaverReset 0683#define ScreenSaverActive 1684685/*****************************************************************686* HOSTS AND CONNECTIONS687*****************************************************************/688689/* for ChangeHosts */690691#define HostInsert 0692#define HostDelete 1693694/* for ChangeAccessControl */695696#define EnableAccess 1697#define DisableAccess 0698699/* Display classes used in opening the connection700* Note that the statically allocated ones are even numbered and the701* dynamically changeable ones are odd numbered */702703#define StaticGray 0704#define GrayScale 1705#define StaticColor 2706#define PseudoColor 3707#define TrueColor 4708#define DirectColor 5709710711/* Byte order used in imageByteOrder and bitmapBitOrder */712713#define LSBFirst 0714#define MSBFirst 1715716#endif /* X_H */717718719