DisplayControllerStepsImpl:
CEDAR
PROGRAM
EXPORTS DisplayControllerSteps
= {OPEN DisplayControllers, DisplayControllerSteps;
Where: TYPE = CharDisplays.Where;
Emph: TYPE = CharDisplays.Emph;
CarriageReturn:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] =
{dc.cd.class.CursorMove[dc.cd, 0, 0, FALSE, FALSE]};
Home:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] =
{dc.cd.class.CursorMove[dc.cd, 0, 0, FALSE]};
ScrollBack:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] = {
oldLine: INT ← dc.cd.line;
oldCol: INT ← dc.cd.col;
dc.cd.class.CursorMove[cd: dc.cd, line: dc.cd.det.lines-1, col: 0];
dc.cd.class.Line[dc.cd, FALSE];
dc.cd.class.CursorMove[cd: dc.cd, line: 0, col: 0];
dc.cd.class.Line[dc.cd, TRUE];
dc.cd.class.CursorMove[cd: dc.cd, line: oldLine, col: oldCol];
};
ClearScreen:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] = {
dc.cd.class.ClearAll[dc.cd];
dc.cd.class.CursorMove[dc.cd, 0, 0];
};
DeleteChar:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] =
{dc.cd.class.DeleteChar[dc.cd]};
UnderlineChar:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] = {
dc.cd.class.Emphasize[dc.cd, underline, TRUE];
dc.cd.class.CursorMove[dc.cd, 0, 1, TRUE];
};
ClrTo:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] =
{where: Where;
SELECT clientData
FROM
$eos => where ← EndOfScreen;
$eol => where ← EndOfLine;
ENDCASE => ERROR;
dc.cd.class.ClearTo[dc.cd, where]};
SkipCursor:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] =
{dLine, dCol: INT ← 0;
SELECT clientData
FROM
$down => dLine ← 1;
$up => dLine ← -1;
$right => dCol ← 1;
$left => dCol ← -1;
ENDCASE => ERROR;
dc.cd.class.CursorMove[dc.cd, dLine, dCol, TRUE]};
JumpCursor:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] =
{doLine, doCol: BOOL ← TRUE;
SELECT clientData
FROM
$h => doLine ← FALSE;
$v => doCol ← FALSE;
$hv => NULL;
ENDCASE => ERROR;
dc.cd.class.CursorMove[dc.cd, dc.cps.regs[line], dc.cps.regs[col], FALSE, doLine, doCol]};
Line:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] = {
insert:
BOOL ←
SELECT clientData
FROM
$ins => TRUE,
$del => FALSE,
ENDCASE => ERROR;
dc.cd.class.Line[dc.cd, insert]};
SetEmph:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] = {
emph: Emph;
on: BOOL;
SELECT clientData
FROM
$underlineOn => {emph ← underline; on ← TRUE};
$underlineOff => {emph ← underline; on ← FALSE};
$standout1On => {emph ← standout1; on ← TRUE};
$standout1Off => {emph ← standout1; on ← FALSE};
$standout2On => {emph ← standout2; on ← TRUE};
$standout2Off => {emph ← standout2; on ← FALSE};
ENDCASE => ERROR;
dc.cd.class.SetEmph[dc.cd, emph, on]};
InsertSpace:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] = {
line: INT ← dc.cd.line;
col: INT ← dc.cd.col;
dc.cd.class.TakeChar[dc.cd, Ascii.SP, TRUE];
dc.cd.class.CursorMove[dc.cd, 0, -1, TRUE];
};
Flash:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] =
{dc.cd.class.Flash[dc.cd]};
Tab:
PUBLIC
PROC [dc: DisplayController, clientData:
REF
ANY] = {
delta: INT ← (8 - (dc.cd.col MOD 8)) MOD 8;
SELECT clientData
FROM
$blanken => {
FOR i:
INT
IN [0 .. delta)
DO
dc.cd.class.TakeChar[dc.cd, Ascii.SP];
ENDLOOP;
};
$dontTouch => dc.cd.class.CursorMove[dc.cd, 0, delta, TRUE];
ENDCASE => ERROR;
};
}.