DIRECTORY CD, CDColors, CDDrawQueue, CDEvents, CDExtras, CDBasics, CDPanel, CDProperties, CDSequencer USING [Command, CommandRec, ExecuteCommand], CDTipEtc, CDLayers, CDValue, CDVFurtherPainters, CDVPrivate, CDViewer, CDViewerBase, CDVScale, Cursors, InputFocus USING [SetInputFocus], List, PrincOps USING [BBTableSpace], PrincOpsUtils, Process USING [Detach, Yield], CedarProcess USING [SetPriority, Priority], Rope USING [ROPE, Cat], RuntimeError USING [UNCAUGHT], SafeStorage USING [ReclaimCollectibleObjects], TerminalIO, TIPUser USING [TIPScreenCoords], UserProfile, ViewerClasses, ViewerEvents USING [EventProc, RegisterEventProc], ViewerOps USING [CreateViewer, RegisterViewerClass, PaintViewer, BlinkIcon, EnumProc, EnumerateViewers], WindowManager USING [colorDisplayOn]; CDVMain: CEDAR MONITOR IMPORTS CedarProcess, CD, CDColors, CDDrawQueue, CDEvents, CDExtras, CDBasics, CDPanel, CDProperties, CDVFurtherPainters, CDVScale, CDSequencer, CDTipEtc, CDLayers, CDValue, CDViewer, CDViewerBase, CDVPrivate, InputFocus, List, PrincOpsUtils, Process, Rope, RuntimeError, SafeStorage, TerminalIO, UserProfile, ViewerEvents, ViewerOps, WindowManager EXPORTS CDVPrivate SHARES CDVFurtherPainters, TerminalIO, CDDrawQueue = BEGIN greeting: Rope.ROPE = "ChipNDale Version 2.2 for Cedar 6.0 "; date: Rope.ROPE = "March 12, 1986"; copyRight: Rope.ROPE = "\nCopyright (C) 1984, 1986 by Xerox Corporation. All rights reserved.\n\n"; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- notSupportedColorMode: PUBLIC ERROR = CODE; allVRefs: PUBLIC LIST OF VRef _ NIL; catchAny: PUBLIC BOOL _ TRUE; catchAnyWhichDeadlock: PUBLIC BOOL _ TRUE; putNewViewerOnColor: BOOL _ TRUE; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- viewerClassAtom: ATOM = $ChipNDale; VRef: TYPE = CDVPrivate.VRef; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- terminalLock: BOOL _ FALSE; TerminalLock: PROC [] = { terminalLock _ TRUE; viewerClassRec.cursor _ cursorWhileInput }; TerminalFree: PROC [] ={ terminalLock _ FALSE; SetCursor[] }; TrackRef: TYPE = REF TrackRecord; TrackRecord: TYPE = RECORD [ pos: CD.Position ]; track: TrackRef _ NIL; GetTrackRef: PROC [p: CD.Position] RETURNS [t: TrackRef] = INLINE { t _ track; track _ NIL; IF t=NIL THEN t _ NEW[TrackRecord]; t.pos _ p }; DisposeTrackRef: PROC [t: TrackRef] = INLINE { track _ t }; RepaintRectAreaRef: TYPE = REF RepaintRectArea; RepaintRectArea: TYPE = RECORD[ rect: CD.Rect _ CDBasics.universe, erase: BOOL _ FALSE ]; tryToPaint: CONDITION; viewerClassRec: ViewerClasses.ViewerClass _ NEW[ViewerClasses.ViewerClassRec _ [ paint: PaintViewer, notify: NotifyViewer, modify: ModifyViewer, destroy: DestroyViewer, set: CDViewerBase.SetProc, get: CDViewerBase.GetProc, cursor: cursorNoFocus ]]; cursoredCDViewer: PUBLIC ViewerClasses.Viewer _ NIL; inputFocussedViewer: ViewerClasses.Viewer _ NIL; lastInputFocussedViewer: ViewerClasses.Viewer _ NIL; cursorWithFocus: Cursors.CursorType = textPointer; cursorNoFocus: Cursors.CursorType = pointDown; cursorWhileInput: Cursors.CursorType = questionMark; SetCursor: PROC [] = INLINE { viewerClassRec.cursor _ IF terminalLock THEN cursorWhileInput ELSE IF cursoredCDViewer=inputFocussedViewer THEN cursorWithFocus ELSE cursorNoFocus; }; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- LastViewer: PUBLIC PROC [] RETURNS [ViewerClasses.Viewer] = BEGIN RETURN [lastInputFocussedViewer] END; SetUpAndRedraw: ENTRY PROC[me: VRef] = BEGIN ENABLE UNWIND => NULL; CDDrawQueue.Flush[me.ct]; me.onVC _ FALSE; --erasing viewer automaticaly makes cursor invisible CDVPrivate.CreateDrawInformation[me]; CDDrawQueue.ChangeClipArea[me.ct, me.dClip]; CDDrawQueue.QueueInsertDrawCommand[me.ct, CDDrawQueue.Request[$redraw, CDBasics.universe]]; END; PaintViewer: ViewerClasses.PaintProc = BEGIN ENABLE { CDVPrivate.notSupportedColorMode => GOTO oops; RuntimeError.UNCAUGHT => IF CDVPrivate.catchAnyWhichDeadlock THEN GOTO oops ELSE REJECT; }; me: VRef = NARROW[self.data]; TrackRefTrack: ENTRY PROC [me: VRef, tr: TrackRef] = INLINE BEGIN ENABLE UNWIND => NULL; IF me.cursorInhibitations=0 THEN { IF me.onVC THEN me.usedCursor[me] ELSE { me.startVC _ me.designRec.startLC; me.firstHorizontalVC _ me.designRec.firstHLC; me.designRec.currentLayer _ CDLayers.CurrentLayer[me.actualDesign]; me.defaultWidthVC _ me.designRec.widthLC _ CDLayers.LayerWidth[me.actualDesign, me.designRec.currentLayer]; me.onVC _ TRUE; }; me.usedCursor _ me.designRec.outlineProcLC; me.stopVC _ tr.pos; me.usedCursor[me]; }; DisposeTrackRef[tr]; END; RemoveTrack: ENTRY PROC[me: VRef] = INLINE BEGIN ENABLE UNWIND => NULL; IF me.onVC THEN { me.usedCursor[me]; me.onVC _ FALSE; }; END; IF self.destroyed THEN RETURN; me.viewContext _ context; WITH whatChanged SELECT FROM tr: TrackRef => TrackRefTrack[me, tr]; -- called by NotifyViewer atom: ATOM => { IF atom=$RemoveTrack THEN RemoveTrack[me] ELSE CDVFurtherPainters.CallFurther[me, atom]; -- called from anywhere, maybe not protected }; area: RepaintRectAreaRef => -- protected by ProtectedRepaint CDVPrivate.RepaintRectAreaInViewer[me, area.rect, area.erase]; ENDCASE => { IF whatChanged=NIL THEN { IF me.viewer#self THEN RETURN; --initialization not finished SetUpAndRedraw[me] -- called from anywhere, maybe not protected } ELSE CDVFurtherPainters.CallFurther[me, whatChanged]; } EXITS oops => NULL; END; Flushed: CDVFurtherPainters.FurtherPaintProc = -- PROC [me: CDVPrivate.VRef, key: REF] BEGIN CDDrawQueue.Flush[me.ct]; me.scale _ me.intendedScale; SetUpAndRedraw[me]; END; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --local-- EnableCursoring: ENTRY PROC[me: VRef] = INLINE BEGIN ENABLE { UNWIND => NULL; RuntimeError.UNCAUGHT => { BROADCAST tryToPaint; IF CDVPrivate.catchAnyWhichDeadlock THEN GOTO oops ELSE REJECT }; }; me.cursorInhibitations _ me.cursorInhibitations-1; BROADCAST tryToPaint EXITS oops => NULL; END; ProtectedRepaint: PROC[me: VRef, whatChanged: REF ANY] = BEGIN ENABLE RuntimeError.UNCAUGHT => { EnableCursoring[me]; IF CDVPrivate.catchAnyWhichDeadlock THEN GOTO oops ELSE REJECT }; DisableCursoring: ENTRY PROC[me: VRef] RETURNS [mustRemoveCursor: BOOL] = INLINE BEGIN ENABLE { UNWIND => NULL; RuntimeError.UNCAUGHT => {BROADCAST tryToPaint; REJECT}; }; me.cursorInhibitations _ me.cursorInhibitations+1; WHILE me.cursorInhibitations>1 DO me.cursorInhibitations _ me.cursorInhibitations-1; WAIT tryToPaint; me.cursorInhibitations _ me.cursorInhibitations+1; ENDLOOP; mustRemoveCursor _ me.onVC; END; IF DisableCursoring[me].mustRemoveCursor THEN RemoveCursor[me]; ViewerOps.PaintViewer[me.viewer, client, FALSE, whatChanged]; EnableCursoring[me]; EXITS oops => NULL; END; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ViewerProcess: PROC[me: VRef] = BEGIN comm: REF CDDrawQueue.Request = NEW[CDDrawQueue.Request]; bBTableSpace1, bBTableSpace2, bBTableSpace3: PrincOps.BBTableSpace; IF me.running THEN ERROR; TRUSTED { me.pBBptr _ PrincOpsUtils.AlignedBBTable[@bBTableSpace1]; me.oBBptr _ PrincOpsUtils.AlignedBBTable[@bBTableSpace2]; me.xBBptr _ PrincOpsUtils.AlignedBBTable[@bBTableSpace3]; }; me.running _ TRUE; DO comm^ _ CDDrawQueue.FetchCommand[me.ct]; SELECT comm.key FROM $redraw => { paintArea: RepaintRectAreaRef = NEW[RepaintRectArea_[comm.rect, TRUE]]; ProtectedRepaint[me, paintArea]; }; $draw => { paintArea: RepaintRectAreaRef = NEW[RepaintRectArea_[comm.rect, FALSE]]; ProtectedRepaint[me, paintArea]; }; CDDrawQueue.queueEmpty => { ProtectedRepaint[me, $Temporaries]; CedarProcess.SetPriority[CedarProcess.Priority[background]]; SafeStorage.ReclaimCollectibleObjects[suspendMe: FALSE]; }; CDDrawQueue.finishedForEver => EXIT; ENDCASE => ProtectedRepaint[me, comm]; ENDLOOP; TerminalIO.WriteRope["Viewer destroyed\n"]; me.running _ FALSE; me.ct _ NIL; me.actualDesign _ NIL; me.designRec _ NIL; me.deviceDrawRef _ NIL; me.painterList _ NIL; me.properties _ NIL; END; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- SlowDown: PROC [v: ViewerClasses.Viewer] = BEGIN IF v#NIL THEN WITH v.data SELECT FROM me: VRef => { me.hurryUp _ FALSE; me.slowDown _ TRUE; me.check _ TRUE; me.deviceDrawRef.checkPriority _ TRUE; }; ENDCASE => NULL; END; SpeedUp: PROC [v: ViewerClasses.Viewer] = BEGIN IF v#NIL THEN WITH v.data SELECT FROM me: VRef => { me.slowDown _ FALSE; me.hurryUp _ TRUE; me.check _ TRUE; me.deviceDrawRef.checkPriority _ TRUE; }; ENDCASE => NULL; END; RemoveCursor: PROC [me: VRef] = INLINE BEGIN IF me.onVC THEN ViewerOps.PaintViewer[me.viewer, client, FALSE, $RemoveTrack]; END; ModifyViewer: ViewerClasses.ModifyProc = -- PROC [self: Viewer, change: ModifyAction] BEGIN ENABLE UNWIND => NULL; SELECT change FROM set, pop => lastInputFocussedViewer _ inputFocussedViewer _ self; kill, push => inputFocussedViewer _ NIL; ENDCASE => NULL; SetCursor[]; END; NotifyViewer: ViewerClasses.NotifyProc = -- PROC [self: Viewer, input: LIST OF REF ANY] BEGIN ENABLE RuntimeError.UNCAUGHT => IF CDVPrivate.catchAnyWhichDeadlock THEN GOTO oops ELSE REJECT; me: VRef = NARROW[self.data]; mouse: CD.Position _ [0, 0]; --initialize, there are crazy tiptables. LogicalTrack: PROC [me: VRef, pos: CD.Position] = INLINE BEGIN IF NOT me.designRec.startLCValid THEN { me.designRec.startLC _ pos; me.designRec.startLCValid _ TRUE; } END; LogicalTrackOff: PROC [me: VRef, pos: CD.Position] = INLINE BEGIN me.designRec.stopLC _ pos; me.designRec.startLCValid _ FALSE; END; Track: PROC [me: VRef] = INLINE BEGIN VisibleTrack: PROC [me: VRef, pos: CD.Position] = INLINE BEGIN ViewerOps.PaintViewer[me.viewer, client, FALSE, GetTrackRef[pos] ]; END; pos: CD.Position = CDVScale.ViewerToDesignPosition[me.scale, mouse]; LogicalTrack[me, pos]; IF me.cursorInhibitations=0 THEN VisibleTrack[me, pos]; END; StopTrack: PROC [me: VRef] = BEGIN pos: CD.Position = CDVScale.ViewerToDesignPosition[me.scale, mouse]; me.hurryUp _ TRUE; LogicalTrackOff[me, pos]; RemoveCursor[me]; CDVPrivate.SetCursorMode[me, NIL]; END; IF self#cursoredCDViewer THEN { tem: ViewerClasses.Viewer = cursoredCDViewer; IF me.deviceDrawRef=NIL THEN { RETURN }; IF tem#NIL AND tem.data#NIL THEN RemoveCursor[NARROW[tem.data, VRef]]; cursoredCDViewer _ self; SetCursor[]; }; WHILE input#NIL DO WITH input.first SELECT FROM atom: ATOM => { IF atom=$Track THEN Track[me] ELSE IF atom=$StopTrack THEN StopTrack[me] ELSE IF terminalLock THEN { IF atom#$UseCursor THEN ViewerOps.BlinkIcon[viewer: self, millisecondsPerBlink: 100]; RETURN; } ELSE { IF self#inputFocussedViewer THEN { SlowDown[inputFocussedViewer]; InputFocus.SetInputFocus[self]; SpeedUp[self]; IF atom=$CloseReSelectOnlyP THEN RETURN; }; IF atom=$UseCursor THEN { --command involving 2 atoms RemoveCursor[me]; input _ input.rest; IF input=NIL THEN RETURN; CDVPrivate.SetCursorMode[me, input.first] } ELSE { -- all other (standard) commands StopTrack[me]; TRUSTED {Process.Detach[ FORK CDSequencer.ExecuteCommand[ design: me.actualDesign, comm: NEW[CDSequencer.CommandRec _ CDSequencer.CommandRec[ design: me.actualDesign, a: atom, pos: me.designRec.stopLC, sPos: me.designRec.startLC, l: me.designRec.currentLayer, ref: me, n: me.defaultWidthVC, b: me.designRec.firstHLC ]] ] ]}; }; }; }; coords: TIPUser.TIPScreenCoords => { mouse.x _ MIN[MAX[coords.mouseX, 0], me.viewer.cw-1]; mouse.y _ MIN[MAX[coords.mouseY, 0], me.viewer.ch-1]; }; ENDCASE => NULL; input _ input.rest ENDLOOP; EXITS oops => NULL; END; Caption: PROC [design: CD.Design] RETURNS [Rope.ROPE] = BEGIN IF design=NIL THEN RETURN["nil design"] ELSE RETURN [Rope.Cat[ (IF design.name#NIL THEN design.name ELSE "no name"), " (", design.technology.name, ") cell: ", CDExtras.PushedCellName[design] ]] END; CDEventHappened: CDEvents.EventProc = BEGIN name: Rope.ROPE = Caption[design]; FOR l: CDViewer.ViewerList _ CDViewer.ViewersOf[design], l.rest WHILE l#NIL DO me: VRef = NARROW[l.first.data]; l.first.name _ name; ViewerOps.PaintViewer[l.first, caption]; IF event=$AfterPop OR event=$AfterPush THEN { CDDrawQueue.QueueInsertDrawCommand[me.ct, CDDrawQueue.Request[$redraw, CDBasics.universe]] } ENDLOOP; END; CreateViewer: PUBLIC PROC[design: CD.Design] RETURNS [ViewerClasses.Viewer]= BEGIN bb: CD.Rect = CDExtras.BoundingBox[design]; me: VRef = New[design]; TRUSTED {Process.Detach[FORK ViewerProcess[me]]}; [] _ CDPanel.CreatePanel[design]; WHILE NOT me.running DO Process.Yield[] ENDLOOP; me.viewer _ ViewerOps.CreateViewer[ flavor: viewerClassAtom, info: [ name: Caption[design], scrollable: FALSE, icon: CDTipEtc.GetIcon[design], iconic: FALSE, column: ColumnForNewViewer[], tipTable: CDTipEtc.GetTipTable[design], data: me ], paint: TRUE --sorry, must check elsewhere for this case, otherwise viewerpackage blusters ]; me.dClip _ CDVScale.GetClipRecord[me.intendedScale, me.viewer.cw, me.viewer.ch]; IF CDBasics.NonEmpty[bb] THEN { CDViewer.ShowAndScale[me.viewer, bb]; CDDrawQueue.Flush[me.ct]; --I don't trust me me.scale _ me.intendedScale; me.dClip _ CDVScale.GetClipRecord[me.intendedScale, me.viewer.cw, me.viewer.ch]; }; CDDrawQueue.Flush[me.ct]; --I don't trust me CDDrawQueue.ChangeClipArea[me.ct, me.dClip]; ViewerOps.PaintViewer[me.viewer, all]; EnableCursoring[me]; RETURN [me.viewer] END; ColumnForNewViewer: PROC [] RETURNS [col: ViewerClasses.Column_left] = BEGIN colorDisplayEmpty: BOOL _ TRUE; CheckColorScreen: ViewerOps.EnumProc = {-- PROC [v: Viewer] RETURNS [BOOL _ TRUE] IF v.column=color AND ~v.iconic AND ~v.offDeskTop THEN RETURN [colorDisplayEmpty _ FALSE] }; IF WindowManager.colorDisplayOn AND putNewViewerOnColor THEN { ViewerOps.EnumerateViewers[CheckColorScreen]; IF colorDisplayEmpty THEN col _ color } END; DestroyViewer: ViewerClasses.DestroyProc = BEGIN Destroy[NARROW[self.data]]; self.data _ NIL; END; ViewerCloseEvent: ViewerEvents.EventProc = BEGIN me: VRef ~ NARROW[viewer.data]; IF event=close THEN CDDrawQueue.ChangeClipArea[me.ct, CDBasics.empty]; END; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- New: PUBLIC ENTRY PROC [design: CD.Design] RETURNS [me: VRef] = BEGIN ENABLE UNWIND => NULL; NewScale: PROC [design: CD.Design] RETURNS [CDVScale.ScaleRec] = BEGIN scale: INT = CDValue.FetchInt[boundTo: design, key: $CDxInitScale, propagation: global, ifNotFound: 6]; grid: INT = CDValue.FetchInt[boundTo: design, key: $CDxInitGrid, propagation: global, ifNotFound: design.technology.lambda]; RETURN [ CDVScale.MakeScale[ nscale: MIN[MAX[scale, 0], CDVScale.scaleNum-1], grid: MIN[MAX[grid, 0], 512], off: [0, 0] ]]; END; InitDesignRec: PROC [me: VRef] = BEGIN FOR l: LIST OF VRef _ allVRefs, l.rest WHILE l#NIL DO IF me.actualDesign=l.first.actualDesign THEN { me.designRec _ l.first.designRec; RETURN }; ENDLOOP; me.designRec _ NEW[CDVPrivate.VPrivatePerDesign]; CDVPrivate.SetCursorMode[me, NIL]; END; b: REF BOOL = NEW[BOOL_FALSE]; me _ NEW[CDVPrivate.VRec_[ actualDesign: design, ct: CDDrawQueue.Create[design, b, CDBasics.empty], scale: NewScale[design], dClip: CDBasics.empty, intendedScale: NewScale[design], stoprequest: b, environment: CDProperties.GetPropFromDesign[design, $CDxDrawEnvironment]#$FALSE, symbolics: CDProperties.GetPropFromDesign[design, $CDxDrawSymbolics]#$FALSE, b4: CDProperties.GetPropFromDesign[design, $CDxSkipBorder]#$FALSE, personalColors: CDColors.globalColors, cursorInhibitations: 1, --disabled, not yet ready properties: CD.InitPropRef[] ]]; InitDesignRec[me]; allVRefs _ CONS[me, allVRefs]; END; Destroy: PUBLIC ENTRY PROC [me: VRef] = TRUSTED BEGIN ENABLE UNWIND => NULL; allVRefs _ LOOPHOLE[List.DRemove[ref: me, list: LOOPHOLE[allVRefs]]]; IF me#NIL THEN CDDrawQueue.Destroy[me.ct]; END; -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- NoteProfileChange: UserProfile.ProfileChangedProc = BEGIN catchAny _ UserProfile.Boolean["ChipNDale.CatchLowLevelErrors", TRUE]; catchAnyWhichDeadlock _ catchAny OR UserProfile.Boolean["ChipNDale.CatchErrorsWhichCauseDeadlock", TRUE]; putNewViewerOnColor _ UserProfile.Boolean["ChipNDale.FirstViewerOnColor", TRUE]; END; UserProfile.CallWhenProfileChanges[NoteProfileChange]; TerminalIO.AddLock[TerminalLock, TerminalFree]; CDVFurtherPainters.InstallFurtherPaint[keyValue: $changeScale, proc: Flushed]; CDVFurtherPainters.InstallFurtherPaint[keyValue: $flushed, proc: Flushed]; CDEvents.RegisterEventProc[$ResetDesign, CDEventHappened]; CDEvents.RegisterEventProc[$RenameDesign, CDEventHappened]; CDEvents.RegisterEventProc[$AfterPush, CDEventHappened]; CDEvents.RegisterEventProc[$AfterPop, CDEventHappened]; ViewerOps.RegisterViewerClass[viewerClassAtom, viewerClassRec]; [] _ ViewerEvents.RegisterEventProc[proc: ViewerCloseEvent, event: close, filter: viewerClassAtom, before: TRUE]; TerminalIO.WriteRopes[greeting, date, copyRight]; END. ,CDVMain.mesa (part of ChipNDale) Copyright c 1983, 1986 by Xerox Corporation. All rights reserved. Ch. Jacobi, June 24, 1983 3:33 pm last edited by Christian Jacobi, March 12, 1986 6:11:36 pm PST --monitoring rule: aquire the ViewerLock first, the monitor's entry lock only after. -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- types used for parameters to the viewer paint procedure --TrackRef: type to force cursor tracking --the Get and Dispose proc's are a hack to reduce the memory allocator's work --may be called by viewers NotifyViewer proc only; monitored through viewers NotifyViewer proc --RepaintRectAreaRef: type to force drawing a rectangular aera -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --logically inside the viewer's paint proc; --reset viewer data and then sets up a buffered request for redrawing -- erase to allow also backgrounds of arbitrary patterns or colors --PROC [self: Viewer, context: Imager.Context, whatChanged: REF ANY, clear: BOOL] --depending on whatChanged, the call must be protected or need not. --Never call with modules entry monitor lock set. --now me.onVC is true --PaintViewer -- logicaly local to viewers paint proc (PaintViewer) --logically local to ProtectedRepaint --is outside to make callable from catch-phrase and initialization --does: --remove cursor and disables any cursoring process --let only one client come through --and enters protected region. --ProtectedRepaint --me.fooBBptr is a short pointer! (hardware) therefore must be local to some procedure space. --do the garbage collection now, when not to much else is to do, --and also all the allocations of the drawing can be freed --order important --order important --removes visible cursor, if there is --monitores inside viewerpaintproc -- ENTRY ommitted since sequential already by viewer package --makes cursor logically available --makes cursor logically unavailable --uses intermediate layer variable mouse --makes cursor visible --Track --uses intermediate layer variable mouse --NotifyViewer --silly Cedar Viewer package allows calls of notify before --the first call to the paint procedure happened; --but in ChipNDale, some initializations happens in paintprocedure only. --luckily at that time cursoredCDViewer#self; so here is the only --place to check. -- range test, -- [some crazy tiptables use coords without having had a mouse action first] -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- PROC [event: REF, design: CD.Design, x: REF] -- repaint captions and sometimes the contents --redraw everything, because -- after pop: cell change may have propagated -- after push: background features must be redrawn greyish --must wait until me.fooBBLT is initialized by ViewerProcess paint: FALSE --important: me.viewer is initialized only after return --but redraw does not yet come through... (clip area empty!) --selects colordisplay if it is on and free -- PROC [viewer: Viewer, event: ViewerEvent, before: BOOL] RETURNS [abort: BOOL _ FALSE] --New -- PROC [reason: ProfileChangeReason] ΚŽ˜codešœ"™"Kšœ Οmœ7™BKšœ"™"Kšœ?™?—K˜šΟk ˜ Kšžœ˜Kšœ ˜ Kšœ ˜ K˜ Kšœ ˜ K˜ K˜Kšœ ˜ Kšœ žœ'˜8K˜ Kšœ ˜ Kšœ˜Kšœ˜Kšœ ˜ Kšœ ˜ Kšœ ˜ Kšœ ˜ K˜Kšœ žœ˜!Kšœ˜Kšœ žœ˜Kšœ˜Kšœžœ˜Kšœ žœ˜+Kšœžœžœ˜Kšœ žœžœ˜Kšœ žœ˜.Kšœ ˜ Kšœžœ˜ Kšœ ˜ Kšœ˜Kšœ žœ ˜2Kšœ žœY˜hKšœžœ˜%—K˜šΠblœžœžœ˜KšœT™Tšžœ˜KšœΥ˜Υ—Kšžœ ˜Kšžœ.˜4—Kšž˜K˜Kšœžœ-˜@Kšœ žœ˜#KšœžœP˜dK˜KšΟcœ œ œ œ œ œ œ œ ˜5K˜Kšœžœžœžœ˜+Kš œ žœžœžœžœ˜$Kšœ žœžœžœ˜Kšœžœžœž˜*Kšœžœžœ˜!K˜Kš œ œ œ œ œ œ œ œ ˜5K˜Kšœžœ˜#Kšœžœ˜K˜Kš œ œ œ œ œ œ œ œ ˜5K˜Kšœžœžœ˜K˜šΟn œžœ˜Kšœžœ˜Kšœ(˜(Kšœ˜—K˜š‘ œžœ˜Kšœž˜Kšœ ˜ Kšœ˜—K˜Kšœ2™2K™:K˜Kšœ)™)˜Kšœ žœžœ˜"šœ žœžœ˜Kšœžœ ˜K˜—K˜KšœN™NKšœžœ˜K˜š ‘ œžœžœ žœžœ˜CKšœ^™^Kšœžœ˜Kš žœžœžœžœžœ˜#Kšœ ˜ K˜—K˜š‘œžœžœ˜.Kšœ ˜ K˜—K˜—Kšœ?™?˜Kšœžœžœ˜0šœžœžœ˜Kšœžœ˜"Kšœžœž˜K˜——K™Kšœ2™2K˜Kšœ ž œ˜K˜šœ,žœ!˜PKšœ˜Kšœ˜Kšœ˜K˜Kšœ˜Kšœ˜Kšœ˜K˜—K™Kšœ2™2K˜Kšœžœžœ˜4Kšœ,žœ˜0Kšœ0žœ˜4˜Kšœ2˜2Kšœ.˜.Kšœ4˜4—K˜š‘ œžœžœ˜šœ˜Kšžœžœ˜%Kšžœžœ&žœ˜AKšžœ˜—K˜—K˜Kšœ5˜5K˜š‘ œžœžœžœ˜;Kšž˜Kšžœ˜ Kšžœ˜—K˜K˜š‘œžœžœ ˜'Kšœ+™+K™Ešžœ˜Kšžœžœžœ˜—Kšœ˜Kšœ žœ 4˜FKšœ%˜%šœ,˜,KšœB™B—Kšœ[˜[Kšžœ˜—K˜šΟb œ˜&KšœQ™QKšœC™CKšœ1™1šž˜šžœ˜Kšœ$žœ˜.šœ žœ˜Kš žœ"žœžœžœžœ˜?—K˜——Kšœ žœ ˜K˜š‘ œžœžœžœ˜=šžœ˜Kšžœžœžœ˜—šžœžœ˜"Kšžœ žœ˜!šžœ˜Kšœ"˜"Kšœ.˜.KšœC˜Cšœ*˜*Kšœ@˜@—Kšœ žœ˜K˜—Kšœ™Kšœ+˜+Kšœ˜K˜K˜—Kšœ˜Kšžœ˜K˜—š‘ œžœžœ ž˜*šžœ˜Kšžœžœžœ˜—šžœ žœ˜K˜Kšœ žœ˜K˜—Kšžœ˜—K˜Kšœ ™ Kšžœžœžœ˜K˜šžœ žœž˜Kšœ' ˜@šœžœ˜Kšžœžœ˜)Kšžœ+ ,˜[K˜—šœ  ˜˜>—šžœ˜ šžœ žœžœ˜Kšžœžœžœ ˜Kšœ˜—K˜——Kšœ2˜2Kšž œ ˜Kšžœ žœ˜Kšžœ˜K˜——š‘œžœžœžœ˜8šœ™Kšœ2™2Kšœ"™"—šž˜šžœžœ˜!Kšœ˜Kš žœ"žœžœžœž˜>Kšœ˜——K˜š ‘œžœžœ žœžœ˜JKšœ™šž œ˜ šžœž˜Kšžœžœ˜Kšœ žœž œ žœ˜8K˜——K˜2šžœžœ˜"K˜2Kšžœ ˜K˜2Kšžœ˜—Kšœ˜Kšžœ˜K˜—Kšœ™Kšžœ'žœ˜?Kšœ)žœ˜=K˜Kšžœ žœ˜Kšžœ˜—K˜Kš œ œ œ œ œ œ œ œ ˜5K˜š‘ œžœ ˜Kšž˜Kšœžœžœ˜9šœD˜DKšœ]™]—Kšžœ žœžœ˜šžœ˜ Kšœ9˜9Kšœ9˜9Kšœ9˜9Kšœ˜—Kšœ žœ˜šž˜Kšœ(˜(šžœ ž˜˜ Kšœ žœžœ˜GKšœ ˜ Kšœ˜—˜ Kšœ žœžœ˜HKšœ ˜ Kšœ˜—šœ˜Kšœ#˜#Kšœ<˜—Kšžœ˜—K˜š‘ œ -˜VKšž œžœžœ˜šžœž˜KšœA˜AKšœ#žœ˜(Kšžœžœ˜—Kšœ ˜ Kšžœ˜—K˜š’ œ˜)Kš /œ˜0Kšœ=™=šž˜šžœžœ˜ Kš žœ"žœžœžœžœ˜?——K˜Kšœ žœ ˜Kšœžœ )˜EK˜š‘ œžœžœ ž˜8Kšœ"™"Kšž˜šžœžœžœ˜'Kšœ˜Kšœžœ˜!K˜—Kšžœ˜K˜—š‘œžœžœ ž˜;Kšœ$™$Kšž˜Kšœ˜Kšœžœ˜#Kšžœ˜K˜—š‘œžœž˜Kšœ(™(Kšž˜K˜š‘ œžœžœ ž˜8Kšœ™Kšž˜Kšœ)žœ˜CKšžœ˜K˜—Kšœ™Kšœžœ=˜DK˜Kšžœžœ˜7Kšžœ˜K˜—š‘ œžœ˜Kšœ(™(Kšž˜Kšœžœ=˜DKšœ žœ˜Kšœ˜Kšœ˜Kšœžœ˜"Kšžœ˜K˜—Kšœ™šžœžœ˜Kšœ-˜-šžœžœžœ˜Kšœ:™:Kšœ1™1KšœH™HKšœA™AKšœ™Kšž˜K˜—Kš žœžœžœ žœžœžœ˜FKšœ˜Kšœ ˜ Kšœ˜—šžœžœžœ˜šžœ žœž˜šœžœ˜Kšžœ žœ ˜Kšžœžœ˜+šžœžœžœ˜Kšžœžœ?˜VKšž˜Kšœ˜—šžœ˜šžœžœ˜"Kšœ˜Kšœ˜Kšœ˜Kšžœžœžœ˜)K˜—šžœžœ ˜5Kšœ˜Kš œžœžœžœžœ˜.Kšœ)˜)K˜—šžœ  ˜'K˜šžœ˜šžœ˜ Kšœ˜šœžœ1˜:K˜K˜Kšœ˜Kšœ˜Kšœ˜K˜K˜Kšœ˜Kšœ˜—Kšœ˜—Kšœ˜—Kšœ˜—Kšœ˜—K˜—˜$Kšœ™KšœM™MKšœ žœžœ%˜6Kšœ žœžœ$˜5K˜—Kšžœžœ˜—Kšœ˜Kšžœ˜—Kšžœ žœ˜Kšžœ˜—K˜Kšœ8™8K˜š ‘œžœ žœ žœžœ˜7Kšž˜Kšžœžœžœžœ˜'šžœžœ ˜Kš œžœ žœžœ žœ ˜6Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜—Kšžœ˜K˜—š’œ˜%Kšœ0™0Kšœ.™.Kšž˜Kšœ žœ˜"šžœ=žœžœž˜NKšœ žœ˜ K˜K˜(šžœžœžœ˜.Kšœ™Kšœ.™.Kšœ;™;KšœZ˜ZK˜—Kšžœ˜—Kšžœ˜K˜—š ‘ œžœžœ žœ žœ˜MKšž˜Kšœžœ&˜,Kšœ˜Kšžœžœ˜1K˜!Kšœ<™