<> <> <> <> <> <> <> <> <<>> DIRECTORY EditSpan USING [Span], TextNode USING [Location, Node, Runs], Rope USING [ROPE], Rosary USING [ROSARY]; EditNotify: CEDAR DEFINITIONS = BEGIN ROPE: TYPE ~ Rope.ROPE; ROSARY: TYPE ~ Rosary.ROSARY; Runs: TYPE ~ TextNode.Runs; Node: TYPE ~ TextNode.Node; Location: TYPE ~ TextNode.Location; Span: TYPE ~ EditSpan.Span; <<**** Change Record ****>> ChangeType: TYPE = { ChangingView, ChangingText, ChangingTextForPaste, ChangingSpanForPaste, ChangingFormat, ChangingProp, MovingNodes, NodeNesting, InsertingNode }; Change: TYPE = RECORD [SELECT kind: ChangeType FROM ChangingView => [ viewer: REF, old: Location ], ChangingText => [ root: Node, text: Node, start, newlen, oldlen: INT, oldRope: ROPE, oldRuns: Runs, oldCharSets: ROSARY, oldCharProps: ROSARY ], ChangingTextForPaste => [ rope: ROPE, runs: Runs, charSets: ROSARY, charProps: ROSARY, start, len: INT ], ChangingSpanForPaste => [ span: Span ], ChangingFormat => [ -- change format for node root: Node, node: Node, newFormatName, oldFormatName: ATOM ], ChangingProp => [ -- change property for node root, node: Node, propName: ROPE, propAtom: ATOM, newval, oldval: REF ], MovingNodes => [ destRoot, sourceRoot: Node, dest, first, last, pred: Node, nesting: INTEGER, afterDest: BOOL ], <> <> NodeNesting => [ -- change nesting of nodes [first..last] root, first, last: Node, change: INTEGER ], InsertingNode => [ -- insert new node after dest root, new, dest: Node ], ENDCASE ]; ChangeSet: TYPE = PACKED ARRAY ChangeType OF Flag; Flag: TYPE = BOOL _ FALSE; defaultChangeSet: ChangeSet = ALL[TRUE]; <<**** Notification Operations ****>> EditNotifyProc: TYPE = PROC [change: REF READONLY Change]; When: TYPE = { before, after }; <> Priority: TYPE = { high, normal, low }; <> <> <> <> 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]; <> END.