ColorDisplay.mesa
Mik Lamming - February 10, 1984 2:32:16 pm PST
Last Edited by: Pier, February 17, 1984 2:03:00 pm PST
Last Edited by Eric Nickell, April 1, 1985 4:51:41 am PST
ColorDisplay:
CEDAR
DEFINITIONS
~ {
ScreenPos: TYPE ~ WindowManager.ScreenPos;
CDState:
TYPE ~
RECORD [
on, onLeft: BOOLEAN,
bpp: CARDINAL,
monitorType: Rope.ROPE
];
SetColorDisplayStatus:
PROC [on:
BOOLEAN ← DefaultOn[], onLeft:
BOOLEAN ← DefaultOnLeft[], bpp:
CARDINAL ← DefaultBpp[], monitorType: Rope.
ROPE ← DefaultMonitorType[]];
Philosophy of SetColorDisplayStatus:
There are four arguments of significance to the color display:
on Whether or not the display is on
onLeft Whether it is on the left side or the right
bpp Bits Per Pixel (or Point)
monitorType ... (Only "640x480" and "1024x768" have special significance)
The SetColorDisplayStatus proc has been set up so that all arguments can be defaulted, and the defaults will be
1. The current state of the display, if the display is on.
2. The last known state of that parameter, if the display is off.
The known state is set whenever any procedure in this module is called.
The initial values for the `known' state are set to
3. The value found in the User Profile, if an entry exists (see ColorDisplayDoc.tioga)
4. The following values, if there is no User Profile entry:
onLeft: TRUE
bpp: 8
monitorType "640x480"
GetColorDisplayStatus:
PROC
RETURNS [on:
BOOLEAN, onLeft:
BOOLEAN, bpp:
CARDINAL, monitorType: Rope.
ROPE];
Philosophy of GetColorDisplayStatus:
on, of course, tells you whether or not the color display is on.
onLeft and bpp are determined as follows:
1. If the display is on, then they are the actual state of the display
2. Otherwise, they are the last known state, or the default state.
monitorType is the last set (or default) value of monitorType.
GetColorDisplayProfile:
PROC
RETURNS [on:
BOOLEAN, onLeft:
BOOLEAN, bpp:
CARDINAL, monitorType: Rope.
ROPE];
Philosophy of GetColorDisplayProfile:
For each parameter, if there is an entry in the User Profile, it returns that value.
Otherwise, it returns the current or last known state of that parameter.
CDNotifyProc: TYPE ~ PROC [old, new: CDState];
RegisterCDNotifyProc:
PROC [proc: CDNotifyProc];
Allows a client to be called with a FORKed process whenever anyone a change is noticed in the color display status.
SleepColorDisplay:
PROC [ticks: Process.Ticks];
Turns off the color display (without deallocating the screen or affecting the viewers) for so many ticks. Mostly used as a hack to speed processing while the color display would normally be on.
The Procs below here are private. They return the same info as GetColorDisplayStatus. The only reason they are here is to provide defaults to the SetColorDisplayStatus proc in the interface, since CEDAR didn't seem to make that easy any other way.
DefaultOn: PRIVATE PROC RETURNS[BOOLEAN];
DefaultOnLeft: PRIVATE PROC RETURNS[BOOLEAN];
DefaultBpp: PRIVATE PROC RETURNS [CARDINAL];
DefaultMonitorType: PRIVATE PROC RETURNS [Rope.ROPE];
}.