ColorMaps.mesa
Copyright © 1985, 1987 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, December 23, 1985 12:52:29 pm PST
Last edited by: Christian Jacobi, March 13, 1987 12:33:44 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 [name: Rope.ROPE, msgs: IO.STREAMNIL];
Sets up the colormap as specified in the file or registered type "name".
Some "name" values cause special functions, e.g: "Standard", or "off".
This feature is used to provide some standard entries in the color map menu.
msgs: place for feedback.
CreateFile: PROC [fileName: Rope.ROPE, special: REFNIL, msgs: IO.STREAMNIL];
Creates a file describing current color map entries.
LastFile: PROC [] RETURNS [fileName: Rope.ROPE];
Returns name of last file used successfully for set up.
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.
END.