CDImports.mesa (part of ChipNDale)
Copyright © 1984, 1985 by Xerox Corporation. All rights reserved.
by Christian Jacobi, March 20, 1984 5:50:51 pm PST
last edited Christian Jacobi, September 24, 1985 5:34:27 pm PDT
DIRECTORY
CD, Rope;
CDImports: CEDAR DEFINITIONS =
BEGIN
Objects which reference Objects in other designs are called imports.
No circular imports.
IsImport: PROC [ob: CD.Object] RETURNS [BOOL] = INLINE {
RETURN [ISTYPE[ob.specificRef, ImportPtr]]
};
importsClass: PRIVATE READONLY REF CD.ObjectClass;
ImportPtr: TYPE = REF ImportRep;
ImportRep: TYPE = RECORD [ --consider READONLY
boundInstance: CD.Instance ← NIL, -- NIL if not yet bound
ir: CD.Rect ← [0, 0, -1, -1],
objectName: Rope.ROPENIL,
designName: Rope.ROPENIL
];
ImportList: TYPE = RECORD [list: LIST OF REF ImportDesign];
-- describes all the imports of a design
ImportDesign: TYPE = RECORD[ -- consider READONLY
importeeName: Rope.ROPENIL,
loaded: BOOLFALSE, --a readonly version of the design is loaded
reservedForCDImports: PRIVATE REF ←
];
-- describes imports of one particular importee-design
BoolOrInteractive: TYPE = {true, false, interactive};
CreateImport: PROC [into: CD.Design, objectName, importeeName: Rope.ROPE] RETURNS [ob: CD.Object];
--Creates an import object.
--Design importeeName must be loaded. (to know size of object!)
--Returns nil if not done.
--Multiple creation may return the same object.
Load: PROC [into: CD.Design, importeeName: Rope.ROPE, overload, allowConflicts: BoolOrInteractive←true] RETURNS [done: BOOL];
--Load or Reloads an imported design importeeName.
--Creates an import entry into the import list if necessary.
--(importeeName is fetched using CDRemote's FetchDesign)
--Procedure talks to TerminalIO.
--overload: allows reloading if importeeName is already loaded.
--allowConflicts; If conflicts are disabled, objects with (size) conflict will not be loaded.
-- indirect imports
MergeInImports: PROC [into: CD.Design, importeeName: Rope.ROPE];
--Includes all the imported and loaded objects from design importeeName (including
--their transitive closure; but not indirect imports) into the design "into".
GetImportList: PROC [design: CD.Design] RETURNS [REF ImportList];
-- Returns the import list of the design.
-- Consider the list and its entries READONLY.
GetImportEntry: PROC [into: CD.Design, importeeName: Rope.ROPE, createIfNotFound: BoolOrInteractive�lse] RETURNS [REF ImportDesign];
-- Returns an entry of the import list.
-- Consider the returned record READONLY
-- NIL if not found and not created
HasUnloadedImports: PROC [design: CD.Design] RETURNS [BOOL];
-- Returns "design has imports or imported objects wich are not yet loaded".
END.