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

Contents of /mcclim/decls.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.20 - (show annotations)
Wed Aug 7 16:05:31 2002 UTC (11 years, 8 months ago) by adejneka
Branch: MAIN
Changes since 1.19: +5 -0 lines
* STREAM-DEFAULT-VIEW: added DEFGENERIC; added default method.
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 medium-miter-limit (medium)
196 (:documentation
197 "If LINE-STYLE-JOINT-SHAPE is :MITER and the angle between two
198 consequent lines is less than the values return by
199 MEDIUM-MITER-LIMIT, :BEVEL is used instead."))
200 (defgeneric line-style-effective-thickness (line-style medium)
201 (:documentation
202 "Returns the thickness in device units of a line,
203 rendered on MEDIUM with the style LINE-STYLE."))
204
205 ;;;
206
207 (defgeneric sheet-grafted-p (sheet))
208 (defgeneric graft-width (graft &key units))
209 (defgeneric graft-height (graft &key units))
210 (defgeneric graft-units (graft))
211
212 (defgeneric text-style-character-width (text-style medium char))
213 ;; fall back, where to put this?
214 (defmethod text-style-character-width (text-style medium char)
215 (text-size medium char :text-style text-style))
216
217 (declaim (ftype (function (t t t
218 &key (:filled t) (:ink t) (:clipping-region t) (:transformation t)
219 (:line-style t) (:line-thickness t) (:line-unit t) (:line-dashes t)
220 (:line-joint-shape t))
221 t)
222 draw-rectangle))
223
224 (declaim (ftype (function (t t t t t
225 &key (:filled t) (:ink t) (:clipping-region t) (:transformation t)
226 (:line-style t) (:line-thickness t) (:line-unit t) (:line-dashes t)
227 (:line-joint-shape t))
228 t)
229 draw-rectangle*))
230
231 ;;; "exported" from a port
232
233 (defgeneric mirror-transformation (port mirror))
234 (defgeneric port-set-sheet-region (port sheet region))
235 (defgeneric port-set-sheet-transformation (port sheet region))
236 (defgeneric port-text-style-mappings (port))
237 (defgeneric port-lookup-mirror (port sheet))
238 (defgeneric port-register-mirror (port sheet mirror))
239 (defgeneric port-allocate-pixmap (port sheet width height))
240 (defgeneric port-deallocate-pixmap (port pixmap))
241 (defgeneric port-mirror-width (port sheet))
242 (defgeneric port-mirror-height (port sheet))
243 (defgeneric port-enable-sheet (port sheet))
244 (defgeneric port-disable-sheet (port sheet))
245
246 ;;;
247
248 ;; Used in stream-input.lisp, defined in frames.lisp
249 (defgeneric frame-event-queue (frame))
250
251 ;;; Used in presentations.lisp, defined in commands.lisp
252
253 (defgeneric presentation-translators (command-table))
254
255 (defgeneric stream-default-view (stream)
256 (:method (stream)
257 (declare (ignore stream))
258 +textual-view+))
259
260 #||
261
262 Further undeclared functions
263
264 FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
265 ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
266 HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
267 PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
268 SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
269
270 (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
271 SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
272 FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
273 MEDIUM WITH-GRAPHICS-STATE
274 PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH TEXT-STYLE-CHARACTER-WIDTH
275 FIND-INNERMOST-APPLICABLE-PRESENTATION HIGHLIGHT-PRESENTATION-1
276 PRESENTATION-OBJECT PRESENTATION-TYPE THROW-HIGHLIGHTED-PRESENTATION
277 FORMAT-CHILDREN TABLE-PANE-NUMBER TEXT-STYLE-CHARACTER-WIDTH
278 PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH SCROLL-EXTENT TEXT-STYLE-CHARACTER-WIDTH
279 FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
280 ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
281 HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
282 PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
283 SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
284 (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
285 SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
286 FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
287
288 ||#

  ViewVC Help
Powered by ViewVC 1.1.5