Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_strokes_queue.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2011 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef __KIS_STROKES_QUEUE_H
8#define __KIS_STROKES_QUEUE_H
9
10#include "kritaimage_export.h"
11#include "kundo2magicstring.h"
12#include "kis_types.h"
14#include "kis_stroke_strategy.h"
19#include "KisLodPreferences.h"
20
22class KisStroke;
26
27
28class KRITAIMAGE_EXPORT KisStrokesQueue : public KisStrokesQueueMutatedJobInterface
29{
30public:
33
34 KisStrokeId startStroke(KisStrokeStrategy *strokeStrategy);
35 void addJob(KisStrokeId id, KisStrokeJobData *data);
36
37 void endStroke(KisStrokeId id);
38 bool cancelStroke(KisStrokeId id);
39
40 bool tryCancelCurrentStrokeAsync();
41
42 UndoResult tryUndoLastStrokeAsync();
43
44 void processQueue(KisUpdaterContext &updaterContext,
45 bool externalJobsPending);
47 bool isEmpty() const;
48
49 qint32 sizeMetric() const;
50 KUndo2MagicString currentStrokeName() const;
51 bool hasOpenedStrokes() const;
52
55
57 void setLodPreferences(const KisLodPreferences &value);
58 void explicitRegenerateLevelOfDetail();
59 void setLod0ToNStrokeStrategyFactory(const KisLodSyncStrokeStrategyFactory &factory);
60 void setSuspendResumeUpdatesStrokeStrategyFactory(const KisSuspendResumeStrategyPairFactory &factory);
61 void setPurgeRedoStateCallback(const std::function<void()> &callback);
62 void setPostSyncLod0GUIPlaneRequestForResumeCallback(const std::function<void()> &callback);
64
70 void notifyUFOChangedImage();
71
72 void debugDumpAllStrokes();
73
74 // interface for KisStrokeStrategy only!
75 void addMutatedJobs(KisStrokeId id, const QVector<KisStrokeJobData*> list) final override;
76
77private:
78 bool processOneJob(KisUpdaterContext &updaterContext,
79 bool externalJobsPending);
80 bool checkStrokeState(bool hasStrokeJobsRunning,
81 int runningLevelOfDetail);
82 bool checkExclusiveProperty(bool hasMergeJobs, bool hasStrokeJobs);
83 bool checkSequentialProperty(KisUpdaterContextSnapshotEx snapshot, bool externalJobsPending);
84 bool checkBarrierProperty(bool hasMergeJobs, bool hasStrokeJobs,
85 bool externalJobsPending);
86 bool checkLevelOfDetailProperty(int runningLevelOfDetail);
87
89 KisStrokeId startLodNUndoStroke(KisStrokeStrategy *strokeStrategy);
90
91private:
92 struct Private;
93 Private * const m_d;
94};
95
96#endif /* __KIS_STROKES_QUEUE_H */
float value(const T *src, size_t ch)
virtual void addMutatedJobs(KisStrokeId strokeId, const QVector< KisStrokeJobData * > list)=0
std::function< std::pair< KisSuspendResumePair, KisSuspendResumePair >()> KisSuspendResumeStrategyPairFactory
std::function< KisLodSyncPair(bool)> KisLodSyncStrokeStrategyFactory
qreal balancingRatioOverride() const
bool wrapAroundModeSupported() const
KisLodPreferences lodPreferences() const override
Private *const m_d
bool needsExclusiveAccess() const
KisPostExecutionUndoAdapter * lodNPostExecutionUndoAdapter() const
bool checkBarrierProperty(bool hasMergeJobs, bool hasStrokeJobs, bool externalJobsPending)