TEditInput.mesa; Edited by Paxton on October 29, 1982 9:58 am
by Plass on October 11, 1983 10:00 am
DIRECTORY
TextNode USING [Ref],
TEditDocument USING [Selection, TEditDocumentData],
UndoEvent USING [Ref],
ViewerClasses USING [Viewer];
TEditInput:
CEDAR DEFINITIONS =
BEGIN
interpreterNesting:
INTEGER;
currentEvent: UndoEvent.Ref;
-- used by anyone who needs to save info for Undo/Cancel
EditState:
TYPE = {
reset, -- no edit specified
abort, -- edit aborted
tolimbo, -- delete primary
toprimary, -- copy/move secondary selection to/onto primary
tosecondary, -- copy/move primary to/onto secondary
toboth -- transpose primary and secondary
};
repeatList:
LIST
OF
REF
ANY;
chars:
REF
TEXT;
-- buffer for typein
charsClosed: BOOL;
charsUsed: BOOL;
CloseEvent:
PROC =
INLINE { closeEvent ←
TRUE };
CurrentEvent:
PROC
RETURNS [UndoEvent.Ref] =
INLINE {
RETURN [currentEvent] };
CommandProc:
TYPE =
PROC [viewer: ViewerClasses.Viewer ←
NIL]
RETURNS [recordAtom: BOOL ← TRUE, quit: BOOL ← FALSE];
Register:
PROC [name:
ATOM, proc: CommandProc, before:
BOOL ←
TRUE];
If before is true, proc goes at front of list. Else goes at end of list.
UnRegister:
PROC [name:
ATOM, proc: CommandProc];
Remove the proc from the list for the atom.
IsRegistered:
PROC [name:
ATOM, proc: CommandProc]
RETURNS [
BOOLEAN];
RecordInt:
PROC [i:
LONG
INTEGER];
RecordChar:
PROC [c:
CHARACTER];
RecordRef:
PROC [ref:
REF
ANY];
GetRepeatSequence:
PROC
RETURNS [params:
LIST
OF
REF
ANY];
SetCommand:
PROC [num: ComIndex, params:
LIST
OF
REF
ANY];
GetCommand:
PROC [num: ComIndex]
RETURNS [params:
LIST
OF
REF
ANY];
InterpInput:
PROC [viewer: ViewerClasses.Viewer, params:
LIST
OF
REF
ANY,
increaseNestingCount: BOOL ← TRUE];
Interpret:
PROC [viewer: ViewerClasses.Viewer, params:
LIST
OF
REF
ANY];
DontDoIt:
SIGNAL;
-- raised if user category is too low
BadMouse:
SIGNAL;
-- raised if mouse "color" is wrong
InterpretAtom:
PROC [viewer: ViewerClasses.Viewer, atom:
ATOM];
as if input from TIP
SaveCoords:
PROC [x,y:
INTEGER];
CheckSelection:
PROC [sel: TEditDocument.Selection]
RETURNS [
BOOLEAN];
FreeTree:
PROC [root: TextNode.Ref];
AllLevels: CommandProc;
FirstLevelOnly: CommandProc;
MoreLevels: CommandProc;
FewerLevels: CommandProc;
AllLines: CommandProc;
FirstLineOnly: CommandProc;
MoreLines: CommandProc;
MaxLevelShown: PROC [tdd: TEditDocument.TEditDocumentData] RETURNS [level: INTEGER];
MakePointSelection: CommandProc;
Cancel: CommandProc;
Repeat: CommandProc;
RestoreSelectionA: CommandProc;
SaveSelectionA: CommandProc;
RestoreSelectionB: CommandProc;
SaveSelectionB: CommandProc;
END.