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.
IsAtomicOb:
PROC [ob:
CD.ObPtr]
RETURNS [
BOOL] =
INLINE {
RETURN [ISTYPE[ob.specificRef, AtomicObsPtr]]
};
Create
AtomicOb:
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
];
FillObjectProc:
TYPE =
PROC [ob:
CD.ObPtr]
RETURNS [mustFail:
BOOL ←
FALSE];
--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.ROPE←NIL,
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: BOOL ← TRUE, save: BOOL ← FALSE];
END.