PageRenderTime 57ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

/gcl-2.6.8/xgcl-2/gcl_Xutil.lsp

#
Lisp | 797 lines | 389 code | 329 blank | 79 comment | 0 complexity | d0688fe88d75a10b579639135739f7c5 MD5 | raw file
Possible License(s): LGPL-2.0, GPL-3.0, LGPL-3.0, AGPL-1.0
  1. (in-package :XLIB)
  2. ; Xutil.lsp modified by Hiep Huu Nguyen 27 Aug 92
  3. ; Copyright (c) 1994 Hiep Huu Nguyen and The University of Texas at Austin.
  4. ; See the files gnu.license and dec.copyright .
  5. ; This program is free software; you can redistribute it and/or modify
  6. ; it under the terms of the GNU General Public License as published by
  7. ; the Free Software Foundation; either version 1, or (at your option)
  8. ; any later version.
  9. ; This program is distributed in the hope that it will be useful,
  10. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. ; GNU General Public License for more details.
  13. ; You should have received a copy of the GNU General Public License
  14. ; along with this program; if not, write to the Free Software
  15. ; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ; Some of the files that interface to the Xlib are adapted from DEC/MIT files.
  17. ; See the file dec.copyright for details.
  18. ;; $XConsortium: Xutil.h,v 11.58 89/12/12 20:15:40 jim Exp $ */
  19. ;;**********************************************************
  20. ;;Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
  21. ;;and the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  22. ;;modified by Hiep H Nguyen 28 Jul 91
  23. ;; All Rights Reserved
  24. ;;Permission to use, copy, modify, and distribute this software and its
  25. ;;documentation for any purpose and without fee is hereby granted,
  26. ;;provided that the above copyright notice appear in all copies and that
  27. ;;both that copyright notice and this permission notice appear in
  28. ;;supporting documentation, and that the names of Digital or MIT not be
  29. ;;used in advertising or publicity pertaining to distribution of the
  30. ;;software without specific, written prior permission.
  31. ;;DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  32. ;;ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  33. ;;DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  34. ;;ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  35. ;;WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  36. ;;ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  37. ;;SOFTWARE.
  38. ;;*****************************************************************
  39. ;;
  40. ;; * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding)
  41. ;; * value (x, y, width, height) was found in the parsed string.)
  42. (defconstant NoValue 0000)
  43. (defconstant XValue 0001)
  44. (defconstant YValue 0002)
  45. (defconstant WidthValue 0004)
  46. (defconstant HeightValue 0008)
  47. (defconstant AllValues 15)
  48. (defconstant XNegative 16)
  49. (defconstant YNegative 32)
  50. ;;
  51. ;; The next block of definitions are for window manager properties that
  52. ;; clients and applications use for communication.
  53. ;; flags argument in size hints
  54. (defconstant USPosition (expt 2 0) ) ;; user specified x, y
  55. (defconstant USSize (expt 2 1) ) ;; user specified width, height
  56. (defconstant PPosition (expt 2 2) ) ;; program specified position
  57. (defconstant PSize (expt 2 3) ) ;; program specified size
  58. (defconstant PMinSize (expt 2 4) ) ;; program specified minimum size
  59. (defconstant PMaxSize (expt 2 5) ) ;; program specified maximum size
  60. (defconstant PResizeInc (expt 2 6) ) ;; program specified resize increments
  61. (defconstant PAspect (expt 2 7) ) ;; program specified min and max aspect ratios
  62. (defconstant PBaseSize (expt 2 8) ) ;; program specified base for incrementing
  63. (defconstant PWinGravity (expt 2 9) ) ;; program specified window gravity
  64. ;; obsolete
  65. (defconstant PAllHints (+ PPosition PSize PMinSize PMaxSize PResizeInc PAspect))
  66. ;; definition for flags of XWMHints
  67. (defconstant InputHint (expt 2 0))
  68. (defconstant StateHint (expt 2 1))
  69. (defconstant IconPixmapHint (expt 2 2))
  70. (defconstant IconWindowHint (expt 2 3))
  71. (defconstant IconPositionHint (expt 2 4))
  72. (defconstant IconMaskHint (expt 2 5))
  73. (defconstant WindowGroupHint (expt 2 6))
  74. (defconstant AllHints ( + InputHint StateHint IconPixmapHint IconWindowHint
  75. IconPositionHint IconMaskHint WindowGroupHint))
  76. ;; definitions for initial window state
  77. (defconstant WithdrawnState 0 ) ;; for windows that are not mapped
  78. (defconstant NormalState 1 ) ;; most applications want to start this way
  79. (defconstant IconicState 3 ) ;; application wants to start as an icon
  80. ;;
  81. ;; Obsolete states no longer defined by ICCCM
  82. (defconstant DontCareState 0 ) ;; don't know or care
  83. (defconstant ZoomState 2 ) ;; application wants to start zoomed
  84. (defconstant InactiveState 4 ) ;; application believes it is seldom used;
  85. ;; some wm's may put it on inactive menu
  86. ;;
  87. ;; opaque reference to Region data type
  88. ;;typedef struct _XRegion *Region;
  89. ;; Return values from XRectInRegion()
  90. (defconstant RectangleOut 0)
  91. (defconstant RectangleIn 1)
  92. (defconstant RectanglePart 2)
  93. (defconstant VisualNoMask 0)
  94. (defconstant VisualIDMask 1)
  95. (defconstant VisualScreenMask 2)
  96. (defconstant VisualDepthMask 4)
  97. (defconstant VisualClassMask 8)
  98. (defconstant VisualRedMaskMask 16)
  99. (defconstant VisualGreenMaskMask 32)
  100. (defconstant VisualBlueMaskMask 64)
  101. (defconstant VisualColormapSizeMask 128)
  102. (defconstant VisualBitsPerRGBMask 256)
  103. (defconstant VisualAllMask 511)
  104. (defconstant ReleaseByFreeingColormap 1) ;; for killid field above
  105. ;;
  106. ;; return codes for XReadBitmapFile and XWriteBitmapFile
  107. (defconstant BitmapSuccess 0)
  108. (defconstant BitmapOpenFailed 1)
  109. (defconstant BitmapFileInvalid 2)
  110. (defconstant BitmapNoMemory 3)
  111. ;;
  112. ;; Declare the routines that don't return int.
  113. ;; ***************************************************************
  114. ;; *
  115. ;; * Context Management
  116. ;; *
  117. ;; ***************************************************************
  118. ;; Associative lookup table return codes
  119. (defconstant XCSUCCESS 0 ) ;; No error.
  120. (defconstant XCNOMEM 1 ) ;; Out of memory
  121. (defconstant XCNOENT 2 ) ;; No entry in table
  122. ;;typedef fixnum XContext;
  123. (defentry XSaveContext(
  124. fixnum ;; display
  125. fixnum ;; w
  126. fixnum ;; context
  127. fixnum ;; data
  128. )( fixnum "XSaveContext"))
  129. (defentry XFindContext(
  130. fixnum ;; display
  131. fixnum ;; w
  132. fixnum ;; context
  133. fixnum ;; data_return
  134. )( fixnum "XFindContext"))
  135. (defentry XDeleteContext(
  136. fixnum ;; display
  137. fixnum ;; w
  138. fixnum ;; context
  139. )( fixnum "XDeleteContext"))
  140. (defentry XGetWMHints(
  141. fixnum ;; display
  142. fixnum ;; w
  143. )( fixnum "XGetWMHints"))
  144. (defentry XCreateRegion(
  145. ;; void
  146. )( fixnum "XCreateRegion"))
  147. (defentry XPolygonRegion(
  148. fixnum ;; points
  149. fixnum ;; n
  150. fixnum ;; fill_rule
  151. )( fixnum "XPolygonRegion"))
  152. (defentry XGetVisualInfo(
  153. fixnum ;; display
  154. fixnum ;; vinfo_mask
  155. fixnum ;; vinfo_template
  156. fixnum ;; nitems_return
  157. )( fixnum "XGetVisualInfo"))
  158. ;; Allocation routines for properties that may get longer
  159. (defentry XAllocSizeHints (
  160. ;; void
  161. )( fixnum "XAllocSizeHints" ))
  162. (defentry XAllocStandardColormap (
  163. ;; void
  164. )( fixnum "XAllocStandardColormap" ))
  165. (defentry XAllocWMHints (
  166. ;; void
  167. )( fixnum "XAllocWMHints" ))
  168. (defentry XAllocClassHint (
  169. ;; void
  170. )( fixnum "XAllocClassHint" ))
  171. (defentry XAllocIconSize (
  172. ;; void
  173. )( fixnum "XAllocIconSize" ))
  174. ;; ICCCM routines for data structures defined in this file
  175. (defentry XGetWMSizeHints(
  176. fixnum ;; display
  177. fixnum ;; w
  178. fixnum ;; hints_return
  179. fixnum ;; supplied_return
  180. fixnum ;; property
  181. )( fixnum "XGetWMSizeHints"))
  182. (defentry XGetWMNormalHints(
  183. fixnum ;; display
  184. fixnum ;; w
  185. fixnum ;; hints_return
  186. fixnum ;; supplied_return
  187. )( fixnum "XGetWMNormalHints"))
  188. (defentry XGetRGBColormaps(
  189. fixnum ;; display
  190. fixnum ;; w
  191. fixnum ;; stdcmap_return
  192. fixnum ;; count_return
  193. fixnum ;; property
  194. )( fixnum "XGetRGBColormaps"))
  195. (defentry XGetTextProperty(
  196. fixnum ;; display
  197. fixnum ;; window
  198. fixnum ;; text_prop_return
  199. fixnum ;; property
  200. )( fixnum "XGetTextProperty"))
  201. (defentry XGetWMName(
  202. fixnum ;; display
  203. fixnum ;; w
  204. fixnum ;; text_prop_return
  205. )( fixnum "XGetWMName"))
  206. (defentry XGetWMIconName(
  207. fixnum ;; display
  208. fixnum ;; w
  209. fixnum ;; text_prop_return
  210. )( fixnum "XGetWMIconName"))
  211. (defentry XGetWMClientMachine(
  212. fixnum ;; display
  213. fixnum ;; w
  214. fixnum ;; text_prop_return
  215. )( fixnum "XGetWMClientMachine"))
  216. (defentry XSetWMProperties(
  217. fixnum ;; display
  218. fixnum ;; w
  219. fixnum ;; window_name
  220. fixnum ;; icon_name
  221. fixnum ;; argv
  222. fixnum ;; argc
  223. fixnum ;; normal_hints
  224. fixnum ;; wm_hints
  225. fixnum ;; class_hints
  226. )( void "XSetWMProperties"))
  227. (defentry XSetWMSizeHints(
  228. fixnum ;; display
  229. fixnum ;; w
  230. fixnum ;; hints
  231. fixnum ;; property
  232. )( void "XSetWMSizeHints"))
  233. (defentry XSetWMNormalHints(
  234. fixnum ;; display
  235. fixnum ;; w
  236. fixnum ;; hints
  237. )( void "XSetWMNormalHints"))
  238. (defentry XSetRGBColormaps(
  239. fixnum ;; display
  240. fixnum ;; w
  241. fixnum ;; stdcmaps
  242. fixnum ;; count
  243. fixnum ;; property
  244. )( void "XSetRGBColormaps"))
  245. (defentry XSetTextProperty(
  246. fixnum ;; display
  247. fixnum ;; w
  248. fixnum ;; text_prop
  249. fixnum ;; property
  250. )( void "XSetTextProperty"))
  251. (defentry XSetWMName(
  252. fixnum ;; display
  253. fixnum ;; w
  254. fixnum ;; text_prop
  255. )( void "XSetWMName"))
  256. (defentry XSetWMIconName(
  257. fixnum ;; display
  258. fixnum ;; w
  259. fixnum ;; text_prop
  260. )( void "XSetWMIconName"))
  261. (defentry XSetWMClientMachine(
  262. fixnum ;; display
  263. fixnum ;; w
  264. fixnum ;; text_prop
  265. )( void "XSetWMClientMachine"))
  266. (defentry XStringListToTextProperty(
  267. fixnum ;; list
  268. fixnum ;; count
  269. fixnum ;; text_prop_return
  270. )( fixnum "XStringListToTextProperty"))
  271. (defentry XTextPropertyToStringList(
  272. fixnum ;; text_prop
  273. fixnum ;; list_return
  274. fixnum ;; count_return
  275. )( fixnum "XTextPropertyToStringList"))
  276. ;; The following declarations are alphabetized.
  277. (defentry XClipBox(
  278. fixnum ;; r
  279. fixnum ;; rect_return
  280. )( void "XClipBox"))
  281. (defentry XDestroyRegion(
  282. fixnum ;; r
  283. )( void "XDestroyRegion"))
  284. (defentry XEmptyRegion(
  285. fixnum ;; r
  286. )( void "XEmptyRegion"))
  287. (defentry XEqualRegion(
  288. fixnum ;; r1
  289. fixnum ;; r2
  290. )( void "XEqualRegion"))
  291. (defentry XGetClassHint(
  292. fixnum ;; display
  293. fixnum ;; w
  294. fixnum ;; class_hints_return
  295. )( fixnum "XGetClassHint"))
  296. (defentry XGetIconSizes(
  297. fixnum ;; display
  298. fixnum ;; w
  299. fixnum ;; size_list_return
  300. fixnum ;; count_return
  301. )( fixnum "XGetIconSizes"))
  302. (defentry XGetNormalHints(
  303. fixnum ;; display
  304. fixnum ;; w
  305. fixnum ;; hints_return
  306. )( fixnum "XGetNormalHints"))
  307. (defentry XGetSizeHints(
  308. fixnum ;; display
  309. fixnum ;; w
  310. fixnum ;; hints_return
  311. fixnum ;; property
  312. )( fixnum "XGetSizeHints"))
  313. (defentry XGetStandardColormap(
  314. fixnum ;; display
  315. fixnum ;; w
  316. fixnum ;; colormap_return
  317. fixnum ;; property
  318. )( fixnum "XGetStandardColormap"))
  319. (defentry XGetZoomHints(
  320. fixnum ;; display
  321. fixnum ;; w
  322. fixnum ;; zhints_return
  323. )( fixnum "XGetZoomHints"))
  324. (defentry XIntersectRegion(
  325. fixnum ;; sra
  326. fixnum ;; srb
  327. fixnum ;; dr_return
  328. )( void "XIntersectRegion"))
  329. (defentry XLookupString(
  330. fixnum ;; event_struct
  331. object ;; buffer_return
  332. fixnum ;; bytes_buffer
  333. fixnum ;; keysym_return
  334. fixnum ;; int_in_out
  335. )( fixnum "XLookupString"))
  336. (defentry XMatchVisualInfo(
  337. fixnum ;; display
  338. fixnum ;; screen
  339. fixnum ;; depth
  340. fixnum ;; class
  341. fixnum ;; vinfo_return
  342. )( fixnum "XMatchVisualInfo"))
  343. (defentry XOffsetRegion(
  344. fixnum ;; r
  345. fixnum ;; dx
  346. fixnum ;; dy
  347. )( void "XOffsetRegion"))
  348. (defentry XPointInRegion(
  349. fixnum ;; r
  350. fixnum ;; x
  351. fixnum ;; y
  352. )( fixnum "XPointInRegion"))
  353. (defentry XRectInRegion(
  354. fixnum ;; r
  355. fixnum ;; x
  356. fixnum ;; y
  357. fixnum ;; width
  358. fixnum ;; height
  359. )( fixnum "XRectInRegion"))
  360. (defentry XSetClassHint(
  361. fixnum ;; display
  362. fixnum ;; w
  363. fixnum ;; class_hints
  364. )( void "XSetClassHint"))
  365. (defentry XSetIconSizes(
  366. fixnum ;; display
  367. fixnum ;; w
  368. fixnum ;; size_list
  369. fixnum ;; count
  370. )( void "XSetIconSizes"))
  371. (defentry XSetNormalHints(
  372. fixnum ;; display
  373. fixnum ;; w
  374. fixnum ;; hints
  375. )( void "XSetNormalHints"))
  376. (defentry XSetSizeHints(
  377. fixnum ;; display
  378. fixnum ;; w
  379. fixnum ;; hints
  380. fixnum ;; property
  381. )( void "XSetSizeHints"))
  382. (defentry XSetStandardProperties(
  383. fixnum ;; display
  384. fixnum ;; w
  385. object ;; window_name
  386. object ;; icon_name
  387. fixnum ;; icon_pixmap
  388. fixnum ;; argv
  389. fixnum ;; argc
  390. fixnum ;; hints
  391. )( void "XSetStandardProperties"))
  392. (defentry XSetWMHints(
  393. fixnum ;; display
  394. fixnum ;; w
  395. fixnum ;; wm_hints
  396. )( void "XSetWMHints"))
  397. (defentry XSetRegion(
  398. fixnum ;; display
  399. fixnum ;; gc
  400. fixnum ;; r
  401. )( void "XSetRegion"))
  402. (defentry XSetStandardColormap(
  403. fixnum ;; display
  404. fixnum ;; w
  405. fixnum ;; colormap
  406. fixnum ;; property
  407. )( void "XSetStandardColormap"))
  408. (defentry XSetZoomHints(
  409. fixnum ;; display
  410. fixnum ;; w
  411. fixnum ;; zhints
  412. )( void "XSetZoomHints"))
  413. (defentry XShrinkRegion(
  414. fixnum ;; r
  415. fixnum ;; dx
  416. fixnum ;; dy
  417. )( void "XShrinkRegion"))
  418. (defentry XSubtractRegion(
  419. fixnum ;; sra
  420. fixnum ;; srb
  421. fixnum ;; dr_return
  422. )( void "XSubtractRegion"))
  423. (defentry XUnionRectWithRegion(
  424. fixnum ;; rectangle
  425. fixnum ;; src_region
  426. fixnum ;; dest_region_return
  427. )( void "XUnionRectWithRegion"))
  428. (defentry XUnionRegion(
  429. fixnum ;; sra
  430. fixnum ;; srb
  431. fixnum ;; dr_return
  432. )( void "XUnionRegion"))
  433. (defentry XWMGeometry(
  434. fixnum ;; display
  435. fixnum ;; screen_number
  436. object ;; user_geometry
  437. object ;; default_geometry
  438. fixnum ;; border_width
  439. fixnum ;; hints
  440. fixnum ;; x_return
  441. fixnum ;; y_return
  442. fixnum ;; width_return
  443. fixnum ;; height_return
  444. fixnum ;; gravity_return
  445. )( fixnum "XWMGeometry"))
  446. (defentry XXorRegion(
  447. fixnum ;; sra
  448. fixnum ;; srb
  449. fixnum ;; dr_return
  450. )( void "XXorRegion"))
  451. ;;
  452. ;; These macros are used to give some sugar to the image routines so that
  453. ;; naive people are more comfortable with them.
  454. (defentry XDestroyImage(fixnum) (fixnum "XDestroyImage"))
  455. (defentry XGetPixel(fixnum fixnum fixnum) (fixnum "XGetPixel" ))
  456. (defentry XPutPixel(fixnum fixnum int fixnum) ( fixnum "XPutPixel"))
  457. (defentry XSubImage(fixnum fixnum int fixnum fixnum) (fixnum "XSubImage"))
  458. (defentry XAddPixel(fixnum fixnum) (fixnum "XAddPixel"))
  459. ;;
  460. ;; Keysym macros, used on Keysyms to test for classes of symbols
  461. (defentry IsKeypadKey(fixnum) (fixnum "IsKeypadKey"))
  462. (defentry IsCursorKey(fixnum) (fixnum "IsCursorKey"))
  463. (defentry IsPFKey(fixnum) (fixnum "IsPFKey"))
  464. (defentry IsFunctionKey(fixnum) (fixnum "IsFunctionKey"))
  465. (defentry IsMiscFunctionKey(fixnum) (fixnum "IsMiscFunctionKey"))
  466. (defentry IsModifierKey(fixnum) (fixnum "IsModifierKey"))
  467. (defentry XUniqueContext() (fixnum "XUniqueContext"))
  468. (defentry XStringToContext(object) (fixnum "XStringToContext"))