x.pp 18 KB

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