<<>> <> <> <> DIRECTORY MathBoxTree, MathExpr, MathBox, MathConstructors, MathDB, MathTypes, MathRules, Convert USING [RopeFromAtom], Rope USING [ROPE, Length, Find, Replace, Cat], Imager USING [Context, DoSaveAll, MaskRectangle, MaskStrokeTrajectory, SetColor, SetStrokeWidth], ImagerBackdoor USING [invert], ImagerFont USING [Extents, Find, Font, RopeBoundingBox, Scale], ImagerPath USING [LineToX, LineToY, MoveTo], Vector2 USING [InlineAdd], XRope; MathBoxTreesImpl: CEDAR PROGRAM IMPORTS MathBox, MathExpr, MathDB, MathConstructors, Imager, ImagerBackdoor, ImagerFont, ImagerPath, MathRules, Rope, Convert, Vector2, XRope EXPORTS MathBoxTree ~ BEGIN <> <<>> ROPE: TYPE ~ Rope.ROPE; <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> BoxTreeDataRep: TYPE ~ RECORD [ SELECT type:* FROM privateTree => [ <> <> root: Box, -- cannot be NIL since visibility/non-visibility is a property of Objects (i.e. only of ancestors of privateTrees) parent: BoxTreeData, -- cannot be NIL since (root of) a privateTree is always a child either of some privateTree, or of some atomicObject. children: LIST OF BoxTreeData _ NIL -- All children of a privateTree are privateTrees. <> ], atomicObject => [ <> root: Box _ NIL, -- object visible iff root # NIL parent: BoxTreeData _ NIL, -- root is an absolute Box iff parent = NIL (otherwise relative) children: LIST OF BoxTreeData _ NIL -- All children of a atomicObject are privateTrees. <> object: Object, ], <> <> <> <<>> compositeObject => [ <<"Unpacked" (to at least one level) Object display>> root: Box _ NIL, -- bounding, i.e. outermost, box for the display of self. All subBoxes assumed to be contained in self.args and self.opDisplay. <> parent: BoxTreeData _ NIL, -- root is an absolute Box iff parent = NIL (otherwise relative) op: ATOM, domain: Object, -- Domain or View args: LIST OF BoxTreeData, -- cannot be NIL since this is display of an unpacked Object <> <> <> opDisplay: LIST OF BoxTreeData _ NIL <> <> <<>> <> ENDCASE <> <> <> <> <> <> <> <> <> <> <> <> <> ]; BoxTree: TYPE ~ REF BoxTreeRep; -- inside impl module, use rep END.