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

Contents of /mcclim/decls.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.16 - (show annotations)
Fri Jun 7 07:04:25 2002 UTC (11 years, 10 months ago) by adejneka
Branch: MAIN
Changes since 1.15: +4 -0 lines
* Added support of multiple mediums per stream.

* TEXT-STYLE-MAPPING for postscript streams is implemented and
  documented.

* CLIM-POSTSCRIPT:LOAD-AFM-FILE is documented.
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-circle* (medium center-x center-y radius start-angle end-angle filled))
101 (defgeneric medium-draw-text* (medium string x y
102 start end
103 align-x align-y
104 toward-x toward-y transform-glyphs))
105
106 ;;;; 29.2.2 Pane Properties
107
108 (defgeneric pane-frame (pane))
109 (defgeneric pane-name (pane))
110 (defgeneric pane-foreground (pane))
111 (defgeneric pane-background (pane))
112 (defgeneric pane-text-style (pane))
113
114 ;;;; 29.3.3 Scroller Pane Classes
115
116 (defgeneric pane-viewport (pane))
117 (defgeneric pane-viewport-region (pane))
118 (defgeneric pane-scroller (pane))
119 (defgeneric scroll-extent (pane x y))
120
121 ;;;; 29.3.4 The Layout Protocol
122
123 ;; (define-protocol-class space-requirement ())
124
125 ;; make-space-requirement &key (width 0) (max-width 0) (min-width 0) (height 0) (max-height 0) (min-height 0) [Function]
126
127 (defgeneric space-requirement-width (space-req))
128 (defgeneric space-requirement-min-width (space-req))
129 (defgeneric space-requirement-max-width (space-req))
130 (defgeneric space-requirement-height (space-req))
131 (defgeneric space-requirement-min-height (space-req))
132 (defgeneric space-requirement-max-height (space-req))
133 (defgeneric space-requirement-components (space-req))
134
135 ;; space-requirement-combine function sr1 sr2 [Function]
136 ;; space-requirement+ sr1 sr2 [Function]
137 ;; space-requirement+* space-req &key width min-width max-width height min-height max-height [Function]
138
139 (defgeneric compose-space (pane &key width height))
140 (defgeneric allocate-space (pane width height))
141 (defgeneric change-space-requirements
142 (pane &rest space-req-keys &key resize-frame))
143 (defgeneric note-space-requirements-changed (sheet pane))
144 ;; changing-space-requirements (&key resize-frame layout) &body body [Macro]
145
146 ;;;; 29.4.4 CLIM Stream Pane Functions
147
148 (defgeneric window-clear (window))
149 (defgeneric window-refresh (window))
150 (defgeneric window-viewport (window))
151 (defgeneric window-erase-viewport (window))
152 (defgeneric window-viewport-position (window))
153 ;; (defgeneric (setf* window-viewport-position) (x y window))
154
155 ;;;;
156
157 (defgeneric (setf gadget-max-value) (new-value gadget))
158 (defgeneric (setf gadget-min-value) (new-value gadget))
159 (defgeneric (setf scroll-bar-thumb-size) (new-value scroll-bar))
160 (defgeneric gadget-value (gadget))
161 (defgeneric gadget-orientation (gadget))
162 (defgeneric gadget-client (gadget))
163
164 ;;;
165
166 (defgeneric medium-foreground (medium))
167 (defgeneric medium-background (medium))
168 (defgeneric medium-ink (medium))
169 (defgeneric medium-transformation (medium))
170 (defgeneric medium-clipping-region (medium))
171 (defgeneric medium-line-style (medium))
172 (defgeneric medium-text-style (medium))
173 (defgeneric medium-default-text-style (medium))
174 (defgeneric text-size (medium string &key text-style start end)
175 (:documentation
176 "Computes the \"cursor motion\" in device units that would take
177 place if STRING were output to MEDIUM starting at position (0,0).
178
179 Returns total width, total height, final x cursor position, final y
180 cursor position, baseline."))
181
182 (defgeneric text-style-mapping (port text-style &optional character-set))
183
184 (defgeneric (setf medium-foreground) (new-value medium))
185 (defgeneric (setf medium-background) (new-value medium))
186 (defgeneric (setf medium-ink) (new-value medium))
187 (defgeneric (setf medium-transformation) (new-value medium))
188 (defgeneric (setf medium-clipping-region) (new-value medium))
189 (defgeneric (setf medium-line-style) (new-value medium))
190 (defgeneric (setf medium-text-style) (new-value medium))
191 (defgeneric (setf medium-default-text-style) (new-value medium))
192
193 (defgeneric (setf text-style-mapping)
194 (mapping port text-style &optional character-set))
195 (defgeneric line-style-effective-thickness (line-style medium)
196 (:documentation
197 "Returns the thickness in device units of a line,
198 rendered on MEDIUM with the style LINE-STYLE."))
199
200 ;;;
201
202 (defgeneric sheet-grafted-p (sheet))
203 (defgeneric graft-width (graft &key units))
204 (defgeneric graft-height (graft &key units))
205 (defgeneric graft-units (graft))
206
207 (defgeneric text-style-character-width (text-style medium char))
208 ;; fall back, where to put this?
209 (defmethod text-style-character-width (text-style medium char)
210 (text-size medium char :text-style text-style))
211
212 (declaim (ftype (function (t t t
213 &key (:filled t) (:ink t) (:clipping-region t) (:transformation t)
214 (:line-style t) (:line-thickness t) (:line-unit t) (:line-dashes t)
215 (:line-joint-shape t))
216 t)
217 draw-rectangle))
218
219 (declaim (ftype (function (t t t t t
220 &key (:filled t) (:ink t) (:clipping-region t) (:transformation t)
221 (:line-style t) (:line-thickness t) (:line-unit t) (:line-dashes t)
222 (:line-joint-shape t))
223 t)
224 draw-rectangle*))
225
226 ;;; "exported" from a port
227
228 (defgeneric mirror-transformation (port mirror))
229 (defgeneric port-set-sheet-region (port sheet region))
230 (defgeneric port-set-sheet-transformation (port sheet region))
231 (defgeneric port-make-font-text-style (port device-font-name))
232 (defgeneric port-lookup-mirror (port sheet))
233 (defgeneric port-register-mirror (port sheet mirror))
234 (defgeneric port-allocate-pixmap (port sheet width height))
235 (defgeneric port-deallocate-pixmap (port pixmap))
236 (defgeneric port-mirror-width (port sheet))
237 (defgeneric port-mirror-height (port sheet))
238 (defgeneric port-enable-sheet (port sheet))
239 (defgeneric port-disable-sheet (port sheet))
240
241 ;;;
242
243 (defmacro with-special-choices ((sheet) &body body)
244 "Macro for optimizing drawing with graphical system dependant mechanisms."
245 (let ((fn (gensym "FN.")))
246 `(labels ((,fn (,sheet)
247 ,@body))
248 (declare (dynamic-extent #',fn))
249 (invoke-with-special-choices #',fn ,sheet))))
250
251 (defgeneric invoke-with-special-choices (continuation sheet))
252
253 ;; fall back, where to put this?
254
255 (defmethod invoke-with-special-choices (continuation (sheet T))
256 (funcall continuation sheet))
257
258 ;;;
259
260 ;; Used in stream-input.lisp, defined in frames.lisp
261 (defgeneric frame-event-queue (frame))
262
263 ;;; Used in presentations.lisp, defined in commands.lisp
264
265 (defgeneric presentation-translators (command-table))
266
267 #||
268
269 Further undeclared functions
270
271 FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
272 ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
273 HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
274 PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
275 SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
276
277 (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
278 SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
279 FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
280 MEDIUM WITH-GRAPHICS-STATE
281 PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH TEXT-STYLE-CHARACTER-WIDTH
282 FIND-INNERMOST-APPLICABLE-PRESENTATION HIGHLIGHT-PRESENTATION-1
283 PRESENTATION-OBJECT PRESENTATION-TYPE THROW-HIGHLIGHTED-PRESENTATION
284 FORMAT-CHILDREN TABLE-PANE-NUMBER TEXT-STYLE-CHARACTER-WIDTH
285 PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH SCROLL-EXTENT TEXT-STYLE-CHARACTER-WIDTH
286 FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
287 ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
288 HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
289 PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
290 SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
291 (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
292 SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
293 FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
294
295 ||#

  ViewVC Help
Powered by ViewVC 1.1.5