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

Contents of /mcclim/decls.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.28 - (hide annotations)
Thu Oct 23 05:59:14 2003 UTC (10 years, 5 months ago) by moore
Branch: MAIN
CVS Tags: McCLIM-0-9
Changes since 1.27: +45 -3 lines
Christophe Rhodes' improved defgeneric definitions.

Early work on the partial command processor.
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 moore 1.28 ;;; This is just an ad hoc list. Would it be a good idea to include all
32     ;;; (exported) generic functions here? --GB
33     ;;;
34     ;;; YES! -- CSR
35 gilbert 1.1 (defgeneric point-x (point))
36     (defgeneric point-y (point))
37    
38     (defgeneric transform-region (transformation region))
39    
40 moore 1.28 ;;;; 8.1
41     (defgeneric process-next-event (port &key wait-function timeout))
42    
43 gilbert 1.5 ;;;; 8.3.4 Associating a Medium with a Sheet
44    
45     ;;;; 8.3.4.1 Grafting and Degrafting of Mediums
46    
47     ;; with-sheet-medium (medium sheet) &body body [Macro]
48     ;; with-sheet-medium-bound (sheet medium) &body body [Macro]
49    
50 adejneka 1.11 (defgeneric sheet-medium (sheet))
51     (defgeneric medium-sheet (medium))
52     (defgeneric medium-drawable (medium))
53 gilbert 1.5 (defgeneric port (medium))
54    
55     ;;;; 8.3.4.1 Grafting and Degrafting of Mediums
56 gilbert 1.2
57     (defgeneric allocate-medium (port sheet))
58     (defgeneric deallocate-medium (port medium))
59     (defgeneric make-medium (port sheet))
60     (defgeneric engraft-medium (medium port sheet))
61     (defgeneric degraft-medium (medium port sheet))
62    
63     ;; 8.4.1 Repaint Protocol Functions
64    
65     (defgeneric queue-repaint (sheet repaint-event))
66     (defgeneric handle-repaint (sheet region))
67     (defgeneric repaint-sheet (sheet region))
68    
69     ;; 9 Ports, Grafts, and Mirrored Sheets
70    
71     ;; (defgeneric portp (object))
72     ;; find-port function
73    
74     ;; 9.4.1 Mirror Functions
75    
76     (defgeneric sheet-direct-mirror (sheet))
77     (defgeneric sheet-mirrored-ancestor (sheet))
78     (defgeneric sheet-mirror (sheet))
79     (defgeneric realize-mirror (port mirrored-sheet))
80     (defgeneric destroy-mirror (port mirrored-sheet))
81     (defgeneric raise-mirror (port sheet))
82     (defgeneric bury-mirror (port sheet))
83    
84     ;; 9.4.2 Internal Interfaces for Native Coordinates
85    
86     (defgeneric sheet-native-transformation (sheet))
87     (defgeneric sheet-native-region (sheet))
88     (defgeneric sheet-device-transformation (sheet))
89     (defgeneric sheet-device-region (sheet))
90     (defgeneric invalidate-cached-transformations (sheet))
91     (defgeneric invalidate-cached-regions (sheet))
92    
93     ;;; Graphics ops
94    
95     (defgeneric medium-draw-point* (medium x y))
96     (defgeneric medium-draw-points* (medium coord-seq))
97     (defgeneric medium-draw-line* (medium x1 y1 x2 y2))
98     (defgeneric medium-draw-lines* (medium coord-seq))
99     (defgeneric medium-draw-polygon* (medium coord-seq closed filled))
100     (defgeneric medium-draw-rectangle* (medium left top right bottom filled))
101     (defgeneric medium-draw-ellipse* (medium center-x center-y
102     radius-1-dx radius-1-dy radius-2-dx radius-2-dy
103     start-angle end-angle filled))
104 brian 1.4 (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 moore 1.28
110     ;;;; 10.2
111     (defgeneric invoke-with-drawing-options
112     (medium continuation &rest drawing-options &key &allow-other-keys))
113    
114    
115     ;;;; 14.5
116     (defgeneric draw-design
117     (medium design
118     &key ink clipping-region transformation line-style line-thickness
119     line-unit line-dashes line-joint-shape line-cap-shape text-style
120     text-family text-face text-size))
121    
122     ;;;; 21.2
123     (defgeneric invoke-updating-output
124     (stream continuation record-type unique-id id-test cache-value cache-test
125     &key all-new parent-cache))
126    
127     ;;;; 24.4
128     (defgeneric presentation-replace-input
129     (stream object type view
130     &key buffer-start rescan query-identifier for-context-type))
131    
132     ;;;; 28.3
133     (defgeneric frame-find-innermost-applicable-presentation
134     (frame input-context stream x y &key event))
135    
136     ;;;; 28.4
137     (defgeneric default-frame-top-level
138     (frame &key command-parser command-unparser partial-command-parser prompt))
139     (defgeneric read-frame-command (frame &key stream))
140     (defgeneric run-frame-top-level (frame &key &allow-other-keys))
141    
142     ;;;; 29.2
143     ;;;;
144     ;;;; FIXME: should we have &key &allow-other-keys here, to cause
145     ;;;; initarg checking? Probably.
146     (defgeneric make-pane-1 (realizer frame abstract-class-name &rest initargs))
147 gilbert 1.2
148 gilbert 1.5 ;;;; 29.2.2 Pane Properties
149    
150     (defgeneric pane-frame (pane))
151     (defgeneric pane-name (pane))
152     (defgeneric pane-foreground (pane))
153     (defgeneric pane-background (pane))
154     (defgeneric pane-text-style (pane))
155    
156     ;;;; 29.3.3 Scroller Pane Classes
157    
158     (defgeneric pane-viewport (pane))
159     (defgeneric pane-viewport-region (pane))
160     (defgeneric pane-scroller (pane))
161     (defgeneric scroll-extent (pane x y))
162    
163 gilbert 1.6 ;;;; 29.3.4 The Layout Protocol
164    
165     ;; (define-protocol-class space-requirement ())
166    
167     ;; make-space-requirement &key (width 0) (max-width 0) (min-width 0) (height 0) (max-height 0) (min-height 0) [Function]
168    
169     (defgeneric space-requirement-width (space-req))
170     (defgeneric space-requirement-min-width (space-req))
171     (defgeneric space-requirement-max-width (space-req))
172     (defgeneric space-requirement-height (space-req))
173     (defgeneric space-requirement-min-height (space-req))
174     (defgeneric space-requirement-max-height (space-req))
175     (defgeneric space-requirement-components (space-req))
176    
177     ;; space-requirement-combine function sr1 sr2 [Function]
178     ;; space-requirement+ sr1 sr2 [Function]
179     ;; space-requirement+* space-req &key width min-width max-width height min-height max-height [Function]
180    
181 adejneka 1.9 (defgeneric compose-space (pane &key width height))
182 gilbert 1.6 (defgeneric allocate-space (pane width height))
183 adejneka 1.11 (defgeneric change-space-requirements
184 hefner1 1.27 (pane &rest space-req-keys &key resize-frame width height
185     min-width min-height max-width max-height))
186 gilbert 1.6 (defgeneric note-space-requirements-changed (sheet pane))
187     ;; changing-space-requirements (&key resize-frame layout) &body body [Macro]
188    
189     ;;;; 29.4.4 CLIM Stream Pane Functions
190    
191     (defgeneric window-clear (window))
192     (defgeneric window-refresh (window))
193     (defgeneric window-viewport (window))
194     (defgeneric window-erase-viewport (window))
195     (defgeneric window-viewport-position (window))
196     ;; (defgeneric (setf* window-viewport-position) (x y window))
197    
198 gilbert 1.8 ;;;;
199 gilbert 1.23 (defgeneric gadget-value (gadget))
200     (defgeneric (setf gadget-value) (new-value gadget &key invoke-callback))
201     (defgeneric gadget-min-value (gadget))
202     (defgeneric gadget-max-value (gadget))
203 gilbert 1.8 (defgeneric (setf gadget-max-value) (new-value gadget))
204     (defgeneric (setf gadget-min-value) (new-value gadget))
205     (defgeneric (setf scroll-bar-thumb-size) (new-value scroll-bar))
206     (defgeneric gadget-orientation (gadget))
207     (defgeneric gadget-client (gadget))
208    
209 gilbert 1.2 ;;;
210    
211     (defgeneric medium-foreground (medium))
212     (defgeneric medium-background (medium))
213     (defgeneric medium-ink (medium))
214     (defgeneric medium-transformation (medium))
215     (defgeneric medium-clipping-region (medium))
216     (defgeneric medium-line-style (medium))
217     (defgeneric medium-text-style (medium))
218     (defgeneric medium-default-text-style (medium))
219 adejneka 1.14 (defgeneric text-size (medium string &key text-style start end)
220     (:documentation
221     "Computes the \"cursor motion\" in device units that would take
222     place if STRING were output to MEDIUM starting at position (0,0).
223    
224     Returns total width, total height, final x cursor position, final y
225     cursor position, baseline."))
226 gilbert 1.2
227 adejneka 1.16 (defgeneric text-style-mapping (port text-style &optional character-set))
228    
229 gilbert 1.2 (defgeneric (setf medium-foreground) (new-value medium))
230     (defgeneric (setf medium-background) (new-value medium))
231     (defgeneric (setf medium-ink) (new-value medium))
232     (defgeneric (setf medium-transformation) (new-value medium))
233     (defgeneric (setf medium-clipping-region) (new-value medium))
234     (defgeneric (setf medium-line-style) (new-value medium))
235     (defgeneric (setf medium-text-style) (new-value medium))
236     (defgeneric (setf medium-default-text-style) (new-value medium))
237    
238 adejneka 1.16 (defgeneric (setf text-style-mapping)
239     (mapping port text-style &optional character-set))
240 adejneka 1.19 (defgeneric medium-miter-limit (medium)
241     (:documentation
242     "If LINE-STYLE-JOINT-SHAPE is :MITER and the angle between two
243     consequent lines is less than the values return by
244     MEDIUM-MITER-LIMIT, :BEVEL is used instead."))
245 adejneka 1.15 (defgeneric line-style-effective-thickness (line-style medium)
246     (:documentation
247     "Returns the thickness in device units of a line,
248     rendered on MEDIUM with the style LINE-STYLE."))
249    
250 gilbert 1.5 ;;;
251    
252     (defgeneric sheet-grafted-p (sheet))
253     (defgeneric graft-width (graft &key units))
254     (defgeneric graft-height (graft &key units))
255     (defgeneric graft-units (graft))
256    
257     (defgeneric text-style-character-width (text-style medium char))
258 adejneka 1.13 ;; fall back, where to put this?
259     (defmethod text-style-character-width (text-style medium char)
260     (text-size medium char :text-style text-style))
261 gilbert 1.5
262 gilbert 1.23 ;; Since the declaim form for functions looks clumsy and is
263     ;; syntax-wise different from defun, we define us a new declfun, which
264     ;; fixes this.
265    
266     (defmacro declfun (name lambda-list)
267     `(declaim (ftype (function
268     ,(let ((q lambda-list)
269     res)
270     (do () ((or (null q)
271     (member (car q) '(&optional &rest &key))))
272     (push 't res)
273     (pop q))
274     (when (eq (car q) '&optional)
275     (push '&optional res)
276     (pop q)
277     (do () ((or (null q)
278     (member (car q) '(&rest &key))))
279     (push 't res)))
280     (when (eq (car q) '&rest)
281     (push '&rest res)
282     (pop q)
283     (push 't res)
284     (pop q))
285     (when (eq (car q) '&key)
286     (push '&key res)
287     (pop q)
288     (do () ((or (null q)
289     (member (car q) '(&allow-other-keys))))
290     (push (list (intern (string (if (consp (car q))
291     (if (consp (caar q))
292     (caaar q)
293     (caar q))
294     (car q)))
295     :keyword)
296     't)
297     res)
298     (pop q)))
299     (when (eq (car q) '&allow-other-keys)
300     (push '&allow-other-keys res)
301     (pop q))
302     (reverse res))
303     t)
304     ,name)))
305    
306     (declfun draw-rectangle (sheet point1 point2
307     &rest args
308     &key (filled t)
309     ink clipping-region transformation line-style line-thickness
310     line-unit line-dashes line-joint-shape))
311    
312     (declfun draw-rectangle* (sheet x1 y1 x2 y2
313     &rest args
314     &key (filled t)
315     ink clipping-region transformation line-style line-thickness
316     line-unit line-dashes line-joint-shape))
317 gilbert 1.5
318     ;;; "exported" from a port
319    
320     (defgeneric mirror-transformation (port mirror))
321     (defgeneric port-set-sheet-region (port sheet region))
322     (defgeneric port-set-sheet-transformation (port sheet region))
323 adejneka 1.17 (defgeneric port-text-style-mappings (port))
324 gilbert 1.5 (defgeneric port-lookup-mirror (port sheet))
325     (defgeneric port-register-mirror (port sheet mirror))
326     (defgeneric port-allocate-pixmap (port sheet width height))
327     (defgeneric port-deallocate-pixmap (port pixmap))
328     (defgeneric port-mirror-width (port sheet))
329     (defgeneric port-mirror-height (port sheet))
330 gilbert 1.7 (defgeneric port-enable-sheet (port sheet))
331     (defgeneric port-disable-sheet (port sheet))
332 moore 1.22 (defgeneric port-pointer (port))
333 gilbert 1.2
334 gilbert 1.1 ;;;
335    
336 gilbert 1.8 ;; Used in stream-input.lisp, defined in frames.lisp
337     (defgeneric frame-event-queue (frame))
338 gilbert 1.1
339 moore 1.10 ;;; Used in presentations.lisp, defined in commands.lisp
340    
341     (defgeneric presentation-translators (command-table))
342 gilbert 1.1
343 adejneka 1.21 (defgeneric stream-default-view (stream))
344 adejneka 1.20
345 gilbert 1.26 ;;; ----------------------------------------------------------------------
346    
347     (defgeneric output-record-basline (record)
348     (:documentation
349     "Returns two values: the baseline of an output record and a boolean
350     indicating if this baseline is definitive. McCLIM addition."))
351    
352 gilbert 1.5 #||
353    
354     Further undeclared functions
355    
356     FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
357     ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
358     HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
359     PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
360     SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
361    
362     (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
363     SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
364     FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
365     MEDIUM WITH-GRAPHICS-STATE
366     PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH TEXT-STYLE-CHARACTER-WIDTH
367     FIND-INNERMOST-APPLICABLE-PRESENTATION HIGHLIGHT-PRESENTATION-1
368     PRESENTATION-OBJECT PRESENTATION-TYPE THROW-HIGHLIGHTED-PRESENTATION
369     FORMAT-CHILDREN TABLE-PANE-NUMBER TEXT-STYLE-CHARACTER-WIDTH
370     PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH SCROLL-EXTENT TEXT-STYLE-CHARACTER-WIDTH
371     FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
372     ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
373     HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
374     PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
375     SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
376     (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
377     SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
378     FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
379 gilbert 1.1
380 gilbert 1.23 ||#

  ViewVC Help
Powered by ViewVC 1.1.5