x.pp 18 KB

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