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; CommandProc: TYPE ~ TEditInput.CommandProc; Register: PROC [atom: ATOM, op: CommandProc] RETURNS [LIST OF REF]; 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 DoSubstituteMenuButton: Menus.ClickProc; DoYesMenuButton: Menus.ClickProc; DoNoMenuButton: Menus.ClickProc; DoItMenuButton: Menus.ClickProc; DoCountMenuButton: Menus.ClickProc; DoSearchMenuButton: Menus.ClickProc; 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]; 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]; BuildSortButtons: PROC [info: Info]; SortKind: TYPE ~ {sortText, sortLines, sortBranches}; BuildLooksButtons: PROC [info: Info]; BadArg: ERROR; GetNameArg: PROC [arg: Viewer] RETURNS [ROPE]; GetRopeArg: PROC [arg: Viewer] RETURNS [ROPE]; 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]; LastHRule: PROC [info: EditToolBuilder.Layout, thickness: CARDINAL ¬ 1, gapAbove, gapBelow: BOOL ¬ TRUE] RETURNS [rule: Viewer]; 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. – 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 command registration stuff general stuff Menu procs Search related stuff Substitute related stuff Sort related stuff Looks related stuff Getting arguments Miscellaneous related stuff Registration of additional buttons stuff 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 Κ O•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ ΟeœC™NKšœ.™.Kšœ+™+Kšœ%™%K™,K™'K™,Kšœ&™&—K˜šΟk ˜ Kšœžœ˜*Kšœžœ"˜-Kšœžœžœ˜Kšœžœ ˜ Kšœ žœ˜Kšœžœ˜!Kšœ žœ˜&Kšœžœ ˜—K˜KšΟnœžœž œž˜*K˜Kšžœžœžœ˜Kšœžœ˜$K™Kšœ™K˜šœ žœ˜+K˜—KšŸœžœžœžœžœžœžœ˜CK˜Kšœ ™ K˜šŸœžœžœžœžœžœžœžœžœ˜fK˜—Kšœ žœ˜Kšœžœ˜KšœžœΟc,˜JKšœ žœ˜Kšœžœ˜)K˜Kšœ žœ1˜?K˜Kšœ žœ˜-K˜Kšœžœžœ ˜šœ žœžœ˜Kšœ žœžœžœ˜+Kšœ!˜!K˜ Kšœ'˜'Kšœ žœžœ˜K˜Kšœ žœ˜Kšœ žœ˜Kšœ žœ˜Kšœžœ˜Kšœ žœ˜Kšœžœ˜Kšœ žœ˜Kšœ žœ˜Kšœ žœ˜Kšœžœ˜Kšœ žœ˜K˜Kšœžœ˜K˜Kšœ žœ˜K˜K˜K˜Kšœ ˜Kšœ ˜Kšœ ˜Kšœ ˜Kšœ ˜Kšœ ˜Kšœ ˜Kšœ ˜Kšœ  ˜#Kšœ  ˜Kšœ  ˜Kšœ  ˜Kšœ  ˜Kšœ  ˜ Kšœ  ˜Kšœ ˜ Kšœ ˜Kšœ ˜ Kšœ ˜Kšœ ˜Kšœ ˜Kšœ ˜Kšœ ˜Kšœ ˜"Kšœ ˜Kšœ ˜ Kšœ ˜!Kšœ ˜Kšœ ˜Kšœ ˜Kšœ ˜Kšœ ˜!Kšœ ˜!Kšœ ˜ K˜Kšœ˜Kšœ#Πci˜9K˜Kšœ'‘y˜ Kšœ;˜;Kšœ ˜K˜K˜—Kšœžœžœžœ˜Išœžœžœ˜$Kšœžœ˜ Kšœ žœ˜Kšœžœ˜Kšœžœ˜Kšœ˜K˜—Kšœ žœžœ ˜!šœ žœžœ˜Kšœ žœ˜K˜3K˜Kšœžœ˜Kšœ žœ˜Kšœ˜Kšœžœ˜Kšœ žœ˜Kšœžœ˜K˜K˜K˜—šœžœžœ˜!Kšœžœ˜ Kšœžœ˜ Kš œ žœžœžœžœ˜Kšœ˜Kšœžœ˜ Kšœž˜Kšœ˜K˜K˜—Kšœ˜K˜K˜K˜K˜K˜Kš Ÿ œžœžœžœžœžœ˜AK˜Kš Ÿ œžœ&žœžœžœ˜DK˜KšŸœžœ ?˜OK˜KšŸœžœ 7˜FK˜Kšœ ™ K˜KšŸœ˜(KšŸœ˜!KšŸœ˜ KšŸœ˜ KšŸœ˜#šŸœ˜$K˜—Kšœ™K˜KšŸœžœžœžœ˜?KšŸœžœ˜$K˜Kšœ žœ#˜2KšŸœžœ#˜/KšŸ œžœ#žœ žœ˜HK˜š Ÿ œžœ/žœžœžœžœ˜_K˜—Kšœ žœžœ ˜šœ žœžœ˜K˜Kšœžœ˜#Kšœ žœžœ˜#Kšœžœ žœ˜"Kšœ žœ žœ˜ Kšœ žœ ž˜K˜K˜—KšŸ œžœžœ ˜0K˜Kšœ™K˜Kšœ žœ$˜3K˜KšŸœžœ˜$KšŸœžœ˜$KšŸœžœžœžœ˜@KšŸœžœžœžœ˜>KšŸœžœ˜'KšŸœžœ˜,KšŸœžœ˜(KšŸœžœ˜$KšŸœžœžœžœ˜AKšŸœžœ˜(šŸœžœ˜,K˜—KšŸœžœžœžœžœžœžœ˜:K˜KšŸœžœ˜K˜Kšœ™K˜KšŸœžœ˜$K˜Kšœ žœ'˜5K˜Kšœ™K˜KšŸœžœ˜%K˜K™K˜KšŸœžœ˜KšŸ œžœžœžœ˜.KšŸ œžœžœžœ˜.K˜Kšœ™K˜KšŸœžœ˜&K˜KšŸœžœ˜%K˜KšŸœžœ˜(K˜KšŸœžœ˜%K˜KšŸœžœ˜&K˜KšŸœžœžœžœžœžœžœžœ˜@K˜KšŸœžœžœžœžœžœžœžœ˜AK˜K™(š Ÿ œžœ+žœžœžœžœ˜€KšœO™OK™9KšœJ™JKšœI™IK˜—KšŸœžœ˜)KšŸœžœ˜*KšŸœžœžœžœ˜LKšŸœžœ˜,KšŸœžœ˜)KšŸœžœ˜*KšŸœžœ˜)KšŸœžœ˜0KšŸœžœ˜(KšŸœžœ˜,KšŸœžœ˜(KšŸœ˜(KšŸœ˜%K˜Kšžœ˜—…—²(—