Modula-2 || Compiler & Tools || Library || Search Engine
TYPE Screen; TYPE CursorVisibility = (normal, invisible, morevisible);
VAR Done: BOOLEAN;
PROCEDURE OpenScreen(VAR scr: Screen; outfp: StdIO.FILE; baudrate: CARDINAL; lines, columns: CARDINAL; terminal: ARRAY OF CHAR) : BOOLEAN; PROCEDURE OpenScreenTI(VAR scr: Screen; outfp: StdIO.FILE; baudrate: CARDINAL; lines, columns: CARDINAL; tinfo: TermInfo.Term); PROCEDURE InitScreen(scr: Screen; lines, columns: CARDINAL); PROCEDURE CloseScreen(VAR scr: Screen); PROCEDURE Lines(scr: Screen) : CARDINAL; PROCEDURE Columns(scr: Screen) : CARDINAL; PROCEDURE ClearScreen(scr: Screen); PROCEDURE SetCursor(scr: Screen; line, column: CARDINAL); PROCEDURE MoveCursor(scr: Screen; (* from *) line1, column1, (* to *) line2, column2: CARDINAL); PROCEDURE Scroll(scr: Screen; down: BOOLEAN; line, column: CARDINAL; lines, columns: CARDINAL); PROCEDURE ResetScrollRegions(scr: Screen); PROCEDURE SetCursorVisibility(scr: Screen; visibility: CursorVisibility);
CloseScreen deallocates the space used for scr but does not close the output file-pointer outfp which has been given to OpenScreen or OpenScreenTI.
Lines and Columns return the number of lines and columns of the given screen. If the associated capability is not set 1 is returned. ClearScreen clears the screen. SetCursor moves the cursor to the given position. Some optimizations (e.g. home position and last line) are done. MoveCursor takes line1 and column1 as the current position of the cursor and outputs an optimized sequence to move to line2 and column2.
Scroll scrolls a given window of a screen one line downward (down set to TRUE) or upward (forward). The window is defined by the upper left corner given by line and column and the number of lines and columns. The cursor position is undefined if successful.
ResetScrollRegions undoes all former settings for scroll regions and is useful in a sequence of operations to restore a terminal to a sane state. Note that this operation is not needed for any of the operations above except for cases of abnormal termination in the middle of a sequence that creates a scroll region temporarily.
The cursor visibility can be modified by calling SetCursorVisibility. Supported are normal, invisible, and morevisible.
TermInfo | interface to the terminfo database |
Windows | high-level interface |
Modula-2 || Compiler & Tools || Library || Search Engine