Debian Codegraph @

libs/image/kis_image_signal_router.h

raw symbols SCIP
1 /*
2 * SPDX-FileCopyrightText: 2011 Dmitry Kazakov <[email protected]>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7 #ifndef __KIS_IMAGE_SIGNAL_ROUTER_H
8 #define __KIS_IMAGE_SIGNAL_ROUTER_H
9
10 #include <QObject>
11 #include "KisImageSignals.h"
12 #include "KisNodeAdditionFlags.h"
13
14 class KoColorSpace;
15 class KoColorProfile;
16
17
18 class KRITAIMAGE_EXPORT KisImageSignalRouter : public QObject
19 {
20 Q_OBJECT
21
22 public:
23 KisImageSignalRouter(KisImageWSP image);
24 ~KisImageSignalRouter() override;
25
26 void emitNotification(KisImageSignalType type);
27 void emitNotifications(KisImageSignalVector notifications);
28
29 void emitNodeChanged(KisNodeSP node);
30 void emitNodeHasBeenAdded(KisNode *parent, int index, KisNodeAdditionFlags flags);
31 void emitAboutToRemoveANode(KisNode *parent, int index);
32
33 void emitRequestLodPlanesSyncBlocked(bool value);
34 void emitNotifyBatchUpdateStarted();
35 void emitNotifyBatchUpdateEnded();
36
37 public Q_SLOTS:
38 void emitImageModifiedNotification();
39
40 private Q_SLOTS:
41 void slotNotification(KisImageSignalType type);
42
43 Q_SIGNALS:
44
45 void sigNotification(KisImageSignalType type);
46
47 /**
48 * Emitted whenever the image wants to update Lod0 plane of the canvas. Blocking
49 * syncing effectively means that the canvas will not try to read from these planes
50 * until the **all** the data is loaded. Otherwise the user will see weird flickering
51 * because of partially loaded lod0 tiles.
52 *
53 * NOTE: while the sync is blocked, the canvas is considered to use LodN planes
54 * that are expected to contain valid data.
55 */
56 void sigRequestLodPlanesSyncBlocked(bool value);
57
58 /**
59 * Emitted whenever the image is going to issue a lot of canvas update signals and
60 * it is a good idea to group then and rerender the canvas in one go. The canvas
61 * should initiate new rerenders while the batch is in progress.
62 *
63 * NOTE: even though the batched updates will not initiate a rerender, it does
64 * **not** guarantee that there will be processed during the batch. The
65 * updates may come from other sources, e.g. from mouse moves.
66 *
67 * NOTE: this feature is used to avoid flickering when switching
68 * back from lodN plane back to lod0. All the texture tiles should
69 * be loaded with new information before mipmaps can be regenerated.
70 */
71 void sigNotifyBatchUpdateStarted();
72
73 /**
74 * \see sigNotifyBatchUpdateStarted()
75 */
76 void sigNotifyBatchUpdateEnded();
77
78 // Notifications
79 void sigImageModified();
80 void sigImageModifiedWithoutUndo();
81
82 void sigSizeChanged(const QPointF &oldStillPoint, const QPointF &newStillPoint);
83 void sigProfileChanged(const KoColorProfile * profile);
84 void sigColorSpaceChanged(const KoColorSpace* cs);
85 void sigResolutionChanged(double xRes, double yRes);
86 void sigRequestNodeReselection(KisNodeSP activeNode, const KisNodeList &selectedNodes);
87
88 // Graph change signals
89 void sigNodeChanged(KisNodeSP node);
90 void sigNodeAddedAsync(KisNodeSP node, KisNodeAdditionFlags flags);
91 void sigRemoveNodeAsync(KisNodeSP node);
92 void sigLayersChangedAsync();
93
94 private:
95 KisImageWSP m_image;
96 };
97
98 #endif /* __KIS_IMAGE_SIGNAL_ROUTER_H */