DIRECTORY CD, CDApplications, CDBasics, CDRects, CDIO, CDLRUCache, CDOrient, CMos, Rope, TokenIO; CMosPDif: CEDAR PROGRAM IMPORTS CD, CDApplications, CDBasics, CDIO, CDLRUCache, CDRects, CDOrient, CMos, TokenIO = BEGIN lambda: CD.DesignNumber = CD.lambda; wellSurround: CD.DesignNumber = CMos.wellSurround; pForWellDiff: REF CD.ObjectProcs = CD.RegisterObjectType[$CMosPDifRect, CMos.cmos]; cache: CDLRUCache.LRUCache = CDLRUCache.Create[size: 30, newProc: NewPDif]; dummySpecific: REF CMos.WellRectRep = NEW[CMos.WellRectRep]; NewPDif: PROC [] RETURNS [CD.ObPtr] = { ob: CD.ObPtr _ NEW[CD.ObjectDefinition_[p: pForWellDiff]]; ob.specificRef _ dummySpecific; RETURN [ob] }; Init: PROC [] = BEGIN pForWellDiff.drawMe _ DrawWellDiffRect; pForWellDiff.interestRect _ pForWellDiff.oldInsideRect _ InsideWellDiffRect; pForWellDiff.showMeSelected _ ShowSelectedWellDiffRect; pForWellDiff.hitInside _ HitInsideWellDiffRect; pForWellDiff.internalRead _ ReadWellDif; pForWellDiff.internalWrite _ WriteWellDif; pForWellDiff.wireTyped _ TRUE; pForWellDiff.describe _ Describe; CDRects.UseAsCreateRect[CMos.wpdif, CreateWellDiffRect, pForWellDiff]; CDRects.UseAsCreateRect[CMos.bur, CDRects.CreateSaveRect]; CDRects.UseAsCreateRect[CMos.cut2, CDRects.CreateSaveRect]; END; Describe: PROC[me: CD.ObPtr] RETURNS [Rope.ROPE] = BEGIN RETURN ["w-pdif"] END; WriteWellDif: CD.InternalWriteProc -- PROC [me: ObPtr] -- = BEGIN TokenIO.WriteInt[me.size.x-2*wellSurround]; TokenIO.WriteInt[me.size.y-2*wellSurround]; CDIO.WriteLayer[CMos.wpdif]; END; ReadWellDif: CD.InternalReadProc --PROC [] RETURNS [ObPtr]-- = BEGIN x: INT = TokenIO.ReadInt[]; y: INT = TokenIO.ReadInt[]; l: CD.Layer = CDIO.ReadLayer[]; ob: CD.ObPtr = CreateWellDiffRect[[x, y], CMos.wpdif]; RETURN [ob] END; InsideWellDiffRect: PROC [ob: CD.ObPtr] RETURNS [CD.DesignRect] = BEGIN RETURN [CDBasics.Extend[CDBasics.RectAt[[0, 0], ob.size], -wellSurround]] END; ShowSelectedWellDiffRect: PROC [aptr: CD.ApplicationPtr, pos: CD.DesignPosition, orient: CD.Orientation, pr: CD.DrawRef] = BEGIN pr.outLineProc[CDBasics.Extend[CDOrient.RectAt[pos, aptr.ob.size, orient], -(wellSurround)], pr] END; HitInsideWellDiffRect: PROC [aptr: CD.ApplicationPtr, hitRect: CD.DesignRect] RETURNS [BOOL] = BEGIN RETURN [CDBasics.Intersect[ CDBasics.Extend[ CDApplications.ARectO[aptr], -wellSurround], hitRect]] END; CreateWellDiffRect: PROC [size: CD.DesignPosition, l: CD.Layer] RETURNS [CD.ObPtr] = BEGIN ob: CD.ObPtr ~ cache.UnusedOrNew[]; ob.p _ pForWellDiff; ob.size _ CDBasics.AddSize[ [2*wellSurround, 2*wellSurround], CDBasics.MaxPoint[size, [1, 1]]]; ob.layer _ CMos.wpdif; RETURN [cache.ReplaceByAequivalent[ob]] END; DrawWellDiffRect: PROC [aptr: CD.ApplicationPtr, pos: CD.DesignPosition, orient: CD.Orientation, pr: CD.DrawRef] = BEGIN r: CD.DesignRect = CDOrient.RectAt[pos, aptr.ob.size, orient]; inr: CD.DesignRect = CDBasics.Extend[r, -wellSurround]; pr.drawRect[inr, CMos.pdif, pr]; pr.drawRect[r, CMos.nwel, pr]; END; Init[]; END.  CMosPDif.mesa (part of ChipNDale) Copyright c 1983, 1985 by Xerox Corporation. All rights reserved. by Christian Jacobi, September 10, 1983 9:34 pm last edited Christian Jacobi, March 20, 1985 9:46:27 am PST -- hack; here to reduce numbers of modules only Κϋ˜šœ"™"Jšœ Οmœ7™BJšœ1™1Jšœ<™Jšž˜Jšœžœ˜Jšœžœ˜Jšœžœ žœ ˜Jšœžœ0˜6Jšžœ˜ Jšžœ˜J˜—š Ÿœžœžœžœžœ˜AJšž˜JšžœD˜JJšžœ˜J˜—šŸœžœžœžœ˜QJšœžœžœ ˜)Jšž˜Jšœ`˜`Jšžœ˜J˜—šŸœžœžœžœ ˜NJšžœžœ˜Jšž˜šžœ˜˜J˜J˜—J˜ —Jšžœ˜J˜—š Ÿœžœžœžœžœžœ ˜TJšžœ˜Jšœžœ˜#Jšœ˜˜J˜"J˜!—Jšœ˜Jšžœ!˜'Jšžœ˜J˜—š Ÿœžœžœžœžœ ˜`Jšœžœ ˜Jšž˜Jšœžœ9˜>Jšœžœ1˜8Jšœ ˜ J˜Jšžœ˜J˜—J˜Jšžœ˜J˜—…— ΘΟ