CDDefaultsImpl.mesa (part of Chipndale)
Copyright © 1983, 1984 by Xerox Corporation. All rights reserved.
by Christian Jacobi August 11, 1983 11:32 am
last edited by Christian Jacobi October 24, 1984 7:07:52 pm PDT
DIRECTORY
CD,
CDDefaults,
CDPrivate,
CDValue;
CDDefaultsImpl: CEDAR PROGRAM
IMPORTS CDPrivate, CDValue
EXPORTS CDDefaults =
BEGIN
CurrentLevel: PUBLIC PROC [design: CD.Design] RETURNS [CD.Level] =
BEGIN
RETURN [CDValue.FetchInt[boundTo: design, key: $CurrentLevel, propagation: technology]]
END;
SetCurrentLevel: PUBLIC PROC [design: REF, level: CD.Level] =
BEGIN
CDValue.StoreInt[boundTo: design, key: $CurrentLevel, value: level]
END;
--design can exceptionally be a technology to set default values
--reserve call for CDPanelImpl; otherwise CDPanel gets fooled
LevelWidth: PUBLIC PROC [design: CD.Design, level: CD.Level] RETURNS [CD.DesignNumber] =
BEGIN
RETURN [CDValue.FetchInt[boundTo: design, key: CDPrivate.levels[level].globalUniqueKey, propagation: technology]]
END;
SetLevelWidth: PUBLIC PROC [design: REF, level: CD.Level, width: CD.DesignNumber] =
BEGIN
CDValue.StoreInt[boundTo: design, key: CDPrivate.levels[level].globalUniqueKey, value: width]
END;
-- design can exceptionally be a technology to set default values
-- reserve call for CDPanelImpl; otherwise CDPanel gets fooled
CDValue.EnregisterKey[key: $CurrentLevel, boundTo: NIL];
FOR l: CD.Level IN CD.Level DO
[] ← CDValue.EnregisterKey[CDPrivate.levels[l].globalUniqueKey];
ENDLOOP;
END.