ILayoutSource adapter wrapping an IZoneLayoutRegistry. More...
#include <phosphor-zones/include/PhosphorZones/ZonesLayoutSource.h>
Public Member Functions | |
| ZonesLayoutSource (PhosphorZones::IZoneLayoutRegistry *registry, QObject *parent=nullptr) | |
| Construct over a borrowed layout registry. | |
| ~ZonesLayoutSource () override | |
| QVector< PhosphorLayout::LayoutPreview > | availableLayouts () const override |
| Enumerate every layout this source can render. | |
| PhosphorLayout::LayoutPreview | previewAt (const QString &id, int windowCount=PhosphorLayout::DefaultPreviewWindowCount, const QSize &canvas={}) override |
windowCount is ignored — manual layouts have authored zones. | |
Public Member Functions inherited from PhosphorLayout::ILayoutSource | |
| ~ILayoutSource () override | |
Additional Inherited Members | |
Signals inherited from PhosphorLayout::ILayoutSource | |
| void | contentsChanged () |
| Emitted whenever the set of layouts this source reports has changed (entries added, removed, or mutated — e.g. | |
Protected Member Functions inherited from PhosphorLayout::ILayoutSource | |
| ILayoutSource (QObject *parent=nullptr) | |
ILayoutSource adapter wrapping an IZoneLayoutRegistry.
Implements PhosphorLayout::ILayoutSource so editor / settings / overlay code can render manual-layout previews uniformly with autotile-algorithm previews (the latter coming from PhosphorTiles::AutotileLayoutSource).
Self-wires the registry's contentsChanged signal (inherited from PhosphorLayout::ILayoutSourceRegistry) to its own contentsChanged at construction — no caller-side connect is required. Mirrors the pattern used by AutotileLayoutSource.
Borrows the registry — caller owns it and must keep it alive for this source's lifetime. Taking IZoneLayoutRegistry* rather than ILayoutManager* means fixture tests can stub just the enumeration surface (layouts() + layoutById()) instead of the full manager contract.
|
explicit |
Construct over a borrowed layout registry.
Caller owns registry and must keep it alive for the source's lifetime.
|
override |
|
overridevirtual |
Enumerate every layout this source can render.
The returned previews are populated enough for the picker UI to render rows (id, displayName, aspect-ratio class, autotile flag, optional algorithm metadata). For autotile entries the zones field is populated with a default-window-count preview; consumers wanting a different count call previewAt with the entry's id.
Implements PhosphorLayout::ILayoutSource.
|
overridevirtual |
windowCount is ignored — manual layouts have authored zones.
canvas is also ignored at this stage; future work may use it to set LayoutPreview::recommended for aspect-ratio filtering.
Implements PhosphorLayout::ILayoutSource.