WalnutInternal.Mesa
Copyright Ó 1988, 1989, 1992 by Xerox Corporation. All rights reserved.
Willie-Sue, May 5, 1989 6:48:30 pm PDT
Internal interface for WalnutControl
DIRECTORY
Icons USING [IconFlavor],
Menus USING [Menu, MenuProc],
Rope USING [ROPE],
ViewerClasses USING [Viewer],
WalnutOps USING [MsgSet, ServerInfo],
WalnutWindow USING [OutCome, WalnutHandle],
WalnutWindowPrivate USING [MsgSetButton, WalnutIcons];
WalnutInternal: CEDAR DEFINITIONS =
BEGIN
Viewer: TYPE = ViewerClasses.Viewer;
ROPE: TYPE = Rope.ROPE;
WalnutHandle: TYPE = WalnutWindow.WalnutHandle;
MsgSetButton: TYPE = WalnutWindowPrivate.MsgSetButton;
WalnutIcons: TYPE = WalnutWindowPrivate.WalnutIcons;
WaitCallOutcome: TYPE = WalnutWindow.OutCome;
HowToPrint: TYPE = { press, ip2, ip3 };
MailState: TYPE = {noMail, retrieving, thereIsMail, waiting, noState, noServers, someMail};
previousUser: ROPE;
mustQuitWalnut: ROPE;
invocationDirectory: ROPE;
searchRules: LIST OF REF ANY;
blankMenu: Menus.Menu;
workingMenu: Menus.Menu;
tocDefaultLooks: ROPE;
tocSelectedLooks: ROPE;
tocUnreadLooks: ROPE;
userWantsQMs: BOOL;
plainTextStyle: ROPE;
displayMsgSetInIcon: BOOL;
msbDefaultLooks: ROPE;
msbSelectedLooks: ROPE;
msgSetBorders: BOOL;
initialActiveIconic, initialActiveOpen, initialActiveRight: BOOL;
msgIcon: Icons.IconFlavor;
msgSetIcon: Icons.IconFlavor;
labelledWalnutIcons: WalnutIcons;
unLabelledWalnutIcons: WalnutIcons;
alternateWalnutIcons: WalnutIcons; -- have label area for number
walnutIcon: Icons.IconFlavor;
newMailIcon: Icons.IconFlavor;
labelledWalnutIcon: Icons.IconFlavor;
labelledNewMailIcon: Icons.IconFlavor;
unLabelledWalnutIcon: Icons.IconFlavor;
unLabelledNewMailIcon: Icons.IconFlavor;
brokenWalnutIcon: Icons.IconFlavor;
* * * * * * * * * from WalnutWindowMenuImpl
GetUserResponse: PROC[wH: WalnutHandle, m: Menus.Menu ¬ NIL, tryAutoConfirm: BOOL ¬ FALSE] RETURNS[BOOL];
ChangeMenu: PROC[wH: WalnutHandle, m: Menus.Menu, isBusy: BOOL];
BuildWalnutMenus: PROC[wH: WalnutHandle];
DoArchive: PROC[wH: WalnutHandle, fileName: ROPE, msList: LIST OF WalnutOps.MsgSet, append: BOOL]
RETURNS[ok: BOOL];
must called from within a DoWaitCall
DoRemoveOverThere: PROC[ wH: WalnutHandle, rootMsgSet: ROPE, msgSetList: LIST OF MsgSetButton];
must be called from within a DoWaitCall
DoAppendMsg: PROC[wH: WalnutHandle, curSel: ROPE, curV: Viewer,
msgSetList: LIST OF MsgSetButton];
curSel & curV are used to figure out what the msg is - it can even be a Walnut Msg Displayer for some other database
must be called from within a DoWaitCall
* * * * from WalnutNotifierImpl
WalnutNotifier: PROC[wH: WalnutHandle];
RestartWalnut: PROC[wH: WalnutHandle, scavengeFirst, firstTime: BOOL]
RETURNS[ok: BOOL];
QuitWalnut: PROC[ra: REF ANY ];
the ref must be a WalnutHandle
DoStartupCall: PROC[wH: WalnutHandle, proc: PROC[isRunning: BOOL]] RETURNS[outcome: WaitCallOutcome];
puts proc on Walnut's queue and waits for its execution to finish; will get called even if Walnut is not running
DoWaitCall: PROC[wH: WalnutHandle, proc: PROC[]] RETURNS[outcome: WaitCallOutcome];
puts proc on Walnut's queue and waits for its execution to finish; If the call was flushed from the queue, then outcome = flushed upon return; if Walnut is not running, outcome = notRunning, else outcome = ok
FlushWQueue: PROC[wH: WalnutHandle];
FixUpWalnutViewers: PROC[wH: WalnutHandle];
******** from WalnutWindowInternalImpl
CloseDownWalnut: PROC[wH: WalnutHandle];
CloseTS: PROC[wH: WalnutHandle];
OpenTS: PROC[wH: WalnutHandle, r: ROPE ¬ NIL, doRegister: BOOL ¬ TRUE];
TakeDownWalnutViewers: PROC[wH: WalnutHandle];
RetrieveNewMail: PROC[wH: WalnutHandle];
EnableNewMail: PROC[wH: WalnutHandle];
DisableNewMail: PROC[wH: WalnutHandle];
SetMailState: PROC[wH: WalnutHandle, mailState: MailState];
******** from WalnutMsgSetButtonsImpl
DestroyAllMsgSetButtons: PROC[wH: WalnutHandle];
GetButton: PROC[wH: WalnutHandle, msgSet: ROPE] RETURNS[MsgSetButton];
returns the message set button for the named message set
ShowMsgSetButtons: PROC[wH: WalnutHandle];
constructs or re-constructs the msgSetButtons in the control window;
"knows" where in the window the buttons belong
GetSelectedMsgSets: PROC[wH: WalnutHandle] RETURNS[msL: LIST OF MsgSetButton];
the list of MsgSets the user has selected (for Add/Remove Msg operations)
DeleteMsgSetButton: PROC[wH: WalnutHandle, msgSet: ROPE];
AddMsgSetButton: PROC[wH: WalnutHandle, msgSet: ROPE, select: BOOL];
adds a button for msgSet
PrepareToEditMsgSetButtons: PROC[wH: WalnutHandle];
removes selections & strikethrus before editting
* * * * * * from WalnutMsgDisplayerImpl
CreateMsgMenu: PROC[ wH: WalnutHandle];
creates the msgMenu for this walnutHandle
DisplayMsgFromMsgSet: PROC[
 wH: WalnutHandle, msg: ROPE, msViewer: Viewer, shift: BOOL ¬ FALSE];
