Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
DecorationProfileTree.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 <PhosphorSurface/phosphorsurface_export.h>
8
10
11#include <QJsonObject>
12#include <QString>
13#include <QStringList>
14
15namespace PhosphorSurfaceShaders {
16
41class PHOSPHORSURFACE_EXPORT DecorationProfileTree
42{
43public:
45
50
51 // ─────── Lookup ───────
52
53 DecorationProfile resolve(const QString& surfacePath) const;
78 DecorationProfile directOverride(const QString& surfacePath) const;
79 bool hasOverride(const QString& surfacePath) const;
80 QStringList overriddenPaths() const;
81
82 // ─────── Mutation ───────
83
84 void setOverride(const QString& surfacePath, const DecorationProfile& profile);
85 bool clearOverride(const QString& surfacePath);
87
88 // ─────── Baseline ───────
89
91 {
92 return m_store.baseline();
93 }
94 void setBaseline(const DecorationProfile& profile);
95
96 // ─────── Serialization ───────
97
98 QJsonObject toJson() const;
99 static DecorationProfileTree fromJson(const QJsonObject& obj);
100
101 // ─────── Equality ───────
102
103 bool operator==(const DecorationProfileTree& other) const;
104 bool operator!=(const DecorationProfileTree& other) const
105 {
106 return !(*this == other);
107 }
108
109private:
116};
117
118} // namespace PhosphorSurfaceShaders
A baseline payload plus keyed overrides, in insertion order.
Definition PathKeyedOverrides.h:56
DecorationProfile directOverride(const QString &surfacePath) const
Returns the override stored directly at surfacePath, or a default-constructed (all-unset) profile whe...
bool hasOverride(const QString &surfacePath) const
DecorationProfileTree & operator=(DecorationProfileTree &&)=default
void setOverride(const QString &surfacePath, const DecorationProfile &profile)
bool clearOverride(const QString &surfacePath)
bool operator!=(const DecorationProfileTree &other) const
Definition DecorationProfileTree.h:104
DecorationProfileTree withSeedDefaults(const DecorationProfileTree &seeds) const
Two-layer seed overlay: returns a copy of this tree with seeds injected as the LOWEST-precedence laye...
DecorationProfile resolve(const QString &surfacePath) const
static DecorationProfileTree fromJson(const QJsonObject &obj)
DecorationProfileTree(DecorationProfileTree &&)=default
void setBaseline(const DecorationProfile &profile)
bool operator==(const DecorationProfileTree &other) const
DecorationProfile baseline() const
Definition DecorationProfileTree.h:90
DecorationProfileTree(const DecorationProfileTree &)=default
DecorationProfileTree & operator=(const DecorationProfileTree &)=default
Per-surface decoration shader-pack chain and its per-pack parameters.
Definition DecorationProfile.h:68
Definition DecorationProfile.h:31