<> <> <> DIRECTORY Atom, JaMBasic, JaMOps, JaMVM, MessageWindow, NameSymbolTable, NodeProps, NodeStyle, NodeStyleExtra, NodeStyleObject, Process, Rope, TiogaNode; NodeStyleExtraImpl: MONITOR IMPORTS Atom, JaMOps, JaMVM, MessageWindow, NameSymbolTable, NodeProps, NodeStyle, NodeStyleExtra, Process, Rope EXPORTS NodeStyle, NodeStyleExtra, NodeStyleObject = BEGIN OPEN NodeStyle, NodeStyleExtra; <> FrameInfo: TYPE = REF FrameInfoBody; FrameInfoBody: TYPE = RECORD [ frame: Frame, style: Ref, rest: FrameInfo ]; defaultStyleRope: Rope.Text; defaultStyleName: PUBLIC Name; defaultStylesForExtensions: PUBLIC LIST OF ExtObjPair; SetDefaultStyle: PUBLIC SAFE PROC [name: Rope.ROPE] = TRUSTED { defaultStyleRope _ Rope.Flatten[name]; defaultStyleName _ ForceLower[MakeName[ LOOPHOLE[defaultStyleRope, REF READONLY TEXT]]]; defaultStyle.name[style] _ defaultStyleName; FlushCaches[] }; SetExtensionStyles: PUBLIC SAFE PROC [value: LIST OF Rope.ROPE] = TRUSTED { ForceRopeLower: PROC [r: Rope.ROPE] RETURNS [Rope.ROPE] = TRUSTED { ForceCharLower: SAFE PROC [old: CHAR] RETURNS [new: CHAR] = TRUSTED { RETURN [Rope.Lower[old]] }; RETURN [Rope.Translate[base: r, translator: ForceCharLower]] }; defaultStylesForExtensions _ NIL; UNTIL value=NIL OR value.rest=NIL DO ext: ATOM _ Atom.MakeAtom[ForceRopeLower[value.first]]; -- the extension styleObject: NameSymbolTable.Object _ NameSymbolTable.MakeObject[LOOPHOLE[Rope.Flatten[ Rope.Cat["\"", ForceRopeLower[value.rest.first], "\" style"]]]]; defaultStylesForExtensions _ CONS[[ext, styleObject], defaultStylesForExtensions]; value _ value.rest.rest; ENDLOOP; FlushCaches[] }; GetFrame: PUBLIC SAFE PROC [style: Ref, styleName: Name, kind: OfStyle] RETURNS [frame: Frame] = TRUSTED { <