|
Krita Source Code Documentation
|
#include <kis_processing_applicator.h>
Public Types | |
| enum | ProcessingFlag { NONE = 0x0 , RECURSIVE = 0x1 , NO_UI_UPDATES = 0x2 , SUPPORTS_WRAPAROUND_MODE = 0x4 , NO_IMAGE_UPDATES = 0x8 , RECURSIVE_FRAME_TIMES = 0x10 , READ_ONLY_ACTION = 0x20 } |
Static Public Member Functions | |
| static void | runSingleCommandStroke (KisImageSP image, KUndo2Command *cmd, KisStrokeJobData::Sequentiality sequentiality=KisStrokeJobData::SEQUENTIAL, KisStrokeJobData::Exclusivity exclusivity=KisStrokeJobData::NORMAL) |
runSingleCommandStroke creates a stroke and runs cmd in it. The text() field of cmd is used as a title of the stroke. | |
Private Member Functions | |
| void | visitRecursively (KisNodeSP node, KisProcessingVisitorSP visitor, KisStrokeJobData::Sequentiality sequentiality, KisStrokeJobData::Exclusivity exclusivity) |
Private Attributes | |
| KisImageSignalVector | m_emitSignals |
| bool | m_finalSignalsEmitted |
| ProcessingFlags | m_flags |
| KisImageWSP | m_image |
| KisNodeList | m_nodes |
| QSharedPointer< bool > | m_sharedAllFramesToken |
| KisStrokeId | m_strokeId |
| std::future< bool > | m_successfullyCompletedFuture |
Definition at line 21 of file kis_processing_applicator.h.
Definition at line 24 of file kis_processing_applicator.h.
| KisProcessingApplicator::KisProcessingApplicator | ( | KisImageWSP | image, |
| KisNodeSP | node, | ||
| ProcessingFlags | flags = NONE, | ||
| KisImageSignalVector | emitSignals = KisImageSignalVector(), | ||
| const KUndo2MagicString & | name = KUndo2MagicString(), | ||
| KUndo2CommandExtraData * | extraData = 0, | ||
| int | macroId = -1 ) |
Definition at line 262 of file kis_processing_applicator.cpp.
| KisProcessingApplicator::KisProcessingApplicator | ( | KisImageWSP | image, |
| KisNodeList | nodes = KisNodeList(), | ||
| ProcessingFlags | flags = NONE, | ||
| KisImageSignalVector | emitSignals = KisImageSignalVector(), | ||
| const KUndo2MagicString & | name = KUndo2MagicString(), | ||
| KUndo2CommandExtraData * | extraData = 0, | ||
| int | macroId = -1 ) |
Definition at line 273 of file kis_processing_applicator.cpp.
References applyCommand(), KisStrokeJobData::BARRIER, KisWeakSharedPtr< T >::data(), KisCommandUtils::FlipFlopCommand::INITIALIZING, m_emitSignals, m_flags, m_image, m_nodes, m_sharedAllFramesToken, m_strokeId, StrategyWithStatusPromise::m_successfullyCompleted, m_successfullyCompletedFuture, NO_UI_UPDATES, READ_ONLY_ACTION, KisStrokeStrategyUndoCommandBased::setCommandExtraData(), KisStrokeStrategyUndoCommandBased::setMacroId(), KisStrokeStrategyUndoCommandBased::setSupportsWrapAroundMode(), KisImage::startStroke(), and SUPPORTS_WRAPAROUND_MODE.
| KisProcessingApplicator::~KisProcessingApplicator | ( | ) |
Definition at line 318 of file kis_processing_applicator.cpp.
| void KisProcessingApplicator::applyCommand | ( | KUndo2Command * | command, |
| KisStrokeJobData::Sequentiality | sequentiality = KisStrokeJobData::SEQUENTIAL, | ||
| KisStrokeJobData::Exclusivity | exclusivity = KisStrokeJobData::NORMAL ) |
Definition at line 430 of file kis_processing_applicator.cpp.
References KisImage::addJob(), KIS_ASSERT_RECOVER_RETURN, m_finalSignalsEmitted, m_image, and m_strokeId.
| void KisProcessingApplicator::applyVisitor | ( | KisProcessingVisitorSP | visitor, |
| KisStrokeJobData::Sequentiality | sequentiality = KisStrokeJobData::SEQUENTIAL, | ||
| KisStrokeJobData::Exclusivity | exclusivity = KisStrokeJobData::NORMAL ) |
Definition at line 333 of file kis_processing_applicator.cpp.
References applyCommand(), KisProcessingVisitor::createInitCommand(), m_flags, m_nodes, KisStrokeJobData::NORMAL, RECURSIVE, KisStrokeJobData::SEQUENTIAL, and visitRecursively().
| void KisProcessingApplicator::applyVisitorAllFrames | ( | KisProcessingVisitorSP | visitor, |
| KisStrokeJobData::Sequentiality | sequentiality = KisStrokeJobData::SEQUENTIAL, | ||
| KisStrokeJobData::Exclusivity | exclusivity = KisStrokeJobData::NORMAL ) |
Definition at line 356 of file kis_processing_applicator.cpp.
References applyCommand(), applyVisitor(), KisStrokeJobData::BARRIER, KisProcessingVisitor::createInitCommand(), end(), KisStrokeJobData::EXCLUSIVE, m_flags, m_image, m_nodes, m_sharedAllFramesToken, KisStrokeJobData::NORMAL, RECURSIVE, RECURSIVE_FRAME_TIMES, KisStrokeJobData::SEQUENTIAL, KisLayerUtils::updateFrameJobsNonRecursive(), and KisLayerUtils::updateFrameJobsRecursive().
| void KisProcessingApplicator::cancel | ( | ) |
Definition at line 478 of file kis_processing_applicator.cpp.
References KisImage::cancelStroke(), m_image, and m_strokeId.
| void KisProcessingApplicator::end | ( | ) |
Definition at line 469 of file kis_processing_applicator.cpp.
References KisImage::endStroke(), explicitlyEmitFinalSignals(), m_finalSignalsEmitted, m_image, and m_strokeId.
| void KisProcessingApplicator::explicitlyEmitFinalSignals | ( | ) |
This method emits all the final update signals of the stroke without actually ending the stroke. This can be used for long-running strokes which are kept open to implement preview of the actions.
WARNING: you cannot add new commands/processings after the final signals has been emitted. You should either call end() or cancel().
Definition at line 447 of file kis_processing_applicator.cpp.
References applyCommand(), KisStrokeJobData::BARRIER, KisCommandUtils::FlipFlopCommand::FINALIZING, KIS_ASSERT_RECOVER_RETURN, m_emitSignals, m_finalSignalsEmitted, m_flags, m_image, m_nodes, m_sharedAllFramesToken, NO_UI_UPDATES, and READ_ONLY_ACTION.
| const KisStrokeId KisProcessingApplicator::getStroke | ( | ) | const |
Returns the underlying stroke. Useful if you want to inject additional jobs in the applicator.
Definition at line 322 of file kis_processing_applicator.cpp.
References m_strokeId.
|
static |
runSingleCommandStroke creates a stroke and runs cmd in it. The text() field of cmd is used as a title of the stroke.
| image | the image to run the stroke on |
| cmd | the command to be executed |
| sequentiality | sequentiality property of the command being executed (see strokes documentation) |
| exclusivity | sequentiality property of the command being executed (see strokes documentation) |
Definition at line 483 of file kis_processing_applicator.cpp.
References applyCommand(), end(), KUndo2Command::id(), NONE, and KUndo2Command::text().
| std::future< bool > && KisProcessingApplicator::successfullyCompletedFuture | ( | ) |
A future that notifies the caller when the whole processing stroke has been completed. The returned value shows if the stroke has been completed (true) or cancelled (false).
Definition at line 327 of file kis_processing_applicator.cpp.
References KIS_ASSERT, and m_successfullyCompletedFuture.
|
private |
Definition at line 413 of file kis_processing_applicator.cpp.
References applyCommand(), KisNode::lastChild(), KisNode::prevSibling(), and visitRecursively().
|
private |
Definition at line 120 of file kis_processing_applicator.h.
|
private |
Definition at line 122 of file kis_processing_applicator.h.
|
private |
Definition at line 119 of file kis_processing_applicator.h.
|
private |
Definition at line 117 of file kis_processing_applicator.h.
|
private |
Definition at line 118 of file kis_processing_applicator.h.
|
private |
Definition at line 123 of file kis_processing_applicator.h.
|
private |
Definition at line 121 of file kis_processing_applicator.h.
|
private |
Definition at line 124 of file kis_processing_applicator.h.