DIRECTORY NodeStyle, NodeStyleExtra, NodeStyleObject, TiogaNode, NameSymbolTable, Real, JaMOps, JaMBasic; NodeStyle2Impl: CEDAR MONITOR IMPORTS JaMOps, NameSymbolTable, NodeStyle, NodeStyleExtra, NodeStyleObject, Real EXPORTS NodeStyleExtra, NodeStyleObject = BEGIN OPEN R:Real, NodeStyle, NodeStyleExtra, NodeStyleObject; TextRotationOp: PROC [frame: Frame] = { DoStyleOperation[frame,textRotationParam] }; textRotationParam: Param; LineWeightOp: PROC [frame: Frame] = { DoStyleOperation[frame,lineWeightParam] }; lineWeightParam: Param; PageWidthOp: PROC [frame: Frame] = { DoStyleOperation[frame,pageWidthParam] }; pageWidthParam: Param; PageLengthOp: PROC [frame: Frame] = { DoStyleOperation[frame,pageLengthParam] }; pageLengthParam: Param; LeftMarginOp: PROC [frame: Frame] = { DoStyleOperation[frame,leftMarginParam] }; leftMarginParam: Param; RightMarginOp: PROC [frame: Frame] = { DoStyleOperation[frame,rightMarginParam] }; rightMarginParam: Param; TopMarginOp: PROC [frame: Frame] = { DoStyleOperation[frame,topMarginParam] }; topMarginParam: Param; BottomMarginOp: PROC [frame: Frame] = { DoStyleOperation[frame,bottomMarginParam] }; bottomMarginParam: Param; HeaderMarginOp: PROC [frame: Frame] = { DoStyleOperation[frame,headerMarginParam] }; headerMarginParam: Param; FooterMarginOp: PROC [frame: Frame] = { DoStyleOperation[frame,footerMarginParam] }; footerMarginParam: Param; BindingMarginOp: PROC [frame: Frame] = { DoStyleOperation[frame,bindingMarginParam] }; bindingMarginParam: Param; LineLengthOp: PROC [frame: Frame] = { DoStyleOperation[frame,lineLengthParam] }; lineLengthParam: Param; ColumnOp: PROC [frame: Frame] = { DoStyleOperation[frame,columnParam] }; columnParam: Param; AreaHueOp: PROC [frame: Frame] = { DoStyleOperation[frame,areaHueParam] }; areaHueParam: Param; AreaSaturationOp: PROC [frame: Frame] = { DoStyleOperation[frame,areaSaturationParam] }; areaSaturationParam: Param; AreaBrightnessOp: PROC [frame: Frame] = { DoStyleOperation[frame,areaBrightnessParam] }; areaBrightnessParam: Param; AreaColorOp: PROC [frame: Frame] = { DoStyleOperation[frame,areaColorParam] }; areaColorParam: Param; OutlineHueOp: PROC [frame: Frame] = { DoStyleOperation[frame,outlineHueParam] }; outlineHueParam: Param; OutlineSaturationOp: PROC [frame: Frame] = { DoStyleOperation[frame,outlineSaturationParam] }; outlineSaturationParam: Param; OutlineBrightnessOp: PROC [frame: Frame] = { DoStyleOperation[frame,outlineBrightnessParam] }; outlineBrightnessParam: Param; OutlineColorOp: PROC [frame: Frame] = { DoStyleOperation[frame,outlineColorParam] }; outlineColorParam: Param; TextHueOp: PROC [frame: Frame] = { DoStyleOperation[frame,textHueParam] }; textHueParam: Param; TextSaturationOp: PROC [frame: Frame] = { DoStyleOperation[frame,textSaturationParam] }; textSaturationParam: Param; TextBrightnessOp: PROC [frame: Frame] = { DoStyleOperation[frame,textBrightnessParam] }; textBrightnessParam: Param; TextColorOp: PROC [frame: Frame] = { DoStyleOperation[frame,textColorParam] }; textColorParam: Param; PageBreakPenaltyOp: PROC [frame: Frame] = { DoStyleOperation[frame,pageBreakPenaltyParam] }; pageBreakPenaltyParam: Param; PageBreakPenalty2Op: PROC [frame: Frame] = { DoStyleOperation[frame,pageBreakPenalty2Param] }; pageBreakPenalty2Param: Param; PageBreakPenalty3Op: PROC [frame: Frame] = { DoStyleOperation[frame,pageBreakPenalty3Param] }; pageBreakPenalty3Param: Param; PageBreakPenalty4Op: PROC [frame: Frame] = { DoStyleOperation[frame,pageBreakPenalty4Param] }; pageBreakPenalty4Param: Param; PageBreakPenalty5Op: PROC [frame: Frame] = { DoStyleOperation[frame,pageBreakPenalty5Param] }; pageBreakPenalty5Param: Param; FontAlphabetsOp: PROC [frame: Frame] = { DoStyleOperation[frame,fontAlphabetsParam] }; fontAlphabetsOps: Ops; fontAlphabetsParam: Param; FontAlphabetsLoad: LoadProc = { PushName[frame, SELECT style.fontAlphabets FROM CapsAndLower => capsAndLower, CapsAndSmallCaps => capsAndSmallCaps, LowerOnly => lowerOnly, CapsOnly => capsOnly, ENDCASE => ERROR] }; FontAlphabetsSetName: SetNameProc = { Error: PROC RETURNS [FontAlphabets] = { NameError[frame,name,p]; RETURN [CapsAndLower] }; style.fontAlphabets _ SELECT name FROM capsAndLower => CapsAndLower, capsAndSmallCaps => CapsAndSmallCaps, lowerOnly => LowerOnly, capsOnly => CapsOnly, ENDCASE => Error[] }; StrikeoutOp: PROC [frame: Frame] = { DoStyleOperation[frame,strikeoutParam] }; strikeoutOps: Ops; strikeoutParam: Param; StrikeoutLoad: LoadProc = { PushName[frame, SELECT style.strikeout FROM None => none, LettersAndDigits => lettersAndDigits, Visible => visible, All => all, ENDCASE => ERROR] }; StrikeoutSetName: SetNameProc = { Error: PROC RETURNS [FontUnderlining] = { NameError[frame,name,p]; RETURN [None] }; style.strikeout _ SELECT name FROM none => None, lettersAndDigits => LettersAndDigits, visible => Visible, all => All, ENDCASE => Error[] }; UnderliningOp: PROC [frame: Frame] = { DoStyleOperation[frame,underliningParam] }; underliningOps: Ops; underliningParam: Param; UnderliningLoad: LoadProc = { PushName[frame, SELECT style.underlining FROM None => none, LettersAndDigits => lettersAndDigits, Visible => visible, All => all, ENDCASE => ERROR] }; UnderliningSetName: SetNameProc = { Error: PROC RETURNS [FontUnderlining] = { NameError[frame,name,p]; RETURN [None] }; style.underlining _ SELECT name FROM none => None, lettersAndDigits => LettersAndDigits, visible => Visible, all => All, ENDCASE => Error[] }; ForceBreakOp: PROC [frame: Frame] = { DoStyleOperation[frame,forceBreakParam] }; forceBreakOps: Ops; forceBreakParam: Param; ForceBreakLoad: LoadProc = { PushName[frame, SELECT style.forceBreak FROM No => no, Before => before, After => after, Around => around, ENDCASE => ERROR] }; ForceBreakSetName: SetNameProc = { Error: PROC RETURNS [ForceBreak] = { NameError[frame,name,p]; RETURN [Around] }; style.forceBreak _ SELECT name FROM no => No, before => Before, after => After, around => Around, ENDCASE => Error[] }; PathTypeOp: PROC [frame: Frame] = { DoStyleOperation[frame,pathTypeParam] }; pathTypeOps: Ops; pathTypeParam: Param; PathTypeLoad: LoadProc = { PushName[frame, SELECT style.pathType FROM Filled => filled, Outlined => outlined, FilledAndOutlined => filledAndOutlined, ENDCASE => ERROR] }; PathTypeSetName: SetNameProc = { Error: PROC RETURNS [PathType] = { NameError[frame,name,p]; RETURN [Filled] }; style.pathType _ SELECT name FROM filled => Filled, outlined => Outlined, filledAndOutlined => FilledAndOutlined, ENDCASE => Error[] }; colorOps: Ops; ColorOpLoad: LoadProc = { Get: PROC [param: RealParam] = { PushReal[frame,GetReal[style,param]] }; x: REF ParamRec.color = NARROW[p]; Get[x.hue]; Get[x.saturation]; Get[x.brightness] }; ColorOpSetReal: StoreProc = { Set: PROC [param: RealParam] = { SetReal[style,param,PopReal[frame]] }; x: REF ParamRec.color = NARROW[p]; Set[x.brightness]; Set[x.saturation]; Set[x.hue] }; ColorOpAddReal: AddRealProc = { Add: PROC [param: RealParam] = { SetReal[style,param,GetReal[style,param]+inc] }; x: REF ParamRec.color = NARROW[p]; Add[x.hue]; Add[x.saturation]; Add[x.brightness] }; ColorOpPercent: PercentProc = { Set: PROC [param: RealParam] = { val: REAL _ GetReal[style,param]; SetReal[style, param, (percent/100)*val] }; x: REF ParamRec.color = NARROW[p]; Set[x.hue]; Set[x.saturation]; Set[x.brightness] }; glueOps: Ops; GlueOpLoad: LoadProc = { Get: PROC [param: RealParam] = { PushReal[frame,GetReal[style,param]] }; x: REF ParamRec.glue = NARROW[p]; Get[x.size]; Get[x.stretch]; Get[x.shrink] }; GlueOpSetReal: StoreProc = { Set: PROC [param: RealParam] = { SetReal[style,param,PopReal[frame]] }; x: REF ParamRec.glue = NARROW[p]; Set[x.shrink]; Set[x.stretch]; Set[x.size] }; GlueOpAddReal: AddRealProc = { Add: PROC [param: RealParam] = { SetReal[style,param,GetReal[style,param]+inc] }; x: REF ParamRec.glue = NARROW[p]; Add[x.size]; Add[x.stretch]; Add[x.shrink] }; GlueOpPercent: PercentProc = { Set: PROC [param: RealParam] = { val: REAL _ GetReal[style,param]; SetReal[style, param, (percent/100)*val] }; x: REF ParamRec.glue = NARROW[p]; Set[x.size]; Set[x.stretch]; Set[x.shrink] }; LineLeadingStretchOp: PROC [frame: Frame] = { DoStyleOperation[frame,lineLeadingStretchParam] }; lineLeadingStretchParam: Param; LineLeadingShrinkOp: PROC [frame: Frame] = { DoStyleOperation[frame,lineLeadingShrinkParam] }; lineLeadingShrinkParam: Param; LineLeadingGlueOp: PROC [frame: Frame] = { DoStyleOperation[frame,lineLeadingGlueParam] }; lineLeadingGlueParam: Param; TopLeadingStretchOp: PROC [frame: Frame] = { DoStyleOperation[frame,topLeadingStretchParam] }; topLeadingStretchParam: Param; TopLeadingShrinkOp: PROC [frame: Frame] = { DoStyleOperation[frame,topLeadingShrinkParam] }; topLeadingShrinkParam: Param; TopLeadingGlueOp: PROC [frame: Frame] = { DoStyleOperation[frame,topLeadingGlueParam] }; topLeadingGlueParam: Param; BottomLeadingStretchOp: PROC [frame: Frame] = { DoStyleOperation[frame,bottomLeadingStretchParam] }; bottomLeadingStretchParam: Param; BottomLeadingShrinkOp: PROC [frame: Frame] = { DoStyleOperation[frame,bottomLeadingShrinkParam] }; bottomLeadingShrinkParam: Param; BottomLeadingGlueOp: PROC [frame: Frame] = { DoStyleOperation[frame,bottomLeadingGlueParam] }; bottomLeadingGlueParam: Param; styleFreeVarName: Name; -- for the first REAL valued free variable realFreeVars: LIST OF RealFreeVarRec; RealFreeVarRec: TYPE = RECORD [ key: Name, eval: PROC [node: TiogaNode.Ref] RETURNS [REAL]]; objFreeVars: LIST OF ObjFreeVarRec; ObjFreeVarRec: TYPE = RECORD [ key: Name, eval: PROC [node: TiogaNode.Ref] RETURNS [JaMBasic.Object]]; EvalFreeVars: PUBLIC PROC [style: Ref, node: TiogaNode.Ref] = { key: Name; SetVal: PROC [value: JaMBasic.Object] = { FOR x: DataList _ style.dataList, x.next UNTIL x=NIL DO -- see if already has this value xx: REF DataEntry.object = NARROW[x]; IF xx.name=key THEN { ob: NameSymbolTable.Object _ LOOPHOLE[value]; IF xx.object=ob THEN RETURN ELSE EXIT }; ENDLOOP; style.dataList _ NEW[DataEntry _ [style.dataList, object[key,LOOPHOLE[value]]]] }; FOR lst: LIST OF RealFreeVarRec _ realFreeVars, lst.rest UNTIL lst=NIL DO value: Real _ lst.first.eval[node]; key _ lst.first.key; IF key=styleFreeVarName THEN SetReal[style,freeVar,value] -- this one is special ELSE SetVal[[L, real[value]]]; ENDLOOP; FOR lst: LIST OF ObjFreeVarRec _ objFreeVars, lst.rest UNTIL lst=NIL DO key _ lst.first.key; SetVal[lst.first.eval[node]]; ENDLOOP; }; UnregisterStyleFreeVar: PROC [name: Name] = { prev: LIST OF RealFreeVarRec _ realFreeVars; prevObj: LIST OF ObjFreeVarRec _ objFreeVars; key: Name _ StyleParamKey[name]; IF styleFreeVarName=key THEN styleFreeVarName _ NameSymbolTable.nullName; IF realFreeVars=NIL THEN NULL ELSE IF realFreeVars.first.key=key THEN realFreeVars _ realFreeVars.rest ELSE FOR lst: LIST OF RealFreeVarRec _ realFreeVars, lst.rest UNTIL lst=NIL DO IF lst.first.key=key THEN { prev.rest _ lst.rest; EXIT }; prev _ lst; ENDLOOP; IF objFreeVars=NIL THEN NULL ELSE IF objFreeVars.first.key=key THEN objFreeVars _ objFreeVars.rest ELSE FOR lst: LIST OF ObjFreeVarRec _ objFreeVars, lst.rest UNTIL lst=NIL DO IF lst.first.key=key THEN { prevObj.rest _ lst.rest; EXIT }; prevObj _ lst; ENDLOOP }; GetFreeVarOp: PROC [frame: Frame] = { style: Ref _ StyleForFrame[frame]; key: Name _ PopName[frame]; -- key name for the free var IF key=styleFreeVarName THEN { PushReal[frame, GetReal[style, freeVar]]; RETURN }; PushFreeVar[frame, style, key] }; GetFreeVarObjOp: PROC [frame: Frame] = { style: Ref _ StyleForFrame[frame]; key: Name _ PopName[frame]; -- key name for the free var PushFreeVar[frame, style, key] }; PushFreeVar: PROC [frame: Frame, style: Ref, key: Name] = { FOR x: DataList _ style.dataList, x.next UNTIL x=NIL DO xx: REF DataEntry.object = NARROW[x]; IF xx.name = key THEN { PushObject[frame, LOOPHOLE[xx.object]]; RETURN }; ENDLOOP; PushText[frame,"not defined as a free variable?"]; PushName[frame,key]; StyleError[frame,3] }; getFreeVarOp, getFreeVarObjOp: Object; RegisterStyleFreeVar: PUBLIC PROC [ name: Name, eval: PROC [node: TiogaNode.Ref] RETURNS [REAL]] = TRUSTED { key: Name; array: array Object; [key, array] _ SpecialOpArray[name, getFreeVarOp]; JaMOps.Put[styledict,NameToObject[name],array]; -- store the definition UnregisterStyleFreeVar[name]; IF styleFreeVarName=NameSymbolTable.nullName THEN styleFreeVarName _ key; realFreeVars _ CONS[[key, eval], realFreeVars] }; RegisterStyleFreeObjVar: PUBLIC PROC [ name: Name, eval: PROC [node: TiogaNode.Ref] RETURNS [JaMBasic.Object]] = TRUSTED { key: Name; array: array Object; [key, array] _ SpecialOpArray[name, getFreeVarObjOp]; JaMOps.Put[styledict,NameToObject[name],array]; -- store the definition UnregisterStyleFreeVar[name]; objFreeVars _ CONS[[key, eval], objFreeVars] }; DefineSpecial: PUBLIC PROC [name: Name, initialValue: Real] = { DefineSpecialObj[name, [L,real[initialValue]]] }; DefineSpecialObj: PUBLIC PROC [name: Name, initialValue: JaMBasic.Object] = TRUSTED { key: Name; array: array Object; [key, array] _ SpecialOpArray[name, specialOp]; JaMOps.Put[styledict,NameToObject[name],array]; -- store the definition JaMOps.Put[styledict,NameToObject[key],initialValue]; -- store the initial value }; nonNumeric: PUBLIC ERROR = CODE; GetSpecial: PUBLIC PROC [s: Ref, name: Name] RETURNS [r: Real] = { obj: Object = GetSpecialObj[s, name]; WITH x:obj SELECT FROM real => r _ x.rvalue; integer => r _ x.ivalue; ENDCASE => ERROR nonNumeric }; GetSpecialI: PUBLIC PROC [s: Ref, name: Name] RETURNS [val: INTEGER] = { obj: Object = GetSpecialObj[s, name]; WITH x:obj SELECT FROM real => val _ R.RoundI[x.rvalue]; integer => val _ x.ivalue; ENDCASE => ERROR nonNumeric }; GetSpecialObj: PUBLIC PROC [s: Ref, name: Name] RETURNS [obj: Object] = TRUSTED { key: Name _ StyleParamKey[name]; FOR x: DataList _ s.dataList, x.next UNTIL x=NIL DO xx: REF DataEntry.object = NARROW[x]; IF xx.name = key THEN RETURN [LOOPHOLE[xx.object]]; ENDLOOP; RETURN [JaMOps.Get[styledict,NameToObject[key]]] }; SpecialOpArray: PROC [name: Name, op: Object] RETURNS [key: Name, array: array Object] = TRUSTED { key _ StyleParamKey[name]; array _ JaMOps.Array[2]; -- create a 2 element array array.tag _ X; -- make it executable JaMOps.APut[array,0,CVLit[NameToObject[key]]]; JaMOps.APut[array,1,CVX[op]]; }; text: REF TEXT _ NEW[TEXT[64]]; -- to hold the name for StyleParamKey StyleParamKey: ENTRY PROC [name: Name] RETURNS [key: Name] = TRUSTED { ENABLE UNWIND => NULL; text.length _ 0; NameSymbolTable.FromName[name, text]; FOR i:NAT DECREASING IN [0..text.length) DO -- make room for prefix text[i+2] _ text[i]; ENDLOOP; text[0] _ text[1] _ '!; -- prefix for keys is double bang text.length _ text.length+2; key _ MakeName[LOOPHOLE[text, REF READONLY TEXT]]; }; StyleParam: PROC [frame: Frame] = TRUSTED { -- called to declare a special style parameter object: Object _ PopObject[frame]; -- the initial value name: Name _ PopName[frame]; -- the parameter name key: Name; array: array Object; [key, array] _ SpecialOpArray[name, specialOp]; JaMOps.Def[frame,NameToObject[name],array]; -- store the definition JaMOps.Def[frame,NameToObject[key],object]; -- store the initial value }; GetStyleParam: PUBLIC PROC [s: Ref, name: Name, styleName: Name, kind: OfStyle] RETURNS [obj: Object] = TRUSTED { frame: Frame; key: Name _ StyleParamKey[name]; FOR x: DataList _ s.dataList, x.next UNTIL x=NIL DO xx: REF DataEntry.object = NARROW[x]; IF xx.name = key THEN RETURN [LOOPHOLE[xx.object]]; ENDLOOP; frame _ GetFrame[s, styleName, kind]; PushName[frame,key]; JaMOps.Execute[frame,load]; -- get the initial value obj _ LOOPHOLE[PopObject[frame]]; FreeFrame[frame, styleName, kind]; RETURN [obj] }; SpecialOp: PROC [frame: Frame] = { -- like DoStyleOperation, but for special parameters nameflag: BOOLEAN; name: Name; var: Name; style: Ref _ StyleForFrame[frame]; Error: PROC = { PushName[frame,name]; PushText[frame,"has illegal qualifier:"]; PushName[frame,var]; StyleError[frame,3] }; FindObject: PROC RETURNS [NameSymbolTable.Object] = TRUSTED { FOR x: DataList _ style.dataList, x.next UNTIL x=NIL DO xx: REF DataEntry.object = NARROW[x]; IF xx.name = var THEN RETURN [xx.object]; ENDLOOP; PushName[frame,var]; JaMOps.Execute[frame,load]; -- get the initial value RETURN [LOOPHOLE[PopObject[frame]]] }; Store: PROC [ob: NameSymbolTable.Object] = { style.dataList _ NEW[DataEntry _ [ style.dataList, object[var,ob]]] }; Load: PROC = { PushObject[frame,LOOPHOLE[FindObject[]]] }; AddReal: PROC [inc: REAL] = { value: REAL; Load; value _ PopReal[frame]; SetReal[value+inc] }; SetReal: PROC [x: REAL] = { PushReal[frame,x]; Store[LOOPHOLE[PopObject[frame]]] }; SetName: PROC [n: Name] = { PushName[frame,n]; Store[LOOPHOLE[PopObject[frame]]] }; Percent: PROC [percent: REAL] = { value: REAL; Load; value _ PopReal[frame]; SetReal[(percent/100)*value] }; var _ PopName[frame]; -- the name of the special parameter [name, nameflag] _ TryToPopName[frame]; IF ~nameflag THEN Store[LOOPHOLE[PopObject[frame]]] ELSE SELECT name FROM the => Load[]; bigger => BEGIN [name, nameflag] _ TryToPopName[frame]; IF ~nameflag THEN AddReal[PopReal[frame]] ELSE IF name=percent THEN Percent[100+PopReal[frame]] ELSE { Error; RETURN }; END; smaller => BEGIN [name, nameflag] _ TryToPopName[frame]; IF ~nameflag THEN AddReal[-PopReal[frame]] ELSE IF name=percent THEN Percent[100-PopReal[frame]] ELSE { Error; RETURN }; END; percent => Percent[PopReal[frame]]; ENDCASE => SetName[name]; }; DefineSpecialOp: PROC [ frame: Frame, text: REF READONLY TEXT, proc: PROC [Frame]] RETURNS [op: Object] = TRUSTED { JaMOps.RegisterExplicit[frame,LOOPHOLE[text, LONG STRING],proc]; PushName[frame,MakeName[text]]; JaMOps.Execute[frame,load]; op _ PopObject[frame] }; specialOp: Object; DefineColorOp: PROC [ frame: Frame, text: REF READONLY TEXT, proc: PROC [Frame], hue, saturation, brightness: RealParam] RETURNS [Param] = { name: Name = StyleCommand[frame,text,proc]; RETURN [NEW [color ParamRec _ [colorOps, name, color[hue, saturation, brightness]]]] }; DefineGlueOp: PROC [ frame: Frame, text: REF READONLY TEXT, proc: PROC [Frame], size, stretch, shrink: RealParam] RETURNS [Param] = { name: Name = StyleCommand[frame,text,proc]; RETURN [NEW [glue ParamRec _ [glueOps, name, glue[size, stretch, shrink]]]] }; DefineRealOp: PROC [ frame: Frame, text: REF READONLY TEXT, proc: PROC [Frame], param: RealParam] RETURNS [Param] = { name: Name = StyleCommand[frame,text,proc]; RETURN [NEW [real ParamRec _ [realOps, name, real[param]]]] }; nameOps: Ops; DefineNameOp: PROC [ frame: Frame, text: REF READONLY TEXT, proc: PROC [Frame], param: NameParam] RETURNS [Param] = { name: Name = StyleCommand[frame,text,proc]; RETURN [NEW [name ParamRec _ [nameOps, name, name[param]]]] }; realOps: Ops; fontFaceOps: Ops; lineFormattingOps: Ops; the, smaller, bigger, percent, regular, bold, italic, bolditalic, plusbold, plusitalic, minusbold, minusitalic, capsAndLower, capsAndSmallCaps, lowerOnly, capsOnly, none, lettersAndDigits, visible, all, flush, centered, flushLeft, flushRight, justified, no, before, after, around, filled, outlined, filledAndOutlined, fixed, relative, looks, breakIfPast, spaceIfPast, blank, leaders, rule, rules, aligned, congruent: PUBLIC Name; StartImpl2: PUBLIC PROCEDURE = TRUSTED BEGIN frame: Frame; PointsPerInch: REAL = 1.0/0.0138370; frame _ JaMOps.defaultFrame; defaultStyle.name[style] _ defaultStyleName; defaultStyle.name[fontFamily] _ MakeName["Helvetica"]; SetReal[defaultStyle,fontSize,10]; SetReal[defaultStyle,leading,12]; SetReal[defaultStyle,tabStops,4]; SetReal[defaultStyle,pageWidth,8.5*PointsPerInch]; SetReal[defaultStyle,pageLength,11*PointsPerInch]; SetReal[defaultStyle,leftMargin,1*PointsPerInch]; SetReal[defaultStyle,rightMargin,1*PointsPerInch]; SetReal[defaultStyle,topMargin,1*PointsPerInch]; SetReal[defaultStyle,bottomMargin,1*PointsPerInch]; SetReal[defaultStyle,lineLength,6.5*PointsPerInch]; specialOp _ DefineSpecialOp[frame,"SpecialOp",SpecialOp]; getFreeVarOp _ DefineSpecialOp[frame,"GetFreeVarOp",GetFreeVarOp]; getFreeVarObjOp _ DefineSpecialOp[frame,"GetFreeVarObjOp",GetFreeVarObjOp]; JaMOps.RegisterExplicit[frame,"StyleParam",StyleParam]; JaMOps.RegisterExplicit[frame,"isComment",IsComment]; JaMOps.RegisterExplicit[frame,"isPrint",IsPrint]; JaMOps.RegisterExplicit[frame,"nestingLevel",NestingLevel]; the _ StyleLiteral[frame,"the"]; smaller _ StyleLiteral[frame,"smaller"]; bigger _ StyleLiteral[frame,"bigger"]; percent _ StyleLiteral[frame,"percent"]; regular _ StyleLiteral[frame,"regular"]; bold _ StyleLiteral[frame,"bold"]; italic _ StyleLiteral[frame,"italic"]; bolditalic _ StyleLiteral[frame,"bold+italic"]; plusbold _ StyleLiteral[frame,"+bold"]; plusitalic _ StyleLiteral[frame,"+italic"]; minusbold _ StyleLiteral[frame,"-bold"]; minusitalic _ StyleLiteral[frame,"-italic"]; capsAndLower _ StyleLiteral[frame,"caps+lowercase"]; capsAndSmallCaps _ StyleLiteral[frame,"caps+smallcaps"]; lowerOnly _ StyleLiteral[frame,"lowercase"]; capsOnly _ StyleLiteral[frame,"caps"]; all _ StyleLiteral[frame,"all"]; visible _ StyleLiteral[frame,"visible"]; lettersAndDigits _ StyleLiteral[frame,"letters+digits"]; none _ StyleLiteral[frame,"none"]; justified _ StyleLiteral[frame,"justified"]; flush _ StyleLiteral[frame,"flush"]; flushLeft _ StyleLiteral[frame,"flushLeft"]; flushRight _ StyleLiteral[frame,"flushRight"]; filled _ StyleLiteral[frame,"filled"]; outlined _ StyleLiteral[frame,"outlined"]; filled _ StyleLiteral[frame,"filled"]; filledAndOutlined _ StyleLiteral[frame,"filled+outlined"]; centered _ StyleLiteral[frame,"centered"]; no _ StyleLiteral[frame,"no"]; before _ StyleLiteral[frame,"before"]; after _ StyleLiteral[frame,"after"]; fixed _ StyleLiteral[frame,"fixed"]; around _ StyleLiteral[frame,"around"]; relative _ StyleLiteral[frame,"relative"]; looks _ StyleLiteral[frame,"looks"]; breakIfPast _ StyleLiteral[frame,"breakIfPast"]; spaceIfPast _ StyleLiteral[frame,"spaceIfPast"]; blank _ StyleLiteral[frame,"blank"]; leaders _ StyleLiteral[frame,"leaders"]; rule _ StyleLiteral[frame,"rule"]; rules _ StyleLiteral[frame,"rules"]; aligned _ StyleLiteral[frame,"aligned"]; congruent _ StyleLiteral[frame,"congruent"]; fontFaceOps _ NEW [OpsRec _ [FontFaceLoad, StoreError, AddRealError, PercentError, FontFaceSetName]]; fontFaceParam _ NEW[misc ParamRec _ [fontFaceOps, StyleCommand[frame,"face",FontFaceOp], misc[]]]; fontAlphabetsOps _ NEW [OpsRec _ [FontAlphabetsLoad, StoreError, AddRealError, PercentError, FontAlphabetsSetName]]; fontAlphabetsParam _ NEW[misc ParamRec _ [fontAlphabetsOps, StyleCommand[frame,"alphabets",FontAlphabetsOp], misc[]]]; underliningOps _ NEW [OpsRec _ [UnderliningLoad, StoreError, AddRealError, PercentError, UnderliningSetName]]; underliningParam _ NEW [misc ParamRec _ [underliningOps, StyleCommand[frame,"underlining",UnderliningOp], misc[]]]; strikeoutOps _ NEW [OpsRec _ [StrikeoutLoad, StoreError, AddRealError, PercentError, StrikeoutSetName]]; strikeoutParam _ NEW [misc ParamRec _ [strikeoutOps, StyleCommand[frame,"strikeout",StrikeoutOp], misc[]]]; lineFormattingOps _ NEW [OpsRec _ [LineFormattingLoad, StoreError, AddRealError, PercentError, LineFormattingSetName]]; lineFormattingParam _ NEW [misc ParamRec _ [lineFormattingOps, StyleCommand[frame,"lineFormatting",LineFormattingOp], misc[]]]; pathTypeOps _ NEW [OpsRec _ [PathTypeLoad, StoreError, AddRealError, PercentError, PathTypeSetName]]; pathTypeParam _ NEW [misc ParamRec _ [pathTypeOps, StyleCommand[frame,"pathType",PathTypeOp], misc[]]]; forceBreakOps _ NEW [OpsRec _ [ForceBreakLoad, StoreError, AddRealError, PercentError, ForceBreakSetName]]; forceBreakParam _ NEW [misc ParamRec _ [forceBreakOps, StyleCommand[frame,"forceBreak",ForceBreakOp], misc[]]]; nameOps _ NEW [OpsRec _ [LoadNameParam, StoreError, AddRealError, PercentError, SetNameParam]]; styleParam _ DefineNameOp[frame, "style", StyleNameOp, style]; fontFamilyParam _ DefineNameOp[frame, "family", FontFamilyOp, fontFamily]; realOps _ NEW [OpsRec _ [RealOpLoad, RealOpSetReal, RealOpAddReal, RealOpPercent, SetNameError]]; glueOps _ NEW [OpsRec _ [GlueOpLoad, GlueOpSetReal, GlueOpAddReal, GlueOpPercent, SetNameError]]; colorOps _ NEW [OpsRec _ [ColorOpLoad, ColorOpSetReal, ColorOpAddReal, ColorOpPercent, SetNameError]]; fontSizeParam _ DefineRealOp[frame, "size", FontSizeOp, fontSize]; leftIndentParam _ DefineRealOp[frame, "leftIndent", LeftIndentOp, leftIndent]; rightIndentParam _ DefineRealOp[frame, "rightIndent", RightIndentOp, rightIndent]; firstIndentParam _ DefineRealOp[frame, "firstIndent", FirstIndentOp, firstIndent]; restIndentParam _ DefineRealOp[frame, "restIndent", RestIndentOp, restIndent]; topIndentParam _ DefineRealOp[frame, "topIndent", TopIndentOp, topIndent]; bottomIndentParam _ DefineRealOp[frame, "bottomIndent", BottomIndentOp, bottomIndent]; lineLeadingSizeParam _ DefineRealOp[frame, "leading", LineLeadingSizeOp, leading]; lineLeadingStretchParam _ DefineRealOp[frame, "leadingStretch", LineLeadingStretchOp, leadingStretch]; lineLeadingShrinkParam _ DefineRealOp[frame, "leadingShrink", LineLeadingShrinkOp, leadingShrink]; lineLeadingGlueParam _ DefineGlueOp[frame, "leadingGlue", LineLeadingGlueOp, leading, leadingStretch, leadingShrink]; topLeadingSizeParam _ DefineRealOp[frame, "topLeading", TopLeadingSizeOp, topLeading]; topLeadingStretchParam _ DefineRealOp[frame, "topLeadingStretch", TopLeadingStretchOp, topLeadingStretch]; topLeadingShrinkParam _ DefineRealOp[frame, "topLeadingShrink", TopLeadingShrinkOp, topLeadingShrink]; topLeadingGlueParam _ DefineGlueOp[frame, "topLeadingGlue", TopLeadingGlueOp, topLeading, topLeadingStretch, topLeadingShrink]; bottomLeadingSizeParam _ DefineRealOp[frame, "bottomLeading", BottomLeadingSizeOp, bottomLeading]; bottomLeadingStretchParam _ DefineRealOp[frame, "bottomLeadingStretch", BottomLeadingStretchOp, bottomLeadingStretch]; bottomLeadingShrinkParam _ DefineRealOp[frame, "bottomLeadingShrink", BottomLeadingShrinkOp, bottomLeadingShrink]; bottomLeadingGlueParam _ DefineGlueOp[frame, "bottomLeadingGlue", BottomLeadingGlueOp, bottomLeading, bottomLeadingStretch, bottomLeadingShrink]; vshiftParam _ DefineRealOp[frame, "vShift", VShiftOp, vshift]; tabStopsParam _ DefineRealOp[frame, "tabStops", TabStopsOp, tabStops]; minLineGapParam _ DefineRealOp[frame, "minLineGap", MinLineGapOp, minLineGap]; lineWeightParam _ DefineRealOp[frame, "lineWeight", LineWeightOp, lineWeight]; pageWidthParam _ DefineRealOp[frame, "pageWidth", PageWidthOp, pageWidth]; pageLengthParam _ DefineRealOp[frame, "pageLength", PageLengthOp, pageLength]; leftMarginParam _ DefineRealOp[frame, "leftMargin", LeftMarginOp, leftMargin]; rightMarginParam _ DefineRealOp[frame, "rightMargin", RightMarginOp, rightMargin]; topMarginParam _ DefineRealOp[frame, "topMargin", TopMarginOp, topMargin]; bottomMarginParam _ DefineRealOp[frame, "bottomMargin", BottomMarginOp, bottomMargin]; headerMarginParam _ DefineRealOp[frame, "headerMargin", HeaderMarginOp, headerMargin]; footerMarginParam _ DefineRealOp[frame, "footerMargin", FooterMarginOp, footerMargin]; bindingMarginParam _ DefineRealOp[frame, "bindingMargin", BindingMarginOp, bindingMargin]; lineLengthParam _ DefineRealOp[frame, "lineLength", LineLengthOp, lineLength]; columnParam _ DefineRealOp[frame, "column", ColumnOp, column]; textRotationParam _ DefineRealOp[frame, "textRotation", TextRotationOp, textRotation]; areaHueParam _ DefineRealOp[frame, "areaHue", AreaHueOp, areaHue]; areaSaturationParam _ DefineRealOp[frame, "areaSaturation", AreaSaturationOp, areaSaturation]; areaBrightnessParam _ DefineRealOp[frame, "areaBrightness", AreaBrightnessOp, areaBrightness]; areaColorParam _ DefineColorOp[frame, "areaColor", AreaColorOp, areaHue, areaSaturation, areaBrightness]; outlineHueParam _ DefineRealOp[frame, "outlineHue", OutlineHueOp, outlineHue]; outlineSaturationParam _ DefineRealOp[frame, "outlineSaturation", OutlineSaturationOp, outlineSaturation]; outlineBrightnessParam _ DefineRealOp[frame, "outlineBrightness", OutlineBrightnessOp, outlineBrightness]; outlineColorParam _ DefineColorOp[frame, "outlineColor", OutlineColorOp, outlineHue, outlineSaturation, outlineBrightness]; textHueParam _ DefineRealOp[frame, "textHue", TextHueOp, textHue]; textSaturationParam _ DefineRealOp[frame, "textSaturation", TextSaturationOp, textSaturation]; textBrightnessParam _ DefineRealOp[frame, "textBrightness", TextBrightnessOp, textBrightness]; textColorParam _ DefineColorOp[frame, "textColor", TextColorOp, textHue, textSaturation, textBrightness]; pageBreakPenaltyParam _ DefineRealOp[frame, "pageBreakPenalty", PageBreakPenaltyOp, pageBreakPenalty]; pageBreakPenalty2Param _ DefineRealOp[frame, "pageBreakAfterFirstLinePenalty", PageBreakPenalty2Op, pageBreakAfterFirstLinePenalty]; pageBreakPenalty3Param _ DefineRealOp[frame, "pageBreakAfterLastLinePenalty", PageBreakPenalty3Op, pageBreakAfterLastLinePenalty]; pageBreakPenalty4Param _ DefineRealOp[frame, "pageBreakBeforeFirstLinePenalty", PageBreakPenalty4Op, pageBreakBeforeFirstLinePenalty]; pageBreakPenalty5Param _ DefineRealOp[frame, "pageBreakBeforeLastLinePenalty", PageBreakPenalty5Op, pageBreakBeforeLastLinePenalty]; JaMOps.End[frame]; -- replace sysdict by userdict JaMOps.Begin[frame,userdict]; END; END. ¦NodeStyle2Impl.mesa Written by Bill Paxton, January 1981 Last changed by Bill Paxton, June 7, 1983 2:49 pm Implements JaM commands for style rules and commands to load styles **** Text Rotation **** **** Line Weight **** **** Page Width **** **** Page Length **** **** Left Margin **** **** Right Margin **** **** Top Margin **** **** Bottom Margin **** **** Header Margin **** **** Footer Margin **** **** Binding Margin **** **** Line Length **** **** Column **** **** Area Color **** **** Outline Color **** **** Text Color **** **** Penalty Parameters **** Font Alphabets **** **** Strikeout **** **** Underlining **** **** Force Break **** **** Path Type **** **** Color Parameters **** **** Glue Parameters **** **** LineLeading **** **** Top Leading **** **** Bottom Leading **** **** Free Variables **** **** Special Parameters **** Special Parameters store the object as new value Initialization initialize the params Ê|˜Jšœ™Jšœ$™$Jšœ1™1J˜šœ'™'Jšœ™—J˜šÏk ˜ J˜ J˜J˜J˜ J˜J˜J˜J˜ J˜—šœ ˜JšœJ˜QJšœ"˜)—Jšœœœ2˜>J˜šœ™J˜šÏnœœ˜'J˜,—J˜J˜J˜—šœ™J˜šž œœ˜%J˜*—J˜J˜J˜—šœ™J˜šž œœ˜$J˜)—J˜J˜J˜—šœ™J˜šž œœ˜%J˜*—J˜J˜J˜—šœ™J˜šž œœ˜%J˜*—J˜J˜J˜—šœ™J˜šž œœ˜&J˜+—J˜J˜J˜—šœ™J˜šž œœ˜$J˜)—J˜J˜J˜—šœ™J˜šžœœ˜'J˜,—J˜J˜J˜—šœ™J˜šžœœ˜'J˜,—J˜J˜J˜—šœ™J˜šžœœ˜'J˜,—J˜J˜J˜—šœ™J˜šžœœ˜(J˜-—J˜J˜J˜—šœ™J˜šž œœ˜%J˜*—J˜J˜J˜—šœ™J˜šžœœ˜!J˜&—J˜J˜J˜—šœ™J˜šž œœ˜"J˜'—J˜J˜šžœœ˜)J˜.—J˜J˜šžœœ˜)J˜.—J˜J˜šž œœ˜$J˜)—J˜J˜J˜—šœ™J˜šž œœ˜%J˜*—J˜J˜šžœœ˜,J˜1—J˜J˜šžœœ˜,J˜1—J˜J˜šžœœ˜'J˜,—J˜J˜J˜—šœ™J˜šž œœ˜"J˜'—J˜J˜šžœœ˜)J˜.—J˜J˜šžœœ˜)J˜.—J˜J˜šž œœ˜$J˜)—J˜J˜J˜—šœ™J˜šžœœ˜+J˜0—J˜J˜šžœœ˜,J˜1—J˜J˜šžœœ˜,J˜1—J˜J˜šžœœ˜,J˜1—J˜J˜šžœœ˜,J˜1—J˜J˜J˜—šœ™J˜JšžœœA˜VJ˜J˜J˜J˜˜šœœ˜/J˜J˜%J˜J˜Jšœœ˜J˜J˜——˜%šžœœœ˜%Jšœœ˜3—šœœ˜&J˜J˜%J˜J˜Jšœ˜J˜J˜———šœ™J˜Jšž œœ=˜NJ˜J˜J˜J˜˜šœœ˜+J˜ J˜%J˜J˜ Jšœœ˜J˜J˜——˜!šžœœœ˜'Jšœœ ˜+—šœœ˜"J˜ J˜%J˜J˜ Jšœ˜J˜J˜———šœ™J˜Jšž œœ?˜RJ˜J˜J˜J˜˜šœœ˜-J˜ J˜%J˜J˜ Jšœœ˜J˜J˜——˜#šžœœœ˜'Jšœœ ˜+—šœœ˜$J˜ J˜%J˜J˜ Jšœ˜J˜J˜———šœ™J˜šž œœ˜&J˜*—J˜J˜J˜˜šœœ˜,Jšœ ˜ Jšœ˜Jšœ˜Jšœ˜Jšœœ˜J˜J˜——˜"šžœœœ˜"Jšœœ ˜-—šœœ˜#Jšœ ˜ Jšœ˜Jšœ˜Jšœ˜Jšœ˜J˜———šœ™J˜šž œœ˜$J˜(—J˜J˜J˜˜šœœ˜*J˜J˜J˜'Jšœœ˜J˜J˜——˜ šžœœœ ˜ Jšœœ ˜-—šœœ˜!J˜J˜J˜'Jšœ˜J˜———šœ™J˜J˜J˜˜šžœœ˜ J˜'—Jšœœœ˜"šœ3˜3J˜——˜šžœœ˜ J˜&—Jšœœœ˜"šœ3˜3J˜——˜šžœœ˜ J˜0—Jšœœœ˜"šœ3˜3J˜——˜šžœœ˜ Jšœœ˜!J˜+—Jšœœœ˜"šœ3˜3J˜J˜———šœ™J˜J˜ J˜˜šžœœ˜ J˜'—Jšœœœ˜!šœ-˜-J˜——˜šžœœ˜ J˜&—Jšœœœ˜!šœ-˜-J˜——˜šžœœ˜ J˜0—Jšœœœ˜!šœ-˜-J˜——˜šžœœ˜ Jšœœ˜!J˜+—Jšœœœ˜!šœ-˜-J˜———šœ™J˜šžœœ˜-J˜2—J˜J˜šžœœ˜,J˜1—J˜J˜šžœœ˜*J˜/—J˜J˜—šœ™J˜šžœœ˜,J˜1—J˜J˜šžœœ˜+J˜0—J˜J˜šžœœ˜)J˜.—J˜J˜—šœ™J˜šžœœ˜/J˜4—J˜!J˜šžœœ˜.J˜3—J˜ J˜šžœœ˜,J˜1—J˜J˜—šœ™J˜JšœÏc*˜BJšœœœ˜%šœœœ˜Jšœœœœ˜<—Jšœ œœ˜#šœœœ˜Jšœœœ˜G—J˜šž œ œ&˜?Jšœ ˜ šžœœ˜)š œ&œœœŸ ˜XJšœœœ˜%šœ œ˜Jšœœ˜-Jš œœœœœ˜(—Jšœ˜—Jšœœ)œ ˜R—š œœœ)œœ˜IJ˜#Jšœ˜JšœœŸ˜PJšœ œ˜Jšœ˜—š œœœ'œœ˜GJšœ˜Jšœ˜Jšœ˜—˜J˜——šžœœ˜-Jšœœœ˜,Jšœ œœ˜-J˜ Jšœœ-˜IJšœœœ˜Jšœœœ!˜Hš œœœœ)œœ˜NJšœœœ˜9J˜ Jšœ˜—Jšœ œœ˜Jšœœœ˜Eš œœœœ'œœ˜LJšœœœ˜J˜—J˜ J˜šž œœ˜šœœœœ˜&Jšœœ˜%—Jšœ ˜J˜+Jšœœ3˜>J˜—J˜ J˜J˜˜AJ˜-J˜4J˜%J˜2Jšœ˜Jšœ$˜$Jšœ1˜1Jšœ1œ˜=J˜J˜—šž œœ œ˜Jšœ˜ J˜ Jšœœ˜$J˜J˜J˜J˜,J˜6J˜"J˜!J˜!J˜2J˜2J˜1J˜2J˜0J˜3J˜3J˜Jšœ9˜9JšœB˜BJšœK˜KJ˜J˜7J˜5J˜1J˜;J˜J˜ J˜(J˜&J˜(J˜(J˜"J˜&J˜/J˜'J˜+J˜(J˜,J˜4J˜8J˜,J˜&J˜ J˜(J˜8J˜"J˜,J˜$J˜,J˜.J˜&J˜*J˜&J˜:J˜*Jšœ˜Jšœ&˜&Jšœ$˜$Jšœ$˜$Jšœ&˜&Jšœ*˜*Jšœ$˜$Jšœ0˜0Jšœ0˜0Jšœ$˜$Jšœ(˜(Jšœ"˜"Jšœ$˜$Jšœ(˜(Jšœ,˜,J˜Jšœ™J˜šœœ%˜6J˜.—šœœ˜1J˜0J˜—šœœ*˜@J˜3—šœœ#˜;J˜:J˜—šœœ(˜J˜@J˜—šœœ%˜6J˜.—šœœ˜2J˜4J˜—šœœ'˜:J˜0—šœœ!˜6Jšœ8˜8J˜—šœ œ&˜3J˜+—J˜>J˜JJ˜šœ œ ˜J˜I—šœ œ ˜J˜I—šœ œ ˜J˜MJ˜—J˜BJ˜NJ˜RJ˜RJ˜NJ˜J˜J˜BJ˜—˜J˜;—˜J˜L—˜J˜I—˜9J˜