SpellingToolShared.mesa
Copyright Ó 1987, 1992 by Xerox Corporation. All rights reserved.
Last Edited by: Nix, November 21, 1983 5:21 pm
Jack Kent August 17, 1987 4:47:47 pm PDT
Last tweaked by Mike Spreitzer on February 17, 1989 6:34:08 pm PST
Tim Diebert: January 26, 1987 4:50:58 pm PST
Willie-s, May 22, 1992 2:37 pm PDT
DIRECTORY
IO USING [STREAM],
Rope USING [ROPE],
SpellingWordMap USING [CharSet],
TiogaOpsDefs USING [Location, Ref, SelectionGrain],
ViewerClasses USING [Viewer];
SpellingToolShared: CEDAR DEFINITIONS = {
ROPE: TYPE ~ Rope.ROPE;
STREAM: TYPE = IO.STREAM;
CharSet: TYPE = SpellingWordMap.CharSet;
SelectionRec: TYPE = RECORD[
viewer: ViewerClasses.Viewer,
start,
end: TiogaOpsDefs.Location,
level: TiogaOpsDefs.SelectionGrain,
caretBefore, pendingDelete: BOOL];
Selection: TYPE = REF SelectionRec;
MapWordsInSelection: PROC [start, end: TiogaOpsDefs.Location, alphabetic: CharSet, f: PROC [REF TEXT, REF ANY, INT] RETURNS [BOOL], forwards: BOOL] RETURNS [premature: BOOL ¬ FALSE, wordStart, wordEnd: TiogaOpsDefs.Location];
Second argument to f is the node; third is the starting index.
ToRope: PROC [Selection] RETURNS [ROPE];
ProcessSelection: PROC [forceEOD: BOOL ¬ FALSE, defEOD: BOOL ¬ TRUE, forwards: BOOL] RETURNS [Processed];
Analyzes the current selection and returns a selection record that describes it. If forceEOD is true, then the selection record returned always describes a selection from the beginning of the current selection to the end of the document, even if the user only had one word selected. If defEOD is TRUE, then this sort of selection is returned only when the user has a point or single character selection, otherwise the user's actual selection is returned.
Processed: TYPE ~ RECORD [s: Selection, alphabetic: CharSet, wasExtended: BOOL];
CheckMiddleOfWord: PROC[s: Selection, alphabetic: CharSet];
FirstWithin: PROC [r: TiogaOpsDefs.Ref] RETURNS [first: TiogaOpsDefs.Ref];
AdjustCharSet: PROC [org: CharSet, add, rem: ROPE] RETURNS [CharSet];
Non-destructive. Starts from empty set if given org=NIL.
}.