File: WhiteboardDBPrivate.mesa
Copyright (C) 1984 by Xerox Corporation. All rights reserved.
Last edited by: Donahue, March 19, 1986 10:39:30 am PST
Last Edited by: Winkler, December 18, 1984 11:18:04 am PST
DIRECTORY
BasicTime USING[GMT],
DBDefs USING [Entity, RelshipSet],
Rope USING [ROPE],
ViewerTools USING [TiogaContents];
WhiteboardDBPrivate: CEDAR DEFINITIONS =
BEGIN
Whiteboard: TYPE = DBDefs.Entity;
WBIcon: TYPE = DBDefs.Entity;
WBNote: TYPE = DBDefs.Entity;
WBItem: TYPE = DBDefs.Entity;
ItemType: TYPE = {icon, note};
ChildSet: TYPE = REF ChildSetObject;
ChildSetObject: TYPE = RECORD[rs: DBDefs.RelshipSet, screen: BOOLFALSE];
wbType: ATOM;
Whiteboard items with this type are references to other whiteboards.
ROPE: TYPE = Rope.ROPE;
Structure of a whiteboard database.
A whiteboard database contains two types of entities: Whiteboards and WhiteboardItems; a whiteboard contains a collection of whiteboard items. Whiteboards also have a version number and a create date that are to be updated whenever any of the contents of the whiteboard changes (this is done by WhiteboardDB).
Whiteboard items are the entities that are contained on whiteboards (each entity belongs to only one whiteboad). Each whiteboard item has a position (where it is to be placed on its containing whiteboard) and a size (expressed as a height and width). There are two types of whiteboard items, WBIcons and WBNotes, each with different additional properties.
WBNotes are the text boxes on a whiteboard: they simply have contents and formatting properties, which are interpreted as a ViewerTools.TiogaContents record. WBNotes also have a flexible size, so a Grow operation is provided for this class of WhiteboardItems.
WBIcons are the icon entities on a whiteboard (they have a fixed size: 64 x 64). Each icon entity has two sets of properties:
"Display properties": the name of the icon to be used and the label to be painted on the icon. The icon names are mapped to icon flavors through the DBIcons database
"Icon properties": the name and type of the icon to be used when "opening" it. The current icon types used are $Whiteboard, $Tool (the name is used to lookup a tool in the DBTools database and the label becomes the argument to the tool), $Text (the name is taken as the name of a file), $ToolRope (the name is taken as the name of a tool that does not create a new viewer, but instead uses a Commander to get its arguments), and $Entity (the name is taken as the name of another database entity, eg., a calendar entry or Walnut message set). The use of these icon properties can be found in WhiteboardOpsImpl.
Operations on Whiteboards.
DeclareWhiteboard: PROC[name: ROPE] RETURNS[wb: Whiteboard];
Find the whiteboard with the given name (creating a new one if necessary).
NameOf: PROC[wb: Whiteboard] RETURNS[name: ROPE];
Give the name of the whiteboard supplied.
GetVersion: PROC[wb: Whiteboard] RETURNS[version: INT];
Return the current version number of the whiteboard.
SetVersion: PROC[wb: Whiteboard, version: INT];
Set the version number of the whiteboard to have the given value.
GetCreateDate: PROC[wb: Whiteboard] RETURNS[date: BasicTime.GMT];
Return the create date of the whiteboard (the time at which the contents were last changed).
SetCreateDate: PROC[wb: Whiteboard, date: BasicTime.GMT];
Sets the create date of the whiteboard.
GetGridSize: PROC[wb: Whiteboard] RETURNS[gridSize: INT];
Return the current grid size of the whiteboard.
SetGridSize: PROC[wb: Whiteboard, gridSize: INT];
Set the grid size of the whiteboard to have the given value.
DestroyWhiteboard: PROC[wb: Whiteboard];
Remove all references to the whiteboard from the database.
Exists: PROC[name: ROPE] RETURNS[BOOL];
Does a whiteboard by this name already exist in the database.
Enumerate: PROC[pattern: Rope.ROPE] RETURNS[wbList: LIST OF Whiteboard];
List all of the whiteboards stored in the database with names satisifying the given pattern.
Generic operations on Whiteboard Items.
FetchWBItem: PROC[name: ROPE, type: ItemType] RETURNS[item: WBItem];
Go from a name to the whiteboard item it denotes -- this procedure returns NIL if the item does not exist in the database.
Parent: PROC[item: WBItem] RETURNS[wb: Whiteboard];
The parent of the WBitem.
Children: PROC[wb: Whiteboard, onlyWhiteboards: BOOLFALSE] RETURNS[children: ChildSet];
Return an enumeration of all of the children of a whiteboard. If onlyWhiteboards, then the enumeration will produce only those children that are references to whiteboards
NextChild: PROC[children: ChildSet] RETURNS[child: WBItem];
Return the next child in the enumeration (if no children remain, produce NIL).
TypeOf: PROC[item: WBItem] RETURNS[type: ItemType];
Return the type of a whiteboard item.
Position: PROC[item: WBItem] RETURNS[x, y: INT];
Return the position of a whiteboard item.
Size: PROC[item: WBItem] RETURNS[w, h: INT];
Return the size of a whiteboard item.
Move: PROC[item: WBItem, newX, newY: INT];
Change the position of a whiteboard item (either note or icon).
Destroy: PROC[item: WBItem];
Remove all references to the whiteboard item from the database.
Operations on Whiteboard Notes.
NewNote: PROC[parent: Whiteboard, x, y, w, h: INT, content: ViewerTools.TiogaContents] RETURNS[newNote: WBNote];
Build a new note entity in the database with all of the supplied properties.
GetContents: PROC[note: WBNote] RETURNS[content: ViewerTools.TiogaContents];
Return the current Tioga contents of the note.
SetContents: PROC[note: WBNote, content: ViewerTools.TiogaContents];
Change the contents of a note.
Grow: PROC[note: WBNote, newW, newH: INT];
Change the size of a note.
Operations on Whiteboard Icons.
NewIcon: PROC[parent: Whiteboard, x, y: INT, name, label, icon, argument: ROPE, type: ATOM] RETURNS[newIcon: WBIcon];
Create a new icon entity in the database, with its position as specified (the height and width of an icon are 64). The label can be different from the name so that a more reasonable label can be displayed on the icon.
GetDisplayProps: PROC[wbIcon: WBIcon] RETURNS[label, icon: ROPE];
Get the display properties of a whiteboard icon.
GetToolArgument: PROC[wbIcon: WBIcon] RETURNS[argument: ROPE];
Get the display tool argument property of a whiteboard icon.
GetIconProps: PROC[wbIcon: WBIcon] RETURNS[name: ROPE, type: ATOM];
Get the "entity" properties of an icon -- those needed when the icon is "opened".
SetProps: PROC[wbIcon: WBIcon, name, label, icon: ROPE, type: ATOM];
Change the properties of an icon.
Initialization.
OpenTransaction: PROC[];
AbortTransaction: PROC[];
CloseTransaction: PROC[];
MarkTransaction: PROC[unlock: BOOLTRUE];
Mark the transaction. If unlock is TRUE, then the Alpine owner database for the server containing the Whiteboard database will be unlocked; this unlocking should always be done if a write has been performed
Initialize: PROC[DBFile: ROPE] RETURNS[serverDown: BOOL];
Set up the whiteboards database for processing; does not initialize the schema. Returns serverDown if could not connect to Alpine
readOnly: BOOL;
-- Is the current segment readOnly
WBSegment: ROPE;
The file name of the current Whiteboard database (in case anyone is curious)
END...