Krita Source Code Documentation
Loading...
Searching...
No Matches
timeline_frames_index_converter.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2015 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8
11
12
14 : m_dummiesFacade(dummiesFacade),
15 m_activeDummy(0),
16 m_showGlobalSelectionMask(false)
17{
18}
19
23
25{
26 if (isDummyVisible(root)) {
27 if (endDummy && root == endDummy) {
28 return true;
29 }
30
31 startCount++;
32 }
33
34 KisNodeDummy *dummy = root->lastChild();
35 while (dummy) {
36 if (calcNodesInPath(dummy, startCount, endDummy)) {
37 return true;
38 }
39
40 dummy = dummy->prevSibling();
41 }
42
43 return false;
44}
45
47{
48 if (isDummyVisible(root)) {
49 if (!startCount) {
50 return root;
51 }
52
53 startCount--;
54 }
55
56 KisNodeDummy *dummy = root->lastChild();
57 while (dummy) {
58 KisNodeDummy *found = findNodeFromRow(dummy, startCount);
59 if (found) return found;
60
61 dummy = dummy->prevSibling();
62 }
63
64 return 0;
65}
66
68{
70 if(!root) return 0;
71
72 return findNodeFromRow(root, row);
73}
74
76{
77 if (!dummy) return -1;
78
80 if(!root) return -1;
81
82 int count = 0;
83 return calcNodesInPath(root, count, dummy) ? count : -1;
84}
85
87{
89 if(!root) return 0;
90
91 int count = 0;
92 calcNodesInPath(root, count, 0);
93 return count;
94}
95
100
102 bool *oldRemoved,
103 bool *newAdded)
104{
105 if (m_activeDummy == dummy) return;
106
108 *oldRemoved = true;
109 }
110
111 m_activeDummy = dummy;
112
114 *newAdded = true;
115 }
116}
117
124
129
134
136{
137 return (isDummyAvailableForTimeline(dummy) &&
138 dummy->node()->isPinnedToTimeline()) ||
139 dummy == m_activeDummy;
140}
float value(const T *src, size_t ch)
virtual KisNodeDummy * rootDummy() const =0
bool isGUIVisible(bool showGlobalSelection) const
KisNodeDummy * lastChild() const
KisNodeSP node() const
KisNodeDummy * prevSibling() const
void updateActiveDummy(KisNodeDummy *dummy, bool *oldRemoved, bool *newAdded)
bool isDummyAvailableForTimeline(KisNodeDummy *dummy) const
TimelineFramesIndexConverter(KisDummiesFacadeBase *dummiesFacade)
KisNodeDummy * findNodeFromRow(KisNodeDummy *root, int &startCount)
bool calcNodesInPath(KisNodeDummy *root, int &startCount, KisNodeDummy *endDummy)
bool isDummyVisible(KisNodeDummy *dummy) const
bool isPinnedToTimeline() const