<> <> <> <> DIRECTORY CD; CDLayers: CEDAR DEFINITIONS = BEGIN <> <> <> Layer: TYPE = CD.Layer; Number: TYPE = CD.Number; Design: TYPE = CD.Design; <<>> <<--everybodys procedures>> <<>> CurrentLayer: PROC [design: Design] RETURNS [Layer]; <<--returns current layer for this design>> LayerWidth: PROC [design: Design, layer: Layer] RETURNS [Number]; <<--returns current width for layer "layer" in this design>> PlaceholderToAbstract: PROC [design: Design, layer: Layer] RETURNS [Layer]; <<--returns corresponding abstract or paint layer given an placeholder layer for this design>> AbstractToPaint: PROC [layer: Layer] RETURNS [Layer] = INLINE { <<--returns corresponding paint layer given an abstract layer>> <<--identity for paint layers>> <<--CD.undefLayer for abstract layer not representing a paint layer>> <<--CD.errorLayer or CD.undefLayer for placeholder layers>> RETURN [layerPaint[layer]] }; Kind: PROC [layer: Layer] RETURNS [LayerKind] = INLINE { <<--returns usage of layer>> RETURN [layerKind[layer]]; }; LayerKind: TYPE = {paint, abstract, placeholder}; layerKind: READONLY REF READONLY ARRAY Layer OF LayerKind; layerPaint: READONLY REF READONLY ARRAY Layer OF Layer; <> <> <> <> <> <> <> <> <> <> <<>> <<--procedures for control panel implementors>> SetCurrentLayer: PROC [design: REF, layer: Layer]; <<--use technology for initializing defaults>> SetLayerWidth: PROC [design: Design, layer: Layer, width: Number]; <<--NIL design for initializing defaults>> SetPlaceholderToAbstract: PROC [design: Design, placeholder, abstract: Layer]; <<--NIL design for initializing defaults>> RegisterNotifiers: PRIVATE PROC [layer: DesignNotifyProc_NIL, width: LayerNotifyProc_NIL, placeholder: LayerNotifyProc_NIL]; DesignNotifyProc: TYPE = PROC [design: Design]; LayerNotifyProc: TYPE = PROC [design: Design, layer: Layer]; <<--These Notify Proc's are not monitored and might pass each other. >> <<--For correct behavior on multiple processes, the actual values have to be querried inside.>> <<--Changes on an other than per design basis may or may not be notifyed.>> <<>> <<>> <<--procedures for technology implementors>> MakeAbstract: PRIVATE PROC [abstract: Layer, represents: Layer_CD.undefLayer]; <<--makes this layer an abstract layer>> MakePlaceholder: PRIVATE PROC [layer: Layer, defaultsTo: Layer_CD.undefLayer]; <<--makes this layer a placeholder layer>> <<--procedures for CDLayer implementors >> MakePaint: PRIVATE PROC [layer: Layer]; <<--makes this layer a paint layer>> END.