DIRECTORY NodeStyle USING [Ref], Rope USING [ROPE], TextLooks USING [Looks], TextNode USING [Ref]; NodeStyleOps: CEDAR DEFINITIONS ~ BEGIN ROPE: TYPE ~ Rope.ROPE; Ref: TYPE ~ NodeStyle.Ref; Create: PROC RETURNS [Ref]; Copy: PROC [dest, source: Ref]; Alloc: PROC RETURNS [Ref]; Free: PROC [Ref]; 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: Ref; defaultStylesForExtensions: LIST OF ExtObjPair; ExtObjPair: TYPE ~ RECORD [fileExtension: ATOM, styleObject: REF]; SetDefaultStyle: PROC [name: ROPE]; SetExtensionStyles: PROC [value: LIST OF ROPE]; ApplyAll: PROC [ref: Ref, node: TextNode.Ref, kind: OfStyle _ screen]; ApplyForNode: PROC [ref: Ref, node: TextNode.Ref, alt: ATOM, kind: OfStyle _ screen]; ApplyFormat: PROC [ref: Ref, name, alt: ATOM, kind: OfStyle _ screen]; ApplyLooks: PROC [ref: Ref, looks: TextLooks.Looks, kind: OfStyle _ screen]; ApplyObject: PROC [ref: Ref, object: REF, kind: OfStyle _ screen]; OfStyle: TYPE ~ { screen, print, base }; StyleNameForNode: PROC [TextNode.Ref] RETURNS [ATOM]; FlushCaches: PROC; nonNumeric: ERROR; -- raised if call for nonnumeric variable GetStyleParam: PROC [s: Ref, name: ATOM, styleName: ATOM, kind: OfStyle] RETURNS [REAL]; GetStyleParamI: PUBLIC PROC [s: Ref, name: ATOM, styleName: ATOM, kind: OfStyle] RETURNS [INTEGER]; GetStyleParamObj: PUBLIC PROC [s: Ref, name: ATOM, styleName: ATOM, kind: OfStyle] RETURNS [REF]; InitializeDefaultStyle: PROC [suggestedStyle: ROPE]; END. NodeStyleOps.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Written by Bill Paxton, January 1981 Last changed by Bill Paxton, December 1, 1982 8:37 am Doug Wyatt, March 2, 1985 5:35:13 pm PST Michael Plass, March 14, 1985 4:47:24 pm PST Beach, March 20, 1985 5:52:54 pm PST 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 ΚΩ– "Mesa" style˜codešœ™Kšœ Οmœ1™