aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/animations/qabstractanimationjob_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/animations/qabstractanimationjob_p.h')
-rw-r--r--src/qml/animations/qabstractanimationjob_p.h62
1 files changed, 14 insertions, 48 deletions
diff --git a/src/qml/animations/qabstractanimationjob_p.h b/src/qml/animations/qabstractanimationjob_p.h
index d046ce9def..04b47e3ae5 100644
--- a/src/qml/animations/qabstractanimationjob_p.h
+++ b/src/qml/animations/qabstractanimationjob_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQml module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QABSTRACTANIMATIONJOB_P_H
#define QABSTRACTANIMATIONJOB_P_H
@@ -53,6 +17,7 @@
#include <private/qtqmlglobal_p.h>
#include <private/qanimationjobutil_p.h>
+#include <private/qdoubleendedlist_p.h>
#include <QtCore/QObject>
#include <QtCore/private/qabstractanimation_p.h>
#include <vector>
@@ -65,7 +30,7 @@ class QAnimationGroupJob;
class QAnimationJobChangeListener;
class QQmlAnimationTimer;
-class Q_QML_PRIVATE_EXPORT QAbstractAnimationJob
+class Q_QML_EXPORT QAbstractAnimationJob : public QInheritedListNode
{
Q_DISABLE_COPY(QAbstractAnimationJob)
public:
@@ -113,6 +78,7 @@ public:
void pause();
void resume();
void stop();
+ void complete();
enum ChangeType {
Completion = 0x01,
@@ -124,8 +90,6 @@ public:
void addAnimationChangeListener(QAnimationJobChangeListener *listener, QAbstractAnimationJob::ChangeTypes);
void removeAnimationChangeListener(QAnimationJobChangeListener *listener, QAbstractAnimationJob::ChangeTypes);
- QAbstractAnimationJob *nextSibling() const { return m_nextSibling; }
- QAbstractAnimationJob *previousSibling() const { return m_previousSibling; }
bool isGroup() const { return m_isGroup; }
bool isRenderThreadJob() const { return m_isRenderThreadJob; }
@@ -134,6 +98,7 @@ public:
SelfDeletable m_selfDeletable;
protected:
virtual void updateCurrentTime(int) {}
+ virtual void updateLoopCount(int) {}
virtual void updateState(QAbstractAnimationJob::State newState, QAbstractAnimationJob::State oldState);
virtual void updateDirection(QAbstractAnimationJob::Direction direction);
virtual void topLevelAnimationLoopChanged() {}
@@ -172,8 +137,6 @@ protected:
};
std::vector<ChangeListener> changeListeners;
- QAbstractAnimationJob *m_nextSibling;
- QAbstractAnimationJob *m_previousSibling;
QQmlAnimationTimer *m_timer = nullptr;
bool m_hasRegisteredTimer:1;
@@ -186,10 +149,10 @@ protected:
friend class QQmlAnimationTimer;
friend class QAnimationGroupJob;
- friend Q_QML_PRIVATE_EXPORT QDebug operator<<(QDebug, const QAbstractAnimationJob *job);
+ friend Q_QML_EXPORT QDebug operator<<(QDebug, const QAbstractAnimationJob *job);
};
-class Q_QML_PRIVATE_EXPORT QAnimationJobChangeListener
+class Q_QML_EXPORT QAnimationJobChangeListener
{
public:
virtual ~QAnimationJobChangeListener();
@@ -199,13 +162,15 @@ public:
virtual void animationCurrentTimeChanged(QAbstractAnimationJob *, int) {}
};
-class Q_QML_PRIVATE_EXPORT QQmlAnimationTimer : public QAbstractAnimationTimer
+class Q_QML_EXPORT QQmlAnimationTimer : public QAbstractAnimationTimer
{
Q_OBJECT
private:
QQmlAnimationTimer();
public:
+ ~QQmlAnimationTimer(); // must be destructible by QThreadStorage
+
static QQmlAnimationTimer *instance();
static QQmlAnimationTimer *instance(bool create);
@@ -228,7 +193,7 @@ public:
void updateAnimationsTime(qint64 timeStep) override;
//useful for profiling/debugging
- int runningAnimationCount() override { return animations.count(); }
+ int runningAnimationCount() override { return animations.size(); }
bool hasStartAnimationPending() const { return startAnimationPending; }
@@ -251,13 +216,14 @@ private:
void registerRunningAnimation(QAbstractAnimationJob *animation);
void unregisterRunningAnimation(QAbstractAnimationJob *animation);
+ void unsetJobTimer(QAbstractAnimationJob *animation);
int closestPauseAnimationTimeToFinish();
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractAnimationJob::ChangeTypes)
-Q_QML_PRIVATE_EXPORT QDebug operator<<(QDebug, const QAbstractAnimationJob *job);
+Q_QML_EXPORT QDebug operator<<(QDebug, const QAbstractAnimationJob *job);
QT_END_NAMESPACE