-- Displayer.mesa
-- last edit     July 20, 1984 8:50:46 am PDT

DIRECTORY
   Labels USING[Label],
   NewCalcGlobal USING[Displayer, Document],
   Rope USING[ROPE],
   StructureNodes USING[Action, StructureNode],
   ViewerClasses USING[Viewer];
   
Displayer: DEFINITIONS  =

BEGIN

-- In defineProcButton, if arg is NIL, then owner will be used on calls, else the supplied arg.

ButtonDefiningProc: TYPE = PROCEDURE[
	owner: REF ANY,
	defineProcButton: PROCEDURE[name: Rope.ROPE, proc: PROC[REF ANY], arg: REF ANY ← NIL],
	defineStructureOpButton: PROCEDURE[act: StructureNodes.Action],
	defineLabel:  PROCEDURE[initialContents, forSize: Rope.ROPE] RETURNS[Labels.Label],
	defineText: PROCEDURE[initialContents, forSize: Rope.ROPE] RETURNS[ViewerClasses.Viewer],
	newLine: PROCEDURE];
	
		
BuildDisplayer: PROCEDURE[document: NewCalcGlobal.Document, owner: REF ANY, name: Rope.ROPE, defineButtons: ButtonDefiningProc] RETURNS[NewCalcGlobal.Displayer, --container-- ViewerClasses.Viewer, --displays structure-- ViewerClasses.Viewer];

SetDisplayerContents: PROCEDURE[displayer: NewCalcGlobal.Displayer, name: Rope.ROPE, sn: StructureNodes.StructureNode]; -- It is up to the client to have previously called abandon on the previous contents.

ResetDisplayerName: PROCEDURE[displayer: NewCalcGlobal.Displayer, name: Rope.ROPE];

DoOperatorOrStructureAct: PROCEDURE[displayer: NewCalcGlobal.Displayer, act: StructureNodes.Action, p1, p2: REF ANY] RETURNS[triedIt: BOOLEAN];

AfterStructureOp: PROCEDURE[displayer: NewCalcGlobal.Displayer];
AfterOperatorOp: PROCEDURE[displayer: NewCalcGlobal.Displayer];
PaintDisplayerContents: PROCEDURE[displayer: NewCalcGlobal.Displayer];

END..

-- October 13, 1982 2:49 pm: Sturgis, started Displayer.mesa, using Displayerimpl.
-- October 18, 1982 3:24 pm: modify defineProcButton to take an optinaal argument to be supplied to the proc.
-- October 18, 1982 3:53 pm: add ReSetDisplayerName
-- October 21, 1982 1:27 pm: add owner procs to owner, and include exactly one proc:  ComputeTotals.
-- October 26, 1982 4:42 pm: add doOperatorOrStructureAct, so that NewCalcImpl can do SetSelectiontoNExt, or some such.
-- November 2, 1982 4:30 pm: add two ref any params to DoOperatorOrStructureAct.
-- February 25, 1983 2:54 pm: replace LogicalNode and DisplayNode with StructureNode
-- July 10, 1984 6:37:01 pm PDT: add an Adjust proc to the owner procs.

-- July 20, 1984 8:50:51 am PDT: displayer type moved to NewCalcGlobal, to avoid loops in the defs files