Opaque QML value-type wrapper around shared_ptr<const Curve>.
More...
#include <phosphor-animation/include/PhosphorAnimation/PhosphorCurve.h>
Public Member Functions | |
| PhosphorCurve ()=default | |
| PhosphorCurve (std::shared_ptr< const Curve > curve) | |
| std::shared_ptr< const Curve > | curve () const |
| The wrapped pointer. May be null on a default-constructed handle. | |
| QString | typeId () const |
| Stable curve type-id string ("cubic-bezier", "spring", "elastic-out", …). | |
| QString | toString () const |
| Serialize to wire format. Empty when null. | |
| bool | isNull () const |
Null-handle check for QML code: if (!curve.isNull()) .... | |
| bool | operator== (const PhosphorCurve &other) const |
Equality compares via Curve::equals so curves with floating-point parameters compare tightly rather than through the string form. | |
| bool | operator!= (const PhosphorCurve &other) const |
Static Public Member Functions | |
| static void | setDefaultRegistry (CurveRegistry *registry) |
Set the process-wide default CurveRegistry used by fromString. | |
| static CurveRegistry * | defaultRegistry () |
Read-only view of the process-wide default CurveRegistry pointer installed via setDefaultRegistry. | |
| static PhosphorCurve | fromString (const QString &str) |
Parse via CurveRegistry — handles every curve type the registry knows, including user-authored curves registered by CurveLoader. | |
| static PhosphorCurve | fromEasing (const PhosphorEasing &easing) |
Wrap an Easing value as a polymorphic PhosphorCurve. | |
| static PhosphorCurve | fromSpring (const PhosphorSpring &spring) |
Wrap a Spring value as a polymorphic PhosphorCurve. | |
Opaque QML value-type wrapper around shared_ptr<const Curve>.
Q_GADGET per Phase 4 decision O. Holds a polymorphic curve reference without exposing the Curve hierarchy to QML — plugin authors who only need to pass a curve through the system (curve → Profile → PhosphorMotionAnimation) can use PhosphorCurve as an opaque token, while authors that need specific parameters construct PhosphorEasing / PhosphorSpring directly.
Serialization round-trips through CurveRegistry — a PhosphorCurve constructed from a string resolves whatever curve type the registry knows about (including third-party curves registered via CurveRegistry::registerFactory, which is how Phase 4's CurveLoader extends the known set from user-authored JSON).
The wrapped shared_ptr<const Curve> is immutable — consistent with the Curve contract that subclasses must not be mutated after construction. Mutating needs a rebuild (PhosphorCurve::fromEasing(...), fromSpring(...), or fromString(...)) which replaces the stored pointer.
|
default |
|
inlineexplicit |
|
inline |
The wrapped pointer. May be null on a default-constructed handle.
|
inlinestatic |
Read-only view of the process-wide default CurveRegistry pointer installed via setDefaultRegistry.
Returns nullptr when no registry has been published yet. Used by PhosphorProfile:: fromJson to route parse requests through the same user-curve- aware registry that fromString consults — without this shared accessor, fromJson would see only built-ins via its function-local static registry and user-authored curves registered by CurveLoader::setDefaultRegistry would silently fail to resolve.
|
static |
Wrap an Easing value as a polymorphic PhosphorCurve.
Allocates a shared_ptr<Easing> copy of the value.
|
static |
Wrap a Spring value as a polymorphic PhosphorCurve.
|
static |
Parse via CurveRegistry — handles every curve type the registry knows, including user-authored curves registered by CurveLoader.
Returns a null-handle PhosphorCurve on parse failure (check via isNull()).
|
inline |
Null-handle check for QML code: if (!curve.isNull()) ....
|
inline |
|
inline |
Equality compares via Curve::equals so curves with floating-point parameters compare tightly rather than through the string form.
|
static |
Set the process-wide default CurveRegistry used by fromString.
Must be called by the composition root (daemon / editor) before any QML code invokes fromString. The pointer must outlive all QML usage (typically a member of the daemon). When null, fromString returns a null-handle PhosphorCurve.
|
inline |
Serialize to wire format. Empty when null.
|
inline |
Stable curve type-id string ("cubic-bezier", "spring", "elastic-out", …).
Empty when the handle is null.