Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/qml/animations/qabstractanimationjob_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count |
---|---|---|
1 | - | |
2 | - | |
3 | static_assert(bool(1 == 1), "Required feature " "qml_animation" " for file " __FILE__ " not available."); | - |
4 | - | |
5 | - | |
6 | - | |
7 | class QAnimationGroupJob; | - |
8 | class QAnimationJobChangeListener; | - |
9 | class QQmlAnimationTimer; | - |
10 | - | |
11 | class __attribute__((visibility("default"))) QAbstractAnimationJob | - |
12 | { | - |
13 | QAbstractAnimationJob(const QAbstractAnimationJob &) = delete; QAbstractAnimationJob &operator=(const QAbstractAnimationJob &) = delete; | - |
14 | public: | - |
15 | enum Direction { | - |
16 | Forward, | - |
17 | Backward | - |
18 | }; | - |
19 | - | |
20 | enum State { | - |
21 | Stopped, | - |
22 | Paused, | - |
23 | Running | - |
24 | }; | - |
25 | - | |
26 | QAbstractAnimationJob(); | - |
27 | virtual ~QAbstractAnimationJob(); | - |
28 | - | |
29 | - | |
30 | inline QAnimationGroupJob *group() const {return executed 10 times by 2 tests: m_group;return m_group; Executed by:
executed 10 times by 2 tests: }return m_group; Executed by:
| 10 |
31 | - | |
32 | inline int loopCount() const {return executed 1532967 times by 19 tests: m_loopCount;return m_loopCount; Executed by:
executed 1532967 times by 19 tests: }return m_loopCount; Executed by:
| 1532967 |
33 | void setLoopCount(int loopCount); | - |
34 | - | |
35 | int totalDuration() const; | - |
36 | virtual int duration() const {return executed 2 times by 1 test: 0;return 0; Executed by:
executed 2 times by 1 test: }return 0; Executed by:
| 2 |
37 | - | |
38 | inline QAbstractAnimationJob::Direction direction() const {return executed 84716 times by 36 tests: m_direction;return m_direction; Executed by:
executed 84716 times by 36 tests: }return m_direction; Executed by:
| 84716 |
39 | void setDirection(QAbstractAnimationJob::Direction direction); | - |
40 | - | |
41 | - | |
42 | inline int currentTime() const {return executed 107186 times by 28 tests: m_totalCurrentTime;return m_totalCurrentTime; Executed by:
executed 107186 times by 28 tests: }return m_totalCurrentTime; Executed by:
| 107186 |
43 | inline int currentLoopTime() const {return executed 10780 times by 31 tests: m_currentTime;return m_currentTime; Executed by:
executed 10780 times by 31 tests: }return m_currentTime; Executed by:
| 10780 |
44 | inline int currentLoop() const {return executed 244 times by 5 tests: m_currentLoop;return m_currentLoop; Executed by:
executed 244 times by 5 tests: }return m_currentLoop; Executed by:
| 244 |
45 | inline QAbstractAnimationJob::State state() const {return executed 280316 times by 26 tests: m_state;return m_state; Executed by:
executed 280316 times by 26 tests: }return m_state; Executed by:
| 280316 |
46 | inline bool isRunning() { return executed 96938 times by 24 tests: m_state == Running;return m_state == Running; Executed by:
executed 96938 times by 24 tests: }return m_state == Running; Executed by:
| 96938 |
47 | inline bool isStopped() { return executed 292096 times by 29 tests: m_state == Stopped;return m_state == Stopped; Executed by:
executed 292096 times by 29 tests: }return m_state == Stopped; Executed by:
| 292096 |
48 | inline bool isPaused() { return executed 35360 times by 16 tests: m_state == Paused;return m_state == Paused; Executed by:
executed 35360 times by 16 tests: }return m_state == Paused; Executed by:
| 35360 |
49 | void setDisableUserControl(); | - |
50 | void setEnableUserControl(); | - |
51 | bool userControlDisabled() const; | - |
52 | - | |
53 | void setCurrentTime(int msecs); | - |
54 | - | |
55 | void start(); | - |
56 | void pause(); | - |
57 | void resume(); | - |
58 | void stop(); | - |
59 | - | |
60 | enum ChangeType { | - |
61 | Completion = 0x01, | - |
62 | StateChange = 0x02, | - |
63 | CurrentLoop = 0x04, | - |
64 | CurrentTime = 0x08 | - |
65 | }; | - |
66 | typedef QFlags<ChangeType> ChangeTypes; | - |
67 | - | |
68 | void addAnimationChangeListener(QAnimationJobChangeListener *listener, QAbstractAnimationJob::ChangeTypes); | - |
69 | void removeAnimationChangeListener(QAnimationJobChangeListener *listener, QAbstractAnimationJob::ChangeTypes); | - |
70 | QAbstractAnimationJob *nextSibling() const { return executed 2154723 times by 21 tests: m_nextSibling;return m_nextSibling; Executed by:
executed 2154723 times by 21 tests: }return m_nextSibling; Executed by:
| 2154723 |
71 | QAbstractAnimationJob *previousSibling() const { return executed 78800 times by 21 tests: m_previousSibling;return m_previousSibling; Executed by:
executed 78800 times by 21 tests: }return m_previousSibling; Executed by:
| 78800 |
72 | - | |
73 | bool isGroup() const { return executed 26 times by 2 tests: m_isGroup;return m_isGroup; Executed by:
executed 26 times by 2 tests: }return m_isGroup; Executed by:
| 26 |
74 | bool isRenderThreadJob() const { return executed 206 times by 2 tests: m_isRenderThreadJob;return m_isRenderThreadJob; Executed by:
executed 206 times by 2 tests: }return m_isRenderThreadJob; Executed by:
| 206 |
75 | bool isRenderThreadProxy() const { return executed 54 times by 3 tests: m_isRenderThreadProxy;return m_isRenderThreadProxy; Executed by:
executed 54 times by 3 tests: }return m_isRenderThreadProxy; Executed by:
| 54 |
76 | - | |
77 | protected: | - |
78 | virtual void updateCurrentTime(int) {} | - |
79 | virtual void updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState); | - |
80 | virtual void updateDirection(QAbstractAnimationJob::Direction direction); | - |
81 | virtual void topLevelAnimationLoopChanged() {} | - |
82 | - | |
83 | virtual void debugAnimation(QDebug d) const; | - |
84 | - | |
85 | void fireTopLevelAnimationLoopChanged(); | - |
86 | - | |
87 | void setState(QAbstractAnimationJob::State state); | - |
88 | - | |
89 | void finished(); | - |
90 | void stateChanged(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState); | - |
91 | void currentLoopChanged(); | - |
92 | void directionChanged(QAbstractAnimationJob::Direction); | - |
93 | void currentTimeChanged(int currentTime); | - |
94 | - | |
95 | - | |
96 | int m_loopCount; | - |
97 | QAnimationGroupJob *m_group; | - |
98 | QAbstractAnimationJob::Direction m_direction; | - |
99 | - | |
100 | - | |
101 | QAbstractAnimationJob::State m_state; | - |
102 | int m_totalCurrentTime; | - |
103 | int m_currentTime; | - |
104 | int m_currentLoop; | - |
105 | - | |
106 | int m_uncontrolledFinishTime; | - |
107 | int m_currentLoopStartTime; | - |
108 | - | |
109 | struct ChangeListener { | - |
110 | ChangeListener(QAnimationJobChangeListener *l, QAbstractAnimationJob::ChangeTypes t) : listener(l), types(t) {} executed 30445 times by 36 tests: end of block Executed by:
| 30445 |
111 | QAnimationJobChangeListener *listener; | - |
112 | QAbstractAnimationJob::ChangeTypes types; | - |
113 | bool operator==(const ChangeListener &other) const { return executed 10636 times by 9 tests: listener == other.listener && types == other.types;return listener == other.listener && types == other.types; Executed by:
executed 10636 times by 9 tests: }return listener == other.listener && types == other.types; Executed by:
| 10636 |
114 | }; | - |
115 | std::vector<ChangeListener> changeListeners; | - |
116 | - | |
117 | QAbstractAnimationJob *m_nextSibling; | - |
118 | QAbstractAnimationJob *m_previousSibling; | - |
119 | QQmlAnimationTimer *m_timer = nullptr; | - |
120 | - | |
121 | bool *m_wasDeleted; | - |
122 | bool m_hasRegisteredTimer:1; | - |
123 | bool m_isPause:1; | - |
124 | bool m_isGroup:1; | - |
125 | bool m_disableUserControl:1; | - |
126 | bool m_hasCurrentTimeChangeListeners:1; | - |
127 | bool m_isRenderThreadJob:1; | - |
128 | bool m_isRenderThreadProxy:1; | - |
129 | - | |
130 | friend class QQmlAnimationTimer; | - |
131 | friend class QAnimationGroupJob; | - |
132 | friend __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QAbstractAnimationJob *job); | - |
133 | }; | - |
134 | - | |
135 | class __attribute__((visibility("default"))) QAnimationJobChangeListener | - |
136 | { | - |
137 | public: | - |
138 | virtual ~QAnimationJobChangeListener(); | - |
139 | virtual void animationFinished(QAbstractAnimationJob *) {} | - |
140 | virtual void animationStateChanged(QAbstractAnimationJob *, QAbstractAnimationJob::State, QAbstractAnimationJob::State) {} | - |
141 | virtual void animationCurrentLoopChanged(QAbstractAnimationJob *) {} | - |
142 | virtual void animationCurrentTimeChanged(QAbstractAnimationJob *, int) {} | - |
143 | }; | - |
144 | - | |
145 | class __attribute__((visibility("default"))) QQmlAnimationTimer : public QAbstractAnimationTimer | - |
146 | { | - |
147 | public: | - |
148 | #pragma GCC diagnostic push | - |
149 | - | |
150 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - |
151 | static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: | - |
152 | #pragma GCC diagnostic ignored "-Wattributes" | - |
153 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - |
154 | #pragma GCC diagnostic pop | - |
155 | struct QPrivateSignal {}; | - |
156 | private: | - |
157 | QQmlAnimationTimer(); | - |
158 | - | |
159 | public: | - |
160 | static QQmlAnimationTimer *instance(); | - |
161 | static QQmlAnimationTimer *instance(bool create); | - |
162 | - | |
163 | void registerAnimation(QAbstractAnimationJob *animation, bool isTopLevel); | - |
164 | void unregisterAnimation(QAbstractAnimationJob *animation); | - |
165 | - | |
166 | - | |
167 | - | |
168 | - | |
169 | - | |
170 | void ensureTimerUpdate(); | - |
171 | - | |
172 | - | |
173 | - | |
174 | - | |
175 | - | |
176 | void updateAnimationTimer(); | - |
177 | - | |
178 | void restartAnimationTimer() override; | - |
179 | void updateAnimationsTime(qint64 timeStep) override; | - |
180 | - | |
181 | - | |
182 | int runningAnimationCount() override { return executed 6 times by 1 test: animations.count();return animations.count(); Executed by:
executed 6 times by 1 test: }return animations.count(); Executed by:
| 6 |
183 | - | |
184 | bool hasStartAnimationPending() const { return executed 302 times by 8 tests: startAnimationPending;return startAnimationPending; Executed by:
executed 302 times by 8 tests: }return startAnimationPending; Executed by:
| 302 |
185 | - | |
186 | public : | - |
187 | void startAnimations(); | - |
188 | void stopTimer(); | - |
189 | - | |
190 | private: | - |
191 | qint64 lastTick; | - |
192 | int currentAnimationIdx; | - |
193 | bool insideTick; | - |
194 | bool startAnimationPending; | - |
195 | bool stopTimerPending; | - |
196 | - | |
197 | QList<QAbstractAnimationJob*> animations, animationsToStart; | - |
198 | - | |
199 | - | |
200 | int runningLeafAnimations; | - |
201 | QList<QAbstractAnimationJob*> runningPauseAnimations; | - |
202 | - | |
203 | void registerRunningAnimation(QAbstractAnimationJob *animation); | - |
204 | void unregisterRunningAnimation(QAbstractAnimationJob *animation); | - |
205 | - | |
206 | int closestPauseAnimationTimeToFinish(); | - |
207 | }; | - |
208 | - | |
209 | constexpr inline QFlags<QAbstractAnimationJob::ChangeTypes::enum_type> operator|(QAbstractAnimationJob::ChangeTypes::enum_type f1, QAbstractAnimationJob::ChangeTypes::enum_type f2) noexcept { return QFlags<QAbstractAnimationJob::ChangeTypes::enum_type>(f1) | f2; } constexpr inline QFlags<QAbstractAnimationJob::ChangeTypes::enum_type> operator|(QAbstractAnimationJob::ChangeTypes::enum_type f1, QFlags<QAbstractAnimationJob::ChangeTypes::enum_type> f2) noexcept { return f2 | f1; } constexpr inline QIncompatibleFlag operator|(QAbstractAnimationJob::ChangeTypes::enum_type f1, int f2) noexcept { return QIncompatibleFlag(int(f1) | f2); } | - |
210 | - | |
211 | __attribute__((visibility("default"))) QDebug operator<<(QDebug, const QAbstractAnimationJob *job); | - |
212 | - | |
213 | - | |
Switch to Source code | Preprocessed file |