<> <> <> DIRECTORY TiogaLooks, TiogaNode, TiogaTreeOps, TextEdit, EditNotify, UndoEvent; EditSpan: CEDAR DEFINITIONS IMPORTS TiogaLooks = BEGIN Ref: TYPE = TiogaNode.Ref; RefBranchNode: TYPE = TiogaNode.RefBranchNode; TreeLoc: TYPE = TiogaTreeOps.TreeLoc; TreeSpan: TYPE = TiogaTreeOps.TreeSpan; Event: TYPE = UndoEvent.Ref; <<**** Miscellaneous ****>> CannotDoEdit: ERROR; afterMoved1, afterMoved2: TreeLoc; <> <> <<**** Operations to add or delete looks ****>> Looks: TYPE = TiogaLooks.Looks; noLooks: Looks = TiogaLooks.noLooks; allLooks: Looks = TiogaLooks.allLooks; ChangeLooks: PROC [root: RefBranchNode, span: TreeSpan, remove, add: Looks, event: Event _ NIL]; <> AddLooks: PROC [root: RefBranchNode, span: TreeSpan, add: Looks, event: Event _ NIL] = INLINE { ChangeLooks[root, span, noLooks, add, event] }; RemoveLooks: PROC [root: RefBranchNode, span: TreeSpan, remove: Looks, event: Event _ NIL] = INLINE { ChangeLooks[root, span, remove, noLooks, event] }; SetLooks: PROC [root: RefBranchNode, span: TreeSpan, new: Looks, event: Event _ NIL] = INLINE { ChangeLooks[root, span, allLooks, new, event] }; ClearLooks: PROC [root: RefBranchNode, span: TreeSpan, event: Event _ NIL] = INLINE { ChangeLooks[root, span, allLooks, noLooks, event] }; <<>> <<***** Editing operations on spans>> Replace: PROC [ destRoot, sourceRoot: RefBranchNode, dest, source: TreeSpan, saveForPaste: BOOLEAN _ TRUE, event: Event _ NIL] RETURNS [result: TreeSpan]; <> <> <> Delete: PROC [root: RefBranchNode, del: TreeSpan, event: Event _ NIL, saveForPaste: BOOLEAN _ TRUE]; RecordGroupForPaste: PROC [start, end: Ref, event: Event]; -- for use by EditGroupImpl.Delete etc. SaveForPaste: PROC [span: TreeSpan, event: Event _ NIL]; SavedForPaste: PROC RETURNS [span: TreeSpan]; <> Place: TYPE = EditNotify.Place; -- { before, after, sibling, child }; <> <> <> <> <> <> Copy: PROC [destRoot, sourceRoot: RefBranchNode, dest: TreeLoc, source: TreeSpan, where: Place _ after, nesting: INTEGER _ 0, event: Event _ NIL] RETURNS [result: TreeSpan]; <> Move: PROC [destRoot, sourceRoot: RefBranchNode, dest: TreeLoc, source: TreeSpan, where: Place _ after, nesting: INTEGER _ 0, event: Event _ NIL] RETURNS [result: TreeSpan]; <> <> <> <> MoveOnto: PROC [destRoot, sourceRoot: RefBranchNode, dest, source: TreeSpan, saveForPaste: BOOLEAN _ TRUE, event: Event _ NIL] RETURNS [result: TreeSpan]; <> <> Transpose: PROC [ alphaRoot, betaRoot: RefBranchNode, alpha, beta: TreeSpan, event: Event _ NIL] RETURNS [newAlpha, newBeta: TreeSpan]; <> <> <<***** Insert new nodes>> Insert: PROC [root: RefBranchNode, old: Ref, where: Place _ after, event: Event _ NIL] RETURNS [new: Ref]; <> Inherit: PROC [old, new: Ref, allprops: BOOL _ FALSE]; InsertTextNode: PROC [ root: RefBranchNode, old: Ref, class: TiogaNode.ItemClassID, where: Place _ after, inherit: BOOL _ FALSE, event: Event _ NIL] RETURNS [new: TiogaNode.RefTextNode]; <> InsertBranchNode: PROC [ root: RefBranchNode, old: Ref, where: Place _ after, inherit: BOOL _ FALSE, event: Event _ NIL] RETURNS [new: TiogaNode.RefBranchNode]; <> InsertBoxNode: PROC [ root: RefBranchNode, old: Ref, class: TiogaNode.ItemClassID, where: Place _ after, inherit: BOOL _ FALSE, event: Event _ NIL] RETURNS [new: TiogaNode.RefBoxNode]; <> InsertListNode: PROC [ root: RefBranchNode, old: Ref, class: TiogaNode.ItemClassID, where: Place _ after, inherit: BOOL _ FALSE, event: Event _ NIL] RETURNS [new: TiogaNode.RefListNode]; <> InsertBasicNode: PROC [ root: RefBranchNode, old: Ref, class: TiogaNode.BasicClassID, where: Place _ after, inherit: BOOL _ FALSE, event: Event _ NIL] RETURNS [new: TiogaNode.RefBasicNode]; <> <<***** Break & Join>> <<>> BreakTextNode: PROC [root: RefBranchNode, loc: TreeLoc, event: Event _ NIL] RETURNS [new: Ref]; <> BreakParent: PROC [root: RefBranchNode, node: Ref, before: BOOL _ TRUE, event: Event _ NIL] RETURNS [Ref]; <> <> <> <> BreakStatement: PROC [root: RefBranchNode, node: Ref, before: BOOL _ TRUE, event: Event _ NIL] RETURNS [RefBranchNode]; <> <> JoinStatements: PROC [root, statement: RefBranchNode, event: Event _ NIL] RETURNS [loc: TreeLoc]; <> <<***** Nesting>> Nest: PROC [root: RefBranchNode, span: TreeSpan, event: Event _ NIL] RETURNS [new: TreeSpan] = INLINE { <> <> new _ ChangeNesting[root,span,1,event] }; UnNest: PROC [root: RefBranchNode, span: TreeSpan, event: Event _ NIL] RETURNS [new: TreeSpan] = INLINE { <> new _ ChangeNesting[root,span,-1,event] }; ChangeNesting: PROC [root: RefBranchNode, span: TreeSpan, change: INTEGER, event: Event _ NIL] RETURNS [new: TreeSpan]; END.