|
Krita Source Code Documentation
|
#include <kis_stroke_strategy.h>
Inheritance diagram for KisStrokeStrategy:Protected Member Functions | |
| void | addMutatedJob (KisStrokeJobData *data) |
| void | addMutatedJobs (const QVector< KisStrokeJobData * > list) |
| KisStrokeStrategy (const KisStrokeStrategy &rhs) | |
| void | setAsynchronouslyCancellable (bool value) |
| void | setBalancingRatioOverride (qreal value) |
| void | setCanForgetAboutMe (bool value) |
| void | setClearsRedoOnStart (bool value) |
| void | setExclusive (bool value) |
| void | setNeedsExplicitCancel (bool value) |
| void | setRequestsOtherStrokesToEnd (bool value) |
| void | setSupportsWrapAroundMode (bool value) |
Private Attributes | |
| bool | m_asynchronouslyCancellable |
| qreal | m_balancingRatioOverride |
| bool | m_canForgetAboutMe |
| bool | m_clearsRedoOnStart |
| bool | m_exclusive |
| bool | m_forceLodModeIfPossible |
| QLatin1String | m_id |
| KisStrokesQueueMutatedJobInterface * | m_mutatedJobsInterface |
| KUndo2MagicString | m_name |
| bool | m_needsExplicitCancel |
| bool | m_requestsOtherStrokesToEnd |
| KisStrokeId | m_strokeId |
| bool | m_supportsWrapAroundMode |
Friends | |
| class | KisMutatableDabStrategy |
Definition at line 20 of file kis_stroke_strategy.h.
| KisStrokeStrategy::KisStrokeStrategy | ( | const QLatin1String & | id, |
| const KUndo2MagicString & | name = KUndo2MagicString() ) |
Definition at line 13 of file kis_stroke_strategy.cpp.
|
virtual |
Definition at line 57 of file kis_stroke_strategy.cpp.
|
protected |
Protected c-tor, used for cloning of hi-level strategies
Definition at line 29 of file kis_stroke_strategy.cpp.
References KIS_ASSERT_RECOVER_NOOP, m_mutatedJobsInterface, and m_strokeId.
|
protected |
Convenience override for addMutatedJobs()
Definition at line 177 of file kis_stroke_strategy.cpp.
References addMutatedJobs().
|
protected |
This function is supposed to be called by internal asynchronous jobs. It allows adding subtasks that may be executed concurrently.
Requirements:
Guarantees:
Definition at line 167 of file kis_stroke_strategy.cpp.
| qreal KisStrokeStrategy::balancingRatioOverride | ( | ) | const |
Definition at line 242 of file kis_stroke_strategy.cpp.
References m_balancingRatioOverride.
| bool KisStrokeStrategy::canForgetAboutMe | ( | ) | const |
Returns true if the update scheduler can cancel this stroke when some other stroke is going to be started. This makes the "forgettable" stroke very low priority.
Default is 'false'.
Definition at line 212 of file kis_stroke_strategy.cpp.
References m_canForgetAboutMe.
| bool KisStrokeStrategy::clearsRedoOnStart | ( | ) | const |
Returns true if mere start of the stroke should cancel all the pending redo tasks.
This method should return true in almost all circumstances except if we are running an undo or redo stroke.
Definition at line 192 of file kis_stroke_strategy.cpp.
References m_clearsRedoOnStart.
|
virtual |
Reimplemented in KisSimpleStrokeStrategy.
Definition at line 109 of file kis_stroke_strategy.cpp.
|
virtual |
Reimplemented in KisSimpleStrokeStrategy.
Definition at line 79 of file kis_stroke_strategy.cpp.
|
virtual |
Reimplemented in KisSimpleStrokeStrategy.
Definition at line 84 of file kis_stroke_strategy.cpp.
|
virtual |
Reimplemented in KisSimpleStrokeStrategy.
Definition at line 104 of file kis_stroke_strategy.cpp.
|
virtual |
Reimplemented in KisSimpleStrokeStrategy.
Definition at line 74 of file kis_stroke_strategy.cpp.
|
virtual |
Reimplemented in KisSimpleStrokeStrategy.
Definition at line 99 of file kis_stroke_strategy.cpp.
|
virtual |
Reimplemented in KisSimpleStrokeStrategy.
Definition at line 69 of file kis_stroke_strategy.cpp.
|
virtual |
Reimplemented in KisRegenerateFrameStrokeStrategy, KisSwitchTimeStrokeStrategy, KisColorizeStrokeStrategy, KisIdleTaskStrokeStrategy, FreehandStrokeStrategy, KisColorSamplerStrokeStrategy, KisFilterStrokeStrategy, MoveStrokeStrategy, and MoveSelectionStrokeStrategy.
Definition at line 124 of file kis_stroke_strategy.cpp.
|
virtual |
Reimplemented in KisSimpleStrokeStrategy.
Definition at line 119 of file kis_stroke_strategy.cpp.
|
virtual |
Reimplemented in KisSimpleStrokeStrategy.
Definition at line 94 of file kis_stroke_strategy.cpp.
|
virtual |
Reimplemented in KisSimpleStrokeStrategy.
Definition at line 114 of file kis_stroke_strategy.cpp.
|
virtual |
Reimplemented in KisSimpleStrokeStrategy.
Definition at line 89 of file kis_stroke_strategy.cpp.
| KisLodPreferences KisStrokeStrategy::currentLodPreferences | ( | ) | const |
Returns current lod preferences of the strokes queue
Definition at line 155 of file kis_stroke_strategy.cpp.
References KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE, KisStrokesQueueMutatedJobInterface::lodPreferences(), and m_mutatedJobsInterface.
| bool KisStrokeStrategy::forceLodModeIfPossible | ( | ) | const |
Definition at line 47 of file kis_stroke_strategy.cpp.
References m_forceLodModeIfPossible.
| QString KisStrokeStrategy::id | ( | ) | const |
| bool KisStrokeStrategy::isAsynchronouslyCancellable | ( | ) | const |
Returns true if the stroke can be cancelled by the engine, e.g. when the user presses Esc key or Ctrl+Z shortcut. Default value is true. The only exception right now are the strokes that perform undo/redo operations.
The owner of the stroke can still cancel the stroke via the strokeId handle (though it is not used for undo/redo strokes).
Definition at line 222 of file kis_stroke_strategy.cpp.
References m_asynchronouslyCancellable.
| bool KisStrokeStrategy::isExclusive | ( | ) | const |
Definition at line 135 of file kis_stroke_strategy.cpp.
References m_exclusive.
| KUndo2MagicString KisStrokeStrategy::name | ( | ) | const |
Definition at line 150 of file kis_stroke_strategy.cpp.
References m_name.
| bool KisStrokeStrategy::needsExplicitCancel | ( | ) | const |
Definition at line 232 of file kis_stroke_strategy.cpp.
References m_needsExplicitCancel.
|
virtual |
notifyUserEndedStroke() is a callback used by the strokes system to notify when the user ends the stroke. That moment corresponds to the user calling strokesFacade->endStroke(id) and might happen much earlier when the stroke even started its execution.
NOTE: this method will be executed in the context of the GUI thread!
Reimplemented in FreehandStrokeStrategy.
Definition at line 65 of file kis_stroke_strategy.cpp.
|
virtual |
notifyUserStartedStroke() is a callback used by the strokes system to notify when the user adds the stroke to the strokes queue. That moment corresponds to the user calling strokesFacade->startStroke(strategy) and might happen much earlier than the first job being executed.
NOTE: this method will be executed in the context of the GUI thread!
Reimplemented in FreehandStrokeStrategy.
Definition at line 61 of file kis_stroke_strategy.cpp.
| bool KisStrokeStrategy::requestsOtherStrokesToEnd | ( | ) | const |
Returns true if the other currently running strokes should be politely asked to exit. The default value is 'true'.
The only known exception right now is KisRegenerateFrameStrokeStrategy which does not requests ending of any actions, since it performs purely background action.
Definition at line 202 of file kis_stroke_strategy.cpp.
References m_requestsOtherStrokesToEnd.
|
protected |
Definition at line 227 of file kis_stroke_strategy.cpp.
References m_asynchronouslyCancellable, and value().
|
protected |
Set override for the desired scheduler balancing ratio:
ratio = stroke jobs / update jobs
If value < 1.0, then the priority is given to updates, if the value is higher than 1.0, then the priority is given to stroke jobs.
Special value -1.0, suggests the scheduler to use the default value set by the user's config file (which is 100.0 by default).
Definition at line 247 of file kis_stroke_strategy.cpp.
References m_balancingRatioOverride, and value().
|
protected |
Definition at line 217 of file kis_stroke_strategy.cpp.
References m_canForgetAboutMe, and value().
|
protected |
Definition at line 197 of file kis_stroke_strategy.cpp.
References m_clearsRedoOnStart, and value().
|
protected |
Definition at line 182 of file kis_stroke_strategy.cpp.
References m_exclusive, and value().
| void KisStrokeStrategy::setForceLodModeIfPossible | ( | bool | forceLodModeIfPossible | ) |
Definition at line 52 of file kis_stroke_strategy.cpp.
References m_forceLodModeIfPossible, and value().
| void KisStrokeStrategy::setMutatedJobsInterface | ( | KisStrokesQueueMutatedJobInterface * | mutatedJobsInterface, |
| KisStrokeId | strokeId ) |
Definition at line 161 of file kis_stroke_strategy.cpp.
References m_mutatedJobsInterface, and m_strokeId.
|
protected |
Definition at line 237 of file kis_stroke_strategy.cpp.
References m_needsExplicitCancel, and value().
|
protected |
Definition at line 207 of file kis_stroke_strategy.cpp.
References m_requestsOtherStrokesToEnd, and value().
|
protected |
Definition at line 187 of file kis_stroke_strategy.cpp.
References m_supportsWrapAroundMode, and value().
| bool KisStrokeStrategy::supportsWrapAroundMode | ( | ) | const |
Definition at line 140 of file kis_stroke_strategy.cpp.
References m_supportsWrapAroundMode.
|
virtual |
tryCancelCurrentStrokeJobAsync is called by the strokes queue when the stroke is being cancelled. The stroke strategy may or may not handle this request and cancel the currently running long action.
Reimplemented in KisColorizeStrokeStrategy.
Definition at line 130 of file kis_stroke_strategy.cpp.
|
friend |
Definition at line 136 of file kis_stroke_strategy.h.
|
private |
Definition at line 202 of file kis_stroke_strategy.h.
|
private |
Definition at line 205 of file kis_stroke_strategy.h.
|
private |
Definition at line 201 of file kis_stroke_strategy.h.
|
private |
Definition at line 199 of file kis_stroke_strategy.h.
|
private |
Definition at line 196 of file kis_stroke_strategy.h.
|
private |
Definition at line 204 of file kis_stroke_strategy.h.
|
private |
Definition at line 207 of file kis_stroke_strategy.h.
|
private |
Definition at line 211 of file kis_stroke_strategy.h.
|
private |
Definition at line 208 of file kis_stroke_strategy.h.
|
private |
Definition at line 203 of file kis_stroke_strategy.h.
|
private |
Definition at line 200 of file kis_stroke_strategy.h.
|
private |
Definition at line 210 of file kis_stroke_strategy.h.
|
private |
Definition at line 197 of file kis_stroke_strategy.h.