Modula-2 || Compiler & Tools || Library || Search Engine


Ulm's Modula-2 Library:
Attributes


NAME

Attributes - set terminal display attributes

SYNOPSIS

TYPE Attribute = (standout, underline, reverse, blink,
                  dim, bold, blank, protect, alternate);
TYPE AttributeSet = SET OF Attribute;
TYPE AttrInfo;


VAR Done: BOOLEAN;

PROCEDURE OpenAttrInfo(VAR atinfo: AttrInfo; VAR tinfo: Term; baudrate: CARDINAL; out: FILE); PROCEDURE CloseAttrInfo(VAR atinfo: AttrInfo); PROCEDURE AvailableAttributes(atinfo: AttrInfo; VAR atset: AttributeSet); PROCEDURE SetAttribute(atinfo: AttrInfo; at: Attribute); PROCEDURE SetAttributes(atinfo: AttrInfo; atset: AttributeSet); PROCEDURE ResetAttribute(atinfo: AttrInfo; at: Attribute); PROCEDURE ResetAttributes(atinfo: AttrInfo);

DESCRIPTION

Attributes allows to set display attributes on terminals as defined in the terminfo(4) database. OpenAttrInfo associates atinfo (which is to be given as reference on further calls) with a terminal description and an output file pointer. Padding depends on baudrate. If baudrate is zero no padding will be done. The terminal description tinfo must be non-local because Attributes does not copy it but keeps a pointer to it. The space associated with atinfo can be released by calling CloseAttrInfo. AvailableAttributes returns the set of supported attributes.

SetAttribute enters the given display mode. Characters written in the following are printed in this mode. This mode is potentially left in case of cursor movements or even on going to the next line. Multiple calls of SetAttribute can affect modes set earlier. SetAttributes should be used instead. ResetAttribute exits the display mode previously entered by SetAttribute. SetAttributes allows to set several modes simultaneously. But this does not work well on every terminal. ResetAttributes restores the terminal to a normal state without any display attributes set.

SEE ALSO

TermInfo interface to the terminfo(4) database
terminfo(4) terminfo database
Windows high-level interface to attributes

BUGS

Some terminals code display modes in one or more extra characters (represented as blanks on the screen). The number of extra characters used by these terminals is found in tinfo^.MagicCookieGlitch.
Edited by: borchert, last change: 1997/02/25, revision: 1.2, converted to HTML: 1997/04/28

Modula-2 || Compiler & Tools || Library || Search Engine