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

Hierarchical DecorationProfile storage with walk-up inheritance. More...

#include <PhosphorSurface/DecorationProfileTree.h>

Public Member Functions

 DecorationProfileTree ()=default
 DecorationProfileTree (const DecorationProfileTree &)=default
DecorationProfileTree & operator= (const DecorationProfileTree &)=default
 DecorationProfileTree (DecorationProfileTree &&)=default
DecorationProfileTree & operator= (DecorationProfileTree &&)=default
DecorationProfile resolve (const QString &surfacePath) const
DecorationProfileTree withSeedDefaults (const DecorationProfileTree &seeds) const
 Two-layer seed overlay: returns a copy of this tree with seeds injected as the LOWEST-precedence layer — the same seed model as PhosphorAnimation::PhosphorProfileRegistry::resolveWithInheritance's low-precedence owner tag, expressed as a tree-to-tree merge.
DecorationProfile directOverride (const QString &surfacePath) const
 Returns the override stored directly at surfacePath, or a default-constructed (all-unset) profile when none exists — which is indistinguishable from a real all-unset override.
bool hasOverride (const QString &surfacePath) const
QStringList overriddenPaths () const
void setOverride (const QString &surfacePath, const DecorationProfile &profile)
bool clearOverride (const QString &surfacePath)
void clearAllOverrides ()
DecorationProfile baseline () const
void setBaseline (const DecorationProfile &profile)
QJsonObject toJson () const
bool operator== (const DecorationProfileTree &other) const
bool operator!= (const DecorationProfileTree &other) const

Static Public Member Functions

static DecorationProfileTree fromJson (const QJsonObject &obj)

Detailed Description

Hierarchical DecorationProfile storage with walk-up inheritance.

Same inheritance semantics as PhosphorAnimationShaders::ShaderProfileTree but carrying DecorationProfile payloads (a decoration shader-pack chain plus its per-pack parameters) instead of ShaderProfile. Keyed on a dot-path surface namespace (DecorationSupportedPaths) so a consumer can resolve the decoration config for any surface.

Walk-up inheritance

For "window.tiled", resolve() walks:

  1. baseline (global default)
  2. "window" (category override)
  3. "window.tiled" (leaf override)

Overlay order is shallowest-first so the deepest (most specific) override wins: each engaged optional replaces the accumulator, unset fields pass through.

Thread safety

Value type, not internally synchronized. Same as ShaderProfileTree.

Constructor & Destructor Documentation

◆ DecorationProfileTree() [1/3]

PhosphorSurfaceShaders::DecorationProfileTree::DecorationProfileTree ( )
default

◆ DecorationProfileTree() [2/3]

PhosphorSurfaceShaders::DecorationProfileTree::DecorationProfileTree ( const DecorationProfileTree & )
default

◆ DecorationProfileTree() [3/3]

PhosphorSurfaceShaders::DecorationProfileTree::DecorationProfileTree ( DecorationProfileTree && )
default

Member Function Documentation

◆ baseline()

DecorationProfile PhosphorSurfaceShaders::DecorationProfileTree::baseline ( ) const
inline

◆ clearAllOverrides()

void PhosphorSurfaceShaders::DecorationProfileTree::clearAllOverrides ( )

◆ clearOverride()

bool PhosphorSurfaceShaders::DecorationProfileTree::clearOverride ( const QString & surfacePath)

◆ directOverride()

DecorationProfile PhosphorSurfaceShaders::DecorationProfileTree::directOverride ( const QString & surfacePath) const

Returns the override stored directly at surfacePath, or a default-constructed (all-unset) profile when none exists — which is indistinguishable from a real all-unset override.

Pair with hasOverride() before trusting a non-empty-looking result.

◆ fromJson()

DecorationProfileTree PhosphorSurfaceShaders::DecorationProfileTree::fromJson ( const QJsonObject & obj)
static

◆ hasOverride()

bool PhosphorSurfaceShaders::DecorationProfileTree::hasOverride ( const QString & surfacePath) const

◆ operator!=()

bool PhosphorSurfaceShaders::DecorationProfileTree::operator!= ( const DecorationProfileTree & other) const
inline

◆ operator=() [1/2]

DecorationProfileTree & PhosphorSurfaceShaders::DecorationProfileTree::operator= ( const DecorationProfileTree & )
default

◆ operator=() [2/2]

DecorationProfileTree & PhosphorSurfaceShaders::DecorationProfileTree::operator= ( DecorationProfileTree && )
default

◆ operator==()

bool PhosphorSurfaceShaders::DecorationProfileTree::operator== ( const DecorationProfileTree & other) const

◆ overriddenPaths()

QStringList PhosphorSurfaceShaders::DecorationProfileTree::overriddenPaths ( ) const

◆ resolve()

DecorationProfile PhosphorSurfaceShaders::DecorationProfileTree::resolve ( const QString & surfacePath) const

◆ setBaseline()

void PhosphorSurfaceShaders::DecorationProfileTree::setBaseline ( const DecorationProfile & profile)

◆ setOverride()

void PhosphorSurfaceShaders::DecorationProfileTree::setOverride ( const QString & surfacePath,
const DecorationProfile & profile )

◆ toJson()

QJsonObject PhosphorSurfaceShaders::DecorationProfileTree::toJson ( ) const

◆ withSeedDefaults()

DecorationProfileTree PhosphorSurfaceShaders::DecorationProfileTree::withSeedDefaults ( const DecorationProfileTree & seeds) const

Two-layer seed overlay: returns a copy of this tree with seeds injected as the LOWEST-precedence layer — the same seed model as PhosphorAnimation::PhosphorProfileRegistry::resolveWithInheritance's low-precedence owner tag, expressed as a tree-to-tree merge.

For each seed override path (and the seed baseline), a seed field is copied in ONLY where this tree leaves room for it:

  • If this tree engages chain at the path or anywhere on its walk-up (baseline or an ancestor override), the path is skipped entirely — the user built their own look there, and injecting the seed's parameters or disable set under a foreign chain is meaningless. An engaged-but-empty chain therefore keeps a surface explicitly undecorated.
  • Otherwise parameters and disabledPacks each inject only when this tree engages that SAME field nowhere on the walk-up either, so a parameters-only retune (at the path or at an ancestor) keeps the seed chain while the user's map wins — an injected leaf field would otherwise shadow an engaged ancestor map in resolve()'s deepest-last overlay.

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