DIRECTORY GGHistoryTypes, GGHistoryTypesOpaque, GGInterfaceTypes, GGModelTypes, RefTab, Rope, ViewerClasses; GGHistory: CEDAR DEFINITIONS = BEGIN OPEN GGHistoryTypes; GGData: TYPE = GGInterfaceTypes.GGData; Change: TYPE = GGHistoryTypesOpaque.Change; Scene: TYPE = GGModelTypes.Scene; Slice: TYPE = GGModelTypes.Slice; SliceDescriptor: TYPE = GGModelTypes.SliceDescriptor; SliceParts: TYPE = GGModelTypes.SliceParts; Viewer: TYPE = ViewerClasses.Viewer; HistoryTool: TYPE = REF HistoryToolObj; HistoryToolObj: TYPE = RECORD [ layout: Layout, eventNumArg: Viewer, sizeArg: Viewer, textField: Viewer]; Layout: TYPE = REF LayoutRec; LayoutRec: TYPE = RECORD [ entryLeft: INTEGER _ 5, initLeft: INTEGER _ 5, heightSoFar: INTEGER _ 5, initHeight: INTEGER _ 5, entryHeight: INTEGER _ 15, entryVSpace: INTEGER _ 5, gapSize: INTEGER _ 5, container: Viewer ]; NewCurrent: PROC [name: Rope.ROPE, ggData: GGData] RETURNS [HistoryEvent]; GetCurrent: PROC [ggData: GGData] RETURNS [event: HistoryEvent, index: INT]; PushCurrent: PROC [ggData: GGData]; NewCapture: PROC [name: Rope.ROPE, ggData: GGData]; KillAdvanceCapture: PROC [ggData: GGData]; DoAdvanceCapture: PROC [ggData: GGData]; Note: PROC [event: HistoryEvent, historyProc: HistoryProc, historyData: REF Change]; Undo: PROC [historyEvent: HistoryEvent, currentEvent: HistoryEvent]; UndoN: PROC [ggData: GGData, N: INT _ 0]; Create: PROC [name: Rope.ROPE] RETURNS [HistoryEvent]; SetCurrent: PROC [ggData: GGData, event: HistoryEvent]; -- sets current event to event SetHistory: PROC [ggData: GGData, list: LIST OF HistoryEvent]; -- sets history list to list GetHistory: PROC [ggData: GGData] RETURNS [LIST OF HistoryEvent]; Push: PROC [event: HistoryEvent, list: LIST OF HistoryEvent]; Reset: PROC [event: HistoryEvent]; ResetHistory: PROC [ggData: GGData]; Empty: PROC [event: HistoryEvent] RETURNS [BOOL]; BuildTool: PROC [caption: Rope.ROPE, ggData: GGData] RETURNS [HistoryTool]; CapTool: PROC [caption: Rope.ROPE, ggData: GGData]; ClearTool: PROC [ggData: GGData]; END. ϊGGHistory.mesa Copyright Σ 1988 by Xerox Corporation. All rights reserved. Pier, August 31, 1988 11:08:27 am PDT Bier, October 31, 1988 4:28:40 pm PST Routines used by the Gargoyle interface code. equivalent to SetCurrent[ggData, Create[name] ]; GetCurrent[ggData]; used to create a new current event at the start of a user operation returns event in progress and its event number pushes current event in progress onto history list used to make a completed history entry at the end of a user operation makes a new currentEvent and captures the current scene aborts advance capture when it is known to be out of date called by RestoreScreenAndInvariants to use idle time for possibly useful (future) capture. Routines that make entries on a HistoryEvent and perform actual undo of HistoryEvent adds to list of subevents calls historyProc[historyData, 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 undoes the top N events on the history list Utility routines manipulating HistoryEvents. takes a rope as the name of this event for printing resets the list of subevents to NIL. Attempts to free storage within the list elements. empties the entire history. Attempts to free storage within the list elements. returns true if subevents list is empty HistoryTool procedures Build a new HistoryTool for ggData Change the HistoryTool caption Clear the history tool viewers ΚΘ˜codešœ™K™œ ˜TKšœ4™4K™—šžœœ:˜DKšœ?™?Kšœ3™3KšœL™L—K™šžœœœ˜)K™+—K˜šœ,™,K™—šžœœ œœ˜6K™3K˜—šž œœ(‘˜VK˜—š ž œœœœ‘˜[K˜—š ž œœœœœ˜AK˜—Kšžœœœœ˜=K˜šžœœ˜"KšœX™XK˜—šž œœ˜$KšœO™OK˜—šžœœœœ˜1Kšœ'™'—K˜š ™K™—šž œœœœ˜Lšœ"™"J™——šžœœœ˜3Jšœ™J™—šž œœ˜!J™—J™Kšœ˜J˜—…—όΎ