NodeStyleWorks4Impl.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Rick Beach, June 3, 1985 5:44:34 pm PDT
Michael Plass, March 27, 1986 4:53:16 pm PST
Doug Wyatt, September 24, 1986 6:36:26 pm PDT
Implements JaM commands for style rules and commands to load styles.
DIRECTORY
NodeStyleWorks USING [colorOps, DoStyleOp, glueOps, Param, ParamRec, realOps, RegisterStyleCommand],
Rope USING [ROPE],
TJaM USING [CommandProc, CvX, Execute, Frame];
NodeStyleWorks4Impl: CEDAR PROGRAM
IMPORTS NodeStyleWorks, TJaM
EXPORTS NodeStyleWorks
~ BEGIN OPEN NodeStyleWorks;
Frame: TYPE ~ TJaM.Frame;
ROPE: TYPE ~ Rope.ROPE;
Initialization
This must be first to pick up the Preregister calls in the start code.
OpsListItem: TYPE ~ RECORD [name: ATOM, op: TJaM.CommandProc];
OpsList: TYPE ~ LIST OF OpsListItem;
opsList: OpsList ← NIL;
Preregister: PROC [param: Param, op: TJaM.CommandProc] RETURNS [Param] ~ {
opsList ← CONS[[param.opName, op], opsList];
RETURN [param];
};
RegisterWorks4: PUBLIC PROC [frame: Frame] ~ {
FOR list: OpsList ← opsList, list.rest UNTIL list=NIL DO
RegisterStyleCommand[frame, list.first.name, list.first.op];
ENDLOOP;
TJaM.Execute[frame, TJaM.CvX[prolog]];
};
New Style Parameters
These are style parameters that have not been given a place NodeStyle.RealParam. They may be used in a style just like any other real-valued style parameter, and they may be accessed from a client program by means of NodeStyleOps.GetStyleParam.
prolog: ROPE ← "
(firstFolio) 1 StyleParam
Number associated with first formatted page
(firstVisibleFolio) 1 StyleParam
Folios smaller than this will not be printed. Use a large value to kill page numbers.
(lastDropFolio) 1 StyleParam
Last folio to be placed at the bottom center of the page
(firstHeaders) 0 StyleParam
Page headers will first appear on the page with this folio.
(maxVerticalExpansion) 3 StyleParam
Extra fil is inserted if the vertical expansion ratio would exceed this.
(maxHorizontalExpansion) 1 fil StyleParam
Spaces in justified lines are never stretched by more than this amount, possibly resulting in a somewhat ragged right margin. Applies at the node level.
(sided) 1 StyleParam
Should be 1 or 2
(keep) 0 pt StyleParam
Asserts that a new column or page should be started if there is less than this amount of vertical space remaining when the first line of the node is formatted.
(keepStretch) 1 fil StyleParam
Added to the bottomIndentStretch when a new column is started because of a keep.
(columnGap) 0.5 in StyleParam
Minimum gap between columns
(topIndentStretch) 0 StyleParam
Stretchability at the top of the column
(bottomIndentStretch) 0 StyleParam
Stretchability at the bottom of the column
(hyphenation) (No) StyleParam
Kind of hyphenation applied to this node (applies at node level)
(hyphenCode) 45 StyleParam
Character code for hyphen (applies at character level)
(pageRotation) 0 StyleParam
Degrees of counterclockwise rotation for the whole page
(pageRotationVerso) 0 StyleParam
Degrees of counterclockwise rotation for verso pages (only used if 2 sided)
(mediumColor) {mediumBrightness mediumSaturation mediumHue} .cvx .def
Color of the page background
(mediumHue) 0 StyleParam
(mediumSaturation) 0 StyleParam
(mediumBrightness) 1 StyleParam
";
Letter Spacing Glue
LetterspacingOp: TJaM.CommandProc ~ { DoStyleOp[frame, letterspacingParam] };
letterspacingParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $letterspacing, real[letterspacing]]], LetterspacingOp];
LetterspacingStretchOp: TJaM.CommandProc ~ { DoStyleOp[frame, letterspacingStretchParam] };
letterspacingStretchParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $letterspacingStretch, real[letterspacingStretch]]], LetterspacingStretchOp];
LetterspacingShrinkOp: TJaM.CommandProc ~ { DoStyleOp[frame, letterspacingShrinkParam] };
letterspacingShrinkParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $letterspacingShrink, real[letterspacingShrink]]], LetterspacingShrinkOp];
LetterspacingGlueOp: TJaM.CommandProc ~ { DoStyleOp[frame, letterspacingGlueParam] };
letterspacingGlueParam: Param ← Preregister[NEW[glue ParamRec ← [glueOps, $letterspacingGlue, glue[letterspacing, letterspacingStretch, letterspacingShrink]]], LetterspacingGlueOp];
Pagebreak Glue
PagebreakOp: TJaM.CommandProc ~ { DoStyleOp[frame, pagebreakParam] };
pagebreakParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $pagebreak, real[pagebreak]]], PagebreakOp];
PagebreakStretchOp: TJaM.CommandProc ~ { DoStyleOp[frame, pagebreakStretchParam] };
pagebreakStretchParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $pagebreakStretch, real[pagebreakStretch]]], PagebreakStretchOp];
PagebreakShrinkOp: TJaM.CommandProc ~ { DoStyleOp[frame, pagebreakShrinkParam] };
pagebreakShrinkParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $pagebreakShrink, real[pagebreakShrink]]], PagebreakShrinkOp];
PagebreakGlueOp: TJaM.CommandProc ~ { DoStyleOp[frame, pagebreakGlueParam] };
pagebreakGlueParam: Param ← Preregister[NEW[glue ParamRec ← [glueOps, $pagebreakGlue, glue[pagebreak, pagebreakStretch, pagebreakShrink]]], PagebreakGlueOp];
Underline Dimensions and Color
UnderlineThicknessOp: TJaM.CommandProc ~ { DoStyleOp[frame, underlineThicknessParam] };
underlineThicknessParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $underlineThickness, real[underlineThickness]]], UnderlineThicknessOp];
UnderlineDescentOp: TJaM.CommandProc ~ { DoStyleOp[frame, underlineDescentParam] };
underlineDescentParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $underlineDescent, real[underlineDescent]]], UnderlineDescentOp];
UnderlineHueOp: TJaM.CommandProc ~ { DoStyleOp[frame, underlineHueParam] };
underlineHueParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $underlineHue, real[underlineHue]]], UnderlineHueOp];
UnderlineSaturationOp: TJaM.CommandProc ~ { DoStyleOp[frame, underlineSaturationParam] };
underlineSaturationParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $underlineSaturation, real[underlineSaturation]]], UnderlineSaturationOp];
UnderlineBrightnessOp: TJaM.CommandProc ~ { DoStyleOp[frame, underlineBrightnessParam] };
underlineBrightnessParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $underlineBrightness, real[underlineBrightness]]], UnderlineBrightnessOp];
UnderlineColorOp: TJaM.CommandProc ~ { DoStyleOp[frame, underlineColorParam] };
underlineColorParam: Param ← Preregister[NEW[color ParamRec ← [colorOps, $underlineColor, color[underlineHue, underlineSaturation, underlineBrightness]]], UnderlineColorOp];
Strikeout Dimensions and Color
StrikeoutThicknessOp: TJaM.CommandProc ~ { DoStyleOp[frame, strikeoutThicknessParam] };
strikeoutThicknessParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $strikeoutThickness, real[strikeoutThickness]]], StrikeoutThicknessOp];
StrikeoutAscentOp: TJaM.CommandProc ~ { DoStyleOp[frame, strikeoutAscentParam] };
strikeoutAscentParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $strikeoutAscent, real[strikeoutAscent]]], StrikeoutAscentOp];
StrikeoutHueOp: TJaM.CommandProc ~ { DoStyleOp[frame, strikeoutHueParam] };
strikeoutHueParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $strikeoutHue, real[strikeoutHue]]], StrikeoutHueOp];
StrikeoutSaturationOp: TJaM.CommandProc ~ { DoStyleOp[frame, strikeoutSaturationParam] };
strikeoutSaturationParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $strikeoutSaturation, real[strikeoutSaturation]]], StrikeoutSaturationOp];
StrikeoutBrightnessOp: TJaM.CommandProc ~ { DoStyleOp[frame, strikeoutBrightnessParam] };
strikeoutBrightnessParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $strikeoutBrightness, real[strikeoutBrightness]]], StrikeoutBrightnessOp];
StrikeoutColorOp: TJaM.CommandProc ~ { DoStyleOp[frame, strikeoutColorParam] };
strikeoutColorParam: Param ← Preregister[NEW[color ParamRec ← [colorOps, $strikeoutColor, color[strikeoutHue, strikeoutSaturation, strikeoutBrightness]]], StrikeoutColorOp];
Outline Box Dimensions and Color
OutlineBoxThicknessOp: TJaM.CommandProc ~ { DoStyleOp[frame, outlineBoxThicknessParam] };
outlineBoxThicknessParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $outlineBoxThickness, real[outlineboxThickness]]], OutlineBoxThicknessOp];
OutlineBoxBearoffOp: TJaM.CommandProc ~ { DoStyleOp[frame, outlineBoxBearoffParam] };
outlineBoxBearoffParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $outlineBoxBearoff, real[outlineboxBearoff]]], OutlineBoxBearoffOp];
OutlineBoxHueOp: TJaM.CommandProc ~ { DoStyleOp[frame, outlineBoxHueParam] };
outlineBoxHueParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $outlineBoxHue, real[outlineboxHue]]], OutlineBoxHueOp];
OutlineBoxSaturationOp: TJaM.CommandProc ~ { DoStyleOp[frame, outlineBoxSaturationParam] };
outlineBoxSaturationParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $outlineBoxSaturation, real[outlineboxSaturation]]], OutlineBoxSaturationOp];
OutlineBoxBrightnessOp: TJaM.CommandProc ~ { DoStyleOp[frame, outlineBoxBrightnessParam] };
outlineBoxBrightnessParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $outlineBoxBrightness, real[outlineboxBrightness]]], OutlineBoxBrightnessOp];
OutlineBoxColorOp: TJaM.CommandProc ~ { DoStyleOp[frame, outlineBoxColorParam] };
outlineBoxColorParam: Param ← Preregister[NEW[color ParamRec ← [colorOps, $outlineBoxColor, color[outlineboxHue, outlineboxSaturation, outlineboxBrightness]]], OutlineBoxColorOp];
Background Dimensions and Color
BackgroundAscentOp: TJaM.CommandProc ~ { DoStyleOp[frame, backgroundAscentParam] };
backgroundAscentParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $backgroundAscent, real[backgroundAscent]]], BackgroundAscentOp];
BackgroundDescentOp: TJaM.CommandProc ~ { DoStyleOp[frame, backgroundDescentParam] };
backgroundDescentParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $backgroundDescent, real[backgroundDescent]]], BackgroundDescentOp];
BackgroundHueOp: TJaM.CommandProc ~ { DoStyleOp[frame, backgroundHueParam] };
backgroundHueParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $backgroundHue, real[backgroundHue]]], BackgroundHueOp];
BackgroundSaturationOp: TJaM.CommandProc ~ { DoStyleOp[frame, backgroundSaturationParam] };
backgroundSaturationParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $backgroundSaturation, real[backgroundSaturation]]], BackgroundSaturationOp];
BackgroundBrightnessOp: TJaM.CommandProc ~ { DoStyleOp[frame, backgroundBrightnessParam] };
backgroundBrightnessParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $backgroundBrightness, real[backgroundBrightness]]], BackgroundBrightnessOp];
BackgroundColorOp: TJaM.CommandProc ~ { DoStyleOp[frame, backgroundColorParam] };
backgroundColorParam: Param ← Preregister[NEW[color ParamRec ← [colorOps, $backgroundColor, color[backgroundHue, backgroundSaturation, backgroundBrightness]]], BackgroundColorOp];
Area Color
AreaHueOp: TJaM.CommandProc ~ { DoStyleOp[frame, areaHueParam] };
areaHueParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $areaHue, real[areaHue]]], AreaHueOp];
AreaSaturationOp: TJaM.CommandProc ~ { DoStyleOp[frame, areaSaturationParam] };
areaSaturationParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $areaSaturation, real[areaSaturation]]], AreaSaturationOp];
AreaBrightnessOp: TJaM.CommandProc ~ { DoStyleOp[frame, areaBrightnessParam] };
areaBrightnessParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $areaBrightness, real[areaBrightness]]], AreaBrightnessOp];
AreaColorOp: TJaM.CommandProc ~ { DoStyleOp[frame, areaColorParam] };
areaColorParam: Param ← Preregister[NEW[color ParamRec ← [colorOps, $areaColor, color[areaHue, areaSaturation, areaBrightness]]], AreaColorOp];
Outline Color
OutlineHueOp: TJaM.CommandProc ~ { DoStyleOp[frame, outlineHueParam] };
outlineHueParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $outlineHue, real[outlineHue]]], OutlineHueOp];
OutlineSaturationOp: TJaM.CommandProc ~ { DoStyleOp[frame, outlineSaturationParam] };
outlineSaturationParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $outlineSaturation, real[outlineSaturation]]], OutlineSaturationOp];
OutlineBrightnessOp: TJaM.CommandProc ~ { DoStyleOp[frame, outlineBrightnessParam] };
outlineBrightnessParam: Param ← Preregister[NEW[real ParamRec ← [realOps, $outlineBrightness, real[outlineBrightness]]], OutlineBrightnessOp];
OutlineColorOp: TJaM.CommandProc ~ { DoStyleOp[frame, outlineColorParam] };
outlineColorParam: Param ← Preregister[NEW[color ParamRec ← [colorOps, $outlineColor, color[outlineHue, outlineSaturation, outlineBrightness]]], OutlineColorOp];
END.