-- CGPoolImpl.mesa -- Last changed by Doug Wyatt, September 20, 1982 4:06 pm DIRECTORY CGClipper USING [Assign, Copy], CGContext USING [Level, PoolData, PoolDataRep, PoolNode, PoolNodeRep, Ref], CGMatrix USING [Assign, Copy], CGPrivate USING [Context], CGStorage USING [pZone, qZone], GraphicsBasic USING [black, Mark, nullMark]; CGPoolImpl: CEDAR PROGRAM IMPORTS CGClipper, CGMatrix, CGStorage EXPORTS CGContext, CGPrivate = { OPEN CGContext; Mark: TYPE = GraphicsBasic.Mark; nullMark: Mark = GraphicsBasic.nullMark; Context: TYPE = CGPrivate.Context; dataZone: ZONE = CGStorage.pZone; nodeZone: ZONE = CGStorage.qZone; nil: Level = LAST[Level]; nullNode: PoolNodeRep = [matrixLevel: nil, clipperLevel: nil, fillLevel: nil, cpLevel: nil, yUp: FALSE, fill: [mode: opaque, fat: FALSE, color: GraphicsBasic.black], matrix: NIL, clipper: NIL, cp: [0,0]]; Save: PUBLIC PROC[self: Context] RETURNS[Mark] = { ctx: Ref _ NARROW[self.data]; oldlev: Level _ ctx.level; -- current level newlev: Level _ oldlev + 1; data: PoolData _ ctx.pooldata; space: NAT _ IF data=NIL THEN 0 ELSE data.space; node: PoolNode _ NIL; IF newlev=nil THEN ERROR; IF space0 THEN oldlev _ lev - 1 ELSE RETURN } ELSE { [oldlev] _ mark; IF oldlev>=lev THEN RETURN }; WHILE lev>oldlev DO node: PoolNode _ data[lev _ lev - 1]; IF node.matrixLevel#nil THEN { IF node.matrixLevel<=lev THEN { CGMatrix.Assign[ctx.matrix, node.matrix]; ctx.yUp _ node.yUp; ctx.matrixLevel _ node.matrixLevel; }; node.matrixLevel _ nil; }; IF node.clipperLevel#nil THEN { IF node.clipperLevel<=lev THEN { CGClipper.Assign[ctx.clipper, node.clipper]; ctx.clipperLevel _ node.clipperLevel; }; node.clipperLevel _ nil; }; IF node.fillLevel#nil THEN { IF node.fillLevel<=lev THEN { ctx.fill _ node.fill; ctx.fillLevel _ node.fillLevel; }; node.fillLevel _ nil; }; ENDLOOP; ctx.poolnode _ IF lev>0 THEN data[lev-1] ELSE NIL; ctx.level _ lev; }; SaveClipper: PUBLIC PROC[self: Ref] = { node: PoolNode _ self.poolnode; IF node.clipper=NIL THEN node.clipper _ CGClipper.Copy[self.clipper] ELSE CGClipper.Assign[node.clipper,self.clipper]; node.clipperLevel _ self.clipperLevel; self.clipperLevel _ self.level; }; SaveMatrix: PUBLIC PROC[self: Ref] = { node: PoolNode _ self.poolnode; IF node.matrix=NIL THEN node.matrix _ CGMatrix.Copy[self.matrix] ELSE CGMatrix.Assign[node.matrix,self.matrix]; node.yUp _ self.yUp; node.yUp _ self.yUp; node.matrixLevel _ self.matrixLevel; self.matrixLevel _ self.level; }; SaveFill: PUBLIC PROC[self: Ref] = { node: PoolNode _ self.poolnode; node.fill _ self.fill; node.fillLevel _ self.fillLevel; self.fillLevel _ self.level; }; SaveCP: PUBLIC PROC[self: Ref] = { node: PoolNode _ self.poolnode; node.cp _ self.cp; node.cpLevel _ self.cpLevel; self.cpLevel _ self.level; }; ResetPool: PUBLIC PROC[self: Ref] = { self.matrixLevel _ 0; self.clipperLevel _ 0; self.fillLevel _ 0; self.cpLevel _ 0; self.poolnode _ NIL; self.level _ 0; }; }. Κτ– "Mesa" style˜IprocšάΟcMœΟk œ žœžœHžœžœžœ!žœ'ž œžœ žœžœžœJžœ!žœžœ"žœmžœžœ)žœ žœΟnœžœžœžœžœ*œHžœžœžœžœžœ žœžœ žœžœžœžœ'žœžœ žœžœ-žœžœžœžœ žœžœ"žœžœžœ žœIžœŸœžœžœ-žœ_žœžœžœžœžœžœžœžœ žœžœžœ žœ/žœžœ žœžœ³žœžœ žœžœžœžœ žœžœ}žœžœžœ žœžœŸ œžœžœ4žœžœžœ/žœŸ œžœžœ4žœ žœžœ,žœ§Ÿœžœžœ“Ÿœžœžœ‰Ÿ œžœžœ}žœ˜³—…—Ά°