ScriptedDocs.mesa
Copyright © 1986, 1987 by Xerox Corporation. All rights reserved.
Polle Zellweger (PTZ) January 28, 1987 6:58:18 pm PST
DIRECTORY
MBQueue USING [ Queue ],
Rope USING [ ROPE ],
;
ScriptedDocs: CEDAR DEFINITIONS = {
Types
ScriptList: TYPE ~ LIST OF Script;
Script: TYPE ~ REF ScriptBody;
ScriptBody: TYPE ~ RECORD [
sid: ScriptUID ← "", -- a unique id for the LoganBerry package
firstEntry: EntryID ← NIL,
sName: Name ← "", -- a human-sensible name
sDesc: Desc ← "", -- a human-sensible description
sKeywords: ... may want to include some...
sCreateInfo: CreateInfo ← NIL,
may differ from info in sid; sid set at initial creation
numEntries: INT ← 0,
For user feedback, to give some idea of the script's length. However, for branching scripts, this gives no idea of how long any path through the script is.
startingFile: FileID,
could determine this via script.firstEntry.file, but this allows us to have a LoganBerry index on $StartingFile to find all scripts that start in a given file quickly.
May eventually want to list all files touched by this script, probably in script order (remove duplicates or not?). This could be done by adding a sequence of $AllFiles attributes at the end of the descriptor. Otherwise it would be necessary to find all entries in the script (indexed DB lookup) and prune those to the entries with different filenames (doesn't provide order - for that you need to lookup each script entry in order - via sid generator).
edited: BOOLFALSE -- TRUE iff this script descriptor needs to be written to the DB
];
ScriptUID: TYPE = Rope.ROPE;
ScriptID: TYPE ~ REF ScriptIDBody;
ScriptIDBody: TYPE ~ RECORD [
sid: ScriptUID ← "",
sref: Script ← NIL
];
Name: TYPE ~ Rope.ROPE;
Desc: TYPE ~ Rope.ROPE;
CreateInfo: TYPE ~ REF CreateInfoBody;
CreateInfoBody: TYPE ~ RECORD [
creator: Rope.ROPE ← "",
creation: BasicTime.GMT ← BasicTime.nullGMT
];
EntryList: TYPE ~ LIST OF ScriptEntry;
ScriptEntry: TYPE ~ REF ScriptEntryBody;
these are an internal representation for the script tool
ScriptEntryBody: TYPE ~ RECORD [
eid: EntryUID ← "", -- a unique id for the LoganBerry package
scriptHeader: ScriptID ← "", -- reference to the containing script
file: FileID ← NIL, -- the containing file
internal: BOOLEAN ← FALSE,
Internal script entries have script entryid pointers stored in the document that will track edits. External script entries refer to a particular version of a file.
class: DocClass ← $Tioga,
classData: ClassData ← NIL,
the idea here is to allow other systems (i.e., Gargoyle, ChipNDale) to implement their own idea of "location" and register with the scripting system the procedures needed to record, find, and highlight these locations
chars: CharRange ← NIL,
trust this only if document is not edited; just a hint for internal script
action: Action ← NIL,
pauseBefore: INT ← 0, -- in msec (is sec more reasonable?)
pauseAfter: INT ← 0, -- ditto
nextEntries: NextEntryList ← NIL,
eName: Name ← "", -- a human-sensible name
eDesc: Desc ← "", -- a human-sensible description
eKeywords: ... may want to include some...
eCreateInfo: CreateInfo ← NIL,
may differ from info in eid; eid set at initial creation
edited: BOOLFALSE -- TRUE iff this entry needs to be written to the DB
];
EntryUID: TYPE = Rope.ROPE;
EntryIDList: TYPE ~ LIST OF EntryID;
EntryID: TYPE ~ REF EntryIDBody;
EntryIDBody: TYPE ~ RECORD [
eid: EntryUID ← "",
these are stored (in a list, as $script property) on characters in the document
eref: ScriptEntry ← NIL
];
Action: TYPE = Rope.ROPE;
CharRange: TYPE ~ REF CharRangeBody;
CharRangeBody: TYPE ~ RECORD [
start: INT ← 0,
len: INT ← 0
];
FileID: TYPE = REF FileIDBody;
FileIDBody: TYPE ~ RECORD [
name: Rope.ROPE ← "",
createTime: BasicTime.GMT ← BasicTime.nullGMT
];
NextEntryList: TYPE ~ LIST OF NextEntry;
NextEntry: TYPE ~ REF NextEntryBody;
NextEntryBody: TYPE ~ RECORD [
cond: Rope.ROPE ← "",
entry: EntryID ← NIL
];
Script Creation
scriptUID => script
either in-core (linear search) or through DB
scriptID => script
if sref = NIL, uses above
entryUID => entry
either in-core (linear search) or through DB
entryID => entry
if eref = NIL, uses above
savescript[script]
writes edited entries to db, turning any edited bits off
AddSelectedAnnotations: PROC [viewerPos: Viewer.position, script: Script, seqNum: INT] RETURNS [success];
DeleteSelectedAnnotations: PROC [viewerPos: Viewer.position, script: Script, seqNum: INT] RETURNS [success];
GetSeqNumsOfFirstAnnotation: PROC [viewerPos: Viewer.position] RETURNS [script: Script, seqNumList: INT];
For a given script? For all scripts (eg if user enters * in tool??) ? For all annotations in selection? For lists, report in SeqNum field or in feedback area? This sort of situation makes a script specification that is editable and reingestable seem much nicer. Or a ShowSeqNumbers mode.
FindSeqNum: PROC [script: Script, seqNum: INT] RETURNS [viewerPos: Viewer.position];
DeleteScript: PROC [script: Script] RETURNS [succeeded ← FALSE];
NewScript: PROC RETURNS [script: Script];
Script Playback
PlayScript: PROC;
}.
Polle Zellweger (PTZ) August 21, 1986 4:26:01 pm PDT
changes to: DIRECTORY, NarratedDocs, Script, ScriptBody, ScriptEntry, ScriptEntryBody, AddSelectedAnnotations, DeleteSelectedAnnotations, GetSequenceNumbersOfFirstAnnotation
Polle Zellweger (PTZ) August 22, 1986 0:08:28 am PDT
changes to: FindSeqNum, DeleteScript, NewScript, PlayScript, ScriptBody
Polle Zellweger (PTZ) August 22, 1986 4:17:21 pm PDT
changes to: ScriptBody, ScriptEntryBody, EntryID
Polle Zellweger (PTZ) August 23, 1986 5:37:59 pm PDT
changes to: ScriptList, Script, ScriptBody, ScriptEntry, ScriptEntryBody, EntryID, ScriptToolBody
Polle Zellweger (PTZ) August 24, 1986 6:33:25 pm PDT
changes to: ScriptToolBody, ScriptEntryBody, EntryID, EntryIDBody
Polle Zellweger (PTZ) January 7, 1987 6:50:37 pm PST
changes to: ScriptedDocs, ScriptEntryBody, FileID
Polle Zellweger (PTZ) January 8, 1987 3:47:52 pm PST
changes to: ScriptBody, ScriptEntryBody
Polle Zellweger (PTZ) January 14, 1987 9:37:31 pm PST
changes to: Action, CharRange, CharRangeBody, CreateInfo, CreateInfoBody, Desc, EntryID, EntryIDBody, EntryList, EntryUID, FileID, FileIDBody, Name, NextEntry, NextEntryBody, NextEntryList, ScriptBody, ScriptEntry, ScriptEntryBody, ScriptID, ScriptIDBody, ScriptUID
Polle Zellweger (PTZ) January 15, 1987 1:03:25 pm PST
changes to: ScriptEntryBody
Polle Zellweger (PTZ) January 28, 1987 6:58:18 pm PST
changes to: ScriptBody, ScriptEntryBody