Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorAnimation::PhosphorEasing Class Reference

QML value-type wrapper around PhosphorAnimation::Easing. More...

#include <phosphor-animation/include/PhosphorAnimation/PhosphorEasing.h>

Public Types

enum class  Type : int {
  CubicBezier = int(Easing::Type::CubicBezier) , ElasticIn = int(Easing::Type::ElasticIn) , ElasticOut = int(Easing::Type::ElasticOut) , ElasticInOut = int(Easing::Type::ElasticInOut) ,
  BounceIn = int(Easing::Type::BounceIn) , BounceOut = int(Easing::Type::BounceOut) , BounceInOut = int(Easing::Type::BounceInOut)
}
 

Public Member Functions

 PhosphorEasing ()=default
 
 PhosphorEasing (const Easing &value)
 Implicit-conversion ctor so core-library code can hand a bare Easing value into the QML boundary without a wrapping call.
 
const Easingvalue () const
 Read-only access to the underlying value.
 
Type type () const
 
void setType (Type t)
 
qreal x1 () const
 
void setX1 (qreal v)
 
qreal y1 () const
 
void setY1 (qreal v)
 
qreal x2 () const
 
void setX2 (qreal v)
 
qreal y2 () const
 
void setY2 (qreal v)
 
qreal amplitude () const
 
void setAmplitude (qreal v)
 
qreal period () const
 
void setPeriod (qreal v)
 
int bounces () const
 
void setBounces (int v)
 
QString toString () const
 Canonical wire format from PhosphorAnimation::Easing::toString.
 
bool operator== (const PhosphorEasing &other) const
 
bool operator!= (const PhosphorEasing &other) const
 

Static Public Member Functions

static PhosphorEasing fromString (const QString &str)
 Parse the same wire format.
 

Detailed Description

QML value-type wrapper around PhosphorAnimation::Easing.

Q_GADGET per Phase 4 decision O — value semantics (stack-allocated, copy-constructible, snapshot at bind time). Used as a property shape inside PhosphorProfile { curve: PhosphorEasing { type: ... } } and as a structured literal for PhosphorMotionAnimation.profile.

Every parameter is mirrored to a Q_PROPERTY delegating to the underlying Easing value. The enum is re-exported as Type so QML can reference PhosphorEasing.CubicBezier etc. without knowing the underlying nested enum.

Serialization

fromString / toString round-trip through the C++ Easing wire format — no QML-specific form. A config that has a curve string can be reconstituted with PhosphorEasing.fromString(str) in QML.

Member Enumeration Documentation

◆ Type

enum class PhosphorAnimation::PhosphorEasing::Type : int
strong
Enumerator
CubicBezier 
ElasticIn 
ElasticOut 
ElasticInOut 
BounceIn 
BounceOut 
BounceInOut 

Constructor & Destructor Documentation

◆ PhosphorEasing() [1/2]

PhosphorAnimation::PhosphorEasing::PhosphorEasing ( )
default

◆ PhosphorEasing() [2/2]

PhosphorAnimation::PhosphorEasing::PhosphorEasing ( const Easing value)
inlineexplicit

Implicit-conversion ctor so core-library code can hand a bare Easing value into the QML boundary without a wrapping call.

Member Function Documentation

◆ amplitude()

qreal PhosphorAnimation::PhosphorEasing::amplitude ( ) const
inline

◆ bounces()

int PhosphorAnimation::PhosphorEasing::bounces ( ) const
inline

◆ fromString()

static PhosphorEasing PhosphorAnimation::PhosphorEasing::fromString ( const QString &  str)
inlinestatic

Parse the same wire format.

Invalid input yields a default- constructed (OutCubic bezier) PhosphorEasing, matching the core library's fault-tolerant parse contract.

◆ operator!=()

bool PhosphorAnimation::PhosphorEasing::operator!= ( const PhosphorEasing other) const
inline

◆ operator==()

bool PhosphorAnimation::PhosphorEasing::operator== ( const PhosphorEasing other) const
inline

◆ period()

qreal PhosphorAnimation::PhosphorEasing::period ( ) const
inline

◆ setAmplitude()

void PhosphorAnimation::PhosphorEasing::setAmplitude ( qreal  v)
inline

◆ setBounces()

void PhosphorAnimation::PhosphorEasing::setBounces ( int  v)
inline

◆ setPeriod()

void PhosphorAnimation::PhosphorEasing::setPeriod ( qreal  v)
inline

◆ setType()

void PhosphorAnimation::PhosphorEasing::setType ( Type  t)
inline

◆ setX1()

void PhosphorAnimation::PhosphorEasing::setX1 ( qreal  v)
inline

◆ setX2()

void PhosphorAnimation::PhosphorEasing::setX2 ( qreal  v)
inline

◆ setY1()

void PhosphorAnimation::PhosphorEasing::setY1 ( qreal  v)
inline

◆ setY2()

void PhosphorAnimation::PhosphorEasing::setY2 ( qreal  v)
inline

◆ toString()

QString PhosphorAnimation::PhosphorEasing::toString ( ) const
inline

Canonical wire format from PhosphorAnimation::Easing::toString.

◆ type()

Type PhosphorAnimation::PhosphorEasing::type ( ) const
inline

◆ value()

const Easing & PhosphorAnimation::PhosphorEasing::value ( ) const
inline

Read-only access to the underlying value.

The non-const overload was deliberately removed: a mutable handle from QML let scripts bypass the setter clamps below by writing directly into the underlying Easing fields. Core-library mutators construct a fresh Easing and assign through the implicit-conversion ctor.

◆ x1()

qreal PhosphorAnimation::PhosphorEasing::x1 ( ) const
inline

◆ x2()

qreal PhosphorAnimation::PhosphorEasing::x2 ( ) const
inline

◆ y1()

qreal PhosphorAnimation::PhosphorEasing::y1 ( ) const
inline

◆ y2()

qreal PhosphorAnimation::PhosphorEasing::y2 ( ) const
inline

The documentation for this class was generated from the following file: