TEditViewer.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Doug Wyatt, September 2, 1986 1:36:32 pm PDT
DIRECTORY
TEditDocument USING [TEditDocumentData],
TextLooks USING [Looks, noLooks],
TextNode USING [Location, Node],
ViewerClasses USING [Viewer];
TEditViewer: CEDAR DEFINITIONS
= BEGIN
Selection: TYPE = REF SelectionRec;
SelectionRec: TYPE = RECORD [
viewer: ViewerClasses.Viewer,
data: TEditDocument.TEditDocumentData,
start: SelectionPoint,
end: SelectionPoint,
caretX, caretY: INTEGER,
granularity: SelectionGrain,
punctuation: PunctuationPosition, -- whether spaces are part of the selection
insertion: BeforeAfter,
looks: TextLooks.Looks ← TextLooks.noLooks, -- caret looks
pendingDelete: BOOLFALSE -- Laurel-style pending deletion of selection
];
SelectionPoint: TYPE = RECORD [
pos: TextNode.Location,
line: INTEGER ← 0,
x: INTEGER ← 0,
y: INTEGER ← 0,
w: INTEGER ← 0,
h: INTEGER ← 0,
clipped: BOOLFALSE,
metricsValid: BOOLFALSE
];
SelectionGrain: TYPE = {point, char, word, node, branch} ← char;
PunctuationPosition: TYPE = {none, leading, trailing} ← none;
BeforeAfter: TYPE = {before, after} ← before;
RecordViewerForRoot: PROC [viewer: ViewerClasses.Viewer, root: TextNode.Node];
ForgetViewer: PROC [viewer: ViewerClasses.Viewer];
remove this from the root => viewer mapping
GetViewerForRoot: PROC [root: TextNode.Node] RETURNS [viewer: ViewerClasses.Viewer];
END.