DIRECTORY Tioga USING [Node]; TextNodeRegistry: CEDAR DEFINITIONS ~ BEGIN Node: TYPE ~ Tioga.Node; TransformProc: TYPE ~ PROC [node: Node, parent: Node, wantFirst: BOOLEAN, clientData: REF ANY] RETURNS [new: Node]; SizeProc: TYPE ~ PROC [node: Node, clientData: REF ANY] RETURNS [size: INT]; ActivityProc: TYPE ~ PROC [on: BOOLEAN, clientData: REF ANY] RETURNS []; ProcSet: TYPE = REF ProcSetRec; ProcSetRec: TYPE = RECORD[ activityOn: BOOLEAN ¬ FALSE, transformProc: TransformProc ¬ NIL, transformProcData: REF ANY ¬ NIL, sizeProc: SizeProc ¬ NIL, sizeProcData: REF ANY ¬ NIL, activityProc: ActivityProc ¬ NIL, activityProcData: REF ANY ¬ NIL]; Register: PROC [activity: ATOM, procs: ProcSet] RETURNS []; UnRegister: PROC [activity: ATOM] RETURNS []; GetProcs: PROC[activity: ATOM] RETURNS [procs: ProcSet]; ActivityOn: PROC [activity: ATOM, on: BOOLEAN ¬ TRUE] RETURNS [wasOn: BOOLEAN]; IsActivityOn: PROC [activity: ATOM] RETURNS [isOn: BOOLEAN]; NotifyProc: TYPE ~ PROC [handle: REF ANY, activity: ATOM, nowOn: BOOLEAN] RETURNS []; NotifySet: TYPE = REF NotifySetRec; NotifySetRec: TYPE = RECORD[ registrationNotify: NotifyProc ¬ NIL, unRegistrationNotify: NotifyProc ¬ NIL, activityOnNotify: NotifyProc ¬ NIL]; NotificationRegister: PROC[handle: REF ANY, notifyProcs: NotifySet] RETURNS []; NotificationUnRegister: PROC[handle: REF ANY, doNotify: BOOLEAN ¬ FALSE] RETURNS []; DoTransform: PROC [activity: ATOM, node: Node, parent: Node ¬ NIL, wantFirst: BOOLEAN ¬ TRUE] RETURNS [new: Node]; GetSize: PROC [activity: ATOM, node: Node] RETURNS [size: INT]; END. h TextNodeRegistry.mesa Copyright Σ 1987, 1991 by Xerox Corporation. All rights reserved. Doug Terry, July 28, 1988 5:04:37 pm PDT Don Baker, May 27, 1988 1:44:55 pm PDT Doug Wyatt, October 8, 1991 4:49 pm PDT Transformations on text nodes can be registered to provide for a rudimentary type of "active" Tioga document. These transformations are done by Tioga on demand, that is, registered transformation procedures are called at the time that a node with the "Active" property is to be returned to clients of TextNode (the value of the "Active" property identifies the activity to be performed). The rules regarding legal transformations are as follows:  A node may transform into one or more sibling nodes,  A node may not be deleted by a transformation,  The transformation procedure is responsible for making any necessary changes in the document tree, i.e. reestablishing proper child and next links for new nodes; these changes must obey the previous two rules,  An active node may transform into another active node, however, in this case, the new active node may been seen by clients; the transformation on it will not occur until the next time the node is requested. Performs a transformation on the given node and returns the resulting node. If the transformation results in more than one new node then the first new node is returned if wantFirst=TRUE, otherwise the last new node is returned. Computes or estimates the size that the given node will be AFTER it is transformed. Informs clients whether or not the registered transformations should be currently applied. The given TransformProc will hereafter be applied to all nodes having an active property with value=activity. Notification procedures are invoked accordingly. Removes the procedures associated with the given activity. Notification procedures are invoked accordingly. Return the procedures associated with the given activity. Determines whether or not the registered transformations should be currently applied; if activity=NIL then activity is turned on/off for all registered clients. Registered clients are informed via callbacks when this switch is toggled so they can take appropriate action. Notification procedures are called accordingly. Returns true if the activity specified is on. Notifies client of an addition, deletion, or status change in the list of registered activities. Registers a set of notification procedures which are called both in the event of a change in activity registration or status *and* during this call, notification will be given of the "registration" of those activities which are already registered. Note that handle serves as a unique key for the registration. Unregisters a set of notification procedures. If doNotify is true, notification of the "unregistration" of registered activities will be made during this call. Force the TransformProc associated with the given activity to be applied to the node. (This is intended primarily for use by TextNodeImpl.) Computes or estimates the size that the given node will be AFTER it is transformed by the specified activity. (This is intended primarily for use by TextNodeImpl.) Κš•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ Οeœ7™BKšœ(™(Kšœ&™&K™'K˜K™„K™K™9K™6K™0K™ΣK™ΠK™—šΟk ˜ Kšœžœ˜—K˜šΟnœžœž œž˜+K˜Kšœžœ˜K˜š œžœžœ'žœžœžœžœ ˜sKšœδ™δK™—š œ žœžœžœžœžœžœ˜LK™S—K˜š œžœžœžœžœžœžœ˜HKšœZ™ZK™—Kšœ žœžœ ˜šœ žœžœ˜Kšœ žœžœ˜Kšœžœ˜#Kšœžœžœžœ˜!Kšœžœ˜Kšœžœžœžœ˜Kšœžœ˜!Kšœžœžœžœ˜!K˜—šŸœžœ žœžœ˜;KšœŸ™ŸK™—šŸ œžœ žœžœ˜-K™lK™—šŸœžœ žœžœ˜8Jšœ9™9J™—šŸ œžœ žœžœžœžœ žœ˜OKšœΑ™ΑK™—š Ÿ œžœ žœžœžœ˜