ColorizeViewPoint.mesa
Copyright Ó 1988, 1989 by Xerox Corporation. All rights reserved.
Eric Nickell, May 17, 1989 6:35:24 pm PDT
Bob Coleman, July 16, 1989 11:12:58 pm PDT
DIRECTORY
Profiles USING [Profile],
Rope USING [ROPE];
ColorizeViewPoint: CEDAR DEFINITIONS
~ BEGIN
ROPE: TYPE ~ Rope.ROPE;
Warning: SIGNAL [class: ATOM, explanation: ROPE];
Error: ERROR [class: ATOM, explanation: ROPE];
class describes the general type of error (e.g., $MalformedPaletteEntry)
explanation is a user-readable ROPE describing the problem
In general, clients should RESUME Warning.
Do (or DoRope) and ExaminesTheseSettings should be the only things that top-level colorizer clients need. In particular, Do* should encapsulate the "current wisdom" of the best approach for colorizing an otherwise unknown interpress master.
Do: PROC [fromFile, toFile: ROPE, palette: Profiles.Profile, checkSystemSetting: CheckSystemSettingProc];
fromFile, toFile are file names
palette is a Profile which will be queried for color and rendering information
checkSystemSetting is a way to check settings maintained by the system.
Suggestion To Clients: If there is a route for a user-specific or document-specific Profile, we suggest that this be layered over both the palette profile and checkSystemSetting so that both color and control info can be changed per document.
DoRope: PROC [fromIP: ROPE, palette: Profiles.Profile, checkSystemSetting: CheckSystemSettingProc] RETURNS [toIP: ROPE];
fromIP, toIP are ROPEs containing the interpress tokens. They include the headers.
CheckSystemSettingProc: TYPE ~ PROC [key: ROPE, default: BOOL] RETURNS [BOOL];
Setting: TYPE ~ RECORD [key, description: ROPE, default: BOOL];
ExaminesTheseSettings: PROC RETURNS [LIST OF Setting];
Do (and DoRope) guarantee that they will not call checkSystemSetting with a ROPE which is not in ExaminesTheseSettings[], allowing clients of ColorizeViewPoint to know the universe of possible options.
The defaults returned in these settings are not used anywhere except to return to the client from ExaminesTheseSettings.
END.