Lines Matching refs:command
35 CommandStack::Perform(Command* command)
40 status_t ret = command ? B_OK : B_BAD_VALUE;
42 ret = command->InitCheck();
45 ret = command->Perform();
48 ret = _AddCommand(command);
52 delete command;
68 Command* command = fUndoHistory.top();
70 status = command->Undo();
72 fRedoHistory.push(command);
74 fUndoHistory.push(command);
92 Command* command = fRedoHistory.top();
94 status = command->Redo();
96 fUndoHistory.push(command);
98 fRedoHistory.push(command);
191 CommandStack::_AddCommand(Command* command)
197 // try to collapse commands to a single command
198 // or remove this and the previous command if
201 if (command->UndoesPrevious(top)) {
205 delete command;
206 } else if (top->CombineWithNext(command)) {
208 delete command;
209 // after collapsing, the command might
216 } else if (command->CombineWithPrevious(top)) {
219 // after collapsing, the command might
222 if (command->InitCheck() < B_OK) {
223 delete command;
231 fUndoHistory.push(command);
239 // as soon as a command was added (also in case of collapsing)