CDTechnology.mesa (part of Chipndale)
by Christian Jacobi August 11, 1983 11:32 am
last edited by Christian Jacobi November 23, 1983 9:59 am
DIRECTORY
CD,
CDValue,
Graphics USING [Color, black],
Rope USING [ROPE],
TIPUser USING [TIPTable];
CDTechnology: CEDAR DEFINITIONS
IMPORTS CDValue =
BEGIN
--tip tables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SetTipTable:
PROC [tech:
CD.Technology, tipTable: Rope.
ROPE];
--may generate InvalidTable signal
--attachedTo=NIL serves for initializing a default
--only new viewers will get the new tiptable
GetTipTable:
PROC [tech:
CD.Technology, allowDefault:
BOOL←
TRUE]
RETURNS [TIPUser.TIPTable];
--if tiptable be defined before call of GetTipTable returns default or NIL
--level and width ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
widthAtomTable: PRIVATE REF ARRAY CD.Level OF ATOM;
CurrentLevel:
PROC [design:
CD.Design]
RETURNS [
CD.Level] =
INLINE {RETURN [CDValue.FetchInt[boundTo: design, key: $CurrentLevel, propagation: technology]]};
SetCurrentLevel:
PROC [design:
REF, level:
CD.Level] =
INLINE {CDValue.StoreInt[boundTo: design, key: $CurrentLevel, value: level]};
--design can exceptionally be a technology to set default values
--reserve call for CDPanelImpl; otherwise CDPanel gets fooled
LevelWidth:
PROC [design:
CD.Design, level:
CD.Level]
RETURNS [
CD.DesignNumber] =
INLINE {RETURN [CDValue.FetchInt[boundTo: design, key: widthAtomTable[level], propagation: technology]]};
SetLevelWidth:
PROC [design:
REF, level:
CD.Level, width:
CD.DesignNumber] =
INLINE {CDValue.StoreInt[boundTo: design, key: widthAtomTable[level], value: width]};
-- design can exceptionally be a technology to set default values
-- reserve call for CDPanelImpl; otherwise CDPanel gets fooled
--implementors of technologies must cause CurrentLevel and LevelWidth to return
--reasonable values
--colors ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TeachGraphicsColor: PROC [lev: CD.Level, color: Graphics.Color←Graphics.black];
Brick: TYPE = ARRAY [0..4) OF CARDINAL;
ColorTable: TYPE = ARRAY CD.Level OF REF Brick;
TeachColor:
PROC[lev:
CD.Level, bpp:
CARDINAL, brick: Brick];
--sets value into the default ColorTable
--and resets default greytable
TeachGrey:
PROC[lev:
CD.Level, bpp:
CARDINAL, brick: Brick];
--sets value into the default GreyTable
TeachColorCode:
PROC[lev:
CD.Level, bpp:
CARDINAL, code:
CARDINAL];
--sets value into the default Color- and GreyTable
Brick4: PROC[color: CARDINAL, pattern: CARDINAL] RETURNS [Brick];
Brick8: PROC[color: CARDINAL, pattern: CARDINAL] RETURNS [Brick];
OrBricks: PROC[b1, b2: Brick] RETURNS [Brick];
END.