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

Contents of /mcclim/decls.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.48 - (hide annotations)
Sat Jan 19 09:38:20 2008 UTC (6 years, 3 months ago) by thenriksen
Branch: MAIN
Changes since 1.47: +81 -14 lines
Added docstrings for input-editor related stuff.
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 moore 1.28 ;;; This is just an ad hoc list. Would it be a good idea to include all
28     ;;; (exported) generic functions here? --GB
29     ;;;
30     ;;; YES! -- CSR
31 tmoore 1.32 ;;; We'll get right on it :) -- moore
32     ;;; Whose numbers are we using here?
33    
34 gbaumann 1.33 ;;; The numbers are section numbers from the spec. --GB
35    
36     ;; Since the declaim form for functions looks clumsy and is
37     ;; syntax-wise different from defun, we define us a new declfun, which
38     ;; fixes this.
39    
40     (defmacro declfun (name lambda-list)
41     `(declaim (ftype (function
42     ,(let ((q lambda-list)
43     res)
44     (do () ((or (null q)
45     (member (car q) '(&optional &rest &key))))
46     (push 't res)
47     (pop q))
48     (when (eq (car q) '&optional)
49     (push '&optional res)
50     (pop q)
51     (do () ((or (null q)
52     (member (car q) '(&rest &key))))
53     (pop q)
54     (push 't res)))
55     (when (eq (car q) '&rest)
56     (push '&rest res)
57     (pop q)
58     (push 't res)
59     (pop q))
60     (when (eq (car q) '&key)
61     (push '&key res)
62     (pop q)
63     (do () ((or (null q)
64     (member (car q) '(&allow-other-keys))))
65     (push (list (intern (string (if (consp (car q))
66     (if (consp (caar q))
67     (caaar q)
68     (caar q))
69     (car q)))
70     :keyword)
71     't)
72     res)
73     (pop q)))
74     (when (eq (car q) '&allow-other-keys)
75     (push '&allow-other-keys res)
76     (pop q))
77     (reverse res))
78     t)
79     ,name)))
80    
81     ;;;; Early special variables
82    
83     (defvar *application-frame* nil)
84    
85 crhodes 1.39 ;;; 3.2.1.1 The Point Protocol
86    
87 gilbert 1.1 (defgeneric point-x (point))
88     (defgeneric point-y (point))
89 tmoore 1.32
90 crhodes 1.39 ;;; 3.2.2.1 The Polygon and Polyline Protocol
91    
92     (defgeneric polygon-points (polygon-or-polyline))
93     (defgeneric map-over-polygon-coordinates (function polygon-or-polyline))
94     (defgeneric map-over-polygon-segments (function polygon-or-polyline))
95     (defgeneric polyline-closed (polyline))
96    
97     ;;; 3.2.3.1 The Line Protocol
98    
99     (defgeneric line-start-point* (line))
100     (defgeneric line-end-point* (line))
101     (defgeneric line-start-point (line))
102     (defgeneric line-end-point (line))
103    
104 tmoore 1.32 ;;; 3.2.4.1
105    
106     (defgeneric rectangle-edges* (rectangle))
107     (defgeneric rectangle-min-point (rectangle))
108     (defgeneric rectangle-max-point (rectangle))
109     (defgeneric rectangle-min-x (rectangle))
110     (defgeneric rectangle-min-y (rectangle))
111     (defgeneric rectangle-max-x (rectangle))
112     (defgeneric rectangle-max-y (rectangle))
113     (defgeneric rectangle-width (rectangle))
114     (defgeneric rectangle-height (rectangle))
115     (defgeneric rectangle-size (rectangle))
116    
117 crhodes 1.39 ;;; 3.2.5.1 The Ellipse and Elliptical Arc Protocol
118    
119     (defgeneric ellipse-center-point* (elliptical-object))
120     (defgeneric ellipse-center-point (elliptical-object))
121     (defgeneric ellipse-radii (elliptical-object))
122     (defgeneric ellipse-start-angle (elliptical-object))
123     (defgeneric ellipse-end-angle (elliptical-object))
124    
125     ;;; 4.1.1 The Bounding Rectangle Protocol
126    
127     (defgeneric bounding-rectangle* (region))
128     (defgeneric bounding-rectangle (region))
129    
130     ;;; 4.1.2 Bounding Rectangle Convenience Functions
131    
132     (defgeneric bounding-rectangle-position (region))
133     (defgeneric bounding-rectangle-min-x (region))
134     (defgeneric bounding-rectangle-min-y (region))
135     (defgeneric bounding-rectangle-max-x (region))
136     (defgeneric bounding-rectangle-max-y (region))
137     (defgeneric bounding-rectangle-width (region))
138     (defgeneric bounding-rectangle-height (region))
139     (defgeneric bounding-rectangle-size (region))
140    
141     ;;; 5.3.1 Transformation Predicates
142    
143     (defgeneric transformation-equal (transformation1 transformation2))
144     (defgeneric identity-transformation-p (transformation))
145     (defgeneric invertible-transformation-p (transformation))
146     (defgeneric translation-transformation-p (transformation))
147     (defgeneric reflection-transformation-p (transformation))
148     (defgeneric rigid-transformation-p (transformation))
149     (defgeneric even-scaling-transformation-p (transformation))
150     (defgeneric scaling-transformation-p (transformation))
151     (defgeneric rectilinear-transformation-p (transformation))
152    
153 gbaumann 1.33 ;;; 5.3.2 Composition of Transformations
154    
155     (defgeneric compose-transformations (transformation1 transformation2))
156     (defgeneric invert-transformation (transformation))
157     (declfun compose-translation-with-transformation (transformation dx dy))
158     (declfun compose-scaling-with-transformation (transformation sx sy &optional origin))
159     (declfun compose-rotation-with-transformation (transformation angle &optional origin))
160     (declfun compose-transformation-with-translation (transformation dx dy))
161     (declfun compose-transformation-with-scaling (transformation sx sy &optional origin))
162     (declfun compose-transformation-with-rotation (transformation angle &optional origin))
163    
164     ;;; 5.3.3 Applying Transformations
165    
166     (defgeneric transform-region (transformation region))
167     (defgeneric untransform-region (transformation region))
168     (defgeneric transform-position (transformation x y))
169     (defgeneric untransform-position (transformation x y))
170     (defgeneric transform-distance (transformation dx dy))
171     (defgeneric untransform-distance (transformation dx dy))
172     (defgeneric transform-rectangle* (transformation x1 y1 x2 y2))
173     (defgeneric untransform-rectangle* (transformation x1 y1 x2 y2))
174    
175 crhodes 1.39 ;;; 7.2.1 Sheet Relationship Functions
176    
177     (defgeneric sheet-parent (sheet))
178     (defgeneric sheet-children (sheet))
179     (defgeneric sheet-adopt-child (sheet child))
180     (defgeneric sheet-disown-child (sheet child &key errorp))
181     (defgeneric sheet-siblings (sheet))
182     (defgeneric sheet-enabled-children (sheet))
183     (defgeneric sheet-ancestor-p (sheet putative-ancestor))
184     (defgeneric raise-sheet (sheet))
185     (defgeneric bury-sheet (sheet))
186     (defgeneric reorder-sheets (sheet new-ordering))
187     (defgeneric sheet-enabled-p (sheet))
188     (defgeneric (setf sheet-enabled-p) (enabled-p sheet))
189     (defgeneric sheet-viewable-p (sheet))
190     (defgeneric sheet-occluding-sheets (sheet child))
191     (defgeneric map-over-sheets (function sheet))
192    
193 gbaumann 1.33 ;;; 7.3.1 Sheet Geometry Functions [complete]
194    
195     (defgeneric sheet-transformation (sheet))
196     (defgeneric (setf sheet-transformation) (transformation sheet))
197     (defgeneric sheet-region (sheet))
198     (defgeneric (setf sheet-region) (region sheet))
199     (defgeneric move-sheet (sheet x y))
200     (defgeneric resize-sheet (sheet width height))
201     (defgeneric move-and-resize-sheet (sheet x y width height))
202     (defgeneric map-sheet-position-to-parent (sheet x y))
203     (defgeneric map-sheet-position-to-child (sheet x y))
204     (defgeneric map-sheet-rectangle*-to-parent (sheet x1 y1 x2 y2))
205     (defgeneric map-sheet-rectangle*-to-child (sheet x1 y1 x2 y2))
206     (defgeneric map-over-sheets-containing-position (function sheet x y))
207     (defgeneric map-over-sheets-overlapping-region (function sheet region))
208     (defgeneric child-containing-position (sheet x y))
209     (defgeneric children-overlapping-region (sheet region))
210     (defgeneric children-overlapping-rectangle* (sheet x1 y1 x2 y2))
211     (defgeneric sheet-delta-transformation (sheet ancestor))
212     (defgeneric sheet-allocated-region (sheet child))
213    
214     ;;; 7.3.2
215    
216     ;; sheet-identity-transformation-mixin [class]
217     ;; sheet-translation-mixin [class]
218     ;; sheet-y-inverting-transformation-mixin [class]
219     ;; sheet-transformation-mixin [class]
220    
221 moore 1.28 ;;;; 8.1
222     (defgeneric process-next-event (port &key wait-function timeout))
223    
224 crhodes 1.46 (defgeneric port-keyboard-input-focus (port))
225     (defgeneric (setf port-keyboard-input-focus) (focus port))
226    
227 tmoore 1.36 ;;; 8.2 Standard Device Events
228    
229     (defgeneric event-timestamp (event))
230 crhodes 1.39 (defgeneric event-type (event))
231     (defgeneric event-sheet (device-event))
232     (defgeneric event-modifier-state (device-event))
233     (defgeneric keyboard-event-key-name (keyboard-event))
234     (defgeneric keyboard-event-character (keyboard-event))
235     (defgeneric pointer-event-x (pointer-event))
236     (defgeneric pointer-event-y (pointer-event))
237     (defgeneric pointer-event-native-x (pointer-event))
238     (defgeneric pointer-event-native-y (pointer-event))
239     (defgeneric pointer-event-pointer (pointer-event))
240     (defgeneric pointer-event-button (pointer-button-event))
241     (defgeneric pointer-boundary-event-kind (pointer-boundary-event))
242     (defgeneric window-event-region (window-event))
243     (defgeneric window-event-native-region (window-event))
244     (defgeneric window-event-mirrored-sheet (window-event))
245    
246     ;;; 8.3.1 Output Properties
247    
248     (defgeneric medium-foreground (medium))
249     (defgeneric (setf medium-foreground) (design medium))
250     (defgeneric medium-background (medium))
251     (defgeneric (setf medium-background) (design medium))
252     (defgeneric medium-ink (medium))
253     (defgeneric (setf medium-ink) (design medium))
254     (defgeneric medium-transformation (medium))
255     (defgeneric (setf medium-transformation) (transformation medium))
256     (defgeneric medium-clipping-region (medium))
257     (defgeneric (setf medium-clipping-region) (region medium))
258     (defgeneric medium-line-style (medium))
259     (defgeneric (setf medium-line-style) (line-style medium))
260     (defgeneric medium-text-style (medium))
261     (defgeneric (setf medium-text-style) (text-style medium))
262     (defgeneric medium-default-text-style (medium))
263     (defgeneric (setf medium-default-text-style) (text-style medium))
264     (defgeneric medium-merged-text-style (medium))
265    
266 tmoore 1.36
267 gilbert 1.5 ;;;; 8.3.4 Associating a Medium with a Sheet
268    
269     ;; with-sheet-medium (medium sheet) &body body [Macro]
270     ;; with-sheet-medium-bound (sheet medium) &body body [Macro]
271    
272 adejneka 1.11 (defgeneric sheet-medium (sheet))
273     (defgeneric medium-sheet (medium))
274     (defgeneric medium-drawable (medium))
275 gilbert 1.5
276 gbaumann 1.33 ;;; 8.3.4.1 Grafting and Degrafting of Mediums
277 gilbert 1.2
278     (defgeneric allocate-medium (port sheet))
279     (defgeneric deallocate-medium (port medium))
280     (defgeneric make-medium (port sheet))
281     (defgeneric engraft-medium (medium port sheet))
282     (defgeneric degraft-medium (medium port sheet))
283    
284 gbaumann 1.33 ;;; 8.4.1 Repaint Protocol Functions
285 gilbert 1.2
286     (defgeneric queue-repaint (sheet repaint-event))
287     (defgeneric handle-repaint (sheet region))
288     (defgeneric repaint-sheet (sheet region))
289    
290 gbaumann 1.33 ;;;; 9 Ports, Grafts, and Mirrored Sheets
291 gilbert 1.2
292     ;; (defgeneric portp (object))
293     ;; find-port function
294    
295 crhodes 1.39 ;;; 9.2 Ports
296    
297     (defgeneric port (object))
298     (defgeneric port-server-path (port))
299     (defgeneric port-name (port))
300     (defgeneric port-type (port))
301     (defgeneric port-properties (port indicator))
302     (defgeneric (setf port-properties) (property port indicator))
303     (defgeneric restart-port (port))
304     (defgeneric destroy-port (port))
305    
306 gbaumann 1.33 ;;; 9.3 Grafts
307    
308     (defgeneric sheet-grafted-p (sheet))
309     (declfun find-graft (&key (server-path *default-server-path*)
310     (port (find-port :server-path server-path))
311     (orientation :default)
312     (units :device)))
313     (defgeneric graft (object))
314     (declfun map-over-grafts (function port))
315     ;; with-graft-locked (graft) &body body [macro]
316     (defgeneric graft-orientation (graft))
317     (defgeneric graft-units (graft))
318     (defgeneric graft-width (graft &key units))
319     (defgeneric graft-height (graft &key units))
320     (declfun graft-pixels-per-millimeter (graft))
321     (declfun graft-pixels-per-inch (graft))
322    
323 gilbert 1.2 ;; 9.4.1 Mirror Functions
324    
325     (defgeneric sheet-direct-mirror (sheet))
326     (defgeneric sheet-mirrored-ancestor (sheet))
327     (defgeneric sheet-mirror (sheet))
328     (defgeneric realize-mirror (port mirrored-sheet))
329     (defgeneric destroy-mirror (port mirrored-sheet))
330     (defgeneric raise-mirror (port sheet))
331     (defgeneric bury-mirror (port sheet))
332    
333     ;; 9.4.2 Internal Interfaces for Native Coordinates
334    
335     (defgeneric sheet-native-transformation (sheet))
336     (defgeneric sheet-native-region (sheet))
337     (defgeneric sheet-device-transformation (sheet))
338     (defgeneric sheet-device-region (sheet))
339     (defgeneric invalidate-cached-transformations (sheet))
340     (defgeneric invalidate-cached-regions (sheet))
341    
342     ;;; Graphics ops
343    
344     (defgeneric medium-draw-point* (medium x y))
345     (defgeneric medium-draw-points* (medium coord-seq))
346     (defgeneric medium-draw-line* (medium x1 y1 x2 y2))
347     (defgeneric medium-draw-lines* (medium coord-seq))
348     (defgeneric medium-draw-polygon* (medium coord-seq closed filled))
349     (defgeneric medium-draw-rectangle* (medium left top right bottom filled))
350     (defgeneric medium-draw-ellipse* (medium center-x center-y
351     radius-1-dx radius-1-dy radius-2-dx radius-2-dy
352     start-angle end-angle filled))
353 brian 1.4 (defgeneric medium-draw-circle* (medium center-x center-y radius start-angle end-angle filled))
354 gilbert 1.2 (defgeneric medium-draw-text* (medium string x y
355     start end
356     align-x align-y
357     toward-x toward-y transform-glyphs))
358 moore 1.28
359 crhodes 1.39 ;;; 10.1 Medium Components
360     ;;;
361     ;;; For reasons that are beyond me, many of the medium component
362     ;;; accessors are also specified in section 8.3.1.
363    
364     (defgeneric medium-current-text-style (medium))
365    
366 moore 1.28 ;;;; 10.2
367     (defgeneric invoke-with-drawing-options
368     (medium continuation &rest drawing-options &key &allow-other-keys))
369    
370 tmoore 1.31 ;;;; 10.2.1
371     (defgeneric invoke-with-identity-transformation (medium continuation))
372    
373     ;;;; 10.2.2
374     (defgeneric invoke-with-local-coordinates (medium continuation x y))
375    
376     (defgeneric invoke-with-first-quadrant-coordinates (medium continuation x y))
377 moore 1.28
378 crhodes 1.39 ;;; 11.1.1 Text Style Protocol and Text Style Suboptions
379    
380     (defgeneric text-style-components (text-style))
381     (defgeneric text-style-family (text-style))
382     (defgeneric text-style-face (text-style))
383     (defgeneric text-style-size (text-style))
384     (defgeneric merge-text-styles (style1 style2))
385     (defgeneric text-style-ascent (text-style medium))
386     (defgeneric text-style-descent (text-style medium))
387     (defgeneric text-style-height (text-style medium))
388     (defgeneric text-style-width (text-style medium))
389     (defgeneric text-style-fixed-width-p (text-style medium))
390     (defgeneric text-size (medium string &key text-style start end))
391    
392     ;;; 11.2 Text Style Binding Forms
393    
394     (defgeneric invoke-with-text-style (medium continuation text-style))
395    
396     ;;; 12.7.3 Other Medium-specific Output Functions
397    
398     (defgeneric medium-finish-output (medium))
399     (defgeneric medium-force-output (medium))
400     (defgeneric medium-clear-area (medium left top right bottom))
401     (defgeneric medium-beep (medium))
402    
403 moore 1.28 ;;;; 14.5
404     (defgeneric draw-design
405     (medium design
406     &key ink clipping-region transformation line-style line-thickness
407     line-unit line-dashes line-joint-shape line-cap-shape text-style
408     text-family text-face text-size))
409    
410 gbaumann 1.33 ;;; 15.3 The Text Cursor [complete]
411    
412     ;;; 15.3.1 Text Cursor Protocol [complete]
413    
414     ;; cursor [protocol class]
415     ;; cursorp object [protocol predicate]
416     ;; :sheet [Initarg for cursor]
417     ;; standard-text-cursor [class]
418     (defgeneric cursor-sheet (cursor))
419     (defgeneric cursor-position (cursor))
420     ;;(defgeneric (setf* cursor-position) (x y cursor))
421     (defgeneric cursor-active (cursor))
422     (defgeneric (setf cursor-active) (value cursor))
423     (defgeneric cursor-state (cursor))
424     (defgeneric (setf cursor-state) (value cursor))
425     (defgeneric cursor-focus (cursor))
426     (defgeneric cursor-visibility (cursor))
427     (defgeneric (setf cursor-visibility) (visibility cursor))
428    
429     ;;; 15.3.2 Stream Text Cursor Protocol [complete]
430    
431     (defgeneric stream-text-cursor (stream))
432     (defgeneric (setf stream-text-cursor) (cursor stream))
433     (defgeneric stream-cursor-position (stream))
434     ;; (defgeneric (setf* stream-cursor-position) (x y stream)) unsure how to declare this, can somebody help? --GB
435 thenriksen 1.43 (defgeneric stream-set-cusor-position (stream x y)) ; This is actually in 19.3.1 in CLIM 2.2
436 gbaumann 1.33 (defgeneric stream-increment-cursor-position (stream dx dy))
437    
438     ;;; 15.4 Text Protocol [complete]
439    
440     (defgeneric stream-character-width (stream character &key text-style))
441     (defgeneric stream-string-width (stream character &key start end text-style))
442     (defgeneric stream-text-margin (stream))
443     (defgeneric (setf stream-text-margin) (margin stream))
444     (defgeneric stream-line-height (stream &key text-style))
445     (defgeneric stream-vertical-spacing (stream))
446     (defgeneric stream-baseline (stream))
447    
448     ;;; 15.4.1 Mixing Text and Graphics [complete]
449    
450     ;; with-room-for-graphics (&optional stream &key (first-quadrant t) height (move-cursor t) record-type) &body body [Macro]
451    
452     ;;; 15.4.2 Wrapping of Text Lines [complete]
453    
454     (defgeneric stream-end-of-line-action (stream))
455     (defgeneric (setf stream-end-of-line-action) (action stream))
456     ;; with-end-of-line-action (stream action) &body body [Macro]
457     (defgeneric stream-end-of-page-action (stream))
458     (defgeneric (setf stream-end-of-page-action) (action stream))
459     ;; with-end-of-page-action (stream action) &body body [Macro]
460    
461 crhodes 1.39 ;;; 15.5 Attracting the User's Attention
462    
463     (defgeneric beep (&optional medium))
464    
465     ;;; 15.6 Buffering of Output
466    
467     (defgeneric medium-buffering-output-p (medium))
468     (defgeneric (setf medium-buffering-output-p) (buffer-p medium))
469    
470     ;;; 16.3.3 Text Displayed Output Record
471    
472     (defgeneric add-character-output-to-text-record
473     (text-record character text-style width height baseline))
474 gbaumann 1.33
475 crhodes 1.39 (defgeneric add-string-output-to-text-record
476     (text-record string start end text-style width height baseline))
477    
478     (defgeneric text-displayed-output-record-string (text-record))
479    
480     ;;; 16.4.1. The Output Recording Stream Protocol
481    
482     (defgeneric stream-recording-p (stream))
483     (defgeneric (setf stream-recording-p) (recording-p stream))
484     (defgeneric stream-drawing-p (stream))
485     (defgeneric (setf stream-drawing-p) (drawing-p stream))
486     (defgeneric stream-output-history (stream))
487     (defgeneric stream-current-output-record (stream))
488     (defgeneric (setf stream-current-output-record) (record stream))
489     (defgeneric stream-add-output-record (stream record))
490     (defgeneric stream-replay (stream &optional region))
491     (defgeneric erase-output-record (record stream &optional errorp))
492    
493     ;;; 16.4.3. Text Output Recording
494 gbaumann 1.33 (defgeneric stream-text-output-record (stream text-style))
495     (defgeneric stream-close-text-output-record (stream))
496 crhodes 1.39 (defgeneric stream-add-character-output
497     (stream character text-style width height baseline))
498     (defgeneric stream-add-string-output
499     (stream string start end text-style width height baseline))
500 gbaumann 1.33
501     ;;; 16.4.4 Output Recording Utilities [complete]
502    
503     ;; with-output-recording-options (stream &key record draw) &body body [Macro]
504 crhodes 1.39 (defgeneric invoke-with-output-recording-options
505     (stream continuation record draw))
506    
507     ;;; with-new-output-record (stream &optional record-type record &rest initargs) &body body [Macro]
508    
509     ;;; The 'constructor' arg is absent from the CLIM 2.0 spec but is documented
510     ;;; in the Allegro CLIM 2 User Guide and appears to exist in other 'classic'
511     ;;; CLIM implementations. I'm assuming it's an omission from the spec.
512     (defgeneric invoke-with-new-output-record
513     (stream continuation record-type constructor &key &allow-other-keys))
514    
515     ;;; with-output-to-output-record (stream &optional record-type record &rest initargs)) &body body [Macro]
516     (defgeneric invoke-with-output-to-output-record
517     (stream continuation record-type constructor
518     &rest initargs &key &allow-other-keys))
519    
520 gbaumann 1.33 (defgeneric make-design-from-output-record (record))
521    
522 moore 1.28 ;;;; 21.2
523     (defgeneric invoke-updating-output
524     (stream continuation record-type unique-id id-test cache-value cache-test
525 rstrandh 1.30 &key fixed-position all-new parent-cache))
526 moore 1.28
527 crhodes 1.39 ;;; 22.2.1 The Extended Stream Input Protocol
528    
529     (defgeneric stream-input-buffer (stream))
530     (defgeneric (setf stream-input-buffer) (buffer stream))
531     ;; (defgeneric (setf* stream-pointer-position))
532     (defgeneric stream-set-input-focus (stream))
533     (defgeneric stream-read-gesture
534     (stream &key timeout peek-p input-wait-test
535     input-wait-handler pointer-button-press-handler))
536     (defgeneric stream-input-wait (stream &key timeout input-wait-test))
537     (defgeneric stream-unread-gesture (stream gesture))
538    
539     ;;; 22.2.2 Extended Input Stream Conditions
540    
541     (defgeneric abort-gesture-event (condition))
542     (defgeneric accelerator-gesture-event (condition))
543     (defgeneric accelerator-gesture-numeric-argument (condition))
544    
545     ;;; 23.5 Context-dependent (Typed) Input
546    
547     (defgeneric stream-accept
548     (stream
549     type &key view default default-type provide-default insert-default
550     replace-input history active-p prompt prompt-mode display-default
551     query-identifier activation-gestures additional-activation-gestures
552     delimiter-gestures additional-delimiter-gestures))
553     (defgeneric prompt-for-accept (stream type view &rest accept-args &key))
554    
555     ;;; 24.1 The Input Editor
556    
557 thenriksen 1.48 (defgeneric input-editor-format (stream format-string &rest args)
558     (:documentation "This function is like `format', except that it
559     is intended to be called on input editing streams. It arranges to
560     insert \"noise strings\" in the input editor's input
561     buffer. Programmers can use this to display in-line prompts in
562     `accept' methods.
563    
564     If `stream' is a stream that is not an input editing stream, then
565     `input-editor-format' is equivalent to format."))
566    
567    
568     (defgeneric redraw-input-buffer (stream &optional start-from)
569     (:documentation "Displays the input editor's buffer starting at
570     the position `start-position' on the interactive stream that is
571     encapsulated by the input editing stream `stream'."))
572 crhodes 1.39
573     ;;; 24.1.1 The Input Editing Stream Protocol
574    
575 thenriksen 1.48 (defgeneric stream-insertion-pointer (stream)
576     (:documentation "Returns an integer corresponding to the
577     current input position in the input editing stream `stream's
578     buffer, that is, the point in the buffer at which the next user
579     input gesture will be inserted. The insertion pointer will always
580     be less than (fill-pointer (stream-input-buffer stream)). The
581     insertion pointer can also be thought of as an editing cursor."))
582    
583     (defgeneric (setf stream-insertion-pointer) (pointer stream)
584     (:documentation "Changes the input position of the input
585     editing stream `stream' to `pointer'. `Pointer' is an integer,
586     and must be less than (fill-pointer (stream-input-buffer stream))"))
587    
588     (defgeneric stream-scan-pointer (stream)
589     (:documentation "Returns an integer corresponding to the
590     current scan pointer in the input editing stream `stream's
591     buffer, that is, the point in the buffer at which calls to
592     `accept' have stopped parsing input. The scan pointer will always
593     be less than or equal to (stream-insertion-pointer stream)."))
594    
595     (defgeneric (setf stream-scan-pointer) (pointer stream)
596     (:documentation "Changes the scan pointer of the input editing
597     stream `stream' to `pointer'. `Pointer' is an integer, and must
598     be less than or equal to (stream-insertion-pointer stream)"))
599    
600     (defgeneric stream-rescanning-p (stream)
601     (:documentation "Returns the state of the input editing stream
602     `stream's \"rescan in progress\" flag, which is true if stream is
603     performing a rescan operation, otherwise it is false. All
604     extended input streams must implement a method for this, but
605     non-input editing streams will always returns false."))
606    
607     (defgeneric reset-scan-pointer (stream &optional scan-pointer)
608     (:documentation "Sets the input editing stream stream's scan
609     pointer to `scan-pointer', and sets the state of
610     `stream-rescanning-p' to true."))
611    
612     (defgeneric immediate-rescan (stream)
613     (:documentation "Invokes a rescan operation immediately by
614     \"throwing\" out to the most recent invocation of
615     `with-input-editing'."))
616    
617     (defgeneric queue-rescan (stream)
618     (:documentation "Indicates that a rescan operation on the input
619     editing stream `stream' should take place after the next
620     non-input editing gesture is read by setting the \"rescan
621     queued\" flag to true. "))
622    
623     (defgeneric rescan-if-necessary (stream &optional inhibit-activation)
624     (:documentation "Invokes a rescan operation on the input
625     editing stream `stream' if `queue-rescan' was called on the same
626     stream and no intervening rescan operation has taken
627     place. Resets the state of the \"rescan queued\" flag to false.
628    
629     If `inhibit-activation' is false, the input line will not be
630     activated even if there is an activation character in it."))
631    
632     (defgeneric erase-input-buffer (stream &optional start-position)
633     (:documentation "Erases the part of the display that
634     corresponds to the input editor's buffer starting at the position
635     `start-position'."))
636 crhodes 1.39
637     ;;; McCLIM relies on a text editor class (by default
638 thenriksen 1.40 ;;; DREI-INPUT-EDITING-MIXIN) to perform the user interaction and
639 crhodes 1.39 ;;; display for input editing. Also, that class must update the stream
640     ;;; buffer and the insertion pointer, cause rescans to happen, and
641     ;;; handle activation gestures.
642 thenriksen 1.48 (defgeneric stream-process-gesture (stream gesture type)
643     (:documentation "If gesture is an input editing command,
644     stream-process-gesture performs the input editing operation on
645     the input editing stream `stream' and returns NIL. Otherwise, it
646     returns the two values gesture and type."))
647 crhodes 1.39
648     ;;; 24.4 Reading and Writing of Tokens
649    
650     (defgeneric replace-input
651 thenriksen 1.47 (stream new-input &key start end buffer-start rescan)
652     ;; XXX: Nonstandard behavior for :rescan.
653     (:documentation "Replaces the part of the input editing stream
654     `stream's input buffer that extends from `buffer-start' to its
655     scan pointer with the string `new-input'. `buffer-start' defaults
656     to the current input position of stream, which is the position at
657     which the current accept \"session\" starts. `start' and `end' can be
658     supplied to specify a subsequence of `new-input'; start defaults to
659     0 and end defaults to the length of `new-input'.
660    
661     `replace-input' will queue a rescan by calling `queue-rescan' if
662     the new input does not match the old input, or `rescan' is
663     true. If `rescan' is explicitly provided as NIL, no rescan will
664     be queued in any case.
665    
666     The returned value is the position in the input buffer."))
667    
668 moore 1.28 (defgeneric presentation-replace-input
669     (stream object type view
670 thenriksen 1.47 &key buffer-start rescan query-identifier for-context-type)
671     (:documentation "Like `replace-input', except that the new
672     input to insert into the input buffer is gotten by presenting
673     `object' with the presentation type `type' and view
674     `view'. `buffer-start' and `rescan' are as for `replace-input',
675     and `query-identifier' and `for-context-type' as as for
676     `present'.
677    
678     Typically, this function will be implemented by calling
679     `present-to-string' on `object', `type', `view', and
680     `for-context-type', and then calling `replace-input' on the
681     resulting string.
682    
683     If the object cannot be transformed into an acceptable textual
684     form, it may be inserted as a special \"accept result\" that is
685     considered a single gesture. These accept result objects have no
686     standardised form."))
687 moore 1.28
688 thenriksen 1.44 ;;; 27.3 Command Menus
689    
690     (defgeneric display-command-table-menu (command-table stream &key max-width
691     max-height n-rows n-columns x-spacing
692     y-spacing initial-spacing row-wise
693     cell-align-x cell-align-y move-cursor)
694     (:documentation "Display a menu of the commands accessible in
695     `command-table' to `stream'.
696    
697     `max-width', `max-height', `n-rows', `n-columns', `x-spacing',
698     `y-spacing', `row-wise', `initial-spacing', `cell-align-x',
699     `cell-align-y', and `move-cursor' are as for
700     `formatting-item-list'."))
701    
702 crhodes 1.39 ;;; 28.2 Specifying the Panes of a Frame
703    
704     (defgeneric destroy-frame (frame))
705     (defgeneric raise-frame (frame))
706     (defgeneric bury-frame (frame))
707    
708     ;;; 28.3 Application Frame Functions
709    
710     (defgeneric frame-name (frame))
711     (defgeneric frame-pretty-name (frame))
712     (defgeneric (setf frame-pretty-name) (name frame))
713     (defgeneric frame-command-table (frame))
714     (defgeneric (setf frame-command-table) (command-table frame))
715     (defgeneric frame-standard-output (frame))
716     (defgeneric frame-standard-input (frame))
717     (defgeneric frame-query-io (frame))
718     (defgeneric frame-error-output (frame))
719     (defgeneric frame-pointer-documentation-output (frame))
720     (defgeneric frame-calling-frame (frame))
721     (defgeneric frame-parent (frame))
722     (defgeneric frame-panes (frame))
723     (defgeneric frame-top-level-sheet (frame))
724     (defgeneric frame-current-panes (frame))
725     (defgeneric get-frame-pane (frame pane-name))
726     (defgeneric fine-pane-named (frame pane-name))
727     (defgeneric frame-current-layout (frame))
728     (defgeneric (setf frame-current-layout) (layout frame))
729     (defgeneric frame-all-layouts (frame))
730     (defgeneric layout-frame (frame &optional width height))
731     (defgeneric frame-exit-frame (condition))
732     (defgeneric frame-exit (frame))
733     (defgeneric pane-needs-redisplay (pane))
734     (defgeneric (setf pane-needs-redisplay) (value pane))
735     (defgeneric redisplay-frame-pane (frame pane &key force-p))
736     (defgeneric redisplay-frame-panes (frame &key force-p))
737     (defgeneric frame-replay (frame stream &optional region))
738     (defgeneric notify-user (frame message &key associated-window title
739     documentation exit-boxes name style text-style))
740     (defgeneric frame-properties (frame property))
741     (defgeneric (setf frame-properties) (value frame property))
742    
743     ;;; 28.3.1 Interface with Presentation Types
744    
745     (defgeneric frame-maintain-presentation-histories (frame))
746 moore 1.28 (defgeneric frame-find-innermost-applicable-presentation
747     (frame input-context stream x y &key event))
748 crhodes 1.39 (defgeneric frame-input-context-button-press-handler
749     (frame stream button-prees-event))
750     (defgeneric frame-document-highlighted-presentation
751     (frame presentation input-context window-context x y stream))
752     (defgeneric frame-drag-and-drop-feedback
753     (frame presentation stream initial-x initial-y new-x new-y state))
754     (defgeneric frame-drag-and-drop-highlighting
755     (frame presentation stream state))
756 moore 1.28
757     ;;;; 28.4
758     (defgeneric default-frame-top-level
759     (frame &key command-parser command-unparser partial-command-parser prompt))
760     (defgeneric read-frame-command (frame &key stream))
761     (defgeneric run-frame-top-level (frame &key &allow-other-keys))
762 moore 1.29 (defgeneric command-enabled (command-name frame))
763     (defgeneric (setf command-name) (enabled command-name frame))
764 thenriksen 1.45 (defgeneric display-command-menu (frame stream &key command-table
765     initial-spacing row-wise max-width
766     max-height n-rows n-columns
767     cell-align-x cell-align-y)
768     (:documentation "Display the command table associated with
769     `command-table' on `stream' by calling
770     `display-command-table-menu'. If no command table is
771     provided, (frame-command-table frame) will be used.
772    
773     The arguments `initial-spacing', `row-wise',
774     `max-width', `max-height', `n-rows', `n-columns', `cell-align-x',
775     and `cell-align-y' are as for `formatting-item-list'."))
776 moore 1.29
777 crhodes 1.39 ;;;; 28.5.2 Frame Manager Operations
778    
779     (defgeneric frame-manager (frame))
780     (defgeneric (setf frame-manager) (frame-manager frame))
781     (defgeneric frame-manager-frames (frame-manager))
782     (defgeneric adopt-frame (frame-manager frame))
783     (defgeneric disown-frame (frame-manager frame))
784     (defgeneric frame-state (frame))
785     (defgeneric enable-frame (frame))
786     (defgeneric disable-frame (frame))
787     (defgeneric shrink-frame (frame))
788    
789     (defgeneric note-frame-enabled (frame-manager frame))
790     (defgeneric note-frame-disabled (frame-manager frame))
791     (defgeneric note-frame-iconified (frame-manager frame))
792     (defgeneric note-frame-deiconified (frame-manager frame))
793 moore 1.29 (defgeneric note-command-enabled (frame-manager frame command-name))
794     (defgeneric note-command-disabled (frame-manager frame command-name))
795 moore 1.28
796 crhodes 1.39 (defgeneric frame-manager-notify-user
797     (framem message-string &key frame associated-window title
798     documentation exit-boxes name style text-style))
799     (defgeneric generate-panes (frame-manager frame))
800     (defgeneric find-pane-for-frame (frame-manager frame))
801    
802     ;;; 28.5.3 Frame Manager Settings
803    
804     (defgeneric (setf client-setting) (value frame setting))
805     (defgeneric reset-frame (frame &rest client-settings))
806    
807 moore 1.28 ;;;; 29.2
808     ;;;;
809     ;;;; FIXME: should we have &key &allow-other-keys here, to cause
810     ;;;; initarg checking? Probably.
811     (defgeneric make-pane-1 (realizer frame abstract-class-name &rest initargs))
812 gilbert 1.2
813 gilbert 1.5 ;;;; 29.2.2 Pane Properties
814    
815     (defgeneric pane-frame (pane))
816     (defgeneric pane-name (pane))
817     (defgeneric pane-foreground (pane))
818     (defgeneric pane-background (pane))
819     (defgeneric pane-text-style (pane))
820    
821     ;;;; 29.3.3 Scroller Pane Classes
822    
823     (defgeneric pane-viewport (pane))
824     (defgeneric pane-viewport-region (pane))
825     (defgeneric pane-scroller (pane))
826     (defgeneric scroll-extent (pane x y))
827    
828 thenriksen 1.42 (deftype scroll-bar-spec () '(member t :both :vertical :horizontal nil))
829    
830 gilbert 1.6 ;;;; 29.3.4 The Layout Protocol
831    
832     ;; (define-protocol-class space-requirement ())
833    
834     ;; make-space-requirement &key (width 0) (max-width 0) (min-width 0) (height 0) (max-height 0) (min-height 0) [Function]
835    
836     (defgeneric space-requirement-width (space-req))
837     (defgeneric space-requirement-min-width (space-req))
838     (defgeneric space-requirement-max-width (space-req))
839     (defgeneric space-requirement-height (space-req))
840     (defgeneric space-requirement-min-height (space-req))
841     (defgeneric space-requirement-max-height (space-req))
842     (defgeneric space-requirement-components (space-req))
843    
844     ;; space-requirement-combine function sr1 sr2 [Function]
845     ;; space-requirement+ sr1 sr2 [Function]
846     ;; space-requirement+* space-req &key width min-width max-width height min-height max-height [Function]
847    
848 rgoldman 1.34 (defgeneric compose-space (pane &key width height)
849     (:documentation "During the space composition pass, a composite pane will
850     typically ask each of its children how much space it requires by calling COMPOSE-SPACE.
851     They answer by returning space-requirement objects. The composite will then form
852     its own space requirement by composing the space requirements of its children
853     according to its own rules for laying out its children.
854    
855     Returns a SPACE-REQUIREMENT object."))
856 gilbert 1.6 (defgeneric allocate-space (pane width height))
857 adejneka 1.11 (defgeneric change-space-requirements
858 hefner1 1.27 (pane &rest space-req-keys &key resize-frame width height
859     min-width min-height max-width max-height))
860 gilbert 1.6 (defgeneric note-space-requirements-changed (sheet pane))
861     ;; changing-space-requirements (&key resize-frame layout) &body body [Macro]
862    
863     ;;;; 29.4.4 CLIM Stream Pane Functions
864    
865     (defgeneric window-clear (window))
866     (defgeneric window-refresh (window))
867     (defgeneric window-viewport (window))
868     (defgeneric window-erase-viewport (window))
869     (defgeneric window-viewport-position (window))
870     ;; (defgeneric (setf* window-viewport-position) (x y window))
871    
872 crhodes 1.39 ;;; D.2 Basic Stream Functions
873    
874     ;;; Gray Streamoid functions, but not part of any Gray proposal.
875     (defgeneric stream-pathname (stream))
876     (defgeneric stream-truename (stream))
877    
878 gilbert 1.8 ;;;;
879 gilbert 1.23 (defgeneric gadget-value (gadget))
880     (defgeneric (setf gadget-value) (new-value gadget &key invoke-callback))
881     (defgeneric gadget-min-value (gadget))
882     (defgeneric gadget-max-value (gadget))
883 gilbert 1.8 (defgeneric (setf gadget-max-value) (new-value gadget))
884     (defgeneric (setf gadget-min-value) (new-value gadget))
885     (defgeneric (setf scroll-bar-thumb-size) (new-value scroll-bar))
886     (defgeneric gadget-orientation (gadget))
887     (defgeneric gadget-client (gadget))
888    
889 gilbert 1.2 ;;;
890    
891 adejneka 1.16 (defgeneric text-style-mapping (port text-style &optional character-set))
892    
893     (defgeneric (setf text-style-mapping)
894     (mapping port text-style &optional character-set))
895 adejneka 1.19 (defgeneric medium-miter-limit (medium)
896     (:documentation
897     "If LINE-STYLE-JOINT-SHAPE is :MITER and the angle between two
898     consequent lines is less than the values return by
899     MEDIUM-MITER-LIMIT, :BEVEL is used instead."))
900 adejneka 1.15 (defgeneric line-style-effective-thickness (line-style medium)
901     (:documentation
902     "Returns the thickness in device units of a line,
903     rendered on MEDIUM with the style LINE-STYLE."))
904    
905 gilbert 1.5 ;;;
906    
907     (defgeneric text-style-character-width (text-style medium char))
908 adejneka 1.13 ;; fall back, where to put this?
909     (defmethod text-style-character-width (text-style medium char)
910     (text-size medium char :text-style text-style))
911 gilbert 1.23
912     (declfun draw-rectangle (sheet point1 point2
913     &rest args
914     &key (filled t)
915     ink clipping-region transformation line-style line-thickness
916     line-unit line-dashes line-joint-shape))
917    
918     (declfun draw-rectangle* (sheet x1 y1 x2 y2
919     &rest args
920     &key (filled t)
921     ink clipping-region transformation line-style line-thickness
922     line-unit line-dashes line-joint-shape))
923 gilbert 1.5
924     ;;; "exported" from a port
925    
926     (defgeneric mirror-transformation (port mirror))
927     (defgeneric port-set-sheet-region (port sheet region))
928     (defgeneric port-set-sheet-transformation (port sheet region))
929 adejneka 1.17 (defgeneric port-text-style-mappings (port))
930 gilbert 1.5 (defgeneric port-lookup-mirror (port sheet))
931     (defgeneric port-register-mirror (port sheet mirror))
932     (defgeneric port-allocate-pixmap (port sheet width height))
933     (defgeneric port-deallocate-pixmap (port pixmap))
934     (defgeneric port-mirror-width (port sheet))
935     (defgeneric port-mirror-height (port sheet))
936 gilbert 1.7 (defgeneric port-enable-sheet (port sheet))
937     (defgeneric port-disable-sheet (port sheet))
938 moore 1.22 (defgeneric port-pointer (port))
939 gilbert 1.2
940 tmoore 1.37 (defgeneric pointer-update-state (pointer event)
941     (:documentation "Called by port event dispatching code to update the modifier
942     and button states of the pointer."))
943    
944 gilbert 1.1 ;;;
945    
946 gilbert 1.8 ;; Used in stream-input.lisp, defined in frames.lisp
947     (defgeneric frame-event-queue (frame))
948 gilbert 1.1
949 moore 1.10 ;;; Used in presentations.lisp, defined in commands.lisp
950    
951     (defgeneric presentation-translators (command-table))
952 gilbert 1.1
953 adejneka 1.21 (defgeneric stream-default-view (stream))
954 adejneka 1.20
955 gilbert 1.26 ;;; ----------------------------------------------------------------------
956    
957     (defgeneric output-record-basline (record)
958     (:documentation
959     "Returns two values: the baseline of an output record and a boolean
960     indicating if this baseline is definitive. McCLIM addition."))
961    
962 tmoore 1.36 (defgeneric encapsulating-stream-stream (encapsulating-stream)
963     (:documentation "The stream encapsulated by an encapsulating stream"))
964    
965 gilbert 1.5 #||
966    
967     Further undeclared functions
968    
969     FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
970     ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
971     HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
972     PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
973     SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
974    
975     (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
976     SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
977     FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
978     MEDIUM WITH-GRAPHICS-STATE
979     PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH TEXT-STYLE-CHARACTER-WIDTH
980     FIND-INNERMOST-APPLICABLE-PRESENTATION HIGHLIGHT-PRESENTATION-1
981     PRESENTATION-OBJECT PRESENTATION-TYPE THROW-HIGHLIGHTED-PRESENTATION
982     FORMAT-CHILDREN TABLE-PANE-NUMBER TEXT-STYLE-CHARACTER-WIDTH
983     PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH SCROLL-EXTENT TEXT-STYLE-CHARACTER-WIDTH
984     FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
985     ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
986     HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
987     PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
988     SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
989     (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
990     SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
991     FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
992 gilbert 1.1
993 gilbert 1.23 ||#

  ViewVC Help
Powered by ViewVC 1.1.5