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

Contents of /mcclim/decls.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.30 - (hide annotations)
Thu Dec 30 10:09:40 2004 UTC (9 years, 3 months ago) by rstrandh
Branch: MAIN
Changes since 1.29: +1 -1 lines
added `fixed-position' to the declaration of the generic
function `invoke-updating-output'.
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 rstrandh 1.30 &key fixed-position all-new parent-cache))
126 moore 1.28
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 moore 1.29 (defgeneric command-enabled (command-name frame))
142     (defgeneric (setf command-name) (enabled command-name frame))
143    
144     ;;;; 28.5
145     (defgeneric note-command-enabled (frame-manager frame command-name))
146     (defgeneric note-command-disabled (frame-manager frame command-name))
147 moore 1.28
148     ;;;; 29.2
149     ;;;;
150     ;;;; FIXME: should we have &key &allow-other-keys here, to cause
151     ;;;; initarg checking? Probably.
152     (defgeneric make-pane-1 (realizer frame abstract-class-name &rest initargs))
153 gilbert 1.2
154 gilbert 1.5 ;;;; 29.2.2 Pane Properties
155    
156     (defgeneric pane-frame (pane))
157     (defgeneric pane-name (pane))
158     (defgeneric pane-foreground (pane))
159     (defgeneric pane-background (pane))
160     (defgeneric pane-text-style (pane))
161    
162     ;;;; 29.3.3 Scroller Pane Classes
163    
164     (defgeneric pane-viewport (pane))
165     (defgeneric pane-viewport-region (pane))
166     (defgeneric pane-scroller (pane))
167     (defgeneric scroll-extent (pane x y))
168    
169 gilbert 1.6 ;;;; 29.3.4 The Layout Protocol
170    
171     ;; (define-protocol-class space-requirement ())
172    
173     ;; make-space-requirement &key (width 0) (max-width 0) (min-width 0) (height 0) (max-height 0) (min-height 0) [Function]
174    
175     (defgeneric space-requirement-width (space-req))
176     (defgeneric space-requirement-min-width (space-req))
177     (defgeneric space-requirement-max-width (space-req))
178     (defgeneric space-requirement-height (space-req))
179     (defgeneric space-requirement-min-height (space-req))
180     (defgeneric space-requirement-max-height (space-req))
181     (defgeneric space-requirement-components (space-req))
182    
183     ;; space-requirement-combine function sr1 sr2 [Function]
184     ;; space-requirement+ sr1 sr2 [Function]
185     ;; space-requirement+* space-req &key width min-width max-width height min-height max-height [Function]
186    
187 adejneka 1.9 (defgeneric compose-space (pane &key width height))
188 gilbert 1.6 (defgeneric allocate-space (pane width height))
189 adejneka 1.11 (defgeneric change-space-requirements
190 hefner1 1.27 (pane &rest space-req-keys &key resize-frame width height
191     min-width min-height max-width max-height))
192 gilbert 1.6 (defgeneric note-space-requirements-changed (sheet pane))
193     ;; changing-space-requirements (&key resize-frame layout) &body body [Macro]
194    
195     ;;;; 29.4.4 CLIM Stream Pane Functions
196    
197     (defgeneric window-clear (window))
198     (defgeneric window-refresh (window))
199     (defgeneric window-viewport (window))
200     (defgeneric window-erase-viewport (window))
201     (defgeneric window-viewport-position (window))
202     ;; (defgeneric (setf* window-viewport-position) (x y window))
203    
204 gilbert 1.8 ;;;;
205 gilbert 1.23 (defgeneric gadget-value (gadget))
206     (defgeneric (setf gadget-value) (new-value gadget &key invoke-callback))
207     (defgeneric gadget-min-value (gadget))
208     (defgeneric gadget-max-value (gadget))
209 gilbert 1.8 (defgeneric (setf gadget-max-value) (new-value gadget))
210     (defgeneric (setf gadget-min-value) (new-value gadget))
211     (defgeneric (setf scroll-bar-thumb-size) (new-value scroll-bar))
212     (defgeneric gadget-orientation (gadget))
213     (defgeneric gadget-client (gadget))
214    
215 gilbert 1.2 ;;;
216    
217     (defgeneric medium-foreground (medium))
218     (defgeneric medium-background (medium))
219     (defgeneric medium-ink (medium))
220     (defgeneric medium-transformation (medium))
221     (defgeneric medium-clipping-region (medium))
222     (defgeneric medium-line-style (medium))
223     (defgeneric medium-text-style (medium))
224     (defgeneric medium-default-text-style (medium))
225 adejneka 1.14 (defgeneric text-size (medium string &key text-style start end)
226     (:documentation
227     "Computes the \"cursor motion\" in device units that would take
228     place if STRING were output to MEDIUM starting at position (0,0).
229    
230     Returns total width, total height, final x cursor position, final y
231     cursor position, baseline."))
232 gilbert 1.2
233 adejneka 1.16 (defgeneric text-style-mapping (port text-style &optional character-set))
234    
235 gilbert 1.2 (defgeneric (setf medium-foreground) (new-value medium))
236     (defgeneric (setf medium-background) (new-value medium))
237     (defgeneric (setf medium-ink) (new-value medium))
238     (defgeneric (setf medium-transformation) (new-value medium))
239     (defgeneric (setf medium-clipping-region) (new-value medium))
240     (defgeneric (setf medium-line-style) (new-value medium))
241     (defgeneric (setf medium-text-style) (new-value medium))
242     (defgeneric (setf medium-default-text-style) (new-value medium))
243    
244 adejneka 1.16 (defgeneric (setf text-style-mapping)
245     (mapping port text-style &optional character-set))
246 adejneka 1.19 (defgeneric medium-miter-limit (medium)
247     (:documentation
248     "If LINE-STYLE-JOINT-SHAPE is :MITER and the angle between two
249     consequent lines is less than the values return by
250     MEDIUM-MITER-LIMIT, :BEVEL is used instead."))
251 adejneka 1.15 (defgeneric line-style-effective-thickness (line-style medium)
252     (:documentation
253     "Returns the thickness in device units of a line,
254     rendered on MEDIUM with the style LINE-STYLE."))
255    
256 gilbert 1.5 ;;;
257    
258     (defgeneric sheet-grafted-p (sheet))
259     (defgeneric graft-width (graft &key units))
260     (defgeneric graft-height (graft &key units))
261     (defgeneric graft-units (graft))
262    
263     (defgeneric text-style-character-width (text-style medium char))
264 adejneka 1.13 ;; fall back, where to put this?
265     (defmethod text-style-character-width (text-style medium char)
266     (text-size medium char :text-style text-style))
267 gilbert 1.5
268 gilbert 1.23 ;; Since the declaim form for functions looks clumsy and is
269     ;; syntax-wise different from defun, we define us a new declfun, which
270     ;; fixes this.
271    
272     (defmacro declfun (name lambda-list)
273     `(declaim (ftype (function
274     ,(let ((q lambda-list)
275     res)
276     (do () ((or (null q)
277     (member (car q) '(&optional &rest &key))))
278     (push 't res)
279     (pop q))
280     (when (eq (car q) '&optional)
281     (push '&optional res)
282     (pop q)
283     (do () ((or (null q)
284     (member (car q) '(&rest &key))))
285     (push 't res)))
286     (when (eq (car q) '&rest)
287     (push '&rest res)
288     (pop q)
289     (push 't res)
290     (pop q))
291     (when (eq (car q) '&key)
292     (push '&key res)
293     (pop q)
294     (do () ((or (null q)
295     (member (car q) '(&allow-other-keys))))
296     (push (list (intern (string (if (consp (car q))
297     (if (consp (caar q))
298     (caaar q)
299     (caar q))
300     (car q)))
301     :keyword)
302     't)
303     res)
304     (pop q)))
305     (when (eq (car q) '&allow-other-keys)
306     (push '&allow-other-keys res)
307     (pop q))
308     (reverse res))
309     t)
310     ,name)))
311    
312     (declfun draw-rectangle (sheet point1 point2
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    
318     (declfun draw-rectangle* (sheet x1 y1 x2 y2
319     &rest args
320     &key (filled t)
321     ink clipping-region transformation line-style line-thickness
322     line-unit line-dashes line-joint-shape))
323 gilbert 1.5
324     ;;; "exported" from a port
325    
326     (defgeneric mirror-transformation (port mirror))
327     (defgeneric port-set-sheet-region (port sheet region))
328     (defgeneric port-set-sheet-transformation (port sheet region))
329 adejneka 1.17 (defgeneric port-text-style-mappings (port))
330 gilbert 1.5 (defgeneric port-lookup-mirror (port sheet))
331     (defgeneric port-register-mirror (port sheet mirror))
332     (defgeneric port-allocate-pixmap (port sheet width height))
333     (defgeneric port-deallocate-pixmap (port pixmap))
334     (defgeneric port-mirror-width (port sheet))
335     (defgeneric port-mirror-height (port sheet))
336 gilbert 1.7 (defgeneric port-enable-sheet (port sheet))
337     (defgeneric port-disable-sheet (port sheet))
338 moore 1.22 (defgeneric port-pointer (port))
339 gilbert 1.2
340 gilbert 1.1 ;;;
341    
342 gilbert 1.8 ;; Used in stream-input.lisp, defined in frames.lisp
343     (defgeneric frame-event-queue (frame))
344 gilbert 1.1
345 moore 1.10 ;;; Used in presentations.lisp, defined in commands.lisp
346    
347     (defgeneric presentation-translators (command-table))
348 gilbert 1.1
349 adejneka 1.21 (defgeneric stream-default-view (stream))
350 adejneka 1.20
351 gilbert 1.26 ;;; ----------------------------------------------------------------------
352    
353     (defgeneric output-record-basline (record)
354     (:documentation
355     "Returns two values: the baseline of an output record and a boolean
356     indicating if this baseline is definitive. McCLIM addition."))
357    
358 gilbert 1.5 #||
359    
360     Further undeclared functions
361    
362     FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
363     ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
364     HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
365     PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
366     SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
367    
368     (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
369     SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
370     FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
371     MEDIUM WITH-GRAPHICS-STATE
372     PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH TEXT-STYLE-CHARACTER-WIDTH
373     FIND-INNERMOST-APPLICABLE-PRESENTATION HIGHLIGHT-PRESENTATION-1
374     PRESENTATION-OBJECT PRESENTATION-TYPE THROW-HIGHLIGHTED-PRESENTATION
375     FORMAT-CHILDREN TABLE-PANE-NUMBER TEXT-STYLE-CHARACTER-WIDTH
376     PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH SCROLL-EXTENT TEXT-STYLE-CHARACTER-WIDTH
377     FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
378     ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
379     HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
380     PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
381     SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
382     (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
383     SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
384     FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
385 gilbert 1.1
386 gilbert 1.23 ||#

  ViewVC Help
Powered by ViewVC 1.1.5