Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
TermAttributes


NAME

TermAttributes - support of display attributes on ASCII terminals

SYNOPSIS

(* attributes *)
CONST standout = 0;
CONST underline = 1;
CONST reverse = 2;
CONST blink = 3;
CONST dim = 4;
CONST bold = 5;
CONST attributes = 6;
(* errorcodes *)
CONST unknownAttribute = 0;
CONST notSupported = 1;
CONST errorcodes = 2;


TYPE AttributeSet = SET; (* of attributes *) TYPE SetProc = PROCEDURE (s: Streams.Stream; atts: AttributeSet); TYPE Interface = POINTER TO InterfaceRec; TYPE InterfaceRec = RECORD (Objects.ObjectRec) set: SetProc; END; TYPE ErrorEvent = POINTER TO ErrorEventRec; TYPE ErrorEventRec = RECORD (Events.EventRec) errorcode: SHORTINT; END;

PROCEDURE Init(s: Streams.Stream; available: AttributeSet; if: Interface); PROCEDURE Set(s: Streams.Stream; attributes: AttributeSet); PROCEDURE Current(s: Streams.Stream): AttributeSet; PROCEDURE Available(s: Streams.Stream): AttributeSet;

DESCRIPTION

TermAttributes adds support of display attributes on ASCII terminals. Display attributes are used on character-based displays to highlight selected characters when they appear on the screen. More than one attribute can be active at the same time. Following attributes are supported by the abstraction:

standout
standout mode is the standard mode to highlight selected characters. On many terminals it's a combination of one or more of the other attributes.
underline
underline character
reverse
reverse fore- and background colour of character
blink
make character blink at a certain frequency
dim
draw character with less intensity
bold
draw character bold or with more intensity

Init has to be called by the underlying terminal implementation with the interface specified by if and the available attributes in set.

Set makes attributes the active set.

Current returns the set of attributes currently in use.

Available returns the set of available attributes.

DIAGNOSTICS

Errors are converted to events of type error which are passed to RelatedEvents for further handling. Following errorcodes are currently implemented:
unknownAttribute
an attribute to be set with Set is not supported by the terminal.
notSupported
the terminal does not support attributes.

SEE ALSO

Streams
abstraction for byte oriented input and output
Terminals
abstraction for terminals

AUTHOR

Ralf Beck
Edited by: rbeck, last change: 1996/01/09, revision: 1.6, converted to HTML: 1997/04/28

Oberon || Library || Module Index || Search Engine || Definition || Module