<> <> <<>> <> <<>> DIRECTORY BoxTree, InternalExpr, ImagerFont; BoxTreeImpl: CEDAR PROGRAM ~ BEGIN <> <<>> EXPR: TYPE ~ InternalExpr.EXPR; BoxTreeRep: TYPE ~ RECORD [ boundbox: ImagerFont.Extents, -- size of bounding box( what type should this be) offset: Vector.VEC; -- offset from origin of parent box subBoxes: LIST OF BoxTree.BOXTREE, -- list of boxes bound by this box parentBox: BoxTree.BOXTREE, -- parent bounding box style: BoxTree.STYLE, expression: EXPR -- pointer to expression bound by this box ]; <> Format: PUBLIC PROC [expr: InternalExpr.EXPR, style: STYLE] RETURNS [BOXTREE] ~ { <> <<>> box : BoxTree _ NewBox[expr, style]; --create a new scaled box with pointer to expr box.subBoxes _ GetFormat[expr]; --get formating information for expr from data base. FOR l: LIST OF BoxTree.BOXTREE _ box.subBox, l.next DO { l.first.style.scale _ l.first.style.scale*box.style.scale; l.first.parentBox _ box; l.first.subBoxes _ Format[l.first.expression, l.first.style]; }; ENDLOOP; IF box.subBox THEN box.boundBox _ ComputeBox[box.subBox] ELSE box.boundBox _ ; }; Paint: PUBLIC PROC [boxTree: BOXTREE, context: Imager.Context, selections: LIST OF Selection]; <> NewBox: PROC [expr: InternalExpr.EXPR, style: STYLE] RETURNS [BOXTREE] ~ { <> Return[NEW[BoxTreeRep _ [style: style, expression: expr]]]; }; GetFormat: PROC [expr: InternalExpr.EXPR] RETURNS [LIST OF BOXTREE] ~ { <> }; END.