DIRECTORY Basics USING [BITAND, BITOR], II USING [Color, ColorOperator, Context, Font, PathProc, PixelArray, Rectangle, Transformation, VEC], IIBackdoor USING [Clipper, IntKey, RealKey]; IIState: CEDAR DEFINITIONS IMPORTS Basics ~ BEGIN OPEN IIBackdoor, II; ChangeFlags: TYPE ~ RECORD [ T: BOOL _ FALSE, clipper: BOOL _ FALSE, font: BOOL _ FALSE, color: BOOL _ FALSE, priority: BOOL _ FALSE, unused: [0..3777B] _ 0 ]; notChanged: ChangeFlags ~ []; OrChangeFlags: PROC[c1, c2: ChangeFlags] RETURNS[ChangeFlags] ~ INLINE { RETURN[LOOPHOLE[Basics.BITOR[LOOPHOLE[c1], LOOPHOLE[c2]]]]; }; AndChangeFlags: PROC[c1, c2: ChangeFlags] RETURNS[ChangeFlags] ~ INLINE { RETURN[LOOPHOLE[Basics.BITAND[LOOPHOLE[c1], LOOPHOLE[c2]]]]; }; PersistentVariables: TYPE ~ RECORD [ cp: VEC _ [0, 0], -- current position, view coords correctMeasure: VEC _ [0, 0], -- target line measure for Correct, view coords correctMaskCount: INT _ 0, -- tally number of CorrectMask calls in pass 1 correctSum: VEC _ [0, 0], -- tally adjustable space from CorrectSpace calls in pass 1 correctMask: VEC _ [0, 0], -- space inserted by each CorrectMask call in pass 2 correctSpace: VEC _ [0, 0] -- adjustment factors for each CorrectSpace call in pass 2 ]; NonPersistentVariables: TYPE ~ RECORD [ changed: ChangeFlags _ notChanged, -- changes since np variables were saved priorityImportant: INT _ 0, -- if nonzero, priority of masks is important mediumSize: VEC _ [0, 0], -- size of medium, in meters fieldMin: VEC _ [0, 0], -- minimum x and y of field, in meters fieldMax: VEC _ [0, 0], -- maximum x and y of field, in meters noImage: INT _ 0, -- if nonzero, don't image masks strokeWidth: REAL _ 0, -- stroke width, client coords strokeEnd: INT _ 0, -- stroke end treatment strokeJoint: INT _ 0, -- stroke joint treatment underlineStart: REAL _ 0, -- starting x position for underline, client coords amplifySpace: REAL _ 1.0, -- multiplies width of amplified characters correctPass: INT _ 0, -- which pass, during Correct correctShrink: REAL _ 0.5, -- allowable space shrink correctTolerance: VEC _ [0, 0] -- tolerable deviation from correctMeasure, view coords ]; RasterData: TYPE ~ REF RasterDataRep; RasterDataRep: TYPE; State: TYPE ~ REF StateRep; StateRep: TYPE ~ RECORD [ changed: ChangeFlags _ notChanged, p: PersistentVariables _ [], -- persistent variables np: NonPersistentVariables _ [], -- non-persistent variables other than REFs below T: Transformation _ NIL, -- current transformation (mutable!) font: Font _ NIL, -- current "showVec" color: Color _ NIL, -- current color clipper: Clipper _ NIL, -- current clipping outline rasterData: RasterData _ NIL -- data for the common raster implementation ]; StateDoSave: PROC[context: Context, action: PROC, all: BOOL]; StateSetInt: PROC[context: Context, key: IntKey, val: INT]; StateSetReal: PROC[context: Context, key: RealKey, val: REAL]; StateSetT: PROC[context: Context, m: Transformation]; StateSetFont: PROC[context: Context, font: Font]; StateSetColor: PROC[context: Context, color: Color]; StateSetClipper: PROC[context: Context, clipper: Clipper]; StateGetInt: PROC[context: Context, key: IntKey] RETURNS[INT]; StateGetReal: PROC[context: Context, key: RealKey] RETURNS[REAL]; StateGetT: PROC[context: Context] RETURNS[Transformation]; StateGetFont: PROC[context: Context] RETURNS[Font]; StateGetColor: PROC[context: Context] RETURNS[Color]; StateGetClipper: PROC[context: Context] RETURNS[Clipper]; StateConcatT: PROC[context: Context, m: Transformation]; StateScale2T: PROC[context: Context, s: VEC]; StateRotateT: PROC[context: Context, a: REAL]; StateTranslateT: PROC[context: Context, t: VEC]; StateMove: PROC[context: Context, rounded: BOOL]; StateSetXY: PROC[context: Context, p: VEC]; StateSetXYRel: PROC[context: Context, v: VEC]; StateGetCP: PROC[context: Context, rounded: BOOL] RETURNS[VEC]; StateStartUnderline: PROC[context: Context]; StateMaskUnderline: PROC[context: Context, dy, h: REAL]; StateCorrectMask: PROC[context: Context]; StateCorrectSpace: PROC[context: Context, v: VEC]; StateSpace: PROC[context: Context, x: REAL]; StateSetCorrectMeasure: PROC[context: Context, v: VEC]; StateSetCorrectTolerance: PROC[context: Context, v: VEC]; StateCorrect: PROC[context: Context, action: PROC]; StateDontCorrect: PROC[context: Context, action: PROC, saveCP: BOOL]; StateSetGray: PROC[context: Context, f: REAL]; StateSetSampledColor: PROC[context: Context, pa: PixelArray, m: Transformation, colorOperator: ColorOperator]; StateSetSampledBlack: PROC[context: Context, pa: PixelArray, m: Transformation, clear: BOOL]; StateClip: PROC[context: Context, path: PathProc, oddWrap: BOOL, exclude: BOOL]; StateClipRectangle: PROC[context: Context, r: Rectangle, exclude: BOOL]; StateClipRectangleI: PROC[context: Context, x, y, w, h: INTEGER, exclude: BOOL]; END. πImagerState.mesa Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. Doug Wyatt, November 11, 1985 4:59:36 pm PST Michael Plass, August 22, 1986 4:05:27 pm PDT Contains no REFs, so can be copied with block transfers. ΚΕ˜codešœ™Kšœ Οmœ7™BKšœ,™,K™-—K™šΟk ˜ Kšœžœžœžœ˜KšœžœXžœ˜eKšœ žœ˜,—K˜KšΠblœžœž ˜Kšžœ˜Kšœžœžœ˜K˜šœ žœžœ˜Kšœžœžœ˜Kšœ žœžœ˜Kšœžœžœ˜Kšœžœžœ˜Kšœ žœžœ˜K˜K˜K˜—šœ˜K˜—šΟn œžœžœžœ˜HKš žœžœžœžœžœ˜;K˜K˜—š œžœžœžœ˜IKš žœžœžœžœžœ˜Kšœ žœ ‘&˜>Kšœ žœ‘ ˜2Kšœ žœ‘˜5Kšœ žœ‘˜+Kšœ žœ‘˜/Kšœžœ‘3˜MKšœžœ‘+˜EKšœ žœ‘˜3Kšœžœ‘˜4Kšœžœ ‘7˜VK˜Kšœ8™8K™—Kšœ žœžœ˜%šœžœ˜K˜—Kšœžœžœ ˜šœ žœžœ˜Kšœ"˜"Kšœ‘˜4Kšœ!‘1˜RKšœžœ‘$˜=Kšœ žœ‘˜&Kšœžœ‘˜$Kšœžœ‘˜3Kšœžœ‘,˜IK˜K˜—K˜Kš  œžœžœžœ˜=Kš  œžœ%žœ˜;Kš  œžœ&žœ˜>Kš  œžœ&˜5Kš  œžœ˜1Kš  œžœ!˜4Kš œžœ%˜:Kš  œžœ žœžœ˜>Kš  œžœ!žœžœ˜AKš  œžœžœ˜:Kš  œžœžœ˜3Kš  œžœžœ˜5Kš œžœžœ ˜9Kš  œžœ&˜8Kš  œžœžœ˜-Kš  œžœžœ˜.Kš œžœžœ˜0Kš  œžœžœ˜1Kš  œžœžœ˜+Kš  œžœžœ˜.Kš   œžœžœžœžœ˜?Kš œžœ˜,Kš œžœžœ˜8Kš œžœ˜)Kš œžœžœ˜2Kš  œžœžœ˜,Kš œžœžœ˜7Kš œžœžœ˜9Kš  œžœžœ˜3Kš œžœžœ žœ˜EKš  œžœžœ˜.Kš œžœU˜oKš œžœ>žœ˜^Kš  œžœ,žœ žœ˜PKš œžœ*žœ˜HKš œžœžœ žœ˜PK˜Kšžœ˜—…—Τ‰