You may return to the Cvo Object Documenation Index from this document. This document contains the following sections describing the Cvo_Text object:
Cvo_Text
Cvo_CRT
#include
<Cvo/Text.h++>
Cvo_Text ( char *resource_name,
{ Cvo_Object *parent | Display *display } )
The Cvo_Text object is a Cvo_CRT derived object with an interface
similar to that of the C/C++ stdio
interface. The Cvo_Text object
also provides some standard ANSI escape sequences for controlling the
cursor position and other features.
The ANSI codes which the Cvo_Text object understands are:
^[ ^G Display Visual Bell.
^[ $ c Change to character set c (deferred).
^[ ( c Change to character set c (deferred).
^[ 7 Save current cursor position.
^[ 8 Restore cursor position.
^[ D Index one line.
^[ M Reverse index one line.
^[ [ @ Insert one character.
^[ [ n @ Insert n characters.
^[ [ A Move cursor up one line.
^[ [ n A Move cursor up n lines.
^[ [ B Move cursor down one line.
^[ [ n B Move cursor down n lines.
^[ [ C Move cursor forward one position.
^[ [ n C Move cursor forward n positions.
^[ [ D Move cursor backward one position.
^[ [ n D Move cursor backward n positions.
^[ [ H Move cursor home.
^[ [ r H Move cursor to row r.
^[ [ r ; c H Move cursor to row r, column c.
^[ [ J Clear to end of display.
^[ [ 0 J Clear to end of display.
^[ [ 1 J Clear to begining of display.
^[ [ 2 J Clear display.
^[ [ K Clear to end of line.
^[ [ 0 K Clear to end of line.
^[ [ 1 K Clear to begining of line.
^[ [ 2 K Clear line.
^[ [ L Insert one line.
^[ [ n L Insert n lines.
^[ [ M Delete one line.
^[ [ n M Delete n lines.
^[ [ P Delete one character.
^[ [ n P Delete n characters.
^[ [ m Restore graphics state.
^[ [ 0 m Restore graphics state.
^[ [ 7 m Set reverse video.
This object defines the following member functions in addition to those defined by its parent and ancestor objects.
Putc (
{ wchar_t | char } c )
Write the charcter c to the object's display area. If c is only the first character of a multibyte character, it will be spooled up, waiting for the rest of the bytes to be sent.
Puts (
{ wchar_t | char } *string )
Write the NULL
terminated array string to the object's
display area. Multibyte strings are first converted to wide
character strings. Partial multibyte characters are spooled up to
wait for the rest of the bytes.
Write (
{ wchar_t | char } *string,
int length )
Write length characters of the array string to the the object's display area. Multibyte strings are first converted to wide character strings. Partial multibyte characters are spooled up to wait for the rest of the bytes.
MoveCursor (
int row,
int column )
Move the cursor to the specified row and column.
Raw (
)
Cause newline characters to not imply a carriage return.
Cooked (
)
Cause newline characters to imply a carriage return.
VisualBell (
)
Flash the visual bell.
int NLines (
)
Return the number of lines in the Cvo_Text object's display area.
int NCols (
)
Return the average number of columns in the Cvo_Text object's display area.
This object modifies the following X resources which are used by its parent or other ancestors.
*CvoText*FontFamily
(new value:
Courier
)
*CvoText*Pad
(new value:
2
)
*CvoText*Sunken
(new value:
True
)
*CvoText*TabStop
(new value:
8
)
*CvoText.Cursor
(new value:
xterm
)
See the example source code for an example of how to use this object.
See the legend for information about the conventions used in this documentation.