SessionLog.mesa
Copyright © 1986 by Xerox Corporation. All rights reserved.
Last edited by Bier on April 27, 1987 10:47:48 pm PDT
Contents: Routines recording and playing back a record of an interactive session. SessionLog is intended to be used with SlackProcess in systems built according to the new user interface architecture (see SlackProcessDoc and AtomButtonsDoc).
DIRECTORY
IO, SlackProcess;
SessionLog: CEDAR DEFINITIONS =
BEGIN
Recording
EnterAction: PROC [f: IO.STREAM, action: LIST OF REF ANY];
Writes the action onto f in a human-readable format. Each action is followed by a carriage-return. For instance, here are the first few lines of /cedar/cedarchest7.0/Gargoyle/StarOfDavid.script as they would be generated by this routine:
PrintRope "\nStarting script StarOfDavid.script"
SetShowColors "F"
SetGravity "T"
SetMidpoints "F"
SetHeuristics "T"
InitializeAlignments
Clear
SetGravityExtent 0.3472222
ToggleHeuristics
StartCaretPos [262.0, 286.0]
During [264.0, 285.0]
The data types that may appear in action are: REF INT, REF REAL, REF CHAR, REF CARD, Rope.ROPE, REF TEXT, and REF Vector2.VEC.
Playing Back
PlayScript: PROC [f: IO.STREAM, clientData: REF ANY, notifyProc: SlackProcess.EventProc];
Parse all of the actions on f. Pass each action (a LORA) and the clientData to notifyProc. In order to Abort at fine grain, write your own loop and use PlayAction below.
PlayAction: PROC [f: IO.STREAM, clientData: REF ANY, notifyProc: SlackProcess.EventProc] RETURNS [endOfStream: BOOL];
Take the next action from stream f. Pass the action (a LORA) and clientData to notifyProc. endOfStream is TRUE if there are no more actions on f. PlayAction is provided so that the client can Abort Playback at fine grain.
END.