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

Contents of /mcclim/decls.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.25 - (hide annotations)
Fri Mar 21 21:36:58 2003 UTC (11 years, 1 month ago) by mikemac
Branch: MAIN
Changes since 1.24: +1 -1 lines
make all of the package names passed to in-package be lowercase keywords for ACL's java mode
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 adejneka 1.11 ;;; License along with this library; if not, write to the
22     ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 gilbert 1.1 ;;; Boston, MA 02111-1307 USA.
24    
25 mikemac 1.25 (in-package :clim-internals)
26 gilbert 1.1
27 gilbert 1.8 ;;;; Early special variables
28 gilbert 1.1
29 gilbert 1.8 (defvar *application-frame* nil)
30 gilbert 1.1
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 gilbert 1.5 ;;;; 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 adejneka 1.11 (defgeneric sheet-medium (sheet))
47     (defgeneric medium-sheet (medium))
48     (defgeneric medium-drawable (medium))
49 gilbert 1.5 (defgeneric port (medium))
50    
51     ;;;; 8.3.4.1 Grafting and Degrafting of Mediums
52 gilbert 1.2
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 brian 1.4 (defgeneric medium-draw-circle* (medium center-x center-y radius start-angle end-angle filled))
101 gilbert 1.2 (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 gilbert 1.5 ;;;; 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 gilbert 1.6 ;;;; 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 adejneka 1.9 (defgeneric compose-space (pane &key width height))
140 gilbert 1.6 (defgeneric allocate-space (pane width height))
141 adejneka 1.11 (defgeneric change-space-requirements
142     (pane &rest space-req-keys &key resize-frame))
143 gilbert 1.6 (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 gilbert 1.8 ;;;;
156 gilbert 1.23 (defgeneric gadget-value (gadget))
157     (defgeneric (setf gadget-value) (new-value gadget &key invoke-callback))
158     (defgeneric gadget-min-value (gadget))
159     (defgeneric gadget-max-value (gadget))
160 gilbert 1.8 (defgeneric (setf gadget-max-value) (new-value gadget))
161     (defgeneric (setf gadget-min-value) (new-value gadget))
162     (defgeneric (setf scroll-bar-thumb-size) (new-value scroll-bar))
163     (defgeneric gadget-orientation (gadget))
164     (defgeneric gadget-client (gadget))
165    
166 gilbert 1.2 ;;;
167    
168     (defgeneric medium-foreground (medium))
169     (defgeneric medium-background (medium))
170     (defgeneric medium-ink (medium))
171     (defgeneric medium-transformation (medium))
172     (defgeneric medium-clipping-region (medium))
173     (defgeneric medium-line-style (medium))
174     (defgeneric medium-text-style (medium))
175     (defgeneric medium-default-text-style (medium))
176 adejneka 1.14 (defgeneric text-size (medium string &key text-style start end)
177     (:documentation
178     "Computes the \"cursor motion\" in device units that would take
179     place if STRING were output to MEDIUM starting at position (0,0).
180    
181     Returns total width, total height, final x cursor position, final y
182     cursor position, baseline."))
183 gilbert 1.2
184 adejneka 1.16 (defgeneric text-style-mapping (port text-style &optional character-set))
185    
186 gilbert 1.2 (defgeneric (setf medium-foreground) (new-value medium))
187     (defgeneric (setf medium-background) (new-value medium))
188     (defgeneric (setf medium-ink) (new-value medium))
189     (defgeneric (setf medium-transformation) (new-value medium))
190     (defgeneric (setf medium-clipping-region) (new-value medium))
191     (defgeneric (setf medium-line-style) (new-value medium))
192     (defgeneric (setf medium-text-style) (new-value medium))
193     (defgeneric (setf medium-default-text-style) (new-value medium))
194    
195 adejneka 1.16 (defgeneric (setf text-style-mapping)
196     (mapping port text-style &optional character-set))
197 adejneka 1.19 (defgeneric medium-miter-limit (medium)
198     (:documentation
199     "If LINE-STYLE-JOINT-SHAPE is :MITER and the angle between two
200     consequent lines is less than the values return by
201     MEDIUM-MITER-LIMIT, :BEVEL is used instead."))
202 adejneka 1.15 (defgeneric line-style-effective-thickness (line-style medium)
203     (:documentation
204     "Returns the thickness in device units of a line,
205     rendered on MEDIUM with the style LINE-STYLE."))
206    
207 gilbert 1.5 ;;;
208    
209     (defgeneric sheet-grafted-p (sheet))
210     (defgeneric graft-width (graft &key units))
211     (defgeneric graft-height (graft &key units))
212     (defgeneric graft-units (graft))
213    
214     (defgeneric text-style-character-width (text-style medium char))
215 adejneka 1.13 ;; fall back, where to put this?
216     (defmethod text-style-character-width (text-style medium char)
217     (text-size medium char :text-style text-style))
218 gilbert 1.5
219 gilbert 1.23 ;; Since the declaim form for functions looks clumsy and is
220     ;; syntax-wise different from defun, we define us a new declfun, which
221     ;; fixes this.
222    
223     (defmacro declfun (name lambda-list)
224     `(declaim (ftype (function
225     ,(let ((q lambda-list)
226     res)
227     (do () ((or (null q)
228     (member (car q) '(&optional &rest &key))))
229     (push 't res)
230     (pop q))
231     (when (eq (car q) '&optional)
232     (push '&optional res)
233     (pop q)
234     (do () ((or (null q)
235     (member (car q) '(&rest &key))))
236     (push 't res)))
237     (when (eq (car q) '&rest)
238     (push '&rest res)
239     (pop q)
240     (push 't res)
241     (pop q))
242     (when (eq (car q) '&key)
243     (push '&key res)
244     (pop q)
245     (do () ((or (null q)
246     (member (car q) '(&allow-other-keys))))
247     (push (list (intern (string (if (consp (car q))
248     (if (consp (caar q))
249     (caaar q)
250     (caar q))
251     (car q)))
252     :keyword)
253     't)
254     res)
255     (pop q)))
256     (when (eq (car q) '&allow-other-keys)
257     (push '&allow-other-keys res)
258     (pop q))
259     (reverse res))
260     t)
261     ,name)))
262    
263     (declfun draw-rectangle (sheet point1 point2
264     &rest args
265     &key (filled t)
266     ink clipping-region transformation line-style line-thickness
267     line-unit line-dashes line-joint-shape))
268    
269     (declfun draw-rectangle* (sheet x1 y1 x2 y2
270     &rest args
271     &key (filled t)
272     ink clipping-region transformation line-style line-thickness
273     line-unit line-dashes line-joint-shape))
274 gilbert 1.5
275     ;;; "exported" from a port
276    
277     (defgeneric mirror-transformation (port mirror))
278     (defgeneric port-set-sheet-region (port sheet region))
279     (defgeneric port-set-sheet-transformation (port sheet region))
280 adejneka 1.17 (defgeneric port-text-style-mappings (port))
281 gilbert 1.5 (defgeneric port-lookup-mirror (port sheet))
282     (defgeneric port-register-mirror (port sheet mirror))
283     (defgeneric port-allocate-pixmap (port sheet width height))
284     (defgeneric port-deallocate-pixmap (port pixmap))
285     (defgeneric port-mirror-width (port sheet))
286     (defgeneric port-mirror-height (port sheet))
287 gilbert 1.7 (defgeneric port-enable-sheet (port sheet))
288     (defgeneric port-disable-sheet (port sheet))
289 moore 1.22 (defgeneric port-pointer (port))
290 gilbert 1.2
291 gilbert 1.1 ;;;
292    
293 gilbert 1.8 ;; Used in stream-input.lisp, defined in frames.lisp
294     (defgeneric frame-event-queue (frame))
295 gilbert 1.1
296 moore 1.10 ;;; Used in presentations.lisp, defined in commands.lisp
297    
298     (defgeneric presentation-translators (command-table))
299 gilbert 1.1
300 adejneka 1.21 (defgeneric stream-default-view (stream))
301 adejneka 1.20
302 gilbert 1.5 #||
303    
304     Further undeclared functions
305    
306     FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
307     ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
308     HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
309     PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
310     SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
311    
312     (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
313     SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
314     FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
315     MEDIUM WITH-GRAPHICS-STATE
316     PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH TEXT-STYLE-CHARACTER-WIDTH
317     FIND-INNERMOST-APPLICABLE-PRESENTATION HIGHLIGHT-PRESENTATION-1
318     PRESENTATION-OBJECT PRESENTATION-TYPE THROW-HIGHLIGHTED-PRESENTATION
319     FORMAT-CHILDREN TABLE-PANE-NUMBER TEXT-STYLE-CHARACTER-WIDTH
320     PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH SCROLL-EXTENT TEXT-STYLE-CHARACTER-WIDTH
321     FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
322     ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
323     HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
324     PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
325     SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
326     (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
327     SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
328     FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
329 gilbert 1.1
330 gilbert 1.23 ||#

  ViewVC Help
Powered by ViewVC 1.1.5