Key-value JSON store for surface-related persistence. More...
#include <phosphor-layer/include/PhosphorLayer/ISurfaceStore.h>
Public Member Functions | |
| ISurfaceStore ()=default | |
| virtual | ~ISurfaceStore ()=default |
| virtual bool | save (const QString &key, const QJsonObject &data)=0 |
Persist data under key. | |
| virtual QJsonObject | load (const QString &key) const =0 |
Load the JSON object previously stored under key. | |
| virtual bool | has (const QString &key) const =0 |
True if key exists in the store. | |
| virtual void | remove (const QString &key)=0 |
Remove the entry for key (no-op if absent). | |
Key-value JSON store for surface-related persistence.
Layer-shell surfaces have no per-instance runtime state that the compositor doesn't already manage (position comes from anchors/margins, size from configure events). What consumers DO want to persist is application state: "which surfaces were visible", "which shader preset was last selected in the modal dialog", etc.
This interface is deliberately thin — a glorified QJsonObject bag keyed by string. The library does not automatically persist anything through it; consumers decide what to save and when.
Implementations:
|
default |
|
virtualdefault |
|
pure virtual |
True if key exists in the store.
Implemented in PhosphorLayer::JsonSurfaceStore.
|
pure virtual |
Load the JSON object previously stored under key.
Returns an empty object if the key does not exist or the stored data cannot be parsed.
Implemented in PhosphorLayer::JsonSurfaceStore.
|
pure virtual |
Remove the entry for key (no-op if absent).
Implemented in PhosphorLayer::JsonSurfaceStore.
|
pure virtual |
Persist data under key.
Overwrites any existing entry. Returns false on I/O failure (the implementation logs the reason).
Implemented in PhosphorLayer::JsonSurfaceStore.