AdjustColorStd.mesa
Copyright © 1984 by Xerox Corporation. All rights reserved.
This module maintains a Viewer Tool with sliders capable of attachment to hardware knobs. A facility is provided to allow various run-time-selectable modules to control the color maps as a function of those knobs.
Created Saturday, September 8, 1984 10:35 pm PDT
Last edited by Eric Nickell, December 17, 1985 3:53:27 pm PST
DIRECTORY
AdjustColor USING [ByeProc, Color, Flavor, TRC],
Rope USING [ROPE]
;
AdjustColorStd: CEDAR DEFINITIONS = BEGIN
Color: TYPE ~ AdjustColor.Color;
TRC: TYPE ~ AdjustColor.TRC;
Flavor: TYPE ~ AdjustColor.Flavor;
StdAdjuster: TYPE ~ REF StdAdjusterRec;
StdAdjusterRec: TYPE ~ RECORD [
flavor: Flavor,
doc: Rope.ROPE,  --Intended for the message Window
setProc: SetProc ← NIL,  --Establishes TRC when controls change
byeProc: ByeProc ← NIL,  --Called when client loses control
private: REFNIL,  --Implementation data
clientData: REFNIL
];
Control: TYPE ~ {dark, contrast, white, black};
Setting: TYPE ~ REAL;  --Constrained in range [0.0 .. 1.0];
Settings: TYPE ~ ARRAY Control OF Setting;
SetProc: TYPE ~ PROC [settings: Settings, whatChanged: ARRAY Control OF BOOL, old: REF TRCNIL] RETURNS [trc: REF TRC];
ByeProc: TYPE ~ AdjustColor.ByeProc;
DuplicateName: ERROR;
NoSuchName: ERROR;
RegisterStdAdjuster: PROC [adjuster: StdAdjusterRec, initialSettings: Settings ← ALL[.5]];
RequestControl: PROC [flavor: Flavor] RETURNS [granted: BOOLEAN];
! NoSuchName
ClientDataForName: PROC [flavor: Flavor] RETURNS [clientData: REF];
! NoSuchName
CurrentTRC: PROC RETURNS [trc: REF TRC];
NormalizeAdjustments: PROC;
Normalize adjustments of currently selected TRC
SetAdjustments: PROC [settings: Settings];
Set adjustments of currently selected TRC
END.