Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
ShaderProfileTree.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
7#include <PhosphorAnimation/phosphoranimation_export.h>
8
10
11#include <QJsonObject>
12#include <QString>
13#include <QStringList>
14
16
74class PHOSPHORANIMATION_EXPORT ShaderProfileTree
75{
76public:
77 ShaderProfileTree() = default;
78
83
84 // ─────── Lookup ───────
85
86 ShaderProfile resolve(const QString& path) const;
87 ShaderProfile directOverride(const QString& path) const;
88 bool hasOverride(const QString& path) const;
89 QStringList overriddenPaths() const;
90
91 // ─────── Mutation ───────
92
93 void setOverride(const QString& path, const ShaderProfile& profile);
94 bool clearOverride(const QString& path);
96
97 // ─────── Baseline ───────
98
100 {
101 return m_store.baseline();
102 }
103 void setBaseline(const ShaderProfile& profile);
104
105 // ─────── Serialization ───────
106
107 QJsonObject toJson() const;
108 static ShaderProfileTree fromJson(const QJsonObject& obj);
109
110 // ─────── Equality ───────
111
112 bool operator==(const ShaderProfileTree& other) const;
113 bool operator!=(const ShaderProfileTree& other) const
114 {
115 return !(*this == other);
116 }
117
118private:
125};
126
136PHOSPHORANIMATION_EXPORT bool shaderPathResolvesInIsolation(const QString& path);
137
162PHOSPHORANIMATION_EXPORT QString shaderPathIsolationRoot(const QString& path);
163
174PHOSPHORANIMATION_EXPORT ShaderProfile resolveShaderWithDefault(const ShaderProfileTree& tree, const QString& path);
175
176} // namespace PhosphorAnimationShaders
Hierarchical ShaderProfile storage with walk-up inheritance.
Definition ShaderProfileTree.h:75
void setOverride(const QString &path, const ShaderProfile &profile)
ShaderProfileTree & operator=(const ShaderProfileTree &)=default
void setBaseline(const ShaderProfile &profile)
bool hasOverride(const QString &path) const
ShaderProfile baseline() const
Definition ShaderProfileTree.h:99
ShaderProfile directOverride(const QString &path) const
bool operator!=(const ShaderProfileTree &other) const
Definition ShaderProfileTree.h:113
bool clearOverride(const QString &path)
ShaderProfileTree(ShaderProfileTree &&)=default
ShaderProfile resolve(const QString &path) const
static ShaderProfileTree fromJson(const QJsonObject &obj)
ShaderProfileTree(const ShaderProfileTree &)=default
ShaderProfileTree & operator=(ShaderProfileTree &&)=default
bool operator==(const ShaderProfileTree &other) const
Per-event shader effect selection and configuration.
Definition ShaderProfile.h:50
A baseline payload plus keyed overrides, in insertion order.
Definition PathKeyedOverrides.h:56
Definition AnimationShaderContract.h:10
PHOSPHORANIMATION_EXPORT ShaderProfile resolveShaderWithDefault(const ShaderProfileTree &tree, const QString &path)
Resolve path against tree, applying the built-in per-event default shader (ProfilePaths::defaultShade...
PHOSPHORANIMATION_EXPORT bool shaderPathResolvesInIsolation(const QString &path)
True when path resolves its shader in ISOLATION: ShaderProfileTree:: resolve reads only the direct ov...
PHOSPHORANIMATION_EXPORT QString shaderPathIsolationRoot(const QString &path)
The subtree root path resolves WITHIN, or an empty string when it resolves the ordinary way (from the...