CDColors.mesa (Viewer definitions for ChipNDale)
Copyright © 1984, 1986 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, September 19, 1984 6:00:17 pm PDT
Last edited by: Christian Jacobi, October 20, 1986 10:05:35 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 = RECORD [
bricks: REF ARRAY CD.Layer OF REF Brick,
filter: REF CD.ContextFilter,
cols: REF ARRAY CD.Layer OF Imager.Color
];
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)
DefineColor: PROC[
layer: 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.
DefineIColor: PROC [
layer: CD.Layer,
col: Imager.Color ← NIL,
display: DisplayType ← bw,
mode: DisplayMode ← normal,
table: REF ColorDefinition ← NIL --NIL uses the global table
];
--Defining color filters for either display.
--A NIL color makes a layer invisible.
END.