DIRECTORY Imager, ImagerBasic, ImagerPrivate; ImagerDefault: CEDAR DEFINITIONS = BEGIN Context: TYPE = Imager.Context; FONT: TYPE = Imager.FONT; Color: TYPE = ImagerBasic.Color; IntPair: TYPE = ImagerBasic.IntPair; IntRectangle: TYPE = ImagerBasic.IntRectangle; Pair: TYPE = ImagerBasic.Pair; PathMapType: TYPE = ImagerBasic.PathMapType; PixelArray: TYPE = ImagerBasic.PixelArray; StrokeEnd: TYPE = ImagerBasic.StrokeEnd; Transformation: TYPE = ImagerBasic.Transformation; Visibility: TYPE = ImagerBasic.Visibility; Name: TYPE = ImagerPrivate.Name; State: TYPE = REF StateRep; StateRep: TYPE = RECORD[ -- persistent variables -- cpx, cpy: REAL, correctMX, correctMY: REAL, -- nonpersistent variables -- nps: NonPersistentState ]; NonPersistentState: TYPE = RECORD[ T: Transformation, priorityImportant: INT, mediumXSize, mediumYSize: REAL, fieldXMin, fieldYMin, fieldXMax, fieldYMax: REAL, showVec: REF, color: Color, noImage: INT, strokeWidth: REAL, strokeEnd: INT, underlineStart: REAL, amplifySpace: REAL, correctPass: INT, correctShrink: REAL, correctTX, correctTY: REAL, clipper: REF, -- CORRECT variables -- correctMaskCount: INT, correctMaskX, correctMaskY: REAL, correctSumX, correctSumY: REAL, correctSpaceX, correctSpaceY: REAL, correctcpx, correctcpy: REAL, correctTargetX, correctTargetY: REAL ]; InitState: PROC [context: Context]; IGet: PROC [context: Context, n: Name] RETURNS[REF]; ISet: PROC [context: Context, n: Name, x: REF]; IGetReal: PROC[context: Context, n: Name] RETURNS[REAL]; ISetReal: PROC[context: Context, n: Name, x: REAL]; IGetInt: PROC[context: Context, n: Name] RETURNS[INT]; ISetInt: PROC[context: Context, n: Name, x: INT]; ConcatT: PROC[context: Context, m: Transformation]; TranslateT: PROC[context: Context, x, y: REAL]; RotateT: PROC[context: Context, a: REAL]; ScaleT: PROC[context: Context, s: REAL]; Scale2T: PROC[context: Context, sx, sy: REAL]; Move: PROC[context: Context]; Trans: PROC[context: Context]; SetXY: PROC[context: Context, p: Pair]; IntegerSetXY: PROC[context: Context, x, y: INTEGER]; SetXYRel: PROC[context: Context, v: Pair]; IntegerSetXYRel: PROC[context: Context, x, y: INTEGER]; GetCP: PROC[context: Context] RETURNS[Pair]; GetCPRounded: PROC[context: Context] RETURNS[Pair]; MaskVector: PROC[context: Context, x1, y1, x2, y2: REAL]; IntegerMaskVector: PROC[context: Context, x1, y1, x2, y2: INTEGER]; StartUnderline: PROC[context: Context]; MaskUnderline: PROC[context: Context, dy, h: REAL]; IntegerMaskUnderline: PROC[context: Context, dy, h: INTEGER]; CorrectMask: PROC[context: Context]; CorrectSpace: PROC[context: Context, v: Pair]; SetCorrectMeasure: PROC[context: Context, v: Pair]; SetCorrectTolerance: PROC[context: Context, v: Pair]; Space: PROC[context: Context, x: REAL]; IntegerSpace: PROC[context: Context, x: INTEGER]; Correct: PROC[context: Context, body: PROC]; Reset: PROC[context: Context]; DrawBitmap: PROC[context: Context, base: LONG POINTER, raster: CARDINAL, area: IntRectangle]; MaskBits: PROC[context: Context, base: LONG POINTER, raster: CARDINAL, tile: IntRectangle, area: IntRectangle]; GetSurfaceBounds: PROC[context: Context] RETURNS[IntRectangle]; END. úImagerDefault.mesa Last changed by: Michael Plass, October 31, 1983 9:08 am Get state: iget -> [any] getcp -> [x, y] getcprounded -> [x, y] Set state: iset[x] setgray[f] setfont[n] Read and set state: concatt[m] move[] trans[] setxy[x, y] setxyrel[x, y] setxrel[x] setyrel[y] startunderline[] clipoutline[outline] excludeoutline[outline] cliprectangle[x1, y1, x2, y2] excluderectangle[x1, y1, x2, y2] correctmask[] correctspace[x, y] setcorrectmeasure[x, y] setcorrecttolerance[x, y] space[x] Read state, write output: maskfill[outline] maskstroke[trajectory] maskstrokeclosed[trajectory] maskvector[x1, y1, x2, y2] maskrectangle[x, y, w, h] maskunderline[dy, h] masktrapezoidx[x1, y1, x2, x3, y3, x4] masktrapezoidy[x1, y1, y2, x3, y3, y4] maskpixel[pixelArray] Read and set state, write output: show[vector] showandxrel[vector] correct[body] dosave[op] (and friends) No interaction with state or output: dround maket opent translate rotate scale scale2 concat invert transform transformvec roundxy roundxyvec makepixelarray finddecompressor makegray findcolor findcoloroperator findcolormodeloperator makesampledcolor makesampledblack moveto lineto linetox linetoy curveto arcto conicto makeoutline findfont findfontvec modifyfont Common implementations ---------------- Some device implementations may use these procedures in their class record, or call them in addition to some device-specific actions. Some of these procedures assume that context.state narrows to ImagerPrivate.State and some depend on other procedures in the class record. Note that device implementations are under no obligation to use any of these procedures; they may choose to use context.state for some other purpose, or leave it unused. Examples of devices that would take this latter approach are the InterPress-master creator and a lightweight-context display implementation. Allocates and initalizes context.state. For getting value of T, showVec, color, clipOutline For setting value of T, showVec, color, clipOutline For getting value of REAL-valued state variables For setting value of REAL-valued state variables For getting value of priorityImportant, noImage, strokeEnd, correctPass, correctMaskCount For getting value of priorityImportant, noImage, strokeEnd, correctPass, correctMaskCount Ê ˜Jšœ™™J™'J™—šÏk œ$˜-J˜—Jšœœ ˜ Jšœ˜J˜Jšœ œ˜Jšœœ œ˜Jšœœ˜ Jšœ œ˜$Jšœœ˜.Jšœœ˜Jšœ œ˜,Jšœ œ˜*Jšœ œ˜(Jšœœ˜2Jšœ œ˜*Jšœœ˜ J˜Jšœœœ ˜šœ œœ˜JšÏc˜Jšœ œ˜Jšœœ˜Jšž˜Jšœ˜J˜—šœœœ˜"Jšœ˜Jšœœ˜Jšœœ˜Jšœ,œ˜1Jšœ œ˜ Jšœ ˜ Jšœ œ˜ Jšœ œ˜Jšœ œ˜Jšœœ˜Jšœœ˜Jšœ œ˜Jšœœ˜Jšœœ˜Jšœ œ˜ JšžÐckž ˜Jšœœ˜Jšœœ˜!Jšœœ˜Jšœœ˜#Jšœœ˜Jšœ ˜$J˜—J˜šœ ™ J™ J™J™J™—šœ ™ J™J™ J™ J™—šœ™J™ J™J™J™ J™J™ J™ J™J™J™J™J™ J™ J™J™J™J™J™—šœ™J™J™J™J™J™J™J™&J™&J™J™—šœ!™!J™ J™J™ J™J™—šœ$™$J™ÇJ™—™™J™ÊJ™—šÏn œœ˜#Jšœ'™'J˜—š œœœœ˜4Jšœ3™3J˜—š œœ œ˜/Jšœ3™3J˜—š œœœœ˜8Jšœ0™0J˜—š œœœ˜3Jšœ0™0J˜—š  œœœœ˜6JšœY™YJ˜—š œœœ˜1JšœY™YJ˜—š œœ&˜3J˜—š  œœœ˜/J˜—š œœœ˜)J˜—š œœœ˜(J˜—š œœœ˜.J˜—š œœ˜J˜—š œœ˜J˜—š œœ˜'J˜—š  œœœ˜4J˜—š œœ˜*J˜—š œœœ˜7J˜—š œœœ˜,J˜—š  œœœ˜3J˜—š  œœ#œ˜9J˜—š œœ#œ˜CJ˜—š œœ˜'J˜—š  œœœ˜3J˜—š œœœ˜=J˜—š  œœ˜$J˜—š  œœ˜.J˜—š œœ˜3J˜—š œœ˜5J˜—š œœœ˜'J˜—š  œœœ˜1J˜—š œœœ˜,J˜—š œœ˜J˜—š   œœœœ œ˜]J˜—š  œœœœ œ*˜oJ˜—š œœœ˜?J˜——Jšœ˜—…— x|