|
Krita Source Code Documentation
|
#include <kis_stroke_strategy_undo_command_based.h>
Inheritance diagram for KisStrokeStrategyUndoCommandBased:Classes | |
| class | Data |
| struct | MutatedCommandInterface |
Private Attributes | |
| QScopedPointer< KUndo2CommandExtraData > | m_commandExtraData |
| KUndo2CommandSP | m_finishCommand |
| KUndo2CommandSP | m_initCommand |
| KisSavedMacroCommand * | m_macroCommand {nullptr} |
| int | m_macroId |
| QMutex | m_mutex |
| bool | m_undo |
| KisStrokeUndoFacade * | m_undoFacade {nullptr} |
Additional Inherited Members | |
Public Types inherited from KisSimpleStrokeStrategy | |
| enum | JobType { JOB_INIT = 0 , JOB_CANCEL , JOB_FINISH , JOB_DOSTROKE , JOB_SUSPEND , JOB_RESUME , NJOBS } |
Static Public Member Functions inherited from KisSimpleStrokeStrategy | |
| static QLatin1String | jobTypeToString (JobType type) |
Definition at line 25 of file kis_stroke_strategy_undo_command_based.h.
| KisStrokeStrategyUndoCommandBased::KisStrokeStrategyUndoCommandBased | ( | const KUndo2MagicString & | name, |
| bool | undo, | ||
| KisStrokeUndoFacade * | undoFacade, | ||
| KUndo2CommandSP | initCommand = KUndo2CommandSP(0), | ||
| KUndo2CommandSP | finishCommand = KUndo2CommandSP(0) ) |
Definition at line 20 of file kis_stroke_strategy_undo_command_based.cpp.
References KisSimpleStrokeStrategy::enableJob(), KisSimpleStrokeStrategy::JOB_CANCEL, KisSimpleStrokeStrategy::JOB_DOSTROKE, KisSimpleStrokeStrategy::JOB_FINISH, and KisSimpleStrokeStrategy::JOB_INIT.
|
protected |
Definition at line 40 of file kis_stroke_strategy_undo_command_based.cpp.
References KIS_ASSERT_RECOVER_NOOP, m_macroCommand, and m_undo.
|
overridevirtual |
Reimplemented from KisSimpleStrokeStrategy.
Reimplemented in StrategyWithStatusPromise, MoveStrokeStrategy, MoveSelectionStrokeStrategy, and TransformStrokeStrategy.
Definition at line 103 of file kis_stroke_strategy_undo_command_based.cpp.
References KisStrokeStrategy::addMutatedJobs(), and cancelStrokeCallbackImpl().
|
protected |
Definition at line 110 of file kis_stroke_strategy_undo_command_based.cpp.
References KisSavedMacroCommand::getCommandExecutionJobs(), m_macroCommand, m_mutex, and m_undo.
|
overridevirtual |
Reimplemented from KisRunnableBasedStrokeStrategy.
Reimplemented in MoveStrokeStrategy, MoveSelectionStrokeStrategy, and TransformStrokeStrategy.
Definition at line 121 of file kis_stroke_strategy_undo_command_based.cpp.
References KisRunnableBasedStrokeStrategy::doStrokeCallback(), executeCommand(), and notifyCommandDone().
|
protected |
Definition at line 60 of file kis_stroke_strategy_undo_command_based.cpp.
References KisRunnableBasedStrokeStrategy::runnableJobsInterface().
|
overridevirtual |
Reimplemented from KisSimpleStrokeStrategy.
Reimplemented in StrategyWithStatusPromise, MoveStrokeStrategy, MoveSelectionStrokeStrategy, and TransformStrokeStrategy.
Definition at line 87 of file kis_stroke_strategy_undo_command_based.cpp.
References KisPostExecutionUndoAdapter::addMacro(), executeCommand(), m_finishCommand, m_macroCommand, m_mutex, m_undo, m_undoFacade, KisStrokeJobData::NORMAL, notifyCommandDone(), KisStrokeUndoFacade::postExecutionUndoAdapter(), postProcessToplevelCommand(), and KisStrokeJobData::SEQUENTIAL.
|
overridevirtual |
Reimplemented from KisSimpleStrokeStrategy.
Reimplemented in MoveStrokeStrategy, MoveSelectionStrokeStrategy, and TransformStrokeStrategy.
Definition at line 75 of file kis_stroke_strategy_undo_command_based.cpp.
References KisPostExecutionUndoAdapter::createMacro(), executeCommand(), m_initCommand, m_macroCommand, m_undo, m_undoFacade, KisStrokeStrategy::name(), KisStrokeJobData::NORMAL, notifyCommandDone(), KisStrokeUndoFacade::postExecutionUndoAdapter(), and KisStrokeJobData::SEQUENTIAL.
|
protected |
Definition at line 148 of file kis_stroke_strategy_undo_command_based.cpp.
References KisSavedMacroCommand::addCommand(), m_macroCommand, and m_mutex.
|
protectedvirtual |
Applies some modifications (e.g. assigning extra data) to the toplevel command.
Reimplemented in InplaceTransformStrokeStrategy, and TransformStrokeStrategy.
Definition at line 176 of file kis_stroke_strategy_undo_command_based.cpp.
References m_commandExtraData, m_macroId, KUndo2Command::setExtraData(), and KisSavedMacroCommand::setMacroId().
|
protected |
Definition at line 138 of file kis_stroke_strategy_undo_command_based.cpp.
References executeCommand(), and notifyCommandDone().
| void KisStrokeStrategyUndoCommandBased::setCommandExtraData | ( | KUndo2CommandExtraData * | data | ) |
Set extra data that will be assigned to the command representing this action. Using extra data has the following restrictions:
1) The data must be set before the stroke has been started. Setting the data after the stroke has been started with image->startStroke(strokeId) leads to an undefined behaviour.
2) data becomes owned by the strategy/command right after setting it. Don't try to change it afterwards.
Definition at line 160 of file kis_stroke_strategy_undo_command_based.cpp.
References m_commandExtraData, m_macroCommand, m_undoFacade, and warnKrita.
| void KisStrokeStrategyUndoCommandBased::setMacroId | ( | int | value | ) |
Sets the id of this action. Will be used for merging the undo commands
The value must be set before the stroke has been started. Setting the value after the stroke has been started with image->startStroke(strokeId) leads to an undefined behaviour.
Definition at line 171 of file kis_stroke_strategy_undo_command_based.cpp.
| void KisStrokeStrategy::setSupportsWrapAroundMode | ( | bool | value | ) |
The undo-command-based is a low-level strategy, so it allows changing its wraparound mode status.
WARNING: the switch must be called before the stroke has been started! Otherwise the mode will not be activated.
Definition at line 168 of file kis_stroke_strategy.cpp.
References KisStrokesQueueMutatedJobInterface::addMutatedJobs(), KIS_SAFE_ASSERT_RECOVER, KisStrokeStrategy::m_mutatedJobsInterface, and KisStrokeStrategy::m_strokeId.
| void KisStrokeStrategyUndoCommandBased::setUsedWhileUndoRedo | ( | bool | value | ) |
Definition at line 54 of file kis_stroke_strategy_undo_command_based.cpp.
References KisStrokeStrategy::setAsynchronouslyCancellable(), KisStrokeStrategy::setClearsRedoOnStart(), and value().
|
protected |
Definition at line 188 of file kis_stroke_strategy_undo_command_based.cpp.
References m_undoFacade.
|
private |
Definition at line 152 of file kis_stroke_strategy_undo_command_based.h.
|
private |
Definition at line 149 of file kis_stroke_strategy_undo_command_based.h.
|
private |
Definition at line 148 of file kis_stroke_strategy_undo_command_based.h.
|
private |
Definition at line 157 of file kis_stroke_strategy_undo_command_based.h.
|
private |
Definition at line 153 of file kis_stroke_strategy_undo_command_based.h.
|
private |
Definition at line 156 of file kis_stroke_strategy_undo_command_based.h.
|
private |
Definition at line 147 of file kis_stroke_strategy_undo_command_based.h.
|
private |
Definition at line 150 of file kis_stroke_strategy_undo_command_based.h.