home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lifeos2.zip / LIFE-1.02 / LIB / X_GETSET.LF < prev    next >
Text File  |  1996-06-04  |  18KB  |  398 lines

  1. %    $Id: x_getset.lf,v 1.2 1994/12/09 00:27:26 duchier Exp $    
  2. module("x")? % RM: Mar 24 1993 
  3.  
  4. % Copyright 1992 Digital Equipment Corporation.
  5. % Distributed only by permission.
  6. %
  7. % Last modified on Mon Jun  7 17:35:19 MET DST 1993 by dumant
  8. %      modified on Wed Mar 24 06:25:02 1993 by Rmeyer
  9. %      modified on Thu Aug 27 17:41:06 MET DST 1992 by herve
  10. %
  11. %
  12. % X functions xGet* and xSet* for Life
  13.  
  14.  
  15. % connection attributes
  16. xGetConnectionNetworkDescriptor (C) -> V | xcGetConnectionAttribute(C, 0, V).
  17. xGetConnectionProtocolVersion (C) -> V | xcGetConnectionAttribute(C, 1, V).
  18. xGetConnectionProtocolRevision (C) -> V | xcGetConnectionAttribute(C, 2, V).
  19. xGetConnectionServerVendor (C) -> V | xcGetConnectionAttribute(C, 3, V).
  20. xGetConnectionImageByteOrder (C) -> V | 
  21.         xcGetConnectionAttribute(C, 4, R), 
  22.     xBoolean(V, R).
  23. xGetConnectionImageUnit (C) -> V | xcGetConnectionAttribute(C, 5, V).
  24. xGetConnectionImagePad (C) -> V | xcGetConnectionAttribute(C, 6, V).
  25. xGetConnectionImageBitOrder (C) -> V | 
  26.         xcGetConnectionAttribute(C, 7, R), 
  27.     xBoolean(V, R).
  28. xGetConnectionVendorRelease (C) -> V | xcGetConnectionAttribute(C, 8, V).
  29. xGetConnectionQueueLength (C) -> V | xcGetConnectionAttribute(C, 9, V).
  30. xGetConnectionLastEvent (C) -> V | xcGetConnectionAttribute(C, 10, L).
  31. xGetConnectionLastRequest (C) -> V | xcGetConnectionAttribute(C, 11, L).
  32. xGetConnectionConnectionName (C) -> V | xcGetConnectionAttribute(C, 12, V).
  33. xGetConnectionDefaultScreen (C) -> V | xcGetConnectionAttribute(C, 13, V).
  34. xGetConnectionMinKeycode (C) -> V | xcGetConnectionAttribute(C, 14, V).
  35. xGetConnectionMaxKeycode (C) -> V | xcGetConnectionAttribute(C, 15, V).
  36. xGetConnectionScreens (C) -> V | 
  37.         xcGetConnectionAttribute(C, 16, N), 
  38.     pxListGet(N, V).
  39. xGetConnectionMotionBuffer (C) -> V | xcGetConnectionAttribute(C, 17, V).
  40. xGetConnectionFormats (C) -> V | 
  41.         xcGetConnectionAttribute(C, 18, N), 
  42.     pxListGet(N, V).
  43.  
  44.  
  45. % format attributes
  46. xGetFormatConnection(F) -> V | xcGetFormatAttribute(F, 0, V).
  47. xGetFormatDepth(F) -> V | xcGetFormatAttribute(F, 1, V).
  48. xGetFormatBits(F) -> V | xcGetFormatAttribute(F, 2, V).
  49. xGetFormatPad(F) -> V | xcGetFormatAttribute(F, 3, V).
  50.  
  51.  
  52. % screen attributes
  53. xGetScreenConnection(C,S) -> V | xcGetScreenAttribute(C, S, 0, V).
  54. xGetScreenRootWindow(C,S) -> V | xcGetScreenAttribute(C, S, 1, V).
  55. xGetScreenWidth(C,S) -> V | xcGetScreenAttribute(C, S, 2, V).
  56. xGetScreenHeight(C,S) -> V | xcGetScreenAttribute(C, S, 3, V).
  57. xGetScreenPhysicalWidth(C,S) -> V | xcGetScreenAttribute(C, S, 4, V).
  58. xGetScreenPhysicalHeight(C,S) -> V | xcGetScreenAttribute(C, S, 5, V).
  59. xGetScreenRootDepth(C,S) -> V | xcGetScreenAttribute(C, S, 6, V).
  60. xGetScreenRootVisual(C,S) -> V | xcGetScreenAttribute(C, S, 7, V).
  61. xGetScreenDefaultGC(C,S) -> V | xcGetScreenAttribute(C, S, 8, V).
  62. xGetScreenDefaultColormap(C,S) -> V | xcGetScreenAttribute(C, S, 9, V).
  63. xGetScreenWhitePixel(C,S) -> V | xcGetScreenAttribute(C, S, 10, V).
  64. xGetScreenBlackPixel(C,S) -> V | xcGetScreenAttribute(C, S, 11, V).
  65. xGetScreenMaxColormaps(C,S) -> V | xcGetScreenAttribute(C, S, 12, V).
  66. xGetScreenMinColormaps(C,S) -> V | xcGetScreenAttribute(C, S, 13, V).
  67. xGetScreenBackingStore(C,S) -> V | xcGetScreenAttribute(C, S, 14, V). 
  68. xGetScreenSaveUnders(C,S) -> V | 
  69.         xcGetScreenAttribute(C, S, 15, R), 
  70.     xBoolean(V, R).
  71. xGetScreenRootEventMask(C,S) -> V | 
  72.         xcGetScreenAttribute(C, S, 16, V). 
  73. xGetScreenDepths(C,S) -> V | 
  74.         xcGetScreenAttribute(C, S, 17, N), 
  75.     pxListGet(N, V).
  76.  
  77.  
  78. % depth attributes 
  79. xGetDepths(D) -> V | xcGetDepthAttribute(D, 0, V).
  80. xGetVisuals(D) -> V | xcGetDepthAttribute(D, 1, N), pxListGet(N, V).
  81.  
  82.  
  83. % visual attribute 
  84. xGetVisualClass(Vis) -> V | xcGetVisualAttribute(Vis, 0, V).
  85. xGetVisualRedMask(Vis) -> V | xcGetVisualAttribute(Vis, 1, V).
  86. xGetVisualGreenMask(Vis) -> V | xcGetVisualAttribute(Vis, 2, V).
  87. xGetVisualBlueMask(Vis) -> V | xcGetVisualAttribute(Vis, 3, V).
  88. xGetVisualColormapBits(Vis) -> V | xcGetVisualAttribute(Vis, 4, V).
  89. xGetVisualColormapEntries(Vis) -> V | xcGetVisualAttribute(Vis, 5, V).
  90.  
  91.  
  92. % get window attribute 
  93. xGetWindowX (W:@(display=>Display))
  94.     -> V | xcGetWindowAttribute(Display, W, 0, V).
  95. xGetWindowY (W:@(display=>Display))
  96.     -> V | xcGetWindowAttribute(Display, W, 1, V).
  97. xGetWindowWidth (W:@(display=>Display))
  98.     -> V | xcGetWindowAttribute(Display, W, 2, V).
  99. xGetWindowHeight (W:@(display=>Display))
  100.     -> V | xcGetWindowAttribute(Display, W, 3, V).
  101. xGetWindowBorderWidth (W:@(display=>Display))
  102.     -> V | xcGetWindowAttribute(Display, W, 4, V).
  103. xGetWindowDepth (W:@(display=>Display))
  104.     -> V | xcGetWindowAttribute(Display, W, 5, V).
  105. xGetWindowRootWindow (W:@(display=>Display))
  106.     -> V | xcGetWindowAttribute(Display, W, 6, V).
  107. xGetWindowScreen (W:@(display=>Display))
  108.     -> V | xcGetWindowAttribute(Display, W, 7, V).
  109. xGetWindowVisual (W:@(display=>Display))
  110.     -> V | xcGetWindowAttribute(Display, W, 8, V).
  111. xGetWindowClass (W:@(display=>Display))
  112.     -> V | xcGetWindowAttribute(Display, W, 9, V).
  113. xGetWindowUnionEventMask (W:@(display=>Display))
  114.     -> V | xcGetWindowAttribute(Display, W, 10, V).
  115. xGetWindowBitGravity (W:@(display=>Display))
  116.     -> V | xcGetWindowAttribute(Display, W, 11, V).
  117. xGetWindowWinGravity (W:@(display=>Display))
  118.     -> V | xcGetWindowAttribute(Display, W, 12, V).
  119. xGetWindowBackingStore (W:@(display=>Display))
  120.     -> V | xcGetWindowAttribute(Display, W, 13, V).
  121. xGetWindowBackingPlanes (W:@(display=>Display))
  122.     -> V | xcGetWindowAttribute(Display, W, 14, V).
  123. xGetWindowBackingPixel (W:@(display=>Display))
  124.     -> V | xcGetWindowAttribute(Display, W, 15, V).
  125. xGetWindowOverrideRedirect (W:@(display=>Display))
  126.     -> V | xcGetWindowAttribute(Display, W, 16, R), xBoolean(V, R).
  127. xGetWindowSaveUnder (W:@(display=>Display))
  128.     -> V | xcGetWindowAttribute(Display, W, 17, R), xBoolean(V, R).
  129. xGetWindowEventMask (W:@(display=>Display))
  130.     -> V | xcGetWindowAttribute(Display, W, 18, V).
  131. xGetWindowDontPropagate (W:@(display=>Display))
  132.     -> V | xcGetWindowAttribute(Display, W, 19, V).
  133. xGetWindowColormap (W:@(display=>Display))
  134.     -> V | xcGetWindowAttribute(Display, W, 20, V).
  135. xGetWindowColormapLoaded (W:@(display=>Display))
  136.     -> V | xcGetWindowAttribute(Display, W, 21, R), xBoolean(V, R).
  137. xGetWindowState (W:@(display=>Display))
  138.     -> V | xcGetWindowAttribute(Display, W, 22, V).
  139.  
  140.  
  141. % set window attribute 
  142. xSetWindowX(W:@(display=>Display), V) 
  143.     :- xcSetWindowAttribute(Display, W, 0, V).
  144. xSetWindowY(W:@(display=>Display), V) 
  145.     :- xcSetWindowAttribute(Display, W, 1, V).
  146. xSetWindowWidth(W:@(display=>Display), V) 
  147.     :- xcSetWindowAttribute(Display, W, 2, V).
  148. xSetWindowHeight(W:@(display=>Display), V) 
  149.     :- xcSetWindowAttribute(Display, W, 3, V).
  150. xSetWindowBorderWidth(W:@(display=>Display), V) 
  151.     :- xcSetWindowAttribute(Display, W, 4, V).
  152. xSetWindowBitGravity(W:@(display=>Display), V) 
  153.     :- xcSetWindowAttribute(Display, W, 11, V).
  154. xSetWindowWinGravity(W:@(display=>Display), V) 
  155.     :- xcSetWindowAttribute(Display, W, 12, V).
  156. xSetWindowBackingStore(W:@(display=>Display), V) 
  157.     :- xBackingStore(V, R), xcSetWindowAttribute(Display, W, 13, R).
  158. xSetWindowBackingPlanes(W:@(display=>Display), V) 
  159.     :- xcSetWindowAttribute(Display, W, 14, V).
  160. xSetWindowBackingPixel(W:@(display=>Display), V) 
  161.     :- xcSetWindowAttribute(Display, W, 15, V).
  162. xSetWindowOverrideRedirect(W:@(display=>Display), V) 
  163.     :- xBoolean(V, R), xcSetWindowAttribute(Display, W, 16, R).
  164. xSetWindowSaveUnder(W:@(display=>Display), V) 
  165.     :- xBoolean(V, R), xcSetWindowAttribute(Display, W, 17, R).
  166.  
  167. xSetWindowEventMask(W:@(display=>Display), V) 
  168.     :- %pxMaskFromBits(V, R, pxmEvent), 
  169.     xcSetWindowAttribute(Display, W, 18, V).
  170.  
  171. xSetWindowDontPropagate(W:@(display=>Display), V) 
  172.     :- %pxMaskFromBits(V, R, pxmEvent), 
  173.     xcSetWindowAttribute(Display, W, 19, R).
  174.  
  175. xSetWindowColormap(W:@(display=>Display), V) 
  176.     :- xcSetWindowAttribute(Display, W, 20, V).
  177. xSetWindowSibling(W:@(display=>Display), V) 
  178.     :- xcSetWindowAttribute(Display, W, 23, V).
  179. xSetWindowStackMode(W:@(display=>Display), V) 
  180.     :- xcSetWindowAttribute(Display, W, 24, V).
  181. xSetWindowBackPixmap(W:@(display=>Display), V) 
  182.     :- xcSetWindowAttribute(Display, W, 25, V).
  183. xSetWindowBackPixel(W:@(display=>Display), V) 
  184.     :- xcSetWindowAttribute(Display, W, 26, V), xcSync(Display,0).
  185. xSetWindowBorderPixmap(W:@(display=>Display), V) 
  186.     :- xParent(R,V), xcSetWindowAttribute(Display, W, 27, R).
  187. xSetWindowBorderPixel(W:@(display=>Display), V) 
  188.     :- xcSetWindowAttribute(Display, W, 28, V).
  189. xSetWindowCursor(W:@(display=>Display), V) 
  190.     :- xcSetWindowAttribute(Display, W, 29, V).
  191.  
  192.  
  193. % TO BE CHANGED: ADD THE PIXMAP IN THE PARAMETERS
  194. % pixmap attributes
  195. xGetPixmapWidth(V) :- xcGetPixmapAttribute(0, V).
  196. xGetPixmapHeight(V) :- xcGetPixmapAttribute(1, V).
  197. xGetPixmapBorderWidth(V) :- xcGetPixmapAttribute(2, V).
  198. xGetPixmapDepth(V) :- xcGetPixmapAttribute(3, V).
  199. xGetPixmapScreen(V) :- xcGetPixmapAttribute(4, V).
  200.  
  201.  
  202. % get GC attributes   
  203.  
  204.      %%% passer C en arguments est absolument inutile !!!
  205.     
  206. xGetGCFunction(C, GC) -> V | xcGetGCAttribute(GC, 0, V).
  207. xGetGCPlaneMask(C, GC) -> V | xcGetGCAttribute(GC, 1, V).
  208. xGetGCForeground(C, GC) -> V | xcGetGCAttribute(GC, 2, V).
  209. xGetGCBackground(C, GC) -> V | xcGetGCAttribute(GC, 3, V).
  210. xGetGCLineWidth(C, GC) -> V | xcGetGCAttribute(GC, 4, V).
  211. xGetGCLineStyle(C, GC) -> V | xcGetGCAttribute(GC, 5, V).
  212. xGetGCCapStyle(C, GC) -> V | xcGetGCAttribute(GC, 6, R), xCapStyle(V, R).
  213. xGetGCJoinStyle(C, GC) -> V | xcGetGCAttribute(GC, 7, R), xJoinStyle(V, R).
  214. xGetGCFillStyle(C, GC) -> V | xcGetGCAttribute(GC, 8, V).
  215. xGetGCFillRule(C, GC) -> V | xcGetGCAttribute(GC, 9, R), xBoolean(V, R).
  216. xGetGCTile(C, GC) -> V | xcGetGCAttribute(GC, 10, V).
  217. xGetGCStipple(C, GC) -> V | xcGetGCAttribute(GC, 11, V).
  218. xGetGCTileStipXOrigin(C, GC) -> V | xcGetGCAttribute(GC, 12, V).
  219. xGetGCTileStipYOrigin(C, GC) -> V | xcGetGCAttribute(GC, 13, V).
  220. xGetGCFont(C, GC) -> V | xcGetGCAttribute(GC, 14, V).
  221. xGetGCSubwindowMode(C, GC) -> V | xcGetGCAttribute(GC, 15, R), xBoolean(V, R).
  222. xGetGCGraphicsExposures(C, GC) -> V | 
  223.         xcGetGCAttribute(GC, 16, R), 
  224.     xBoolean(V, R).
  225. xGetGCClipXOrigin(C, GC) -> V | xcGetGCAttribute(GC, 17, V).
  226. xGetGCClipYOrigin(C, GC) -> V | xcGetGCAttribute(GC, 18, V).
  227. xGetGCClipMask(C, GC) -> V | xcGetGCAttribute(GC, 19, V).
  228. xGetGCDashOffset(C, GC) -> V | xcGetGCAttribute(GC, 20, V).
  229. xGetGCDashLength(C, GC) -> V | xcGetGCAttribute(GC, 21, V).
  230. xGetGCArcMode(C, GC) -> V | xcGetGCAttribute(GC, 22, R), xBoolean(V, R).
  231. xGetGCClipList(C, GC) -> V | xcGetGCAttribute(GC, 23, R), xBoolean(V, R).
  232. xGetGCDashList(C, GC) -> V | xcGetGCAttribute(GC, 24, R), xBoolean(V, R).
  233.  
  234.  
  235. % set GC attributes 
  236. xSetGCFunction(C, GC, V) :- xcSetGCAttribute(C, GC, 0, V).
  237. xSetGCPlaneMask(C, GC, V) :- xcSetGCAttribute(C, GC, 1, V).
  238. xSetGCForeground(C, GC, V) :- xcSetGCAttribute(C, GC, 2, V).
  239. xSetGCBackground(C, GC, V) :- xcSetGCAttribute(C, GC, 3, V).
  240. xSetGCLineWidth(C, GC, V) :- xcSetGCAttribute(C, GC, 4, V).
  241. xSetGCLineStyle(C, GC, V) :- xcSetGCAttribute(C, GC, 5, V).
  242. xSetGCCapStyle(C, GC, V) :- xCapStyle(V, R), xcSetGCAttribute(C, GC, 6, R).
  243. xSetGCJoinStyle(C, GC, V) :- xJoinStyle(V, R), xcSetGCAttribute(C, GC, 7, R).
  244. xSetGCFillStyle(C, GC, V) :- xcSetGCAttribute(C, GC, 8, V).
  245. xSetGCFillRule(C, GC, V) :- xBoolean(V, R), xcSetGCAttribute(C, GC, 9, R).
  246. xSetGCTile(C, GC, V) :- xcSetGCAttribute(C, GC, 10, V).
  247. xSetGCStipple(C, GC, V) :- xcSetGCAttribute(C, GC, 11, V).
  248. xSetGCTileStipXOrigin(C, GC, V) :- xcSetGCAttribute(C, GC, 12, V).
  249. xSetGCTileStipYOrigin(C, GC, V) :- xcSetGCAttribute(C, GC, 13, V).
  250. xSetGCFont(C, GC, V) :- xcSetGCAttribute(C, GC, 14, V).
  251. xSetGCSubwindowMode(C, GC, V) :- 
  252.     xBoolean(V, R), 
  253.     xcSetGCAttribute(C, GC, 15, R).
  254. xSetGCGraphicsExposures(C, GC, V) :- 
  255.     xBoolean(V, R), 
  256.     xcSetGCAttribute(C, GC, 16, R).
  257. xSetGCClipXOrigin(C, GC, V) :- xcSetGCAttribute(C, GC, 17, V).
  258. xSetGCClipYOrigin(C, GC, V) :- xcSetGCAttribute(C, GC, 18, V).
  259. xSetGCClipMask(C, GC, V) :- xcSetGCAttribute(C, GC, 19, V).
  260. xSetGCDashOffset(C, GC, V) :- xcSetGCAttribute(C, GC, 20, V).
  261. xSetGCDashLength(C, GC, V) :- xcSetGCAttribute(C, GC, 21, V).
  262. xSetGCArcMode(C, GC, V) :- xBoolean(V, R), xcSetGCAttribute(C, GC, 22, R).
  263.  
  264.  
  265. % image attributes
  266. xGetImageWidth(I, V) :- xcGetImageAttribute(I, 0, V).
  267. xGetImageHeight(I, V) :- xcGetImageAttribute(I, 1, V).
  268. xGetImageOffset(I, V) :- xcGetImageAttribute(I, 2, V).
  269. xGetImageFormat(I, V) :- xcGetImageAttribute(I, 3, V).
  270. xGetImageByteOrder(I, V) :- xcGetImageAttribute(I, 4, R), xBoolean(V, R).
  271. xGetImageUnit(I, V) :- xcGetImageAttribute(I, 5, V).
  272. xGetImagePad(I, V) :- xcGetImageAttribute(I, 6, V).
  273. xGetImageBitOrder(I, V) :- xcGetImageAttribute(I, 7, R), xBoolean(V, R).
  274. xGetImageDepth(I, V) :- xcGetImageAttribute(I, 8, V).
  275. xGetImageLineBytes(I, V) :- xcGetImageAttribute(I, 9, V).
  276. xGetImagePixelBits(I, V) :- xcGetImageAttribute(I, 10, V).
  277. xGetImageRedMask(I, V) :- xcGetImageAttribute(I, 11, V).
  278. xGetImageGreenMask(I, V) :- xcGetImageAttribute(I, 12, V).
  279. xGetImageBlueMask(I, V) :- xcGetImageAttribute(I, 13, V).
  280.  
  281.  
  282. % font attributes 
  283. xGetFontDirection(F, V) :- xcGetFontAttribute(F, 0, R), xBoolean(V, R).
  284. xGetFontMinColumn(F, V) :- xcGetFontAttribute(F, 1, V).
  285. xGetFontMaxColumn(F, V) :- xcGetFontAttribute(F, 2, V).
  286. xGetFontMinRow(F, V) :- xcGetFontAttribute(F, 3, V).
  287. xGetFontMaxRow(F, V) :- xcGetFontAttribute(F, 4, V).
  288. xGetFontAllExist(F, V) :- xcGetFontAttribute(F, 5, R), xBoolean(V, R).
  289. xGetFontDefaultChar(F, V) :- xcGetFontAttribute(F, 6, V).
  290. xGetFontMinLeft(F, V) :- xcGetFontAttribute(F, 7, V).
  291. xGetFontMinRight(F, V) :- xcGetFontAttribute(F, 8, V).
  292. xGetFontMinWidth(F, V) :- xcGetFontAttribute(F, 9, V).
  293. xGetFontMinAscent(F, V) :- xcGetFontAttribute(F, 10, V).
  294. xGetFontMinDescent(F, V) :- xcGetFontAttribute(F, 11, V).
  295. xGetFontMinAttribute(F, V) :- xcGetFontAttribute(F, 12, V).
  296. xGetFontMaxLeft(F, V) :- xcGetFontAttribute(F, 13, V).
  297. xGetFontMaxRight(F, V) :- xcGetFontAttribute(F, 14, V).
  298. xGetFontMaxWidth(F, V) :- xcGetFontAttribute(F, 15, V).
  299. xGetFontMaxAscent(F, V) :- xcGetFontAttribute(F, 16, V).
  300. xGetFontMaxDescent(F, V) :- xcGetFontAttribute(F, 17, V).
  301. xGetFontMaxAttribute(F, V) :- xcGetFontAttribute(F, 18, V).
  302. xGetFontAscent(F, V) :- xcGetFontAttribute(F, 19, V).
  303. xGetFontDescent(F, V) :- xcGetFontAttribute(F, 20, V).
  304. xGetFontConnection(F, V) :- xcGetFontAttribute(F, 21, V).
  305. xGetFontFont(F, V) :- xcGetFontAttribute(F, 22, V).
  306. xGetFontProperties(F, V) :- xcGetFontAttribute(F, 23, N), pxVectorGet(N, V).
  307.  
  308.  
  309. % TO BE CHANGED: ADD THE POINTER IN THE PARAMETERS
  310. % get pointer attributes 
  311. xGetPointerNumerator(V) :- xcGetPointerAttribute(0, V).
  312. xGetPointerDenominator(V) :- xcGetPointerAttribute(1, V).
  313. xGetPointerThreshold(V) :- xcGetPointerAttribute(2, V).
  314.  
  315.  
  316. % TO BE CHANGED: ADD THE POINTER IN THE PARAMETERS
  317. % set pointer attributes 
  318. xSetPointerNumerator(V) :- xcSetPointerAttribute(0, V).
  319. xSetPointerDenominator(V) :- xcSetPointerAttribute(1, V).
  320. xSetPointerThreshold(V) :- xcSetPointerAttribute(2, V).
  321.  
  322.  
  323. % get keyboard attributes
  324. xGetKeyboardKeyClickPercent(V) :- xcGetKeyboardAttribute(0, V).
  325. xGetKeyboardBellPercent(V) :- xcGetKeyboardAttribute(1, V).
  326. xGetKeyboardBellPitch(V) :- xcGetKeyboardAttribute(2, V).
  327. xGetKeyboardBellDuration(V) :- xcGetKeyboardAttribute(3, V).
  328. xGetKeyboardLed(V) :- xcGetKeyboardAttribute(4, V).
  329. xGetKeyboardAutoRepeatMode(V) :- xcGetKeyboardAttribute(7, R), xBoolean(V, R).
  330. xGetKeyboardRepeatKeymap(V) :- 
  331.     xcGetKeyboardAttribute(8, N), 
  332.     pxVectorGet(N, R), 
  333.     pxKeymapToCodes(R,V).
  334.  
  335.  
  336. % set keyboard attributes
  337. xSetKeyboardKeyClickPercent(V) :- 
  338.     xKeyboardDefault(V, R), 
  339.     xcSetKeyboardAttribute(0, R).
  340. xSetKeyboardBellPercent(V) :- 
  341.     xKeyboardDefault(V, R), 
  342.     xcSetKeyboardAttribute(1, R).
  343. xSetKeyboardBellPitch(V) :- 
  344.     xKeyboardDefault(V, R), 
  345.     xcSetKeyboardAttribute(2, R).
  346. xSetKeyboardBellDuration(V) :- 
  347.     xKeyboardDefault(V, R), 
  348.     xcSetKeyboardAttribute(3, R).
  349. xSetKeyboardLed(V) :- xcSetKeyboardAttribute(4, V).
  350. xSetKeyboardLedMode(V) :- xBoolean(V, R), xcSetKeyboardAttribute(5, R).
  351. xSetKeyboardKey(V) :- xcSetKeyboardAttribute(6, V).
  352. xSetKeyboardAutoRepeatMode(V) :- 
  353.     xAutoRepeat(V, R), 
  354.     xcSetKeyboardAttribute(7, R).
  355.  
  356.  
  357. % WM_HINTS: format 32 
  358. xSetWMxInput(V) :- pxp_WM_HINTS(xInput, V, 2, 1, R).
  359. xSetWMInitialState(V) :- pxp_WM_HINTS(xInitialState, V, 3, 2, V). 
  360. xSetWMIconPixmap(V) :- pxp_WM_HINTS(xIconPixmap, V, 4, 4, V).
  361. xSetWMIconWindow(V) :- pxp_WM_HINTS(xIconWindow, V, 5, 8, V).
  362. xSetWMIconX(V) :- pxp_WM_HINTS(xIconX, V, 6, 16, V).
  363. xSetWMIconY(V) :- pxp_WM_HINTS(xIconY, V, 7, 16, V).
  364. xSetWMIconMask(V) :- pxp_WM_HINTS(xIconMask, V, 8, 32, V).
  365. xSetWMWindowGroup(V) :- pxp_WM_HINTS(xWindowGroup, V, 9, 64, V).
  366.  
  367.  
  368. % WM_NORMAL_HINTS: format 32 
  369. xSetWMUserX(V) :- pxp_WM_NORMAL_HINTS(xUserX, V, 2, 1, V).
  370. xSetWMUserY(V) :- pxp_WM_NORMAL_HINTS(xUserY, V, 3, 1, V).
  371. xSetWMUserWidth(V) :- pxp_WM_NORMAL_HINTS(xUserWidth, V, 4, 2, V).
  372. xSetWMUserHeight(V) :- pxp_WM_NORMAL_HINTS(xUserHeight, V, 5, 2, V).
  373. xSetWMProgramX(V) :- pxp_WM_NORMAL_HINTS(xProgramX, V, 2, 4, V).
  374. xSetWMProgramY(V) :- pxp_WM_NORMAL_HINTS(xProgramY, V, 3, 4, V).
  375. xSetWMProgramWidth(V) :- pxp_WM_NORMAL_HINTS(xProgramWidth, V, 4, 8, V).
  376. xSetWMProgramHeight(V) :- pxp_WM_NORMAL_HINTS(xProgramHeight, V, 5, 8, V).
  377. xSetWMMinWidth(V) :- pxp_WM_NORMAL_HINTS(xMinWidth, V, 6, 16, V).
  378. xSetWMMinHeight(V) :- pxp_WM_NORMAL_HINTS(xMinHeight, V, 7, 16, V).
  379. xSetWMMaxWidth(V) :- pxp_WM_NORMAL_HINTS(xMaxWidth, V, 8, 32, V).
  380. xSetWMMaxHeight(V) :- pxp_WM_NORMAL_HINTS(xMaxHeight, V, 9, 32, V).
  381. xSetWMWidthIncrement(V) :- pxp_WM_NORMAL_HINTS(xWidthIncrement, V, 10, 64, V).
  382. xSetWMHeightIncrement(V) :- 
  383.     pxp_WM_NORMAL_HINTS(xHeightIncrement, V, 11, 64, V).
  384. xSetWMMinAspectNumerator(V) :- 
  385.     pxp_WM_NORMAL_HINTS(xMinAspectNumerator, V, 12, 128, V).
  386. xSetWMMinAspectDenominator(V) :- 
  387.     pxp_WM_NORMAL_HINTS(xMinAspectDenominator, V, 13, 128, V).
  388. xSetWMMaxAspectNumerator(V) :- 
  389.     pxp_WM_NORMAL_HINTS(xMaxAspectNumerator, V, 14, 128, V).
  390. xSetWMMaxAspectDenominator(V) :- 
  391.     pxp_WM_NORMAL_HINTS(xMaxAspectDenominator, V, 15, 128, V).
  392. xSetWMBaseWidth(V) :- pxp_WM_NORMAL_HINTS(xBaseWidth, V, 16, 256, V).
  393. xSetWMBaseHeight(V) :- pxp_WM_NORMAL_HINTS(xBaseHeight, V, 17, 256, V).
  394. xSetWMWindowGravity(V) :-  
  395.     pxp_WM_NORMAL_HINTS(xWindowGravity, V, 18, 512, V).
  396.  
  397.