WalnutWindowPrivate.mesa
Copyright Ó 1985, 1987, 1992 by Xerox Corporation. All rights reserved.
Created by: Willie-Sue, March 23, 1982
Willie-Sue, October 21, 1988 4:41:25 pm PDT
Pavel, February 5, 1986 7:12:49 pm PST
Chauser, October 3, 1991 2:12 pm PDT
Swinehar, November 16, 1991 4:41 pm PST
Doug Terry, January 3, 1992 11:18 am PST
(The control panel now contains the relevant state of a running Walnut -- ie., the message set buttons contain the version numbers of all of the currently displayed message sets and the version number of the message set domain)
(This was substantially reworked and simplified -- it now is the interface that handles the internal details of the Walnut Window, ie., how messages are reported and the display of message set buttons.)
DIRECTORY
BasicTime USING [GMT],
Icons USING [IconFlavor],
IO USING [STREAM],
LoganBerry USING [OpenDB, nullDB],
Menus USING [Menu, MenuEntry],
TBQueue USING [Queue],
Rope USING [ROPE],
TiogaButtons USING [TiogaButton],
ViewerClasses USING [Viewer],
ViewerEvents USING [EventRegistration],
WalnutDefs USING [MsgSet],
WalnutOps USING [WalnutOpsHandle];
WalnutWindowPrivate: CEDAR DEFINITIONS =
BEGIN
ROPE: TYPE = Rope.ROPE;
Viewer: TYPE = ViewerClasses.Viewer;
TiogaButton: TYPE = TiogaButtons.TiogaButton;
WalnutState: TYPE = { uninitialized, running, stopped, waitingForUser };
IconState: TYPE = { regular, haveNewMail, expunging, broken };
WalnutIcons: TYPE = REF WalnutIconsRec;
WalnutIconsRec: TYPE = ARRAY IconState OF Icons.IconFlavor ¬ ALL[tool];
WalnutHandle: TYPE = REF WalnutHandleRec;
WalnutHandleRec: PUBLIC TYPE = RECORD[
opsH: WalnutOps.WalnutOpsHandle,
walnut: Viewer,
walnutMenu: Menus.Menu, -- the one being used for the control window
walnutQueue: TBQueue.Queue,
walnutState: WalnutState ¬ uninitialized,
openDB: LoganBerry.OpenDB ¬ LoganBerry.nullDB, -- for queries
identifierPrefix, iconIdentifier: ROPE ¬ NIL,
whichIcon: IconState ¬ regular,
iconSet: WalnutIcons,
msgSetViewerList: LIST OF Viewer ¬ NIL,  -- msgSet displayers
msgViewerList: LIST OF Viewer ¬ NIL,  -- msg displayers
wallabyViewerList: LIST OF Viewer ¬ NIL,
newMailRetrievalStream: IO.STREAM ¬ NIL,
newMailRetrievalViewer: Viewer ¬ NIL,
mustQuitMsg: ROPE,
mailNotifyLabel: Viewer,
someMail: BOOL ¬ FALSE,
walnutEventReg: ViewerEvents.EventRegistration,
responseSynch: CONDITION,
userHasResponded, userConfirmed: BOOL ¬ FALSE,
msgSetsVersion: INT,
msgSetsTViewer: Viewer, -- the $TiogaButtons class viewer for msgSet TiogaButtons
msgSetButtonsFile: ROPE ¬ NIL,
localMsgSetButtonsFile: ROPE ¬ NIL,
orphanButtons: LIST OF TiogaButton,
selectedMsgSetButtons: MsgSetButton,  -- List of selected MsgSets (may be empty)
firstMsgSetButton: MsgSetButton,
activeMsgSetButton: MsgSetButton,
deletedMsgSetButton: MsgSetButton,
selectedMsgSet: MsgSetInfo ¬ NIL,
walnutTS, walnutRulerBefore, walnutRulerAfter: Viewer,
oldMailReader: OldMailReader,
printingOptions: PrintingOptions,
wtsOut: IO.STREAM,
crCount: CARDINAL ¬ 0,
reportCount: CARDINAL ¬ 0,
personalMailDB, readOnlyAccess, userAskedForReadOnly: BOOL,
msgNamePrefix, msgSetNamePrefix: ROPE,
dontDoMail: BOOL,
control window menus
mailDBMenu, readOnlyDBMenu, nonMailDBMenu: Menus.Menu,
confirmMenu, forceQuitMenu, maybeQuitMenu, scavMenu: Menus.Menu,
menus for msg and msgSet displayers
msgMenu: Menus.Menu,  -- depends on walnutQueue
frozenMsgMenu: Menus.Menu, -- may depend on walnutQueue
displayerMenu, activeMenu, deletedMenu, readOnlyMenu: Menus.Menu,
placesMenuEntry, levelsMenuEntry: Menus.MenuEntry -- depend on walnutQueue
];
MsgSetButton: TYPE = REF MsgSetButtonObject;
MsgSetButtonObject: TYPE = RECORD[
wH: WalnutHandle,
msgSet: WalnutDefs.MsgSet, -- the message set for the button (if the msViewer is NIL, then the version stored for the message set will be "don't care")
spaceButton: TiogaButton,
mainButton: TiogaButton, -- the one in the bottom list (included below)
allButtons: LIST OF TiogaButton, -- the buttons in the control panel for this message set
msViewer: Viewer ¬ NIL, -- the message set viewer (may be NIL)
next: MsgSetButton ¬ NIL, -- list of all MsgSets
selected: MsgSetButton ¬ NIL-- list of Selected MsgSets
];
this gets stored as the WalnutMsgName prop for Msg Displayers
MsgAndHandle: TYPE = REF MsgAndHandleRec;
MsgAndHandleRec: TYPE = RECORD [msg: ROPE, wH: WalnutHandle];
Types used in message set displays
MsgSetInfo: TYPE = REF MsgSetInfoRec;
MsgSetInfoRec: TYPE = RECORD [
button: MsgSetButton, -- the "button" in the control panel that this msgSet is bound to
tiogaViewer: Viewer, -- only child, $TiogaButton viewer
container: Viewer,  -- back pointer to msgSet viewer
selected: LIST OF MsgSetFieldHandle,
lastMFH: MsgSetFieldHandle,
lastDeleted: MsgInfo,  -- last message deleted from this message set
destroyER: ViewerEvents.EventRegistration,
sortby: ATOM ¬ $date  -- the display order for this msgSet
];
MsgSetFieldHandle: TYPE = REF MsgSetFieldHandleRec;
MsgSetFieldHandleRec: TYPE = RECORD[
next, prev: MsgSetFieldHandle,
tocButton: TiogaButton,  -- TableOfContentsButton
msI: MsgSetInfo,  -- back pointer to msgSetInfo
msgInfo: MsgInfo  -- constant for a message
];
MsgInfo: TYPE = REF MsgInfoRec;
MsgInfoRec: TYPE = RECORD[ msg, tocName: ROPE, startOfSubject: INT, hasBeenRead: BOOL, date: BasicTime.GMT, ilevel: INT ];
OldMailReader: TYPE = REF OldMailReaderRec;
OldMailReaderRec: TYPE = RECORD[
container: Viewer,  -- need only move this one viewer
doIt, msgSetLabel, msgSetText, close, fileLabel, fileText: Viewer
];
PrintingOptions: TYPE = REF PrintingOptionsRec;
PrintingOptionsRec: TYPE = RECORD[
container: Viewer,  -- need only move this one viewer
options, copiesLabel, copiesText, serverLabel, serverText: Viewer
];
END.