DIRECTORY CD, CDDrawQueue USING [DrawQueue], CDBasics USING [empty], CDColors, CDVScale USING [ScaleRec], ViewerClasses USING [Viewer], Imager USING [Context], PrincOps USING [BBptr], Rope USING [ROPE], Terminal USING [FrameBuffer]; CDVPrivate: CEDAR DEFINITIONS = BEGIN notSupportedColorMode: ERROR; --catched by viewer paintproc DebugProc: TYPE = PROC [ref: REF_NIL, wedge: BOOL_FALSE, msg: Rope.ROPE_NIL] RETURNS [BOOL_FALSE]; UseDebug: PROC [proc: DebugProc]; ShallContinue: PROC [ref: REF_NIL, wedge: BOOL_FALSE, msg: Rope.ROPE_NIL] RETURNS [BOOL]; VRef: TYPE = REF VRec; -- for NEW use only New VRec: TYPE = RECORD [ viewer: ViewerClasses.Viewer _ NIL, pBBptr: PrincOps.BBptr _ NIL, xBBptr: PrincOps.BBptr _ NIL, -- used for all other purposes; set flags before usage frame: Terminal.FrameBuffer, screen: LONG POINTER _ NIL, bpp: CARDINAL _ 1, -- bits per pixel (1, 4, 8) logbpp: CARDINAL _ 0, display: CDColors.DisplayType _ bw, scWidthWords: CARDINAL _ 0, -- Screen width in words vx: CARDINAL _ 0, --distance from left of screen to left most pixel vy: CARDINAL _ 0, --distance from top of screen to bottom most pixel vh: CARDINAL _ 0, --copied from viewer, to avoid race conditions vw: CARDINAL _ 0, --copied from viewer, to avoid race conditions dClip: CD.Rect _ CDBasics.empty, -- no point outside is visible on viewer scale: CDVScale.ScaleRec, personalColors: REF CDColors.ColorDefinition, colorTable: REF CDColors.ColorTable, --switch between fore- and back- ground viewContext: Imager.Context _ NIL, ct: CDDrawQueue.DrawQueue _ NIL, deviceDrawRef: CD.DrawRef _ NIL, actualDesign: CD.Design _ NIL, remember: PRIVATE REF _ NIL, --private usage of CDVDraw stoprequest: REF BOOL, check: BOOL _ FALSE, hurryUp: BOOL _ FALSE, slowDown: BOOL _ FALSE, running: BOOL _ FALSE, environment: BOOL _ TRUE, symbolics: BOOL _ TRUE, fontSubstitution: BOOL _ FALSE, borders: BOOL _ FALSE, checkPriority: BOOL _ TRUE, b4: BOOL _ TRUE, b5: BOOL _ TRUE, suppressFactorForCells: REAL _ 1.0, contextFilter: REF CD.ContextFilter, painterList: PainterList _ NIL, usedCursor: OutLineProc, startVC, stopVC: CD.Position _ [0, 0], onVC: BOOL _ FALSE, cursorInhibitations: CARDINAL _ 0, -- MONITORED firstHorizontalVC: BOOL _ TRUE, defaultWidthVC: CD.Number _ 0, -- width of cursored wire intendedScale: CDVScale.ScaleRec, designRec: REF VPrivatePerDesign, --never assign nil properties: CD.PropRef _ --registration is expected ]; VPrivatePerDesign: TYPE = RECORD [ startLCValid: BOOL _ FALSE, -- Logical Cursors startLC: CD.Position _ [0,0], stopLC: CD.Position _ [0,0], firstHLC: BOOL _ FALSE, widthLC: CD.Number _ 0, currentLayer: CD.Layer, usedCursor: REF _ NIL, --key designating outlineProcLC outlineProcLC: OutLineProc, --if a new cursor is used, this one will be used; never assign nil xMode: BOOL _ FALSE, -- usefull for wiring-, pendingdelete-modes..., but only 1 mode per tip table mark: CD.Position _ [0, 0] -- reserved for usage as logical mark, independent of visibility ]; IncludeAPainterRec: PROC [me: VRef, pr: REF PainterRec]; RemoveAPainterRec: PROC [me: VRef, pr: REF PainterRec]; PainterRec: TYPE = RECORD [ rect: CD.Rect _ CDBasics.empty, proc: PainterProc _ NIL, -- the painterproc data: REF _ NIL ]; PainterProc: TYPE = PROC [me: VRef, paintRef: REF PainterRec, interrestRect: CD.Rect]; PainterList: TYPE = LIST OF REF PainterRec; allVRefs: READONLY LIST OF VRef; New: PRIVATE PROC [design: CD.Design] RETURNS [VRef]; Destroy: PRIVATE PROC [VRef]; CreateDrawInformation: PRIVATE PROC [vRef: VRef]; ResetDrawScale: PRIVATE PROC [vRef: VRef]; RepaintRectAreaInViewer: PRIVATE PROC[vRef: VRef, rect: CD.Rect, eraseFirst: BOOL]; RepaintBackground: PRIVATE PROC[vRef: VRef, rect: CD.Rect, eraseFirst: BOOL]; OutLineProc: TYPE = PROC[me: VRef]; --type of cursoring procedure cursoredCDViewer: READONLY ViewerClasses.Viewer; InvertArea: PROC[me: VRef, x1, y1, x2, y2: INT]; --xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx CreateViewer: PROC [design: CD.Design] RETURNS [ViewerClasses.Viewer]; LastViewer: PROC [] RETURNS [ViewerClasses.Viewer]; CheckPriority: CD.CheckPriorityProc; DoInsideMonitor: PRIVATE PROC [proc: PROC [VRef], vRef: VRef]; END. δCDVPrivate.mesa (Viewer definitions for ChipNDale) Copyright c 1983, 1986, 1987 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, July 15, 1983 11:16 am Last edited by: Christian Jacobi, April 29, 1987 1:11:56 pm PDT -- Non public ChipNDale interface defining viewer handling. --can be called to assign debugging procedures --proc is called from critical places; any IO can wedge the machine --on errors in critical places, use --! RuntimeError.UNCAUGHT => IF ShallContinue[...] THEN CONTINUE --in addition to catching UNWIND --deadlock: TRUE in places which would deadlock if CONTINUE isn't called --xx Data xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ----------- -- all the data for bit-blit are protected with monitor -- used for painting [overpainting: "or"ing pictures] exclusively, with single -- exception of re-initialization of background [flags are set for painting, and must -- be reset before exit of re initialization]. --speedups for frame^ ----------- --further drawings --cursor tracking information (Visible Cursors) --PainterList's xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -- a viewer record has a list of PainterRec's, a record with a rectangle and a procedure. -- Whenever a rectangle is (re)drawn, all intersecting PainterRec's will be applied. Its -- interrestRect will be set to the intersection of the registered rect and some clip boundary. -- -- This allows to independently implement drawing further area dependent features. -- The PainterRec's proc will be called inside the "viewer main loop" only. --xx list xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --New and Destroy are the only methods to modify allVRefs --xx Drawing xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --monitored by: called from "viewer" loop only --monitored by: called from "viewer" loop only --moves scale down from intendedScale and calls CreateDrawInformation --monitored by: called from "viewer" loop only --(re)draws everything --monitored by: called from "viewer" loop only --(re)draws background only --useful for erasing first and painting later to achieve visual effect --xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --Cursor's --viewer which has the ChipNDale cursor --(it does not need to have the input focus) --x1, y1, x2, y2 in viewers coordinates; --handy procedure for several cursor implementors --the monitor protecting the bit-blit data Κm˜codešœ9™9Kšœ Οmœ=™HKšœ4™4K™?K˜—šΟk ˜ Kšžœ˜Kšœ žœ ˜Kšœ žœ ˜Kšœ ˜ Kšœ žœ ˜Kšœžœ ˜Kšœžœ ˜Kšœ žœ ˜Kšœ˜Kšœ žœ˜—K˜KšΟn œžœž œ˜Kšž˜K˜Kšœ>™>KšœžœΟc˜;K˜Kšœ žœžœžœžœ žœžœ žœžœžœžœžœ˜bK˜šŸœžœ˜"K™/KšœD™DK˜—šŸ œžœžœžœ žœžœ žœžœžœžœ˜YK™$Kšœ@™@K™ KšœH™H—K™KšœL™LK˜Kšœžœžœ  ˜0šœžœžœ˜Kšœžœ˜#Kšœ ™ Kšœ7™7šœžœ˜KšœP™PKšœU™UKšœ/™/—šœžœ˜Kš 6˜6—šœ˜Kšœ™Kšœžœžœžœ˜Kšœžœ ˜0Kšœžœ˜K˜#Kšœžœ ˜4—Kšœžœ 1˜CKšœžœ 2˜DKšœžœ .˜@Kšœžœ .˜@Kšœžœ (˜IKšœ˜Kšœ ™ Kšœžœ˜-Kšœ žœ '˜LKšœžœ˜#Kšœžœ˜ Kšœžœ žœ˜ Kšœžœ žœ˜Kšœ žœžœžœ ˜7Kšœ žœžœ˜Kšœžœžœ˜Kšœ žœžœ˜Kšœ žœžœ˜Kšœ žœžœ˜Kšœ žœžœ˜Kšœ žœžœ˜Kšœžœžœ˜Kšœ žœžœ˜Kšœžœžœ˜Kšœžœžœ˜Kšœžœžœ˜Kšœžœ˜#Kšœžœžœ˜$K™Kšœ™Kšœžœ˜K™Kšœ0™0K˜Kšœžœ˜&Kšœžœžœ˜Kšœž œ  ˜/Kšœžœžœ˜Kšœžœ  ˜8K™Kšœ!˜!Kšœ žœ ˜4Kšœ žœ  ˜3K˜K˜—šœžœžœ˜"Kšœžœžœ ˜0Kšœ žœ˜Kšœžœ˜Kšœ žœžœ˜Kšœ žœ ˜Kšœžœ˜Kšœ žœžœ ˜6Kšœ B˜^Kšœžœžœ M˜bKšœžœ @˜[K˜K˜—KšœR™RK™KšœY™YKšœY™YKšœ_™_Kšœ™KšœR™RšœK™KK˜—KšŸœžœžœ ˜8KšŸœžœžœ ˜7K˜šœ žœžœ˜Kšœžœ˜Kšœžœ ˜,Kšœžœž˜K˜—Kš œ žœžœžœžœ˜VKš œ žœžœžœžœ ˜+K˜K˜KšœL™LK˜šœ žœžœžœ˜"Kšœ9™9—K˜KšŸœž œ žœ žœ˜5KšŸœž œ˜K˜KšœO™OK˜šŸœž œ˜1Kšœ.™.—K˜šŸœž œ˜*Kšœ.™.KšœE™E—K˜šŸœž œžœžœ˜SKšœ.™.Kšœ™—K˜šŸœž œžœžœ˜MKšœ.™.Kšœ™KšœG™G—K˜K˜KšœD™DKšœ ™ K˜šœ žœžœ ˜$Kš ˜—K˜šœžœ˜0Kšœ)™)Kšœ.™.—K˜šŸ œžœžœ˜0Kšœ)™)Kšœ1™1K˜—KšœD˜DK˜KšŸ œžœ žœ žœ˜FK˜KšŸ œžœžœ˜3K˜KšΟb œžœ˜%K˜šŸœž œžœ˜>K™*—K˜Kšžœ˜K˜K˜K˜—…—‚!Σ