7#include <phosphorengine_export.h>
62 std::optional<WindowPlacement>
take(
const QString& windowId,
const QString& appId,
70 std::optional<WindowPlacement>
peek(
const QString& windowId,
const QString& appId,
75 bool contains(
const QString& windowId,
const QString& appId = QString())
const;
100 bool clear(
const QString& windowId);
129 QHash<QString, QList<WindowPlacement>> m_byApp;
130 quint64 m_sequence = 0;
132 static constexpr int MaxPerApp = 16;
The single source of truth for window restore state in the unified model.
Definition WindowPlacementStore.h:34
bool clear(const QString &windowId)
Drop any record for the exact windowId (and prune the empty bucket).
bool collapsePureFloatSiblings(const QString &appId, const QString &keepWindowId)
Collapse stale pure-float duplicates for an app, keeping keepWindowId.
bool contains(const QString &windowId, const QString &appId=QString()) const
True if a record exists for the exact windowId, or (if appId non-empty) any record in that appId buck...
int transform(const std::function< bool(WindowPlacement &)> &fn)
Apply an in-place mutation to every record; fn returns true when it changed the record.
int removeIf(const std::function< bool(const WindowPlacement &)> &pred)
Remove every record matching pred. Returns the count removed.
std::optional< WindowPlacement > peek(const QString &windowId, const QString &appId, const std::function< bool(const WindowPlacement &)> &accept={}) const
Non-consuming lookup (unlike take): the record for the exact windowId, else the NEWEST record in the ...
QList< WindowPlacement > records() const
All records, in no particular order.
std::optional< WindowPlacement > take(const QString &windowId, const QString &appId, const std::function< bool(const WindowPlacement &)> &accept={}, const std::function< bool(const WindowPlacement &)> &preferred={})
Restore lookup: the first record whose accept predicate passes, trying the exact-windowId match befor...
bool clearFreeGeometry(const QString &windowId)
Clear ONLY the shared free/float geometry for the exact windowId, leaving the engine slots and contex...
QJsonObject serialize(const std::function< bool(const WindowPlacement &)> &keep={}) const
JSON shape: { appId: [ record, ... ] }.
WindowPlacementStore()=default
void deserialize(const QJsonObject &obj)
bool record(WindowPlacement placement)
Record / MERGE this window's placement.
Definition EngineTypes.h:13
One window's single, authoritative placement record — the unit of the unified, engine-agnostic restor...
Definition WindowPlacement.h:66