Page 226 Table of Contents Index Page 228
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E



CHAPTER 23. PRESENTATION TYPES

define-presentation-translator will be stored in the command table command-table.

gesture is a gesture name that names a pointer gesture (described in Section 22.3). The body
of the translator will be run only if the translator is applicable and gesture used by the user
matches the gesture name in the translator. (We will explain applicability, or matching, in detail
below.) gesture defaults to :select.

tester is either a function or a list of the form
(tester-arglist . tester-body)
where tester-arglist takes the same form as arglist (see below), and tester-body is the body of
the tester. The tester must return either true or false. If it returns false, then the translator
is definitely not applicable. If it returns true, then the translator might be applicable, and the
body of the translator might be run (if tester-definitive is false) in order to definitively decide
if the translator is applicable (this is described in more detail below). If no tester is supplied,
CLIM supplies a tester that always returns true.

When the boolean tester-definitive is true, the body of the translator will never be run in order to
decide if the translator is applicable, that is, the tester is assumed to definitively decide whether
the translator applies. The default for tester-definitive is false. When there is no explicitly
supplied tester, the tester supplied by CLIM is assumed to be definitive.

Both documentation and pointer-documentation are objects that will be used for documenting
the translator. pointer-documentation will be used to generate documentation for the pointer
documentation window; the documentation generated by pointer-documentation should be very
brief and computing it should be very fast and preferably not cons. documentation is used to
generate such things as items in the :menu-gesture menu. If the object is a string, the string
itself will be used as the documentation. Otherwise, the object must be the name of a function
or a list of the form
(doc-arglist . doc-body)
where doc-arglist takes the same form as arglist, but includes a named (keyword) stream argu-
ment as well (see below), and doc-body is the body of the documentation function. The body
of the documentation function should write the documentation to stream. The default for docu-
mentation
is nil, meaning that there is no explicitly supplied documentation; in this case, CLIM
is free to generate the documentation in other ways. The default for pointer-documentation is
documentation.

menu must be t or nil. When it is t, the translator will be included in the :menu-gesture menu
if it matches. When it is nil, the translator will not be included in the :menu-gesture menu.
Other non-nil values are reserved for future extensions to allow multiple presentation translator
menus.

priority is either nil (the default, which corresponds to 0) or an integer that represents the
priority of the translator. When there are several translators that match for the same gesture,
the one with the highest priority is chosen.

arglist, tester-arglist, and doc-arglist are each an argument list that must "match" the following
"canonical" argument list.
(object &key presentation context-type frame event window x y)
In order to "match" the canonical argument list, there must be a single positional argument
that corresponds to the presentation's object, and several named arguments that must match


Page 226 Table of Contents Index Page 228
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E