7#include <PhosphorAnimation/phosphoranimation_export.h>
11#include <QtCore/QObject>
12#include <QtCore/QString>
13#include <QtQml/qqmlregistration.h>
49 QML_VALUE_TYPE(phosphorCurve)
54 Q_PROPERTY(QString typeId READ typeId)
59 : m_curve(std::move(curve))
64 std::shared_ptr<const Curve>
curve()
const
73 return m_curve ? m_curve->typeId() : QString();
79 return m_curve ? m_curve->toString() : QString();
108 return s_registry.load(std::memory_order_acquire);
133 if (m_curve == other.m_curve) {
136 if (!m_curve || !other.m_curve) {
139 return m_curve->equals(*other.m_curve);
143 return !(*
this == other);
155 static std::atomic<CurveRegistry*> s_registry;
156 std::shared_ptr<const Curve> m_curve;
String-id <-> curve factory registry.
Definition CurveRegistry.h:22
Opaque QML value-type wrapper around shared_ptr<const Curve>.
Definition PhosphorCurve.h:47
static PhosphorCurve fromSpring(const PhosphorSpring &spring)
Wrap a Spring value as a polymorphic PhosphorCurve.
static PhosphorCurve fromEasing(const PhosphorEasing &easing)
Wrap an Easing value as a polymorphic PhosphorCurve.
bool isNull() const
Null-handle check for QML code: if (!curve.isNull()) ....
Definition PhosphorCurve.h:83
bool operator!=(const PhosphorCurve &other) const
Definition PhosphorCurve.h:141
static void setDefaultRegistry(CurveRegistry *registry)
Set the process-wide default CurveRegistry used by fromString.
bool operator==(const PhosphorCurve &other) const
Equality compares via Curve::equals so curves with floating-point parameters compare tightly rather t...
Definition PhosphorCurve.h:131
std::shared_ptr< const Curve > curve() const
The wrapped pointer. May be null on a default-constructed handle.
Definition PhosphorCurve.h:64
QString typeId() const
Stable curve type-id string ("cubic-bezier", "spring", "elastic-out", …).
Definition PhosphorCurve.h:71
static CurveRegistry * defaultRegistry()
Read-only view of the process-wide default CurveRegistry pointer installed via setDefaultRegistry.
Definition PhosphorCurve.h:106
static PhosphorCurve fromString(const QString &str)
Parse via CurveRegistry — handles every curve type the registry knows, including user-authored curves...
PhosphorCurve(std::shared_ptr< const Curve > curve)
Definition PhosphorCurve.h:58
QString toString() const
Serialize to wire format. Empty when null.
Definition PhosphorCurve.h:77
QML value-type wrapper around PhosphorAnimation::Easing.
Definition PhosphorEasing.h:38
QML value-type wrapper around PhosphorAnimation::Spring.
Definition PhosphorSpring.h:28
Definition AnimatedValue.h:31