DIRECTORY CD, CDBasics, CDMenus, CDOps, CDOrient, CDSequencer, Rope, TerminalIO; CDIRCommands: CEDAR PROGRAM IMPORTS CDBasics, CDMenus, CDOps, CDOrient, CDSequencer, TerminalIO = BEGIN DefaultIRComm: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["default the interest rect\n"]; IF comm.design.actual.rest=NIL THEN TerminalIO.WriteRope[" not pushed in; not done\n"] ELSE { mightReplace: CD.Instance _ comm.design^.actual.first.mightReplace; newWir: CD.Rect; oldWir: CD.Rect = CDOrient.MapRect[--old interest rect in design coordinates itemInCell: comm.design^.actual.first.specific.ir, cellSize: mightReplace.ob.size, cellInstOrient: mightReplace.orientation, cellInstPos: mightReplace.location ]; comm.design.actual.first.specific.ir _ comm.design.actual.first.specific.dIr; comm.design.actual.first.specific.useDIr _ TRUE; newWir _ CDOrient.MapRect[--new interest rect in design coordinates itemInCell: comm.design^.actual.first.specific.ir, cellSize: mightReplace.ob.size, cellInstOrient: mightReplace.orientation, cellInstPos: mightReplace.location ]; CDOps.DelayedRedraw[comm.design, CDBasics.Surround[oldWir, newWir]]; }; END; SetIRComm: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["Set the interest rect\n"]; IF comm.design.actual.rest=NIL THEN TerminalIO.WriteRope[" not pushed in; not done\n"] ELSE { mightReplace: CD.Instance _ comm.design^.actual.first.mightReplace; oldWir: CD.Rect = CDOrient.MapRect[--old interest rect in design coordinates itemInCell: comm.design^.actual.first.specific.ir, cellSize: mightReplace.ob.size, cellInstOrient: mightReplace.orientation, cellInstPos: mightReplace.location ]; newWir: CD.Rect = CDBasics.ToRect[comm.pos, comm.sPos]; -- new interest rect ir: CD.Rect = CDOrient.DeMapRect[ itemInWorld: newWir, cellSize: mightReplace.ob.size, cellInstOrient: mightReplace.orientation, cellInstPos: mightReplace.location ]; comm.design.actual.first.specific.ir _ ir; comm.design.actual.first.specific.useDIr _ FALSE; CDOps.DelayedRedraw[comm.design, CDBasics.Surround[oldWir, newWir]]; }; END; CDSequencer.ImplementCommand[$DefaultIR, DefaultIRComm]; CDSequencer.ImplementCommand[$SetIR, SetIRComm]; [] _ CDMenus.CreateMenu["Special commands", $RectSpecialMenu]; CDMenus.ImplementMenuCommand[$RectSpecialMenu, $RectSpecialMenu]; CDMenus.CreateEntry[menu: $RectSpecialMenu, entry: "default interest rect", key: $DefaultIR]; CDMenus.CreateEntry[menu: $RectSpecialMenu, entry: "set interest rect", key: $SetIR]; END. êCDIRCommands.mesa (part of ChipNDale) Copyright c 1984, 1985 by Xerox Corporation. All rights reserved. by Christian Jacobi, September 14, 1984 9:36:44 am PDT last edited Christian Jacobi, September 2, 1985 3:50:08 pm PDT ÊŠ˜šœ'™'Jšœ Ïmœ7™BJšœ8™8Jšœ?™?J˜—šÏk ˜ Jšžœ˜Jšœ ˜ Jšœ˜Jšœ˜Jšœ ˜ Jšœ ˜ Jšœ˜Jšœ ˜ J˜—šÏb œžœžœ˜Jšžœ?˜F—Jšž˜J˜šÏn œžœ˜1Jšžœ˜J˜4Jšžœžœžœ4˜Wšžœ˜JšœC˜CJšœžœ˜šœžœÏc)˜LJšœ2˜2Jšœ˜Jšœ)˜)Jšœ"˜"Jšœ˜—JšœM˜MJšœ+žœ˜0šœžœ¡)˜CJšœ2˜2Jšœ˜Jšœ)˜)Jšœ"˜"Jšœ˜—JšœD˜DJ˜—Jšžœ˜—J˜š  œžœ˜-Jšžœ˜J˜0Jšžœžœžœ4˜Wšžœ˜JšœC˜Cšœžœ¡)˜LJšœ2˜2Jšœ˜Jšœ)˜)Jšœ"˜"Jšœ˜—Jšœžœ-¡˜Mšœžœ˜!Jšœ˜Jšœ˜Jšœ)˜)Jšœ"˜"Jšœ˜—Jšœ*˜*Jšœ+žœ˜1JšœD˜DJ˜—Jšžœ˜—J˜Jšœ8˜8Jšœ0˜0J˜Jšœ>˜>JšœA˜AJ˜Jšœ]˜]JšœU˜UJšžœ˜J˜—…— Æ :