DIRECTORY CD; CDLayers: CEDAR DEFINITIONS = BEGIN CurrentLayer: PROC [design: CD.Design] RETURNS [CD.Layer]; LayerWidth: PROC [design: CD.Design, layer: CD.Layer] RETURNS [CD.Number]; PlaceholderToAbstract: PROC [design: CD.Design, layer: CD.Layer] RETURNS [CD.Layer]; AbstractToPaint: PROC [layer: CD.Layer] RETURNS [CD.Layer] = INLINE { RETURN [layerData[layer].paint] }; Kind: PROC [layer: CD.Layer] RETURNS [LayerKind] = INLINE { RETURN [layerData[layer].kind]; }; SuppressIR: PROC [layer: CD.Layer] RETURNS [BOOL] = INLINE { RETURN [layerData[layer].suppressIR]; }; LayerKind: TYPE = {paint, abstract, placeholder}; LayerData: TYPE = RECORD [paint, well: CD.Layer_CD.undefLayer, kind: LayerKind_placeholder, suppressIR: BOOL_FALSE, wSurr: BYTE_0]; layerData: READONLY REF READONLY ARRAY CD.Layer OF LayerData; SetCurrentLayer: PROC [design: REF, layer: CD.Layer]; SetLayerWidth: PROC [design: REF, layer: CD.Layer, width: CD.Number]; SetPlaceholderToAbstract: PROC [design: REF, placeholder, abstract: CD.Layer]; RegisterNotifiers: PRIVATE PROC [layer: DesignNotifyProc_NIL, width: LayerNotifyProc_NIL, placeholder: LayerNotifyProc_NIL]; DesignNotifyProc: TYPE = PROC [design: CD.Design]; LayerNotifyProc: TYPE = PROC [design: CD.Design, layer: CD.Layer]; MakeAbstract: PRIVATE PROC [abstract: CD.Layer, paint: CD.Layer _ CD.undefLayer, well: CD.Layer _ CD.undefLayer, wSurr: BYTE _ 0]; MakePlaceholder: PRIVATE PROC [placeholder: CD.Layer, defaultsTo: CD.Layer _ CD.undefLayer]; MakePaint: PRIVATE PROC [layer: CD.Layer]; MakeSuppressIR: PRIVATE PROC [layer: CD.Layer, suppressIR: BOOL _ TRUE]; END. >CDLayers.mesa (part of ChipNDale) Copyright c 1983, 1986, 1987 by Xerox Corporation. All rights reserved. Created by: Christian Jacobi, August 11, 1983 11:32 am Last edited by: Christian Jacobi, March 27, 1987 5:23:42 pm PST This module serves to decouple low level querries for current layer and width from control panel modules, which resides on higher levels. But we do assume here that some control panel module will actually initialize the witdhs. Furthermore, and deeper, it allows to state the purpose of layers. These two concepts are on different levels in the logically package hierarchy, but the default procs are vanilla enough to be allowed to co-reside on this low logical level. --Procedures for designer and interactive editor --Returns current layer for this design --Returns current width for layer "layer" in this design --Returns corresponding abstract or paint layer given an placeholder layer for this design --Low level stuff for any purpose --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 --Returns usage of layer There are three different usages of layers placeholder: Not to be put into data structures, only help for interactions. Meaning may change over time and per design as result of user interaction. abstract: Objects might have this layer, e.g. rectangles. Might (or might not) represent a paint layer. Meaning is defined by technology. Abstract layers typically are not drawn into rectangles of devices. paint: Has a color...; is subject to masks --Procedures for control panel implementors --Technology instead of design for initializing defaults --NIL or technology instead of design for initializing defaults --set a placeholder to point to an abstract or paint layer --NIL or technology instead of design for initializing defaults --Registeres notifiers which are called when a default value for a design changes --These Notify Proc's are not monitored and might pass each other. --The actual new default values have to be querried inside. --Procedures for Technology implementors --Makes "abstract" an abstract layer --Makes "placeholder" a placeholder layer --Makes "layer" a paint layer --Sets "layers" suppressIR field Κ˜codešœ(™(Kšœ Οmœ=™HKšœ7™7K™?—K˜šΟk ˜ Kšžœ˜—K˜KšΟnœžœž œ˜Kšž˜K˜KšœR™RKšœM™MK™CK˜K™CK™K™W™WK™—K˜KšœΟcœ™0K™š Ÿ œžœ žœ žœžœ˜:Kš '™'K˜—š Ÿ œžœ žœžœžœžœ ˜JKš 8™8K˜—š Ÿœžœ žœžœžœžœ˜TKš !Πbc 1™ZK˜—K˜K™"K˜š Ÿœžœ žœžœžœ žœ˜EKš ;™;Kš ™Kš A™AKš 7™7Kšžœ˜Kšœ˜—K˜š Ÿœžœ žœžœžœ˜;Kš ™Kšžœ˜K˜—K˜š Ÿ œžœ žœžœžœžœ˜K˜—K™Kš +™+K˜šŸœžœ žœ žœ˜5Kš 8™8—K˜š Ÿ œžœ žœ žœžœ ˜EKš ?™?—K˜šŸœžœ žœžœ˜NKšœ,Οbœ™;Kš ?™?—K˜š Ÿœžœžœžœžœžœ˜|K™QK˜Kšœžœžœ žœ ˜2Kš œžœžœ žœžœ˜BKš C™CKš <™