-- Whiteboard.mesa
-- Last edited by: John Maxwell on: June 24, 1982 10:23 am
-- Last Edited by: Willie-Sue, February 22, 1983 3:46 pm
-- Last Edited by: Donahue, June 1, 1983 4:32 pm (added InitializeSchema)

DIRECTORY
DB USING[Entity, Domain, Attribute],
Nut USING [CreateProc, UpdateProc],
Rope USING [ROPE],
ViewerClasses USING [PaintProc, Viewer, ViewerFlavor];

Whiteboard: CEDAR DEFINITIONS =
BEGIN
OPEN Rope;

PaintRelships: ViewerClasses.PaintProc; -- paint the relships between icons
PaintIconic: ViewerClasses.PaintProc; -- paint an iconic whiteboard
PaintIcon: ViewerClasses.PaintProc; -- paint an icon

OpenSegment: PROC[ fileName: ROPE, readOnly: BOOLTRUE ]; -- open a new $Squirrel segment

AddTextBox: PROCEDURE[wb: ViewerClasses.Viewer, e: DB.Entity, x, y, w, h: INTEGER]
RETURNS[child: ViewerClasses.Viewer];
AddIcon: PROCEDURE[wb, viewer: ViewerClasses.Viewer, e: DB.Entity, x, y: INTEGER]
RETURNS[child: ViewerClasses.Viewer];
RemoveChild: PROCEDURE[wb, child: ViewerClasses.Viewer];

ShowLines: PROCEDURE[wb: ViewerClasses.Viewer, show: BOOLEAN];
UpdateRelships: Nut.UpdateProc; -- watch relships being created/destroyed

GetBinaryProperties: PROCEDURE[e: DB.Entity] RETURNS[LIST OF BinaryProperty];
BinaryProperty: TYPE = RECORD[of, is: DB.Entity, name: ROPE];

OpenIcon: PROCEDURE[icon: ViewerClasses.Viewer];

MoveChild: PROCEDURE[child: ViewerClasses.Viewer];
GrowBox: PROCEDURE[wb, box: ViewerClasses.Viewer, x, y: INTEGER];
NearestChild: PROCEDURE[wb: ViewerClasses.Viewer, x, y: INTEGER,
type: ViewerClasses.ViewerFlavor ← NIL]
RETURNS[nearest: ViewerClasses.Viewer];

-- ***************** Data Schema for Viewers *******************
-- NOTE: There is no notion of versions in this implementation!
-- If a viewer already exists with the entity's name, ViewerNut will flash it.
-- If the entity is a TextViewer, ViewerNut open a Viewer on the file.
-- If the entity is a ToolViewer, ViewerNut will load its implementor.
-- **********************************************************

ToolViewer: DB.Domain; -- DeclareDomain[NutViewer.ToolViewer, $Squirrel]
-- properties of ToolViewers
comment: DB.Attribute; -- human readable instructions
loadError: DB.Attribute; -- loadError is set if the Tool couldn't be loaded
implementor: DB.Attribute; -- an implementor of a ToolViewer is a BCD

BCD: DB.Domain; -- the domain of implementations DeclareDomain["BCD", $Squirrel]

TextViewer: DB.Domain; -- DeclareDomain[NutViewer.TextViewer, $Squirrel]

readOnly: BOOL; -- set if this is a readonly DB segment

RegisterTool: PROCEDURE[name, impl, instructions: ROPENIL];
-- name = name of viewer (as given at the top of the viewer).
-- implementor = name of bcd.
-- instructions = human readable instructions of how to
-- get the tool (where the DF file is, what to load, etc).

CreateTextViewer: Nut.CreateProc;

CreateToolViewer: Nut.CreateProc;

Loaded: PROC[module: ROPE] RETURNS[loaded: BOOLEAN];

ExtractName: PROC[name: ROPE] RETURNS[ROPE];

FetchEntity: PROC[v: ViewerClasses.Viewer] RETURNS[e: DB.Entity];
-- produce the entity stored in the viewer

StoreEntity: PROC[ v: ViewerClasses.Viewer, e: DB.Entity ];

END...

Change Log.
Willie-Sue on December 20, 1982: added FindViewer and RegisterTool from ViewerNut.mesa