CDAtomicObjects.mesa (part of ChipNDale)
Copyright © 1985, 1986 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, March 13, 1985 9:49:28 am PST
Last edited by: Christian Jacobi, October 22, 1986 12:40:09 pm PDT
DIRECTORY
CD USING [undefLayer, Position, Rect, errorLayer, Layer, ObjectClass, Object, Technology],
Rope USING [ROPE];
CDAtomicObjects: CEDAR DEFINITIONS =
BEGIN
This module helps the implementation of a wide class of atomic ChipNDale objects, which do not have children and are shared between designs. Despite its name this are not the only atomic object classes.
--common proc's and types
IsAtomicOb:
PROC [ob:
CD.Object]
RETURNS [
BOOL] =
INLINE {
RETURN [ob.class.atomicOb AND ISTYPE[ob.specific, AtomicObsSpecific]]
};
Create
AtomicOb:
PROC [classKey:
ATOM, size:
CD.Position, tech:
CD.Technology, layer:
CD.Layer ←
CD.undefLayer]
RETURNS [
CD.Object];
--NIL if not done
--Reuses objects in cache if possible
DrawRec: TYPE = RECORD [r: CD.Rect, layer: CD.Layer ← CD.errorLayer];
DrawList: TYPE = LIST OF DrawRec;
AtomicObsSpecific: TYPE = REF AtomicObsRec;
AtomicObsRec:
TYPE =
RECORD [
--do not change directly
rList: DrawList←NIL,
ir: CD.Rect
];
--technology implementor's proc's and type's
FillObjectProc:
TYPE =
PROC [ob:
CD.Object]
RETURNS [mustFail:
BOOL ←
FALSE];
--read (and even rewrite) size, layer
--calls IncorporateRect
--do not read or write AtomicObsRec directly
--rList will be initialized to NIL
RegisterAtomicObClass:
PROC [classKey:
ATOM, fillProc: FillObjectProc, description: Rope.
ROPE ←
NIL, tech:
CD.Technology ←
NIL]
RETURNS [type:
CD.ObjectClass];
--drawMe, quickDrawMe are considered variables and should not
--be changed by class implementor.
Incorporate: PROC [ob: CD.Object, r: CD.Rect, layer: CD.Layer, inside: BOOL ← TRUE];
END.