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

Contents of /mcclim/decls.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.44 - (show annotations)
Wed Dec 13 22:31:57 2006 UTC (7 years, 4 months ago) by thenriksen
Branch: MAIN
Changes since 1.43: +14 -0 lines
Added portable implementation of `display-command-table-menu'.
1 ;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: CLIM-INTERNALS; -*-
2 ;;; ---------------------------------------------------------------------------
3 ;;; Title: DEFGENERICs and stuff
4 ;;; Created: 2001-08-12
5 ;;; Author: Gilbert Baumann <unk6@rz.uni-karlsruhe.de>
6 ;;; License: LGPL (See file COPYING for details).
7 ;;; ---------------------------------------------------------------------------
8 ;;; (c) copyright 2001,2002 by Gilbert Baumann
9
10 ;;; This library is free software; you can redistribute it and/or
11 ;;; modify it under the terms of the GNU Library General Public
12 ;;; License as published by the Free Software Foundation; either
13 ;;; version 2 of the License, or (at your option) any later version.
14 ;;;
15 ;;; This library is distributed in the hope that it will be useful,
16 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;;; Library General Public License for more details.
19 ;;;
20 ;;; You should have received a copy of the GNU Library General Public
21 ;;; License along with this library; if not, write to the
22 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;;; Boston, MA 02111-1307 USA.
24
25 (in-package :clim-internals)
26
27 ;;; 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 ;;; We'll get right on it :) -- moore
32 ;;; Whose numbers are we using here?
33
34 ;;; 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 ;;; 3.2.1.1 The Point Protocol
86
87 (defgeneric point-x (point))
88 (defgeneric point-y (point))
89
90 ;;; 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 ;;; 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 ;;; 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 ;;; 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 ;;; 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 ;;; 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 ;;;; 8.1
222 (defgeneric process-next-event (port &key wait-function timeout))
223
224 ;;; 8.2 Standard Device Events
225
226 (defgeneric event-timestamp (event))
227 (defgeneric event-type (event))
228 (defgeneric event-sheet (device-event))
229 (defgeneric event-modifier-state (device-event))
230 (defgeneric keyboard-event-key-name (keyboard-event))
231 (defgeneric keyboard-event-character (keyboard-event))
232 (defgeneric pointer-event-x (pointer-event))
233 (defgeneric pointer-event-y (pointer-event))
234 (defgeneric pointer-event-native-x (pointer-event))
235 (defgeneric pointer-event-native-y (pointer-event))
236 (defgeneric pointer-event-pointer (pointer-event))
237 (defgeneric pointer-event-button (pointer-button-event))
238 (defgeneric pointer-boundary-event-kind (pointer-boundary-event))
239 (defgeneric window-event-region (window-event))
240 (defgeneric window-event-native-region (window-event))
241 (defgeneric window-event-mirrored-sheet (window-event))
242
243 ;;; 8.3.1 Output Properties
244
245 (defgeneric medium-foreground (medium))
246 (defgeneric (setf medium-foreground) (design medium))
247 (defgeneric medium-background (medium))
248 (defgeneric (setf medium-background) (design medium))
249 (defgeneric medium-ink (medium))
250 (defgeneric (setf medium-ink) (design medium))
251 (defgeneric medium-transformation (medium))
252 (defgeneric (setf medium-transformation) (transformation medium))
253 (defgeneric medium-clipping-region (medium))
254 (defgeneric (setf medium-clipping-region) (region medium))
255 (defgeneric medium-line-style (medium))
256 (defgeneric (setf medium-line-style) (line-style medium))
257 (defgeneric medium-text-style (medium))
258 (defgeneric (setf medium-text-style) (text-style medium))
259 (defgeneric medium-default-text-style (medium))
260 (defgeneric (setf medium-default-text-style) (text-style medium))
261 (defgeneric medium-merged-text-style (medium))
262
263
264 ;;;; 8.3.4 Associating a Medium with a Sheet
265
266 ;; with-sheet-medium (medium sheet) &body body [Macro]
267 ;; with-sheet-medium-bound (sheet medium) &body body [Macro]
268
269 (defgeneric sheet-medium (sheet))
270 (defgeneric medium-sheet (medium))
271 (defgeneric medium-drawable (medium))
272
273 ;;; 8.3.4.1 Grafting and Degrafting of Mediums
274
275 (defgeneric allocate-medium (port sheet))
276 (defgeneric deallocate-medium (port medium))
277 (defgeneric make-medium (port sheet))
278 (defgeneric engraft-medium (medium port sheet))
279 (defgeneric degraft-medium (medium port sheet))
280
281 ;;; 8.4.1 Repaint Protocol Functions
282
283 (defgeneric queue-repaint (sheet repaint-event))
284 (defgeneric handle-repaint (sheet region))
285 (defgeneric repaint-sheet (sheet region))
286
287 ;;;; 9 Ports, Grafts, and Mirrored Sheets
288
289 ;; (defgeneric portp (object))
290 ;; find-port function
291
292 ;;; 9.2 Ports
293
294 (defgeneric port (object))
295 (defgeneric port-server-path (port))
296 (defgeneric port-name (port))
297 (defgeneric port-type (port))
298 (defgeneric port-properties (port indicator))
299 (defgeneric (setf port-properties) (property port indicator))
300 (defgeneric restart-port (port))
301 (defgeneric destroy-port (port))
302
303 ;;; 9.3 Grafts
304
305 (defgeneric sheet-grafted-p (sheet))
306 (declfun find-graft (&key (server-path *default-server-path*)
307 (port (find-port :server-path server-path))
308 (orientation :default)
309 (units :device)))
310 (defgeneric graft (object))
311 (declfun map-over-grafts (function port))
312 ;; with-graft-locked (graft) &body body [macro]
313 (defgeneric graft-orientation (graft))
314 (defgeneric graft-units (graft))
315 (defgeneric graft-width (graft &key units))
316 (defgeneric graft-height (graft &key units))
317 (declfun graft-pixels-per-millimeter (graft))
318 (declfun graft-pixels-per-inch (graft))
319
320 ;; 9.4.1 Mirror Functions
321
322 (defgeneric sheet-direct-mirror (sheet))
323 (defgeneric sheet-mirrored-ancestor (sheet))
324 (defgeneric sheet-mirror (sheet))
325 (defgeneric realize-mirror (port mirrored-sheet))
326 (defgeneric destroy-mirror (port mirrored-sheet))
327 (defgeneric raise-mirror (port sheet))
328 (defgeneric bury-mirror (port sheet))
329
330 ;; 9.4.2 Internal Interfaces for Native Coordinates
331
332 (defgeneric sheet-native-transformation (sheet))
333 (defgeneric sheet-native-region (sheet))
334 (defgeneric sheet-device-transformation (sheet))
335 (defgeneric sheet-device-region (sheet))
336 (defgeneric invalidate-cached-transformations (sheet))
337 (defgeneric invalidate-cached-regions (sheet))
338
339 ;;; Graphics ops
340
341 (defgeneric medium-draw-point* (medium x y))
342 (defgeneric medium-draw-points* (medium coord-seq))
343 (defgeneric medium-draw-line* (medium x1 y1 x2 y2))
344 (defgeneric medium-draw-lines* (medium coord-seq))
345 (defgeneric medium-draw-polygon* (medium coord-seq closed filled))
346 (defgeneric medium-draw-rectangle* (medium left top right bottom filled))
347 (defgeneric medium-draw-ellipse* (medium center-x center-y
348 radius-1-dx radius-1-dy radius-2-dx radius-2-dy
349 start-angle end-angle filled))
350 (defgeneric medium-draw-circle* (medium center-x center-y radius start-angle end-angle filled))
351 (defgeneric medium-draw-text* (medium string x y
352 start end
353 align-x align-y
354 toward-x toward-y transform-glyphs))
355
356 ;;; 10.1 Medium Components
357 ;;;
358 ;;; For reasons that are beyond me, many of the medium component
359 ;;; accessors are also specified in section 8.3.1.
360
361 (defgeneric medium-current-text-style (medium))
362
363 ;;;; 10.2
364 (defgeneric invoke-with-drawing-options
365 (medium continuation &rest drawing-options &key &allow-other-keys))
366
367 ;;;; 10.2.1
368 (defgeneric invoke-with-identity-transformation (medium continuation))
369
370 ;;;; 10.2.2
371 (defgeneric invoke-with-local-coordinates (medium continuation x y))
372
373 (defgeneric invoke-with-first-quadrant-coordinates (medium continuation x y))
374
375 ;;; 11.1.1 Text Style Protocol and Text Style Suboptions
376
377 (defgeneric text-style-components (text-style))
378 (defgeneric text-style-family (text-style))
379 (defgeneric text-style-face (text-style))
380 (defgeneric text-style-size (text-style))
381 (defgeneric merge-text-styles (style1 style2))
382 (defgeneric text-style-ascent (text-style medium))
383 (defgeneric text-style-descent (text-style medium))
384 (defgeneric text-style-height (text-style medium))
385 (defgeneric text-style-width (text-style medium))
386 (defgeneric text-style-fixed-width-p (text-style medium))
387 (defgeneric text-size (medium string &key text-style start end))
388
389 ;;; 11.2 Text Style Binding Forms
390
391 (defgeneric invoke-with-text-style (medium continuation text-style))
392
393 ;;; 12.7.3 Other Medium-specific Output Functions
394
395 (defgeneric medium-finish-output (medium))
396 (defgeneric medium-force-output (medium))
397 (defgeneric medium-clear-area (medium left top right bottom))
398 (defgeneric medium-beep (medium))
399
400 ;;;; 14.5
401 (defgeneric draw-design
402 (medium design
403 &key ink clipping-region transformation line-style line-thickness
404 line-unit line-dashes line-joint-shape line-cap-shape text-style
405 text-family text-face text-size))
406
407 ;;; 15.3 The Text Cursor [complete]
408
409 ;;; 15.3.1 Text Cursor Protocol [complete]
410
411 ;; cursor [protocol class]
412 ;; cursorp object [protocol predicate]
413 ;; :sheet [Initarg for cursor]
414 ;; standard-text-cursor [class]
415 (defgeneric cursor-sheet (cursor))
416 (defgeneric cursor-position (cursor))
417 ;;(defgeneric (setf* cursor-position) (x y cursor))
418 (defgeneric cursor-active (cursor))
419 (defgeneric (setf cursor-active) (value cursor))
420 (defgeneric cursor-state (cursor))
421 (defgeneric (setf cursor-state) (value cursor))
422 (defgeneric cursor-focus (cursor))
423 (defgeneric cursor-visibility (cursor))
424 (defgeneric (setf cursor-visibility) (visibility cursor))
425
426 ;;; 15.3.2 Stream Text Cursor Protocol [complete]
427
428 (defgeneric stream-text-cursor (stream))
429 (defgeneric (setf stream-text-cursor) (cursor stream))
430 (defgeneric stream-cursor-position (stream))
431 ;; (defgeneric (setf* stream-cursor-position) (x y stream)) unsure how to declare this, can somebody help? --GB
432 (defgeneric stream-set-cusor-position (stream x y)) ; This is actually in 19.3.1 in CLIM 2.2
433 (defgeneric stream-increment-cursor-position (stream dx dy))
434
435 ;;; 15.4 Text Protocol [complete]
436
437 (defgeneric stream-character-width (stream character &key text-style))
438 (defgeneric stream-string-width (stream character &key start end text-style))
439 (defgeneric stream-text-margin (stream))
440 (defgeneric (setf stream-text-margin) (margin stream))
441 (defgeneric stream-line-height (stream &key text-style))
442 (defgeneric stream-vertical-spacing (stream))
443 (defgeneric stream-baseline (stream))
444
445 ;;; 15.4.1 Mixing Text and Graphics [complete]
446
447 ;; with-room-for-graphics (&optional stream &key (first-quadrant t) height (move-cursor t) record-type) &body body [Macro]
448
449 ;;; 15.4.2 Wrapping of Text Lines [complete]
450
451 (defgeneric stream-end-of-line-action (stream))
452 (defgeneric (setf stream-end-of-line-action) (action stream))
453 ;; with-end-of-line-action (stream action) &body body [Macro]
454 (defgeneric stream-end-of-page-action (stream))
455 (defgeneric (setf stream-end-of-page-action) (action stream))
456 ;; with-end-of-page-action (stream action) &body body [Macro]
457
458 ;;; 15.5 Attracting the User's Attention
459
460 (defgeneric beep (&optional medium))
461
462 ;;; 15.6 Buffering of Output
463
464 (defgeneric medium-buffering-output-p (medium))
465 (defgeneric (setf medium-buffering-output-p) (buffer-p medium))
466
467 ;;; 16.3.3 Text Displayed Output Record
468
469 (defgeneric add-character-output-to-text-record
470 (text-record character text-style width height baseline))
471
472 (defgeneric add-string-output-to-text-record
473 (text-record string start end text-style width height baseline))
474
475 (defgeneric text-displayed-output-record-string (text-record))
476
477 ;;; 16.4.1. The Output Recording Stream Protocol
478
479 (defgeneric stream-recording-p (stream))
480 (defgeneric (setf stream-recording-p) (recording-p stream))
481 (defgeneric stream-drawing-p (stream))
482 (defgeneric (setf stream-drawing-p) (drawing-p stream))
483 (defgeneric stream-output-history (stream))
484 (defgeneric stream-current-output-record (stream))
485 (defgeneric (setf stream-current-output-record) (record stream))
486 (defgeneric stream-add-output-record (stream record))
487 (defgeneric stream-replay (stream &optional region))
488 (defgeneric erase-output-record (record stream &optional errorp))
489
490 ;;; 16.4.3. Text Output Recording
491 (defgeneric stream-text-output-record (stream text-style))
492 (defgeneric stream-close-text-output-record (stream))
493 (defgeneric stream-add-character-output
494 (stream character text-style width height baseline))
495 (defgeneric stream-add-string-output
496 (stream string start end text-style width height baseline))
497
498 ;;; 16.4.4 Output Recording Utilities [complete]
499
500 ;; with-output-recording-options (stream &key record draw) &body body [Macro]
501 (defgeneric invoke-with-output-recording-options
502 (stream continuation record draw))
503
504 ;;; with-new-output-record (stream &optional record-type record &rest initargs) &body body [Macro]
505
506 ;;; The 'constructor' arg is absent from the CLIM 2.0 spec but is documented
507 ;;; in the Allegro CLIM 2 User Guide and appears to exist in other 'classic'
508 ;;; CLIM implementations. I'm assuming it's an omission from the spec.
509 (defgeneric invoke-with-new-output-record
510 (stream continuation record-type constructor &key &allow-other-keys))
511
512 ;;; with-output-to-output-record (stream &optional record-type record &rest initargs)) &body body [Macro]
513 (defgeneric invoke-with-output-to-output-record
514 (stream continuation record-type constructor
515 &rest initargs &key &allow-other-keys))
516
517 (defgeneric make-design-from-output-record (record))
518
519 ;;;; 21.2
520 (defgeneric invoke-updating-output
521 (stream continuation record-type unique-id id-test cache-value cache-test
522 &key fixed-position all-new parent-cache))
523
524 ;;; 22.2.1 The Extended Stream Input Protocol
525
526 (defgeneric stream-input-buffer (stream))
527 (defgeneric (setf stream-input-buffer) (buffer stream))
528 (defgeneric stream-pointer-position (stream &key pointer))
529 ;; (defgeneric (setf* stream-pointer-position))
530 (defgeneric stream-set-input-focus (stream))
531 (defgeneric stream-read-gesture
532 (stream &key timeout peek-p input-wait-test
533 input-wait-handler pointer-button-press-handler))
534 (defgeneric stream-input-wait (stream &key timeout input-wait-test))
535 (defgeneric stream-unread-gesture (stream gesture))
536
537 ;;; 22.2.2 Extended Input Stream Conditions
538
539 (defgeneric abort-gesture-event (condition))
540 (defgeneric accelerator-gesture-event (condition))
541 (defgeneric accelerator-gesture-numeric-argument (condition))
542
543 ;;; 23.5 Context-dependent (Typed) Input
544
545 (defgeneric stream-accept
546 (stream
547 type &key view default default-type provide-default insert-default
548 replace-input history active-p prompt prompt-mode display-default
549 query-identifier activation-gestures additional-activation-gestures
550 delimiter-gestures additional-delimiter-gestures))
551 (defgeneric prompt-for-accept (stream type view &rest accept-args &key))
552
553 ;;; 24.1 The Input Editor
554
555 (defgeneric input-editor-format (stream format-string &rest args))
556 (defgeneric redraw-input-buffer (stream &optional start-from))
557
558 ;;; 24.1.1 The Input Editing Stream Protocol
559
560 (defgeneric stream-insertion-pointer (stream))
561 (defgeneric (setf stream-insertion-pointer) (pointer stream))
562 (defgeneric stream-scan-pointer (stream))
563 (defgeneric (setf stream-scan-pointer) (pointer stream))
564 (defgeneric stream-rescanning-p (stream))
565 (defgeneric reset-scan-pointer (stream &optional scan-pointer))
566 (defgeneric immediate-rescan (stream))
567 (defgeneric queue-rescan (stream))
568 (defgeneric rescan-if-necessary (stream &optional inhibit-activation))
569 (defgeneric erase-input-buffer (stream &optional start-position))
570
571 ;;; McCLIM relies on a text editor class (by default
572 ;;; DREI-INPUT-EDITING-MIXIN) to perform the user interaction and
573 ;;; display for input editing. Also, that class must update the stream
574 ;;; buffer and the insertion pointer, cause rescans to happen, and
575 ;;; handle activation gestures.
576 (defgeneric stream-process-gesture (stream gesture type))
577
578 ;;; 24.4 Reading and Writing of Tokens
579
580 (defgeneric replace-input
581 (stream new-input &key start end buffer-start rescan))
582 (defgeneric presentation-replace-input
583 (stream object type view
584 &key buffer-start rescan query-identifier for-context-type))
585
586 ;;; 27.3 Command Menus
587
588 (defgeneric display-command-table-menu (command-table stream &key max-width
589 max-height n-rows n-columns x-spacing
590 y-spacing initial-spacing row-wise
591 cell-align-x cell-align-y move-cursor)
592 (:documentation "Display a menu of the commands accessible in
593 `command-table' to `stream'.
594
595 `max-width', `max-height', `n-rows', `n-columns', `x-spacing',
596 `y-spacing', `row-wise', `initial-spacing', `cell-align-x',
597 `cell-align-y', and `move-cursor' are as for
598 `formatting-item-list'."))
599
600 ;;; 28.2 Specifying the Panes of a Frame
601
602 (defgeneric destroy-frame (frame))
603 (defgeneric raise-frame (frame))
604 (defgeneric bury-frame (frame))
605
606 ;;; 28.3 Application Frame Functions
607
608 (defgeneric frame-name (frame))
609 (defgeneric frame-pretty-name (frame))
610 (defgeneric (setf frame-pretty-name) (name frame))
611 (defgeneric frame-command-table (frame))
612 (defgeneric (setf frame-command-table) (command-table frame))
613 (defgeneric frame-standard-output (frame))
614 (defgeneric frame-standard-input (frame))
615 (defgeneric frame-query-io (frame))
616 (defgeneric frame-error-output (frame))
617 (defgeneric frame-pointer-documentation-output (frame))
618 (defgeneric frame-calling-frame (frame))
619 (defgeneric frame-parent (frame))
620 (defgeneric frame-panes (frame))
621 (defgeneric frame-top-level-sheet (frame))
622 (defgeneric frame-current-panes (frame))
623 (defgeneric get-frame-pane (frame pane-name))
624 (defgeneric fine-pane-named (frame pane-name))
625 (defgeneric frame-current-layout (frame))
626 (defgeneric (setf frame-current-layout) (layout frame))
627 (defgeneric frame-all-layouts (frame))
628 (defgeneric layout-frame (frame &optional width height))
629 (defgeneric frame-exit-frame (condition))
630 (defgeneric frame-exit (frame))
631 (defgeneric pane-needs-redisplay (pane))
632 (defgeneric (setf pane-needs-redisplay) (value pane))
633 (defgeneric redisplay-frame-pane (frame pane &key force-p))
634 (defgeneric redisplay-frame-panes (frame &key force-p))
635 (defgeneric frame-replay (frame stream &optional region))
636 (defgeneric notify-user (frame message &key associated-window title
637 documentation exit-boxes name style text-style))
638 (defgeneric frame-properties (frame property))
639 (defgeneric (setf frame-properties) (value frame property))
640
641 ;;; 28.3.1 Interface with Presentation Types
642
643 (defgeneric frame-maintain-presentation-histories (frame))
644 (defgeneric frame-find-innermost-applicable-presentation
645 (frame input-context stream x y &key event))
646 (defgeneric frame-input-context-button-press-handler
647 (frame stream button-prees-event))
648 (defgeneric frame-document-highlighted-presentation
649 (frame presentation input-context window-context x y stream))
650 (defgeneric frame-drag-and-drop-feedback
651 (frame presentation stream initial-x initial-y new-x new-y state))
652 (defgeneric frame-drag-and-drop-highlighting
653 (frame presentation stream state))
654
655 ;;;; 28.4
656 (defgeneric default-frame-top-level
657 (frame &key command-parser command-unparser partial-command-parser prompt))
658 (defgeneric read-frame-command (frame &key stream))
659 (defgeneric run-frame-top-level (frame &key &allow-other-keys))
660 (defgeneric command-enabled (command-name frame))
661 (defgeneric (setf command-name) (enabled command-name frame))
662
663 ;;;; 28.5.2 Frame Manager Operations
664
665 (defgeneric frame-manager (frame))
666 (defgeneric (setf frame-manager) (frame-manager frame))
667 (defgeneric frame-manager-frames (frame-manager))
668 (defgeneric adopt-frame (frame-manager frame))
669 (defgeneric disown-frame (frame-manager frame))
670 (defgeneric frame-state (frame))
671 (defgeneric enable-frame (frame))
672 (defgeneric disable-frame (frame))
673 (defgeneric shrink-frame (frame))
674
675 (defgeneric note-frame-enabled (frame-manager frame))
676 (defgeneric note-frame-disabled (frame-manager frame))
677 (defgeneric note-frame-iconified (frame-manager frame))
678 (defgeneric note-frame-deiconified (frame-manager frame))
679 (defgeneric note-command-enabled (frame-manager frame command-name))
680 (defgeneric note-command-disabled (frame-manager frame command-name))
681
682 (defgeneric frame-manager-notify-user
683 (framem message-string &key frame associated-window title
684 documentation exit-boxes name style text-style))
685 (defgeneric generate-panes (frame-manager frame))
686 (defgeneric find-pane-for-frame (frame-manager frame))
687
688 ;;; 28.5.3 Frame Manager Settings
689
690 (defgeneric (setf client-setting) (value frame setting))
691 (defgeneric reset-frame (frame &rest client-settings))
692
693 ;;;; 29.2
694 ;;;;
695 ;;;; FIXME: should we have &key &allow-other-keys here, to cause
696 ;;;; initarg checking? Probably.
697 (defgeneric make-pane-1 (realizer frame abstract-class-name &rest initargs))
698
699 ;;;; 29.2.2 Pane Properties
700
701 (defgeneric pane-frame (pane))
702 (defgeneric pane-name (pane))
703 (defgeneric pane-foreground (pane))
704 (defgeneric pane-background (pane))
705 (defgeneric pane-text-style (pane))
706
707 ;;;; 29.3.3 Scroller Pane Classes
708
709 (defgeneric pane-viewport (pane))
710 (defgeneric pane-viewport-region (pane))
711 (defgeneric pane-scroller (pane))
712 (defgeneric scroll-extent (pane x y))
713
714 (deftype scroll-bar-spec () '(member t :both :vertical :horizontal nil))
715
716 ;;;; 29.3.4 The Layout Protocol
717
718 ;; (define-protocol-class space-requirement ())
719
720 ;; make-space-requirement &key (width 0) (max-width 0) (min-width 0) (height 0) (max-height 0) (min-height 0) [Function]
721
722 (defgeneric space-requirement-width (space-req))
723 (defgeneric space-requirement-min-width (space-req))
724 (defgeneric space-requirement-max-width (space-req))
725 (defgeneric space-requirement-height (space-req))
726 (defgeneric space-requirement-min-height (space-req))
727 (defgeneric space-requirement-max-height (space-req))
728 (defgeneric space-requirement-components (space-req))
729
730 ;; space-requirement-combine function sr1 sr2 [Function]
731 ;; space-requirement+ sr1 sr2 [Function]
732 ;; space-requirement+* space-req &key width min-width max-width height min-height max-height [Function]
733
734 (defgeneric compose-space (pane &key width height)
735 (:documentation "During the space composition pass, a composite pane will
736 typically ask each of its children how much space it requires by calling COMPOSE-SPACE.
737 They answer by returning space-requirement objects. The composite will then form
738 its own space requirement by composing the space requirements of its children
739 according to its own rules for laying out its children.
740
741 Returns a SPACE-REQUIREMENT object."))
742 (defgeneric allocate-space (pane width height))
743 (defgeneric change-space-requirements
744 (pane &rest space-req-keys &key resize-frame width height
745 min-width min-height max-width max-height))
746 (defgeneric note-space-requirements-changed (sheet pane))
747 ;; changing-space-requirements (&key resize-frame layout) &body body [Macro]
748
749 ;;;; 29.4.4 CLIM Stream Pane Functions
750
751 (defgeneric window-clear (window))
752 (defgeneric window-refresh (window))
753 (defgeneric window-viewport (window))
754 (defgeneric window-erase-viewport (window))
755 (defgeneric window-viewport-position (window))
756 ;; (defgeneric (setf* window-viewport-position) (x y window))
757
758 ;;; D.2 Basic Stream Functions
759
760 ;;; Gray Streamoid functions, but not part of any Gray proposal.
761 (defgeneric stream-pathname (stream))
762 (defgeneric stream-truename (stream))
763
764 ;;;;
765 (defgeneric gadget-value (gadget))
766 (defgeneric (setf gadget-value) (new-value gadget &key invoke-callback))
767 (defgeneric gadget-min-value (gadget))
768 (defgeneric gadget-max-value (gadget))
769 (defgeneric (setf gadget-max-value) (new-value gadget))
770 (defgeneric (setf gadget-min-value) (new-value gadget))
771 (defgeneric (setf scroll-bar-thumb-size) (new-value scroll-bar))
772 (defgeneric gadget-orientation (gadget))
773 (defgeneric gadget-client (gadget))
774
775 ;;;
776
777 (defgeneric text-style-mapping (port text-style &optional character-set))
778
779 (defgeneric (setf text-style-mapping)
780 (mapping port text-style &optional character-set))
781 (defgeneric medium-miter-limit (medium)
782 (:documentation
783 "If LINE-STYLE-JOINT-SHAPE is :MITER and the angle between two
784 consequent lines is less than the values return by
785 MEDIUM-MITER-LIMIT, :BEVEL is used instead."))
786 (defgeneric line-style-effective-thickness (line-style medium)
787 (:documentation
788 "Returns the thickness in device units of a line,
789 rendered on MEDIUM with the style LINE-STYLE."))
790
791 ;;;
792
793 (defgeneric text-style-character-width (text-style medium char))
794 ;; fall back, where to put this?
795 (defmethod text-style-character-width (text-style medium char)
796 (text-size medium char :text-style text-style))
797
798 (declfun draw-rectangle (sheet point1 point2
799 &rest args
800 &key (filled t)
801 ink clipping-region transformation line-style line-thickness
802 line-unit line-dashes line-joint-shape))
803
804 (declfun draw-rectangle* (sheet x1 y1 x2 y2
805 &rest args
806 &key (filled t)
807 ink clipping-region transformation line-style line-thickness
808 line-unit line-dashes line-joint-shape))
809
810 ;;; "exported" from a port
811
812 (defgeneric mirror-transformation (port mirror))
813 (defgeneric port-set-sheet-region (port sheet region))
814 (defgeneric port-set-sheet-transformation (port sheet region))
815 (defgeneric port-text-style-mappings (port))
816 (defgeneric port-lookup-mirror (port sheet))
817 (defgeneric port-register-mirror (port sheet mirror))
818 (defgeneric port-allocate-pixmap (port sheet width height))
819 (defgeneric port-deallocate-pixmap (port pixmap))
820 (defgeneric port-mirror-width (port sheet))
821 (defgeneric port-mirror-height (port sheet))
822 (defgeneric port-enable-sheet (port sheet))
823 (defgeneric port-disable-sheet (port sheet))
824 (defgeneric port-pointer (port))
825
826 (defgeneric pointer-update-state (pointer event)
827 (:documentation "Called by port event dispatching code to update the modifier
828 and button states of the pointer."))
829
830 ;;;
831
832 ;; Used in stream-input.lisp, defined in frames.lisp
833 (defgeneric frame-event-queue (frame))
834
835 ;;; Used in presentations.lisp, defined in commands.lisp
836
837 (defgeneric presentation-translators (command-table))
838
839 (defgeneric stream-default-view (stream))
840
841 ;;; ----------------------------------------------------------------------
842
843 (defgeneric output-record-basline (record)
844 (:documentation
845 "Returns two values: the baseline of an output record and a boolean
846 indicating if this baseline is definitive. McCLIM addition."))
847
848 (defgeneric encapsulating-stream-stream (encapsulating-stream)
849 (:documentation "The stream encapsulated by an encapsulating stream"))
850
851 #||
852
853 Further undeclared functions
854
855 FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
856 ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
857 HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
858 PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
859 SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
860
861 (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
862 SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
863 FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
864 MEDIUM WITH-GRAPHICS-STATE
865 PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH TEXT-STYLE-CHARACTER-WIDTH
866 FIND-INNERMOST-APPLICABLE-PRESENTATION HIGHLIGHT-PRESENTATION-1
867 PRESENTATION-OBJECT PRESENTATION-TYPE THROW-HIGHLIGHTED-PRESENTATION
868 FORMAT-CHILDREN TABLE-PANE-NUMBER TEXT-STYLE-CHARACTER-WIDTH
869 PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH SCROLL-EXTENT TEXT-STYLE-CHARACTER-WIDTH
870 FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
871 ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
872 HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
873 PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
874 SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
875 (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
876 SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
877 FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
878
879 ||#

  ViewVC Help
Powered by ViewVC 1.1.5