DIRECTORY EditNotify; UndoEvent: CEDAR DEFINITIONS = BEGIN Ref: TYPE = REF EventBody; EventBody: PUBLIC TYPE = RECORD [subevents: SubEvent]; 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: Ref]; Create: PROC RETURNS [Ref]; Note: PROC [event: Ref, undoProc: UndoProc, undoRef: REF Change]; Undo: PROC [undoEvent: Ref, currentEvent: Ref _ NIL]; Reset: PROC [event: Ref]; Empty: PROC [event: Ref] RETURNS [BOOLEAN]; END. öUndoEvent.mesa; written by Bill Paxton, June 1981 edited by McGregor, February 8, 1983 11:47 am edited by Bill Paxton, June 1, 1983 10:23 am 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 ʤ˜JšÏc1™1Jš-™-Jš,™,J˜JšD™DJšD™DJ˜šÏk ˜ J˜ —J˜Jšœ žœ˜Jšž˜J˜Jšœžœžœ ˜Jšœ žœžœžœ˜6J˜Jšœ žœžœ˜"šœžœžœ˜J˜J˜Jšœ žœ˜J˜J˜—šœžœ˜!Jš™J˜—šÏnœžœžœ žœ˜?JšI™IJ˜—JšŸœžœžœ˜J˜šŸœžœ+žœ ˜AJš-™-J˜—šŸœžœ&žœ˜5JšB™BJš3™3JšL™LJ˜—šŸœžœ˜Jš#™#Jš3™3J˜—šŸœžœžœžœ˜+Jš'™'J˜—Jšžœ˜J˜J˜J˜—…—\ö