PageRenderTime 56ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/src/window.sc

https://bitbucket.org/bunny351/ezd
Scala | 621 lines | 566 code | 55 blank | 0 comment | 13 complexity | feea13cdd0ff4a5ee497f8caaf5def8e MD5 | raw file
  1. ;;; ezd - easy drawing for X11 displays.
  2. ;;;
  3. ;;; A WINDOW object maintains the information required for an ezd drawing
  4. ;;; window.
  5. ;* Copyright 1990-1993 Digital Equipment Corporation
  6. ;* All Rights Reserved
  7. ;*
  8. ;* Permission to use, copy, and modify this software and its documentation is
  9. ;* hereby granted only under the following terms and conditions. Both the
  10. ;* above copyright notice and this permission notice must appear in all copies
  11. ;* of the software, derivative works or modified versions, and any portions
  12. ;* thereof, and both notices must appear in supporting documentation.
  13. ;*
  14. ;* Users of this software agree to the terms and conditions set forth herein,
  15. ;* and hereby grant back to Digital a non-exclusive, unrestricted, royalty-free
  16. ;* right and license under any changes, enhancements or extensions made to the
  17. ;* core functions of the software, including but not limited to those affording
  18. ;* compatibility with other hardware or software environments, but excluding
  19. ;* applications which incorporate this software. Users further agree to use
  20. ;* their best efforts to return to Digital any such changes, enhancements or
  21. ;* extensions that they make and inform Digital of noteworthy uses of this
  22. ;* software. Correspondence should be provided to Digital at:
  23. ;*
  24. ;* Director of Licensing
  25. ;* Western Research Laboratory
  26. ;* Digital Equipment Corporation
  27. ;* 250 University Avenue
  28. ;* Palo Alto, California 94301
  29. ;*
  30. ;* This software may be distributed (but not offered for sale or transferred
  31. ;* for compensation) to third parties, provided such third parties agree to
  32. ;* abide by the terms and conditions of this notice.
  33. ;*
  34. ;* THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
  35. ;* WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  36. ;* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL DIGITAL EQUIPMENT
  37. ;* CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  38. ;* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  39. ;* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  40. ;* ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  41. ;* SOFTWARE.
  42. (module window)
  43. (include "struct.sch")
  44. (include "display.sch")
  45. (include "view.sch")
  46. (include "drawing.sch")
  47. (include "graphic.sch")
  48. (include "commands.sch")
  49. (include "ginfo.sch")
  50. (include "events.sch")
  51. (include "ezd.sch")
  52. (include "xternal.sch")
  53. ;;; Each WINDOW object is represented by a structure with the following
  54. ;;; fields:
  55. ;;;
  56. ;;; DISPLAY display object for X display.
  57. ;;; X initial window position in pixels
  58. ;;; Y
  59. ;;; WIDTH initial window size in pixels
  60. ;;; HEIGHT
  61. ;;; NAME ezd name for the window.
  62. ;;; TITLE title string for the X window.
  63. ;;; FOREGROUND-NAME foreground color name.
  64. ;;; BACKGROUND-NAME background color name.
  65. ;;; FOREGROUND X pixel for the foreground color.
  66. ;;; BACKGROUND X pixel for the background color.
  67. ;;; EXPOSED boolean indicating that the window has been
  68. ;;; initially exposed.
  69. ;;; EXPOSE-BBL list of bounding boxes defining areas that were
  70. ;;; exposed.
  71. ;;; DAMAGE-BBL list of bounding boxes defining areas that need to be
  72. ;;; redrawn, but weren't exposed.
  73. ;;; VIEWS list of views of drawings displayed in the window. The
  74. ;;; head of the list is the "bottom" view.
  75. ;;; CURSOR current window cursor
  76. ;;; CURSORS stack of cursors used by SAVE-CURSOR and RESTORE-CURSOR
  77. ;;; commands.
  78. ;;; GC graphics context for pixmap operations
  79. ;;; XWINDOW X windowid for the window.
  80. (define-structure WINDOW
  81. display
  82. x
  83. y
  84. width
  85. height
  86. name
  87. title
  88. foreground-name
  89. background-name
  90. (foreground (if foreground-name
  91. (display-color->pixel display foreground-name)
  92. (begin (color? 'black)
  93. (window-foreground-name! self 'black)
  94. (display-black display))))
  95. (background (if background-name
  96. (display-color->pixel display background-name)
  97. (begin (color? 'white)
  98. (window-background-name! self 'white)
  99. (display-white display))))
  100. (variable-width (if (<= width 0) width #f))
  101. (variable-height (if (<= height 0) height #f))
  102. (exposed #f)
  103. (expose-bbl '())
  104. (damage-bbl '())
  105. (views '())
  106. (cursor (display-font->cursor display xc_left_ptr))
  107. (cursors '())
  108. (gc #f)
  109. (xwindow (let* ((dpy (display-dpy display))
  110. (screen (display-screen display))
  111. (wa (let ((wa (make-xsetwindowattributes)))
  112. (xsetwindowattributes-background_pixel! wa
  113. (window-background self))
  114. (xsetwindowattributes-border_pixel! wa
  115. (window-foreground self))
  116. (xsetwindowattributes-colormap! wa
  117. (display-colormap display))
  118. wa))
  119. (xwindow (xcreatewindow dpy
  120. (xrootwindow dpy screen)
  121. (window-x self)
  122. (window-y self)
  123. (window-width self)
  124. (window-height self)
  125. 2
  126. (display-visual-depth display)
  127. inputoutput
  128. (display-visual display)
  129. (bit-or cwbackpixel cwborderpixel cwcolormap)
  130. wa))
  131. (gc (xcreategc dpy xwindow 0 (make-xgcvalues))))
  132. (let ((wmh (make-xwmhints)))
  133. (xwmhints-flags! wmh 1)
  134. (xwmhints-input! wmh 1)
  135. (xsetwmhints dpy xwindow wmh))
  136. (xstorename dpy xwindow title)
  137. (xseticonname dpy xwindow (symbol->string name))
  138. (xselectinput dpy xwindow
  139. (bit-or keypressmask keyreleasemask
  140. exposuremask
  141. structurenotifymask
  142. ownergrabbuttonmask
  143. buttonpressmask buttonreleasemask
  144. enterwindowmask leavewindowmask
  145. pointermotionmask))
  146. (xdefinecursor dpy xwindow (window-cursor self))
  147. (xsetforeground dpy gc (window-background self))
  148. (xsetgraphicsexposures *dpy* gc 0)
  149. (window-gc! self gc)
  150. (set! *name-windows*
  151. (cons (list (window-name self) self) *name-windows*))
  152. (set! *xwindow-windows*
  153. (cons (list xwindow self) *xwindow-windows*))
  154. xwindow)))
  155. (define-in-line-structure-access WINDOW
  156. display
  157. x
  158. y
  159. width
  160. height
  161. name
  162. title
  163. foreground-name
  164. background-name
  165. foreground
  166. background
  167. variable-width
  168. variable-height
  169. exposed
  170. expose-bbl
  171. damage-bbl
  172. views
  173. cursor
  174. cursors
  175. gc
  176. xwindow)
  177. ;;; A list of lists of window name and the appropriate WINDOW data structure
  178. ;;; is kept in *NAME-WINDOWS*.
  179. (define *NAME-WINDOWS* '())
  180. ;;; Convert a window name to the WINDOW data structure.
  181. (define (NAME->WINDOW name)
  182. (let ((x (assoc name *name-windows*)))
  183. (if x (cadr x) (error 'name->window "WINDOW not defined: ~s" name))))
  184. ;;; See DRAWING-IN-LAST-EXISTING-WINDOW? (view.sc) to see how
  185. ;;; LAST-EXISTING-WINDOW-NAME is used to parse commands.
  186. (define LAST-EXISTING-WINDOW-NAME #f)
  187. ;;; Boolean to check if a window exists.
  188. (define (WINDOW-EXISTS? name)
  189. (if (assoc name *name-windows*)
  190. (begin (set! last-existing-window-name name)
  191. #t)
  192. #f))
  193. ;;; A list of lists of X window id and the appropriate WINDOW data structure
  194. ;;; is kept in *XWINDOW-WINDOWS*
  195. (define *XWINDOW-WINDOWS* '())
  196. ;;; Convert a X window id to a WINDOW data structure.
  197. (define (XWINDOW->WINDOW xwindow)
  198. (let ((x (assoc xwindow *xwindow-windows*)))
  199. (if x (cadr x) #f)))
  200. ;;; A drawing window is created by the following procedure. If the window
  201. ;;; already exists, it is deleted and recreated.
  202. (define (EZD-WINDOW name x-y width height fixed-size points title
  203. foreground-name background-name)
  204. (let* ((x (if (pair? x-y)
  205. (if points (points->pixels (car x-y)) (car x-y))
  206. (points->pixels 144)))
  207. (y (if (pair? x-y)
  208. (if points (points->pixels (cadr x-y)) (cadr x-y))
  209. (points->pixels 144)))
  210. (width (if points (points->pixels width) width))
  211. (height (if points (points->pixels height) height)))
  212. (if (window-exists? name) (window-delete name))
  213. (let ((w (make-window *display* x y width height name
  214. (or title (symbol->string name))
  215. foreground-name background-name))
  216. (hints (make-xsizehints)))
  217. (xsizehints-flags! hints ussize)
  218. (xsizehints-width! hints width)
  219. (xsizehints-height! hints height)
  220. (when (pair? x-y)
  221. (xsizehints-flags! hints
  222. (bit-or (xsizehints-flags hints) usposition))
  223. (xsizehints-x! hints x)
  224. (xsizehints-y! hints y))
  225. (when fixed-size
  226. (xsizehints-flags! hints
  227. (bit-or (xsizehints-flags hints)
  228. pminsize pmaxsize))
  229. (xsizehints-min_width! hints width)
  230. (xsizehints-max_width! hints width)
  231. (xsizehints-min_height! hints height)
  232. (xsizehints-max_height! hints height))
  233. (xsetnormalhints *dpy* (window-xwindow w) hints)
  234. w)))
  235. (define-ezd-command
  236. `(window ,symbol?
  237. (optional ,non-negative? ,non-negative?)
  238. ,positive-number? ,positive-number?
  239. (optional fixed-size) (optional points)
  240. (optional ,string?) (optional ,color?) (optional ,color?))
  241. "(window name [ x y ] width height [ FIXED-SIZE ] [ POINTS ] [\"<title>\"] [<color> [<color>] ])"
  242. ezd-window)
  243. ;;; A WINDOW is deleted by the following procedure.
  244. (define (WINDOW-DELETE name)
  245. (let ((self (name->window name)))
  246. (for-each
  247. (lambda (view) (delete-view name (view-drawing-name view)))
  248. (window-views self))
  249. (set! *xwindow-windows*
  250. (remove (list (window-xwindow self) self) *xwindow-windows*))
  251. (set! *name-windows*
  252. (remove (list (window-name self) self) *name-windows*))
  253. (xdestroywindow (display-dpy (window-display self))
  254. (window-xwindow self))
  255. (set! *update-display* #t)))
  256. (define-ezd-command
  257. `(delete-window ,window-exists?)
  258. "(delete-window window)"
  259. window-delete)
  260. ;;; Cursors are saved and restored by the ezd commands SAVE-CURSOR and
  261. ;;; RESTORE-CURSOR.
  262. (define-ezd-command
  263. `(save-cursor ,window-exists?)
  264. "(save-cursor window-name)"
  265. (lambda (name)
  266. (let ((self (name->window name)))
  267. (window-cursors! self (cons (window-cursor self)
  268. (window-cursors self))))))
  269. (define-ezd-command
  270. `(restore-cursor ,window-exists?)
  271. "(restore-cursor window-name)"
  272. (lambda (name)
  273. (let* ((self (name->window name))
  274. (cursors (window-cursors self)))
  275. (when cursors
  276. (let ((cursor (car cursors)))
  277. (xdefinecursor *dpy* (window-xwindow self) cursor)
  278. (window-cursor! self cursor)
  279. (window-cursors! self (cdr cursors))
  280. (xflush *dpy*))))))
  281. ;;; A new cursor is installed in a window by the ezd command SET-CURSOR.
  282. (define-ezd-command
  283. `(set-cursor ,window-exists? ,cursor-name?)
  284. "(set-cursor window-name cursor-name)"
  285. (lambda (name shape)
  286. (let ((self (name->window name))
  287. (cursor (display-font->cursor *display*
  288. (cursor-name? shape))))
  289. (xdefinecursor *dpy* (window-xwindow self) cursor)
  290. (window-cursor! self cursor)
  291. (xflush *dpy*))))
  292. ;;; A bounding box is merged onto a list of non-intersecting bounding boxes by
  293. ;;; the following function. Overlapping bounding boxes are merged into one
  294. ;;; that contains both. Adjacent boxes that are equal in size on the one
  295. ;;; dimension are merged.
  296. (define (MERGE-BBL minx miny maxx maxy bbl)
  297. (let loop ((old bbl) (new '()))
  298. (if (pair? old)
  299. (let* ((h (car old))
  300. (h-minx (car h))
  301. (h-miny (cadr h))
  302. (h-maxx (caddr h))
  303. (h-maxy (cadddr h)))
  304. (cond ((or (>= h-minx maxx) (>= h-miny maxy)
  305. (<= h-maxx minx) (<= h-maxy miny))
  306. (loop (cdr old) (cons h new)))
  307. ((and (= minx h-minx) (= maxx h-maxx) (= maxy h-miny))
  308. (merge-bbl minx miny maxx h-maxy (remq h bbl)))
  309. ((and (= minx h-minx) (= maxx h-maxx) (= h-maxy miny))
  310. (merge-bbl minx h-miny maxx maxy (remq h bbl)))
  311. ((and (= miny h-miny) (= maxy h-maxy) (= maxx h-minx))
  312. (merge-bbl minx miny h-maxx maxy (remq h bbl)))
  313. ((and (= miny h-miny) (= maxy h-maxy) (= h-maxx minx))
  314. (merge-bbl h-minx miny maxx maxy (remq h bbl)))
  315. (else (merge-bbl (min minx h-minx) (min miny h-miny)
  316. (max maxx h-maxx) (max maxy h-maxy)
  317. (remq h bbl)))))
  318. (cons (list minx miny maxx maxy) new))))
  319. ;;; Events related to a WINDOW are processed by the following procedure. The
  320. ;;; only event handling "hardwired" into ezd is for expose events and window
  321. ;;; resizing. The rest of the events are handled by user event handlers.
  322. (define (WINDOW-EVENT-HANDLER window event)
  323. (cond ((eq? (xevent-type event) expose)
  324. (set! *update-display* #t)
  325. (window-exposed! window #t)
  326. (window-expose-bbl! window
  327. (merge-bbl (xevent-xexpose-x event) (xevent-xexpose-y event)
  328. (+ (xevent-xexpose-x event) (xevent-xexpose-width event))
  329. (+ (xevent-xexpose-y event) (xevent-xexpose-height event))
  330. (window-expose-bbl window))))
  331. ((eq? (xevent-type event) configurenotify)
  332. (let ((old-width (window-width window))
  333. (old-height (window-height window))
  334. (width (xevent-xconfigure-width event))
  335. (height (xevent-xconfigure-height event)))
  336. (when (and (or (not (= width old-width))
  337. (not (= height old-height))))
  338. (when (eq? window *window*)
  339. (set! *width* width)
  340. (set! *height* height))
  341. (window-width! window width)
  342. (window-height! window height)
  343. (handle-window-events window 'resize event
  344. (list old-width old-height width height))))))
  345. (handle-when-events window event))
  346. ;;; Once there are no pending events, the display's event handler calls the
  347. ;;; following procedure to redraw all views in all windows as needed.
  348. (define (REDRAW-ALL-WINDOWS)
  349. (let ((visible-event-views '()))
  350. (for-each
  351. (lambda (name-window)
  352. (let* ((window (cadr name-window))
  353. (partitions (partition-views
  354. (window-views window))))
  355. (set! visible-event-views
  356. (append (transform-views
  357. (window-views window))
  358. visible-event-views))
  359. (for-each
  360. (lambda (views)
  361. (if (pair? views)
  362. (let ((view (car views)))
  363. (redraw-a-partition window
  364. views))))
  365. partitions)
  366. (window-damage-bbl! window '())
  367. (window-expose-bbl! window '())))
  368. *name-windows*)
  369. (drawings-redrawn)
  370. (for-each handle-visible-events visible-event-views)))
  371. ;;; When changes must be made to a drawing, or additions made to an overlayed
  372. ;;; drawing, the image is rendered to a pixmap and then copied to the screen
  373. ;;; to reduce screen flashes.
  374. (define *PIXMAP* #f)
  375. (define *PIXMAP-HEIGHT* #f)
  376. (define *PIXMAP-WIDTH* #f)
  377. (define (REDRAW-A-PARTITION window views)
  378. (let ((solid-views (let loop ((views views))
  379. (if (pair? views)
  380. (if (and (drawing-is-clear
  381. (view-drawing (car views)))
  382. (not (drawing-cleared
  383. (view-drawing
  384. (car views)))))
  385. (loop (cdr views))
  386. (cons (car views) (loop (cdr views))))
  387. '())))
  388. (bbl '())
  389. (clip-minx #f)
  390. (clip-miny #f)
  391. (clip-maxx #f)
  392. (clip-maxy #f))
  393. (define (SET-CLIP view)
  394. ;;; Define the current clipping region.
  395. (set! clip-minx (or (and view (view-clip-minx view)) 0))
  396. (set! clip-miny (or (and view (view-clip-miny view)) 0))
  397. (set! clip-maxx (or (and view (view-clip-maxx view))
  398. (window-width window)))
  399. (set! clip-maxy (or (and view (view-clip-maxy view))
  400. (window-height window))))
  401. (define (ADD-BBL minx miny maxx maxy)
  402. ;;; Add a clipped bounding box to the bounding box list.
  403. (if (not (or (<= maxx clip-minx)
  404. (<= maxy clip-miny)
  405. (>= minx clip-maxx)
  406. (>= miny clip-maxy)))
  407. (set! bbl (merge-bbl (max minx clip-minx)
  408. (max miny clip-miny)
  409. (min maxx clip-maxx)
  410. (min maxy clip-maxy) bbl))))
  411. (define (UNION-VIEW-GRAPHIC compute-bb)
  412. ;;; Add a deleted object to the bounding box list.
  413. (let* ((bb (compute-bb))
  414. (minx (car bb))
  415. (miny (cadr bb))
  416. (maxx (caddr bb))
  417. (maxy (cadddr bb)))
  418. (if (not (eq? minx maxx))
  419. (add-bbl minx miny maxx maxy))))
  420. (define (UNION-VIEW view)
  421. ;;; Add changes to a view to the bounding box list.
  422. (cond ((view-new view)
  423. (set-view view '())
  424. (set-clip view)
  425. (let loop ((gl (drawing-head (view-drawing view)))
  426. (minx #f) (miny #f) (maxx #f) (maxy #f))
  427. (if (pair? gl)
  428. (let ((bb ((graphic-compute-bb (car gl)))))
  429. (loop (cdr gl)
  430. (bbmin minx (car bb))
  431. (bbmin miny (cadr bb))
  432. (bbmax maxx (caddr bb))
  433. (bbmax maxy (cadddr bb))))
  434. (if minx (add-bbl minx miny maxx maxy)))))
  435. ((drawing-cleared (view-drawing view))
  436. (set-clip view)
  437. (add-bbl 0 0 (window-width window)
  438. (window-height window)))
  439. (else (set-view view '())
  440. (set-clip view)
  441. (for-each
  442. union-view-graphic
  443. (drawing-damaged (view-drawing view))))))
  444. (define (ADD-ADDITIONS-TO-BBL view)
  445. ;;; Add additions in a view to the bounding box list.
  446. (set-view view '())
  447. (set-clip view)
  448. (for-each
  449. (lambda (g) (union-view-graphic (graphic-compute-bb g)))
  450. (drawing-added-head (view-drawing view))))
  451. (define (UNION-ADDITIONS-TO-UNDERLAYS vl)
  452. ;;; Add additions to lower drawings to the bounding box list.
  453. (when (and (pair? vl) (pair? (cdr vl)))
  454. (add-additions-to-bbl (car vl))
  455. (union-additions-to-underlays (cdr vl))))
  456. (define (ADD-EXPOSE-TO-BBL)
  457. ;;; Add window expose regions to the bounding box list.
  458. (for-each
  459. (lambda (bb) (add-bbl (car bb) (cadr bb)
  460. (caddr bb) (cadddr bb)))
  461. (window-expose-bbl window)))
  462. (define (ADD-DAMAGE-TO-BBL)
  463. ;;; Add window expose regions to the bounding box list.
  464. (for-each
  465. (lambda (bb) (add-bbl (car bb) (cadr bb)
  466. (caddr bb) (cadddr bb)))
  467. (window-damage-bbl window)))
  468. (define (REDRAW)
  469. ;;; Redraw the union of the damaged and exposed areas in
  470. ;;; each view in order.
  471. (for-each
  472. (lambda (view)
  473. (redraw-a-view view (clip-bbl-to-view view bbl)))
  474. solid-views))
  475. (when (window-exposed window)
  476. ;;; Compute the union of the view's damaged areas and added
  477. ;;; areas to underlaying drawings.
  478. (for-each union-view solid-views)
  479. (union-additions-to-underlays solid-views)
  480. (if (and (not nopixmap) solid-views)
  481. ;;; OK to use a Pixmap to avoid flashing the screen.
  482. (let ((xwindow (window-xwindow window))
  483. (width (window-width window))
  484. (height (window-height window)))
  485. ;;; Add additions to the top drawing to bbl
  486. (add-additions-to-bbl (car (last-pair solid-views)))
  487. ;;; Add exposed and damaged regions clipped by each
  488. ;;; view to bbl
  489. (for-each
  490. (lambda (view)
  491. (set-clip view)
  492. (add-expose-to-bbl)
  493. (add-damage-to-bbl))
  494. solid-views)
  495. ;;; Get a pixmap.
  496. (when (or (not *pixmap*) (< *pixmap-width* width)
  497. (< *pixmap-height* height))
  498. (if *pixmap* (xfreepixmap *dpy* *pixmap*))
  499. (set! *pixmap*
  500. (xcreatepixmap *dpy*
  501. (window-xwindow window)
  502. width height
  503. (display-visual-depth *display*)))
  504. (set! *pixmap-width* width)
  505. (set! *pixmap-height* height))
  506. (set-view #f '())
  507. (window-xwindow! window *pixmap*)
  508. ;;; Build clip list and fill pixmap with background.
  509. (let loop ((l bbl) (rl '()))
  510. (if (pair? l)
  511. (let ((bb (car l))
  512. (r (make-xrectangle)))
  513. (xrectangle-x! r (car bb))
  514. (xrectangle-y! r (cadr bb))
  515. (xrectangle-width! r (- (caddr bb)
  516. (car bb)))
  517. (xrectangle-height! r (- (cadddr bb)
  518. (cadr bb)))
  519. (loop (cdr l) (cons r rl)))
  520. (xsetcliprectangles *dpy* (window-gc window)
  521. 0 0 (xrectangle-list->xrectanglea rl)
  522. (length rl) Unsorted)))
  523. (xfillrectangle *dpy* *pixmap* (window-gc window)
  524. 0 0 width height)
  525. ;;; Draw to pixmap and then copy to the window.
  526. (redraw)
  527. (xcopyarea *dpy* *pixmap* xwindow (window-gc window)
  528. 0 0 width height 0 0)
  529. (set-view #f '())
  530. (window-xwindow! window xwindow))
  531. ;;; No pixmap, draw directly to the window.
  532. (begin (for-each
  533. (lambda (view)
  534. (set-clip view)
  535. (add-damage-to-bbl))
  536. solid-views)
  537. (for-each
  538. (lambda (bb)
  539. (xcleararea *dpy*
  540. (window-xwindow window)
  541. (car bb) (cadr bb)
  542. (- (caddr bb) (car bb))
  543. (- (cadddr bb) (cadr bb)) 0))
  544. bbl)
  545. (set-clip #f)
  546. (add-expose-to-bbl)
  547. (redraw))))))
  548. ;;; Once all drawings have been redrawn, then the additions list and the
  549. ;;; redraw area can be cleared.
  550. (define *REDRAW-SEQ* 0)
  551. (define (DRAWINGS-REDRAWN)
  552. (for-each
  553. (lambda (name-drawing)
  554. (let ((drawing (cadr name-drawing)))
  555. (drawing-added-head! drawing '())
  556. (drawing-added-tail! drawing '())
  557. (drawing-zmotion! drawing #f)
  558. (drawing-cleared! drawing #f)
  559. (drawing-damaged! drawing '())))
  560. *drawings*)
  561. (set! *redraw-seq* (+ 1 *redraw-seq*)))
  562. ;;; Module reset/initialization
  563. (define (WINDOW-MODULE-INIT)
  564. (set! *name-windows* '())
  565. (set! *xwindow-windows* '())
  566. (set! *pixmap* #f))