From ab82ff0fb77bc66bc189f769209190c6d294235d Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 15 May 2019 19:19:04 +0300 Subject: [PATCH] QtLottie: Completely detach from upstream. --- .../SourceFiles/lottie/lottie_animation.cpp | 2 +- .../lottie/lottie_frame_renderer.h | 5 +- Telegram/SourceFiles/lottie/lottie_pch.cpp | 1 - Telegram/SourceFiles/lottie/lottie_pch.h | 3 +- Telegram/ThirdParty/qtlottie | 2 +- .../qtlottie_helper/QtBodymovin/bmglobal.h | 44 -- .../QtBodymovin/private/beziereasing_p.h | 61 --- .../QtBodymovin/private/bmasset_p.h | 75 ---- .../QtBodymovin/private/bmbase_p.h | 116 ------ .../QtBodymovin/private/bmbasictransform_p.h | 89 ---- .../QtBodymovin/private/bmconstants_p.h | 67 --- .../QtBodymovin/private/bmellipse_p.h | 86 ---- .../QtBodymovin/private/bmfill_p.h | 75 ---- .../QtBodymovin/private/bmfilleffect_p.h | 78 ---- .../QtBodymovin/private/bmfreeformshape_p.h | 107 ----- .../QtBodymovin/private/bmgfill_p.h | 91 ----- .../QtBodymovin/private/bmgroup_p.h | 77 ---- .../QtBodymovin/private/bmlayer_p.h | 110 ----- .../QtBodymovin/private/bmmasks_p.h | 69 ---- .../QtBodymovin/private/bmmaskshape_p.h | 118 ------ .../QtBodymovin/private/bmnulllayer_p.h | 71 ---- .../QtBodymovin/private/bmpathtrimmer_p.h | 78 ---- .../QtBodymovin/private/bmprecompasset_p.h | 63 --- .../QtBodymovin/private/bmprecomplayer_p.h | 80 ---- .../QtBodymovin/private/bmproperty_p.h | 380 ------------------ .../QtBodymovin/private/bmrect_p.h | 82 ---- .../QtBodymovin/private/bmrepeater_p.h | 79 ---- .../private/bmrepeatertransform_p.h | 79 ---- .../QtBodymovin/private/bmround_p.h | 84 ---- .../QtBodymovin/private/bmscene_p.h | 104 ----- .../QtBodymovin/private/bmshape_p.h | 94 ----- .../QtBodymovin/private/bmshapelayer_p.h | 74 ---- .../QtBodymovin/private/bmshapetransform_p.h | 84 ---- .../QtBodymovin/private/bmspatialproperty_p.h | 141 ------- .../QtBodymovin/private/bmstroke_p.h | 81 ---- .../QtBodymovin/private/bmtrimpath_p.h | 87 ---- .../QtBodymovin/private/lottierenderer_p.h | 116 ------ .../QtBodymovin/private/trimpath_p.h | 93 ----- Telegram/gyp/lib_lottie.gyp | 65 ++- Telegram/gyp/lottie_helper.bat | 13 - Telegram/gyp/lottie_helper.py | 34 -- 41 files changed, 37 insertions(+), 3221 deletions(-) delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/bmglobal.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/beziereasing_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmasset_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmbase_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmbasictransform_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmconstants_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmellipse_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfill_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfilleffect_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfreeformshape_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmgfill_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmgroup_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmlayer_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmmasks_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmmaskshape_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmnulllayer_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmpathtrimmer_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmprecompasset_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmprecomplayer_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmproperty_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrect_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrepeater_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrepeatertransform_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmround_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmscene_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshape_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshapelayer_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshapetransform_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmspatialproperty_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmstroke_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmtrimpath_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/lottierenderer_p.h delete mode 100644 Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/trimpath_p.h delete mode 100644 Telegram/gyp/lottie_helper.bat delete mode 100644 Telegram/gyp/lottie_helper.py diff --git a/Telegram/SourceFiles/lottie/lottie_animation.cpp b/Telegram/SourceFiles/lottie/lottie_animation.cpp index 229e81dbe..934fdbcff 100644 --- a/Telegram/SourceFiles/lottie/lottie_animation.cpp +++ b/Telegram/SourceFiles/lottie/lottie_animation.cpp @@ -55,7 +55,7 @@ Animation::Animation(const QByteArray &content) const auto document = QJsonDocument::fromJson(content, &error); const auto parsed = crl::now(); if (error.error != QJsonParseError::NoError) { - qCWarning(lcLottieQtBodymovinParser) + qWarning() << "Lottie Error: Parse failed with code " << error.error << "( " << error.errorString() << ")"; diff --git a/Telegram/SourceFiles/lottie/lottie_frame_renderer.h b/Telegram/SourceFiles/lottie/lottie_frame_renderer.h index 5e1d98fa4..3fcf24a8d 100644 --- a/Telegram/SourceFiles/lottie/lottie_frame_renderer.h +++ b/Telegram/SourceFiles/lottie/lottie_frame_renderer.h @@ -9,15 +9,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/basic_types.h" #include "base/weak_ptr.h" - #include "lottie/lottie_common.h" +#include "bmscene.h" -#include #include - #include #include - #include class BMBase; diff --git a/Telegram/SourceFiles/lottie/lottie_pch.cpp b/Telegram/SourceFiles/lottie/lottie_pch.cpp index 30c1d284c..cbde84227 100644 --- a/Telegram/SourceFiles/lottie/lottie_pch.cpp +++ b/Telegram/SourceFiles/lottie/lottie_pch.cpp @@ -6,4 +6,3 @@ For license and copyright information please follow this link: https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #include "lottie/lottie_pch.h" - diff --git a/Telegram/SourceFiles/lottie/lottie_pch.h b/Telegram/SourceFiles/lottie/lottie_pch.h index 0372ae5b4..6d62ab815 100644 --- a/Telegram/SourceFiles/lottie/lottie_pch.h +++ b/Telegram/SourceFiles/lottie/lottie_pch.h @@ -7,4 +7,5 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL */ #pragma once -#define qAsConst(X) std::as_const(X) +#include +#include diff --git a/Telegram/ThirdParty/qtlottie b/Telegram/ThirdParty/qtlottie index f95d9f526..15be485c6 160000 --- a/Telegram/ThirdParty/qtlottie +++ b/Telegram/ThirdParty/qtlottie @@ -1 +1 @@ -Subproject commit f95d9f5260af2dcf1e724d1d0814bd9176149b76 +Subproject commit 15be485c6914a48b0031ceaa15a5ff53f5214985 diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/bmglobal.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/bmglobal.h deleted file mode 100644 index 7be60ae67..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/bmglobal.h +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMGLOBAL_H -#define BMGLOBAL_H - -#include - -#if defined(BODYMOVIN_LIBRARY) -# define BODYMOVIN_EXPORT Q_DECL_EXPORT -#else -# define BODYMOVIN_EXPORT Q_DECL_IMPORT -#endif - -QT_BEGIN_NAMESPACE -QT_END_NAMESPACE - -#endif // BMGLOBAL_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/beziereasing_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/beziereasing_p.h deleted file mode 100644 index 4b3772eb2..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/beziereasing_p.h +++ /dev/null @@ -1,61 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BEZIEREASING_P_H -#define BEZIEREASING_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class BezierEasing -{ -public: - void addCubicBezierSegment(const QPointF &c1, const QPointF &c2, const QPointF &endPoint); - qreal valueForProgress(qreal progress) const; - -private: - qreal tForX(qreal x) const; - QBezier mBezier; -}; - -QT_END_NAMESPACE - -#endif // BEZIEREASING_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmasset_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmasset_p.h deleted file mode 100644 index 6eebeff53..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmasset_p.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMASSET_P_H -#define BMASSET_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class LottieRenderer; - -class BODYMOVIN_EXPORT BMAsset : public BMBase -{ -public: - BMAsset(BMBase *parent); - BMAsset(BMBase *parent, const BMAsset &other); - ~BMAsset() = default; - - BMAsset *clone(BMBase *parent) const override; - - static BMAsset *construct(BMBase *parent, QJsonObject definition); - - void parse(const QJsonObject &definition) override; - - void resolveAssets(const std::function &resolver) override; - - QString id() const; - -private: - QString m_id; - bool m_resolved = false; - -}; - -QT_END_NAMESPACE - -#endif // BMASSET_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmbase_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmbase_p.h deleted file mode 100644 index 9445fea7f..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmbase_p.h +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMBASE_P_H -#define BMBASE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include -#include - -#include - -#include - -QT_BEGIN_NAMESPACE - -class BMAsset; -class BMScene; - -class BODYMOVIN_EXPORT BMBase -{ -public: - BMBase(BMBase *parent); - BMBase(BMBase *parent, const BMBase &other); - BMBase(const BMBase &other) = delete; - virtual ~BMBase(); - - virtual BMBase *clone(BMBase *parent) const; - - QString name() const; - - int type() const; - void setType(int type); - virtual void parse(const QJsonObject &definition); - - virtual bool active(int frame) const; - bool hidden() const; - - inline BMBase *parent() const { return m_parent; } - - const QList &children() const { return m_children; } - void prependChild(BMBase *child); - void appendChild(BMBase *child); - - virtual BMBase *findChild(const QString &childName); - - virtual void updateProperties(int frame); - virtual void render(LottieRenderer &renderer, int frame) const; - - virtual void resolveAssets(const std::function &resolver); - -protected: - virtual BMScene *resolveTopRoot() const; - BMScene *topRoot() const; - -protected: - int m_type = 0; - bool m_hidden = false; - QString m_name; - QString m_matchName; - bool m_autoOrient = false; - - friend class BMRasterRenderer; - friend class BMRenderer; - -private: - BMBase * const m_parent = nullptr; - QList m_children; - - // Handle to the topmost element on which this element resides - // Will be resolved when traversing effects - mutable BMScene *m_topRoot = nullptr; -}; - -QT_END_NAMESPACE - -#endif // BMBASE_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmbasictransform_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmbasictransform_p.h deleted file mode 100644 index 5a9eac738..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmbasictransform_p.h +++ /dev/null @@ -1,89 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMBASICTRANSFORM_P_H -#define BMBASICTRANSFORM_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class BODYMOVIN_EXPORT BMBasicTransform : public BMShape -{ -public: - BMBasicTransform(BMBase *parent); - BMBasicTransform(BMBase *parent, const BMBasicTransform &other); - BMBasicTransform(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void parse(const QJsonObject &definition); - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - void clearOpacity(); - - QPointF anchorPoint() const; - virtual QPointF position() const; - QPointF scale() const; - qreal rotation() const; - qreal opacity() const; - -protected: - BMSpatialProperty m_anchorPoint; - bool m_splitPosition = false; - BMSpatialProperty m_position; - BMProperty m_xPos; - BMProperty m_yPos; - BMProperty2D m_scale; - BMProperty m_rotation; - BMProperty m_opacity; -}; - -QT_END_NAMESPACE - -#endif // BMBASICTRANSFORM_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmconstants_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmconstants_p.h deleted file mode 100644 index a510ee383..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmconstants_p.h +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMCONSTANTS_P_H -#define BMCONSTANTS_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include - -#define BM_LAYER_PRECOMP_IX 0x10000 -#define BM_LAYER_SOLID_IX 0x10001 -#define BM_LAYER_IMAGE_IX 0x10002 -#define BM_LAYER_NULL_IX 0x10004 -#define BM_LAYER_SHAPE_IX 0x10008 -#define BM_LAYER_TEXT_IX 0x1000f - -#define BM_EFFECT_FILL 0x20000 - -QT_BEGIN_NAMESPACE - -Q_DECLARE_LOGGING_CATEGORY(lcLottieQtBodymovinParser); -Q_DECLARE_LOGGING_CATEGORY(lcLottieQtBodymovinUpdate); -Q_DECLARE_LOGGING_CATEGORY(lcLottieQtBodymovinRender); -Q_DECLARE_LOGGING_CATEGORY(lcLottieQtBodymovinRenderThread); - -QT_END_NAMESPACE - -#endif // BMCONSTANTS_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmellipse_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmellipse_p.h deleted file mode 100644 index e206c8813..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmellipse_p.h +++ /dev/null @@ -1,86 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMELLIPSE_P_H -#define BMELLIPSE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class BODYMOVIN_EXPORT BMEllipse : public BMShape -{ -public: - BMEllipse(BMBase *parent); - BMEllipse(BMBase *parent, const BMEllipse &other); - BMEllipse(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void parse(const QJsonObject &definition); - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - bool acceptsTrim() const override; - - QPointF position() const; - QSizeF size() const; - -protected: - BMSpatialProperty m_position; - BMProperty2D m_size; -}; - -QT_END_NAMESPACE - -#endif // BMELLIPSE_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfill_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfill_p.h deleted file mode 100644 index 2ba1bae85..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfill_p.h +++ /dev/null @@ -1,75 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMFILL_P_H -#define BMFILL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class BODYMOVIN_EXPORT BMFill : public BMShape -{ -public: - BMFill(BMBase *parent); - BMFill(BMBase *parent, const BMFill &other); - BMFill(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void updateProperties(int frame) override; - - void render(LottieRenderer &renderer, int frame) const override; - - QColor color() const; - qreal opacity() const; - -protected: - BMProperty4D m_color; - BMProperty m_opacity; -}; - -QT_END_NAMESPACE - -#endif // BMFILL_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfilleffect_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfilleffect_p.h deleted file mode 100644 index 5921a9735..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfilleffect_p.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMFILLEFFECT_P_H -#define BMFILLEFFECT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class BODYMOVIN_EXPORT BMFillEffect : public BMBase -{ -public: - BMFillEffect(BMBase *parent); - BMFillEffect(BMBase *parent, const BMFillEffect &other); - BMFillEffect(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void parse(const QJsonObject &definition); - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - QColor color() const; - qreal opacity() const; - -protected: - BMProperty4D m_color; - BMProperty m_opacity; -}; - -QT_END_NAMESPACE - -#endif // BMFILLEFFECT_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfreeformshape_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfreeformshape_p.h deleted file mode 100644 index ce2548148..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmfreeformshape_p.h +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMFEEFORMSHAPE_P_H -#define BMFEEFORMSHAPE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class BODYMOVIN_EXPORT BMFreeFormShape : public BMShape -{ -public: - BMFreeFormShape(BMBase *parent); - BMFreeFormShape(BMBase *parent, const BMFreeFormShape &other); - BMFreeFormShape(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void parse(const QJsonObject &definition); - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - bool acceptsTrim() const override; - -protected: - struct VertexInfo { - BMProperty2D pos; - BMProperty2D ci; - BMProperty2D co; - }; - - void parseShapeKeyframes(QJsonObject &keyframes); - void buildShape(const QJsonObject &keyframe); - void buildShape(int frame); - void parseEasedVertices(const QJsonObject &keyframe, int startFrame); - - QHash m_vertexMap; - QList m_vertexList; - QMap m_closedShape; - -private: - struct VertexBuildInfo - { - QJsonArray posKeyframes; - QJsonArray ciKeyframes; - QJsonArray coKeyframes; - }; - - void finalizeVertices(); - - QMap m_vertexInfos; - - QJsonObject createKeyframe(QJsonArray startValue, QJsonArray endValue, - int startFrame, QJsonObject easingIn, - QJsonObject easingOut); -}; - -QT_END_NAMESPACE - -#endif // BMFEEFORMSHAPE_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmgfill_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmgfill_p.h deleted file mode 100644 index 93827bcc8..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmgfill_p.h +++ /dev/null @@ -1,91 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMGFILL_P_H -#define BMGFILL_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class BODYMOVIN_EXPORT BMGFill : public BMShape -{ -public: - BMGFill(BMBase *parent); - BMGFill(BMBase *parent, const BMGFill &other); - BMGFill(BMBase *parent, const QJsonObject &definition); - ~BMGFill() override; - - BMBase *clone(BMBase *parent) const override; - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - QGradient *value() const; - QGradient::Type gradientType() const; - QPointF startPoint() const; - QPointF endPoint() const; - qreal highlightLength() const; - qreal highlightAngle() const; - qreal opacity() const; - -private: - void setGradient(); - -protected: - BMProperty m_opacity; - BMSpatialProperty m_startPoint; - BMSpatialProperty m_endPoint; - BMProperty m_highlightLength; - BMProperty m_highlightAngle; - QList> m_colors; - QGradient *m_gradient = nullptr; - -}; - -QT_END_NAMESPACE - -#endif // BMGFILL_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmgroup_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmgroup_p.h deleted file mode 100644 index f554db088..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmgroup_p.h +++ /dev/null @@ -1,77 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMGROUP_P_H -#define BMGROUP_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class BMFill; -class BMTrimPath; -class BMPathTrimmer; - -class BODYMOVIN_EXPORT BMGroup : public BMShape -{ -public: - BMGroup(BMBase *parent); - BMGroup(BMBase *parent, const BMGroup &other); - BMGroup(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void parse(const QJsonObject& definition); - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - bool acceptsTrim() const override; - void applyTrim(const BMTrimPath &trimmer) override; -}; - -QT_END_NAMESPACE - -#endif // BMGROUP_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmlayer_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmlayer_p.h deleted file mode 100644 index 4c9207ca4..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmlayer_p.h +++ /dev/null @@ -1,110 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMLAYER_P_H -#define BMLAYER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -QT_BEGIN_NAMESPACE - -class LottieRenderer; -class BMMasks; - -class BODYMOVIN_EXPORT BMLayer : public BMBase -{ -public: - enum MatteClipMode {NoClip, Alpha, InvertedAlpha, Luminence, InvertedLuminence}; - - BMLayer(BMBase *parent); - BMLayer(BMBase *parent, const BMLayer &other); - ~BMLayer() override; - - static BMLayer *construct(BMBase *parent, QJsonObject definition); - - bool active(int frame) const override; - - void parse(const QJsonObject &definition) override; - - void updateProperties(int frame) override; - - BMBase *findChild(const QString &childName) override; - - bool isClippedLayer() const; - bool isMaskLayer() const; - MatteClipMode clipMode() const; - - int layerId() const; - void renderFullTransform(LottieRenderer &renderer, int frame) const; - -protected: - void renderEffects(LottieRenderer &renderer, int frame) const; - - virtual BMLayer *resolveLinkedLayer(); - virtual BMLayer *linkedLayer() const; - - int m_layerIndex = 0; - int m_startFrame; - int m_endFrame; - qreal m_startTime; - int m_blendMode; - bool m_3dLayer = false; - BMBase *m_effects = nullptr; - qreal m_stretch; - BMBasicTransform m_layerTransform; - BMMasks *m_masks = nullptr; - - int m_parentLayer = 0; - int m_td = 0; - MatteClipMode m_clipMode = NoClip; - - bool m_updated = false; - -private: - void parseEffects(const QJsonArray &definition, BMBase *effectRoot = nullptr); - void parseMasks(const QJsonArray &definition); - - BMLayer *m_linkedLayer = nullptr; -}; - -QT_END_NAMESPACE - -#endif // BMLAYER_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmmasks_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmmasks_p.h deleted file mode 100644 index 87053ae36..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmmasks_p.h +++ /dev/null @@ -1,69 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMMASKS_P_H -#define BMMASKS_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class BODYMOVIN_EXPORT BMMasks : public BMBase -{ -public: - BMMasks(BMBase *parent); - BMMasks(BMBase *parent, const BMMasks &other); - BMBase *clone(BMBase *parent) const override; - - void render(LottieRenderer &renderer, int frame) const override; - -}; - -QT_END_NAMESPACE - -#endif // BMMASKCLIP_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmmaskshape_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmmaskshape_p.h deleted file mode 100644 index ab79b6c87..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmmaskshape_p.h +++ /dev/null @@ -1,118 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMMASKSHAPE_P_H -#define BMMASKSHAPE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class BODYMOVIN_EXPORT BMMaskShape : public BMShape -{ -public: - BMMaskShape(BMBase *parent); - BMMaskShape(BMBase *parent, const BMMaskShape &other); - BMMaskShape(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void parse(const QJsonObject &definition); - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - enum class Mode { - Additive, - Intersect, - }; - - Mode mode() const; - - bool inverted() const; - -protected: - struct VertexInfo { - BMProperty2D pos; - BMProperty2D ci; - BMProperty2D co; - }; - - void parseShapeKeyframes(QJsonObject &keyframes); - void buildShape(const QJsonObject &keyframe); - void buildShape(int frame); - void parseEasedVertices(const QJsonObject &keyframe, int startFrame); - - QHash m_vertexMap; - QList m_vertexList; - QMap m_closedShape; - - bool m_inverted = false; - BMProperty m_opacity; - Mode m_mode = Mode::Additive; - -private: - struct VertexBuildInfo - { - QJsonArray posKeyframes; - QJsonArray ciKeyframes; - QJsonArray coKeyframes; - }; - - void finalizeVertices(); - - QMap m_vertexInfos; - - QJsonObject createKeyframe(QJsonArray startValue, QJsonArray endValue, - int startFrame, QJsonObject easingIn, - QJsonObject easingOut); -}; - -QT_END_NAMESPACE - -#endif // BMMASKSHAPE_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmnulllayer_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmnulllayer_p.h deleted file mode 100644 index c0c63cc88..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmnulllayer_p.h +++ /dev/null @@ -1,71 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMNULLLAYER_P_H -#define BMNULLLAYER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class LottieRenderer; -class BMShape; -class BMTrimPath; -class BMBasicTransform; - -class BODYMOVIN_EXPORT BMNullLayer final : public BMLayer -{ -public: - BMNullLayer(BMBase *parent); - BMNullLayer(BMBase *parent, const BMNullLayer &other); - BMNullLayer(BMBase *parent, const QJsonObject &definition); - ~BMNullLayer() override; - - BMBase *clone(BMBase *parent) const override; - - void render(LottieRenderer &render, int frame) const override; - -}; - -QT_END_NAMESPACE - -#endif // BMNULLLAYER_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmpathtrimmer_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmpathtrimmer_p.h deleted file mode 100644 index e507fb6d0..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmpathtrimmer_p.h +++ /dev/null @@ -1,78 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ -#ifndef BMPATHTRIMMER_P_H -#define BMPATHTRIMMER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; -class BMTrimPath; -class LottieRenderer; -class BMBase; -class BMShape; - -class BODYMOVIN_EXPORT BMPathTrimmer -{ -public: - BMPathTrimmer(BMBase *root); - - void addTrim(BMTrimPath* trim); - bool inUse() const; - - void applyTrim(BMShape *shape); - - void updateProperties(int frame); - void render(LottieRenderer &renderer, int frame) const; - -private: - BMBase *m_root = nullptr; - - QList m_trimPaths; - BMTrimPath *m_appliedTrim = nullptr; -}; - -QT_END_NAMESPACE - -#endif // BMPATHTRIMMER_P_H - diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmprecompasset_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmprecompasset_p.h deleted file mode 100644 index 5efbd56e4..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmprecompasset_p.h +++ /dev/null @@ -1,63 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMPRECOMPASSET_P_H -#define BMPRECOMPASSET_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class LottieRenderer; - -class BODYMOVIN_EXPORT BMPreCompAsset : public BMAsset -{ -public: - BMPreCompAsset(BMBase *parent); - BMPreCompAsset(BMBase *parent, const BMPreCompAsset &other); - BMPreCompAsset(BMBase *parent, const QJsonObject &definition); - ~BMPreCompAsset() = default; - - BMPreCompAsset *clone(BMBase *parent) const override; -}; - -QT_END_NAMESPACE - -#endif // BMPRECOMPASSET_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmprecomplayer_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmprecomplayer_p.h deleted file mode 100644 index 1786a2be6..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmprecomplayer_p.h +++ /dev/null @@ -1,80 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMPRECOMPLAYER_P_H -#define BMPRECOMPLAYER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class LottieRenderer; -class BMShape; -class BMTrimPath; -class BMBasicTransform; - -class BODYMOVIN_EXPORT BMPreCompLayer final : public BMLayer -{ -public: - BMPreCompLayer(BMBase *parent); - BMPreCompLayer(BMBase *parent, const BMPreCompLayer &other); - BMPreCompLayer(BMBase *parent, const QJsonObject &definition); - ~BMPreCompLayer() override; - - BMBase *clone(BMBase *parent) const override; - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - void resolveAssets(const std::function &resolver) override; - - QString refId() const; - -private: - QString m_refId; - BMBase *m_layers = nullptr; - bool m_resolving = false; - -}; - -QT_END_NAMESPACE - -#endif // BMPRECOMPLAYER_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmproperty_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmproperty_p.h deleted file mode 100644 index eea4a0ad8..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmproperty_p.h +++ /dev/null @@ -1,380 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMPROPERTY_P_H -#define BMPROPERTY_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -enum class EasingSegmentState : char { - Complete, - Incomplete, - Final, -}; - -template -struct EasingSegment { - EasingSegmentState state = EasingSegmentState::Incomplete; - double startFrame = 0; - double endFrame = 0; - T startValue; - T endValue; - BezierEasing easing; - - double bezierLength = 0.; - struct BezierPoint { - QPointF point; - double length = 0.; - }; - std::vector bezierPoints; -}; - -template -class BODYMOVIN_EXPORT BMProperty -{ -public: - virtual ~BMProperty() = default; - - void construct(const QJsonObject &definition) - { - if (definition.value(QStringLiteral("s")).toVariant().toInt()) - qCWarning(lcLottieQtBodymovinParser) - << "Property is split into separate x and y but it is not supported"; - - m_animated = definition.value(QStringLiteral("a")).toDouble() > 0; - if (m_animated) { - QJsonArray keyframes = definition.value(QStringLiteral("k")).toArray(); - QJsonArray::const_iterator it = keyframes.constBegin(); - QJsonArray::const_iterator previous; - while (it != keyframes.constEnd()) { - QJsonObject keyframe = (*it).toObject(); - EasingSegment easing = parseKeyframe(keyframe); - addEasing(easing); - - if (m_easingCurves.length() > 1) { - postprocessEasingCurve( - m_easingCurves[m_easingCurves.length() - 2], - (*previous).toObject()); - } - previous = it; - ++it; - } - finalizeEasingCurves(); - if (m_easingCurves.length() > 0) { - EasingSegment &last = m_easingCurves.last(); - if (last.state == EasingSegmentState::Complete) { - postprocessEasingCurve( - last, - (*previous).toObject()); - } - } - m_value = T(); - } else - m_value = getValue(definition.value(QStringLiteral("k"))); - } - - void setValue(const T& value) - { - m_value = value; - } - - const T& value() const - { - return m_value; - } - - bool animated() const { - return m_animated; - } - - virtual bool update(int frame) - { - if (!m_animated) - return false; - - int adjustedFrame = qBound(m_startFrame, frame, m_endFrame); - if (const EasingSegment *easing = getEasingSegment(adjustedFrame)) { - qreal progress; - if (easing->endFrame == easing->startFrame) - progress = 1; - else - progress = ((adjustedFrame - easing->startFrame) * 1.0) / - (easing->endFrame - easing->startFrame); - qreal easedValue = easing->easing.valueForProgress(progress); - m_value = easing->startValue + easedValue * - ((easing->endValue - easing->startValue)); - return true; - } - return false; - } - -protected: - void addEasing(EasingSegment& easing) - { - if (m_easingCurves.length()) { - EasingSegment &prevEase = m_easingCurves.last(); - // The end value has to be hand picked to the - // previous easing segment, as the json data does - // not contain end values for segments - prevEase.endFrame = easing.startFrame; - if (prevEase.state == EasingSegmentState::Incomplete) { - prevEase.endValue = easing.startValue; - prevEase.state = EasingSegmentState::Complete; - } - } - m_easingCurves.push_back(easing); - } - - void finalizeEasingCurves() - { - if (m_easingCurves.length()) { - EasingSegment &last = m_easingCurves.last(); - if (last.state == EasingSegmentState::Incomplete) { - last.endValue = last.startValue; - last.endFrame = last.startFrame; - this->m_endFrame = last.startFrame; - last.state = EasingSegmentState::Final; - } - } - } - - const EasingSegment* getEasingSegment(int frame) - { - // TODO: Improve with a faster search algorithm - const EasingSegment *easing = m_currentEasing; - if (!easing || easing->startFrame < frame || - easing->endFrame > frame) { - for (int i=0; i < m_easingCurves.length(); i++) { - if (m_easingCurves.at(i).startFrame <= frame && - m_easingCurves.at(i).endFrame >= frame) { - m_currentEasing = &m_easingCurves.at(i); - break; - } - } - } - - if (!m_currentEasing) { - qCWarning(lcLottieQtBodymovinParser) - << "Property is animated but easing cannot be found"; - } - return m_currentEasing; - } - - EasingSegment parseKeyframe(const QJsonObject keyframe) - { - EasingSegment easing; - - int startTime = keyframe.value(QStringLiteral("t")).toVariant().toInt(); - - // AE exported Bodymovin file includes the last - // key frame but no other properties. - // No need to process in that case - if (!keyframe.contains(QStringLiteral("s")) && !keyframe.contains(QStringLiteral("e"))) { - // In this case start time is the last frame for the property - this->m_endFrame = startTime; - easing.startFrame = startTime; - easing.endFrame = startTime; - easing.state = EasingSegmentState::Final; - if (m_easingCurves.length()) { - const EasingSegment &last = m_easingCurves.last(); - if (last.state == EasingSegmentState::Complete) { - easing.startValue = last.endValue; - easing.endValue = last.endValue; - } else { - qCWarning(lcLottieQtBodymovinParser()) - << "Last keyframe found after an incomplete one"; - } - } - return easing; - } - - if (m_startFrame > startTime) - m_startFrame = startTime; - - easing.startFrame = startTime; - easing.startValue = getValue(keyframe.value(QStringLiteral("s")).toArray()); - if (keyframe.contains(QStringLiteral("e"))) { - easing.endValue = getValue(keyframe.value(QStringLiteral("e")).toArray()); - easing.state = EasingSegmentState::Complete; - } - - QJsonObject easingIn = keyframe.value(QStringLiteral("i")).toObject(); - QJsonObject easingOut = keyframe.value(QStringLiteral("o")).toObject(); - - if (easingIn.value(QStringLiteral("x")).isArray()) { - qreal eix = easingIn.value(QStringLiteral("x")).toArray().at(0).toDouble(); - qreal eiy = easingIn.value(QStringLiteral("y")).toArray().at(0).toDouble(); - - qreal eox = easingOut.value(QStringLiteral("x")).toArray().at(0).toDouble(); - qreal eoy = easingOut.value(QStringLiteral("y")).toArray().at(0).toDouble(); - - QPointF c1 = QPointF(eox, eoy); - QPointF c2 = QPointF(eix, eiy); - - easing.easing.addCubicBezierSegment(c1, c2, QPointF(1.0, 1.0)); - } else { - qreal eix = easingIn.value(QStringLiteral("x")).toDouble(); - qreal eiy = easingIn.value(QStringLiteral("y")).toDouble(); - - qreal eox = easingOut.value(QStringLiteral("x")).toDouble(); - qreal eoy = easingOut.value(QStringLiteral("y")).toDouble(); - - QPointF c1 = QPointF(eox, eoy); - QPointF c2 = QPointF(eix, eiy); - - easing.easing.addCubicBezierSegment(c1, c2, QPointF(1.0, 1.0)); - } - - return easing; - } - - virtual void postprocessEasingCurve( - EasingSegment &easing, - const QJsonObject &keyframe) { - } - - virtual T getValue(const QJsonValue &value) - { - if (value.isArray()) - return getValue(value.toArray()); - else { - QVariant val = value.toVariant(); - if (val.canConvert()) { - T t = val.value(); - return t; - } - else - return T(); - } - } - - virtual T getValue(const QJsonArray &value) - { - QVariant val = value.at(0).toVariant(); - if (val.canConvert()) { - T t = val.value(); - return t; - } - else - return T(); - } - -protected: - bool m_animated = false; - QList> m_easingCurves; - const EasingSegment *m_currentEasing = nullptr; - int m_startFrame = INT_MAX; - int m_endFrame = 0; - T m_value = T(); -}; - -template -class BODYMOVIN_EXPORT BMProperty2D : public BMProperty -{ -protected: - T getValue(const QJsonArray &value) override - { - if (value.count() > 1) - return T(value.at(0).toDouble(), - value.at(1).toDouble()); - else - return T(); - } -}; - -template -class BODYMOVIN_EXPORT BMProperty4D : public BMProperty -{ -public: - bool update(int frame) override - { - if (!this->m_animated) - return false; - - int adjustedFrame = qBound(this->m_startFrame, frame, this->m_endFrame); - if (const EasingSegment *easing = BMProperty::getEasingSegment(adjustedFrame)) { - qreal progress; - if (easing->endFrame == easing->startFrame) - progress = 1; - else - progress = ((adjustedFrame - easing->startFrame) * 1.0) / - (easing->endFrame - easing->startFrame); - qreal easedValue = easing->easing.valueForProgress(progress); - // For the time being, 4D vectors are used only for colors, and - // the value must be restricted to between [0, 1] - easedValue = qBound(qreal(0.0), easedValue, qreal(1.0)); - T sv = easing->startValue; - T ev = easing->endValue; - qreal x = sv.x() + easedValue * (ev.x() - sv.x()); - qreal y = sv.y() + easedValue * (ev.y() - sv.y()); - qreal z = sv.z() + easedValue * (ev.z() - sv.z()); - qreal w = sv.w() + easedValue * (ev.w() - sv.w()); - this->m_value = T(x, y, z, w); - } - - return true; - } - -protected: - T getValue(const QJsonArray &value) override - { - if (value.count() > 3) - return T(value.at(0).toDouble(), value.at(1).toDouble(), - value.at(2).toDouble(), value.at(3).toDouble()); - else - return T(); - } -}; - -QT_END_NAMESPACE - -#endif // BMPROPERTY_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrect_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrect_p.h deleted file mode 100644 index a15964c7b..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrect_p.h +++ /dev/null @@ -1,82 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMRECT_P_H -#define BMRECT_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class BODYMOVIN_EXPORT BMRect : public BMShape -{ -public: - BMRect(BMBase *parent); - BMRect(BMBase *parent, const BMRect &other); - BMRect(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - bool acceptsTrim() const override; - - QPointF position() const; - QSizeF size() const; - qreal roundness() const; - -protected: - BMSpatialProperty m_position; - BMProperty2D m_size; - BMProperty m_roundness; -}; - -QT_END_NAMESPACE - -#endif // BMRECT_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrepeater_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrepeater_p.h deleted file mode 100644 index 50009d02d..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrepeater_p.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMREPEATER_P_H -#define BMREPEATER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class BODYMOVIN_EXPORT BMRepeater : public BMShape -{ -public: - BMRepeater(BMBase *parent); - BMRepeater(BMBase *parent, const BMRepeater &other); - BMRepeater(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void parse(const QJsonObject& definition); - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - int copies() const; - qreal offset() const; - const BMRepeaterTransform &transform() const; - -protected: - BMProperty m_copies; - BMProperty m_offset; - BMRepeaterTransform m_transform; -}; - -QT_END_NAMESPACE - -#endif // BMREPEATER_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrepeatertransform_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrepeatertransform_p.h deleted file mode 100644 index ee7bb3714..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmrepeatertransform_p.h +++ /dev/null @@ -1,79 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMREPEATERTRANSFORM_P_H -#define BMREPEATERTRANSFORM_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class BODYMOVIN_EXPORT BMRepeaterTransform : public BMBasicTransform -{ -public: - BMRepeaterTransform(BMBase *parent); - BMRepeaterTransform(BMBase *parent, const BMRepeaterTransform &other); - BMRepeaterTransform(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void parse(const QJsonObject &definition); - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - qreal startOpacity() const; - qreal endOpacity() const; - - void setInstanceCount(int copies); - qreal opacityAtInstance(int instance) const; - -protected: - int m_copies = 0; - BMProperty m_startOpacity; - BMProperty m_endOpacity; - QList m_opacities; -}; - -QT_END_NAMESPACE - -#endif // BMREPEATERTRANSFORM_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmround_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmround_p.h deleted file mode 100644 index b916eae01..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmround_p.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMROUND_P_H -#define BMROUND_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class BODYMOVIN_EXPORT BMRound : public BMShape -{ -public: - BMRound(BMBase *parent); - BMRound(BMBase *parent, const BMRound &other); - BMRound(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void parse(const QJsonObject &definition); - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - bool acceptsTrim() const override; - - QPointF position() const; - qreal radius() const; - -protected: - BMSpatialProperty m_position; - BMProperty m_radius; -}; - -QT_END_NAMESPACE - -#endif // BMROUND_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmscene_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmscene_p.h deleted file mode 100644 index 3749ba658..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmscene_p.h +++ /dev/null @@ -1,104 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMSCENE_P_H -#define BMSCENE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class BMAsset; - -class BODYMOVIN_EXPORT BMScene : public BMBase -{ -public: - BMScene(const BMScene &other) = delete; - BMScene &operator=(const BMScene &other) = delete; - explicit BMScene(const QJsonObject &definition); - virtual ~BMScene(); - - BMBase *clone(BMBase *parent) const override; - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - int startFrame() const; - int endFrame() const; - int frameRate() const; - int width() const; - int height() const; - -protected: - BMScene *resolveTopRoot() const override; - -private: - void parse(const QJsonObject &definition); - void resolveAllAssets(); - - std::vector> _assets; - QHash _assetIndexById; - - std::unique_ptr _blueprint; - std::unique_ptr _current; - - int _startFrame = 0; - int _endFrame = 0; - int _frameRate = 30; - int _width = 0; - int _height = 0; - QHash _markers; - - bool _unsupported = false; - - // Parsing stage. - bool _parsing = false; - -}; - -QT_END_NAMESPACE - -#endif // BMSCENE_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshape_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshape_p.h deleted file mode 100644 index c5dead038..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshape_p.h +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMSHAPE_P_H -#define BMSHAPE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class BMFill; -class BMStroke; -class BMTrimPath; - -#define BM_SHAPE_ANY_TYPE_IX -1 -#define BM_SHAPE_ELLIPSE_IX 0 -#define BM_SHAPE_FILL_IX 1 -#define BM_SHAPE_GFILL_IX 2 -#define BM_SHAPE_GSTROKE_IX 3 -#define BM_SHAPE_GROUP_IX 4 -#define BM_SHAPE_RECT_IX 5 -#define BM_SHAPE_ROUND_IX 6 -#define BM_SHAPE_SHAPE_IX 7 -#define BM_SHAPE_STAR_IX 8 -#define BM_SHAPE_STROKE_IX 9 -#define BM_SHAPE_TRIM_IX 10 -#define BM_SHAPE_TRANS_IX 11 -#define BM_SHAPE_REPEATER_IX 12 - -class BODYMOVIN_EXPORT BMShape : public BMBase -{ -public: - BMShape(BMBase *parent); - BMShape(BMBase *parent, const BMShape &other); - - BMBase *clone(BMBase *parent) const override; - - static BMShape *construct(BMBase *parent, QJsonObject definition); - - virtual const QPainterPath &path() const; - virtual bool acceptsTrim() const; - virtual void applyTrim(const BMTrimPath& trimmer); - - int direction() const; - -protected: - QPainterPath m_path; - BMTrimPath *m_appliedTrim = nullptr; - int m_direction = 0; -}; - -QT_END_NAMESPACE - -#endif // BMSHAPE_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshapelayer_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshapelayer_p.h deleted file mode 100644 index 9a9db1218..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshapelayer_p.h +++ /dev/null @@ -1,74 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMSHAPELAYER_P_H -#define BMSHAPELAYER_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class LottieRenderer; -class BMShape; -class BMTrimPath; -class BMBasicTransform; - -class BODYMOVIN_EXPORT BMShapeLayer final : public BMLayer -{ -public: - BMShapeLayer(BMBase *parent); - BMShapeLayer(BMBase *parent, const BMShapeLayer &other); - BMShapeLayer(BMBase *parent, const QJsonObject &definition); - ~BMShapeLayer() override; - - BMBase *clone(BMBase *parent) const override; - - void updateProperties(int frame) override; - void render(LottieRenderer &render, int frame) const override; - -private: - BMTrimPath *m_appliedTrim = nullptr; -}; - -QT_END_NAMESPACE - -#endif // BMSHAPELAYER_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshapetransform_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshapetransform_p.h deleted file mode 100644 index 139346cb1..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmshapetransform_p.h +++ /dev/null @@ -1,84 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMSHAPETRANSFORM_P_H -#define BMSHAPETRANSFORM_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -#include -#include -#include - -QT_BEGIN_NAMESPACE - -class QJsonObject; - -class BODYMOVIN_EXPORT BMShapeTransform : public BMBasicTransform -{ -public: - BMShapeTransform(BMBase *parent); - BMShapeTransform(BMBase *parent, const BMShapeTransform &other); - BMShapeTransform(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void parse(const QJsonObject &definition); - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - qreal skew() const; - qreal skewAxis() const; - qreal shearX() const; - qreal shearY() const; - qreal shearAngle() const; - -protected: - BMProperty m_skew; - BMProperty m_skewAxis; - qreal m_shearX; - qreal m_shearY; - qreal m_shearAngle; -}; - -QT_END_NAMESPACE - -#endif // BMSHAPETRANSFORM_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmspatialproperty_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmspatialproperty_p.h deleted file mode 100644 index 45bd7a9d0..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmspatialproperty_p.h +++ /dev/null @@ -1,141 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMSPATIALPROPERTY_P_H -#define BMSPATIALPROPERTY_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include - -QT_BEGIN_NAMESPACE - -class BMSpatialProperty : public BMProperty2D -{ -public: - virtual void postprocessEasingCurve( - EasingSegment &easing, - const QJsonObject &keyframe) override { - // No need to parse further incomplete keyframes (i.e. last keyframes) - if (easing.state != EasingSegmentState::Complete) { - return; - } - - qreal tix = 0, tiy = 0, tox = 0, toy = 0; - QJsonArray tiArr = keyframe.value(QStringLiteral("ti")).toArray(); - QJsonArray toArr = keyframe.value(QStringLiteral("to")).toArray(); - - if (tiArr.count() && toArr.count()) { - tix = tiArr.at(0).toDouble(); - tiy = tiArr.at(1).toDouble(); - tox = toArr.at(0).toDouble(); - toy = toArr.at(1).toDouble(); - } - QPointF s(easing.startValue); - QPointF e(easing.endValue); - QPointF c1(tox, toy); - QPointF c2(tix, tiy); - - c1 += s; - c2 += e; - - QBezier bezier = QBezier::fromPoints(s, c1, c2, e); - - const auto kCount = 150; - easing.bezierPoints.reserve(kCount); - for (auto k = 0; k < kCount; ++k) { - const auto percent = double(k) / (kCount - 1.); - auto point = EasingSegment::BezierPoint(); - point.point = bezier.pointAt(percent); - if (k > 0) { - const auto delta = (point.point - easing.bezierPoints[k - 1].point); - point.length = std::sqrt(QPointF::dotProduct(delta, delta)); - easing.bezierLength += point.length; - } - easing.bezierPoints.push_back(point); - } - } - - virtual bool update(int frame) override - { - if (!m_animated) - return false; - - int adjustedFrame = qBound(m_startFrame, frame, m_endFrame); - if (const EasingSegment *easing = getEasingSegment(adjustedFrame)) { - if (easing->state == EasingSegmentState::Complete) { - int length = (easing->endFrame - easing->startFrame); - qreal progress = (length > 0) - ? ((adjustedFrame - easing->startFrame) * 1.0) / length - : 1.; - qreal easedValue = easing->easing.valueForProgress(progress); - //m_value = easing->bezier.pointAtPercent(easedValue); - - const auto distance = easedValue * easing->bezierLength; - auto segmentPerc = 0.; - auto addedLength = 0.; - const auto count = easing->bezierPoints.size(); - for (auto j = 0; j != count; ++j) { - addedLength += easing->bezierPoints[j].length; - if (distance == 0. || easedValue == 0. || j == count - 1) { - m_value = easing->bezierPoints[j].point; - break; - } else if (distance >= addedLength && distance < addedLength + easing->bezierPoints[j + 1].length) { - segmentPerc = (distance - addedLength) / easing->bezierPoints[j + 1].length; - m_value = easing->bezierPoints[j].point + (easing->bezierPoints[j + 1].point - easing->bezierPoints[j].point) * segmentPerc; - break; - } - } - } else { - // In case of incomplete easing we should just take the final point. - //m_value = m_bezierPath.pointAtPercent(1.); - m_value = easing->endValue; - } - } - - return true; - } - -}; - -QT_END_NAMESPACE - -#endif // BMSPATIALPROPERTY_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmstroke_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmstroke_p.h deleted file mode 100644 index f655c4ed6..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmstroke_p.h +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMSTROKE_P_H -#define BMSTROKE_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class BODYMOVIN_EXPORT BMStroke : public BMShape -{ -public: - BMStroke(BMBase *parent); - BMStroke(BMBase *parent, const BMStroke &other); - BMStroke(BMBase *parent, const QJsonObject &definition); - - BMBase *clone(BMBase *parent) const override; - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - QPen pen() const; - qreal opacity() const; - -protected: - QColor getColor() const; - -protected: - BMProperty m_opacity; - BMProperty m_width; - BMProperty4D m_color; - Qt::PenCapStyle m_capStyle; - Qt::PenJoinStyle m_joinStyle; - qreal m_miterLimit = 0.; -}; - -QT_END_NAMESPACE - -#endif // BMSTROKE_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmtrimpath_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmtrimpath_p.h deleted file mode 100644 index 99898537d..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/bmtrimpath_p.h +++ /dev/null @@ -1,87 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef BMTRIMPATH_P_H -#define BMTRIMPATH_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include -#include - -#include -#include - -QT_BEGIN_NAMESPACE - -class BODYMOVIN_EXPORT BMTrimPath : public BMShape -{ -public: - BMTrimPath(BMBase *parent); - BMTrimPath(BMBase *parent, const BMTrimPath &other); - BMTrimPath(BMBase *parent, const QJsonObject &definition); - - void inherit(const BMTrimPath &other); - - BMBase *clone(BMBase *parent) const override; - - void parse(const QJsonObject &definition); - - void updateProperties(int frame) override; - void render(LottieRenderer &renderer, int frame) const override; - - bool acceptsTrim() const override; - void applyTrim(const BMTrimPath &trimmer) override; - - qreal start() const; - qreal end() const; - qreal offset() const; - bool simultaneous() const; - - QPainterPath trim(const QPainterPath &path) const; - -protected: - BMProperty m_start; - BMProperty m_end; - BMProperty m_offset; - bool m_simultaneous = false; -}; - -QT_END_NAMESPACE - -#endif // BMTRIMPATH_P_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/lottierenderer_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/lottierenderer_p.h deleted file mode 100644 index 486eaa38f..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/lottierenderer_p.h +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef LOTTIERENDERER_H -#define LOTTIERENDERER_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -#include "bmglobal.h" - -QT_BEGIN_NAMESPACE - -class BMBase; -class BMLayer; -class BMRect; -class BMFill; -class BMGFill; -class BMStroke; -class BMBasicTransform; -class BMLayerTransform; -class BMShapeTransform; -class BMRepeaterTransform; -class BMShapeLayer; -class BMEllipse; -class BMRound; -class BMFreeFormShape; -class BMTrimPath; -class BMFillEffect; -class BMRepeater; - -class BMMasks; -class BMMaskShape; - -class BODYMOVIN_EXPORT LottieRenderer -{ -public: - enum TrimmingState{Off = 0, Simultaneous, Individual}; - - virtual ~LottieRenderer() = default; - - virtual void saveState() = 0; - virtual void restoreState() = 0; - - virtual void setTrimmingState(TrimmingState state); - virtual TrimmingState trimmingState() const; - - virtual void startMergeGeometry() = 0; - virtual void renderMergedGeometry() = 0; - - virtual void render(const BMLayer &layer) = 0; - virtual void render(const BMRect &rect) = 0; - virtual void render(const BMEllipse &ellipse) = 0; - virtual void render(const BMRound &round) = 0; - virtual void render(const BMFill &fill) = 0; - virtual void render(const BMGFill &fill) = 0; - virtual void render(const BMStroke &stroke) = 0; - virtual void render(const BMBasicTransform &trans) = 0; - virtual void render(const BMShapeTransform &trans) = 0; - virtual void render(const BMFreeFormShape &shape) = 0; - virtual void render(const BMTrimPath &trans) = 0; - virtual void render(const BMFillEffect &effect) = 0; - virtual void render(const BMRepeater &repeater) = 0; - - virtual void render(const BMMaskShape &shape) = 0; - virtual void render(const BMMasks &masks) = 0; - -protected: - void saveTrimmingState(); - void restoreTrimmingState(); - - TrimmingState m_trimmingState = Off; - -private: - QStack m_trimStateStack; -}; - -QT_END_NAMESPACE - -#endif // LOTTIERENDERER_H diff --git a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/trimpath_p.h b/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/trimpath_p.h deleted file mode 100644 index 5aac2d069..000000000 --- a/Telegram/ThirdParty/qtlottie_helper/QtBodymovin/private/trimpath_p.h +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the lottie-qt module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TRIMPATH_P_H -#define TRIMPATH_P_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -QT_BEGIN_NAMESPACE - -class TrimPath { -public: - TrimPath() = default; - TrimPath(const QPainterPath &path) - : mPath(path) {} - TrimPath(const TrimPath &other) - : mPath(other.mPath), mLens(other.mLens) {} - ~TrimPath() {} - - void setPath(const QPainterPath &path) { - mPath = path; - mLens.clear(); - } - - QPainterPath path() const { - return mPath; - } - - QPainterPath trimmed(qreal f1, qreal f2, qreal offset = 0.0) const; - -private: - bool lensIsDirty() const { - return mLens.size() != mPath.elementCount(); - } - void updateLens() const; - int elementAtLength(qreal len) const; - QPointF endPointOfElement(int elemIdx) const; - void appendTrimmedElement(QPainterPath *to, int elemIdx, bool trimStart, qreal startLen, bool trimEnd, qreal endLen) const; - void appendStartOfElement(QPainterPath *to, int elemIdx, qreal len) const { - appendTrimmedElement(to, elemIdx, false, 0.0, true, len); - } - void appendEndOfElement(QPainterPath *to, int elemIdx, qreal len) const { - appendTrimmedElement(to, elemIdx, true, len, false, 1.0); - } - - void appendElementRange(QPainterPath *to, int first, int last) const; - - QPainterPath mPath; - mutable QVector mLens; -}; - -QT_END_NAMESPACE - -Q_DECLARE_METATYPE(TrimPath); - -#endif // TRIMPATH_P_H diff --git a/Telegram/gyp/lib_lottie.gyp b/Telegram/gyp/lib_lottie.gyp index 83ef24c5d..29b1f28f6 100644 --- a/Telegram/gyp/lib_lottie.gyp +++ b/Telegram/gyp/lib_lottie.gyp @@ -84,32 +84,31 @@ '<(lottie_loc)/bodymovin/bmrepeatertransform.cpp', '<(lottie_loc)/bodymovin/beziereasing.cpp', - '<(lottie_loc)/bodymovin/beziereasing_p.h', - '<(lottie_loc)/bodymovin/bmbase_p.h', - '<(lottie_loc)/bodymovin/bmbasictransform_p.h', - '<(lottie_loc)/bodymovin/bmconstants_p.h', - '<(lottie_loc)/bodymovin/bmellipse_p.h', - '<(lottie_loc)/bodymovin/bmfill_p.h', - '<(lottie_loc)/bodymovin/bmfilleffect_p.h', - '<(lottie_loc)/bodymovin/bmfreeformshape_p.h', - '<(lottie_loc)/bodymovin/bmgfill_p.h', - '<(lottie_loc)/bodymovin/bmgroup_p.h', - '<(lottie_loc)/bodymovin/bmlayer_p.h', - '<(lottie_loc)/bodymovin/bmproperty_p.h', - '<(lottie_loc)/bodymovin/bmrect_p.h', - '<(lottie_loc)/bodymovin/bmrepeater_p.h', - '<(lottie_loc)/bodymovin/bmrepeatertransform_p.h', - '<(lottie_loc)/bodymovin/bmround_p.h', - '<(lottie_loc)/bodymovin/bmshape_p.h', - '<(lottie_loc)/bodymovin/bmshapelayer_p.h', - '<(lottie_loc)/bodymovin/bmshapetransform_p.h', - '<(lottie_loc)/bodymovin/bmspatialproperty_p.h', - '<(lottie_loc)/bodymovin/bmstroke_p.h', - '<(lottie_loc)/bodymovin/bmtrimpath_p.h', - '<(lottie_loc)/bodymovin/trimpath_p.h', - '<(lottie_loc)/bodymovin/lottierenderer_p.h', - '<(lottie_loc)/bodymovin/bmpathtrimmer_p.h', - '<(lottie_loc)/bodymovin/bmglobal.h', + '<(lottie_loc)/bodymovin/beziereasing.h', + '<(lottie_loc)/bodymovin/bmbase.h', + '<(lottie_loc)/bodymovin/bmbasictransform.h', + '<(lottie_loc)/bodymovin/bmconstants.h', + '<(lottie_loc)/bodymovin/bmellipse.h', + '<(lottie_loc)/bodymovin/bmfill.h', + '<(lottie_loc)/bodymovin/bmfilleffect.h', + '<(lottie_loc)/bodymovin/bmfreeformshape.h', + '<(lottie_loc)/bodymovin/bmgfill.h', + '<(lottie_loc)/bodymovin/bmgroup.h', + '<(lottie_loc)/bodymovin/bmlayer.h', + '<(lottie_loc)/bodymovin/bmproperty.h', + '<(lottie_loc)/bodymovin/bmrect.h', + '<(lottie_loc)/bodymovin/bmrepeater.h', + '<(lottie_loc)/bodymovin/bmrepeatertransform.h', + '<(lottie_loc)/bodymovin/bmround.h', + '<(lottie_loc)/bodymovin/bmshape.h', + '<(lottie_loc)/bodymovin/bmshapelayer.h', + '<(lottie_loc)/bodymovin/bmshapetransform.h', + '<(lottie_loc)/bodymovin/bmspatialproperty.h', + '<(lottie_loc)/bodymovin/bmstroke.h', + '<(lottie_loc)/bodymovin/bmtrimpath.h', + '<(lottie_loc)/bodymovin/trimpath.h', + '<(lottie_loc)/bodymovin/lottierenderer.h', + '<(lottie_loc)/bodymovin/bmpathtrimmer.h', # taken from qtlottie/src/imports/imports.pro '<(lottie_loc)/imports/rasterrenderer/lottierasterrenderer.cpp', @@ -125,13 +124,13 @@ '<(lottie_loc)/bodymovin/bmmasks.cpp', '<(lottie_loc)/bodymovin/bmmaskshape.cpp', - '<(lottie_loc)/bodymovin/bmasset_p.h', - '<(lottie_loc)/bodymovin/bmprecompasset_p.h', - '<(lottie_loc)/bodymovin/bmnulllayer_p.h', - '<(lottie_loc)/bodymovin/bmprecomplayer_p.h', - '<(lottie_loc)/bodymovin/bmscene_p.h', - '<(lottie_loc)/bodymovin/bmmasks_p.h', - '<(lottie_loc)/bodymovin/bmmaskshape_p.h', + '<(lottie_loc)/bodymovin/bmasset.h', + '<(lottie_loc)/bodymovin/bmprecompasset.h', + '<(lottie_loc)/bodymovin/bmnulllayer.h', + '<(lottie_loc)/bodymovin/bmprecomplayer.h', + '<(lottie_loc)/bodymovin/bmscene.h', + '<(lottie_loc)/bodymovin/bmmasks.h', + '<(lottie_loc)/bodymovin/bmmaskshape.h', ], 'conditions': [[ 'build_macold', { 'xcode_settings': { diff --git a/Telegram/gyp/lottie_helper.bat b/Telegram/gyp/lottie_helper.bat deleted file mode 100644 index 3ba908832..000000000 --- a/Telegram/gyp/lottie_helper.bat +++ /dev/null @@ -1,13 +0,0 @@ -@echo OFF - -setlocal enabledelayedexpansion -set "FullScriptPath=%~dp0" - -python %FullScriptPath%lottie_helper.py -if %errorlevel% neq 0 goto error - -exit /b - -:error -echo FAILED -exit /b 1 diff --git a/Telegram/gyp/lottie_helper.py b/Telegram/gyp/lottie_helper.py deleted file mode 100644 index 5377144c0..000000000 --- a/Telegram/gyp/lottie_helper.py +++ /dev/null @@ -1,34 +0,0 @@ -''' -This file is part of Telegram Desktop, -the official desktop application for the Telegram messaging service. - -For license and copyright information please follow this link: -https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL -''' -import sys, os, re, subprocess, shutil - -def finish(code): - global executePath - os.chdir(executePath) - sys.exit(code) - -if sys.platform == 'win32' and not 'COMSPEC' in os.environ: - print('[ERROR] COMSPEC environment variable is not set.') - finish(1) - -executePath = os.getcwd() -scriptPath = os.path.dirname(os.path.realpath(__file__)) -src = scriptPath + '/../ThirdParty/qtlottie/src/bodymovin' -dst = scriptPath + '/../ThirdParty/qtlottie_helper/QtBodymovin' - -shutil.rmtree(dst, ignore_errors=True) -os.makedirs(dst + '/private') - -for r, d, f in os.walk(src): - for file in f: - if re.search(r'_p\.h$', file): - shutil.copyfile(src + '/' + file, dst + '/private/' + file) - elif re.search(r'\.h$', file): - shutil.copyfile(src + '/' + file, dst + '/' + file) - -finish(0)