/[mcclim]/mcclim/repaint.lisp
ViewVC logotype

Contents of /mcclim/repaint.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.12 - (hide annotations)
Mon Nov 3 08:12:34 2003 UTC (10 years, 5 months ago) by strandh
Branch: MAIN
CVS Tags: McCLIM-0-9, mcclim-0-9-4, McCLIM-0-9-5, McCLIM-0-9-4, McCLIM-0-9-6, McCLIM-0-9-1, McCLIM-0-9-3, McCLIM-0-9-2, HEAD
Changes since 1.11: +1 -0 lines
Added a few "ignore" declarations to avoid compiler notes.
1 rouanet 1.1 ;;; -*- Mode: Lisp; Package: CLIM-INTERNALS -*-
2    
3     ;;; (c) copyright 1998,1999,2000 by Michael McDonald (mikemac@mikemac.com),
4     ;;; (c) copyright 2000 by
5     ;;; Iban Hatchondo (hatchond@emi.u-bordeaux.fr)
6     ;;; Julien Boninfante (boninfan@emi.u-bordeaux.fr)
7     ;;; Robert Strandh (strandh@labri.u-bordeaux.fr)
8    
9     ;;; This library is free software; you can redistribute it and/or
10     ;;; modify it under the terms of the GNU Library General Public
11     ;;; License as published by the Free Software Foundation; either
12     ;;; version 2 of the License, or (at your option) any later version.
13     ;;;
14     ;;; This library is distributed in the hope that it will be useful,
15     ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16     ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17     ;;; Library General Public License for more details.
18     ;;;
19     ;;; You should have received a copy of the GNU Library General Public
20     ;;; License along with this library; if not, write to the
21     ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
22     ;;; Boston, MA 02111-1307 USA.
23    
24    
25    
26     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
27     ;;;
28     ;;; The Repaint Protocol
29    
30 mikemac 1.7 (in-package :clim-internals)
31 rouanet 1.1
32     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
33     ;;;
34     ;;; repaint protocol functions
35    
36     (defmethod queue-repaint ((sheet basic-sheet) (event window-repaint-event))
37     (queue-event sheet event))
38    
39 hefner1 1.10 (defmethod handle-repaint ((sheet basic-sheet) region)
40 strandh 1.12 (declare (ignore region))
41 rouanet 1.1 nil)
42    
43 moore 1.3 (defmethod repaint-sheet ((sheet basic-sheet) region)
44     (map-over-sheets-overlapping-region #'(lambda (s)
45     (handle-repaint s region))
46     sheet
47     region))
48    
49 rouanet 1.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
50     ;;;
51     ;;; repaint protocol classes
52    
53     ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
54     ;;;
55     ;;; standard repainting mixin
56    
57     (defclass standard-repainting-mixin () ())
58    
59 moore 1.3 (defmethod dispatch-event
60     ((sheet standard-repainting-mixin) (event window-repaint-event))
61     (queue-repaint sheet event))
62    
63 rouanet 1.1 (defmethod dispatch-repaint ((sheet standard-repainting-mixin) region)
64 gilbert 1.6 (when (sheet-mirror sheet) ;only dispatch repaints, when the sheet has a mirror
65     (queue-repaint sheet (make-instance 'window-repaint-event
66     :sheet sheet
67     :region (transform-region
68     (sheet-native-transformation sheet)
69     region)))))
70 rouanet 1.1
71 moore 1.3 (defmethod handle-event ((sheet standard-repainting-mixin)
72     (event window-repaint-event))
73     (handle-repaint sheet (window-event-region event)))
74    
75 rouanet 1.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
76     ;;;
77     ;;; immediate repainting mixin
78    
79     (defclass immediate-repainting-mixin () ())
80    
81 moore 1.3 (defmethod dispatch-event
82     ((sheet immediate-repainting-mixin) (event window-repaint-event))
83     (handle-repaint sheet (window-event-region event)))
84    
85 rouanet 1.1 (defmethod dispatch-repaint ((sheet immediate-repainting-mixin) region)
86     (handle-repaint sheet region))
87    
88 moore 1.3 (defmethod handle-event ((sheet immediate-repainting-mixin)
89     (event window-repaint-event))
90     (handle-repaint sheet (window-event-region event)))
91    
92 rouanet 1.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
93     ;;;
94     ;;; sheet mute repainting mixin
95    
96     (defclass sheet-mute-repainting-mixin () ())
97    
98     (defmethod dispatch-repaint ((sheet sheet-mute-repainting-mixin) region)
99 gilbert 1.6 (when (sheet-mirror sheet) ;only dispatch repaints, when the sheet has a mirror
100     (queue-repaint sheet (make-instance 'window-repaint-event
101     :sheet sheet
102     :region (transform-region
103     (sheet-native-transformation sheet)
104     region)))))
105 rouanet 1.1
106 moore 1.3 ;;; I know what the spec says about sheet-mute-repainting-mixin, but I don't
107     ;;; think it's right; "repaint-sheet that does nothing" makes no sense.
108     ;;; -- moore
109     #+nil
110 rouanet 1.1 (defmethod repaint-sheet ((sheet sheet-mute-repainting-mixin) region)
111     (declare (ignorable sheet region))
112 gilbert 1.11 (format *trace-output* "repaint ~S~%" sheet)
113 rouanet 1.1 (values))
114 gilbert 1.2
115 moore 1.3 (defmethod handle-repaint ((sheet sheet-mute-repainting-mixin) region)
116     (declare (ignore region))
117     nil)
118 gilbert 1.2
119 moore 1.3 (defclass clim-repainting-mixin
120     (#+clim-mp standard-repainting-mixin #-clim-mp immediate-repainting-mixin)
121     ()
122     (:documentation "Internal class that implements repainting protocol based on
123     whether or not multiprocessing is supported."))

  ViewVC Help
Powered by ViewVC 1.1.5