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

ILayoutSource over a ScrollingTemplateStore — the third card family beside manual zone layouts and autotile algorithms. More...

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

Inheritance diagram for PhosphorZones::ScrollingTemplateSource:
[legend]

Public Member Functions

 ScrollingTemplateSource (ScrollingTemplateStore *store, QObject *parent=nullptr)
 Construct over a borrowed template store.
 
 ~ScrollingTemplateSource () override
 
QVector< PhosphorLayout::LayoutPreviewavailableLayouts () const override
 Enumerate every layout this source can render.
 
PhosphorLayout::LayoutPreview previewAt (const QString &id, int windowCount, const QSize &canvas) override
 Produce a fully-realised preview for one layout entry.
 
- 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 over a ScrollingTemplateStore — the third card family beside manual zone layouts and autotile algorithms.

Null-tolerant like ZonesLayoutSource: a null store reports an empty list.

Constructor & Destructor Documentation

◆ ScrollingTemplateSource()

PhosphorZones::ScrollingTemplateSource::ScrollingTemplateSource ( ScrollingTemplateStore store,
QObject *  parent = nullptr 
)
explicit

Construct over a borrowed template store.

Caller owns store and must keep it alive for the source's lifetime (the ZonesLayoutSource contract); null is tolerated and reports an empty list.

◆ ~ScrollingTemplateSource()

PhosphorZones::ScrollingTemplateSource::~ScrollingTemplateSource ( )
override

Member Function Documentation

◆ availableLayouts()

QVector< PhosphorLayout::LayoutPreview > PhosphorZones::ScrollingTemplateSource::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::ScrollingTemplateSource::previewAt ( const QString &  id,
int  windowCount,
const QSize &  canvas 
)
overridevirtual

Produce a fully-realised preview for one layout entry.

id the LayoutPreview::id from availableLayouts windowCount for autotile entries, the window count to render the algorithm with. Ignored by manual sources (their zones are authored statically). Defaults to PhosphorLayout::DefaultPreviewWindowCount (4 — most picker thumbnails fit this nicely). canvas optional aspect-ratio + size hint. Sources that implement aspect-ratio filtering use this to set LayoutPreview::recommended; sources that don't ignore it. An empty QSize disables the hint.

Returns a default-constructed preview (empty id) when id is not known to this source. Caller checks result.id.isEmpty().

Note
Non-const because implementations are expected to populate a preview cache here (re-running a scripted algorithm on every picker redraw would be prohibitive). Callers holding a const ILayoutSource* cannot query previews — which matches the intent: querying a preview is an observable-effect operation on the source.

Implements PhosphorLayout::ILayoutSource.


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