CDColors.mesa (Viewer definitions for ChipNDale)
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, September 19, 1984 6:00:17 pm PDT
last edited by Christian Jacobi, September 19, 1985 11:46:25 am PDT
DIRECTORY
CD USING [Layer, ContextFilter],
Imager USING [Color];
-- ChipNDale interface defining low level color handling.
-- (semi-public)
CDColors: CEDAR DEFINITIONS =
BEGIN
DisplayType: TYPE = {bw, bit1, bit2, bit4, bit8, bit9};
--displays supported by ChipNDale (bits per pixel)
DisplayMode: TYPE = {normal, pushedOut}; --usage of brick
Brick: TYPE = ARRAY [0..4) OF CARDINAL; --brick, or'ed into a bitmap
ColorTable: TYPE = ARRAY CD.Layer OF REF Brick;
ColorTableSet: TYPE = ARRAY DisplayMode OF REF ColorTable;
ColorDefinition: TYPE = ARRAY DisplayType OF REF ColorTableSet;
globalColors: READONLY REF ColorDefinition;
--everything is readonly
--but this module causes changes to the REF Brick (not the Brick)
bwFilter: READONLY REF CD.ContextFilter;
--filter for black and white displays
colorFilter: READONLY REF CD.ContextFilter;
--filter for color displays
DefineColor: PROC[
lev: CD.Layer,
brick: REF Brick ← NIL, -- do no more change the values
display: DisplayType ← bw,
mode: DisplayMode ← normal,
table: REF ColorDefinition ← NIL --NIL uses the global table
];
--Defining a brick with mode normal also clears the pushedOut brick.
--A NIL brick makes a reasonable default.
--The procedure may exchange bricks if they have the same values.
DefineFilter: PROC[
lev: CD.Layer,
color: Imager.Color ← NIL,
colorDisplay: BOOLTRUE,
bwDisplay: BOOLFALSE
];
--Defining color filters for either display.
--A NIL color makes a layer invisible.
END.