DIRECTORY Rope, TextNode, TSArtwork, TSGraphic, TSObject, TSOps, TSOutput, TSTranslate, TSTranslatePrivate, TSTypes; TSArtworkImpl: CEDAR MONITOR IMPORTS Rope, TSOps, TSOutput, TSTranslate, TSTranslatePrivate EXPORTS TSArtwork = { OPEN TSTypes; ObjectFromBranchProc: TYPE = TSArtwork.ObjectFromBranchProc; ROPE: TYPE = Rope.ROPE; ARec: TYPE = RECORD [ artworkClassName: ROPE, objectFromBranchProc: ObjectFromBranchProc ]; AList: LIST OF ARec _ NIL; Register: PUBLIC ENTRY PROCEDURE [ artworkClassName: Rope.ROPE, objectFromBranchProc: ObjectFromBranchProc ] = {ENABLE UNWIND => NULL; AList _ CONS[[artworkClassName, objectFromBranchProc], AList]; }; Lookup: PUBLIC ENTRY PROCEDURE [artworkClassName: ROPE] RETURNS [ObjectFromBranchProc] = {ENABLE UNWIND => NULL; FOR a: LIST OF ARec _ AList, a.rest UNTIL a=NIL DO IF a.first.artworkClassName.Equal[artworkClassName] THEN RETURN[a.first.objectFromBranchProc]; ENDLOOP; RETURN[CreateTypesetObject]; }; CreateTypesetObject: PUBLIC ObjectFromBranchProc = { object _ NEW[TSGraphic.ObjectRec]; object.paintProc _ TypesetObjectPaint; object.layoutProc _ TypesetObjectLayout; object.data _ NEW[TypesetObjectRec _ [node: node]]; }; TypesetObjectRec: TYPE = RECORD [ node: TextNode.Ref, vlist: TSObject.ItemList ]; TypesetObjectLayout: TSGraphic.LayoutProc = TRUSTED { data: REF TypesetObjectRec _ NARROW[self.data]; box: TSObject.Box; data.vlist _ TSTranslate.TreeToVlist[data.node].galley; box _ TSOps.GetSlimBoxFrom[data.vlist]; extent _ box.extent; }; TypesetObjectPaint: TSGraphic.PaintProc = { data: REF TypesetObjectRec _ NARROW[self.data]; box: TSObject.Box _ TSOps.GetSlimBoxFrom[data.vlist]; TSOutput.BoxOut[NARROW[context], originX, originY, box^]; }; }. Michael Plass, September 15, 1982 9:45 am. ENABLE UNWIND => NULL. Michael Plass, December 8, 1982 3:22 pm. Changed TypesetObjectLayout to return dimensions instead of flexes. Rick Beach, May 16, 1983 9:56 am. Moved NumberOfBoxes and FirstBoxOf to TSOps. zTSArtworkImpl.mesa Michael Plass, December 8, 1982 3:22 pm Last Edited by: Beach, December 5, 1984 4:40:58 pm PST Κu– "cedar" style˜JšΟc™Jš(™(J™6šΟk ˜ J˜J˜ J˜ J˜ J˜ J˜J˜ J˜ J˜J˜J˜—Jšœž ˜Jšžœ7˜>Jšžœ˜Jšžœ ˜ J˜Jšœžœ"˜J˜J˜—š Ÿœžœžœž œžœ˜7Jšžœžœžœžœ˜8š žœžœžœžœžœž˜2Jšžœ2žœžœ˜^Jšžœ˜—Jšžœ˜J˜J˜—šŸœžœ˜4Jšœ žœ˜"J˜&J˜(Jšœžœ"˜3J˜J˜—šœžœžœ˜!J˜J˜J˜J˜—šŸœžœ˜5Jšœžœžœ ˜/J˜J˜7Jšœ'˜'J˜J˜J˜—šŸœ˜+Jšœžœžœ ˜/Jšœ5˜5Jšœžœ#˜9J˜J˜—J˜J˜Jšœ+žœžœžœ˜AJšœm˜mJ˜N—…—Ά ₯