| Common Lisp Streams | Contents | Index | Changes from CLIM 1.0 |
35 Suggested Extensions to CLIM
This appendix describes some suggested extensions to CLIM. Conforming CLIM
implementations need not implement any of these extensions. However, if a CLIM
implementation chooses to implement any of this functionality, it is suggested
that is conform to the suggested API.
All of the symbols documented in this appendix should be accessible as external symbols in the clim package.
35.1 Support for PostScript Output
CLIM implementations may choose to implement a PostScript back-end. Such a
back-end must include a medium that supports CLIM's medium protocol, and should
support CLIM's output stream protocol as well.
| with-output-to-postscript-stream | (stream-var file-stream &key device-type multi-page scale-to-fit orientation header-comments) &body body | [Macro] |
device-type is a symbol that names some sort of PostScript display device. Its default value is unspecified, but must be a useful display device type for the CLIM implementation.
multi-page is a boolean that specifies whether or not the output should be broken into multiple pages if it is larger than one page. How the output is broken into multiple pages, and how these multiple pages should be pieced together is unspecified. The default is nil .
scale-to-fit is a boolean that specifies whether or not the output should be scaled to fit on a single page if it is larger than one page. The default is nil . It is an error if multi-page and scale-to-fit are both supplied as true .
orientation may be one of :portrait (the default) or :landscape . It specifies how the output should be oriented.
header-comments allows the programmer to specify some PostScript header comment fields for the resulting PostScript output. The value of header-comments is a list consisting of alternating keyword and value pairs. These are the supported keywords:
| new-page | stream | [Function] |
35.2 Support for Reading Bitmap Files
CLIM implementations may supply some functions that read standard bitmap and
pixmaps files. The following is the suggested API for such functionality.
| read-bitmap-file | type pathname &key | [Generic function] |
read-bitmap-file may take keyword arguments to provide further information to the method decoding the bitmap file.
For example, a CLIM implementation might support an :x11 type. read-bitmap-file could take a format keyword argument, whose value can be either :bitmap or :pixmap .
read-bitmap-file will return two values. The first is a 2-dimensional array of ``pixel'' values. The second is a sequence of CLIM colors (or nil if the result is a monochrome image).
| make-pattern-from-bitmap-file | pathname &key type designs &allow-other-keys | [Function] |
designs is a sequence of CLIM designs (typically color objects) that will be used as the second argument in a call to make-pattern . designs must be supplied if no second value will be returned from read-bitmap-file .
make-pattern-from-bitmap-file will pass any additional keyword arguments
along to read-bitmap-file .
| Common Lisp Streams | Contents | Index | Changes from CLIM 1.0 |