NodeStyleStartEverythingImpl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Start: PROC = {
frame: Frame;
frame ← TJaMOps.defaultFrame;
realArray ← NEW[ARRAY RealCode OF RealInit0];
intArray ← NEW[ARRAY RealCode OF INTEGER];
NodeStyleStart.StartExtra[];
NodeStyleStart.StartApply[];
NodeStyleStart.StartImpl2[];
[] ← StyleCommand[frame,"pt",Points];
[] ← StyleCommand[frame,"pc",Picas];
[] ← StyleCommand[frame,"in",Inches];
[] ← StyleCommand[frame,"cm",Centimeters];
[] ← StyleCommand[frame,"mm",Millimeters];
[] ← StyleCommand[frame,"dd",DidotPoints];
[] ← StyleCommand[frame,"em",Ems];
[] ← StyleCommand[frame,"en",Ens];
[] ← StyleCommand[frame,"screensp", ScreenSpaces];
[] ← StyleCommand[frame,"printsp", PrintSpaces];
[] ← StyleCommand[frame,"fil",Fil];
[] ← StyleCommand[frame,"fill",Fill];
[] ← StyleCommand[frame,"filll",Filll];
[] ← LoadStyle[defaultStyleName];
};
StartExtra: PUBLIC SAFE PROC = TRUSTED {
frame, frame1, frame2, frame3, frame4: Frame ← NIL;
topDictName: Name;
IF (startCount ← startCount+1)>1 THEN RETURN;
frame ← TJaMOps.defaultFrame;
get ← GetCommand[frame,MakeName[".get"]];
run ← GetCommand[frame,MakeName[".run"]];
load ← GetCommand[frame,MakeName[".load"]];
sysdict ← TypeCheckDict[GetObject[frame,MakeName[".sysdict"]]];
-- check if have done (start.jam) .run
IF ~RunFile[frame,MakeName["user"],"start.jam"] THEN
TJaMOps.Execute[frame,CVX[NameToObject[MakeName[".start"]]]];
userdict ← TJaMOps.TopDict[frame.dictstk];
InitStyleDict[];
TJaMOps.End[frame]; -- replace userdict by styledict for rest of startup
TJaMOps.Begin[frame,styledict];
topDictName ← MakeName["topDictName"];
TJaMOps.Put[sysdict,NameToObject[topDictName],NameToObject[MakeName[".sysdict"]]];
TJaMOps.Put[userdict,NameToObject[topDictName],NameToObject[MakeName["userdict"]]];
TJaMOps.Put[styledict,NameToObject[topDictName],
NameToObject[MakeName["TiogaStylesDictionary"]]];
styleerror ← MakeName["StyleError"];
kindNames[screen] ← MakeName["screen"];
kindNames[print] ← MakeName["print"];
kindNames[base] ← MakeName["base"];
styleRuleDictNames[base] ← MakeName["##BaseStyleRuleDictName"];
styleRuleDictNames[screen] ← MakeName["##ScreenStyleRuleDictName"];
styleRuleDictNames[print] ← MakeName["##PrintStyleRuleDictName"];
styleDictNames[base] ← MakeName["##BaseStyleDictName"];
styleDictNames[screen] ← MakeName["##ScreenStyleDictName"];
styleDictNames[print] ← MakeName["##PrintStyleDictName"];
InitStylesDict[]; InitBindingDict[]; InitAttachmentsDict[];
-- check if have done (TiogaUtils.jam) .run
[] ← RunFile[frame,styleerror,"TiogaUtils.jam"];
[] ← RegCom[frame,"ReportStyleError",ReportStyleError];
[] ← RegCom[frame,"StyleName",StyleName];
[] ← RegCom[frame,"StyleRuleDict",StyleRuleDict];
[] ← RegCom[frame,"PrintRuleDict",PrintRuleDict];
[] ← RegCom[frame,"ScreenRuleDict",ScreenRuleDict];
[] ← RegCom[frame,"OpenPrintStyle",OpenPrintStyleOp];
[] ← RegCom[frame,"OpenScreenStyle",OpenScreenStyleOp];
[] ← RegCom[frame,"ResetTestStyle",ResetTestStyle];
[] ← StyleCommand[frame,"BeginStyle",BeginStyleOp];
[] ← StyleCommand[frame,"EndStyle",EndStyleOp];
[] ← StyleCommand[frame,"StyleRule",StyleRuleOp];
[] ← StyleCommand[frame,"PrintRule",PrintRuleOp];
[] ← StyleCommand[frame,"ScreenRule",ScreenRuleOp];
[] ← StyleCommand[frame,"AttachStyle",AttachStyleOp];
-- style commands for tabs
[] ← StyleCommand[frame,"clearTabStops",ClearTabStopsOp];
[] ← StyleCommand[frame,"tabStop",TabStopOp];
[] ← StyleCommand[frame,"defaultTabStops",DefaultTabStopsOp];
[] ← StyleCommand[frame,"tabStopLocations",RelativeTabStopsOp];
-- allocate and free some frames to initialize the cache
frame1 ← GetFrame[NIL, NameSymbolTable.nullName, screen];
frame2 ← GetFrame[NIL, NameSymbolTable.nullName, screen];
frame3 ← GetFrame[NIL, NameSymbolTable.nullName, screen];
frame4 ← GetFrame[NIL, NameSymbolTable.nullName, screen];
FreeFrame[frame1, NameSymbolTable.nullName, screen];
FreeFrame[frame2, NameSymbolTable.nullName, screen];
FreeFrame[frame3, NameSymbolTable.nullName, screen];
FreeFrame[frame4, NameSymbolTable.nullName, screen];
NodeProps.Register[name: $StyleDef,
reader: ReadSpecsProc, writer: WriteSpecsProc, copier: CopyInfoProc];
};
StartApply: PUBLIC PROC = {
changeSet: EditNotify.ChangeSet;
frame: Frame ← NIL;
IF (startCount ← startCount+1)>1 THEN RETURN;
frame ← TJaMOps.defaultFrame;
changeSet[ChangingProp] ← TRUE;
changeSet[ChangingFormat] ← TRUE;
changeSet[MovingNodes] ← TRUE;
changeSet[NodeNesting] ← TRUE;
changeSet[InsertingNode] ← TRUE;
EditNotify.AddNotifyProc[Notify,after,high,changeSet];
defaultStyle ← Create[];
defaultName ← MakeName["default"];
rootName ← MakeName["root"];
InitLookNames[];
InitApplyCacheRecord[];
InitRuleCacheInfo[];
InitLooksCacheInfo[];
InitObjectCacheInfo[];
ClearCaches[TRUE];
SetDefaultStyle["Cedar"];
};
StartImpl2: PUBLIC PROC = TRUSTED { -- exported to NodeStyleStart
frame: Frame;
PointsPerInch: REAL = 1.0/0.0138370;
startCount ← startCount+1;
frame ← TJaMOps.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];
TJaMOps.RegisterExplicit[frame,"StyleParam",StyleParam];
TJaMOps.RegisterExplicit[frame,"isComment",IsComment];
TJaMOps.RegisterExplicit[frame,"isPrint",IsPrint];
TJaMOps.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"];
fixed ← StyleLiteral[frame,"fixed"];
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"];
initialize the params
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[]]];
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];
TJaMOps.End[frame]; -- replace sysdict by userdict
TJaMOps.Begin[frame,userdict];
};