DIRECTORY CD; CDLayers: CEDAR DEFINITIONS = BEGIN Layer: TYPE = CD.Layer; Number: TYPE = CD.Number; Design: TYPE = CD.Design; CurrentLayer: PROC [design: Design] RETURNS [Layer]; LayerWidth: PROC [design: Design, layer: Layer] RETURNS [Number]; PlaceholderToAbstract: PROC [design: Design, layer: Layer] RETURNS [Layer]; AbstractToPaint: PROC [layer: Layer] RETURNS [Layer] = INLINE { RETURN [layerPaint[layer]] }; Kind: PROC [layer: Layer] RETURNS [LayerKind] = INLINE { RETURN [layerKind[layer]]; }; LayerKind: TYPE = {paint, abstract, placeholder}; layerKind: READONLY REF READONLY ARRAY Layer OF LayerKind; layerPaint: READONLY REF READONLY ARRAY Layer OF Layer; SetCurrentLayer: PROC [design: REF, layer: Layer]; SetLayerWidth: PROC [design: Design, layer: Layer, width: Number]; SetPlaceholderToAbstract: PROC [design: Design, placeholder, abstract: Layer]; RegisterNotifiers: PRIVATE PROC [layer: DesignNotifyProc_NIL, width: LayerNotifyProc_NIL, placeholder: LayerNotifyProc_NIL]; DesignNotifyProc: TYPE = PROC [design: Design]; LayerNotifyProc: TYPE = PROC [design: Design, layer: Layer]; MakeAbstract: PRIVATE PROC [abstract: Layer, represents: Layer_CD.undefLayer]; MakePlaceholder: PRIVATE PROC [layer: Layer, defaultsTo: Layer_CD.undefLayer]; MakePaint: PRIVATE PROC [layer: Layer]; END. ͺCDLayers.mesa (part of ChipNDale) Copyright c 1983, 1986 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, August 11, 1983 11:32 am Last edited by: Christian Jacobi, September 19, 1986 11:14:40 am PDT 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. --everybodys procedures --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 --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 interacton. 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 typicaly are not drawn into rectangles of devices. paint: Has a color...; is subject to drawRect --procedures for control panel implementors --use technology for initializing defaults --NIL design for initializing defaults --NIL design for initializing defaults --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 --makes this layer an abstract layer --makes this layer a placeholder layer --procedures for CDLayer implementors --makes this layer a paint layer ΚC˜codešœ(™(Kšœ Οmœ7™BKšœ6™6K™D—K˜šΟk ˜ Kšžœ˜—K˜KšΟnœžœž œ˜Kšž˜K˜KšœR™RKšœM™M™CK˜Kšœžœžœ˜Kšœžœžœ˜Kšœžœžœ˜K˜—K™K™K™šŸ œžœžœ ˜4Jšœ'™'K˜—šŸ œžœ žœ ˜AJšœ8™8K˜—šŸœžœ žœ ˜KJšœZ™ZK˜—šŸœžœžœ žœ˜?Jšœ;™;Jšœ™Jšœžœ=™AJšœžœžœ"™7Jšžœ˜Jšœ˜—K˜šŸœžœžœžœ˜8Jšœ™Jšžœ˜K˜—K˜Kšœ žœ"˜1Kš œ žœžœžœžœžœ ˜;š œ žœžœžœžœžœ˜8šœ*™*šœ ™ Kšœ>™>KšœL™L—šœ ™ KšœP™PKšœL™LKšœ)™)—šœ™Kšœ'™'——K˜—K™Kšœ+™+K˜šŸœžœ žœ˜2Kšœ*™*—šŸ œžœ/˜BKšœ&™&—šŸœžœ0˜NKšœ&™&—K˜š Ÿœž œžœžœžœ˜|K˜Kšœžœžœ˜/Kšœžœžœ ˜