|
Krita Source Code Documentation
|
#include <kis_stroke.h>
Public Types | |
| enum | Type { LEGACY , LOD0 , LODN , SUSPEND , RESUME } |
Public Member Functions | |
| void | addJob (KisStrokeJobData *data) |
| void | addMutatedJobs (const QVector< KisStrokeJobData * > list) |
| qreal | balancingRatioOverride () const |
| bool | canCancel () const |
| void | cancelStroke () |
| bool | canForgetAboutMe () const |
| bool | clearsRedoOnStart () const |
| void | endStroke () |
| bool | hasJobs () const |
| QString | id () const |
| bool | isAsynchronouslyCancellable () const |
| bool | isCancelled () const |
| bool | isEnded () const |
| bool | isExclusive () const |
| bool | isInitialized () const |
| KisStroke (KisStrokeStrategy *strokeStrategy, Type type=LEGACY, int levelOfDetail=0) | |
| KisStrokeSP | lodBuddy () const |
| KUndo2MagicString | name () const |
| int | nextJobLevelOfDetail () const |
| KisStrokeJobData::Sequentiality | nextJobSequentiality () const |
| qint32 | numJobs () const |
| KisStrokeJob * | popOneJob () |
| void | setLodBuddy (KisStrokeSP buddy) |
| bool | supportsSuspension () |
| bool | supportsWrapAroundMode () const |
| void | suspendStroke (KisStrokeSP recipient) |
| Type | type () const |
| int | worksOnLevelOfDetail () const |
| ~KisStroke () | |
Private Member Functions | |
| void | clearQueueOnCancel () |
| KisStrokeJob * | dequeue () |
| void | enqueue (KisStrokeJobStrategy *strategy, KisStrokeJobData *data) |
| void | prepend (KisStrokeJobStrategy *strategy, KisStrokeJobData *data, int levelOfDetail, bool isOwnJob) |
| bool | sanityCheckAllJobsAreCancellable () const |
| QQueue< KisStrokeJob * > & | testingGetQueue () |
Private Attributes | |
| QScopedPointer< KisStrokeJobStrategy > | m_cancelStrategy |
| QScopedPointer< KisStrokeJobStrategy > | m_dabStrategy |
| QScopedPointer< KisStrokeJobStrategy > | m_finishStrategy |
| QScopedPointer< KisStrokeJobStrategy > | m_initStrategy |
| bool | m_isCancelled |
| QQueue< KisStrokeJob * > | m_jobsQueue |
| KisStrokeSP | m_lodBuddy |
| QScopedPointer< KisStrokeJobStrategy > | m_resumeStrategy |
| bool | m_strokeEnded |
| bool | m_strokeInitialized |
| QScopedPointer< KisStrokeStrategy > | m_strokeStrategy |
| bool | m_strokeSuspended |
| QScopedPointer< KisStrokeJobStrategy > | m_suspendStrategy |
| Type | m_type |
| int | m_worksOnLevelOfDetail |
Friends | |
| class | KisStrokeStrategyUndoCommandBasedTest |
| class | KisStrokeTest |
Definition at line 21 of file kis_stroke.h.
| enum KisStroke::Type |
| KisStroke::KisStroke | ( | KisStrokeStrategy * | strokeStrategy, |
| Type | type = LEGACY, | ||
| int | levelOfDetail = 0 ) |
Definition at line 12 of file kis_stroke.cpp.
References enqueue(), m_cancelStrategy, m_dabStrategy, m_finishStrategy, m_initStrategy, m_resumeStrategy, m_strokeInitialized, m_strokeStrategy, and m_suspendStrategy.
| KisStroke::~KisStroke | ( | ) |
Definition at line 38 of file kis_stroke.cpp.
References m_jobsQueue, and m_strokeEnded.
| void KisStroke::addJob | ( | KisStrokeJobData * | data | ) |
Definition at line 70 of file kis_stroke.cpp.
References enqueue(), KIS_SAFE_ASSERT_RECOVER_NOOP, m_dabStrategy, and m_strokeEnded.
| void KisStroke::addMutatedJobs | ( | const QVector< KisStrokeJobData * > | list | ) |
Definition at line 76 of file kis_stroke.cpp.
References KisStrokeJob::isOwnJob(), m_dabStrategy, m_jobsQueue, and worksOnLevelOfDetail().
| qreal KisStroke::balancingRatioOverride | ( | ) | const |
Definition at line 272 of file kis_stroke.cpp.
References m_strokeStrategy.
| bool KisStroke::canCancel | ( | ) | const |
Definition at line 197 of file kis_stroke.cpp.
References m_isCancelled, m_jobsQueue, m_strokeEnded, and m_strokeInitialized.
| void KisStroke::cancelStroke | ( | ) |
About cancelling the stroke There may be four different states of the stroke, when cancel is requested: 1) Not initialized, has jobs – just clear the queue 2) Initialized, has jobs, not finished – clear the queue, enqueue the cancel job 5) Initialized, no jobs, not finished – enqueue the cancel job 3) Initialized, has jobs, finished – clear the queue, enqueue the cancel job 4) Initialized, no jobs, finished – it's too late to cancel anything 6) Initialized, has jobs, cancelled – cancelling twice is a permitted operation, though it does nothing
Lod0 stroke cannot be suspended and !initialized at the same time, because the suspend job is created iff the stroke has already done some meaningful work.
At the same time, LodN stroke can be prepended with a 'suspend' job even when it has not been started yet. That is obvious: we should suspend the other stroke before doing anything else.
Definition at line 157 of file kis_stroke.cpp.
References clearQueueOnCancel(), enqueue(), KIS_ASSERT_RECOVER_NOOP, LODN, m_cancelStrategy, m_isCancelled, m_jobsQueue, m_strokeEnded, m_strokeInitialized, m_strokeStrategy, sanityCheckAllJobsAreCancellable(), and type().
| bool KisStroke::canForgetAboutMe | ( | ) | const |
Definition at line 257 of file kis_stroke.cpp.
References m_strokeStrategy.
|
private |
Definition at line 213 of file kis_stroke.cpp.
References m_jobsQueue.
| bool KisStroke::clearsRedoOnStart | ( | ) | const |
Definition at line 267 of file kis_stroke.cpp.
References m_strokeStrategy.
|
private |
Definition at line 318 of file kis_stroke.cpp.
References m_jobsQueue.
| void KisStroke::endStroke | ( | ) |
Definition at line 132 of file kis_stroke.cpp.
References enqueue(), KIS_SAFE_ASSERT_RECOVER_RETURN, m_finishStrategy, m_strokeEnded, and m_strokeStrategy.
|
private |
Definition at line 289 of file kis_stroke.cpp.
References m_jobsQueue, and worksOnLevelOfDetail().
| bool KisStroke::hasJobs | ( | ) | const |
Definition at line 122 of file kis_stroke.cpp.
References m_jobsQueue.
| QString KisStroke::id | ( | ) | const |
Definition at line 117 of file kis_stroke.cpp.
References m_strokeStrategy.
| bool KisStroke::isAsynchronouslyCancellable | ( | ) | const |
Definition at line 262 of file kis_stroke.cpp.
References m_strokeStrategy.
| bool KisStroke::isCancelled | ( | ) | const |
Definition at line 237 of file kis_stroke.cpp.
References m_isCancelled.
| bool KisStroke::isEnded | ( | ) | const |
Definition at line 232 of file kis_stroke.cpp.
References m_strokeEnded.
| bool KisStroke::isExclusive | ( | ) | const |
Definition at line 242 of file kis_stroke.cpp.
References m_strokeStrategy.
| bool KisStroke::isInitialized | ( | ) | const |
Definition at line 227 of file kis_stroke.cpp.
References m_strokeInitialized.
| KisStrokeSP KisStroke::lodBuddy | ( | ) | const |
| KUndo2MagicString KisStroke::name | ( | ) | const |
Definition at line 112 of file kis_stroke.cpp.
References m_strokeStrategy.
| int KisStroke::nextJobLevelOfDetail | ( | ) | const |
Definition at line 283 of file kis_stroke.cpp.
References m_jobsQueue, and worksOnLevelOfDetail().
| KisStrokeJobData::Sequentiality KisStroke::nextJobSequentiality | ( | ) | const |
Definition at line 277 of file kis_stroke.cpp.
References m_jobsQueue, and KisStrokeJobData::SEQUENTIAL.
| qint32 KisStroke::numJobs | ( | ) | const |
Definition at line 127 of file kis_stroke.cpp.
References m_jobsQueue.
| KisStrokeJob * KisStroke::popOneJob | ( | ) |
Definition at line 100 of file kis_stroke.cpp.
References dequeue(), m_strokeInitialized, and m_strokeSuspended.
|
private |
Definition at line 301 of file kis_stroke.cpp.
References m_jobsQueue, and worksOnLevelOfDetail().
|
private |
Definition at line 203 of file kis_stroke.cpp.
References KisStrokeJob::isCancellable(), and m_jobsQueue.
| void KisStroke::setLodBuddy | ( | KisStrokeSP | buddy | ) |
Definition at line 323 of file kis_stroke.cpp.
References m_lodBuddy.
| bool KisStroke::supportsSuspension | ( | ) |
Definition at line 44 of file kis_stroke.cpp.
References m_resumeStrategy, m_strokeInitialized, and m_suspendStrategy.
| bool KisStroke::supportsWrapAroundMode | ( | ) | const |
Definition at line 247 of file kis_stroke.cpp.
References m_strokeStrategy.
| void KisStroke::suspendStroke | ( | KisStrokeSP | recipient | ) |
Definition at line 49 of file kis_stroke.cpp.
References hasJobs(), KIS_ASSERT_RECOVER_NOOP, m_resumeStrategy, m_strokeEnded, m_strokeInitialized, m_strokeStrategy, m_strokeSuspended, m_suspendStrategy, prepend(), and worksOnLevelOfDetail().
|
inlineprivate |
Definition at line 94 of file kis_stroke.h.
| KisStroke::Type KisStroke::type | ( | ) | const |
Definition at line 333 of file kis_stroke.cpp.
References KIS_ASSERT_RECOVER_NOOP, LEGACY, LOD0, LODN, m_lodBuddy, m_type, and m_worksOnLevelOfDetail.
| int KisStroke::worksOnLevelOfDetail | ( | ) | const |
Definition at line 252 of file kis_stroke.cpp.
References m_worksOnLevelOfDetail.
|
friend |
Definition at line 93 of file kis_stroke.h.
|
friend |
Definition at line 92 of file kis_stroke.h.
|
private |
Definition at line 103 of file kis_stroke.h.
|
private |
Definition at line 102 of file kis_stroke.h.
|
private |
Definition at line 104 of file kis_stroke.h.
|
private |
Definition at line 101 of file kis_stroke.h.
|
private |
Definition at line 112 of file kis_stroke.h.
|
private |
Definition at line 108 of file kis_stroke.h.
|
private |
Definition at line 116 of file kis_stroke.h.
|
private |
Definition at line 106 of file kis_stroke.h.
|
private |
Definition at line 110 of file kis_stroke.h.
|
private |
Definition at line 109 of file kis_stroke.h.
|
private |
Definition at line 100 of file kis_stroke.h.
|
private |
Definition at line 111 of file kis_stroke.h.
|
private |
Definition at line 105 of file kis_stroke.h.
|
private |
Definition at line 115 of file kis_stroke.h.
|
private |
Definition at line 114 of file kis_stroke.h.