-- procedure exporting module of silicon (pretty picture) program -- last modified by E. McCreight, February 2, 1983 3:40 PM DIRECTORY InlineDefs, SegmentDefs, StringDefs, multiGraphicsDefs, ppddefs, ppdddefs, ppdefs; ppprocs6:PROGRAM IMPORTS ppddefs,ppdddefs, ppdefs, multiGraphicsDefs, InlineDefs EXPORTS ppdddefs, ppddefs = BEGIN OPEN ppdefs, ppddefs, ppdddefs,SegmentDefs, InlineDefs, multiGraphicsDefs; lp: LONG POINTER TO list; noChange: PUBLIC BOOLEAN; cChange, bChange: PUBLIC BOOLEAN; doingAreaSel: PUBLIC BOOLEAN; didBW:PUBLIC BOOLEAN_FALSE; doMove: PUBLIC cmdProc = BEGIN dx, dy: INTEGER; dx _ xx - markPnt.x; dy _ yy - markPnt.y; movSel[dx, dy]; putMark[xx, yy,FALSE]; END; lList:TYPE = RECORD[nxt:LONG POINTER TO lList,lp:LONG POINTER TO list, horz,top,bot:BOOLEAN_FALSE]; noMatches:PROCEDURE[rt:Rect,llt,ll:LONG POINTER TO lList,primary:BOOLEAN] RETURNS[BOOLEAN] = BEGIN rb:Rect; top,bot:BOOLEAN; rb.x2_rt.x2; rb.y2_rt.y2; IF BITAND[llt.lp.idx,4] = 0 THEN BEGIN rb.x1_rt.x1; rb.y1_rt.y2; rt.y2_rt.y1; END ELSE BEGIN rb.x1_rt.x2; rb.y1_rt.y1; rt.x2_rt.x1; llt.horz_TRUE; END; WHILE ll#NIL DO IF rb.x2>=ll.lp.lx AND rb.y2>=ll.lp.ly THEN BEGIN ii:CARDINAL_IF BITAND[ll.lp.idx,4]=0 THEN 0 ELSE 1; top_rt.x2>=ll.lp.lx AND rt.y2>=ll.lp.ly AND rt.x1<=ll.lp.lx+ll.lp.ob.size[ii] AND rt.y1<=ll.lp.ly+ll.lp.ob.size[ii+1]; bot_rb.x2>=ll.lp.lx AND rb.y2>=ll.lp.ly AND rb.x1<=ll.lp.lx+ll.lp.ob.size[ii] AND rb.y1<=ll.lp.ly+ll.lp.ob.size[ii+1]; IF top OR bot THEN BEGIN WITH ob:ll.lp.ob^ SELECT FROM cell,rect => NULL; wire,bus => BEGIN IF ob.l#llt.lp.ob.l THEN top_bot_FALSE; IF NOT primary AND ll.horz=llt.horz THEN top_bot_FALSE; END; xstr => BEGIN IF llt.lp.ob.l=met THEN top_bot_FALSE; END; cont => BEGIN SELECT llt.lp.ob.l FROM dif => IF ob.typ=mPol THEN top_bot_FALSE; pol => IF ob.typ=mDif THEN top_bot_FALSE; met => IF ob.typ=burr THEN top_bot_FALSE; ENDCASE => top_bot_FALSE; END; ENDCASE => top_bot_FALSE; llt.top_llt.top OR top; llt.bot_llt.bot OR bot; END; END; ll_ll.nxt; ENDLOOP; RETURN[NOT (llt.top OR llt.bot)]; END; freeuplList:PROCEDURE[l:LONG POINTER TO lList] = BEGIN ll:LONG POINTER TO lList; WHILE l#NIL DO ll_l.nxt; FreeSpace[l]; l_ll; ENDLOOP; END; fiddleWire:PROCEDURE[ll:LONG POINTER TO lList,dx,dy:INTEGER,primary:BOOLEAN]= BEGIN mx:INTEGER_dx; my:INTEGER_dy; r:Rect_getRect[ll.lp]; IF ll.top THEN BEGIN IF NOT primary THEN {IF ll.horz THEN my_0 ELSE mx_0;}; IF NOT ll.bot THEN []_ll.lp.ob.p.setParm[ll.lp,length, -(IF ll.horz THEN dx ELSE dy),1,FALSE]; END ELSE IF ll.bot THEN BEGIN IF ll.horz THEN {mx_0;IF NOT primary THEN my_0;} ELSE {my_0;IF NOT primary THEN mx_0;}; []_ll.lp.ob.p.setParm[ll.lp,length, (IF ll.horz THEN dx ELSE dy),1,FALSE]; END ELSE RETURN; moveOb[ll.lp,mx,my]; reDrawRect[r, 1, TRUE, TRUE, FALSE]; reDrawRect[getRect[ll.lp], 0, TRUE, TRUE, FALSE]; END; movSel: PROCEDURE [dx, dy: INTEGER] = BEGIN anyChanges _ sinceIOchanges _ TRUE; IF Stretchy THEN BEGIN ll1,ll2,ll3,ll4:LONG POINTER TO lList_NIL; llt,lltt:LONG POINTER TO lList; rt,rm:Rect; lp_masterList; WHILE lp#NIL DO IF lp.selected THEN BEGIN rt_getRect[lp]; IF ll1=NIL THEN rm_rt ELSE rm_mergeRects[rm,rt]; llt_GetSpace[SIZE[lList]]; llt^_[ll1,lp]; ll1_llt; END; lp _ lp.nxt; ENDLOOP; IF ll1=NIL THEN RETURN; lp_masterList; WHILE lp#NIL DO IF lp.ob.otyp=wire AND NOT lp.selected THEN BEGIN llt_GetSpace[SIZE[lList]]; llt^_[nxt:NIL,lp:lp]; IF lp.lx>rm.x2 OR lp.ly>rm.y2 OR (rt_getRect[lp]).x2