DIRECTORY Atom USING [GetPName], CD, CDApplications, CDBasics, CDDraw, CDProperties, CDVFurtherPainters, CDVPrivate, CDViewer, CDVScale, Cursors, Graphics, GraphicsOps, Rope USING [ROPE], ViewerClasses USING [Viewer]; CDVSpecialPainters: CEDAR PROGRAM IMPORTS Atom, CDApplications, CDDraw, CDBasics, CDProperties, CDVFurtherPainters, CDVScale, CDViewer, CDVPrivate, Graphics = BEGIN MyGraphicRef: TYPE = CDVPrivate.MyGraphicRef; FurtherPaintProc: TYPE = CDVFurtherPainters.FurtherPaintProc; --PROC [me: CDVPrivate.MyGraphicRef, whatChanged: REF]; ShowViewers: FurtherPaintProc = BEGIN OutlineViewer: PROC [me: MyGraphicRef, other: ViewerClasses.Viewer] = BEGIN otherMe: MyGraphicRef = NARROW[other.data]; r: CD.DesignRect = otherMe.deviceDrawRef.worldClip; 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 = -- PROC [me: CDVPrivate.MyGraphicRef, key: REF] -- monitored by ProtectedRepaint BEGIN DrawCommentForViewers: PROC [pos: CD.DesignPosition, text: Rope.ROPE, me: MyGraphicRef] = BEGIN tc: Graphics.Context ~ Graphics.CopyContext[me.viewerContext]; p: CD.Position ~ CDVScale.DesignToViewerPosition[me.scale, pos]; Graphics.SetColor[tc, Graphics.black]; Graphics.SetCP[tc, p.x, p.y]; Graphics.DrawRope[tc, text]; END; design: CD.Design = me.actualDesign; FOR w: CD.ApplicationList _ design^.actual.first.specific.contents, w.rest WHILE w#NIL DO IF CDBasics.Intersect[CDApplications.ARectO[w.first], me.deviceDrawRef.worldClip] THEN BEGIN x: REF _ CDProperties.GetPropFromApplication[from: w.first, prop: $SignalName]; IF x=NIL THEN x _ CDProperties.GetPropFromObject[from: w.first.ob, prop: $SignalName]; IF x#NIL THEN { IF me.deviceDrawRef.stopFlag^ THEN EXIT; IF ISTYPE[x, Rope.ROPE] THEN { signame: Rope.ROPE = NARROW[x]; DrawCommentForViewers[CDBasics.BaseOfRect[CDApplications.ARectI[w.first]], signame, me] } ELSE IF ISTYPE[x, ATOM] THEN { a: ATOM = NARROW[x]; signame: Rope.ROPE = Atom.GetPName[a]; DrawCommentForViewers[CDBasics.BaseOfRect[CDApplications.ARectI[w.first]], signame, me] } }; END ENDLOOP; END; PaintTemporaries: FurtherPaintProc = -- PROC [me: CDVPrivate.MyGraphicRef, key: REF] BEGIN END; RepaintBackgroundComplete: FurtherPaintProc = -- PROC [me: CDVPrivate.MyGraphicRef, key: REF] -- monitored by ProtectedRepaint BEGIN CDVPrivate.RepaintBackground[me, CDBasics.universe, FALSE]; END; DrawSignalNames: FurtherPaintProc = BEGIN CDDraw.InsertCommandAll[me.actualDesign, CDDraw.Comm[cmd: ref, erase: FALSE, rect: CDBasics.universe, ref: $SignalNames] ]; END; Init: PROC [] = BEGIN CDVFurtherPainters.InstallFurtherPaint[keyValue: $ShowViewers, proc: ShowViewers]; CDVFurtherPainters.InstallFurtherPaint[keyValue: $SignalNames, proc: PaintSignalNames]; CDVFurtherPainters.InstallFurtherPaint[keyValue: $Temporaries, proc: PaintTemporaries]; CDVFurtherPainters.InstallFurtherPaint[keyValue: $BackGround, proc: RepaintBackgroundComplete]; CDVFurtherPainters.InstallFurtherPaint[keyValue: $DrawSignalNames, proc: DrawSignalNames]; END; Init[]; END. lCDVSpecialPainters.mesa (part of Chipndale) Copyright c 1984 by Xerox Corporation. All rights reserved. Ch. Jacobi August 29, 1984 4:58:52 pm PDT last edited by Christian Jacobi November 5, 1984 10:23:09 am PST -- CDVSpecialPainters implements some procedures which are called by the (viewers)-draw -- proc of chipndale viewers --PROC [me: CDVPrivate.MyGraphicRef, key: REF] --monitored by ProtectedRepaint --eg. former paints ticks --called through ProtectedRepaint only -- PROC [me: CDVPrivate.MyGraphicRef, key: REF] -- called from anywhere, not monitored --protected procedures --unprotected procedures Êv˜šœ-™-Jšœ Ïmœ1™Jšœžœ;˜@J˜&J˜J˜Jšžœ˜J˜—Jšœžœ˜$š žœžœBžœžœž˜YšžœPž˜VJšž˜JšœžœI˜Ošžœžœžœ˜JšœH˜H—šžœžœžœ˜Jšžœžœžœ˜(šžœžœ žœžœ˜Jšœžœžœ˜JšœW˜WJ˜—š žœžœžœžœžœ˜Jšœžœžœ˜Jšœžœ˜&JšœW˜WJ˜—J˜—Jšž˜—Jšžœ˜—Jšžœ˜J˜J˜—š¢œ ˜%Jš &¡ ˜/Jšœ™Jšœ œ™&Jšž˜Jšžœ˜J˜J˜—šŸœ ˜.Jš &¡ ˜/Jš  ˜ Jšž˜Jšœ4žœ˜;Jšžœ˜J˜J˜—šŸœ˜$Jšœ&¡œ™/Jšœ&™&Jšž˜˜)Jšœžœ-˜OJšœ˜—Jšžœ˜J˜J˜—š¢œžœ˜Jšž˜Jšœ™JšœR˜RJšœW˜WJšœW˜WJšœ_˜_Jšœ™JšœZ˜ZJšžœ˜—Jšœ˜Jšžœ˜J˜—…— Ú¼