Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
MotionSpec.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
8#include <PhosphorAnimation/phosphoranimation_export.h>
9
10#include <functional>
11#include <optional>
12
13namespace PhosphorAnimation {
14
15class IMotionClock;
16
23template<typename T>
25{
27
29 IMotionClock* clock = nullptr;
30
32
52 std::optional<int> maxLifetimeMs;
53
56 std::function<void(const T&)> onValueChanged;
57
59 std::function<void()> onComplete;
60};
61
62} // namespace PhosphorAnimation
Abstract clock interface for the motion runtime.
Definition IMotionClock.h:18
Configuration for a single animation event.
Definition Profile.h:33
Definition AnimatedValue.h:32
RetargetPolicy
How an in-flight AnimatedValue<T> reshapes on retarget().
Definition RetargetPolicy.h:9
@ PreserveVelocity
Carry velocity across the segment boundary, re-scaled to the new distance. Default.
Runtime call-site bundle for starting an AnimatedValue<T>.
Definition MotionSpec.h:25
std::function< void(const T &)> onValueChanged
Fired every advance() that changes value().
Definition MotionSpec.h:56
std::optional< int > maxLifetimeMs
Optional hard ceiling on a STATEFUL (spring) animation's lifetime, in ms.
Definition MotionSpec.h:52
Profile profile
Definition MotionSpec.h:26
RetargetPolicy retargetPolicy
Definition MotionSpec.h:31
std::function< void()> onComplete
Fired once on completion. Not fired on cancel().
Definition MotionSpec.h:59
IMotionClock * clock
Non-owning; non-null required.
Definition MotionSpec.h:29