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

Pass-through ISurfaceAnimator — calls onComplete() synchronously. More...

#include <phosphor-layer/include/PhosphorLayer/defaults/NoOpSurfaceAnimator.h>

Inheritance diagram for PhosphorLayer::NoOpSurfaceAnimator:
[legend]

Public Member Functions

 NoOpSurfaceAnimator ()=default
 
 ~NoOpSurfaceAnimator () override=default
 
void beginShow (Surface *, QQuickItem *, CompletionCallback onComplete) override
 Begin a show transition for surface.
 
void beginHide (Surface *, QQuickItem *, CompletionCallback onComplete) override
 Begin a hide transition for surface.
 
void cancel (Surface *) override
 Interrupt any in-flight animation for surface.
 
- Public Member Functions inherited from PhosphorLayer::ISurfaceAnimator
 ISurfaceAnimator ()=default
 
virtual ~ISurfaceAnimator ()=default
 

Additional Inherited Members

- Public Types inherited from PhosphorLayer::ISurfaceAnimator
using CompletionCallback = std::function< void()>
 Invoked when a show/hide animation completes.
 

Detailed Description

Pass-through ISurfaceAnimator — calls onComplete() synchronously.

This is the implicit default when a consumer doesn't provide an animator. Handing it to SurfaceFactory::Deps is equivalent to leaving the animator field nullptr; the class exists so consumers that want an explicit "no animation" contract can opt in.

Rationale: 99% of layer-shell consumers animate in QML (Behavior on opacity { … }), which happens independently of this interface. The ISurfaceAnimator hook exists for cases QML can't cover (pre-show measurement, orchestrated multi-surface transitions).

Constructor & Destructor Documentation

◆ NoOpSurfaceAnimator()

PhosphorLayer::NoOpSurfaceAnimator::NoOpSurfaceAnimator ( )
default

◆ ~NoOpSurfaceAnimator()

PhosphorLayer::NoOpSurfaceAnimator::~NoOpSurfaceAnimator ( )
overridedefault

Member Function Documentation

◆ beginHide()

void PhosphorLayer::NoOpSurfaceAnimator::beginHide ( Surface surface,
QQuickItem *  rootItem,
CompletionCallback  onComplete 
)
inlineoverridevirtual

Begin a hide transition for surface.

The Surface is transitioning Shown → Hidden. The animator should fade/slide the content, then invoke onComplete. The library does not delay window->hide() waiting for this — the current contract is "animate for visual polish, but the surface is considered hidden the moment hide() is called".

Implements PhosphorLayer::ISurfaceAnimator.

◆ beginShow()

void PhosphorLayer::NoOpSurfaceAnimator::beginShow ( Surface surface,
QQuickItem *  rootItem,
CompletionCallback  onComplete 
)
inlineoverridevirtual

Begin a show transition for surface.

The Surface has just become visible (Hidden → Shown). The animator can mutate rootItem (opacity, scale, y-offset) and drive an animation. Invoke onComplete when the transition finishes; the library uses this as a no-op today but a future version may defer compositor sync until the completion signal arrives.

Implements PhosphorLayer::ISurfaceAnimator.

◆ cancel()

void PhosphorLayer::NoOpSurfaceAnimator::cancel ( Surface surface)
inlineoverridevirtual

Interrupt any in-flight animation for surface.

Called when the Surface is destroyed or the animation is superseded by an opposite transition (show-while-hiding).

Implements PhosphorLayer::ISurfaceAnimator.


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