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

Contents of /mcclim/decls.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (hide annotations)
Sun Apr 28 11:02:56 2002 UTC (11 years, 11 months ago) by gilbert
Branch: MAIN
Changes since 1.6: +2 -0 lines
added PORT-ENABLE-SHEET, PORT-DISABLE-SHEET declarations.
1 gilbert 1.1 ;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: CLIM-INTERNALS; -*-
2     ;;; ---------------------------------------------------------------------------
3     ;;; Title: DEFGENERICs and stuff
4     ;;; Created: 2001-08-12
5     ;;; Author: Gilbert Baumann <unk6@rz.uni-karlsruhe.de>
6     ;;; License: LGPL (See file COPYING for details).
7     ;;; ---------------------------------------------------------------------------
8 gilbert 1.5 ;;; (c) copyright 2001,2002 by Gilbert Baumann
9 gilbert 1.1
10     ;;; This library is free software; you can redistribute it and/or
11     ;;; modify it under the terms of the GNU Library General Public
12     ;;; License as published by the Free Software Foundation; either
13     ;;; version 2 of the License, or (at your option) any later version.
14     ;;;
15     ;;; This library is distributed in the hope that it will be useful,
16     ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17     ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18     ;;; Library General Public License for more details.
19     ;;;
20     ;;; You should have received a copy of the GNU Library General Public
21     ;;; License along with this library; if not, write to the
22     ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23     ;;; Boston, MA 02111-1307 USA.
24    
25     (in-package :CLIM-INTERNALS)
26    
27     ;;;; Changes
28    
29     ;;; When Who What
30     ;;; --------------------------------------------------------------------------------------
31     ;;; 2001-08-12 GB created
32     ;;;
33    
34     ;; This is just an ad hoc list. Would it be a good idea to include all
35     ;; (exported) generic functions here? --GB
36    
37     (defgeneric point-x (point))
38     (defgeneric point-y (point))
39    
40     (defgeneric transform-region (transformation region))
41    
42 gilbert 1.5 ;;;; 8.3.4 Associating a Medium with a Sheet
43    
44     ;;;; 8.3.4.1 Grafting and Degrafting of Mediums
45    
46     ;; with-sheet-medium (medium sheet) &body body [Macro]
47     ;; with-sheet-medium-bound (sheet medium) &body body [Macro]
48    
49     (defgeneric sheet-medium (sheet))
50     (defgeneric medium-sheet (medium))
51     (defgeneric medium-drawable (medium))
52     (defgeneric port (medium))
53    
54     ;;;; 8.3.4.1 Grafting and Degrafting of Mediums
55 gilbert 1.2
56     (defgeneric allocate-medium (port sheet))
57     (defgeneric deallocate-medium (port medium))
58     (defgeneric make-medium (port sheet))
59     (defgeneric engraft-medium (medium port sheet))
60     (defgeneric degraft-medium (medium port sheet))
61    
62     ;; 8.4.1 Repaint Protocol Functions
63    
64     (defgeneric queue-repaint (sheet repaint-event))
65     (defgeneric handle-repaint (sheet region))
66     (defgeneric repaint-sheet (sheet region))
67    
68     ;; 9 Ports, Grafts, and Mirrored Sheets
69    
70     ;; (defgeneric portp (object))
71     ;; find-port function
72    
73     ;; 9.4.1 Mirror Functions
74    
75     (defgeneric sheet-direct-mirror (sheet))
76     (defgeneric sheet-mirrored-ancestor (sheet))
77     (defgeneric sheet-mirror (sheet))
78     (defgeneric realize-mirror (port mirrored-sheet))
79     (defgeneric destroy-mirror (port mirrored-sheet))
80     (defgeneric raise-mirror (port sheet))
81     (defgeneric bury-mirror (port sheet))
82    
83     ;; 9.4.2 Internal Interfaces for Native Coordinates
84    
85     (defgeneric sheet-native-transformation (sheet))
86     (defgeneric sheet-native-region (sheet))
87     (defgeneric sheet-device-transformation (sheet))
88     (defgeneric sheet-device-region (sheet))
89     (defgeneric invalidate-cached-transformations (sheet))
90     (defgeneric invalidate-cached-regions (sheet))
91    
92     ;;; Graphics ops
93    
94     (defgeneric medium-draw-point* (medium x y))
95     (defgeneric medium-draw-points* (medium coord-seq))
96     (defgeneric medium-draw-line* (medium x1 y1 x2 y2))
97     (defgeneric medium-draw-lines* (medium coord-seq))
98     (defgeneric medium-draw-polygon* (medium coord-seq closed filled))
99     (defgeneric medium-draw-rectangle* (medium left top right bottom filled))
100     (defgeneric medium-draw-ellipse* (medium center-x center-y
101     radius-1-dx radius-1-dy radius-2-dx radius-2-dy
102     start-angle end-angle filled))
103 brian 1.4 (defgeneric medium-draw-oval* (medium center-x center-y radius-x radius-y filled))
104     (defgeneric medium-draw-circle* (medium center-x center-y radius start-angle end-angle filled))
105 gilbert 1.2 (defgeneric medium-draw-text* (medium string x y
106     start end
107     align-x align-y
108     toward-x toward-y transform-glyphs))
109    
110 gilbert 1.5 ;;;; 29.2.2 Pane Properties
111    
112     (defgeneric pane-frame (pane))
113     (defgeneric pane-name (pane))
114     (defgeneric pane-foreground (pane))
115     (defgeneric pane-background (pane))
116     (defgeneric pane-text-style (pane))
117    
118     ;;;; 29.3.3 Scroller Pane Classes
119    
120     (defgeneric pane-viewport (pane))
121     (defgeneric pane-viewport-region (pane))
122     (defgeneric pane-scroller (pane))
123     (defgeneric scroll-extent (pane x y))
124    
125 gilbert 1.6 ;;;; 29.3.4 The Layout Protocol
126    
127     ;; (define-protocol-class space-requirement ())
128    
129     ;; make-space-requirement &key (width 0) (max-width 0) (min-width 0) (height 0) (max-height 0) (min-height 0) [Function]
130    
131     (defgeneric space-requirement-width (space-req))
132     (defgeneric space-requirement-min-width (space-req))
133     (defgeneric space-requirement-max-width (space-req))
134     (defgeneric space-requirement-height (space-req))
135     (defgeneric space-requirement-min-height (space-req))
136     (defgeneric space-requirement-max-height (space-req))
137     (defgeneric space-requirement-components (space-req))
138    
139     ;; space-requirement-combine function sr1 sr2 [Function]
140     ;; space-requirement+ sr1 sr2 [Function]
141     ;; space-requirement+* space-req &key width min-width max-width height min-height max-height [Function]
142    
143     (defgeneric compose-space (pane)) ;; &key width height
144     (defgeneric allocate-space (pane width height))
145     (defgeneric change-space-requirements (pane &key resize-frame &rest space-req-keys))
146     (defgeneric note-space-requirements-changed (sheet pane))
147     ;; changing-space-requirements (&key resize-frame layout) &body body [Macro]
148    
149     ;;;; 29.4.4 CLIM Stream Pane Functions
150    
151     (defgeneric window-clear (window))
152     (defgeneric window-refresh (window))
153     (defgeneric window-viewport (window))
154     (defgeneric window-erase-viewport (window))
155     (defgeneric window-viewport-position (window))
156     ;; (defgeneric (setf* window-viewport-position) (x y window))
157    
158 gilbert 1.2 ;;;
159    
160     (defgeneric medium-foreground (medium))
161     (defgeneric medium-background (medium))
162     (defgeneric medium-ink (medium))
163     (defgeneric medium-transformation (medium))
164     (defgeneric medium-clipping-region (medium))
165     (defgeneric medium-line-style (medium))
166     (defgeneric medium-text-style (medium))
167     (defgeneric medium-default-text-style (medium))
168    
169     (defgeneric (setf medium-foreground) (new-value medium))
170     (defgeneric (setf medium-background) (new-value medium))
171     (defgeneric (setf medium-ink) (new-value medium))
172     (defgeneric (setf medium-transformation) (new-value medium))
173     (defgeneric (setf medium-clipping-region) (new-value medium))
174     (defgeneric (setf medium-line-style) (new-value medium))
175     (defgeneric (setf medium-text-style) (new-value medium))
176     (defgeneric (setf medium-default-text-style) (new-value medium))
177    
178 gilbert 1.5 ;;;
179    
180     (defgeneric sheet-grafted-p (sheet))
181     (defgeneric graft-width (graft &key units))
182     (defgeneric graft-height (graft &key units))
183     (defgeneric graft-units (graft))
184    
185     (defgeneric text-style-character-width (text-style medium char))
186    
187     (declaim (ftype (function (t t t
188     &key (:filled t) (:ink t) (:clipping-region t) (:transformation t)
189     (:line-style t) (:line-thickness t) (:line-unit t) (:line-dashes t)
190     (:line-joint-shape t))
191     t)
192     draw-rectangle))
193    
194     (declaim (ftype (function (t t t t t
195     &key (:filled t) (:ink t) (:clipping-region t) (:transformation t)
196     (:line-style t) (:line-thickness t) (:line-unit t) (:line-dashes t)
197     (:line-joint-shape t))
198     t)
199     draw-rectangle*))
200    
201     ;;; "exported" from a port
202    
203     (defgeneric mirror-transformation (port mirror))
204     (defgeneric port-set-sheet-region (port sheet region))
205     (defgeneric port-set-sheet-transformation (port sheet region))
206     (defgeneric port-make-font-text-style (port device-font-name))
207     (defgeneric port-lookup-mirror (port sheet))
208     (defgeneric port-register-mirror (port sheet mirror))
209     (defgeneric port-allocate-pixmap (port sheet width height))
210     (defgeneric port-deallocate-pixmap (port pixmap))
211     (defgeneric port-mirror-width (port sheet))
212     (defgeneric port-mirror-height (port sheet))
213 gilbert 1.7 (defgeneric port-enable-sheet (port sheet))
214     (defgeneric port-disable-sheet (port sheet))
215 gilbert 1.2
216 gilbert 1.1 ;;;
217    
218     (defmacro with-special-choices ((sheet) &body body)
219     "Macro for optimizing drawing with graphical system dependant mechanisms."
220     (let ((fn (gensym "FN.")))
221     `(labels ((,fn (,sheet)
222     ,@body))
223     (declare (dynamic-extent #',fn))
224     (invoke-with-special-choices #',fn ,sheet))))
225    
226     (defgeneric invoke-with-special-choices (continuation sheet))
227    
228     ;; fall back, where to put this?
229    
230     (defmethod invoke-with-special-choices (continuation (sheet T))
231     (funcall continuation sheet))
232    
233    
234 gilbert 1.5 #||
235    
236     Further undeclared functions
237    
238     FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
239     ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
240     HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
241     PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
242     SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
243    
244     (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
245     SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
246     FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
247     TEXT-STYLE-CHARACTER-WIDTH
248     MEDIUM WITH-GRAPHICS-STATE
249     PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH TEXT-STYLE-CHARACTER-WIDTH
250     FIND-INNERMOST-APPLICABLE-PRESENTATION HIGHLIGHT-PRESENTATION-1
251     PRESENTATION-OBJECT PRESENTATION-TYPE THROW-HIGHLIGHTED-PRESENTATION
252     FORMAT-CHILDREN TABLE-PANE-NUMBER TEXT-STYLE-CHARACTER-WIDTH
253     PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH SCROLL-EXTENT TEXT-STYLE-CHARACTER-WIDTH
254     FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
255     ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
256     HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
257     PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
258     SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
259     (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
260     SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
261     FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
262     TEXT-STYLE-CHARACTER-WIDTH
263 gilbert 1.1
264 gilbert 1.5 ||#

  ViewVC Help
Powered by ViewVC 1.1.5