Idle.mesa
last edited by Levin on December 12, 1983 3:09 pm
DIRECTORY
BasicTime USING [GMT, nullGMT];
Idle: CEDAR DEFINITIONS =
BEGIN
Sleep: PROC [
proc: ImageProc ← DefaultImageProc, powerOff: BasicTime.GMT ← BasicTime.nullGMT];
This procedure puts the user interface into a quiescent state. The normal display screen is replaced by a black one with a roving, client-selected image. Control-shift-shift (to change virtual terminals) and key combinations that invoke a debugger are disabled. When a key is pressed, the black screen disappears and the user is asked to log in. If the login fails, the terminal reverts to the quiescent state; if the login succeeds, Sleep returns to its caller after restoring the terminal to its state at the time of invocation.
`proc' provides the roving image. It is invoked every time Sleep chooses to change the coordinate position, which varies randomly between 0.25 and 2.0 seconds.
The 'powerOff' parameter, unless defaulted, specifies the time at which the processor is to be powered off.
ImageProc: TYPE = PROC [w, h: CARDINAL] RETURNS [BitmapRef];
The parameters of this procedure define a rectangle of the display bitmap that is available to hold an image. An ImageProc should generally return a BitmapRef with width <= w and height <= h; however, if these conditions are not met, Sleep will clip the bitmap as necessary. Note that the contents and dimensions of the bitmap may change from call to call of an ImageProc. The bits of the bitmap are inverted in the course of painting; that is, zeroes paint as black (to match the background) and ones paint as white.
Note that the following two types are structurally identical to the ones in GraphicsOps.
BitmapRef: TYPE = REF READONLY BitmapRep;
BitmapRep: TYPE = RECORD [
base: REF, -- pointer to bitmap bits
raster: CARDINAL, -- words per line (note: words, not bits)
width: CARDINAL, -- width in bits
height: CARDINAL -- height in lines
];
DefaultImageProc: ImageProc;
END.