DIRECTORY TextNode USING [Node]; NodeAddrs: CEDAR DEFINITIONS = BEGIN Node: TYPE = TextNode.Node; AddrsProp: PROC RETURNS [ATOM]; PutTextAddr: PROC [n: Node, addr: REF, location: INT, pin: BOOL _ FALSE]; RemTextAddr: PROC [n: Node, addr: REF]; PinTextAddr: PROC [n: Node, addr: REF]; UnpinTextAddr: PROC [n: Node, addr: REF]; UnpinAll: PROC [n: Node]; MoveTextAddr: PROC [from, to: Node, addr: REF, location: INT]; GetTextAddr: PROC [n: Node, addr: REF] RETURNS [node: Node, location: INT]; TryGetTextAddr: PROC [n: Node, addr: REF] RETURNS [found: BOOL, node: Node, location: INT]; TextAddrNotFound: ERROR; MapTextAddrs: PROC [n: Node, action: TextAddrsAction] RETURNS [BOOL]; TextAddrsAction: TYPE = PROC [addr: REF, location: INT] RETURNS [BOOL]; AddNotifyProc: PROC [proc: AddrNotifyProc]; RemoveNotifyProc: PROC [proc: AddrNotifyProc]; AddrNotifyProc: TYPE = PROC [node: Node, new: PROC [old: INT] RETURNS [INT]]; Replace: PROC [node: Node, start, len, newlen: INT]; AfterReplace: PROC [initLoc, start, len, newlen: INT] RETURNS [newLoc: INT]; END. ΚNodeAddrs.mesa Copyright c 1985, 1986 by Xerox Corporation. All rights reserved. written by Paxton. March 1981 last written by Paxton. December 28, 1982 10:40 am Last Edited by: Maxwell, January 5, 1983 8:42 am Doug Wyatt, September 8, 1986 2:14:17 pm PDT Persistent addressing for characters in text node. assigns addr to location in text ok if addr was previously assigned elsewhere in the text location automatically updated when text is edited removes the given addr if addr has been moved, does RemTextAddr on new location also don't modify location when edits take place does RemTextAddr[from, addr]; PutTextAddr[to, addr, location]; add leaves forwarding address for use by GetTextAddr generates ERROR TextAddrNotFound if the addr is not in the mapping node may be different than n if addr has been moved apply the action to each addr&location pair for the text returns true if&when an action returns true skips pinned or moved addresses Notify proc registration Editing Operations for persistent addrs replace chars in [start..start+len) by newlen chars addrs that are in the replaced section move to start add (newlen-len) to addrs that are after the replaced section Update Functions for persistent addrs ΚΡ˜codešœ™Kšœ Οmœ7™BKšœ™Kšœ2™2K™0K™,—K™Kšœ2™2K™šΟk ˜ Kšœ žœ˜—K˜KšΠbl œžœž ˜Kšœž˜K˜Kšœžœ˜K˜KšΟn œžœžœžœ˜K˜š   œžœžœ žœžœžœ˜JKšœ ™ Kšœ8™8Kšœ2™2K˜—š  œžœžœ˜'Kšœ™K™=K˜—š  œžœžœ˜'Kšœ+™+K˜—š  œžœžœ˜)K˜—š œžœ ˜K˜—š  œžœžœ žœ˜>Kšœ>™>Kšœ4™4K˜—K˜š   œžœžœžœžœ˜KKšœB™BK™3K˜—š  œžœžœžœ žœžœ˜\K˜—šœžœ˜K˜—K˜š  œžœ$žœžœ˜EKšœ8™8Kšœ+™+K™K˜—š œžœžœžœ žœžœžœ˜GK˜—K˜Kšœ™K˜Kš  œžœ˜+š œžœ˜.K˜—š œžœžœžœžœžœžœ˜MK˜—K˜Kšœ'™'K˜š œžœ"žœ˜4Kšœ3™3Kšœ4™4Kšœ=™=K˜—K˜Kšœ%™%K˜š   œžœžœžœ žœ˜LK˜—K˜Kšžœ˜—…—> Ω