Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorZones::ZonesLayoutSource Class Reference

ILayoutSource adapter wrapping an IZoneLayoutRegistry. More...

#include <phosphor-zones/include/PhosphorZones/ZonesLayoutSource.h>

Inheritance diagram for PhosphorZones::ZonesLayoutSource:
[legend]

Public Member Functions

 ZonesLayoutSource (PhosphorZones::IZoneLayoutRegistry *registry, QObject *parent=nullptr)
 Construct over a borrowed layout registry.
 
 ~ZonesLayoutSource () override
 
QVector< PhosphorLayout::LayoutPreviewavailableLayouts () 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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ZonesLayoutSource()

PhosphorZones::ZonesLayoutSource::ZonesLayoutSource ( PhosphorZones::IZoneLayoutRegistry registry,
QObject *  parent = nullptr 
)
explicit

Construct over a borrowed layout registry.

Caller owns registry and must keep it alive for the source's lifetime.

◆ ~ZonesLayoutSource()

PhosphorZones::ZonesLayoutSource::~ZonesLayoutSource ( )
override

Member Function Documentation

◆ availableLayouts()

QVector< PhosphorLayout::LayoutPreview > PhosphorZones::ZonesLayoutSource::availableLayouts ( ) const
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.

◆ previewAt()

PhosphorLayout::LayoutPreview PhosphorZones::ZonesLayoutSource::previewAt ( const QString &  id,
int  windowCount = PhosphorLayout::DefaultPreviewWindowCount,
const QSize &  canvas = {} 
)
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.


The documentation for this class was generated from the following file: