<< JunoGraphics.mesa>> <<>> <> <> <> << TO FIX:>> << callers: replace SetpaintMode by SetColor[invert].>> << callers: Blink, ViewerToJuno, JunoToViewer, StartImageViewer, imageViewer have moved to JunoUserEvents.>> DIRECTORY Imager USING [Trajectory, Color], Graphics USING [Context], JunoStorage USING [Coords, IntCoords], ViewerClasses USING [Viewer], Rope USING [ROPE]; JunoGraphics: DEFINITIONS = BEGIN OPEN Rope, Stor: JunoStorage; << - - - - TYPES>> Coords: TYPE = Stor.Coords; -- Juno coordinates (big points from bottom left corner of buffer) IntCoords: TYPE = Stor.IntCoords; -- same as above, rounded to nearest integer for speed Trajectory: TYPE = Imager.Trajectory; PaintMode: TYPE = {opaque, invert}; Color: TYPE = Imager.Color; Viewer: TYPE = ViewerClasses.Viewer; << - - - - GRAPHICS STATE>> black, white, invert: READONLY Color; currentColor: READONLY Color; currentEnds: READONLY ATOM; -- $round, $butt, $square currentWidth: READONLY REAL; -- line width for draw command (juno units) currentFontName: READONLY ROPE; -- "Helvetica", "Times", etc currentFontSize: READONLY REAL; -- in big points currentFontFace: READONLY ATOM; -- $regular, $italic, $bold, $boldItalic currentJustification: READONLY ATOM; -- $left, $center, $right (affects DrawRope) currentPictureWidth: READONLY INTEGER; -- current picture dimensions (Juno units) currentPictureHeight: READONLY INTEGER; caretOn: READONLY BOOL; -- if TRUE, caret is supposed to be blinking on the image viewer caretPos: READONLY Coords; -- current caret position, in Juno coordinates << - - - - CHANGING THE GRAPHIC STATE>> SetScreenContext: PUBLIC PROC; <> <<(or, rather, an internal bitmap that is periodically copied onto the screen) >> <> SetPaperContext: PUBLIC PROC [device: ATOM, fileName: Rope.ROPE, mag: REAL _ 1.0]; <> <> <> SetPictureSize: PUBLIC PROC [width, height: INTEGER]; <> <> SetColor: PUBLIC PROC [color: Color] RETURNS [old: Color]; IntensityToColor: PUBLIC PROC [intensity: REAL] RETURNS [color: Color]; RGBToColor: PUBLIC PROC [r, g, b: REAL] RETURNS [color: Color]; SetEnds: PUBLIC PROC [ends: ATOM] RETURNS [old: ATOM]; SetWidth: PUBLIC PROC [width: REAL] RETURNS [old: REAL]; SetFontName: PUBLIC PROC [name: ROPE] RETURNS [old: ROPE]; SetFontSize: PUBLIC PROC [size: REAL] RETURNS [old: REAL]; SetFontFace: PUBLIC PROC [face: ATOM] RETURNS [old: ATOM]; SetJustification: PUBLIC PROC [justification: ATOM] RETURNS [old: ATOM]; SetCaret: PUBLIC PROC [on: BOOL _ TRUE, coords: Coords _ [0,0]]; <> << If on=TRUE, the caret is turned on (if not yet on). If on=FALSE, the caret is turned off (of not already off) >> << - - - - IMAGE BLANKING>> Whiten: PUBLIC PROC; <> << - - - - POINT HIGHLIGHTS (AFFECTS SCREEN IMAGE ONLY)>> PointSymbol: TYPE = {dot, plus, cross, box, diamond, bigDot}; Hilyte: PUBLIC PROC[coords: Coords, symbol: PointSymbol]; <> <> << - - - - POINTS>> DrawPoint: PUBLIC PROC[coords: Coords]; <> << - - - - LINES, STROKES, FILLED PATHS>> << These procedures draw a straight lines or bezier arc from p.coords to q.coords.>> <<>> <> <> DrawEdge: PUBLIC PROC [p, q: Coords, thin: BOOL _ TRUE]; DrawArc: PUBLIC PROC [p, r, s, q: Coords, thin: BOOL _ TRUE]; AppendEdge: PUBLIC PROC [t: Trajectory, p, q: Coords] RETURNS [new: Trajectory]; AppendArc: PUBLIC PROC [t: Trajectory, p, r, s, q: Coords] RETURNS [new: Trajectory]; FillTrajectory: PUBLIC PROC [t: Trajectory]; <> StrokeTrajectory: PUBLIC PROC [t: Trajectory]; <> GcTrajectory: PUBLIC PROC [t: Trajectory]; <> << - - - - CHARS AND ROPES>> DrawChar: PUBLIC PROC [coords: Coords, char: CHAR]; <> DrawRope: PUBLIC PROC [coords: Coords, rope: ROPE]; <> <> GetRopeDispl: PUBLIC PROC[rope: ROPE] RETURNS [vec: Coords]; <> << - - - - VIEWER/JUNO COORDINATE MAPPING>> ViewerToJuno: PROC [viewer: Viewer, view: IntCoords] RETURNS [coords: IntCoords]; <> JunoToViewer: PROC [viewer: Viewer, coords: Coords] RETURNS [view: IntCoords]; <> << - - - - BUFFER PAINTING PROC>> picChanged: READONLY BOOL; <> PaintBuffer: PUBLIC PROC [viewer: Viewer, context: Graphics.Context, viewerChanged: BOOL]; <> END.