Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
SurfaceAnimator.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
6#include <PhosphorAnimation/phosphoranimation_export.h>
7
9
10#include <QObject>
11#include <QPointer>
12#include <QString>
13#include <QVariantMap>
14#include <QVector>
15
16#include <memory>
17
18namespace PhosphorAnimation {
19class PhosphorProfileRegistry;
20}
21
23class AnimationShaderRegistry;
24}
25
26namespace PhosphorLayer {
27class Role;
28class Surface;
29}
30
31QT_BEGIN_NAMESPACE
32class QQuickItem;
33QT_END_NAMESPACE
34
36
120class PHOSPHORANIMATION_EXPORT SurfaceAnimator : public PhosphorLayer::ISurfaceAnimator
121{
122public:
154 struct Config
155 {
156 QString showProfile;
157 QString hideProfile;
160 qreal showScaleFrom = 1.0;
161 qreal hideScaleTo = 1.0;
179 };
180
189
198
207
211
223
227
233
238
269
285 void setAudioSpectrum(const QVector<float>& spectrum);
287
290 void beginShow(PhosphorLayer::Surface* surface, QQuickItem* rootItem, CompletionCallback onComplete) override;
291 void beginHide(PhosphorLayer::Surface* surface, QQuickItem* rootItem, CompletionCallback onComplete) override;
292 void cancel(PhosphorLayer::Surface* surface) override;
294
311 void beginShow(PhosphorLayer::Surface* surface, QQuickItem* rootItem, const PhosphorLayer::Role& configRole,
312 CompletionCallback onComplete);
313 void beginHide(PhosphorLayer::Surface* surface, QQuickItem* rootItem, const PhosphorLayer::Role& configRole,
314 CompletionCallback onComplete);
315
322 void setEnabled(bool enabled);
323 bool isEnabled() const;
324
325private:
326 class Private;
327 std::unique_ptr<Private> d;
328};
329
330} // namespace PhosphorAnimationLayer
Concrete PhosphorLayer::ISurfaceAnimator driving show/hide via phosphor-animation Profiles.
Definition SurfaceAnimator.h:121
void cancel(PhosphorLayer::Surface *surface) override
Interrupt any in-flight animation for surface.
void beginHide(PhosphorLayer::Surface *surface, QQuickItem *rootItem, CompletionCallback onComplete) override
Begin a hide transition for surface.
SurfaceAnimator(const SurfaceAnimator &)=delete
void setDefaultConfig(Config cfg)
Mutable access to the default (unregistered-role fallback).
Config configForRole(const PhosphorLayer::Role &role) const
Read-only config lookup.
void beginHide(PhosphorLayer::Surface *surface, QQuickItem *rootItem, const PhosphorLayer::Role &configRole, CompletionCallback onComplete)
void setAudioSpectrum(const QVector< float > &spectrum)
Push the latest CAVA / audio-spectrum sample to every active animation shader item.
SurfaceAnimator(PhosphorAnimation::PhosphorProfileRegistry &registry, PhosphorAnimationShaders::AnimationShaderRegistry *shaderRegistry, Config defaults)
Full constructor with shader registry for Phase 6 transition effects.
void beginShow(PhosphorLayer::Surface *surface, QQuickItem *rootItem, const PhosphorLayer::Role &configRole, CompletionCallback onComplete)
Role-override show/hide.
SurfaceAnimator(PhosphorAnimation::PhosphorProfileRegistry &registry)
Convenience: registry-only ctor with empty default config.
void registerConfigForRole(const PhosphorLayer::Role &role, Config cfg)
Override the configuration for one Role.
void setEnabled(bool enabled)
Global animation enable/disable.
SurfaceAnimator(PhosphorAnimation::PhosphorProfileRegistry &registry, Config defaults)
Construct against an explicit registry with caller-supplied defaults.
void beginShow(PhosphorLayer::Surface *surface, QQuickItem *rootItem, CompletionCallback onComplete) override
Begin a show transition for surface.
SurfaceAnimator & operator=(const SurfaceAnimator &)=delete
void setAnimationShaderRegistry(PhosphorAnimationShaders::AnimationShaderRegistry *registry)
Install the animation shader registry for Phase 6 shader transitions.
Registry of available animation shader transition effects.
Definition AnimationShaderRegistry.h:75
Registry mapping profile path strings to Profile values.
Definition PhosphorProfileRegistry.h:23
Hook point for show/hide transitions on Surfaces.
Definition ISurfaceAnimator.h:50
std::function< void()> CompletionCallback
Invoked when a show/hide animation completes.
Definition ISurfaceAnimator.h:55
One layer-shell surface with a managed lifecycle.
Definition Surface.h:99
Definition SurfaceAnimator.h:35
Definition AnimationAppRule.h:17
Definition AnimatedValue.h:31
Definition SurfaceAnimator.h:26
Per-role profile + scale tuning bundle.
Definition SurfaceAnimator.h:155
QString hideShaderProfile
Definition SurfaceAnimator.h:169
QString hideScaleProfile
Optional. Empty → no scale animation on hide.
Definition SurfaceAnimator.h:159
QString hideProfile
Path resolved via registry, e.g. "osd.hide".
Definition SurfaceAnimator.h:157
QString hideShaderEffectId
Definition SurfaceAnimator.h:165
QVariantMap showShaderParameters
Per-event shader parameter overrides forwarded to PhosphorRendering::ShaderEffect::setShaderParams on...
Definition SurfaceAnimator.h:177
QVariantMap hideShaderParameters
Definition SurfaceAnimator.h:178
QString showProfile
Path resolved via registry, e.g. "osd.show".
Definition SurfaceAnimator.h:156
QString showScaleProfile
Optional. Empty → no scale animation on show.
Definition SurfaceAnimator.h:158
QString showShaderEffectId
Phase 6: shader transition effect ids.
Definition SurfaceAnimator.h:164
QString showShaderProfile
Optional profile paths for the shader time curve.
Definition SurfaceAnimator.h:168
Value type describing a surface's protocol-level configuration.
Definition Role.h:77