-- CGContext.mesa -- Last changed by Doug Wyatt, September 1, 1982 12:49 pm DIRECTORY GraphicsBasic USING [Box, Color, Vec], CGArea USING [Ref], CGClipper USING [Ref], CGDevice USING [Ref], CGMatrix USING [Ref], CGReducer USING [Ref], CGSource USING [Mode, 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 src: CGSource.Ref, -- current source cp: GraphicsBasic.Vec, -- current position reducer: CGReducer.Ref, -- reducer area: CGArea.Ref, -- buffer for reducer output 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, mode: CGSource.Mode, fat: BOOLEAN, color: GraphicsBasic.Color, matrix: CGMatrix.Ref, clipper: CGClipper.Ref, cp: GraphicsBasic.Vec ]; -- Procedures -- TouchMatrix: PROC[self: Ref] = INLINE { IF self.matrixLevel