-- UserTerminal.mesa (last edited by: McJones on: September 2, 1980 2:58 PM)

DIRECTORY
BitBlt USING [BBTable];

UserTerminal: DEFINITIONS =
BEGIN

-- Types

Coordinate: TYPE = MACHINE DEPENDENT RECORD [x, y: INTEGER];
CursorArray: TYPE = ARRAY [0..16) OF WORD;

State: TYPE = {on, off, disconnected};
Background: TYPE = {white, black};

-- Errors

BitmapIsDisconnected: ERROR; -- only raised by GetBitBltTable

-- Constants (modulo display hardware)

screenWidth: READONLY CARDINAL[0..32767];
screenHeight: READONLY CARDINAL[0..32767];
pixelsPerInch: READONLY CARDINAL;

-- Keyboard, mouse and cursor memory locations

keyboard: READONLY LONG POINTER TO READONLY ARRAY OF WORD;
mouse: READONLY LONG POINTER TO READONLY Coordinate;
cursor: READONLY LONG POINTER TO Coordinate;

-- Mouse & cursor functions available only through procedures

SetMousePosition: PROCEDURE [newMousePosition: Coordinate];

SetCursorPattern: PROCEDURE [cursorPattern: CursorArray];
GetCursorPattern: PROCEDURE RETURNS [cursorPattern: CursorArray];

-- Bitmap functions

WaitForScanLine: PROCEDURE [scanLine: INTEGER];

SetBorder: PROCEDURE [oddPairs, evenPairs: [0..377B]];
hasBorder: READONLY BOOLEAN;

BlinkDisplay: PROCEDURE;
GetBackground: PROCEDURE RETURNS [background: Background];
SetBackground: PROCEDURE [new: Background] RETURNS [old: Background];

GetState: PROCEDURE RETURNS [state: State];
SetState: PROCEDURE [new: State] RETURNS [old: State];

GetBitBltTable: PROCEDURE RETURNS [bbt: BitBlt.BBTable];

END.