DIRECTORY NodeStyle USING [Style, StyleKind], Rope USING [ROPE], Tioga USING [Looks, Node]; NodeStyleOps: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; Style: TYPE ~ NodeStyle.Style; StyleKind: TYPE ~ NodeStyle.StyleKind; -- { screen, print, base } Ref: TYPE ~ Style; -- synonym for compatibility OfStyle: TYPE ~ StyleKind; -- synonym for compatibility Create: PROC RETURNS [Style]; Copy: PROC [dest, source: Style]; Alloc: PROC RETURNS [Style]; Free: PROC [Style]; LoadStyle: PROC [name: ATOM] RETURNS [ok: BOOL]; ReloadStyle: PROC [name: ATOM] RETURNS [ok: BOOL]; LocalStyle: TYPE ~ REF LocalStyleRec; LocalStyleRec: TYPE ~ RECORD [ name: ATOM, def: ROPE ]; defaultStyleName: ATOM; defaultStyle: Style; defaultStylesForExtensions: LIST OF ExtObjPair; ExtObjPair: TYPE ~ RECORD [fileExtension: ATOM, styleObject: REF]; SetDefaultStyle: PROC [name: ROPE]; SetExtensionStyles: PROC [value: LIST OF ROPE]; ApplyAll: PROC [ref: Style, node: Tioga.Node, kind: StyleKind ¬ screen]; ApplyForNode: PROC [ref: Style, node: Tioga.Node, alt: ATOM, kind: StyleKind ¬ screen]; ApplyFormat: PROC [ref: Style, name, alt: ATOM, kind: StyleKind ¬ screen]; ApplyLooks: PROC [ref: Style, looks: Tioga.Looks, kind: StyleKind ¬ screen]; ApplyObject: PROC [ref: Style, object: REF, kind: StyleKind ¬ screen]; StyleNameForNode: PROC [Tioga.Node] RETURNS [ATOM]; FlushCaches: PROC; nonNumeric: ERROR; -- raised if call for nonnumeric variable GetStyleParam: PROC [s: Style, name: ATOM, styleName: ATOM, kind: StyleKind] RETURNS [REAL]; GetStyleParamI: PUBLIC PROC [s: Style, name: ATOM, styleName: ATOM, kind: StyleKind] RETURNS [INTEGER]; GetStyleParamObj: PUBLIC PROC [s: Style, name: ATOM, styleName: ATOM, kind: StyleKind] RETURNS [REF]; InitializeDefaultStyle: PROC [suggestedStyle: ROPE]; END. ž NodeStyleOps.mesa Copyright Σ 1985, 1986, 1991 by Xerox Corporation. All rights reserved. Written by Bill Paxton, January 1981 Last changed by Bill Paxton, December 1, 1982 8:37 am Michael Plass, March 14, 1985 4:47:24 pm PST Beach, March 20, 1985 5:52:54 pm PST Doug Wyatt, October 17, 1991 6:30 pm PDT Style Operations create a style body copy a style body get from a small cache don't free more than once or disaster! make sure that named style is loaded fast return if is already loaded forces rereading of definition Local Styles Apply operations ApplyAll[ref,NIL] sets ref to default values including setting style name to "default" ApplyAll[ref,node] for node # NIL 1. ApplyAll[ref, Parent[node]] 2. ApplyForNode[ref, node, alt] where alt is "root" if parent=NIL or "default" otherwise 1. ApplyObject[ref, node prefix object] 2. ApplyFormat[ref, node format, alt] 3. ApplyObject[ref, node postfix object] executes the name to modify the body if name is null or undefined, applies alt instead executes the looks to modify the body executes the object to modify the body does an ApplyAll and then returns the style name Style Parameter Extensions Initialization Κω•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ Οeœ=™HKšœ$™$Kšœ5™5K™,J™$K™(—K˜šΟk ˜ Kšœ žœ˜#Kšœžœžœ˜Kšœžœ˜—K˜šΟn œžœž œž˜'K˜Kšžœžœžœ˜Kšœžœ˜Kšœ žœΟc˜AKšœžœ  ˜/Kšœ žœ ˜7—headšœ™šŸœžœžœ ˜Kšœ™—K˜šŸœžœ˜!Kšœ™—K˜šŸœžœžœ ˜Kšœ™—K˜šŸœžœ ˜Kšœ&™&—K˜š Ÿ œžœžœžœžœ˜0Kšœ$™$Kšœ ™ K˜—š Ÿ œžœžœžœžœ˜2Kšœ™K™——™ Kšœ žœžœ˜%Kš œžœžœ žœžœ˜7K˜Kšœžœ˜K˜Kšœžœžœ ˜/Kš œ žœžœžœžœ˜BK˜KšŸœžœžœ˜#K˜Kš Ÿœžœ žœžœžœ˜/—šœ™šŸœžœ:˜Hšœ,™,Kšœ)™)—šœ!™!Kšœ™šœ™Kšœ!™!Kšœ™K˜———šŸ œžœ%žœ˜WKšœ'™'Kšœ%™%Kšœ(™(K˜—šŸ œžœžœ˜JKšœ$™$Kšœ1™1K˜—šŸ œžœ<˜LKšœ%™%K˜—šŸ œžœžœ˜FKšœ&™&K˜—šŸœžœžœžœ˜3Kšœ0™0K˜—šŸ œžœ˜K˜——™Kšœ žœ )˜