Display the message using the message viewer from the specified message set
QDisplayMsg: PROC[wH: WalnutHandle, msg: ROPE, oldV: Viewer ¬ NIL, shift: BOOL ¬ FALSE, openIfIconic: BOOL ¬ TRUE, paint: BOOL ¬ TRUE]
RETURNS[v: Viewer];
MsgNamePrefix: PROC[wH: WalnutHandle] RETURNS[ROPE];
InternalAddToMsgMenu: PROC[wH: WalnutHandle, label: ROPE, proc: Menus.MenuProc, clientData: REF ANY, onQueue: BOOL];
InternalReplaceInMsgMenu: PROC[wH: WalnutHandle, label: ROPE, proc: Menus.MenuProc, clientData: REF ANY, onQueue: BOOL] RETURNS[oldFound: BOOL];
MsgCategories: PROC[wH: WalnutHandle, msg: ROPE];
lists the MsgSets for msg, in the walnut control window
MsgGvId: PROC[wH: WalnutHandle, msg: ROPE, all: BOOL];
prints the gvID for msg in the walnut control window
* * * * * * from WalnutMsgSetDisplayerImpl
CreateMsgSetMenus: PROC[ wH: WalnutHandle];
creates the msgSetMenus for this walnutHandle
QDisplayMsgSet: PROC[ wH: WalnutHandle, msb: MsgSetButton, oldV: Viewer ¬ NIL, shift: BOOL ¬ FALSE, repaint: BOOL ¬ TRUE]
RETURNS[v: Viewer];
MsgSetNamePrefix: PROC[wH: WalnutHandle] RETURNS[ROPE];
AddNewMsgsToActive: PROC[active: MsgSetButton]
RETURNS[responses: LIST OF WalnutOps.ServerInfo, complete: BOOL, numNew: INT];
called by newMail reader to add msgs to the active message set viewer; if active = NIL, then just return the server responses
AddorAppendTo: PROC[wH: WalnutHandle, msg: ROPE, isAdd: BOOL,
fromButton, toButton: MsgSetButton];
adds a message from one message set to another message set, keeping the second display consistent
MoveTo: PROC[msg: ROPE, fromButton, toButton: MsgSetButton];
moves a message from one message set to another message set, keeping the second display consistent
RemoveFrom: PROC[msg: ROPE, fromButton: MsgSetButton];
removes msg from from.msgSet, keeps the display consistent
ComeFrom: PROC[msb: MsgSetButton];
makes the selected msg(s) in the selected MsgSet(s) ComeFrom those msgSets into this msgSet (like a MoveTo)
PrintSelCmd: PROC[wH: WalnutHandle, msgSet: ROPE, server: ROPE ¬ NIL,
 howToPrint: HowToPrint ¬ press, copies: INT ¬ 1];
