ColorMaps.mesa
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, December 23, 1985 12:52:29 pm PST
Last edited by: Christian Jacobi, December 28, 1986 8:03:31 pm PST
DIRECTORY
Rope USING [ROPE],
IO USING [STREAM];
ColorMaps: CEDAR DEFINITIONS =
BEGIN
Reading and writing colormap entries, using files in a simple format.
The following conventions enable independent applications to share the color display.
A package may change the colormap to its favorite specification, whenever the user declares his interest to the package by performing an appropriate interactive action.
In addition, a package may [but preferably does not] change the colormap once, at initialization time.
A package must never insist on color map specifications at random times, the user might be interested in an other application.
The user can interactively setup the color map at any time.
If an application requires only very few color map entries, it might be more appropriate to just require these entries with the standard module, instead of registering a whole color map with this package; this package leaves undefined color map entries free for the standard mechanism.
SetUp: PROC [fileName: Rope.ROPE, forceOn: BOOLTRUE, forceBits: BOOLTRUE, msgs: IO.STREAMNIL];
Sets up the colormap as specified in the file "fileName".
Some `fileName' values cause special functions, e.g: "Standard", or "off".
This feature is used to provide some standard entries in the color map menu.
forceOn: colordisplay is started first if necessary.
forceBits: colordisplay switches bits per pixel mode if necessary.
msgs: place for feedback.
LastFile: PROC [] RETURNS [fileName: Rope.ROPE];
Returns name of last file used successfully for set up.
Has8BitMode: PROC [setOn: BOOLFALSE] RETURNS [BOOL];
Returns whether the color display is available, and has 8 bit mode,
If setOn then returns whether it is already on and in 8 bit mode.
RegisterSetUp: PROC [entryName: Rope.ROPE, fileName: Rope.ROPENIL];
Offers to set up this file, when the standard color map menu is interactively invoked.
RegisterCallBack: PRIVATE PROC [p: PROC];
p will be called after any color map change caused through this package.
p must not cause recursive color map change.
CreateFile: PROC [fileName: Rope.ROPE, special: REFNIL, msgs: IO.STREAMNIL];
Creates a file describing current color map entries.
END.