Page 163 Table of Contents Index Page 165
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 17. TABLE FORMATTING

item on the stream. printer has dynamic extent. The default for printer is prin1.
presentation-type is a presentation-type. When printer is not supplied, the items will be printed
as if printer were
 
 #'(lambda (item stream)
     (present item presentation-type :stream stream))
When printer is supplied, each item will be enclosed in a presentation whose type is presentation-
type
.

x-spacing, y-spacing, n-columns, n-rows, max-width, max-height, initial-spacing, and move-cursor
are as for formatting-item-list.

cell-align-x and cell-align-y are used to supply :align-x and :align-y to an implicitly used
formatting-cell.

record-type is as for formatting-item-list.

17.3 The Table and Item List Formatting Protocols

Both table and item list formatting is implemented on top of the basic output recording protocol,
using with-new-output-record to specify the appropriate type of output record. For example,
formatting-table first collects all the output that belongs in the table into a collection of
row, column, and cell output records, all of which are children of a single table output record.
During this phase, stream-drawing-p is bound to nil and stream-recording-p is bound to
t. When all the output has been generated, the table layout constraint solver (adjust-table-
cells
or adjust-item-list-cells) is called to compute the table layout, taking into account
such factors as the widest cell in a given column. If the table is to be split into multiple columns,
adjust-multiple-columns is now called. Finally, the table output record is positioned on the
stream at the current text cursor position and then displayed by calling replay on the table (or
item list) output record.

17.3.1 Table Formatting Protocol

Any output record class that implements the following generic functions is said to support the
table formatting protocol.

In the following subsections, the term "non-table output records" will be used to mean any
output record that is not a table, row, column, cell, or item list output record. When CLIM
"skips over intervening non-table output records", this means that it will bypass all the output
records between two such table output records (such as a table and a row, or a row and a
cell) that are not records of those classes (most notably, presentation output records). CLIM
implementations are encouraged to detect invalid nesting of table output records, such as a row


Page 163 Table of Contents Index Page 165
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