1: #include <X/mit-copyright.h> 2: 3: /* Copyright Massachusetts Institute of Technology 1985 */ 4: /* $Header: X.h,v 10.10 86/02/01 15:15:16 tony Rel $ */ 5: 6: /* Definitions for the X window system likely to be used by applications */ 7: 8: #define X_PROTOCOL 10 /* current protocol version */ 9: 10: /* Resources */ 11: 12: typedef long Window; 13: typedef long Font; 14: typedef long Bitmap; 15: typedef long Pixmap; 16: typedef long Cursor; 17: typedef long Locator; 18: 19: /* Input Event Codes */ 20: 21: #define NoEvent 0x0000 22: #define KeyPressed 0x0001 /* keyboard key pressed */ 23: #define KeyReleased 0x0002 /* keyboard key released */ 24: #define ButtonPressed 0x0004 /* mouse button pressed */ 25: #define ButtonReleased 0x0008 /* mouse button released */ 26: #define EnterWindow 0x0010 /* mouse entering window */ 27: #define LeaveWindow 0x0020 /* mouse leaving window */ 28: #define MouseMoved 0x0040 /* mouse moves within window */ 29: #define ExposeWindow 0x0080 /* full window changed and/or exposed */ 30: #define ExposeRegion 0x0100 /* region of window exposed */ 31: #define ExposeCopy 0x0200 /* region exposed by X_CopyArea */ 32: #define RightDownMotion 0x0400 /* mouse moves with right button down */ 33: #define MiddleDownMotion 0x0800 /* mouse moves with middle button down */ 34: #define LeftDownMotion 0x1000 /* mouse moves with left button down */ 35: #define UnmapWindow 0x2000 /* window is unmapped */ 36: #define FocusChange 0x4000 /* keyboard focus changed */ 37: 38: /* Event detail bits */ 39: 40: #define ControlMask 0x4000 /* Control key */ 41: #define MetaMask 0x2000 /* Meta (Symbol) key */ 42: #define ShiftMask 0x1000 /* Shift key */ 43: #define ShiftLockMask 0x0800 /* ShiftLock key */ 44: #define LeftMask 0x0400 /* Left button */ 45: #define MiddleMask 0x0200 /* Middle button */ 46: #define RightMask 0x0100 /* Right button */ 47: #define ValueMask 0x00ff /* Key/button code */ 48: 49: #define KeyState(x) (((x) & (ControlMask|MetaMask|ShiftMask)) >> 12) 50: #define FullKeyState(x) (((x) & (ControlMask|MetaMask|ShiftMask|ShiftLockMask)) >> 11) 51: #define ButtonState(x) (((x) & (LeftMask|MiddleMask|RightMask)) >> 8) 52: 53: /* Button event detail codes */ 54: 55: #define RightButton 0 56: #define MiddleButton 1 57: #define LeftButton 2 58: 59: /* Enter/Leave event detail codes */ 60: 61: #define IntoOrFromSubwindow 1 62: #define VirtualCrossing 2 63: 64: /* These are the error codes */ 65: 66: #define BadRequest 1 /* bad request code */ 67: #define BadValue 2 /* int parameter out of range */ 68: #define BadWindow 3 /* parameter not a Window */ 69: #define BadPixmap 4 /* parameter not a Pixmap */ 70: #define BadBitmap 5 /* parameter not a Bitmap */ 71: #define BadCursor 6 /* parameter not a Cursor */ 72: #define BadFont 7 /* parameter not a Font */ 73: #define BadMatch 8 /* parameter mismatch */ 74: #define BadTile 9 /* Pixmap shape invalid for tiling */ 75: #define BadGrab 10 /* mouse/button already grabbed */ 76: #define BadAccess 11 /* access control violation */ 77: #define BadAlloc 12 /* insufficient resources */ 78: #define BadColor 13 /* no such color */ 79: 80: /* for monochrome applications */ 81: 82: #define BlackPixel 0 /* may not actually be black */ 83: #define WhitePixel 1 /* may not actually be white */ 84: 85: /* graphics functions */ 86: 87: #define GXclear 0x0 /* 0 */ 88: #define GXand 0x1 /* src AND dst */ 89: #define GXandReverse 0x2 /* src AND NOT dst */ 90: #define GXcopy 0x3 /* src */ 91: #define GXandInverted 0x4 /* NOT src AND dst */ 92: #define GXnoop 0x5 /* dst */ 93: #define GXxor 0x6 /* src XOR dst */ 94: #define GXor 0x7 /* src OR dst */ 95: #define GXnor 0x8 /* NOT src AND NOT dst */ 96: #define GXequiv 0x9 /* NOT src XOR dst */ 97: #define GXinvert 0xa /* NOT dst */ 98: #define GXorReverse 0xb /* src OR NOT dst */ 99: #define GXcopyInverted 0xc /* NOT src */ 100: #define GXorInverted 0xd /* NOT src OR dst */ 101: #define GXnand 0xe /* NOT src OR NOT dst */ 102: #define GXset 0xf /* 1 */ 103: 104: /* Used in X_TileMode */ 105: 106: #define TileModeAbsolute 0 107: #define TileModeRelative 1 108: 109: /* Used in X_ClipMode */ 110: 111: #define ClipModeClipped 0 112: #define ClipModeDrawThru 1 113: 114: /* Used in X_QueryWindow reply */ 115: 116: #define IsUnmapped 0 117: #define IsMapped 1 118: #define IsInvisible 2 119: 120: #define IsTransparent 0 121: #define IsOpaque 1 122: #define IsIcon 2 123: 124: /* Used in X_Draw */ 125: 126: #define DrawSolidLine 0 127: #define DrawDashedLine 1 128: #define DrawPatternedLine 2 129: 130: /* Used in X_Draw and X_DrawFilled */ 131: 132: typedef struct _Vertex { 133: short x, y; 134: unsigned short flags; 135: } Vertex; 136: 137: /* The meanings of the flag bits. If the bit is 1 the predicate is true */ 138: 139: #define VertexRelative 0x0001 /* else absolute */ 140: #define VertexDontDraw 0x0002 /* else draw */ 141: #define VertexCurved 0x0004 /* else straight */ 142: #define VertexStartClosed 0x0008 /* else not */ 143: #define VertexEndClosed 0x0010 /* else not */ 144: #define VertexDrawLastPoint 0x0020 /* else don't */ 145: 146: /* Device identifiers returned by X_SetUp */ 147: 148: #define XDEV_XNEST 0 /* X in an X window */ 149: 150: /* DEC address space 1-99 */ 151: #define XDEV_VS100 1 /* DEC VS100 */ 152: #define XDEV_QVSS 2 /* DEC QVSS (VS1 and VS2) */ 153: #define XDEV_QDSS 3 /* DEC QDSS display */ 154: #define XDEV_DECXXX 4 /* reserved for future use */ 155: #define XDEV_DECYYY 5 /* reserved for future use */ 156: #define XDEV_DECZZZ 6 /* reserved for future use */ 157: 158: /* Cognition address space 100-199 */ 159: #define XDEV_LEX90 100 /* Lexidata 90, Cognition */ 160: 161: /* IBM address space 200-299 */ 162: #define XDEV_IBMACIS 200 /* IBM ACIS display, wuf, RT/PC*/ 163: #define XDEV_IBMAPA8 201 /* IBM APA8 display, RT/PC */ 164: #define XDEV_IBMAPA16 202 /* IBM APA16 display, RT/PC */ 165: 166: /* SMI address space 300-399 */ 167: #define SUN_BASE 300 /* base of SMI displays */ 168: #ifndef FBTYPE_SUN1BW 169: /* from /usr/include/sun/fbio.h */ 170: #define FBTYPE_SUN1BW 0 171: #define FBTYPE_SUN1COLOR 1 172: #define FBTYPE_SUN2BW 2 173: #define FBTYPE_SUN2COLOR 3 174: #define FBTYPE_SUN2GP 4 /* reserved for future Sun use */ 175: #define FBTYPE_SUN3BW 5 /* reserved for future Sun use */ 176: #define FBTYPE_SUN3COLOR 6 /* reserved for future Sun use */ 177: #define FBTYPE_SUN4BW 7 /* reserved for future Sun use */ 178: #define FBTYPE_SUN4COLOR 8 /* reserved for future Sun use */ 179: #define FBTYPE_NOTSUN1 9 /* reserved for Sun customer */ 180: #define FBTYPE_NOTSUN2 10 /* reserved for Sun customer */ 181: #define FBTYPE_NOTSUN3 11 /* reserved for Sun customer */ 182: #endif 183: #define XDEV_SUN1BW FBTYPE_SUN1BW+SUN_BASE 184: #define XDEV_SUN1COLOR FBTYPE_SUN1COLOR+SUN_BASE 185: #define XDEV_SUN2BW FBTYPE_SUN2BW+SUN_BASE 186: #define XDEV_SUN2COLOR FBTYPE_SUN2COLOR+SUN_BASE 187: #define XDEV_SUN2GP FBTYPE_SUN2GP+SUN_BASE 188: #define XDEV_SUN3BW FBTYPE_SUN3BW+SUN_BASE 189: #define XDEV_SUN3COLOR FBTYPE_SUN3COLOR+SUN_BASE 190: #define XDEV_SUN4BW FBTYPE_SUN4BW+SUN_BASE 191: #define XDEV_SUN4COLOR FBTYPE_SUN4COLOR+SUN_BASE 192: #define XDEV_NOTSUN1 FBTYPE_NOTSUN1+SUN_BASE 193: #define XDEV_NOTSUN2 FBTYPE_NOTSUN2+SUN_BASE 194: #define XDEV_NOTSUN3 FBTYPE_NOTSUN3+SUN_BASE 195: 196: /* MASSCOMP address space 400-499 */ 197: #define XDEV_MC1 401 /* Masscomp, in progress */ 198: #define XDEV_MC2 402 /* Masscomp, (not implemented) */ 199: #define XDEV_MC3 403 /* Masscomp, (not implemented) */ 200: 201: /* Jupiter Systems address space 500-599 */ 202: #define XDEV_PGP20 501 /* 24 bit deep frame buffer */ 203: 204: /* Used in X_StoreColors */ 205: 206: typedef struct _ColorDef { 207: unsigned short pixel; 208: unsigned short red, green, blue; 209: } ColorDef; 210: 211: /* Used in X_PixmapBitsPut and X_StorePixmap */ 212: 213: #define XYFormat 0 214: #define ZFormat 1 215: 216: /* size in bytes of a bitmap */ 217: #define BitmapSize(width, height) (((((width) + 15) >> 3) &~ 1) * (height)) 218: /* size in bytes of a pixmap in XYFormat */ 219: #define XYPixmapSize(width, height, planes) (BitmapSize(width, height) * (planes)) 220: /* size in bytes of a pizmap in ZFormat for 9 to 16 bit planes */ 221: #define WZPixmapSize(width, height) (((width) * (height)) << 1) 222: /* size in bytes of a pixmap in ZFormat for 2 to 8 bit planes */ 223: #define BZPixmapSize(width, height) ((width) * (height)) 224: 225: /* Used in X_QueryShape */ 226: 227: #define CursorShape 0 228: #define TileShape 1 229: #define BrushShape 2 230: 231: /* Used in X_ShiftLock */ 232: 233: #define LockUpDownMode 0 234: #define LockToggleMode 1 235: 236: /* Used in X_AddHost, X_RemoveHost, and X_GetHosts */ 237: 238: #define XAF_INET 2 239: #define XAF_DECnet 12