7#include "phosphorscreenscore_export.h"
41 , m_maxScreensPerPhysical(maxScreensPerPhysical)
45 QHash<QString, VirtualScreenConfig>
loadAll()
const override
52 return m_configs.value(physicalScreenId);
58 return remove(physicalScreenId);
69 const auto it = m_configs.constFind(physicalScreenId);
77 if (it != m_configs.constEnd() && it.value() == config) {
80 m_configs.insert(physicalScreenId, config);
85 bool remove(
const QString& physicalScreenId)
override
87 if (m_configs.remove(physicalScreenId) > 0) {
94 QHash<QString, VirtualScreenConfig> m_configs;
95 int m_maxScreensPerPhysical;
void changed()
Some entry in the store has changed (via this interface or by an external writer — KCM,...
IConfigStore(QObject *parent=nullptr)
Definition IConfigStore.h:40
static constexpr int DefaultMaxScreensPerPhysical
Production-matching default cap.
Definition InMemoryConfigStore.h:32
VirtualScreenConfig get(const QString &physicalScreenId) const override
Single-key read for callers that only need one entry (e.g.
Definition InMemoryConfigStore.h:50
bool remove(const QString &physicalScreenId) override
Drop the entry for physicalScreenId.
Definition InMemoryConfigStore.h:85
InMemoryConfigStore(int maxScreensPerPhysical=DefaultMaxScreensPerPhysical, QObject *parent=nullptr)
Construct with an optional maximum-virtual-screens-per-physical cap.
Definition InMemoryConfigStore.h:39
QHash< QString, VirtualScreenConfig > loadAll() const override
Snapshot every persisted virtual-screen config, keyed by physical screen ID.
Definition InMemoryConfigStore.h:45
bool save(const QString &physicalScreenId, const VirtualScreenConfig &config) override
Persist config for physicalScreenId.
Definition InMemoryConfigStore.h:55
Definition IWindowTrackingService.h:28
Configuration for how a physical screen is subdivided into virtual screens.
Definition VirtualScreen.h:124
static bool isValid(const VirtualScreenConfig &cfg, const QString &expectedPhysicalScreenId, int maxScreensPerPhysical, QString *error=nullptr)
Validate geometric and structural invariants for this config.
Definition VirtualScreen.h:175
bool isEmpty() const
Definition VirtualScreen.h:132