Page 107 Table of Contents Index Page 109
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 12. GRAPHICS

and height is copied. from-x, from-y, to-x, and to-y are specified in user coordinates. (If sheet is
a medium or a stream, then sheet-x and sheet-y are transformed by the user transformation.)

=> with-output-to-pixmap (medium-var sheet &key width height) &body body [Macro]
Binds medium-var to a "pixmap medium", that is, a medium that does output to a pixmap
with the characteristics appropriate to the sheet sheet, and then evaluates body in that context.
All the output done to the medium designated by medium-var inside of body is drawn on the
pixmap stream. The pixmap medium must support the medium output protocol, including all of
the graphics function. CLIM implementations are permitted, but not required, to have pixmap
mediums support the stream output protocol (write-char and write-string).

width and height are integers that give the width and height of the pixmap. If they are unsupplied,
the result pixmap will be large enough to contain all of the output done by body.

medium-var must be a symbol; it is not evaluated.

The returned value is a pixmap that can be drawn onto sheet using copy-from-pixmap.

12.7 Graphics Protocols

Every medium must implement methods for the various graphical drawing generic functions. Fur-
thermore, every sheet that supports the standard output protocol must implement these methods
as well; often, the sheet methods will trampoline to the methods on the sheet's medium. All of
these generic functions take the same arguments as the non-generic spread function equivalents,
except the arguments that are keyword arguments in the non-generic functions are positional
arguments in the generic functions.

Every port must implement methods for the various graphical drawing generic functions. All of
these generic functions take as (specialized) arguments the port and medium, followed by the
drawing function-specific arguments, followed by the ink, line style (or text style), and clipping
region.

The drawing function-specific arguments will either be x and y positions, or a sequence of x
and y positions. These positions will be in medium coordinates, and must be transformed by
applying the medium's device transformation in order to produce device coordinates. Note that
the user transformation will have already been applied to the positions when the port-specific
drawing function is called.

The ink, line style (or text style), and clipping regions arguments are optional, and default
from the medium (medium-ink, medium-line-style (or medium-current-text-style), and
medium-clipping-region, respectively). Each port method will decode the ink, line (or text)
style, and clipping region in a port-specific way and communicate it to the underlying port.

Minor issue: Do we need to specify define-graphics-generic and define-graphics-method,
or whatever, so that the graphics protocol is easier to extend? Such things should also help define
the hooks into output recording. | SWM


Page 107 Table of Contents Index Page 109
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