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

Namespaces

namespace  detail
 
namespace  Limits
 
namespace  ProfilePaths
 Dot-path constants for well-known animation events.
 
namespace  SnapPolicy
 Snap-animation policy gate — decides if a transition merits animation and builds a MotionSpec<QRectF> for AnimatedValue::start().
 

Classes

class  AnimatedValue
 Unified motion primitive: one value of type T transitioning from start to target over time, driven by a curve and a clock. More...
 
class  AnimationUniformExtension
 IUniformExtension that appends animation-shader spatial uniforms after PhosphorShaders::BaseUniforms in the UBO. More...
 
class  Curve
 Polymorphic base for all animation curves. More...
 
class  CurveLoader
 Scans JSON curve-definition files and registers them with CurveRegistry. More...
 
class  CurveRegistry
 String-id <-> curve factory registry. More...
 
struct  CurveState
 Mutable state for stateful curve progression (springs carry position+velocity across frames; stateless curves share the struct for uniform caller treatment). More...
 
class  Easing
 Parametric easing curve: cubic bezier, elastic, or bounce. More...
 
class  IMotionClock
 Abstract clock interface for the motion runtime. More...
 
struct  Interpolate
 Type-specific linear interpolation and path-distance for AnimatedValue<T>. More...
 
struct  Interpolate< QColor >
 
struct  Interpolate< QPointF >
 
struct  Interpolate< qreal >
 
struct  Interpolate< QRectF >
 
struct  Interpolate< QSizeF >
 
struct  Interpolate< QTransform >
 
struct  MotionSpec
 Runtime call-site bundle for starting an AnimatedValue<T>. More...
 
class  PhosphorCurve
 Opaque QML value-type wrapper around shared_ptr<const Curve>. More...
 
class  PhosphorEasing
 QML value-type wrapper around PhosphorAnimation::Easing. More...
 
class  PhosphorMotionAnimation
 QQuickPropertyAnimation subclass driving property animation with a phosphor-animation Profile. More...
 
class  PhosphorProfile
 QML value-type wrapper around PhosphorAnimation::Profile. More...
 
class  PhosphorProfileRegistry
 Registry mapping profile path strings to Profile values. More...
 
class  PhosphorSpring
 QML value-type wrapper around PhosphorAnimation::Spring. More...
 
class  Profile
 Configuration for a single animation event. More...
 
class  ProfileLoader
 Scans JSON profile-definition files and registers them with PhosphorProfileRegistry. More...
 
class  ProfileTree
 Hierarchical profile storage with walk-up inheritance. More...
 
class  QtQuickClock
 Qt Quick adapter implementing IMotionClock. More...
 
class  QtQuickClockManager
 Enforces "one QtQuickClock per QQuickWindow" within a single composition-root-owned manager instance. More...
 
class  Spring
 Damped harmonic oscillator. More...
 

Typedefs

using LiveReload = PhosphorFsLoader::LiveReload
 

Enumerations

enum class  ColorSpace { Linear , OkLab }
 Interpolation space selector for AnimatedValue<QColor, ...>. More...
 
enum class  SequenceMode : int { AllAtOnce = 0 , Cascade = 1 }
 How a batch of animations starts. Numeric values match the historical wire format. More...
 
enum class  RetargetPolicy { PreserveVelocity , ResetVelocity , PreservePosition }
 How an in-flight AnimatedValue<T> reshapes on retarget(). More...
 

Functions

PHOSPHORANIMATION_EXPORT std::shared_ptr< const CurvedefaultFallbackCurve ()
 
PHOSPHORANIMATION_EXPORT void applyStaggeredOrImmediate (QObject *parent, int count, SequenceMode sequenceMode, int staggerInterval, const std::function< void(int)> &applyFn, const std::function< void()> &onComplete=nullptr)
 Apply a sequence of operations, optionally cascaded with stagger.
 

Variables

constexpr qreal kRectSizeEpsilonPx = 1.0
 Sub-pixel epsilon for rect size-change detection.
 

Typedef Documentation

◆ LiveReload

Enumeration Type Documentation

◆ ColorSpace

enum class PhosphorAnimation::ColorSpace
strong

Interpolation space selector for AnimatedValue<QColor, ...>.

Enumerator
Linear 

sRGB -> linear lerp -> sRGB (radiometrically correct)

OkLab 

sRGB -> OkLab lerp -> sRGB (perceptually uniform)

◆ RetargetPolicy

How an in-flight AnimatedValue<T> reshapes on retarget().

Enumerator
PreserveVelocity 

Carry velocity across the segment boundary, re-scaled to the new distance. Default.

ResetVelocity 

Zero velocity on retarget; motion restarts from rest toward the new target.

PreservePosition 

Position-continuous only; velocity treatment delegated to the curve's natural behaviour.

◆ SequenceMode

enum class PhosphorAnimation::SequenceMode : int
strong

How a batch of animations starts. Numeric values match the historical wire format.

Enumerator
AllAtOnce 
Cascade 

Function Documentation

◆ applyStaggeredOrImmediate()

PHOSPHORANIMATION_EXPORT void PhosphorAnimation::applyStaggeredOrImmediate ( QObject *  parent,
int  count,
SequenceMode  sequenceMode,
int  staggerInterval,
const std::function< void(int)> &  applyFn,
const std::function< void()> &  onComplete = nullptr 
)

Apply a sequence of operations, optionally cascaded with stagger.

When sequenceMode is Cascade and staggerInterval > 0, each applyFn(i) call is delayed by i * staggerInterval ms via QTimer::singleShot, producing the visual cascade familiar from tiling shells. Otherwise all calls are immediate and onComplete fires synchronously at the end.

Callers loading a raw integer from D-Bus / config should convert to SequenceMode at that boundary (with explicit range checking) — this function does not accept magic ints.

Parameters
parentQObject that owns the QTimer context.
countNumber of items to process.
sequenceModeAllAtOnce or Cascade.
staggerIntervalMilliseconds between cascade starts.
applyFnCalled once per index i ∈ [0, count).
onCompleteOptional callback after all items are applied. Not invoked if parent is destroyed mid-cascade — Qt cancels the pending timers and we have no completion to report. Callers relying on onComplete for cleanup must handle parent destruction independently.

Parent-guard contract

QTimer::singleShot(delay, parent, lambda) cancels the lambda if parent is destroyed before the timer fires — that covers the common case where the cascade outlives its initiator.

The parent guard does not protect objects captured inside applyFn / onComplete. If you write [this](int i){ ... } and this is some subsystem whose lifetime is shorter than parent, captured this can dangle when the lambda fires later.

Callers must ensure one of:

  • (a) the captured receiver IS parent, or
  • (b) the captured receiver is owned by parent and cannot outlive it, or
  • (c) the lambda uses a QPointer<T> weak capture and checks it before use.

In PlasmaZones today all callers satisfy (b) — they capture subsystems owned by the compositor effect which is itself parent.

◆ defaultFallbackCurve()

PHOSPHORANIMATION_EXPORT std::shared_ptr< const Curve > PhosphorAnimation::defaultFallbackCurve ( )

Variable Documentation

◆ kRectSizeEpsilonPx

constexpr qreal PhosphorAnimation::kRectSizeEpsilonPx = 1.0
inlineconstexpr

Sub-pixel epsilon for rect size-change detection.

Shared between AnimatedValue<QRectF>::hasSizeChange and SnapPolicy::kSnapSizeEpsilonPx.