DIRECTORY EditNotify USING [Change]; UndoEvent: CEDAR DEFINITIONS ~ BEGIN Event: TYPE ~ REF EventRep; EventRep: TYPE ~ RECORD [subevents: SubEvent]; -- actual type of Tioga.EventRep SubEvent: TYPE = REF SubEventBody; SubEventBody: TYPE = RECORD [ next: SubEvent, undoProc: UndoProc, undoRef: REF Change ]; Change: TYPE ~ EditNotify.Change; UndoProc: TYPE = PROC [undoRef: REF Change, currentEvent: Event]; Create: PROC RETURNS [Event]; Note: PROC [event: Event, undoProc: UndoProc, undoRef: REF Change]; Undo: PROC [undoEvent: Event, currentEvent: Event ¬ NIL]; Reset: PROC [event: Event]; Empty: PROC [event: Event] RETURNS [BOOL]; END. L UndoEvent.mesa Copyright Σ 1985, 1986, 1991, 1992 by Xerox Corporation. All rights reserved. written by Bill Paxton, June 1981 last edit by Bill Paxton, April 5, 1982 12:39 pm Doug Wyatt, February 26, 1992 12:20 pm PST An undo event is a series of actions that are to be undone as a unit. The event record contains sufficient information to undo the actions. undo list contains changes. procedure supplied by client to undo the effects of a particular subevent adds to list of subevents otherwise, calls undoProc[undoRef,currentEvent] for each subevent in reverse order that subevents originally happened currentEvent arg is to record the effects of Undo so it too will be undoable resets the list of subevents to NIL Undo automatically does a Reset when it is finished returns true if subevents list is empty Κΰ–(cedarcode) style•NewlineDelimiter ™codešœ™Kšœ ΟeœC™NKšœ!™!Kšœ0™0K™*—K˜KšœE™EKšœE™EK™šΟk ˜ Kšœ žœ ˜K™—šΟn œžœž œž˜$K™—Kšœžœžœ ˜šœ žœžœΟc ˜OK™—Kšœ žœžœ˜"šœžœžœ˜K˜K˜Kšœ žœ˜K˜K˜—šœžœ˜!Kšœ™K˜—šœ žœžœ žœ˜AKšœI™IK˜—šŸœžœžœ ˜K˜—šŸœžœ-žœ ˜CKšœ-™-K˜—šŸœžœ*žœ˜9KšœB™BKšœ3™3KšœL™LK˜—šŸœžœ˜Kšœ#™#Kšœ3™3K˜—šŸœžœžœžœ˜*Kšœ'™'K˜—Kšžœ˜—…—ˆ΄