DIRECTORY CD, CDApplications, CDBasics, CDCallSpecific, CDCommandOps, CDExtras, CDSequencer, CDOps, CDPanel, CDProperties, CDValue, CDViewer, Rope, TerminalIO, ViewerClasses USING [Viewer]; CDExtraCommands: CEDAR PROGRAM IMPORTS CDApplications, CDCommandOps, CDBasics, CDOps, CDPanel, CDProperties, CDSequencer, CDValue, TerminalIO, CDCallSpecific, CDExtras, CDViewer, Rope = BEGIN verbosity: INT _ 1; WriteInLambda: PROC [n: CD.Number] = BEGIN TerminalIO.WriteRope[CDExtras.ToLambda[n]] END; CoordinatesCommand: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["Coordinates [\024]"]; -- \024 prints as greek lambda TerminalIO.WriteRope[" down: ("]; WriteInLambda[comm.sPos.x]; TerminalIO.WriteRope[","]; WriteInLambda[comm.sPos.y]; TerminalIO.WriteRope[") up: ("]; WriteInLambda[comm.pos.x]; TerminalIO.WriteRope[","]; WriteInLambda[comm.pos.y]; TerminalIO.WriteRope[") dist: ("]; WriteInLambda[comm.pos.x-comm.sPos.x]; TerminalIO.WriteRope[","]; WriteInLambda[comm.pos.y-comm.sPos.y]; TerminalIO.WriteRope[")\n"]; END; SetArrow: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["set arrow at ("]; WriteInLambda[comm.pos.x]; TerminalIO.WriteRope[","]; WriteInLambda[comm.pos.y]; TerminalIO.WriteRope[")\024\n"]; CDViewer.ShowArrow[comm.design, comm.pos]; END; RemoveArrow: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["remove arrow\n"]; CDViewer.RemoveArrow[comm.design]; END; ArrowInformation: PROC [comm: CDSequencer.Command] = BEGIN WITH CDValue.Fetch[comm.design, $arrow, design] SELECT FROM p: REF CD.DesignPosition => { TerminalIO.WriteRope[" arrow at: ("]; WriteInLambda[p.x]; TerminalIO.WriteRope[","]; WriteInLambda[p.y]; TerminalIO.WriteRope[") up: ("]; WriteInLambda[comm.pos.x]; TerminalIO.WriteRope[","]; WriteInLambda[comm.pos.y]; TerminalIO.WriteRope[") dist: ("]; WriteInLambda[p.x-comm.pos.x]; TerminalIO.WriteRope[","]; WriteInLambda[p.y-comm.pos.y]; TerminalIO.WriteRope[")\n"]; } ENDCASE => NULL; END; StatisticCommand: PROC [comm: CDSequencer.Command] = BEGIN countTot: INT _ 0; countSel: INT _ 0; countInvis: INT _ 0; isDesign: BOOL _ FALSE; rect: CD.DesignRect _ CDBasics.universe; v: ViewerClasses.Viewer _ CDViewer.GetViewer[comm]; aptr: CD.ApplicationPtr; TerminalIO.WriteRope["statistic"]; IF v#NIL THEN rect _ CDViewer.VisibleRect[v]; IF ~CDBasics.NonEmpty[rect] THEN rect _ CDBasics.universe; FOR l: CD.ApplicationList _ CDOps.AppList[comm.design], l.rest WHILE l#NIL DO countTot _ countTot+1; IF l.first.selected THEN { IF ~CDBasics.Intersect[rect, CDApplications.ARectI[l.first]] THEN countInvis _ countInvis+1; countSel _ countSel+1; aptr _ l.first } ENDLOOP; TerminalIO.WriteInt[countTot]; TerminalIO.WriteRope[" objects;"]; TerminalIO.WriteInt[countSel]; TerminalIO.WriteRope[" selected"]; TerminalIO.WriteLn[]; IF countSel=1 THEN { CDCommandOps.WriteInfo[aptr, verbosity]; IF verbosity>0 THEN { TerminalIO.WriteRope[" at: ("]; WriteInLambda[aptr.location.x]; TerminalIO.WriteRope[","]; WriteInLambda[aptr.location.y]; TerminalIO.WriteRope[")\024 size: ("]; --\024 prints as greek lambda WriteInLambda[aptr.ob.size.x]; TerminalIO.WriteRope[","]; WriteInLambda[aptr.ob.size.y]; TerminalIO.WriteRope[")\024 orientation-code:"]; --\024 prints as greek lambda TerminalIO.WriteInt[aptr.orientation]; }; TerminalIO.WriteLn[]; }; ArrowInformation[comm]; IF countInvis#0 THEN { TerminalIO.WriteRope[" **** "]; TerminalIO.WriteInt[countInvis]; TerminalIO.WriteRope[" invisible selected object(s)"]; TerminalIO.WriteLn[]; }; END; SelectIfLayer: CDCallSpecific.CallProc = BEGIN IF aptr.ob.layer#NARROW[x, REF CD.Layer]^ THEN {done_FALSE; RETURN}; IF aptr.selected THEN RETURN; aptr.selected _ TRUE; repaintMe _ TRUE END; AddSelectLayer: PROC [comm: CDSequencer.Command] = BEGIN n: INT; reflev: REF CD.Layer _ NEW[CD.Layer_CDPanel.FetchDefaultLayer[comm.design]]; TerminalIO.WriteRope["select all of current layer: ("]; n _ CDCallSpecific.CallForAll[design: comm.design, whatElse: SelectIfLayer, x: reflev]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[") objects\n"]; END; SpecifyAlter: PROC [] RETURNS [code: ATOM_NIL, x: REF_NIL] = BEGIN step: CD.DesignNumber = CD.lambda; SELECT TerminalIO.RequestSelection["alter", LIST["dec w", "dec l", "inc w", "inc l", "dec par", "inc par"]] FROM 1 => {code _ $ChangeExt; x _ NEW[CD.DesignPosition_[-step, 0]]}; 2 => {code _ $ChangeExt; x _ NEW[CD.DesignPosition_[0, -step]]}; 3 => {code _ $ChangeExt; x _ NEW[CD.DesignPosition_[step, 0]]}; 4 => {code _ $ChangeExt; x _ NEW[CD.DesignPosition_[0, step]]}; 5 => {code _ $ChangeParam; x _ NEW[CD.DesignNumber_-step]}; 6 => {code _ $ChangeParam; x _ NEW[CD.DesignNumber_step]}; ENDCASE => {code _ NIL} END; AlterSelected: PROC [comm: CDSequencer.Command] = BEGIN code: ATOM; x: REF; n: CARDINAL; TerminalIO.WriteRope["alter selected: "]; [code, x] _ SpecifyAlter[]; n _ CDCallSpecific.CallForSelected[design: comm.design, objectSpecific: code, x: x]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects altered\n"]; END; SetLayerCommand: PROC [comm: CDSequencer.Command] = BEGIN app: CD.ApplicationPtr = CDCommandOps.TheApplication[comm, "Set default layer"]; IF app#NIL THEN { layer: CD.Layer = app.ob.layer; IF app.ob.p.wireTyped AND CDProperties.GetPropFromLayer[layer, $DontUse]=NIL THEN { TerminalIO.WriteRope[Rope.Cat[" ", CDOps.LayerName[layer], "\n"]]; CDPanel.StoreDefaultLayer[comm.design, layer]; } ELSE TerminalIO.WriteRope[" NOT DONE\n"]; CDOps.ReOrderApplication[comm.design, app] } END; EnforcePanel: PROC [comm: CDSequencer.Command] = BEGIN TerminalIO.WriteRope["enforce a control panel\n"]; [] _ CDPanel.CreatePanel[comm.design] END; CDSequencer.ImplementCommand[$SetLayerP, SetLayerCommand,, doQueue]; CDSequencer.ImplementCommand[$AddSelectLayer, AddSelectLayer,, doQueue]; CDSequencer.ImplementCommand[$Coordinates, CoordinatesCommand,, doQueue]; CDSequencer.ImplementCommand[$Statistic, StatisticCommand,, doQueue]; CDSequencer.ImplementCommand[$SetArrow, SetArrow,, doQueue]; CDSequencer.ImplementCommand[$RemoveArrow, RemoveArrow,, doQueue]; CDSequencer.ImplementCommand[$AlterS, AlterSelected]; CDSequencer.ImplementCommand[$EnforcePanel, EnforcePanel,, doQueue]; CDCommandOps.ImplementSpecificCommand[specificAtom: $Expand, useFor: "SPFXA"]; CDCommandOps.ImplementSpecificCommand[specificAtom: $Lengthen, tipBase: "Widen", useFor: "SPFXA", x: NEW[CD.DesignPosition_[CD.lambda, 0]]]; CDCommandOps.ImplementSpecificCommand[specificAtom: $Lengthen, tipBase: "Narrow", useFor: "SPFXA", x: NEW[CD.DesignPosition_[-CD.lambda, 0]]]; CDCommandOps.ImplementSpecificCommand[specificAtom: $Lengthen, tipBase: "Shorten", useFor: "SPFXA", x: NEW[CD.DesignPosition_[0, -CD.lambda]]]; CDCommandOps.ImplementSpecificCommand[specificAtom: $Lengthen, tipBase: "Lengthen", useFor: "SPFXA", x: NEW[CD.DesignPosition_[0, CD.lambda]]]; CDCommandOps.ImplementSpecificCommand[specificAtom: $Default, useFor: "SPFXA"]; CDCommandOps.ImplementSpecificCommand[specificAtom: $IncCount, text: "Inc count", useFor: "SPFXA"]; CDCommandOps.ImplementSpecificCommand[specificAtom: $DecCount, text: "Dec count", useFor: "SPFXA"]; END. ÚCDExtraCommands.mesa (part of ChipNDale) Copyright c 1983, 1985 by Xerox Corporation. All rights reserved. by Christian Jacobi, July 11, 1983 3:42 pm last edited Christian Jacobi, May 9, 1985 10:56:36 am PDT Ê.˜šœ*™*Jšœ Ïmœ7™BJšœ+™+Jšœ9™9J˜—šÏk ˜ Jšžœ˜Jšœ˜Jšœ ˜ J˜Jšœ ˜ Jšœ ˜ J˜ Jšœ˜Jšœ ˜ Jšœ ˜ Jšœ˜Jšœ ˜ Jšœ˜J˜ Jšœžœ ˜J˜—šÏnœžœž˜Jšžœ”˜›—Jšž˜J˜Jšœ žœ˜J˜šŸ œžœžœ ˜%Jšž˜Jšœ*˜*Jšžœ˜J˜—šŸœžœ˜6Jšž˜Jšœ,Ïc˜JJ˜#Jšœ˜J˜Jšœ˜J˜"Jšœ˜J˜Jšœ˜J˜$Jšœ&˜&J˜Jšœ&˜&J˜Jšžœ˜J˜—šŸœžœ˜,Jšž˜Jšœ(˜(Jšœ˜J˜Jšœ˜J˜ Jšœ*˜*Jšžœ˜—J˜šŸ œžœ˜/Jšž˜Jšœ'˜'Jšœ"˜"Jšžœ˜—J˜šŸœžœ˜4Jšž˜šžœ,žœž˜;šœžœžœ˜J˜&Jšœ˜J˜Jšœ˜J˜"Jšœ˜J˜Jšœ˜J˜$Jšœ˜J˜Jšœ˜J˜Jšœ˜—Jšžœžœ˜—Jšžœ˜—J˜šŸœžœ˜4Jšž˜Jšœ žœ˜Jšœ žœ˜Jšœ žœ˜Jšœ žœžœ˜Jšœžœ ˜(Jšœ3˜3Jšœžœ˜Jšœ"˜"Jšžœžœžœ ˜-Jšžœžœ˜:š žœžœ6žœžœž˜MJšœ˜šžœžœ˜Jšžœ;žœ˜\Jšœ˜Jšœ˜Jšœ˜—Jšžœ˜—JšœB˜BJšœB˜BJšœ˜šžœ žœ˜Jšœ(˜(šžœ žœ˜Jšœ ˜ Jšœ˜J˜Jšœ˜Jšœ( ˜EJšœ˜J˜Jšœ˜Jšœ2 ˜OJšœ&˜&J˜—Jšœ˜Jšœ˜—Jšœ˜šžœžœ˜JšœB˜BJšœ7˜7Jšœ˜J˜—Jšžœ˜J˜—šŸ œ˜(Jšž˜Jšžœžœžœžœ žœžœžœ˜DJšžœžœžœ˜Jšœžœ˜Jšœ ž˜Jšžœ˜J˜—šŸœžœ˜2Jšž˜Jšœžœ˜Jš œžœžœ žœžœ/˜LJ˜7J˜WJ˜J˜$Jšžœ˜—J˜š Ÿ œžœžœžœžœ˜