StyleToolDefs.mesa
Written by Linda Gass on July 27, 1982 12:27 pm
Last edit by Linda Gass on November 4, 1982 2:23 pm
Last Edited by: Plass, March 28, 1983 2:54 pm
DIRECTORY
 Buttons USING [Button],
 ChoiceButtons,
 Containers USING [Container],
 Graphics USING [Box],
 Labels USING [Label],
 NodeStyle USING [Ref],
 Rope USING [ROPE],
 ViewerClasses USING [Viewer];

StyleToolDefs: CEDAR DEFINITIONS = BEGIN
a StyleToolHandle is a REF to the data for a particular instance of our style tool. We can create more than one.
StyleToolHandle: TYPE = REF StyleToolHandleRec;
StyleToolHandleRec is a record describing the data relevent to a particular tool instance.
StyleToolHandleRec: TYPE = RECORD [
outer: Containers.Container ← NIL, -- handle for the enclosing container
height: CARDINAL ← 0,     -- height measured from the top of the container
styleNameData: ChoiceButtons.PromptDataRef ← NIL, -- relevent data for each section below
formatNameData: ChoiceButtons.PromptDataRef ← NIL,
looksData: ChoiceButtons.PromptDataRef ← NIL,
ruleType: ChoiceButtons.EnumTypeRef,
display: ViewerDisplayRec,
swap: SwapRec,
layoutGraphics: LayoutRec,
changesMode: BOOLEANFALSE, -- indicates only interested in changes to a format or look
default: NodeStyle.Ref,
nodeInfo: NodeStyle.Ref,
looksInfo: NodeStyle.Ref,
sample: SampleRec,
userAware: BOOLEAN
];
ViewerDisplayRec: TYPE = RECORD [
-- font information
fontFamilyChoice: ChoiceButtons.EnumTypeRef,
fontFamilyOtherLabel: Labels.Label,
fontFamilyOtherViewer: ViewerClasses.Viewer,
fontFaceChoice: ChoiceButtons.EnumTypeRef,
boldFontFace: ChoiceButtons.ThreeStateRef,
italicFontFace: ChoiceButtons.ThreeStateRef,
fontSizeInfo: ValueAndUnitsRef,
fontAlphabetsChoice: ChoiceButtons.EnumTypeRef,
fontUnderliningChoice: ChoiceButtons.EnumTypeRef,
-- Indent information
leftIndentInfo: ValueAndUnitsRef,
rightIndentInfo: ValueAndUnitsRef,
firstIndentInfo: ValueAndUnitsRef,
restIndentInfo: ValueAndUnitsRef,
topIndentInfo: ValueAndUnitsRef,
bottomIndentInfo: ValueAndUnitsRef,
-- leading information
leadingContainer: Containers.Container,
stretchShrinkContainer: Containers.Container,
leadingInfo: LeadingRef,
topLeadingInfo: LeadingRef,
bottomLeadingInfo: LeadingRef,
-- miscellaneous information
vshiftInfo: ValueAndUnitsRef,
minLineGapInfo: ValueAndUnitsRef,
tabStopsViewer: ViewerClasses.Viewer,
lineFormattingChoice: ChoiceButtons.EnumTypeRef,
-- Tioga Artwork information
pathTypeChoice: ChoiceButtons.EnumTypeRef,
areaHueViewer: ViewerClasses.Viewer,
areaSaturationViewer: ViewerClasses.Viewer,
areaBrightnessViewer: ViewerClasses.Viewer,
outlineHueViewer: ViewerClasses.Viewer,
outlineSaturationViewer: ViewerClasses.Viewer,
outlineBrightnessViewer: ViewerClasses.Viewer,
textHueViewer: ViewerClasses.Viewer,
textSaturationViewer: ViewerClasses.Viewer,
textBrightnessViewer: ViewerClasses.Viewer,
textRotationViewer: ViewerClasses.Viewer,
lineWeightViewer: ViewerClasses.Viewer
];
ValueAndUnitsRef: TYPE = REF ValueAndUnitsRec;
ValueAndUnitsRec: TYPE = RECORD [
valueData: ChoiceButtons.PromptDataRef,
units: ChoiceButtons.EnumTypeRef,
originalValue: REAL,
originalUnits: Rope.ROPE
];
LeadingRef: TYPE = REF LeadingRec;
LeadingRec: TYPE = RECORD [
leading: ValueAndUnitsRef,
stretch: ChoiceButtons.PromptDataRef,
shrink: ChoiceButtons.PromptDataRef,
originalStretch, originalShrink: REAL
];
FontFamilyRec: TYPE = RECORD [
name: Rope.ROPE,  -- the name which appears in one of the standard buttons
text: Rope.ROPE   -- used if the font family name is non-standard. Then name becomes
];       -- "other" and this contains the actual font family name
SwapRec: TYPE = RECORD [
outer: Containers.Container ← NIL,  -- container holding both print into and JamCodeInfo
height: CARDINAL ← 0,     -- so that the paint proc will only paint the areas nec.
penalty: RECORD [
outer: Containers.Container ← NIL, -- container holding all the penalty info
height: CARDINAL ← 0,     -- height of this container
pageBreakPenalty: ViewerClasses.Viewer ← NIL,
afterFirstLinePenalty: ViewerClasses.Viewer ← NIL,
beforeLastLinePenalty: ViewerClasses.Viewer ← NIL,
beforeFirstLinePenalty: ViewerClasses.Viewer ← NIL,
afterLastLinePenalty: ViewerClasses.Viewer ← NIL
],
layoutHeader: RECORD [
outer: Containers.Container ← NIL, -- container holding page layout header
height: CARDINAL ← 0
],
layout: RECORD [
outer: Containers.Container ← NIL, -- container holding all the page layout parameters
height: CARDINAL ← 0,
visible: BOOLEANFALSE,
parametersButton: Buttons.Button,
pageWidth: ValueAndUnitsRef,
pageLength: ValueAndUnitsRef,
leftMargin: ValueAndUnitsRef,
rightMargin: ValueAndUnitsRef,
topMargin: ValueAndUnitsRef,
bottomMargin: ValueAndUnitsRef,
headerMargin: ValueAndUnitsRef,
footerMargin: ValueAndUnitsRef,
bindingMargin: ValueAndUnitsRef,
lineLength: ValueAndUnitsRef,
column: ViewerClasses.Viewer ← NIL -- number of columns
],
jamCodeInfo: RECORD [
outer: Containers.Container ← NIL, -- container holding the whole thing
text: ViewerClasses.Viewer ← NIL -- the actual place where text appears
]
];
SampleRec: TYPE = RECORD [
viewer: ViewerClasses.Viewer ← NIL
];
LayoutRec: TYPE = RECORD [  -- info used for graphical page layout
exists: BOOLEAN ← FALSE,  -- indicates if a graphics viewer has been created
container: Containers.Container ← NIL,
numbersContainer: Containers.Container,
units: UnitsRecord,
indent: INTEGER,
interval: INTEGER,
skip: INTEGER,
increment: INTEGER,
setButton: Buttons.Button,
pageWidth: ChoiceButtons.PromptDataRef,
pageLength: ChoiceButtons.PromptDataRef,
leftMargin: ChoiceButtons.PromptDataRef,
rightMargin: ChoiceButtons.PromptDataRef,
topMargin: ChoiceButtons.PromptDataRef,
bottomMargin: ChoiceButtons.PromptDataRef,
bindingMargin: ChoiceButtons.PromptDataRef,
viewer: ViewerClasses.Viewer,
currentMargin: MarginType ← none, -- indicates which margin we are currently updating with the mouse
screenLeftMargin, screenRightMargin, screenTopMargin, screenBottomMargin, screenBindingMargin: REAL,
currentPage: PageBoundaryType,
screenPage: Graphics.Box
];
UnitsRecord: TYPE = RECORD [ 
ref: ChoiceButtons.EnumTypeRef,
prev: Rope.ROPE
];
MarginType: TYPE = {left, right, binding, top, bottom, none};
PageBoundaryType: TYPE = {side, top, none};
fontFamilyList: LIST OF Rope.ROPE;
fontFaceList: LIST OF Rope.ROPE;
fontAlphabetsList: LIST OF Rope.ROPE;
fontUnderliningList: LIST OF Rope.ROPE;
lineFormattingList: LIST OF Rope.ROPE;
pathTypeList: LIST OF Rope.ROPE;
ruleList: LIST OF Rope.ROPE;
unitsList: LIST OF Rope.ROPE;
realNumberFormat: Rope.ROPE; -- format used for writing out real numbers
integerFormat: Rope.ROPE;   -- format used for writing out integers
END.