-- CGContext.mesa -- Last changed by Doug Wyatt, September 20, 1982 4:04 pm DIRECTORY GraphicsBasic USING [Box, Trap, Vec], CGArea USING [Ref], CGClipper USING [Ref], CGDevice USING [Fill, Ref], CGMatrix USING [Ref], CGReducer USING [Ref]; CGContext: CEDAR DEFINITIONS = { Ref: TYPE = REF Rep; Rep: TYPE = RECORD [ device: CGDevice.Ref, -- output device matrix: CGMatrix.Ref, -- transformation matrix clipper: CGClipper.Ref, -- clipper reducer: CGReducer.Ref, -- reducer area: CGArea.Ref, -- buffer for reducer output fill: CGDevice.Fill, -- current fill parameters (color, paint mode, and scan conversion mode) cp: GraphicsBasic.Vec, -- current position bbox: REF GraphicsBasic.Box, -- bounding box dbase: LONG POINTER _ NIL, -- base address of device raster drast: CARDINAL _ 0, -- words per line for device raster yUp: BOOLEAN _ TRUE, -- increasing y is down (FALSE) or up (TRUE) boxing,newbox: BOOLEAN, -- bounding box state haveRaster: BOOLEAN, -- TRUE if device raster is available -- Pool information level: Level _ 0, -- current level matrixLevel: Level _ 0, clipperLevel: Level _ 0, fillLevel: Level _ 0, cpLevel: Level _ 0, poolnode: PoolNode _ NIL, pooldata: PoolData _ NIL, -- Optional data textdata: TextData _ NIL, -- data specific to text bitmapdata: BitmapData _ NIL -- data specific to bitmap images ]; TextData: TYPE = REF TextDataRep; TextDataRep: TYPE; BitmapData: TYPE = REF BitmapDataRep; BitmapDataRep: TYPE; Level: TYPE = [0..256); PoolData: TYPE = REF PoolDataRep; PoolDataRep: TYPE = RECORD[SEQUENCE space: NAT OF PoolNode]; PoolNode: TYPE = REF PoolNodeRep; PoolNodeRep: TYPE = RECORD [ matrixLevel: Level, clipperLevel: Level, fillLevel: Level, cpLevel: Level, yUp: BOOLEAN, fill: CGDevice.Fill, matrix: CGMatrix.Ref, clipper: CGClipper.Ref, cp: GraphicsBasic.Vec ]; -- Procedures -- TouchMatrix: PROC[self: Ref] = INLINE { IF self.matrixLevel