CDSatellites.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Created by Louis Monier, October 22, 1985 11:08:27 am PDT
Louis Monier, November 19, 1985 11:38:18 am PST
Pradeep Sindhu December 18, 1985 4:32:06 pm PST
Bertrand Serlet December 1, 1985 3:40:29 pm PST
Abstract
A satellite is a text CD.Instance attached to another CD.Instance called the satellite's master. A master along with its satellites forms a satellite group. It is useful to think of satellites simply as visible properties attatched to the master. Three things distinguish satellites from ordinary properties: 1) satellites are always visible, 2) the user can control their looks and placement to suit his taste, and 3) satellites are untyped—as far as clients are concerned satellites are simply pieces of text.
Clients of this interface must be aware some implementation details in order to use satellites properly. Satellites are attatched to their master via a satellite object list—a list of CD.Objects that correspond to the text instances that are the satellites; this list is kept under the $CDSatellites property in the master's property list. There is no other connection between satellites and master. From this it should be clear that the following constraint needs to be maintained to keep the invisible satellite object list consistent with the corresponding visible text instances: each CD.Object in a master's satellite object list must have a text instance that refers to this object; furthermore, this text instance must be located in the same world (cell or top level of design) as the master. The procedure EnforceConstraint checks that this constraint is ok and enforces it if not.
DIRECTORY
CD USING [Instance, Object, PropList],
Rope USING [ROPE];
CDSatellites: CEDAR DEFINITIONS = BEGIN
ROPE: TYPE = Rope.ROPE;
ObList: TYPE = LIST OF CD.Object;
SetSatellites: PROC [master: CD.Instance, satellites: ObList ← NIL];
Sets satellites for master; old satellites are removed.
AddSatellites: PROC [master: CD.Instance, satellites: ObList ← NIL];
Adds satellites to master; old satellites are preserved.
GetSatellites: PROC [master: CD.Instance] RETURNS [satellites: ObList ← NIL];
Returns all satellites of this instance
GetSatelliteRopes: PROC [masterProps: CD.PropList] RETURNS [ropes: LIST OF ROPENIL];
Convenience proc that returns the list of satellite ropes for masterProps.
EnforceConstraint: PROC [world: LIST OF CD.Instance] RETURNS [wasOk: BOOL];
Enforces the constraint that each satellite has a text instance corresponding to it.
END.