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 19, 1985 8:06:33 pm PDT Κ˜codešœ'™'Kšœ Οmœ7™BKšœ8™8Kšœ@™@K˜—šΟk ˜ Kšžœ˜Kšœ ˜ Kšœ˜Kšœ˜Kšœ ˜ Kšœ ˜ Kšœ˜Kšœ ˜ —K˜šΠbl œžœžœ˜Kšžœ?˜F—Kšž˜K˜šΟn œžœ˜1Kšžœ˜K˜4Kšžœžœžœ4˜Wšžœ˜KšœC˜CKšœžœ˜šœžœΟc)˜LKšœ2˜2Kšœ˜Kšœ)˜)Kšœ"˜"Kšœ˜—KšœM˜MKšœ+žœ˜0šœžœ‘)˜CKšœ2˜2Kšœ˜Kšœ)˜)Kšœ"˜"Kšœ˜—KšœD˜DK˜—Kšžœ˜—K˜š  œžœ˜-Kšžœ˜K˜0Kšžœžœžœ4˜Wšžœ˜KšœC˜Cšœžœ‘)˜LKšœ2˜2Kšœ˜Kšœ)˜)Kšœ"˜"Kšœ˜—Kšœžœ-‘˜Mšœžœ˜!Kšœ˜Kšœ˜Kšœ)˜)Kšœ"˜"Kšœ˜—Kšœ*˜*Kšœ+žœ˜1KšœD˜DK˜—Kšžœ˜—K˜Kšœ8˜8Kšœ0˜0K˜Kšœ>˜>KšœA˜AK˜Kšœ]˜]KšœU˜UKšžœ˜K˜—…— Ζ B