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; 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]; 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. ΒGriffinControllerImpl.mesa Copyright c 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 set up the conversion from alto pixels to micas (press) PixelsToMicas _ 635; PixelsToMicas _ PixelsToMicas/18; this section resets the hardcopy controller data this section resets the display controller data Κ0˜codešœ™Kšœ Οmœ1™