CDAtomicObjects.mesa (part of ChipNDale)
Copyright © 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, March 13, 1985 9:49:28 am PST
last edited by Christian Jacobi, April 11, 1985 3:24:22 pm PST
DIRECTORY
CD USING [combined, DesignPosition, DesignRect, highLightError, Layer, ObjectProcs, ObPtr, 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
IsAtomicOb: PROC [ob: CD.ObPtr] RETURNS [BOOL] =
INLINE {
RETURN [ISTYPE[ob.specificRef, AtomicObsPtr]]
};
CreateAtomicOb: PROC [class: ATOM, size: CD.DesignPosition, tech: CD.Technology, lev: CD.Layer←CD.combined] RETURNS [CD.ObPtr];
--NIL if not done
--Reuses objects in cache if possible
DrawRec: TYPE = RECORD [r: CD.DesignRect, lev: CD.Layer ← CD.highLightError];
DrawList: TYPE = LIST OF DrawRec;
AtomicObsPtr: TYPE = REF AtomicObsRec;
AtomicObsRec: TYPE = RECORD [ --do not change directly
rList: DrawList←NIL,
sList: DrawList←NIL,
ir: CD.DesignRect
];
--class creator's proc's
FillObjectProc: TYPE = PROC [ob: CD.ObPtr] RETURNS [mustFail: BOOLFALSE];
--read (and even rewrite) size, layer
--calls IncorporateRect
--do not read or write AtomicObsRec directly
--rList, sList will be initialized to NIL
RegisterAtomicObClass: PROC [class: ATOM,
fillProc: FillObjectProc,
description: Rope.ROPENIL,
tech: CD.Technology←NIL] RETURNS [type: REF CD.ObjectProcs];
--drawMe, quickDrawMe are considered variables and should not
--be changed by class implementor.
Incorporate: PROC [ob: CD.ObPtr, r: CD.DesignRect, lev: CD.Layer,
inside: BOOLTRUE, save: BOOL FALSE];
END.