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

Contents of /mcclim/decls.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations)
Thu May 23 10:38:57 2002 UTC (11 years, 10 months ago) by adejneka
Branch: MAIN
Changes since 1.10: +7 -6 lines
* CHANGE-SPACE-REQUIREMENTS: Put &REST argument before &KEY.
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 ;;; (c) copyright 2001,2002 by Gilbert Baumann
9
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 ;;;; Early special variables
28
29 (defvar *application-frame* nil)
30
31 ;; This is just an ad hoc list. Would it be a good idea to include all
32 ;; (exported) generic functions here? --GB
33
34 (defgeneric point-x (point))
35 (defgeneric point-y (point))
36
37 (defgeneric transform-region (transformation region))
38
39 ;;;; 8.3.4 Associating a Medium with a Sheet
40
41 ;;;; 8.3.4.1 Grafting and Degrafting of Mediums
42
43 ;; with-sheet-medium (medium sheet) &body body [Macro]
44 ;; with-sheet-medium-bound (sheet medium) &body body [Macro]
45
46 (defgeneric sheet-medium (sheet))
47 (defgeneric medium-sheet (medium))
48 (defgeneric medium-drawable (medium))
49 (defgeneric port (medium))
50
51 ;;;; 8.3.4.1 Grafting and Degrafting of Mediums
52
53 (defgeneric allocate-medium (port sheet))
54 (defgeneric deallocate-medium (port medium))
55 (defgeneric make-medium (port sheet))
56 (defgeneric engraft-medium (medium port sheet))
57 (defgeneric degraft-medium (medium port sheet))
58
59 ;; 8.4.1 Repaint Protocol Functions
60
61 (defgeneric queue-repaint (sheet repaint-event))
62 (defgeneric handle-repaint (sheet region))
63 (defgeneric repaint-sheet (sheet region))
64
65 ;; 9 Ports, Grafts, and Mirrored Sheets
66
67 ;; (defgeneric portp (object))
68 ;; find-port function
69
70 ;; 9.4.1 Mirror Functions
71
72 (defgeneric sheet-direct-mirror (sheet))
73 (defgeneric sheet-mirrored-ancestor (sheet))
74 (defgeneric sheet-mirror (sheet))
75 (defgeneric realize-mirror (port mirrored-sheet))
76 (defgeneric destroy-mirror (port mirrored-sheet))
77 (defgeneric raise-mirror (port sheet))
78 (defgeneric bury-mirror (port sheet))
79
80 ;; 9.4.2 Internal Interfaces for Native Coordinates
81
82 (defgeneric sheet-native-transformation (sheet))
83 (defgeneric sheet-native-region (sheet))
84 (defgeneric sheet-device-transformation (sheet))
85 (defgeneric sheet-device-region (sheet))
86 (defgeneric invalidate-cached-transformations (sheet))
87 (defgeneric invalidate-cached-regions (sheet))
88
89 ;;; Graphics ops
90
91 (defgeneric medium-draw-point* (medium x y))
92 (defgeneric medium-draw-points* (medium coord-seq))
93 (defgeneric medium-draw-line* (medium x1 y1 x2 y2))
94 (defgeneric medium-draw-lines* (medium coord-seq))
95 (defgeneric medium-draw-polygon* (medium coord-seq closed filled))
96 (defgeneric medium-draw-rectangle* (medium left top right bottom filled))
97 (defgeneric medium-draw-ellipse* (medium center-x center-y
98 radius-1-dx radius-1-dy radius-2-dx radius-2-dy
99 start-angle end-angle filled))
100 (defgeneric medium-draw-oval* (medium center-x center-y radius-x radius-y filled))
101 (defgeneric medium-draw-circle* (medium center-x center-y radius start-angle end-angle filled))
102 (defgeneric medium-draw-text* (medium string x y
103 start end
104 align-x align-y
105 toward-x toward-y transform-glyphs))
106
107 ;;;; 29.2.2 Pane Properties
108
109 (defgeneric pane-frame (pane))
110 (defgeneric pane-name (pane))
111 (defgeneric pane-foreground (pane))
112 (defgeneric pane-background (pane))
113 (defgeneric pane-text-style (pane))
114
115 ;;;; 29.3.3 Scroller Pane Classes
116
117 (defgeneric pane-viewport (pane))
118 (defgeneric pane-viewport-region (pane))
119 (defgeneric pane-scroller (pane))
120 (defgeneric scroll-extent (pane x y))
121
122 ;;;; 29.3.4 The Layout Protocol
123
124 ;; (define-protocol-class space-requirement ())
125
126 ;; make-space-requirement &key (width 0) (max-width 0) (min-width 0) (height 0) (max-height 0) (min-height 0) [Function]
127
128 (defgeneric space-requirement-width (space-req))
129 (defgeneric space-requirement-min-width (space-req))
130 (defgeneric space-requirement-max-width (space-req))
131 (defgeneric space-requirement-height (space-req))
132 (defgeneric space-requirement-min-height (space-req))
133 (defgeneric space-requirement-max-height (space-req))
134 (defgeneric space-requirement-components (space-req))
135
136 ;; space-requirement-combine function sr1 sr2 [Function]
137 ;; space-requirement+ sr1 sr2 [Function]
138 ;; space-requirement+* space-req &key width min-width max-width height min-height max-height [Function]
139
140 (defgeneric compose-space (pane &key width height))
141 (defgeneric allocate-space (pane width height))
142 (defgeneric change-space-requirements
143 (pane &rest space-req-keys &key resize-frame))
144 (defgeneric note-space-requirements-changed (sheet pane))
145 ;; changing-space-requirements (&key resize-frame layout) &body body [Macro]
146
147 ;;;; 29.4.4 CLIM Stream Pane Functions
148
149 (defgeneric window-clear (window))
150 (defgeneric window-refresh (window))
151 (defgeneric window-viewport (window))
152 (defgeneric window-erase-viewport (window))
153 (defgeneric window-viewport-position (window))
154 ;; (defgeneric (setf* window-viewport-position) (x y window))
155
156 ;;;;
157
158 (defgeneric (setf gadget-max-value) (new-value gadget))
159 (defgeneric (setf gadget-min-value) (new-value gadget))
160 (defgeneric (setf scroll-bar-thumb-size) (new-value scroll-bar))
161 (defgeneric gadget-value (gadget))
162 (defgeneric gadget-orientation (gadget))
163 (defgeneric gadget-client (gadget))
164
165 ;;;
166
167 (defgeneric medium-foreground (medium))
168 (defgeneric medium-background (medium))
169 (defgeneric medium-ink (medium))
170 (defgeneric medium-transformation (medium))
171 (defgeneric medium-clipping-region (medium))
172 (defgeneric medium-line-style (medium))
173 (defgeneric medium-text-style (medium))
174 (defgeneric medium-default-text-style (medium))
175
176 (defgeneric (setf medium-foreground) (new-value medium))
177 (defgeneric (setf medium-background) (new-value medium))
178 (defgeneric (setf medium-ink) (new-value medium))
179 (defgeneric (setf medium-transformation) (new-value medium))
180 (defgeneric (setf medium-clipping-region) (new-value medium))
181 (defgeneric (setf medium-line-style) (new-value medium))
182 (defgeneric (setf medium-text-style) (new-value medium))
183 (defgeneric (setf medium-default-text-style) (new-value medium))
184
185 ;;;
186
187 (defgeneric sheet-grafted-p (sheet))
188 (defgeneric graft-width (graft &key units))
189 (defgeneric graft-height (graft &key units))
190 (defgeneric graft-units (graft))
191
192 (defgeneric text-style-character-width (text-style medium char))
193
194 (declaim (ftype (function (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 (declaim (ftype (function (t t t t t
202 &key (:filled t) (:ink t) (:clipping-region t) (:transformation t)
203 (:line-style t) (:line-thickness t) (:line-unit t) (:line-dashes t)
204 (:line-joint-shape t))
205 t)
206 draw-rectangle*))
207
208 ;;; "exported" from a port
209
210 (defgeneric mirror-transformation (port mirror))
211 (defgeneric port-set-sheet-region (port sheet region))
212 (defgeneric port-set-sheet-transformation (port sheet region))
213 (defgeneric port-make-font-text-style (port device-font-name))
214 (defgeneric port-lookup-mirror (port sheet))
215 (defgeneric port-register-mirror (port sheet mirror))
216 (defgeneric port-allocate-pixmap (port sheet width height))
217 (defgeneric port-deallocate-pixmap (port pixmap))
218 (defgeneric port-mirror-width (port sheet))
219 (defgeneric port-mirror-height (port sheet))
220 (defgeneric port-enable-sheet (port sheet))
221 (defgeneric port-disable-sheet (port sheet))
222
223 ;;;
224
225 (defmacro with-special-choices ((sheet) &body body)
226 "Macro for optimizing drawing with graphical system dependant mechanisms."
227 (let ((fn (gensym "FN.")))
228 `(labels ((,fn (,sheet)
229 ,@body))
230 (declare (dynamic-extent #',fn))
231 (invoke-with-special-choices #',fn ,sheet))))
232
233 (defgeneric invoke-with-special-choices (continuation sheet))
234
235 ;; fall back, where to put this?
236
237 (defmethod invoke-with-special-choices (continuation (sheet T))
238 (funcall continuation sheet))
239
240 ;;;
241
242 ;; Used in stream-input.lisp, defined in frames.lisp
243 (defgeneric frame-event-queue (frame))
244
245 ;;; Used in presentations.lisp, defined in commands.lisp
246
247 (defgeneric presentation-translators (command-table))
248
249 #||
250
251 Further undeclared functions
252
253 FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
254 ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
255 HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
256 PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
257 SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
258
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 MEDIUM WITH-GRAPHICS-STATE
264 PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH TEXT-STYLE-CHARACTER-WIDTH
265 FIND-INNERMOST-APPLICABLE-PRESENTATION HIGHLIGHT-PRESENTATION-1
266 PRESENTATION-OBJECT PRESENTATION-TYPE THROW-HIGHLIGHTED-PRESENTATION
267 FORMAT-CHILDREN TABLE-PANE-NUMBER TEXT-STYLE-CHARACTER-WIDTH
268 PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH SCROLL-EXTENT TEXT-STYLE-CHARACTER-WIDTH
269 FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
270 ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
271 HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
272 PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
273 SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
274 (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
275 SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
276 FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
277 TEXT-STYLE-CHARACTER-WIDTH
278
279 ||#

  ViewVC Help
Powered by ViewVC 1.1.5