<> <> <> <> DIRECTORY TiogaNode, TiogaLooks, TiogaTreeOps, Rope, ViewerClasses; EditNotify: CEDAR DEFINITIONS = BEGIN Ref: TYPE = TiogaNode.Ref; RefBranchNode: TYPE = TiogaNode.RefBranchNode; RefTextNode: TYPE = TiogaNode.RefTextNode; Looks: TYPE = TiogaLooks.Looks; Offset: TYPE = TiogaNode.Offset; ROPE: TYPE = Rope.ROPE; When: TYPE = { before, after }; <> Priority: TYPE = { high, normal, low }; <> <> <> <<**** Notification Operations ****>> EditNotifyProc: TYPE = PROC [change: REF READONLY Change]; AddNotifyProc: PROC [ proc: EditNotifyProc, time: When _ after, priority: Priority _ normal, changeSet: ChangeSet _ defaultChangeSet]; <> <> <> <> RemoveNotifyProc: PROC [ proc: EditNotifyProc, time: When _ after]; <> Notify: PROC [change: REF READONLY Change, time: When]; <> ChangeSet: TYPE = PACKED ARRAY OfChange OF Flag; Flag: TYPE = BOOLEAN _ FALSE; defaultChangeSet: ChangeSet = ALL[TRUE]; <<**** Change Record ****>> Change: TYPE = RECORD [SELECT kind:OfChange FROM ChangingView => [ viewer: ViewerClasses.Viewer, old: TiogaNode.Location ], ChangingText => [ root: RefBranchNode, text: RefTextNode, start, newlen, oldlen: Offset, oldRope: ROPE, oldRuns: TiogaLooks.Runs ], ChangingTextForPaste => [ rope: ROPE, runs: TiogaLooks.Runs, start, len: Offset ], ChangingSpanForPaste => [ span: TiogaTreeOps.TreeSpan ], ChangingFormat => [ -- change format for node root: RefBranchNode, node: Ref, newFormatName, oldFormatName: TiogaNode.Name], ChangingProp => [ -- change property for node root: RefBranchNode, node: Ref, propName: ROPE, propAtom: ATOM, newval, oldval: REF], MovingGroup => [ destRoot, sourceRoot: RefBranchNode, dest, sourceStart, sourceEnd, from: Ref, contents: BOOL], <> MovingNodes => [ destRoot, sourceRoot, dest, first, last: RefBranchNode, pred: Ref, nesting: INTEGER, afterDest: BOOL], <> <> NodeNesting => [ -- change nesting of nodes [first..last] root, first, last: RefBranchNode, change: INTEGER], InsertingNode => [ -- insert new node root: RefBranchNode, new, old: Ref, where: Place], Misc => [ -- for other kinds of edits. root tells document which must be locked if undo root: RefBranchNode, info: REF], Misc2 => [ -- for other kinds of edits. roots tell documents which must be locked if undo root1, root2: RefBranchNode, info: REF], ENDCASE ]; Place: TYPE = { before, after, sibling, child }; OfChange: TYPE = { ChangingView, ChangingText, ChangingTextForPaste, ChangingSpanForPaste, ChangingFormat, ChangingProp, MovingGroup, MovingNodes, NodeNesting, InsertingNode, Misc, Misc2 }; END.