Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PerScreenConfigResolver.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 <phosphortileengine_export.h>
8#include <QHash>
9#include <QString>
10#include <QVariantMap>
11#include <optional>
12
13namespace PhosphorTiles {
14class TilingAlgorithm;
15}
16
17namespace PhosphorTileEngine {
18
20
21class AutotileConfig;
22class AutotileEngine;
23
37class PHOSPHORTILEENGINE_EXPORT PerScreenConfigResolver
38{
39public:
41
42 // ═══════════════════════════════════════════════════════════════════════════
43 // Per-screen override storage
44 // ═══════════════════════════════════════════════════════════════════════════
45
55 void applyPerScreenConfig(const QString& screenId, const QVariantMap& overrides);
56
65 void clearPerScreenConfig(const QString& screenId);
66
70 QVariantMap perScreenOverrides(const QString& screenId) const;
71
75 bool hasPerScreenOverride(const QString& screenId, const QString& key) const;
76
84 void updatePerScreenOverride(const QString& screenId, const QString& key, const QVariant& value);
85
89 void removeOverridesForScreen(const QString& screenId);
90
91 // ═══════════════════════════════════════════════════════════════════════════
92 // Effective per-screen values (per-screen override → global fallback)
93 // ═══════════════════════════════════════════════════════════════════════════
94
95 int effectiveInnerGap(const QString& screenId) const;
96 int effectiveOuterGap(const QString& screenId) const;
97 ::PhosphorLayout::EdgeGaps effectiveOuterGaps(const QString& screenId) const;
98 bool effectiveSmartGaps(const QString& screenId) const;
99 bool effectiveRespectMinimumSize(const QString& screenId) const;
100 int effectiveMaxWindows(const QString& screenId) const;
101 qreal effectiveSplitRatioStep(const QString& screenId) const;
102 QString effectiveAlgorithmId(const QString& screenId) const;
103 PhosphorTiles::TilingAlgorithm* effectiveAlgorithm(const QString& screenId) const;
104
105private:
106 std::optional<QVariant> perScreenOverride(const QString& screenId, const QString& key) const;
107
108 AutotileEngine* m_engine = nullptr;
109 QHash<QString, QVariantMap> m_perScreenOverrides;
110};
111
112} // namespace PhosphorTileEngine
Core engine for automatic window tiling.
Definition AutotileEngine.h:89
Resolves per-screen configuration overrides for autotiling.
Definition PerScreenConfigResolver.h:38
bool effectiveRespectMinimumSize(const QString &screenId) const
PerScreenConfigResolver(AutotileEngine *engine)
void removeOverridesForScreen(const QString &screenId)
Remove all overrides for a screen (used during screen removal)
int effectiveMaxWindows(const QString &screenId) const
void clearPerScreenConfig(const QString &screenId)
Clear per-screen configuration overrides.
::PhosphorLayout::EdgeGaps effectiveOuterGaps(const QString &screenId) const
void applyPerScreenConfig(const QString &screenId, const QVariantMap &overrides)
Apply per-screen configuration overrides.
QString effectiveAlgorithmId(const QString &screenId) const
PhosphorTiles::TilingAlgorithm * effectiveAlgorithm(const QString &screenId) const
bool effectiveSmartGaps(const QString &screenId) const
QVariantMap perScreenOverrides(const QString &screenId) const
Get currently applied per-screen overrides for comparison.
qreal effectiveSplitRatioStep(const QString &screenId) const
void updatePerScreenOverride(const QString &screenId, const QString &key, const QVariant &value)
Update a single per-screen override value in-place.
bool hasPerScreenOverride(const QString &screenId, const QString &key) const
Check if a screen has a per-screen override for a specific key.
int effectiveInnerGap(const QString &screenId) const
int effectiveOuterGap(const QString &screenId) const
Abstract base class for tiling algorithms.
Definition TilingAlgorithm.h:56
Definition PerScreenKeys.h:9
Definition AutotileConfig.h:14
Definition AutotileEngine.h:71
Per-side edge gap values (resolved, non-negative pixel values)
Definition EdgeGaps.h:27