prints the selected msg in named msgSet
* * * * * from WalnutPrintImpl
MsgSetPrintProc: PROC[wH: WalnutHandle, viewer: Viewer, howToPrint: HowToPrint];
prints msgset with press or interpress, using the msgset viewer
MsgSetTOCPrintProc: PROC[wH: WalnutHandle, viewer: Viewer, howToPrint: HowToPrint];
prints msgset with press or interpress, using the msgset viewer
MsgPrintProc: PROC[wH: WalnutHandle, viewer: Viewer, howToPrint: HowToPrint];
prints msg with press or interpress, using the msg viewer
AbortPrintProc: Menus.MenuProc;
PrintMsgSet: PROC[wH: WalnutHandle, msgSet: ROPE, howToPrint: HowToPrint ¬ press]
RETURNS[allOK: BOOL];
uses walnut control window
PrintMsgSetTOC: PROC[wH: WalnutHandle, msgSet: ROPE, howToPrint: HowToPrint ¬ press]
RETURNS[allOK: BOOL];
uses walnut control window
PrintMsgList: PROC[wH: WalnutHandle, mList: LIST OF ROPE, msViewer: Viewer,
 server: ROPE ¬ NIL, howToPrint: HowToPrint ¬ press, copies: INT ¬ 1]
RETURNS[allOK: BOOL];
uses msgset viewer
these next proc are called from WalnutWindowCommandsImpl - they allow the user to specify the printer to use and the number of copies
PrintMsgSetCmd: PROC[wH: WalnutHandle, msgSet: ROPE, server: ROPE ¬ NIL,
 howToPrint: HowToPrint ¬ press, copies: INT ¬ 1];
PrintMsgSetTOCCmd: PROC[wH: WalnutHandle, msgSet: ROPE, server: ROPE ¬ NIL,
 howToPrint: HowToPrint ¬ press, copies: INT ¬ 1];
PrintMsgCmd: PROC[wH: WalnutHandle, msg: ROPE, server: ROPE ¬ NIL,
 howToPrint: HowToPrint ¬ press, copies: INT ¬ 1];
prints the named msg
makes a tioga document for a list of msgSets
WriteMsgSets: PROC[wH: WalnutHandle, msgSetList: LIST OF MsgSetButton, tocsOnly: BOOL, fileName: ROPE];
END.