Page 136 Table of Contents Index Page 138
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 15. EXTENDED STREAM OUTPUT


15.3.2 Stream Text Cursor Protocol

The following generic functions comprise the stream text cursor protocol. Any extended output
stream class must implement methods for these generic functions.

=> stream-text-cursor stream [Generic Function]
=> (setf stream-text-cursor) cursor stream [Generic Function]

Returns (or sets) the text cursor object for the stream stream.

=> stream-cursor-position stream [Generic Function]
Returns the current text cursor position for the extended output stream stream as two integer
values, the x and y positions.

=> (setf* stream-cursor-position) x y stream [Generic Function]
Sets the text cursor position of the extended output stream stream to x and y. x and y are in
device units, and must be integers.

=> stream-increment-cursor-position stream dx dy [Generic Function]
Moves the text cursor position of the extended output stream stream relatively, adding dx to the
x coordinate and dy to the y coordinate. Either of dx or dy may be nil, meaning the the x or y
cursor position will be unaffected. Otherwise, dx and dy must be integers.

15.4 Text Protocol

The following generic functions comprise the text protocol. Any extended output stream class
must implement methods for these generic functions.

=> stream-character-width stream character &key text-style [Generic Function]
Returns a rational number corresponding to the amount of horizontal motion of the cursor
position that would occur if the character character were output to the extended output stream
stream in the text style text-style (which defaults to the current text style for the stream). This
ignores the stream's text margin.

=> stream-string-width stream character &key start end text-style [Generic Function]
Computes how the cursor position would move horizontally if the string string were output to
the extended output stream stream in the text style text-style (which defaults to the current text
style for the stream) starting at the left margin. This ignores the stream's text margin.

The first returned value is the x coordinate that the cursor position would move to. The second
returned value is the maximum x coordinate the cursor would visit during the output. (This is
the same as the first value unless the string contains a #\Newline character.)


Page 136 Table of Contents Index Page 138
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