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 {
20}
21
24}
25
26namespace PhosphorLayer {
27class Role;
28class Surface;
29}
30
31QT_BEGIN_NAMESPACE
32class QQuickItem;
33QT_END_NAMESPACE
34
35namespace PhosphorAnimationLayer {
36
120class PHOSPHORANIMATION_EXPORT SurfaceAnimator : public PhosphorLayer::ISurfaceAnimator
121{
122public:
181
190
199
208
212
224
228
234
239
270
286 void setAudioSpectrum(const QVector<float>& spectrum);
288
291 void beginShow(PhosphorLayer::Surface* surface, QQuickItem* rootItem, CompletionCallback onComplete) override;
292 void beginHide(PhosphorLayer::Surface* surface, QQuickItem* rootItem, CompletionCallback onComplete) override;
293 void cancel(PhosphorLayer::Surface* surface) override;
295
312 void beginShow(PhosphorLayer::Surface* surface, QQuickItem* rootItem, const PhosphorLayer::Role& configRole,
313 CompletionCallback onComplete);
314 void beginHide(PhosphorLayer::Surface* surface, QQuickItem* rootItem, const PhosphorLayer::Role& configRole,
315 CompletionCallback onComplete);
316
323 void setEnabled(bool enabled);
324 bool isEnabled() const;
325
341
347 bool hasParkedShaders() const;
348
349private:
350 class Private;
351 std::unique_ptr<Private> d;
352};
353
354} // namespace PhosphorAnimationLayer
void cancel(PhosphorLayer::Surface *surface) override
Interrupt every in-flight animation for surface, on any item, not only the root.
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.
bool hasParkedShaders() const
Any parked towers currently held?
void registerConfigForRole(const PhosphorLayer::Role &role, Config cfg)
Override the configuration for one Role.
void setEnabled(bool enabled)
Global animation enable/disable.
void releaseParkedShaders()
Destroy every parked (pending-reuse) shader tower now.
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:80
Registry mapping profile path strings to Profile values.
Definition PhosphorProfileRegistry.h:23
Hook point for show/hide transitions on Surfaces.
Definition ISurfaceAnimator.h:51
std::function< void()> CompletionCallback
Invoked when a show/hide animation completes.
Definition ISurfaceAnimator.h:56
One layer-shell surface with a managed lifecycle.
Definition Surface.h:105
Definition AnimationShaderItemConfig.h:18
Definition AnimationShaderContract.h:10
Definition AnimatedValue.h:32
Definition SurfaceAnimator.h:26
Per-role profile + scale tuning bundle.
Definition SurfaceAnimator.h:156
QString hideShaderProfile
Definition SurfaceAnimator.h:170
QString hideScaleProfile
Optional. Empty → no scale animation on hide.
Definition SurfaceAnimator.h:160
QString hideProfile
Path resolved via registry, e.g. "osd.hide".
Definition SurfaceAnimator.h:158
QString hideShaderEffectId
Definition SurfaceAnimator.h:166
qreal showScaleFrom
Initial scale value when showScaleProfile is set.
Definition SurfaceAnimator.h:161
QVariantMap showShaderParameters
Per-event shader parameter overrides forwarded to PhosphorRendering::ShaderEffect::setShaderParams on...
Definition SurfaceAnimator.h:178
qreal hideScaleTo
Final scale value when hideScaleProfile is set.
Definition SurfaceAnimator.h:162
QVariantMap hideShaderParameters
Definition SurfaceAnimator.h:179
QString showProfile
Path resolved via registry, e.g. "osd.show".
Definition SurfaceAnimator.h:157
QString showScaleProfile
Optional. Empty → no scale animation on show.
Definition SurfaceAnimator.h:159
QString showShaderEffectId
Phase 6: shader transition effect ids.
Definition SurfaceAnimator.h:165
QString showShaderProfile
Optional profile paths for the shader time curve.
Definition SurfaceAnimator.h:169
Value type describing a surface's protocol-level configuration.
Definition Role.h:77