<<>> <> <> <> <> DIRECTORY Imager USING [Context], Rope USING [ROPE], Tioga USING [Location, Node, Span], TEditDocument USING [Selection, SelectionGrain, SelectionId, SelectionPoint, TEditDocumentData], ViewerClasses USING [ModifyProc, Viewer]; TEditSelection: CEDAR DEFINITIONS ~ BEGIN OPEN TEditDocument; ROPE: TYPE ~ Rope.ROPE; Viewer: TYPE ~ ViewerClasses.Viewer; <> pSel: READONLY Selection; sSel: READONLY Selection; fSel: READONLY Selection; oldSel: READONLY Selection; nilSel: READONLY Selection; <> <> <> <> Create: PROC RETURNS [Selection]; <> Alloc: PROC RETURNS [Selection]; <> Free: PROC [Selection]; <> Copy: PROC [source, dest: Selection]; <> <> <> PushOrExchangeSelections: PROC; MakePrimary: PROC; MakeSecondary: PROC; CancelPrimary: PROC; CancelSecondary: PROC; CancelFeedback: PROC; CallWithSelAndDocAndTddLocks: PROC [viewer: Viewer, id: SelectionId ¬ primary, proc: PROC [tdd: TEditDocumentData, tSel: Selection]]; UnlockDocAndPSel: PROC [root: Tioga.Node]; LockSel: PROC [selection: SelectionId, who: ROPE]; <> UnlockSel: PROC [selection: SelectionId]; <> <<>> LockBothSelections: PROC [who: ROPE]; -- locks primary, then secondary UnlockBothSelections: PROC; MakeSelection: PROC [new: Selection ¬ NIL, selection: SelectionId ¬ primary, startValid, endValid: BOOL ¬ FALSE, forkPaint: BOOL ¬ TRUE]; <> CaretVisible: PROC RETURNS [BOOL]; IsDown: PROC [id: SelectionId] RETURNS [BOOL]; ForceDown: PROC [id: SelectionId]; ShowSelection: PROC [id: SelectionId, self: Viewer, context: Imager.Context]; TakeDownForRedisplay: PROC [id: SelectionId, self: Viewer, context: Imager.Context]; FixUpAfterDisplay: PROC [id: SelectionId, self: Viewer, context: Imager.Context, caret: BOOL]; AdjustSelStates: PROC [self: Viewer]; TakeSelectionDown: PROC [id: SelectionId, self: Viewer, context: Imager.Context]; PutSelectionUp: PROC [id: SelectionId, self: Viewer, context: Imager.Context]; FakeSecondary: PROC [sel: Selection]; -- change sSel without showing it Deselect: PROC [selection: SelectionId ¬ primary]; <> MarkSelection: PROC [dc: Imager.Context, viewer: Viewer, selection: Selection, id: SelectionId]; ExtendSelection: PROC [dc: Imager.Context, viewer: Viewer, old, new: Selection, id: SelectionId, updateEnd: BOOL]; CannotFindIt: ERROR; <> ComputeSpanLines: PROC [viewer: Viewer, span: Tioga.Span] RETURNS [start, end: INTEGER, startClipped, endClipped: BOOL]; ComputePosLine: PROC [ viewer: Viewer, pos: Tioga.Location, firstLine: INTEGER ¬ 0] RETURNS [line: INTEGER, clipped: BOOL]; ComputePosPoint: PROC [ viewer: Viewer, pos: Tioga.Location, firstLine: INTEGER ¬ 0, lineOnly: BOOL ¬ FALSE] RETURNS [sp: SelectionPoint]; FixupSelection: PROC [selection: Selection, viewer: Viewer, start, end: BOOL ¬ TRUE]; FixupCaret: PROC [selection: Selection]; KillSelection: PROC; -- including resetting inputFocus MakePointSelection: PROC [selection: Selection, pos: Tioga.Location]; InputModify: ViewerClasses.ModifyProc; SelectEverything: PROC; -- expand to include everything GrowSelectionToBlanks: PROC; GrowSelectionToSomething: PROC [left, right: PROC [CHAR] RETURNS [BOOL]]; <> GrowSelection: PROC; PendingDeleteSelection: PROC; NotPendingDeleteSelection: PROC; CaretBeforeSelection: PROC; CaretAfterSelection: PROC; <> SelectProc: TYPE = PROC [viewer: Viewer, tdd: TEditDocumentData, x, y: INTEGER, sel: SelectionId, pDel: BOOL]; SelectPoint: SelectProc; SelectChar: SelectProc; SelectWord: SelectProc; SelectNode: SelectProc; SelectBranch: SelectProc; Update: SelectProc; LevelChange: TYPE = {reduce, expand, same}; Extend: PROC [viewer: Viewer, tdd: TEditDocumentData, x, y: INTEGER, sel: SelectionId, pDel: BOOL, changeLevel: LevelChange, saveEnds: BOOL]; <> SelectionRoot: PROC [s: Selection ¬ pSel] RETURNS [root: Tioga.Node]; InsertionPoint: PROC [s: Selection ¬ pSel] RETURNS [ip: Tioga.Location]; GetSelectionGrain: PROC [sel: Selection] RETURNS [SelectionGrain]; Position: PROC [viewer: Viewer]; FindWhere: TYPE = { forwards, backwards, anywhere }; Find: PROC [ viewer: Viewer, findWhere: FindWhere ¬ anywhere, def, word: BOOL ¬ FALSE, id: SelectionId ¬ primary, case: BOOL ¬ TRUE -- case => case of characters is significant -- ]; FindRope: PROC [viewer: Viewer, rope: ROPE, findWhere: FindWhere ¬ anywhere, def, word: BOOL ¬ FALSE, id: SelectionId ¬ primary, case: BOOL ¬ TRUE -- case => case of characters is significant -- ]; DoFind: PROC [viewer: Viewer, rope: ROPE, findWhere: FindWhere ¬ anywhere, def, word: BOOL ¬ FALSE, id: SelectionId ¬ primary, case: BOOL ¬ TRUE -- case => case of characters is significant -- ] RETURNS [found: BOOL]; SetSelLooks: PROC [sel: Selection]; ShowPosition: PROC[viewer: Viewer, skipCommentNodes: BOOL ¬ TRUE]; END.