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

Contents of /mcclim/repaint.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations)
Sun Apr 28 11:17:07 2002 UTC (11 years, 11 months ago) by gilbert
Branch: MAIN
Changes since 1.3: +0 -8 lines
Besides some support for enabled/disabled sheets in panes.lisp and removal
of some unused code, the most notable change is:

- removal of all method defintions like
  (defmethod handle-event ((foo foo-pane) (event window-repaint-event))
    (repaint-sheet foo (event-region event))

- Switched last remaining REPAINT-SHEET methods into HANDLE-REPAINT, since
  HANDLE-REPAINT is where you define repainting. REPAINT-SHEET is for forcing
  a repaint not for implementing a repaint. [Although I am German my reading
  comprehension should be just good enough to understand the relevant chapter
  of the specification].
  This breaks CLIM-FIG again, refer to my posting to the mailing list.
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     (in-package :CLIM-INTERNALS)
31    
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     (defmethod handle-repaint ((sheet basic-sheet) region)
40     (declare (ignore region))
41     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     (queue-repaint sheet (make-instance 'window-repaint-event
65     :sheet sheet
66     :region region)))
67    
68 moore 1.3 (defmethod handle-event ((sheet standard-repainting-mixin)
69     (event window-repaint-event))
70     (handle-repaint sheet (window-event-region event)))
71    
72 rouanet 1.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
73     ;;;
74     ;;; immediate repainting mixin
75    
76     (defclass immediate-repainting-mixin () ())
77    
78 moore 1.3 (defmethod dispatch-event
79     ((sheet immediate-repainting-mixin) (event window-repaint-event))
80     (handle-repaint sheet (window-event-region event)))
81    
82 rouanet 1.1 (defmethod dispatch-repaint ((sheet immediate-repainting-mixin) region)
83     (handle-repaint sheet region))
84    
85 moore 1.3 (defmethod handle-event ((sheet immediate-repainting-mixin)
86     (event window-repaint-event))
87     (handle-repaint sheet (window-event-region event)))
88    
89 rouanet 1.1 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
90     ;;;
91     ;;; sheet mute repainting mixin
92    
93     (defclass sheet-mute-repainting-mixin () ())
94    
95     (defmethod dispatch-repaint ((sheet sheet-mute-repainting-mixin) region)
96     (queue-repaint sheet (make-instance 'window-repaint-event
97     :sheet sheet
98     :region region)))
99    
100 moore 1.3 ;;; I know what the spec says about sheet-mute-repainting-mixin, but I don't
101     ;;; think it's right; "repaint-sheet that does nothing" makes no sense.
102     ;;; -- moore
103     #+nil
104 rouanet 1.1 (defmethod repaint-sheet ((sheet sheet-mute-repainting-mixin) region)
105     (declare (ignorable sheet region))
106     (format *debug-io* "repaint ~S~%" sheet)
107     (values))
108 gilbert 1.2
109 moore 1.3 (defmethod handle-repaint ((sheet sheet-mute-repainting-mixin) region)
110     (declare (ignore region))
111     nil)
112 gilbert 1.2
113 moore 1.3 (defclass clim-repainting-mixin
114     (#+clim-mp standard-repainting-mixin #-clim-mp immediate-repainting-mixin)
115     ()
116     (:documentation "Internal class that implements repainting protocol based on
117     whether or not multiprocessing is supported."))

  ViewVC Help
Powered by ViewVC 1.1.5