EditToolPrivate.mesa
Copyright Ó 1985, 1986, 1991, 1992 by Xerox Corporation. All rights reserved.
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
Michael Plass, March 28, 1985 8:59:29 am PST
Alison Lee June 26, 1986 2:32:29 pm PDT
Swinehart, November 14, 1986 10:11:36 am PST
Doug Wyatt, March 16, 1992 3:49 pm PST
DIRECTORY
EditToolBuilder USING [Layout, LayoutRec],
Menus USING [ClickProc, MenuEntry, MenuProc],
Rope USING [ROPE],
TEditDocument USING [Selection],
TEditInput USING [CommandProc],
Tioga USING [Node, Looks, Event],
TiogaFind USING [Target, Subs, Match],
ViewerClasses USING [Viewer];
EditToolPrivate: CEDAR DEFINITIONS = BEGIN
ROPE: TYPE ~ Rope.ROPE;
Viewer: TYPE ~ ViewerClasses.Viewer;
command registration stuff
CommandProc: TYPE ~ TEditInput.CommandProc;
Register: PROC [atom: ATOM, op: CommandProc] RETURNS [LIST OF REF];
general stuff
DoButton: PROC [redList, blueList: LIST OF REF ¬ NIL,
redButton: BOOL ¬ FALSE, viewer: Viewer ¬ NIL];
numHeights: CARDINAL = 4;
numScrollRegions: CARDINAL = 8;
maxNumHeights: CARDINAL = 8; -- larger of numHeights and numScrollRegions
otherField: CARDINAL = 7;
HeightScheme: TYPE = { fixed, variable };
NodeKind: TYPE = {forRoot, forSelectedNodes, forSelectedChars};
SearchWhere: TYPE = {anywhere, words, nodes};
Info: TYPE = REF InfoRec;
InfoRec: TYPE = RECORD [
heights: ARRAY [0..numHeights) OF CARDINAL,
scrollSectionInfo: ScrollRecType,
whichHeightScheme: HeightScheme,
currentHeightIndex: [0..maxNumHeights),
interrupt: REF BOOL,
searchWhere: SearchWhere,
looksExact: BOOL,
ignoreLooks: BOOL,
ignoreText: BOOL,
ignoreFormat: BOOL,
ignoreStyle: BOOL,
ignoreComment: BOOL,
literal: BOOL,
ignoreCase: BOOL,
doReplace: BOOL,
forceInitCap: BOOL,
caretFormat: BOOL,
subsRange: SubsRange,
sortIncreasing: BOOL,
sortKind: SortKind,
caretLooks: BOOL,
formatNode: NodeKind,
styleNode: NodeKind,
propNode: NodeKind,
targetArg: Viewer, -- Text
sourceArg: Viewer, -- Text
looksArg: Viewer, -- Text
formatNameArg: Viewer, -- Text
styleNameArg: Viewer, -- Text
propNameArg: Viewer, -- Text
propValueArg: Viewer, -- Text
propPatternArg: Viewer, -- Text
substituteButton: Viewer, -- Button
textButton: Viewer, -- Button
looksButton: Viewer, -- Button
formatButton: Viewer, -- Button
styleButton: Viewer, -- Button
commentButton: Viewer, -- Button
doitButton: Viewer, -- Button
sortOrderLabel: Viewer, -- Label
sortKindLabel: Viewer, -- Label
operationLabel: Viewer, -- Label
propNodeLabel: Viewer, -- Label
opsArg: Viewer, -- Text
filesArg: Viewer, -- Text
wdirArg: Viewer, -- Text
initCapLabel: Viewer, -- Label
caretFormatLabel: Viewer, -- Label
comArg: Viewer, -- Text
subsRangeLabel: Viewer, -- Label
looksMatchLabel: Viewer, -- Label
looksLabel: Viewer, -- Label
literalLabel: Viewer, -- Label
caseLabel: Viewer, -- Label
wordLabel: Viewer, -- Label
caretLooksLabel: Viewer, -- Label
formatNodeLabel: Viewer, -- Label
styleNodeLabel: Viewer, -- Label
target: TiogaFind.Target,
subs: TiogaFind.Subs,
goToSectionMenu: Menus.MenuEntry, -- "Sections" submenu.
layout: EditToolBuilder.Layout,
lastLayout: EditToolBuilder.LayoutRec, -- pointer to the layout information to the point just before the last gap and horizontal rule of the operations section.
layoutBeforeExtraCommandButtons: EditToolBuilder.LayoutRec,
lastRule: Viewer -- Rule
];
ScrollRecType: TYPE = ARRAY [0..numScrollRegions) OF IndividualScrollRec;
IndividualScrollRec: TYPE = RECORD [
name: ROPE,
entryNum: INTEGER,
height: INTEGER ¬ 0,
startLocation: INTEGER ¬ 0
];
SubsInfo: TYPE = REF SubsInfoRec;
SubsInfoRec: TYPE = RECORD [
substitute: BOOL,
searchLooks, targetLooks, sourceLooks: Tioga.Looks,
last: Tioga.Node,
lastLen, sourceLen: INT,
styleRope: ROPE,
sourceNode: Tioga.Node,
sourceFormat: ATOM,
sourceStyle: ATOM,
sourceComment: BOOL,
event: Tioga.Event
];
ButtonCommandRec: TYPE = RECORD [
name: ROPE,
atom: ATOM,
atomComList: LIST OF REF ANY,
commandOp: CommandProc,
before: BOOL,
startNextLine: BOOL,
viewer: Viewer
];
editTool: Viewer;
mainToolInfo: Info;
tSel: TEditDocument.Selection;
ChangeState: PROC [flag: BOOL, 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: Menus.ClickProc;
DoYesMenuButton: Menus.ClickProc;
DoNoMenuButton: Menus.ClickProc;
DoItMenuButton: Menus.ClickProc;
DoCountMenuButton: Menus.ClickProc;
DoSearchMenuButton: Menus.ClickProc;
Search related stuff
BuildSearchButtons: PROC [info: Info, realNames: BOOL ¬ FALSE];
BuildTargetEntry: PROC [info: Info];
SearchDir: TYPE ~ {forwards, backwards, anywhere};
Search: PROC [whichDir: SearchDir, info: Info];
TrySearch: PROC [whichDir: SearchDir, info: Info] RETURNS [found: BOOL];
CheckPSel: PROC [pSel: TEditDocument.Selection, typescriptOK: BOOL ¬ TRUE]
RETURNS [ok: BOOL];
Pattern: TYPE ~ REF PatternRep;
PatternRep: TYPE ~ RECORD [
target: TiogaFind.Target,
case: BOOL, match: TiogaFind.Match,
checkLooks: BOOL, looksExact: BOOL,
checkComment: BOOL, comment: BOOL,
checkFormat: BOOL, format: ATOM,
checkStyle: BOOL, style: ATOM
];
GetPattern: PROC [info: Info] RETURNS [Pattern];
Substitute related stuff
SubsRange: TYPE ~ {withinSel, afterSel, entireDoc};
BuildSourceEntry: PROC [info: Info];
BuildDoItEntries: PROC [info: Info];
BuildOperationEntry: PROC [info: Info, realNames: BOOL ¬ FALSE];
BuildInitCapEntry: PROC [info: Info, realNames: BOOL ¬ FALSE];
BuildOperationField: PROC [info: Info];
BuildGetAndSetOpsEntries: PROC [info: Info];
BuildFileListEntries: PROC [info: Info];
BuildComNumField: PROC [info: Info];
BuildSubstituteEntry: PROC [info: Info, realNames: BOOL ¬ FALSE];
BuildPatternDocEntry: PROC [info: Info];
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];
SortKind: TYPE ~ {sortText, sortLines, sortBranches};
Looks related stuff
BuildLooksButtons: PROC [info: Info];
Getting arguments
BadArg: ERROR;
GetNameArg: PROC [arg: Viewer] RETURNS [ROPE];
GetRopeArg: PROC [arg: Viewer] RETURNS [ROPE];
Miscellaneous related stuff
BuildFormatButtons: 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: BOOL ¬ TRUE];
DoList2: PROC [list: LIST OF REF ANY, typescriptOK: BOOL ¬ TRUE];
Registration of additional buttons stuff
LastHRule: PROC [info: EditToolBuilder.Layout, thickness: CARDINAL ¬ 1, gapAbove, gapBelow: BOOL ¬ TRUE] RETURNS [rule: Viewer];
put the last horizontal rule of the tool across the full width of the container
it is the same as HRule except it returns the rule viewer
if gapAbove is true, then move down by entryVSpace before placing the rule
if gapBelow if true, then move down by entryVSpace after placing the rule
BuildRealExtraButtons: PROC [info: Info];
BuildRealExtraOverflow: PROC [info: Info];
BuildRegisterButtons: PROC [info: Info, listComm: LIST OF ButtonCommandRec];
BuildRealPropertyButtons: PROC [info: Info];
BuildRealStyleButtons: PROC [info: Info];
BuildRealFormatButtons: PROC [info: Info];
BuildRealLooksButtons: PROC [info: Info];
BuildRealGetAndSetOpsEntries: PROC [info: Info];
BuildRealComNumField: PROC [info: Info];
BuildRealFileListEntries: PROC [info: Info];
BuildRealSortButtons: PROC [info: Info];
DoScrollToOpsMenuButton: Menus.MenuProc;
DoScrollToMenuButton: Menus.MenuProc;
END.