DIRECTORY Atom USING [GetPName], CD, CDBasics, CDDrawQueue, CDOps, CDProperties, CDVFurtherPainters, CDVPrivate, CDViewer, CDVScale, Cursors, Imager, Rope USING [ROPE], VFonts, ViewerClasses USING [Viewer]; CDVSpecialPainters: CEDAR PROGRAM IMPORTS Atom, CD, CDDrawQueue, CDOps, CDProperties, CDVFurtherPainters, CDVScale, CDViewer, CDVPrivate, Imager, VFonts = BEGIN VRef: TYPE = CDVPrivate.VRef; FurtherPaintProc: TYPE = CDVFurtherPainters.FurtherPaintProc; --PROC [me: CDVPrivate.VRef, whatChanged: REF]; ShowViewers: FurtherPaintProc = BEGIN OutlineViewer: PROC [me: VRef, other: ViewerClasses.Viewer] = BEGIN otherMe: VRef = NARROW[other.data]; r: CD.Rect = otherMe.dClip; p1: CD.Position = CDVScale.DesignToViewerPosition[me.scale, [r.x1, r.y1]]; p2: CD.Position = CDVScale.DesignToViewerPosition[me.scale, [r.x2, r.y2]]; CDVPrivate.InvertArea[me, p1.x, p1.y, p1.x+1, p2.y]; CDVPrivate.InvertArea[me, p1.x, p2.y, p2.x, p2.y+1]; CDVPrivate.InvertArea[me, p2.x, p2.y, p2.x+1, p1.y]; CDVPrivate.InvertArea[me, p2.x, p1.y, p1.x, p1.y+1]; END; FOR l: CDViewer.ViewerList _ CDViewer.ViewersOf[me.actualDesign], l.rest WHILE l#NIL DO IF ~l.first.iconic AND l.first#me.viewer THEN OutlineViewer[me: me, other: l.first]; ENDLOOP END; PaintSignalNames: FurtherPaintProc = BEGIN PaintProperties[me, $SignalName] END; PaintInstanceNames: FurtherPaintProc = BEGIN PaintProperties[me, $InstanceName] END; PaintProperties: PROC [me: CDVPrivate.VRef, key: ATOM] = BEGIN nameDevice: REF NameDevice _ NEW[NameDevice_[propKey: key, vPriv: me]]; internalPr: CD.DrawRef = CD.CreateDrawRef[[ design: me.actualDesign, interestClip: me.dClip, devicePrivate: nameDevice, drawChild: NamedDrawChild, drawRect: DontDrawRect, drawContext: DontDrawContext, stopFlag: me.stoprequest ]]; Imager.SetColor[me.viewContext, Imager.black]; CDOps.DrawDesign[design: me.actualDesign, pr: internalPr]; END; NameDevice: TYPE = RECORD [propKey: ATOM, vPriv: VRef]; defaultFont: Imager.Font = VFonts.DefaultFont[]; NamedDrawChild: PROC [inst: CD.Instance, pos: CD.Position, orient: CD.Orientation, pr: CD.DrawRef] = BEGIN dev: REF NameDevice = NARROW[pr.devicePrivate]; text: Rope.ROPE _ NIL; inst.ob.class.drawMe[inst, pos, orient, pr]; WITH CDProperties.GetInstanceProp[from: inst, prop: dev.propKey] SELECT FROM r: Rope.ROPE => text _ r; a: ATOM => text _ Atom.GetPName[a]; ENDCASE => NULL; IF text#NIL THEN { vpos: CD.Position = CDVScale.DesignToViewerPosition[dev.vPriv.scale, pos]; Imager.SetXY[dev.vPriv.viewContext, [vpos.x+1, vpos.y+1]]; Imager.SetColor[dev.vPriv.viewContext, Imager.black]; Imager.SetFont[dev.vPriv.viewContext, defaultFont]; Imager.ShowRope[dev.vPriv.viewContext, text]; }; END; DontDrawRect: PROC [r: CD.Rect, l: CD.Layer, pr: CD.DrawRef] = BEGIN END; DontDrawContext: PROC [pr: CD.DrawRef, proc: CD.DrawContextLayerProc, ob: CD.Object, pos: CD.Position, orient: CD.Orientation, layer: CD.Layer] = BEGIN END; PaintTemporaries: FurtherPaintProc = -- PROC [me: CDVPrivate.VRef, key: REF] BEGIN END; DrawSignalNames: FurtherPaintProc = BEGIN CDDrawQueue.InsertDrawCommand[me.actualDesign, CDDrawQueue.Request[$SignalNames, CDBasics.universe]]; END; DrawInstanceNames: FurtherPaintProc = BEGIN CDDrawQueue.InsertDrawCommand[me.actualDesign, CDDrawQueue.Request[$InstanceNames, CDBasics.universe]]; END; Init: PROC [] = BEGIN CDVFurtherPainters.InstallFurtherPaint[keyValue: $ShowViewers, proc: ShowViewers]; CDVFurtherPainters.InstallFurtherPaint[keyValue: $SignalNames, proc: PaintSignalNames]; CDVFurtherPainters.InstallFurtherPaint[keyValue: $InstanceNames, proc: PaintInstanceNames]; CDVFurtherPainters.InstallFurtherPaint[keyValue: $Temporaries, proc: PaintTemporaries]; CDVFurtherPainters.InstallFurtherPaint[keyValue: $DrawSignalNames, proc: DrawSignalNames]; CDVFurtherPainters.InstallFurtherPaint[keyValue: $DrawInstanceNames, proc: DrawInstanceNames]; END; Init[]; END. <CDVSpecialPainters.mesa (part of ChipNDale) Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. Ch. Jacobi August 29, 1984 4:58:52 pm PDT last edited by Christian Jacobi, March 25, 1986 1:39:54 pm PST -- CDVSpecialPainters implements some procedures which are called by the (viewers)-draw -- proc of ChipNDale viewers --PROC [me: CDVPrivate.VRef, key: REF] --monitored by ProtectedRepaint --PROC [me: CDVPrivate.VRef, key: REF] --monitored by ProtectedRepaint --PROC [me: CDVPrivate.VRef, key: REF] --monitored by ProtectedRepaint --eg. former paints ticks --called through ProtectedRepaint only -- PROC [me: CDVPrivate.VRef, key: REF] -- called from anywhere, not monitored -- PROC [me: CDVPrivate.VRef, key: REF] -- called from anywhere, not monitored --protected procedures --unprotected procedures ΚF˜codešœ-™-Kšœ Οmœ7™BKšœ*™*Kšœ>™>—K˜šΟk ˜ Kšœžœ ˜Kšžœ˜K˜ Kšœ ˜ Kšœ˜Kšœ ˜ Kšœ˜Kšœ ˜ Kšœ ˜ K˜ K˜Kšœ˜Kšœžœžœ˜Kšœ˜Kšœžœ ˜—K˜šΠblœžœžœ˜"Kšžœq˜x—Kšž˜K˜KšœX™XKšœ™K˜K˜Kšœžœ˜šœžœ'˜=KšΟc/˜/—K˜K˜šΟb œ˜KšœΟiœ™&Kšœ™Kšž˜K˜šΟn œžœ*˜=Kšž˜Kšœžœ ˜#Kšœžœ˜KšœžœD˜JKšœžœD˜JKšœ4˜4Kšœ4˜4Kšœ4˜4Kšœ4˜4Kšžœ˜—K˜šžœFžœžœž˜WKšžœžœžœ'˜TKšž˜—Kšžœ˜—K˜K˜š‘œ˜%Kšœ’œ™&Kšœ™Kšž˜Kšœ ˜ Kšžœ˜—K˜š‘œ˜'Kšœ’œ™&Kšœ™Kšž˜Kšœ"˜"Kšžœ˜—K˜š£œžœžœ˜9Kšž˜Kšœ žœžœ'˜Gšœ žœ žœ˜+Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜—Kšœ.˜.Kšœ:˜:Kšžœ˜—K™Kšœ žœžœ žœ˜7Kšœ0˜0K˜š £œžœžœžœžœ ˜RKšœžœ ˜Kšž˜Kšœžœžœ˜/Kšœ žœžœ˜Kšœ,˜,šžœ=žœž˜LKšœžœ ˜Kšœžœ˜#Kšžœžœ˜—šžœžœžœ˜KšœžœB˜JKšœ:˜:Kšœ5˜5Kšœ3˜3Kšœ-˜-Kšœ˜—Kšžœ˜K˜—š £ œžœžœ žœ žœ ˜?Kšž˜Kšžœ˜—K˜š£œžœžœžœžœžœžœžœ ˜“Kšž˜Kšžœ˜—K˜š£œ ˜%Kš ’ ˜'Kšœ™Kšœ œ™&Kšž˜Kšžœ˜K˜—š‘œ˜$Kšœ’œ™'Kšœ&™&Kšž˜Kšœe˜eKšžœ˜K˜—š‘œ˜&Kšœ’œ™'Kšœ&™&Kšž˜Kšœg˜gKšžœ˜K˜—š£œžœ˜Kšž˜Kšœ™KšœR˜RKšœW˜WKšœ[˜[KšœW˜WKšœ™KšœZ˜ZKšœ^˜^Kšžœ˜—Kšœ˜Kšžœ˜K˜—…—@Β