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, August 8, 1983 8:44 am (added InitializeSchema)
DIRECTORY
DB USING[Entity, Domain, Attribute, Segment],
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
PaintIcon: ViewerClasses.PaintProc; -- paint an icon
PaintIconic: ViewerClasses.PaintProc;
The addition procedures DO NOT paint the viewer they create
AddTextBox: PROCEDURE[wb: ViewerClasses.Viewer, e: DB.Entity, x, y, w, h: INTEGER]
RETURNS[child: ViewerClasses.Viewer];
AddIcon: PROCEDURE[wb, viewer: ViewerClasses.Viewer, name: ROPE, x, y: INTEGER]
RETURNS[child: ViewerClasses.Viewer];
RemoveChild: PROCEDURE[wb, child: ViewerClasses.Viewer];
retrieve and change the grid size for a whiteboard
GetGrid: PROC[ wb: ViewerClasses.Viewer ] RETURNS[ grid: NAT ];
SetGrid: PROC[ wb: ViewerClasses.Viewer, grid: NAT ];
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 *******************
ToolInfo: TYPE = RECORD[ tool: ATOM, icon: ATOMNIL, commandLine: ROPE ];
If an implementor wants to make it possible for a tool viewer to be added to a Whiteboard, he must add a ToolInfo record to the property list of any viewer created by the tool, using the $ToolInfo property. The tool atom is used as the label for the icon on a whiteboard and the commandLine is passed to a Commander when the icon is "opened". If no icon is specified, a tool icon is used; otherwise, the icon must be the name of a registered icon.
ToolViewer: DB.Domain; -- DeclareDomain[NutViewer.ToolViewer, $Squirrel]
instructions: DB.Attribute; -- what is needed to recreate the viewer
TextViewer: DB.Domain; -- DeclareDomain[NutViewer.TextViewer, $Squirrel]
readOnly: BOOL; -- set if this is a readonly DB segment
WBSegment: ROPE; -- the name of the current WB segment
CreateTextViewer: Nut.CreateProc;
CreateToolViewer: Nut.CreateProc;
ShortName: PROC[name: ROPE] RETURNS[shortName: ROPE]; -- gives the LName for a FS GName
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, seg: DB.Segment ← NIL, name: ROPENIL];
if DB.Null[e] then the name is stored, otherwise DBNames.EntityToName is used;
this is needed for the case where the segment in which the entity exists isn't open yet
Pair: TYPE = RECORD[e: DB.Entity, v: ViewerClasses.Viewer];
GetEntities: PROC[wb: ViewerClasses.Viewer, text: BOOLTRUE] RETURNS[entities: LIST OF Pair];
WBEntityForViewer: PROC[v: ViewerClasses.Viewer] RETURNS[e: DB.Entity]
END...
Change Log.
Willie-Sue on December 20, 1982: added FindViewer and RegisterTool from ViewerNut.mesa