X.h
上传用户:shenzhenrh
上传日期:2013-05-12
资源大小:2904k
文件大小:18k
源码类别:

信息检索与抽取

开发平台:

Unix_Linux

  1. /*
  2.  * $XConsortium: X.h,v 1.66 88/09/06 15:55:56 jim Exp $
  3.  */
  4. /* Definitions for the X window system likely to be used by applications */
  5. #ifndef X_H
  6. #define X_H
  7. /***********************************************************
  8. Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  9. and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  10.                         All Rights Reserved
  11. Permission to use, copy, modify, and distribute this software and its 
  12. documentation for any purpose and without fee is hereby granted, 
  13. provided that the above copyright notice appear in all copies and that
  14. both that copyright notice and this permission notice appear in 
  15. supporting documentation, and that the names of Digital or MIT not be
  16. used in advertising or publicity pertaining to distribution of the
  17. software without specific, written prior permission.  
  18. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  19. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  20. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  21. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  22. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  23. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  24. SOFTWARE.
  25. ******************************************************************/
  26. #define X_PROTOCOL 11 /* current protocol version */
  27. #define X_PROTOCOL_REVISION 0 /* current minor version */
  28. #if defined(MAC_TCL) || defined(MAC_OSX_TK)
  29. #   define Cursor XCursor
  30. #   define Region XRegion
  31. #endif
  32. /* Resources */
  33. #ifdef _WIN64
  34. typedef __int64 XID;
  35. #else
  36. typedef unsigned long XID;
  37. #endif
  38. typedef XID Window;
  39. typedef XID Drawable;
  40. typedef XID Font;
  41. typedef XID Pixmap;
  42. typedef XID Cursor;
  43. typedef XID Colormap;
  44. typedef XID GContext;
  45. typedef XID KeySym;
  46. typedef unsigned long Mask;
  47. typedef unsigned long Atom;
  48. typedef unsigned long VisualID;
  49. typedef unsigned long Time;
  50. typedef unsigned long KeyCode; /* In order to use IME, the Macintosh needs
  51.  * to pack 3 bytes into the keyCode field in
  52.  * the XEvent.  In the real X.h, a KeyCode is
  53.  * defined as a short, which wouldn't be big
  54.  * enough. */
  55. /*****************************************************************
  56.  * RESERVED RESOURCE AND CONSTANT DEFINITIONS
  57.  *****************************************************************/
  58. #define None                 0L /* universal null resource or null atom */
  59. #define ParentRelative       1L /* background pixmap in CreateWindow
  60.     and ChangeWindowAttributes */
  61. #define CopyFromParent       0L /* border pixmap in CreateWindow
  62.        and ChangeWindowAttributes
  63.    special VisualID and special window
  64.        class passed to CreateWindow */
  65. #define PointerWindow        0L /* destination window in SendEvent */
  66. #define InputFocus           1L /* destination window in SendEvent */
  67. #define PointerRoot          1L /* focus window in SetInputFocus */
  68. #define AnyPropertyType      0L /* special Atom, passed to GetProperty */
  69. #define AnyKey      0L /* special Key Code, passed to GrabKey */
  70. #define AnyButton            0L /* special Button Code, passed to GrabButton */
  71. #define AllTemporary         0L /* special Resource ID passed to KillClient */
  72. #define CurrentTime          0L /* special Time */
  73. #define NoSymbol      0L /* special KeySym */
  74. /***************************************************************** 
  75.  * EVENT DEFINITIONS 
  76.  *****************************************************************/
  77. /* Input Event Masks. Used as event-mask window attribute and as arguments
  78.    to Grab requests.  Not to be confused with event names.  */
  79. #define NoEventMask 0L
  80. #define KeyPressMask (1L<<0)  
  81. #define KeyReleaseMask (1L<<1)  
  82. #define ButtonPressMask (1L<<2)  
  83. #define ButtonReleaseMask (1L<<3)  
  84. #define EnterWindowMask (1L<<4)  
  85. #define LeaveWindowMask (1L<<5)  
  86. #define PointerMotionMask (1L<<6)  
  87. #define PointerMotionHintMask (1L<<7)  
  88. #define Button1MotionMask (1L<<8)  
  89. #define Button2MotionMask (1L<<9)  
  90. #define Button3MotionMask (1L<<10) 
  91. #define Button4MotionMask (1L<<11) 
  92. #define Button5MotionMask (1L<<12) 
  93. #define ButtonMotionMask (1L<<13) 
  94. #define KeymapStateMask (1L<<14)
  95. #define ExposureMask (1L<<15) 
  96. #define VisibilityChangeMask (1L<<16) 
  97. #define StructureNotifyMask (1L<<17) 
  98. #define ResizeRedirectMask (1L<<18) 
  99. #define SubstructureNotifyMask (1L<<19) 
  100. #define SubstructureRedirectMask (1L<<20) 
  101. #define FocusChangeMask (1L<<21) 
  102. #define PropertyChangeMask (1L<<22) 
  103. #define ColormapChangeMask (1L<<23) 
  104. #define OwnerGrabButtonMask (1L<<24) 
  105. /* Event names.  Used in "type" field in XEvent structures.  Not to be
  106. confused with event masks above.  They start from 2 because 0 and 1
  107. are reserved in the protocol for errors and replies. */
  108. #define KeyPress 2
  109. #define KeyRelease 3
  110. #define ButtonPress 4
  111. #define ButtonRelease 5
  112. #define MotionNotify 6
  113. #define EnterNotify 7
  114. #define LeaveNotify 8
  115. #define FocusIn 9
  116. #define FocusOut 10
  117. #define KeymapNotify 11
  118. #define Expose 12
  119. #define GraphicsExpose 13
  120. #define NoExpose 14
  121. #define VisibilityNotify 15
  122. #define CreateNotify 16
  123. #define DestroyNotify 17
  124. #define UnmapNotify 18
  125. #define MapNotify 19
  126. #define MapRequest 20
  127. #define ReparentNotify 21
  128. #define ConfigureNotify 22
  129. #define ConfigureRequest 23
  130. #define GravityNotify 24
  131. #define ResizeRequest 25
  132. #define CirculateNotify 26
  133. #define CirculateRequest 27
  134. #define PropertyNotify 28
  135. #define SelectionClear 29
  136. #define SelectionRequest 30
  137. #define SelectionNotify 31
  138. #define ColormapNotify 32
  139. #define ClientMessage 33
  140. #define MappingNotify 34
  141. #define LASTEvent 35 /* must be bigger than any event # */
  142. /* Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer,
  143.    state in various key-, mouse-, and button-related events. */
  144. #define ShiftMask (1<<0)
  145. #define LockMask (1<<1)
  146. #define ControlMask (1<<2)
  147. #define Mod1Mask (1<<3)
  148. #define Mod2Mask (1<<4)
  149. #define Mod3Mask (1<<5)
  150. #define Mod4Mask (1<<6)
  151. #define Mod5Mask (1<<7)
  152. /* modifier names.  Used to build a SetModifierMapping request or
  153.    to read a GetModifierMapping request.  These correspond to the
  154.    masks defined above. */
  155. #define ShiftMapIndex 0
  156. #define LockMapIndex 1
  157. #define ControlMapIndex 2
  158. #define Mod1MapIndex 3
  159. #define Mod2MapIndex 4
  160. #define Mod3MapIndex 5
  161. #define Mod4MapIndex 6
  162. #define Mod5MapIndex 7
  163. /* button masks.  Used in same manner as Key masks above. Not to be confused
  164.    with button names below. */
  165. #define Button1Mask (1<<8)
  166. #define Button2Mask (1<<9)
  167. #define Button3Mask (1<<10)
  168. #define Button4Mask (1<<11)
  169. #define Button5Mask (1<<12)
  170. #define AnyModifier (1<<15)  /* used in GrabButton, GrabKey */
  171. /* button names. Used as arguments to GrabButton and as detail in ButtonPress
  172.    and ButtonRelease events.  Not to be confused with button masks above.
  173.    Note that 0 is already defined above as "AnyButton".  */
  174. #define Button1 1
  175. #define Button2 2
  176. #define Button3 3
  177. #define Button4 4
  178. #define Button5 5
  179. /* Notify modes */
  180. #define NotifyNormal 0
  181. #define NotifyGrab 1
  182. #define NotifyUngrab 2
  183. #define NotifyWhileGrabbed 3
  184. #define NotifyHint 1 /* for MotionNotify events */
  185.        
  186. /* Notify detail */
  187. #define NotifyAncestor 0
  188. #define NotifyVirtual 1
  189. #define NotifyInferior 2
  190. #define NotifyNonlinear 3
  191. #define NotifyNonlinearVirtual 4
  192. #define NotifyPointer 5
  193. #define NotifyPointerRoot 6
  194. #define NotifyDetailNone 7
  195. /* Visibility notify */
  196. #define VisibilityUnobscured 0
  197. #define VisibilityPartiallyObscured 1
  198. #define VisibilityFullyObscured 2
  199. /* Circulation request */
  200. #define PlaceOnTop 0
  201. #define PlaceOnBottom 1
  202. /* protocol families */
  203. #define FamilyInternet 0
  204. #define FamilyDECnet 1
  205. #define FamilyChaos 2
  206. /* Property notification */
  207. #define PropertyNewValue 0
  208. #define PropertyDelete 1
  209. /* Color Map notification */
  210. #define ColormapUninstalled 0
  211. #define ColormapInstalled 1
  212. /* GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */
  213. #define GrabModeSync 0
  214. #define GrabModeAsync 1
  215. /* GrabPointer, GrabKeyboard reply status */
  216. #define GrabSuccess 0
  217. #define AlreadyGrabbed 1
  218. #define GrabInvalidTime 2
  219. #define GrabNotViewable 3
  220. #define GrabFrozen 4
  221. /* AllowEvents modes */
  222. #define AsyncPointer 0
  223. #define SyncPointer 1
  224. #define ReplayPointer 2
  225. #define AsyncKeyboard 3
  226. #define SyncKeyboard 4
  227. #define ReplayKeyboard 5
  228. #define AsyncBoth 6
  229. #define SyncBoth 7
  230. /* Used in SetInputFocus, GetInputFocus */
  231. #define RevertToNone (int)None
  232. #define RevertToPointerRoot (int)PointerRoot
  233. #define RevertToParent 2
  234. /*****************************************************************
  235.  * ERROR CODES 
  236.  *****************************************************************/
  237. #define Success    0 /* everything's okay */
  238. #define BadRequest    1 /* bad request code */
  239. #define BadValue    2 /* int parameter out of range */
  240. #define BadWindow    3 /* parameter not a Window */
  241. #define BadPixmap    4 /* parameter not a Pixmap */
  242. #define BadAtom    5 /* parameter not an Atom */
  243. #define BadCursor    6 /* parameter not a Cursor */
  244. #define BadFont    7 /* parameter not a Font */
  245. #define BadMatch    8 /* parameter mismatch */
  246. #define BadDrawable    9 /* parameter not a Pixmap or Window */
  247. #define BadAccess   10 /* depending on context:
  248.  - key/button already grabbed
  249.  - attempt to free an illegal 
  250.    cmap entry 
  251. - attempt to store into a read-only 
  252.    color map entry.
  253.   - attempt to modify the access control
  254.    list from other than the local host.
  255. */
  256. #define BadAlloc   11 /* insufficient resources */
  257. #define BadColor   12 /* no such colormap */
  258. #define BadGC   13 /* parameter not a GC */
  259. #define BadIDChoice   14 /* choice not in range or already used */
  260. #define BadName   15 /* font or color name doesn't exist */
  261. #define BadLength   16 /* Request length incorrect */
  262. #define BadImplementation 17 /* server is defective */
  263. #define FirstExtensionError 128
  264. #define LastExtensionError 255
  265. /*****************************************************************
  266.  * WINDOW DEFINITIONS 
  267.  *****************************************************************/
  268. /* Window classes used by CreateWindow */
  269. /* Note that CopyFromParent is already defined as 0 above */
  270. #define InputOutput 1
  271. #define InputOnly 2
  272. /* Window attributes for CreateWindow and ChangeWindowAttributes */
  273. #define CWBackPixmap (1L<<0)
  274. #define CWBackPixel (1L<<1)
  275. #define CWBorderPixmap (1L<<2)
  276. #define CWBorderPixel           (1L<<3)
  277. #define CWBitGravity (1L<<4)
  278. #define CWWinGravity (1L<<5)
  279. #define CWBackingStore          (1L<<6)
  280. #define CWBackingPlanes         (1L<<7)
  281. #define CWBackingPixel         (1L<<8)
  282. #define CWOverrideRedirect (1L<<9)
  283. #define CWSaveUnder (1L<<10)
  284. #define CWEventMask (1L<<11)
  285. #define CWDontPropagate         (1L<<12)
  286. #define CWColormap (1L<<13)
  287. #define CWCursor         (1L<<14)
  288. /* ConfigureWindow structure */
  289. #define CWX (1<<0)
  290. #define CWY (1<<1)
  291. #define CWWidth (1<<2)
  292. #define CWHeight (1<<3)
  293. #define CWBorderWidth (1<<4)
  294. #define CWSibling (1<<5)
  295. #define CWStackMode (1<<6)
  296. /* Bit Gravity */
  297. #define ForgetGravity 0
  298. #define NorthWestGravity 1
  299. #define NorthGravity 2
  300. #define NorthEastGravity 3
  301. #define WestGravity 4
  302. #define CenterGravity 5
  303. #define EastGravity 6
  304. #define SouthWestGravity 7
  305. #define SouthGravity 8
  306. #define SouthEastGravity 9
  307. #define StaticGravity 10
  308. /* Window gravity + bit gravity above */
  309. #define UnmapGravity 0
  310. /* Used in CreateWindow for backing-store hint */
  311. #define NotUseful               0
  312. #define WhenMapped              1
  313. #define Always                  2
  314. /* Used in GetWindowAttributes reply */
  315. #define IsUnmapped 0
  316. #define IsUnviewable 1
  317. #define IsViewable 2
  318. /* Used in ChangeSaveSet */
  319. #define SetModeInsert           0
  320. #define SetModeDelete           1
  321. /* Used in ChangeCloseDownMode */
  322. #define DestroyAll              0
  323. #define RetainPermanent         1
  324. #define RetainTemporary         2
  325. /* Window stacking method (in configureWindow) */
  326. #define Above                   0
  327. #define Below                   1
  328. #define TopIf                   2
  329. #define BottomIf                3
  330. #define Opposite                4
  331. /* Circulation direction */
  332. #define RaiseLowest             0
  333. #define LowerHighest            1
  334. /* Property modes */
  335. #define PropModeReplace         0
  336. #define PropModePrepend         1
  337. #define PropModeAppend          2
  338. /*****************************************************************
  339.  * GRAPHICS DEFINITIONS
  340.  *****************************************************************/
  341. /* graphics functions, as in GC.alu */
  342. #define GXclear 0x0 /* 0 */
  343. #define GXand 0x1 /* src AND dst */
  344. #define GXandReverse 0x2 /* src AND NOT dst */
  345. #define GXcopy 0x3 /* src */
  346. #define GXandInverted 0x4 /* NOT src AND dst */
  347. #define GXnoop 0x5 /* dst */
  348. #define GXxor 0x6 /* src XOR dst */
  349. #define GXor 0x7 /* src OR dst */
  350. #define GXnor 0x8 /* NOT src AND NOT dst */
  351. #define GXequiv 0x9 /* NOT src XOR dst */
  352. #define GXinvert 0xa /* NOT dst */
  353. #define GXorReverse 0xb /* src OR NOT dst */
  354. #define GXcopyInverted 0xc /* NOT src */
  355. #define GXorInverted 0xd /* NOT src OR dst */
  356. #define GXnand 0xe /* NOT src OR NOT dst */
  357. #define GXset 0xf /* 1 */
  358. /* LineStyle */
  359. #define LineSolid 0
  360. #define LineOnOffDash 1
  361. #define LineDoubleDash 2
  362. /* capStyle */
  363. #define CapNotLast 0
  364. #define CapButt 1
  365. #define CapRound 2
  366. #define CapProjecting 3
  367. /* joinStyle */
  368. #define JoinMiter 0
  369. #define JoinRound 1
  370. #define JoinBevel 2
  371. /* fillStyle */
  372. #define FillSolid 0
  373. #define FillTiled 1
  374. #define FillStippled 2
  375. #define FillOpaqueStippled 3
  376. /* fillRule */
  377. #define EvenOddRule 0
  378. #define WindingRule 1
  379. /* subwindow mode */
  380. #define ClipByChildren 0
  381. #define IncludeInferiors 1
  382. /* SetClipRectangles ordering */
  383. #define Unsorted 0
  384. #define YSorted 1
  385. #define YXSorted 2
  386. #define YXBanded 3
  387. /* CoordinateMode for drawing routines */
  388. #define CoordModeOrigin 0 /* relative to the origin */
  389. #define CoordModePrevious       1 /* relative to previous point */
  390. /* Polygon shapes */
  391. #define Complex 0 /* paths may intersect */
  392. #define Nonconvex 1 /* no paths intersect, but not convex */
  393. #define Convex 2 /* wholly convex */
  394. /* Arc modes for PolyFillArc */
  395. #define ArcChord 0 /* join endpoints of arc */
  396. #define ArcPieSlice 1 /* join endpoints to center of arc */
  397. /* GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into
  398.    GC.stateChanges */
  399. #define GCFunction              (1L<<0)
  400. #define GCPlaneMask             (1L<<1)
  401. #define GCForeground            (1L<<2)
  402. #define GCBackground            (1L<<3)
  403. #define GCLineWidth             (1L<<4)
  404. #define GCLineStyle             (1L<<5)
  405. #define GCCapStyle              (1L<<6)
  406. #define GCJoinStyle (1L<<7)
  407. #define GCFillStyle (1L<<8)
  408. #define GCFillRule (1L<<9) 
  409. #define GCTile (1L<<10)
  410. #define GCStipple (1L<<11)
  411. #define GCTileStipXOrigin (1L<<12)
  412. #define GCTileStipYOrigin (1L<<13)
  413. #define GCFont  (1L<<14)
  414. #define GCSubwindowMode (1L<<15)
  415. #define GCGraphicsExposures     (1L<<16)
  416. #define GCClipXOrigin (1L<<17)
  417. #define GCClipYOrigin (1L<<18)
  418. #define GCClipMask (1L<<19)
  419. #define GCDashOffset (1L<<20)
  420. #define GCDashList (1L<<21)
  421. #define GCArcMode (1L<<22)
  422. #define GCLastBit 22
  423. /*****************************************************************
  424.  * FONTS 
  425.  *****************************************************************/
  426. /* used in QueryFont -- draw direction */
  427. #define FontLeftToRight 0
  428. #define FontRightToLeft 1
  429. #define FontChange 255
  430. /*****************************************************************
  431.  *  IMAGING 
  432.  *****************************************************************/
  433. /* ImageFormat -- PutImage, GetImage */
  434. #define XYBitmap 0 /* depth 1, XYFormat */
  435. #define XYPixmap 1 /* depth == drawable depth */
  436. #define ZPixmap 2 /* depth == drawable depth */
  437. /*****************************************************************
  438.  *  COLOR MAP STUFF 
  439.  *****************************************************************/
  440. /* For CreateColormap */
  441. #define AllocNone 0 /* create map with no entries */
  442. #define AllocAll 1 /* allocate entire map writeable */
  443. /* Flags used in StoreNamedColor, StoreColors */
  444. #define DoRed (1<<0)
  445. #define DoGreen (1<<1)
  446. #define DoBlue (1<<2)
  447. /*****************************************************************
  448.  * CURSOR STUFF
  449.  *****************************************************************/
  450. /* QueryBestSize Class */
  451. #define CursorShape 0 /* largest size that can be displayed */
  452. #define TileShape 1 /* size tiled fastest */
  453. #define StippleShape 2 /* size stippled fastest */
  454. /***************************************************************** 
  455.  * KEYBOARD/POINTER STUFF
  456.  *****************************************************************/
  457. #define AutoRepeatModeOff 0
  458. #define AutoRepeatModeOn 1
  459. #define AutoRepeatModeDefault 2
  460. #define LedModeOff 0
  461. #define LedModeOn 1
  462. /* masks for ChangeKeyboardControl */
  463. #define KBKeyClickPercent (1L<<0)
  464. #define KBBellPercent (1L<<1)
  465. #define KBBellPitch (1L<<2)
  466. #define KBBellDuration (1L<<3)
  467. #define KBLed (1L<<4)
  468. #define KBLedMode (1L<<5)
  469. #define KBKey (1L<<6)
  470. #define KBAutoRepeatMode (1L<<7)
  471. #define MappingSuccess      0
  472. #define MappingBusy         1
  473. #define MappingFailed 2
  474. #define MappingModifier 0
  475. #define MappingKeyboard 1
  476. #define MappingPointer 2
  477. /*****************************************************************
  478.  * SCREEN SAVER STUFF 
  479.  *****************************************************************/
  480. #define DontPreferBlanking 0
  481. #define PreferBlanking 1
  482. #define DefaultBlanking 2
  483. #define DisableScreenSaver 0
  484. #define DisableScreenInterval 0
  485. #define DontAllowExposures 0
  486. #define AllowExposures 1
  487. #define DefaultExposures 2
  488. /* for ForceScreenSaver */
  489. #define ScreenSaverReset 0
  490. #define ScreenSaverActive 1
  491. /*****************************************************************
  492.  * HOSTS AND CONNECTIONS
  493.  *****************************************************************/
  494. /* for ChangeHosts */
  495. #define HostInsert 0
  496. #define HostDelete 1
  497. /* for ChangeAccessControl */
  498. #define EnableAccess 1      
  499. #define DisableAccess 0
  500. /* Display classes  used in opening the connection 
  501.  * Note that the statically allocated ones are even numbered and the
  502.  * dynamically changeable ones are odd numbered */
  503. #define StaticGray 0
  504. #define GrayScale 1
  505. #define StaticColor 2
  506. #define PseudoColor 3
  507. #define TrueColor 4
  508. #define DirectColor 5
  509. /* Byte order  used in imageByteOrder and bitmapBitOrder */
  510. #define LSBFirst 0
  511. #define MSBFirst 1
  512. #if defined(MAC_TCL) || defined(MAC_OSX_TK)
  513. #   undef Cursor
  514. #   undef Region
  515. #endif
  516. #endif /* X_H */