Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/util/qquickanimator_p.h |
Source code | Switch to Preprocessed file |
Line | Source | Count | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | /**************************************************************************** | - | ||||||||||||
2 | ** | - | ||||||||||||
3 | ** Copyright (C) 2016 The Qt Company Ltd. | - | ||||||||||||
4 | ** Contact: https://www.qt.io/licensing/ | - | ||||||||||||
5 | ** | - | ||||||||||||
6 | ** This file is part of the QtQuick module of the Qt Toolkit. | - | ||||||||||||
7 | ** | - | ||||||||||||
8 | ** $QT_BEGIN_LICENSE:LGPL$ | - | ||||||||||||
9 | ** Commercial License Usage | - | ||||||||||||
10 | ** Licensees holding valid commercial Qt licenses may use this file in | - | ||||||||||||
11 | ** accordance with the commercial license agreement provided with the | - | ||||||||||||
12 | ** Software or, alternatively, in accordance with the terms contained in | - | ||||||||||||
13 | ** a written agreement between you and The Qt Company. For licensing terms | - | ||||||||||||
14 | ** and conditions see https://www.qt.io/terms-conditions. For further | - | ||||||||||||
15 | ** information use the contact form at https://www.qt.io/contact-us. | - | ||||||||||||
16 | ** | - | ||||||||||||
17 | ** GNU Lesser General Public License Usage | - | ||||||||||||
18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - | ||||||||||||
19 | ** General Public License version 3 as published by the Free Software | - | ||||||||||||
20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the | - | ||||||||||||
21 | ** packaging of this file. Please review the following information to | - | ||||||||||||
22 | ** ensure the GNU Lesser General Public License version 3 requirements | - | ||||||||||||
23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. | - | ||||||||||||
24 | ** | - | ||||||||||||
25 | ** GNU General Public License Usage | - | ||||||||||||
26 | ** Alternatively, this file may be used under the terms of the GNU | - | ||||||||||||
27 | ** General Public License version 2.0 or (at your option) the GNU General | - | ||||||||||||
28 | ** Public license version 3 or any later version approved by the KDE Free | - | ||||||||||||
29 | ** Qt Foundation. The licenses are as published by the Free Software | - | ||||||||||||
30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 | - | ||||||||||||
31 | ** included in the packaging of this file. Please review the following | - | ||||||||||||
32 | ** information to ensure the GNU General Public License requirements will | - | ||||||||||||
33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and | - | ||||||||||||
34 | ** https://www.gnu.org/licenses/gpl-3.0.html. | - | ||||||||||||
35 | ** | - | ||||||||||||
36 | ** $QT_END_LICENSE$ | - | ||||||||||||
37 | ** | - | ||||||||||||
38 | ****************************************************************************/ | - | ||||||||||||
39 | - | |||||||||||||
40 | #ifndef QQUICKANIMATOR_P_H | - | ||||||||||||
41 | #define QQUICKANIMATOR_P_H | - | ||||||||||||
42 | - | |||||||||||||
43 | // | - | ||||||||||||
44 | // W A R N I N G | - | ||||||||||||
45 | // ------------- | - | ||||||||||||
46 | // | - | ||||||||||||
47 | // This file is not part of the Qt API. It exists purely as an | - | ||||||||||||
48 | // implementation detail. This header file may change from version to | - | ||||||||||||
49 | // version without notice, or even be removed. | - | ||||||||||||
50 | // | - | ||||||||||||
51 | // We mean it. | - | ||||||||||||
52 | // | - | ||||||||||||
53 | - | |||||||||||||
54 | #include "qquickanimation_p.h" | - | ||||||||||||
55 | - | |||||||||||||
56 | QT_BEGIN_NAMESPACE | - | ||||||||||||
57 | - | |||||||||||||
58 | class QQuickItem; | - | ||||||||||||
59 | - | |||||||||||||
60 | class QQuickAnimatorJob; | - | ||||||||||||
61 | class QQuickAnimatorPrivate; | - | ||||||||||||
62 | class Q_QUICK_PRIVATE_EXPORT QQuickAnimator : public QQuickAbstractAnimation | - | ||||||||||||
63 | { | - | ||||||||||||
64 | Q_OBJECT | - | ||||||||||||
65 | Q_DECLARE_PRIVATE(QQuickAnimator) executed 176 times by 2 tests: return reinterpret_cast<QQuickAnimatorPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 8 times by 1 test: return reinterpret_cast<const QQuickAnimatorPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
| 8-176 | ||||||||||||
66 | Q_PROPERTY(QQuickItem *target READ targetItem WRITE setTargetItem NOTIFY targetItemChanged) | - | ||||||||||||
67 | Q_PROPERTY(QEasingCurve easing READ easing WRITE setEasing NOTIFY easingChanged) | - | ||||||||||||
68 | Q_PROPERTY(int duration READ duration WRITE setDuration NOTIFY durationChanged) | - | ||||||||||||
69 | Q_PROPERTY(qreal to READ to WRITE setTo NOTIFY toChanged) | - | ||||||||||||
70 | Q_PROPERTY(qreal from READ from WRITE setFrom NOTIFY fromChanged) | - | ||||||||||||
71 | - | |||||||||||||
72 | public: | - | ||||||||||||
73 | QQuickItem *targetItem() const; | - | ||||||||||||
74 | void setTargetItem(QQuickItem *target); | - | ||||||||||||
75 | - | |||||||||||||
76 | int duration() const; | - | ||||||||||||
77 | void setDuration(int duration); | - | ||||||||||||
78 | - | |||||||||||||
79 | QEasingCurve easing() const; | - | ||||||||||||
80 | void setEasing(const QEasingCurve & easing); | - | ||||||||||||
81 | - | |||||||||||||
82 | qreal to() const; | - | ||||||||||||
83 | void setTo(qreal to); | - | ||||||||||||
84 | - | |||||||||||||
85 | qreal from() const; | - | ||||||||||||
86 | void setFrom(qreal from); | - | ||||||||||||
87 | - | |||||||||||||
88 | protected: | - | ||||||||||||
89 | ThreadingModel threadingModel() const override { return RenderThread; } executed 84 times by 2 tests: return RenderThread; Executed by:
| 84 | ||||||||||||
90 | virtual QQuickAnimatorJob *createJob() const = 0; | - | ||||||||||||
91 | virtual QString propertyName() const = 0; | - | ||||||||||||
92 | QAbstractAnimationJob *transition(QQuickStateActions &actions, | - | ||||||||||||
93 | QQmlProperties &modified, | - | ||||||||||||
94 | TransitionDirection, | - | ||||||||||||
95 | QObject *) override; | - | ||||||||||||
96 | - | |||||||||||||
97 | QQuickAnimator(QQuickAnimatorPrivate &dd, QObject *parent = nullptr); | - | ||||||||||||
98 | QQuickAnimator(QObject *parent = nullptr); | - | ||||||||||||
99 | - | |||||||||||||
100 | Q_SIGNALS: | - | ||||||||||||
101 | void targetItemChanged(QQuickItem *); | - | ||||||||||||
102 | void durationChanged(int duration); | - | ||||||||||||
103 | void easingChanged(const QEasingCurve &curve); | - | ||||||||||||
104 | void toChanged(qreal to); | - | ||||||||||||
105 | void fromChanged(qreal from); | - | ||||||||||||
106 | }; | - | ||||||||||||
107 | - | |||||||||||||
108 | class QQuickScaleAnimatorPrivate; | - | ||||||||||||
109 | class Q_QUICK_PRIVATE_EXPORT QQuickScaleAnimator : public QQuickAnimator | - | ||||||||||||
110 | { | - | ||||||||||||
111 | Q_OBJECT | - | ||||||||||||
112 | public: | - | ||||||||||||
113 | QQuickScaleAnimator(QObject *parent = nullptr); | - | ||||||||||||
114 | protected: | - | ||||||||||||
115 | QQuickAnimatorJob *createJob() const override; | - | ||||||||||||
116 | QString propertyName() const override { return QStringLiteral("scale"); } never executed: end of block | 0 | ||||||||||||
117 | }; | - | ||||||||||||
118 | - | |||||||||||||
119 | class Q_QUICK_PRIVATE_EXPORT QQuickXAnimator : public QQuickAnimator | - | ||||||||||||
120 | { | - | ||||||||||||
121 | Q_OBJECT | - | ||||||||||||
122 | public: | - | ||||||||||||
123 | QQuickXAnimator(QObject *parent = nullptr); | - | ||||||||||||
124 | protected: | - | ||||||||||||
125 | QQuickAnimatorJob *createJob() const override; | - | ||||||||||||
126 | QString propertyName() const override { return QStringLiteral("x"); } never executed: end of block | 0 | ||||||||||||
127 | }; | - | ||||||||||||
128 | - | |||||||||||||
129 | class Q_QUICK_PRIVATE_EXPORT QQuickYAnimator : public QQuickAnimator | - | ||||||||||||
130 | { | - | ||||||||||||
131 | Q_OBJECT | - | ||||||||||||
132 | public: | - | ||||||||||||
133 | QQuickYAnimator(QObject *parent = nullptr); | - | ||||||||||||
134 | protected: | - | ||||||||||||
135 | QQuickAnimatorJob *createJob() const override; | - | ||||||||||||
136 | QString propertyName() const override { return QStringLiteral("y"); } never executed: end of block | 0 | ||||||||||||
137 | }; | - | ||||||||||||
138 | - | |||||||||||||
139 | class Q_QUICK_PRIVATE_EXPORT QQuickOpacityAnimator : public QQuickAnimator | - | ||||||||||||
140 | { | - | ||||||||||||
141 | Q_OBJECT | - | ||||||||||||
142 | public: | - | ||||||||||||
143 | QQuickOpacityAnimator(QObject *parent = nullptr); | - | ||||||||||||
144 | protected: | - | ||||||||||||
145 | QQuickAnimatorJob *createJob() const override; | - | ||||||||||||
146 | QString propertyName() const override { return QStringLiteral("opacity"); } never executed: end of block | 0 | ||||||||||||
147 | }; | - | ||||||||||||
148 | - | |||||||||||||
149 | class QQuickRotationAnimatorPrivate; | - | ||||||||||||
150 | class Q_QUICK_PRIVATE_EXPORT QQuickRotationAnimator : public QQuickAnimator | - | ||||||||||||
151 | { | - | ||||||||||||
152 | Q_OBJECT | - | ||||||||||||
153 | Q_DECLARE_PRIVATE(QQuickRotationAnimator) never executed: return reinterpret_cast<QQuickRotationAnimatorPrivate *>(qGetPtrHelper(d_ptr)); executed 4 times by 1 test: return reinterpret_cast<const QQuickRotationAnimatorPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
| 0-4 | ||||||||||||
154 | Q_PROPERTY(RotationDirection direction READ direction WRITE setDirection NOTIFY directionChanged) | - | ||||||||||||
155 | - | |||||||||||||
156 | public: | - | ||||||||||||
157 | enum RotationDirection { Numerical, Shortest, Clockwise, Counterclockwise }; | - | ||||||||||||
158 | Q_ENUM(RotationDirection) | - | ||||||||||||
159 | - | |||||||||||||
160 | QQuickRotationAnimator(QObject *parent = nullptr); | - | ||||||||||||
161 | - | |||||||||||||
162 | void setDirection(RotationDirection dir); | - | ||||||||||||
163 | RotationDirection direction() const; | - | ||||||||||||
164 | - | |||||||||||||
165 | Q_SIGNALS: | - | ||||||||||||
166 | void directionChanged(RotationDirection dir); | - | ||||||||||||
167 | - | |||||||||||||
168 | protected: | - | ||||||||||||
169 | QQuickAnimatorJob *createJob() const override; | - | ||||||||||||
170 | QString propertyName() const override { return QStringLiteral("rotation"); } never executed: end of block | 0 | ||||||||||||
171 | }; | - | ||||||||||||
172 | - | |||||||||||||
173 | #if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) | - | ||||||||||||
174 | class QQuickUniformAnimatorPrivate; | - | ||||||||||||
175 | class Q_QUICK_PRIVATE_EXPORT QQuickUniformAnimator : public QQuickAnimator | - | ||||||||||||
176 | { | - | ||||||||||||
177 | Q_OBJECT | - | ||||||||||||
178 | Q_DECLARE_PRIVATE(QQuickUniformAnimator) executed 2 times by 1 test: return reinterpret_cast<QQuickUniformAnimatorPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
executed 10 times by 1 test: return reinterpret_cast<const QQuickUniformAnimatorPrivate *>(qGetPtrHelper(d_ptr)); Executed by:
| 2-10 | ||||||||||||
179 | Q_PROPERTY(QString uniform READ uniform WRITE setUniform NOTIFY uniformChanged) | - | ||||||||||||
180 | - | |||||||||||||
181 | public: | - | ||||||||||||
182 | QQuickUniformAnimator(QObject *parent = nullptr); | - | ||||||||||||
183 | - | |||||||||||||
184 | QString uniform() const; | - | ||||||||||||
185 | void setUniform(const QString &); | - | ||||||||||||
186 | - | |||||||||||||
187 | Q_SIGNALS: | - | ||||||||||||
188 | void uniformChanged(const QString &); | - | ||||||||||||
189 | - | |||||||||||||
190 | protected: | - | ||||||||||||
191 | QQuickAnimatorJob *createJob() const override; | - | ||||||||||||
192 | QString propertyName() const override; | - | ||||||||||||
193 | }; | - | ||||||||||||
194 | #endif | - | ||||||||||||
195 | - | |||||||||||||
196 | QT_END_NAMESPACE | - | ||||||||||||
197 | - | |||||||||||||
198 | QML_DECLARE_TYPE(QQuickAnimator) executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
| 86-288 | ||||||||||||
199 | QML_DECLARE_TYPE(QQuickXAnimator) executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
| 86-288 | ||||||||||||
200 | QML_DECLARE_TYPE(QQuickYAnimator) executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
| 86-288 | ||||||||||||
201 | QML_DECLARE_TYPE(QQuickScaleAnimator) executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
| 86-288 | ||||||||||||
202 | QML_DECLARE_TYPE(QQuickRotationAnimator) executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
| 86-288 | ||||||||||||
203 | QML_DECLARE_TYPE(QQuickOpacityAnimator) executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
| 86-288 | ||||||||||||
204 | #if QT_CONFIG(quick_shadereffect) && QT_CONFIG(opengl) | - | ||||||||||||
205 | QML_DECLARE_TYPE(QQuickUniformAnimator) executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
executed 86 times by 2 tests: return id; Executed by:
executed 288 times by 132 tests: return newId; Executed by:
| 86-288 | ||||||||||||
206 | #endif | - | ||||||||||||
207 | #endif // QQUICKANIMATOR_P_H | - | ||||||||||||
Source code | Switch to Preprocessed file |