EditToolPrivate.mesa
Edited by Paxton on December 30, 1982 10:21 am
Edited by McGregor on June 11, 1982 1:50 pm
Russ Atkinson, July 22, 1983 11:09 am
Doug Wyatt, January 12, 1984 11:29 am
DIRECTORY
Buttons USING [Button],
EditToolBuilder USING [Layout],
Labels USING [Label],
Menus USING [MenuProc],
NameSymbolTable USING [Name],
Rope USING [ROPE, RopeRep],
RopeReader USING [Ref],
TEditDocument USING [Selection],
TEditInput USING [CommandProc],
TextFind USING [PatternErrorCode],
TextLooks USING [Looks, Runs],
TextNode USING [MaxLen, Offset, Ref, RefTextNode, TypeName],
TiogaOps USING [SearchDir],
TreeFind USING [CommentControl, Finder],
UndoEvent USING [Ref],
ViewerClasses USING [Viewer];
EditToolPrivate: CEDAR DEFINITIONS
SHARES Rope = {
-- command registration stuff
Register: PROC [atom: ATOM, op: TEditInput.CommandProc] RETURNS [LIST OF REF];
-- general stuff
DoButton: PROC [
redList, blueList: LIST OF REFNIL,
redButton: BOOLFALSE,
viewer: ViewerClasses.Viewer ← NIL];
numHeights: CARDINAL = 4;
NodeKind: TYPE = BOOLEAN;
root: NodeKind = FALSE;
selection: NodeKind = TRUE;
SearchWhere: TYPE = [0..2];
anywhere: SearchWhere = 0;
words: SearchWhere = 1;
nodes: SearchWhere = 2;
Info: TYPE = REF InfoRec;
InfoRec: TYPE = RECORD [
heights: ARRAY [0..numHeights) OF CARDINAL,
currentHeightIndex: [0..numHeights),
interrupt: REF BOOLEAN,
searchWhere: SearchWhere,
looksExact: BOOLEAN,
ignoreLooks: BOOLEAN,
ignoreText: BOOLEAN,
ignoreType: BOOLEAN,
ignoreStyle: BOOLEAN,
ignoreComment: BOOLEAN,
literal: BOOLEAN,
ignoreCase: BOOLEAN,
doReplace: BOOLEAN,
forceInitCap: BOOLEAN,
caretType: BOOLEAN,
subsRange: [0..2],
sortIncreasing: BOOLEAN,
sortKind: [0..2],
caretLooks: BOOLEAN,
typeNode: NodeKind,
styleNode: NodeKind,
propNode: NodeKind,
targetArg: ViewerClasses.Viewer,
sourceArg: ViewerClasses.Viewer,
looksArg: ViewerClasses.Viewer,
typeNameArg: ViewerClasses.Viewer,
styleNameArg: ViewerClasses.Viewer,
propNameArg: ViewerClasses.Viewer,
propValueArg: ViewerClasses.Viewer,
propPatternArg: ViewerClasses.Viewer,
substituteButton: Buttons.Button,
textButton: Buttons.Button,
looksButton: Buttons.Button,
typeButton: Buttons.Button,
styleButton: Buttons.Button,
commentButton: Buttons.Button,
doitButton: Buttons.Button,
sortOrderLabel: Labels.Label,
sortKindLabel: Labels.Label,
operationLabel: Labels.Label,
propNodeLabel: Labels.Label,
opsArg: ViewerClasses.Viewer,
filesArg: ViewerClasses.Viewer,
wdirArg: ViewerClasses.Viewer,
initCapLabel: Labels.Label,
caretTypeLabel: Labels.Label,
comArg: ViewerClasses.Viewer,
subsRangeLabel: Labels.Label,
looksMatchLabel: Labels.Label,
looksLabel: Labels.Label,
literalLabel: Labels.Label,
caseLabel: Labels.Label,
wordLabel: Labels.Label,
caretLooksLabel: Labels.Label,
typeNodeLabel: Labels.Label,
styleNodeLabel: Labels.Label,
finder: TreeFind.Finder,
varRuns: TextLooks.Runs,
varRope: Rope.ROPE,
layout: EditToolBuilder.Layout ];
SubsInfo: TYPE = REF SubsInfoRec;
SubsInfoRec: TYPE = RECORD [
substitute: BOOLEAN,
searchLooks, targetLooks, sourceLooks: TextLooks.Looks,
last: TextNode.Ref,
lastLen, sourceLen: TextNode.Offset,
sourceRope, styleRope: Rope.ROPE,
sourceRuns: TextLooks.Runs,
nameRope: REF substr node Rope.RopeRep,
sourceType: TextNode.TypeName,
sourceStyle: NameSymbolTable.Name,
sourceComment: BOOLEAN,
rdr: RopeReader.Ref,
event: UndoEvent.Ref ];
editTool: ViewerClasses.Viewer;
mainToolInfo: Info;
Event: TYPE = UndoEvent.Ref;
tSel: TEditDocument.Selection;
ChangeState: PROC [flag: BOOLEAN, trueList, falseList: LIST OF REF];
CycleTriple: PROC [state: [0..2], list0, list1, list2: LIST OF REF];
SavePSel: PROC; -- if pSel is not in data field of Edit Tool, save it for later
FixPSel: PROC; -- if pSel is in data field of Edit Tool, restore prior
-- Menu procs
DoSubstituteMenuButton, DoYesMenuButton, DoNoMenuButton,
DoItMenuButton, DoCountMenuButton, DoSearchMenuButton: Menus.MenuProc;
-- Search related stuff
BuildSearchEntries, BuildSearchButtons, BuildTargetEntry: PROC [info: Info];
Search: PROC [whichDir: TiogaOps.SearchDir, info: Info];
TrySearch: PROC [whichDir: TiogaOps.SearchDir, info: Info] RETURNS [found: BOOL];
CheckPSel: PROC [pSel: TEditDocument.Selection, typescriptOK: BOOLTRUE]
RETURNS [ok: BOOLEAN];
GetPatternNode: PROC [info: Info] RETURNS [pattern: TextNode.RefTextNode];
Extend: PROC[info: Info, forward: BOOLEAN, searchLooks: TextLooks.Looks,
where: TextNode.RefTextNode, at, atEnd: TextNode.Offset,
last: TextNode.Ref ← NIL, lastLen: TextNode.Offset ← TextNode.MaxLen]
RETURNS [newAt, newAtEnd: TextNode.Offset];
ReportPatternError: PROC [ec: TextFind.PatternErrorCode];
-- Substitute related stuff
withinSel: [0..2] = 0;
afterSel: [0..2] = 1;
entireDoc: [0..2] = 2;
GetLooksAndPatternInfo: PROC [pattern: TextNode.RefTextNode, info: Info]
RETURNS [pat: TextNode.RefTextNode,
lit: BOOLEAN,
searchLooks: TextLooks.Looks,
type: TextNode.TypeName,
style: NameSymbolTable.Name,
commentControl: TreeFind.CommentControl];
BuildSourceEntry, BuildDoItEntries, BuildOperationEntry, BuildInitCapEntry, BuildOperationField, BuildGetAndSetOpsEntries, BuildFileListEntries, BuildComNumField, BuildSubstituteEntry, BuildPatternDocEntry, BuildMiniPatternDocEntry: PROC [info: Info];
GetOps: PROC [info: Info] RETURNS [list: LIST OF REF ANY];
DoOpsCom: PROC [info: Info];
-- Sort related stuff
BuildSortButtons: PROC [info: Info];
sortText: [0..2] = 0;
sortLines: [0..2] = 1;
sortBranches: [0..2] = 2;
-- Looks related stuff
BuildLooksButtons: PROC [info: Info];
-- Miscellaneous related stuff
BuildTypeButtons: PROC [info: Info];
BuildStyleButtons: PROC [info: Info];
BuildPropertyButtons: PROC [info: Info];
BuildExtraButtons: PROC [info: Info];
BuildExtraOverflow: PROC [info: Info];
DoList: PROC [list: LIST OF REF ANY, typescriptOK: BOOLTRUE];
DoList2: PROC [list: LIST OF REF ANY, typescriptOK: BOOLTRUE];
}...