|
Krita Source Code Documentation
|
#include <kis_saved_commands.h>
Inheritance diagram for KisSavedMacroCommand:Classes | |
| struct | Private |
Protected Member Functions | |
| void | addCommands (KisStrokeId id, bool undo) override |
Protected Member Functions inherited from KisSavedCommandBase | |
| KisStrokesFacade * | strokesFacade () |
Private Attributes | |
| Private *const | m_d |
Definition at line 87 of file kis_saved_commands.h.
| KisSavedMacroCommand::KisSavedMacroCommand | ( | const KUndo2MagicString & | name, |
| KisStrokesFacade * | strokesFacade ) |
Definition at line 162 of file kis_saved_commands.cpp.
|
override |
| void KisSavedMacroCommand::addCommand | ( | KUndo2CommandSP | command, |
| KisStrokeJobData::Sequentiality | sequentiality = KisStrokeJobData::SEQUENTIAL, | ||
| KisStrokeJobData::Exclusivity | exclusivity = KisStrokeJobData::NORMAL ) |
Definition at line 298 of file kis_saved_commands.cpp.
References KisSavedMacroCommand::Private::SavedCommand::command, KisSavedMacroCommand::Private::commands, KisSavedMacroCommand::Private::SavedCommand::exclusivity, m_d, and KisSavedMacroCommand::Private::SavedCommand::sequentiality.
|
overrideprotectedvirtual |
Implements KisSavedCommandBase.
Definition at line 344 of file kis_saved_commands.cpp.
References KisStrokesFacade::addJob(), getCommandExecutionJobs(), KisSavedCommandBase::strokesFacade(), and KisSavedCommandBase::undo().
|
overridevirtual |
Attempts to merge this command with command and checks if the two commands compensate each other. If the function returns true, both commands are removed from the stack.
If this function returns true, calling this command's redo() followed by other redo() must have no effect.
The function itself shouldn't do any changes to the command, because after returning true, the command will be deleted as a "noop"
KUndo2QStack will only try to merge two commands if they have the same id, and the id is not -1.
The default implementation returns false.
Reimplemented from KUndo2Command.
Definition at line 259 of file kis_saved_commands.cpp.
References KisSavedMacroCommand::Private::commands, id(), m_d, and KisSavedMacroCommand::Private::overriddenCommand.
| void KisSavedMacroCommand::getCommandExecutionJobs | ( | QVector< KisStrokeJobData * > * | jobs, |
| bool | undo, | ||
| bool | shouldGoToHistory = true ) const |
Definition at line 310 of file kis_saved_commands.cpp.
References KisSavedMacroCommand::Private::commands, m_d, and KisSavedCommandBase::undo().
|
overridevirtual |
Returns the ID of this command.
A command ID is used in command compression. It must be an integer unique to this command's class, or -1 if the command doesn't support compression.
If the command supports compression this function must be overridden in the derived class to return the correct ID. The base implementation returns -1.
KUndo2QStack::push() will only try to merge two commands if they have the same ID, and the ID is not -1.
Reimplemented from KUndo2Command.
Definition at line 179 of file kis_saved_commands.cpp.
References m_d, and KisSavedMacroCommand::Private::macroId.
|
overridevirtual |
Attempts to merge this command with command. Returns true on success; otherwise returns false.
If this function returns true, calling this command's redo() must have the same effect as redoing both this command and command. Similarly, calling this command's undo() must have the same effect as undoing command and this command.
KUndo2QStack will only try to merge two commands if they have the same id, and the id is not -1.
The default implementation returns false.
Reimplemented from KUndo2Command.
Definition at line 184 of file kis_saved_commands.cpp.
References KisAsynchronouslyMergeableCommandInterface::canMergeWith(), KUndo2CommandExtraData::clone(), KisSavedMacroCommand::Private::SavedCommand::command, KisSavedMacroCommand::Private::commands, KUndo2Command::extraData(), id(), KIS_ASSERT_RECOVER, m_d, KisSavedMacroCommand::Private::overriddenCommand, KUndo2Command::setExtraData(), and KisSavedMacroCommand::Private::skipWhenOverride.
| void KisSavedMacroCommand::setMacroId | ( | int | value | ) |
Definition at line 174 of file kis_saved_commands.cpp.
References m_d, KisSavedMacroCommand::Private::macroId, and value().
| void KisSavedMacroCommand::setOverrideInfo | ( | const KisSavedMacroCommand * | overriddenCommand, |
| const QVector< const KUndo2Command * > & | skipWhileOverride ) |
Definition at line 338 of file kis_saved_commands.cpp.
References m_d, KisSavedMacroCommand::Private::overriddenCommand, and KisSavedMacroCommand::Private::skipWhenOverride.
|
private |
Definition at line 111 of file kis_saved_commands.h.