<> <> <> DIRECTORY CD, CDSequencer, TerminalIO, Rope, CDCallSpecific; ParametrizedComands: CEDAR PROGRAM IMPORTS CDSequencer, TerminalIO, CDCallSpecific = BEGIN ExpandSelected: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; TerminalIO.WriteRope["Expand selected: "]; n _ CDCallSpecific.CallForSelected[comm.design, $Expand]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects expanded\n"]; END; ExpandPointed: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; TerminalIO.WriteRope["Expand pointed: "]; n _ CDCallSpecific.CallForPointed[comm.design, comm.pos, $Expand]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects expanded\n"]; END; WidenSelected: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; off: REF CD.DesignPosition_NEW[CD.DesignPosition_[CD.lambda, 0]]; TerminalIO.WriteRope["Widen selected: "]; n _ CDCallSpecific.CallForSelected[design: comm.design, objectSpecific: $Lengthen, x: off]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects widen\n"]; END; WidenPointed: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; off: REF CD.DesignPosition_NEW[CD.DesignPosition_[CD.lambda, 0]]; TerminalIO.WriteRope["Widen pointed: "]; n _ CDCallSpecific.CallForPointed[design: comm.design, point: comm.pos, objectSpecific: $Lengthen, x: off]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects widen\n"]; END; ShortenSelected: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; off: REF CD.DesignPosition_NEW[CD.DesignPosition_[0, -CD.lambda]]; TerminalIO.WriteRope["Shorten selected: "]; n _ CDCallSpecific.CallForSelected[design: comm.design, objectSpecific: $Lengthen, x: off]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects shorten\n"]; END; ShortenPointed: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; off: REF CD.DesignPosition_NEW[CD.DesignPosition_[0, -CD.lambda]]; TerminalIO.WriteRope["Shorten pointed: "]; n _ CDCallSpecific.CallForPointed[design: comm.design, point: comm.pos, objectSpecific: $Lengthen, x: off]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects shorten\n"]; END; LengthenSelected: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; off: REF CD.DesignPosition_NEW[CD.DesignPosition_[0, CD.lambda]]; TerminalIO.WriteRope["Lengthen selected: "]; n _ CDCallSpecific.CallForSelected[design: comm.design, objectSpecific: $Lengthen, x: off]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects lengthen\n"]; END; LengthenPointed: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; off: REF CD.DesignPosition_NEW[CD.DesignPosition_[0, CD.lambda]]; TerminalIO.WriteRope["Lengthen pointed: "]; n _ CDCallSpecific.CallForPointed[design: comm.design, point: comm.pos, objectSpecific: $Lengthen, x: off]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects lengthen\n"]; END; NarrowSelected: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; off: REF CD.DesignPosition_NEW[CD.DesignPosition_[-CD.lambda, 0]]; TerminalIO.WriteRope["Narrow selected: "]; n _ CDCallSpecific.CallForSelected[design: comm.design, objectSpecific: $Lengthen, x: off]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects narrowed\n"]; END; NarrowPointed: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; off: REF CD.DesignPosition_NEW[CD.DesignPosition_[-CD.lambda, 0]]; TerminalIO.WriteRope["Narrow pointed: "]; n _ CDCallSpecific.CallForPointed[design: comm.design, point: comm.pos, objectSpecific: $Lengthen, x: off]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects narrowed\n"]; END; DefaultSelected: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; TerminalIO.WriteRope["Default selected: "]; n _ CDCallSpecific.CallForSelected[comm.design, $Default]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects defaulted\n"]; END; DefaultPointed: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; TerminalIO.WriteRope["Default pointed: "]; n _ CDCallSpecific.CallForPointed[comm.design, comm.pos, $Default]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects defaulted\n"]; END; IncCountPointed: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; TerminalIO.WriteRope["inc count: "]; n _ CDCallSpecific.CallForPointed[comm.design, comm.pos, $IncCount]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects incremented count\n"]; END; DecCountPointed: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; TerminalIO.WriteRope["dec count: "]; n _ CDCallSpecific.CallForPointed[comm.design, comm.pos, $DecCount]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects decremented count\n"]; END; IncCountSelected: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; TerminalIO.WriteRope["inc count: "]; n _ CDCallSpecific.CallForSelected[comm.design, $IncCount]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects incremented count\n"]; END; DecCountSelected: PROC [comm: CDSequencer.Command] = BEGIN n: NAT; TerminalIO.WriteRope["dec count: "]; n _ CDCallSpecific.CallForSelected[comm.design, $DecCount]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects decremented count\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; AlterPointed: PROC [comm: CDSequencer.Command] = BEGIN code: ATOM; x: REF; n: CARDINAL; TerminalIO.WriteRope["alter pointed: "]; [code, x] _ SpecifyAlter[]; n _ CDCallSpecific.CallForPointed[design: comm.design, point: comm.pos, objectSpecific: code, x: x]; TerminalIO.WriteInt[n]; TerminalIO.WriteRope[" objects altered\n"]; 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; Impl: PROC [] = BEGIN CDSequencer.ImplementCommand[$AlterP, AlterPointed]; CDSequencer.ImplementCommand[$AlterS, AlterSelected]; CDSequencer.ImplementCommand[$ExpandS, ExpandSelected]; CDSequencer.ImplementCommand[$ExpandP, ExpandPointed]; CDSequencer.ImplementCommand[$WidenS, WidenSelected]; CDSequencer.ImplementCommand[$WidenP, WidenPointed]; CDSequencer.ImplementCommand[$ShortenS, ShortenSelected]; CDSequencer.ImplementCommand[$ShortenP, ShortenPointed]; -- old --CDSequencer.ImplementCommand[$LenthenS, LengthenSelected]; CDSequencer.ImplementCommand[$LengthenS, LengthenSelected]; -- old --CDSequencer.ImplementCommand[$LenthenP, LengthenPointed]; CDSequencer.ImplementCommand[$LengthenP, LengthenPointed]; CDSequencer.ImplementCommand[$NarrowS, NarrowSelected]; CDSequencer.ImplementCommand[$NarrowP, NarrowPointed]; CDSequencer.ImplementCommand[$DefaultS, DefaultSelected]; CDSequencer.ImplementCommand[$DefaultP, DefaultPointed]; CDSequencer.ImplementCommand[$IncCountS, IncCountSelected]; CDSequencer.ImplementCommand[$IncCountP, IncCountPointed]; CDSequencer.ImplementCommand[$DecCountS, DecCountSelected]; CDSequencer.ImplementCommand[$DecCountP, DecCountPointed]; END; Impl[]; END.