CDPinObjects.mesa (part of ChipNDale)
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, August 8, 1984 12:41:50 pm PDT
last edited Christian Jacobi, October 7, 1985 11:15:06 am PDT
DIRECTORY
CD, Rope;
CDPinObjects: CEDAR DEFINITIONS =
BEGIN
Pins are objects to associate names and properties to rectangular areas.
All the actual pins properties like name, layer, propertylist and its semantics are bound to the InstanceRep.
In general, the meaning of a pin is not known, but it is assumed some client program knows it.
NIL owner means: At this area, connection in the particaular layer can be made.
Pin objects will NOT have an special interrest-rect specified; their interrest area is the real rect. It is common to have several pins with the same name.
For rect: use CDInstances.ARectO or ARectI
For size: use object size; (Interestrects for pins is not set).
pinLayer: READONLY CD.Layer;
CreatePinOb: PROC [size: CD.Position] RETURNS [CD.Object];
IsPinOb: PROC [ob: CD.Object] RETURNS [BOOL] = INLINE {
RETURN [ob.class=pinObjectsClass]
};
IsPinApp: PROC [inst: CD.Instance] RETURNS [BOOL] = INLINE {
RETURN [IsPinOb[inst.ob]]
};
CreatePinInstance: PROC [name: Rope.ROPE, rect: CD.Rect, lev: CD.Layer←CD.combined, owner: ATOMNIL] RETURNS [CD.Instance];
SetOwner: PROC [pinInstance: CD.Instance, owner: ATOMNIL];
GetOwner: PROC [pinInstance: CD.Instance] RETURNS [ATOM];
--if owner is not NIL it must be registered with CDProperties
SetName: PROC [pinInstance: CD.Instance, name: Rope.ROPE];
GetName: PROC [pinInstance: CD.Instance] RETURNS [Rope.ROPE];
SetLayer: PROC [pinInstance: CD.Instance, lev: CD.Layer];
GetLayer: PROC [pinInstance: CD.Instance] RETURNS [CD.Layer];
--if layer=CD.combined means: not yet determined, or either: pin has more complex functionality
InstanceEnumerator: TYPE = PROC [inst: CD.Instance] RETURNS [quit: BOOLFALSE];
EnumeratePins: PROC [ob: CD.Object←NIL, eachPin: InstanceEnumerator] RETURNS [quit: BOOL];
--Random order; changes on pins while the enumeration may or may not be seen.
FindPins: PROC [ob: CD.Object←NIL, pinName: Rope.ROPE] RETURNS [CD.InstanceList];
--Returns all pins with name "name"
pinObjectsClass: PRIVATE READONLY REF CD.ObjectClass;
END.