Lines Matching refs:command
36 CommandStack::Perform(Command* command)
41 status_t ret = command ? B_OK : B_BAD_VALUE;
43 ret = command->InitCheck();
46 ret = command->Perform();
49 ret = _AddCommand(command);
53 delete command;
71 Command* command = fUndoHistory.top();
73 status = command->Undo();
75 fRedoHistory.push(command);
77 fUndoHistory.push(command);
95 Command* command = fRedoHistory.top();
97 status = command->Redo();
99 fUndoHistory.push(command);
101 fRedoHistory.push(command);
194 CommandStack::_AddCommand(Command* command)
200 // try to collapse commands to a single command
201 // or remove this and the previous command if
204 if (command->UndoesPrevious(top)) {
208 delete command;
209 } else if (top->CombineWithNext(command)) {
211 delete command;
212 // after collapsing, the command might
219 } else if (command->CombineWithPrevious(top)) {
222 // after collapsing, the command might
225 if (command->InitCheck() < B_OK) {
226 delete command;
234 fUndoHistory.push(command);
242 // as soon as a command was added (also in case of collapsing)