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

Contents of /mcclim/decls.lisp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.47 - (show annotations)
Mon Aug 20 14:27:14 2007 UTC (6 years, 7 months ago) by thenriksen
Branch: MAIN
CVS Tags: McCLIM-0-9-5
Changes since 1.46: +34 -2 lines
Fixed last known Drei input-editing-stream issue by implementing
Goatee-style handling of :REPLACE keyword parameter to
STREAM-REPLACE-INPUT (not mentioned in the spec).
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 (defgeneric port-keyboard-input-focus (port))
225 (defgeneric (setf port-keyboard-input-focus) (focus port))
226
227 ;;; 8.2 Standard Device Events
228
229 (defgeneric event-timestamp (event))
230 (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
267 ;;;; 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 (defgeneric sheet-medium (sheet))
273 (defgeneric medium-sheet (medium))
274 (defgeneric medium-drawable (medium))
275
276 ;;; 8.3.4.1 Grafting and Degrafting of Mediums
277
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 ;;; 8.4.1 Repaint Protocol Functions
285
286 (defgeneric queue-repaint (sheet repaint-event))
287 (defgeneric handle-repaint (sheet region))
288 (defgeneric repaint-sheet (sheet region))
289
290 ;;;; 9 Ports, Grafts, and Mirrored Sheets
291
292 ;; (defgeneric portp (object))
293 ;; find-port function
294
295 ;;; 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 ;;; 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 ;; 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 (defgeneric medium-draw-circle* (medium center-x center-y radius start-angle end-angle filled))
354 (defgeneric medium-draw-text* (medium string x y
355 start end
356 align-x align-y
357 toward-x toward-y transform-glyphs))
358
359 ;;; 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 ;;;; 10.2
367 (defgeneric invoke-with-drawing-options
368 (medium continuation &rest drawing-options &key &allow-other-keys))
369
370 ;;;; 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
378 ;;; 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 ;;;; 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 ;;; 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 (defgeneric stream-set-cusor-position (stream x y)) ; This is actually in 19.3.1 in CLIM 2.2
436 (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 ;;; 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
475 (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 (defgeneric stream-text-output-record (stream text-style))
495 (defgeneric stream-close-text-output-record (stream))
496 (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
501 ;;; 16.4.4 Output Recording Utilities [complete]
502
503 ;; with-output-recording-options (stream &key record draw) &body body [Macro]
504 (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 (defgeneric make-design-from-output-record (record))
521
522 ;;;; 21.2
523 (defgeneric invoke-updating-output
524 (stream continuation record-type unique-id id-test cache-value cache-test
525 &key fixed-position all-new parent-cache))
526
527 ;;; 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 stream-pointer-position (stream &key pointer))
532 ;; (defgeneric (setf* stream-pointer-position))
533 (defgeneric stream-set-input-focus (stream))
534 (defgeneric stream-read-gesture
535 (stream &key timeout peek-p input-wait-test
536 input-wait-handler pointer-button-press-handler))
537 (defgeneric stream-input-wait (stream &key timeout input-wait-test))
538 (defgeneric stream-unread-gesture (stream gesture))
539
540 ;;; 22.2.2 Extended Input Stream Conditions
541
542 (defgeneric abort-gesture-event (condition))
543 (defgeneric accelerator-gesture-event (condition))
544 (defgeneric accelerator-gesture-numeric-argument (condition))
545
546 ;;; 23.5 Context-dependent (Typed) Input
547
548 (defgeneric stream-accept
549 (stream
550 type &key view default default-type provide-default insert-default
551 replace-input history active-p prompt prompt-mode display-default
552 query-identifier activation-gestures additional-activation-gestures
553 delimiter-gestures additional-delimiter-gestures))
554 (defgeneric prompt-for-accept (stream type view &rest accept-args &key))
555
556 ;;; 24.1 The Input Editor
557
558 (defgeneric input-editor-format (stream format-string &rest args))
559 (defgeneric redraw-input-buffer (stream &optional start-from))
560
561 ;;; 24.1.1 The Input Editing Stream Protocol
562
563 (defgeneric stream-insertion-pointer (stream))
564 (defgeneric (setf stream-insertion-pointer) (pointer stream))
565 (defgeneric stream-scan-pointer (stream))
566 (defgeneric (setf stream-scan-pointer) (pointer stream))
567 (defgeneric stream-rescanning-p (stream))
568 (defgeneric reset-scan-pointer (stream &optional scan-pointer))
569 (defgeneric immediate-rescan (stream))
570 (defgeneric queue-rescan (stream))
571 (defgeneric rescan-if-necessary (stream &optional inhibit-activation))
572 (defgeneric erase-input-buffer (stream &optional start-position))
573
574 ;;; McCLIM relies on a text editor class (by default
575 ;;; DREI-INPUT-EDITING-MIXIN) to perform the user interaction and
576 ;;; display for input editing. Also, that class must update the stream
577 ;;; buffer and the insertion pointer, cause rescans to happen, and
578 ;;; handle activation gestures.
579 (defgeneric stream-process-gesture (stream gesture type))
580
581 ;;; 24.4 Reading and Writing of Tokens
582
583 (defgeneric replace-input
584 (stream new-input &key start end buffer-start rescan)
585 ;; XXX: Nonstandard behavior for :rescan.
586 (:documentation "Replaces the part of the input editing stream
587 `stream's input buffer that extends from `buffer-start' to its
588 scan pointer with the string `new-input'. `buffer-start' defaults
589 to the current input position of stream, which is the position at
590 which the current accept \"session\" starts. `start' and `end' can be
591 supplied to specify a subsequence of `new-input'; start defaults to
592 0 and end defaults to the length of `new-input'.
593
594 `replace-input' will queue a rescan by calling `queue-rescan' if
595 the new input does not match the old input, or `rescan' is
596 true. If `rescan' is explicitly provided as NIL, no rescan will
597 be queued in any case.
598
599 The returned value is the position in the input buffer."))
600
601 (defgeneric presentation-replace-input
602 (stream object type view
603 &key buffer-start rescan query-identifier for-context-type)
604 (:documentation "Like `replace-input', except that the new
605 input to insert into the input buffer is gotten by presenting
606 `object' with the presentation type `type' and view
607 `view'. `buffer-start' and `rescan' are as for `replace-input',
608 and `query-identifier' and `for-context-type' as as for
609 `present'.
610
611 Typically, this function will be implemented by calling
612 `present-to-string' on `object', `type', `view', and
613 `for-context-type', and then calling `replace-input' on the
614 resulting string.
615
616 If the object cannot be transformed into an acceptable textual
617 form, it may be inserted as a special \"accept result\" that is
618 considered a single gesture. These accept result objects have no
619 standardised form."))
620
621 ;;; 27.3 Command Menus
622
623 (defgeneric display-command-table-menu (command-table stream &key max-width
624 max-height n-rows n-columns x-spacing
625 y-spacing initial-spacing row-wise
626 cell-align-x cell-align-y move-cursor)
627 (:documentation "Display a menu of the commands accessible in
628 `command-table' to `stream'.
629
630 `max-width', `max-height', `n-rows', `n-columns', `x-spacing',
631 `y-spacing', `row-wise', `initial-spacing', `cell-align-x',
632 `cell-align-y', and `move-cursor' are as for
633 `formatting-item-list'."))
634
635 ;;; 28.2 Specifying the Panes of a Frame
636
637 (defgeneric destroy-frame (frame))
638 (defgeneric raise-frame (frame))
639 (defgeneric bury-frame (frame))
640
641 ;;; 28.3 Application Frame Functions
642
643 (defgeneric frame-name (frame))
644 (defgeneric frame-pretty-name (frame))
645 (defgeneric (setf frame-pretty-name) (name frame))
646 (defgeneric frame-command-table (frame))
647 (defgeneric (setf frame-command-table) (command-table frame))
648 (defgeneric frame-standard-output (frame))
649 (defgeneric frame-standard-input (frame))
650 (defgeneric frame-query-io (frame))
651 (defgeneric frame-error-output (frame))
652 (defgeneric frame-pointer-documentation-output (frame))
653 (defgeneric frame-calling-frame (frame))
654 (defgeneric frame-parent (frame))
655 (defgeneric frame-panes (frame))
656 (defgeneric frame-top-level-sheet (frame))
657 (defgeneric frame-current-panes (frame))
658 (defgeneric get-frame-pane (frame pane-name))
659 (defgeneric fine-pane-named (frame pane-name))
660 (defgeneric frame-current-layout (frame))
661 (defgeneric (setf frame-current-layout) (layout frame))
662 (defgeneric frame-all-layouts (frame))
663 (defgeneric layout-frame (frame &optional width height))
664 (defgeneric frame-exit-frame (condition))
665 (defgeneric frame-exit (frame))
666 (defgeneric pane-needs-redisplay (pane))
667 (defgeneric (setf pane-needs-redisplay) (value pane))
668 (defgeneric redisplay-frame-pane (frame pane &key force-p))
669 (defgeneric redisplay-frame-panes (frame &key force-p))
670 (defgeneric frame-replay (frame stream &optional region))
671 (defgeneric notify-user (frame message &key associated-window title
672 documentation exit-boxes name style text-style))
673 (defgeneric frame-properties (frame property))
674 (defgeneric (setf frame-properties) (value frame property))
675
676 ;;; 28.3.1 Interface with Presentation Types
677
678 (defgeneric frame-maintain-presentation-histories (frame))
679 (defgeneric frame-find-innermost-applicable-presentation
680 (frame input-context stream x y &key event))
681 (defgeneric frame-input-context-button-press-handler
682 (frame stream button-prees-event))
683 (defgeneric frame-document-highlighted-presentation
684 (frame presentation input-context window-context x y stream))
685 (defgeneric frame-drag-and-drop-feedback
686 (frame presentation stream initial-x initial-y new-x new-y state))
687 (defgeneric frame-drag-and-drop-highlighting
688 (frame presentation stream state))
689
690 ;;;; 28.4
691 (defgeneric default-frame-top-level
692 (frame &key command-parser command-unparser partial-command-parser prompt))
693 (defgeneric read-frame-command (frame &key stream))
694 (defgeneric run-frame-top-level (frame &key &allow-other-keys))
695 (defgeneric command-enabled (command-name frame))
696 (defgeneric (setf command-name) (enabled command-name frame))
697 (defgeneric display-command-menu (frame stream &key command-table
698 initial-spacing row-wise max-width
699 max-height n-rows n-columns
700 cell-align-x cell-align-y)
701 (:documentation "Display the command table associated with
702 `command-table' on `stream' by calling
703 `display-command-table-menu'. If no command table is
704 provided, (frame-command-table frame) will be used.
705
706 The arguments `initial-spacing', `row-wise',
707 `max-width', `max-height', `n-rows', `n-columns', `cell-align-x',
708 and `cell-align-y' are as for `formatting-item-list'."))
709
710 ;;;; 28.5.2 Frame Manager Operations
711
712 (defgeneric frame-manager (frame))
713 (defgeneric (setf frame-manager) (frame-manager frame))
714 (defgeneric frame-manager-frames (frame-manager))
715 (defgeneric adopt-frame (frame-manager frame))
716 (defgeneric disown-frame (frame-manager frame))
717 (defgeneric frame-state (frame))
718 (defgeneric enable-frame (frame))
719 (defgeneric disable-frame (frame))
720 (defgeneric shrink-frame (frame))
721
722 (defgeneric note-frame-enabled (frame-manager frame))
723 (defgeneric note-frame-disabled (frame-manager frame))
724 (defgeneric note-frame-iconified (frame-manager frame))
725 (defgeneric note-frame-deiconified (frame-manager frame))
726 (defgeneric note-command-enabled (frame-manager frame command-name))
727 (defgeneric note-command-disabled (frame-manager frame command-name))
728
729 (defgeneric frame-manager-notify-user
730 (framem message-string &key frame associated-window title
731 documentation exit-boxes name style text-style))
732 (defgeneric generate-panes (frame-manager frame))
733 (defgeneric find-pane-for-frame (frame-manager frame))
734
735 ;;; 28.5.3 Frame Manager Settings
736
737 (defgeneric (setf client-setting) (value frame setting))
738 (defgeneric reset-frame (frame &rest client-settings))
739
740 ;;;; 29.2
741 ;;;;
742 ;;;; FIXME: should we have &key &allow-other-keys here, to cause
743 ;;;; initarg checking? Probably.
744 (defgeneric make-pane-1 (realizer frame abstract-class-name &rest initargs))
745
746 ;;;; 29.2.2 Pane Properties
747
748 (defgeneric pane-frame (pane))
749 (defgeneric pane-name (pane))
750 (defgeneric pane-foreground (pane))
751 (defgeneric pane-background (pane))
752 (defgeneric pane-text-style (pane))
753
754 ;;;; 29.3.3 Scroller Pane Classes
755
756 (defgeneric pane-viewport (pane))
757 (defgeneric pane-viewport-region (pane))
758 (defgeneric pane-scroller (pane))
759 (defgeneric scroll-extent (pane x y))
760
761 (deftype scroll-bar-spec () '(member t :both :vertical :horizontal nil))
762
763 ;;;; 29.3.4 The Layout Protocol
764
765 ;; (define-protocol-class space-requirement ())
766
767 ;; make-space-requirement &key (width 0) (max-width 0) (min-width 0) (height 0) (max-height 0) (min-height 0) [Function]
768
769 (defgeneric space-requirement-width (space-req))
770 (defgeneric space-requirement-min-width (space-req))
771 (defgeneric space-requirement-max-width (space-req))
772 (defgeneric space-requirement-height (space-req))
773 (defgeneric space-requirement-min-height (space-req))
774 (defgeneric space-requirement-max-height (space-req))
775 (defgeneric space-requirement-components (space-req))
776
777 ;; space-requirement-combine function sr1 sr2 [Function]
778 ;; space-requirement+ sr1 sr2 [Function]
779 ;; space-requirement+* space-req &key width min-width max-width height min-height max-height [Function]
780
781 (defgeneric compose-space (pane &key width height)
782 (:documentation "During the space composition pass, a composite pane will
783 typically ask each of its children how much space it requires by calling COMPOSE-SPACE.
784 They answer by returning space-requirement objects. The composite will then form
785 its own space requirement by composing the space requirements of its children
786 according to its own rules for laying out its children.
787
788 Returns a SPACE-REQUIREMENT object."))
789 (defgeneric allocate-space (pane width height))
790 (defgeneric change-space-requirements
791 (pane &rest space-req-keys &key resize-frame width height
792 min-width min-height max-width max-height))
793 (defgeneric note-space-requirements-changed (sheet pane))
794 ;; changing-space-requirements (&key resize-frame layout) &body body [Macro]
795
796 ;;;; 29.4.4 CLIM Stream Pane Functions
797
798 (defgeneric window-clear (window))
799 (defgeneric window-refresh (window))
800 (defgeneric window-viewport (window))
801 (defgeneric window-erase-viewport (window))
802 (defgeneric window-viewport-position (window))
803 ;; (defgeneric (setf* window-viewport-position) (x y window))
804
805 ;;; D.2 Basic Stream Functions
806
807 ;;; Gray Streamoid functions, but not part of any Gray proposal.
808 (defgeneric stream-pathname (stream))
809 (defgeneric stream-truename (stream))
810
811 ;;;;
812 (defgeneric gadget-value (gadget))
813 (defgeneric (setf gadget-value) (new-value gadget &key invoke-callback))
814 (defgeneric gadget-min-value (gadget))
815 (defgeneric gadget-max-value (gadget))
816 (defgeneric (setf gadget-max-value) (new-value gadget))
817 (defgeneric (setf gadget-min-value) (new-value gadget))
818 (defgeneric (setf scroll-bar-thumb-size) (new-value scroll-bar))
819 (defgeneric gadget-orientation (gadget))
820 (defgeneric gadget-client (gadget))
821
822 ;;;
823
824 (defgeneric text-style-mapping (port text-style &optional character-set))
825
826 (defgeneric (setf text-style-mapping)
827 (mapping port text-style &optional character-set))
828 (defgeneric medium-miter-limit (medium)
829 (:documentation
830 "If LINE-STYLE-JOINT-SHAPE is :MITER and the angle between two
831 consequent lines is less than the values return by
832 MEDIUM-MITER-LIMIT, :BEVEL is used instead."))
833 (defgeneric line-style-effective-thickness (line-style medium)
834 (:documentation
835 "Returns the thickness in device units of a line,
836 rendered on MEDIUM with the style LINE-STYLE."))
837
838 ;;;
839
840 (defgeneric text-style-character-width (text-style medium char))
841 ;; fall back, where to put this?
842 (defmethod text-style-character-width (text-style medium char)
843 (text-size medium char :text-style text-style))
844
845 (declfun draw-rectangle (sheet point1 point2
846 &rest args
847 &key (filled t)
848 ink clipping-region transformation line-style line-thickness
849 line-unit line-dashes line-joint-shape))
850
851 (declfun draw-rectangle* (sheet x1 y1 x2 y2
852 &rest args
853 &key (filled t)
854 ink clipping-region transformation line-style line-thickness
855 line-unit line-dashes line-joint-shape))
856
857 ;;; "exported" from a port
858
859 (defgeneric mirror-transformation (port mirror))
860 (defgeneric port-set-sheet-region (port sheet region))
861 (defgeneric port-set-sheet-transformation (port sheet region))
862 (defgeneric port-text-style-mappings (port))
863 (defgeneric port-lookup-mirror (port sheet))
864 (defgeneric port-register-mirror (port sheet mirror))
865 (defgeneric port-allocate-pixmap (port sheet width height))
866 (defgeneric port-deallocate-pixmap (port pixmap))
867 (defgeneric port-mirror-width (port sheet))
868 (defgeneric port-mirror-height (port sheet))
869 (defgeneric port-enable-sheet (port sheet))
870 (defgeneric port-disable-sheet (port sheet))
871 (defgeneric port-pointer (port))
872
873 (defgeneric pointer-update-state (pointer event)
874 (:documentation "Called by port event dispatching code to update the modifier
875 and button states of the pointer."))
876
877 ;;;
878
879 ;; Used in stream-input.lisp, defined in frames.lisp
880 (defgeneric frame-event-queue (frame))
881
882 ;;; Used in presentations.lisp, defined in commands.lisp
883
884 (defgeneric presentation-translators (command-table))
885
886 (defgeneric stream-default-view (stream))
887
888 ;;; ----------------------------------------------------------------------
889
890 (defgeneric output-record-basline (record)
891 (:documentation
892 "Returns two values: the baseline of an output record and a boolean
893 indicating if this baseline is definitive. McCLIM addition."))
894
895 (defgeneric encapsulating-stream-stream (encapsulating-stream)
896 (:documentation "The stream encapsulated by an encapsulating stream"))
897
898 #||
899
900 Further undeclared functions
901
902 FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
903 ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
904 HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
905 PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
906 SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
907
908 (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
909 SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
910 FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
911 MEDIUM WITH-GRAPHICS-STATE
912 PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH TEXT-STYLE-CHARACTER-WIDTH
913 FIND-INNERMOST-APPLICABLE-PRESENTATION HIGHLIGHT-PRESENTATION-1
914 PRESENTATION-OBJECT PRESENTATION-TYPE THROW-HIGHLIGHTED-PRESENTATION
915 FORMAT-CHILDREN TABLE-PANE-NUMBER TEXT-STYLE-CHARACTER-WIDTH
916 PORT-MIRROR-HEIGHT PORT-MIRROR-WIDTH SCROLL-EXTENT TEXT-STYLE-CHARACTER-WIDTH
917 FRAME-EVENT-QUEUE FRAME-EXIT PANE-FRAME
918 ALLOCATE-SPACE COMPOSE-SPACE FIND-INNERMOST-APPLICABLE-PRESENTATION
919 HIGHLIGHT-PRESENTATION-1 PANE-DISPLAY-FUNCTION PANE-DISPLAY-TIME PANE-NAME
920 PRESENTATION-OBJECT PRESENTATION-TYPE SPACE-REQUIREMENT-HEIGHT
921 SPACE-REQUIREMENT-WIDTH THROW-HIGHLIGHTED-PRESENTATION WINDOW-CLEAR
922 (SETF GADGET-MAX-VALUE) (SETF GADGET-MIN-VALUE) (SETF SCROLL-BAR-THUMB-SIZE)
923 SLOT-ACCESSOR-NAME::|CLIM-INTERNALS CLIENT slot READER| DRAW-EDGES-LINES*
924 FORMAT-CHILDREN GADGET-VALUE MAKE-MENU-BAR TABLE-PANE-NUMBER
925
926 ||#

  ViewVC Help
Powered by ViewVC 1.1.5