GriffinControllerImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Created by: Maureen Stone, May 2, 1981 12:41 PM
Edited by: Stone, July 13, 1983 6:29 pm
Last Edited by: Ken Pier, October 5, 1985 2:38:57 pm PDT
DIRECTORY
GriffinController,
GriffinStyle USING [Color],
Real USING [RoundC];
GriffinControllerImpl: CEDAR PROGRAM
IMPORTS Real
EXPORTS GriffinController = BEGIN
ControllerError: PUBLIC SIGNAL = CODE;
PixelsToMicas: REAL = 32.0;
ControlPair: TYPE = RECORD [next: ControlPairHandle, color: GriffinStyle.Color, grey: [0 .. 255]];
lControlPair: CARDINAL = SIZE [ControlPair];
ControlPairHandle: TYPE = REF ControlPair;
firstControlPair, lastControlPair: ControlPairHandle ← NIL;
hController: GriffinController.HardcopyController;
dController: GriffinController.DisplayController;
SetHardcopyController: PUBLIC PROCEDURE [hc: GriffinController.HardcopyController] = { NULL; -- use only DefaultControllers
};
SetDisplayController: PUBLIC PROCEDURE [dc: GriffinController.DisplayController] = { NULL; -- use only DefaultControllers
};
ReadDisplayController: PUBLIC PROCEDURE RETURNS [GriffinController.DisplayController] = { RETURN [dController] };
ReadHardcopyController: PUBLIC PROCEDURE RETURNS [GriffinController.HardcopyController] = { RETURN [hController] };
DefaultControllers: PUBLIC PROCEDURE = {
c: ControlPairHandle;
set up the conversion from alto pixels to micas (press)
PixelsToMicas ← 635; PixelsToMicas ← PixelsToMicas/18;
this section resets the hardcopy controller data
hController ← [hxcenter: (586/2)*PixelsToMicas, hycenter: ((694/2)+68)*PixelsToMicas, hwidth: 586*PixelsToMicas, hheight: 674*PixelsToMicas, pressxcenter: Real.RoundC[(586/2)*PixelsToMicas], pressycenter: Real.RoundC[((694/2)+68)*PixelsToMicas], hscale: 1];
this section resets the display controller data
dController ← [dxcenter: 586/2, dycenter: (694/2)+68, dwidth: 586, dheight: 674, dxscale: 1.0/PixelsToMicas, dyscale: 1.0/PixelsToMicas, dxorigin: 0, dyorigin: 0, dgridsize: 8];
UNTIL firstControlPair = NIL DO
c ← firstControlPair.next;
firstControlPair.next ← NIL;
firstControlPair ← c;
ENDLOOP;
};
ForAllControlPairs: PUBLIC PROCEDURE [proc: PROC [h, s, v: [0 .. 255], grey: [0 .. 255]]] = {
NULL;
};
END.