Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
PhosphorTiles::TilingAlgorithm Class Referenceabstract

Abstract base class for tiling algorithms. More...

#include <phosphor-tiles/include/PhosphorTiles/TilingAlgorithm.h>

Inheritance diagram for PhosphorTiles::TilingAlgorithm:
[legend]

Signals

void configurationChanged ()
 Emitted when algorithm parameters change.
 

Public Member Functions

 TilingAlgorithm (QObject *parent=nullptr)
 
 ~TilingAlgorithm () override=default
 
 TilingAlgorithm (const TilingAlgorithm &)=delete
 
TilingAlgorithmoperator= (const TilingAlgorithm &)=delete
 
void setAppIdResolver (std::function< QString(const QString &)> resolver)
 Inject a resolver that maps an opaque instance id to its live app class.
 
std::function< QString(const QString &)> appIdResolver () const
 Access the current resolver.
 
QString registryId () const
 The id this algorithm is registered under.
 
void setRegistryId (const QString &id)
 Registry-internal setter.
 
virtual QString name () const =0
 Human-readable name of the algorithm.
 
virtual QString description () const =0
 Description of the algorithm behavior.
 
virtual QVector< QRect > calculateZones (const TilingParams &params) const =0
 Calculate zone geometries for N windows.
 
virtual int masterZoneIndex () const
 Get the index of the "master" zone (if applicable)
 
virtual bool supportsMasterCount () const
 Check if algorithm supports variable master count.
 
virtual bool supportsSplitRatio () const
 Check if algorithm supports split ratio adjustment.
 
virtual qreal defaultSplitRatio () const
 Get default split ratio for this algorithm.
 
virtual int minimumWindows () const
 Get minimum number of windows for meaningful tiling.
 
virtual int defaultMaxWindows () const
 Get default maximum number of windows for this algorithm.
 
virtual bool producesOverlappingZones () const
 Whether this algorithm intentionally produces overlapping zones.
 
virtual QString zoneNumberDisplay () const noexcept
 How zone numbers should be displayed in previews.
 
virtual bool centerLayout () const
 Whether this algorithm uses a center layout.
 
virtual bool isScripted () const noexcept
 Whether this algorithm is a user-provided scripted algorithm.
 
virtual bool supportsMinSizes () const noexcept
 Whether this algorithm supports per-window minimum size constraints.
 
virtual bool supportsMemory () const noexcept
 Whether this algorithm maintains persistent state across retiles.
 
virtual void prepareTilingState (TilingState *state) const
 Prepare the TilingState before calculateZones() is called.
 
virtual bool isUserScript () const noexcept
 Whether this scripted algorithm was loaded from a user directory.
 
virtual bool supportsLifecycleHooks () const noexcept
 Whether this algorithm implements any lifecycle hooks.
 
virtual void onWindowAdded (TilingState *state, int windowIndex)
 Called when a window is added to the tiling before retile.
 
virtual void onWindowRemoved (TilingState *state, int windowIndex)
 Called when a window is removed from the tiling before retile.
 
virtual bool supportsCustomParams () const noexcept
 Whether this algorithm declares custom parameters.
 
virtual QVariantList customParamDefList () const
 Get custom parameter definitions as a QVariantList for QML.
 
virtual bool hasCustomParam (const QString &name) const
 Check if a named custom parameter is declared by this algorithm.
 

Protected Types

using ThreeColumnWidths = ::PhosphorTiles::ThreeColumnWidths
 Result of solving three-column width distribution.
 
using CumulativeMinDims = ::PhosphorTiles::CumulativeMinDims
 Result of precomputing cumulative min dimensions for alternating V/H splits.
 

Static Protected Member Functions

static QVector< int > distributeEvenly (int total, int count)
 Distribute a total evenly among N parts with pixel-perfect remainder handling.
 
static QRect innerRect (const QRect &screenGeometry, int outerGap)
 Compute the usable area after subtracting uniform outer gap from screen edges.
 
static QRect innerRect (const QRect &screenGeometry, const EdgeGaps &gaps)
 Compute the usable area after subtracting per-side outer gaps from screen edges.
 
static QVector< int > distributeWithGaps (int total, int count, int gap)
 Distribute total space among count items with gaps between them.
 
static QVector< int > distributeWithMinSizes (int total, int count, int gap, const QVector< int > &minDims)
 Distribute total space among count items with gaps, respecting per-item minimums.
 
static int minWidthAt (const QVector< QSize > &minSizes, int index)
 Extract minimum width from minSizes at the given index.
 
static int minHeightAt (const QVector< QSize > &minSizes, int index)
 Extract minimum height from minSizes at the given index.
 
static void solveTwoPartMinSizes (int contentDim, int &firstDim, int &secondDim, int minFirst, int minSecond)
 Solve two-column/two-row dimension distribution with min-size constraints.
 
static void applyPerWindowMinSize (int &width, int &height, const QVector< QSize > &minSizes, int index)
 Apply per-window minimum size constraints (used by overlapping algorithms)
 
static ThreeColumnWidths solveThreeColumnWidths (int areaX, int contentWidth, int innerGap, qreal splitRatio, int minLeftWidth, int minCenterWidth, int minRightWidth)
 Solve three-column width distribution with ratio and min-size constraints.
 
static CumulativeMinDims computeAlternatingCumulativeMinDims (int windowCount, const QVector< QSize > &minSizes, int innerGap)
 Precompute direction-aware cumulative min dimensions for alternating splits.
 
static void appendGracefulDegradation (QVector< QRect > &zones, const QRect &remaining, int leftover, int innerGap)
 Append graceful degradation zones when remaining area is too small.
 
static qreal clampOrProportionalFallback (qreal ratio, qreal minFirstRatio, qreal maxFirstRatio, int firstDim, int secondDim)
 Clamp split ratio to min/max range, or fall back to proportional split.
 

Protected Attributes

std::function< QString(const QString &)> m_appIdResolver
 
QString m_registryId
 

Detailed Description

Abstract base class for tiling algorithms.

Each algorithm generates zone geometries based on:

  • Number of windows to tile
  • Screen geometry (available area)
  • Algorithm-specific parameters (master ratio, gaps, etc.)

Zone geometries are returned as absolute pixel coordinates matching the provided screen geometry. This matches KWin's setFrameGeometry() API.

Subclasses must implement:

Optionally override capability methods to indicate support for:

  • Master count adjustment
  • Split ratio adjustment
Note
Thread Safety: All algorithms are stateless — their const public methods can be called concurrently on the same instance. The TilingState parameter must not be modified during the call.

Member Typedef Documentation

◆ CumulativeMinDims

Result of precomputing cumulative min dimensions for alternating V/H splits.

Aliased from the namespace-level PhosphorTiles::CumulativeMinDims (see TilingAlgorithmHelpers.h) so legacy callers that reference TilingAlgorithm::CumulativeMinDims keep compiling.

◆ ThreeColumnWidths

Result of solving three-column width distribution.

Aliased from the namespace-level PhosphorTiles::ThreeColumnWidths (see TilingAlgorithmHelpers.h) so legacy callers that reference TilingAlgorithm::ThreeColumnWidths keep compiling.

Constructor & Destructor Documentation

◆ TilingAlgorithm() [1/2]

PhosphorTiles::TilingAlgorithm::TilingAlgorithm ( QObject *  parent = nullptr)
explicit

◆ ~TilingAlgorithm()

PhosphorTiles::TilingAlgorithm::~TilingAlgorithm ( )
overridedefault

◆ TilingAlgorithm() [2/2]

PhosphorTiles::TilingAlgorithm::TilingAlgorithm ( const TilingAlgorithm )
delete

Member Function Documentation

◆ appendGracefulDegradation()

static void PhosphorTiles::TilingAlgorithm::appendGracefulDegradation ( QVector< QRect > &  zones,
const QRect &  remaining,
int  leftover,
int  innerGap 
)
staticprotected

Append graceful degradation zones when remaining area is too small.

Shared by Dwindle and Spiral. Distributes leftover windows evenly within the remaining rectangle. zones.last() is resized to the first sub-zone.

◆ appIdResolver()

std::function< QString(const QString &)> PhosphorTiles::TilingAlgorithm::appIdResolver ( ) const
inline

Access the current resolver.

Returns a no-op (empty-string) resolver if none has been injected.

◆ applyPerWindowMinSize()

static void PhosphorTiles::TilingAlgorithm::applyPerWindowMinSize ( int &  width,
int &  height,
const QVector< QSize > &  minSizes,
int  index 
)
staticprotected

Apply per-window minimum size constraints (used by overlapping algorithms)

Clamps width and height upward to the minimum from minSizes[index]. No-op if index is out of range or mins are zero.

Parameters
widthCurrent width (modified in place)
heightCurrent height (modified in place)
minSizesPer-window minimum sizes vector
indexWindow index into minSizes

◆ calculateZones()

virtual QVector< QRect > PhosphorTiles::TilingAlgorithm::calculateZones ( const TilingParams params) const
pure virtual

Calculate zone geometries for N windows.

This is the core algorithm method. Given tiling parameters (window count, screen geometry, state, gaps, min sizes), generate zone rectangles.

Parameters
paramsTiling parameters (see TilingParams)
Returns
Vector of zone geometries in absolute pixel coordinates
Note
The returned vector should have exactly params.windowCount elements. For windowCount == 0, return an empty vector. For windowCount == 1, typically return a single zone inset by outerGap.

Implemented in PhosphorTiles::ScriptedAlgorithm.

◆ centerLayout()

virtual bool PhosphorTiles::TilingAlgorithm::centerLayout ( ) const
virtual

Whether this algorithm uses a center layout.

Center layout algorithms (e.g., ThreeColumn, CenteredMaster) have a center column whose width is controlled by the split ratio. The UI labels the ratio/count controls as "Center" instead of "Master".

Returns
true if this is a center layout algorithm (default: false)

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ clampOrProportionalFallback()

static qreal PhosphorTiles::TilingAlgorithm::clampOrProportionalFallback ( qreal  ratio,
qreal  minFirstRatio,
qreal  maxFirstRatio,
int  firstDim,
int  secondDim 
)
staticprotected

Clamp split ratio to min/max range, or fall back to proportional split.

Shared by BSP for both H and V branches. When minFirstRatio <= maxFirstRatio, clamps ratio. Otherwise distributes proportionally by minimum weight.

◆ computeAlternatingCumulativeMinDims()

static CumulativeMinDims PhosphorTiles::TilingAlgorithm::computeAlternatingCumulativeMinDims ( int  windowCount,
const QVector< QSize > &  minSizes,
int  innerGap 
)
staticprotected

Precompute direction-aware cumulative min dimensions for alternating splits.

Shared by Dwindle and Spiral algorithms. Both alternate V/H splits where splitV = (i % 2 == 0). Accumulates along the split axis and takes max for the orthogonal axis.

◆ configurationChanged

void PhosphorTiles::TilingAlgorithm::configurationChanged ( )
signal

Emitted when algorithm parameters change.

Connect to this signal to trigger retiling when algorithm configuration is modified at runtime.

◆ customParamDefList()

virtual QVariantList PhosphorTiles::TilingAlgorithm::customParamDefList ( ) const
virtual

Get custom parameter definitions as a QVariantList for QML.

Each entry is a QVariantMap with keys: name, type, defaultValue, description, minValue, maxValue, enumOptions (as applicable).

Returns
List of param definition maps, or empty if none declared

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ defaultMaxWindows()

virtual int PhosphorTiles::TilingAlgorithm::defaultMaxWindows ( ) const
virtual

Get default maximum number of windows for this algorithm.

Used as the initial value of the "Max Windows" slider in the KCM, and reported as the zone count on layout previews (LayoutGridDelegate, zone selector). The slider resets to this value when switching algorithms.

Returns
Default max window count for this algorithm (typically 4-10)

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ defaultSplitRatio()

virtual qreal PhosphorTiles::TilingAlgorithm::defaultSplitRatio ( ) const
virtual

Get default split ratio for this algorithm.

Used when creating initial tiling state.

Returns
Default ratio (0.0-1.0), typically 0.5-0.6

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ description()

virtual QString PhosphorTiles::TilingAlgorithm::description ( ) const
pure virtual

Description of the algorithm behavior.

Returns
Description suitable for tooltips/help text

Implemented in PhosphorTiles::ScriptedAlgorithm.

◆ distributeEvenly()

static QVector< int > PhosphorTiles::TilingAlgorithm::distributeEvenly ( int  total,
int  count 
)
staticprotected

Distribute a total evenly among N parts with pixel-perfect remainder handling.

Helper for algorithms that need to divide screen space evenly. Distributes remainder pixels to the first parts to ensure the sum equals the total exactly.

Example: distributeEvenly(100, 3) returns {34, 33, 33}

Parameters
totalTotal pixels to distribute
countNumber of parts to divide into (must be > 0)
Returns
Vector of sizes, one per part

◆ distributeWithGaps()

static QVector< int > PhosphorTiles::TilingAlgorithm::distributeWithGaps ( int  total,
int  count,
int  gap 
)
staticprotected

Distribute total space among count items with gaps between them.

Deducts (count-1) * gap from total, then distributes the remainder evenly with pixel-perfect remainder handling.

Parameters
totalTotal pixels available (including space for gaps)
countNumber of items to distribute among (must be > 0)
gapGap between adjacent items in pixels
Returns
Vector of item sizes (caller positions them with gap spacing)

◆ distributeWithMinSizes()

static QVector< int > PhosphorTiles::TilingAlgorithm::distributeWithMinSizes ( int  total,
int  count,
int  gap,
const QVector< int > &  minDims 
)
staticprotected

Distribute total space among count items with gaps, respecting per-item minimums.

Like distributeWithGaps(), but each item can have a minimum dimension. The algorithm:

  1. Deducts gap space: available = total - (count-1) * gap
  2. If all minimums fit, gives each item its minimum + an even share of surplus
  3. If minimums exceed available space, distributes proportionally by minimum weight
Parameters
totalTotal pixels available (including space for gaps)
countNumber of items to distribute among (must be > 0)
gapGap between adjacent items in pixels
minDimsPer-item minimum dimension (items beyond vector size default to 1px)
Returns
Vector of item sizes (caller positions them with gap spacing)

◆ hasCustomParam()

virtual bool PhosphorTiles::TilingAlgorithm::hasCustomParam ( const QString &  name) const
virtual

Check if a named custom parameter is declared by this algorithm.

Lighter-weight alternative to customParamDefList() for filtering stale params on the retile hot path — avoids QVariantList/QVariantMap allocation.

Parameters
nameParameter name to check
Returns
true if the algorithm declares a
Parameters
withthis name

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ innerRect() [1/2]

static QRect PhosphorTiles::TilingAlgorithm::innerRect ( const QRect &  screenGeometry,
const EdgeGaps gaps 
)
staticprotected

Compute the usable area after subtracting per-side outer gaps from screen edges.

Parameters
screenGeometryFull screen rectangle
gapsPer-side gap values
Returns
Inset rectangle (clamped to at least 1x1)

◆ innerRect() [2/2]

static QRect PhosphorTiles::TilingAlgorithm::innerRect ( const QRect &  screenGeometry,
int  outerGap 
)
staticprotected

Compute the usable area after subtracting uniform outer gap from screen edges.

Parameters
screenGeometryFull screen rectangle
outerGapGap at each edge in pixels
Returns
Inset rectangle (clamped to at least 1x1)

◆ isScripted()

virtual bool PhosphorTiles::TilingAlgorithm::isScripted ( ) const
virtualnoexcept

Whether this algorithm is a user-provided scripted algorithm.

Scripted algorithms are loaded from JavaScript files at runtime. Used by the UI to group algorithms into "Built-in" vs "Custom" sections.

Returns
true if this is a ScriptedAlgorithm (default: false)

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ isUserScript()

virtual bool PhosphorTiles::TilingAlgorithm::isUserScript ( ) const
virtualnoexcept

Whether this scripted algorithm was loaded from a user directory.

System-installed scripts (shipped with PlasmaZones) return false. User-created scripts in ~/.local/share/plasmazones/algorithms/ return true. Non-scripted algorithms always return false.

Returns
true if loaded from user's writable data directory (default: false)

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ masterZoneIndex()

virtual int PhosphorTiles::TilingAlgorithm::masterZoneIndex ( ) const
virtual

Get the index of the "master" zone (if applicable)

For algorithms with a master/stack concept, this returns the index of the primary window zone. Used for "focus master" and "swap with master".

Returns
Master zone index (0-based), or -1 if no master concept

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ minHeightAt()

static int PhosphorTiles::TilingAlgorithm::minHeightAt ( const QVector< QSize > &  minSizes,
int  index 
)
staticprotected

Extract minimum height from minSizes at the given index.

Returns
The minimum height (>= 0), or 0 if index is out of range

◆ minimumWindows()

virtual int PhosphorTiles::TilingAlgorithm::minimumWindows ( ) const
virtual

Get minimum number of windows for meaningful tiling.

Some algorithms (like Three Column) need a minimum number of windows to produce a sensible layout.

Returns
Minimum window count (typically 1)

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ minWidthAt()

static int PhosphorTiles::TilingAlgorithm::minWidthAt ( const QVector< QSize > &  minSizes,
int  index 
)
staticprotected

Extract minimum width from minSizes at the given index.

Returns
The minimum width (>= 0), or 0 if index is out of range

◆ name()

virtual QString PhosphorTiles::TilingAlgorithm::name ( ) const
pure virtual

Human-readable name of the algorithm.

Returns
Algorithm name (e.g., "Master + Stack", "BSP")

Implemented in PhosphorTiles::ScriptedAlgorithm.

◆ onWindowAdded()

virtual void PhosphorTiles::TilingAlgorithm::onWindowAdded ( TilingState state,
int  windowIndex 
)
virtual

Called when a window is added to the tiling before retile.

Algorithms can use this to update internal state (e.g., BSP tree insertion) instead of rebuilding from scratch in calculateZones().

Unlike calculateZones() (which receives a const TilingState*), lifecycle hooks receive a mutable pointer so algorithms can update internal structures (e.g., split trees) incrementally.

Parameters
stateCurrent tiling state (mutable for tree updates)
windowIndexIndex where the window was inserted

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ onWindowRemoved()

virtual void PhosphorTiles::TilingAlgorithm::onWindowRemoved ( TilingState state,
int  windowIndex 
)
virtual

Called when a window is removed from the tiling before retile.

The window is still present in state when this hook fires; it will be removed immediately after the hook returns. This means state->tiledWindowCount() still includes the departing window. Algorithms should use windowIndex to identify the departing window but must not assume the tiled window list will remain unchanged after the call. Hooks must NOT reorder or mutate the tiled window list — the engine relies on list stability for the subsequent removal.

Unlike calculateZones() (which receives a const TilingState*), lifecycle hooks receive a mutable pointer so algorithms can update internal structures (e.g., split trees) incrementally.

Parameters
stateCurrent tiling state (window still present, count not yet decremented)
windowIndexIndex the window occupied before removal

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ operator=()

TilingAlgorithm & PhosphorTiles::TilingAlgorithm::operator= ( const TilingAlgorithm )
delete

◆ prepareTilingState()

virtual void PhosphorTiles::TilingAlgorithm::prepareTilingState ( TilingState state) const
virtual

Prepare the TilingState before calculateZones() is called.

Memory-based algorithms override this to lazily create their SplitTree. The engine calls this unconditionally before calculateZones(), removing the need for concrete algorithm casts in the engine.

The method is const on the algorithm (it doesn't mutate algorithm state) but mutates the TilingState argument — the engine owns that mutation.

Parameters
stateTilingState to prepare (may be nullptr, implementations must check)

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ producesOverlappingZones()

virtual bool PhosphorTiles::TilingAlgorithm::producesOverlappingZones ( ) const
virtual

Whether this algorithm intentionally produces overlapping zones.

Algorithms like Cascade, Stair, and Monocle overlap zones by design. When true, the post-layout enforceMinSizes pass is skipped to avoid removeRectOverlaps destroying the intended layout.

Returns
true if zones intentionally overlap (default: false)

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ registryId()

QString PhosphorTiles::TilingAlgorithm::registryId ( ) const
inline

The id this algorithm is registered under.

Populated by AlgorithmRegistry::registerAlgorithm at registration time and unset when the algorithm is removed. Empty for algorithms that exist but aren't currently registered (fixture stubs, transient instances). Lets callers that have only a TilingAlgorithm* recover the id without the O(N) reverse lookup through the registry.

◆ setAppIdResolver()

void PhosphorTiles::TilingAlgorithm::setAppIdResolver ( std::function< QString(const QString &)>  resolver)
inline

Inject a resolver that maps an opaque instance id to its live app class.

Used by algorithms that need per-window class info (currently only ScriptedAlgorithm, which exposes class to user-authored JS). Built-in geometry algorithms don't care and ignore the resolver.

Injected by AutotileEngine::setWindowRegistry() so every algorithm returned from AlgorithmRegistry::algorithm() is seeded with the live registry's lookup before any lifecycle hook fires. The resolver is a std::function rather than a raw WindowRegistry* so tests can plug in canned answers without constructing a real registry.

Thread safety: setter must be called from the main thread; the resolver itself is invoked only from algorithm methods that already run on the main thread (buildJsState / onWindowAdded / etc.).

◆ setRegistryId()

void PhosphorTiles::TilingAlgorithm::setRegistryId ( const QString &  id)
inline

Registry-internal setter.

Not intended for direct use; AlgorithmRegistry calls this from registerAlgorithm / unregisterAlgorithm.

◆ solveThreeColumnWidths()

static ThreeColumnWidths PhosphorTiles::TilingAlgorithm::solveThreeColumnWidths ( int  areaX,
int  contentWidth,
int  innerGap,
qreal  splitRatio,
int  minLeftWidth,
int  minCenterWidth,
int  minRightWidth 
)
staticprotected

Solve three-column width distribution with ratio and min-size constraints.

Shared by ThreeColumnAlgorithm and CenteredMasterAlgorithm. Computes left/center/right widths from a center split ratio, applying MinRectSizePx floor, min-width clamping, and joint min-width proportional fallback.

Parameters
areaXLeft edge X coordinate
contentWidthTotal width minus two inter-column gaps
innerGapGap between columns
splitRatioCenter column ratio (0.0-1.0, will be clamped)
minLeftWidthMinimum width for left column (0 = unconstrained)
minCenterWidthMinimum width for center column (0 = unconstrained)
minRightWidthMinimum width for right column (0 = unconstrained)
Returns
Solved widths and X positions

◆ solveTwoPartMinSizes()

static void PhosphorTiles::TilingAlgorithm::solveTwoPartMinSizes ( int  contentDim,
int &  firstDim,
int &  secondDim,
int  minFirst,
int  minSecond 
)
staticprotected

Solve two-column/two-row dimension distribution with min-size constraints.

When both minimums fit, clamps each to its minimum. When they don't fit, distributes proportionally by minimum weight.

Parameters
contentDimTotal available dimension (width or height minus gap)
firstDimInitial first dimension (modified in place)
secondDimInitial second dimension (modified in place)
minFirstMinimum for first dimension (0 = unconstrained)
minSecondMinimum for second dimension (0 = unconstrained)

◆ supportsCustomParams()

virtual bool PhosphorTiles::TilingAlgorithm::supportsCustomParams ( ) const
virtualnoexcept

Whether this algorithm declares custom parameters.

Algorithms that support custom parameters (e.g., scripted algorithms with

Parameters
declarations)return true. Used to avoid downcasting.
Returns
true if the algorithm has custom parameter definitions (default: false)

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ supportsLifecycleHooks()

virtual bool PhosphorTiles::TilingAlgorithm::supportsLifecycleHooks ( ) const
virtualnoexcept

Whether this algorithm implements any lifecycle hooks.

When true, the engine calls onWindowAdded/onWindowRemoved before the next calculateZones() call, giving the algorithm a chance to update internal state incrementally.

Returns
true if the algorithm defines lifecycle hooks (default: false)

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ supportsMasterCount()

virtual bool PhosphorTiles::TilingAlgorithm::supportsMasterCount ( ) const
virtual

Check if algorithm supports variable master count.

If true, the algorithm can handle multiple windows in the master area.

Returns
true if master count can be adjusted

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ supportsMemory()

virtual bool PhosphorTiles::TilingAlgorithm::supportsMemory ( ) const
virtualnoexcept

Whether this algorithm maintains persistent state across retiles.

Memory algorithms (like DwindleMemory) remember per-split ratios and tree structure. The UI shows an indicator for memory-enabled algorithms.

Returns
true if the algorithm uses a persistent SplitTree (default: false)

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ supportsMinSizes()

virtual bool PhosphorTiles::TilingAlgorithm::supportsMinSizes ( ) const
virtualnoexcept

Whether this algorithm supports per-window minimum size constraints.

Most algorithms respect the minSizes parameter. Algorithms that ignore it (e.g., Floating Center, Tatami) return false so the settings UI can disable min-size controls for them.

Returns
true if the algorithm honors minSizes (default: true)

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ supportsSplitRatio()

virtual bool PhosphorTiles::TilingAlgorithm::supportsSplitRatio ( ) const
virtual

Check if algorithm supports split ratio adjustment.

If true, the master/stack ratio can be dynamically adjusted.

Returns
true if split ratio can be adjusted

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

◆ zoneNumberDisplay()

virtual QString PhosphorTiles::TilingAlgorithm::zoneNumberDisplay ( ) const
virtualnoexcept

How zone numbers should be displayed in previews.

Controls which zones show their number label in layout cards and previews. Values: "all" (default), "last", "first", "firstAndLast", "none"

Returns
Display mode string

Reimplemented in PhosphorTiles::ScriptedAlgorithm.

Member Data Documentation

◆ m_appIdResolver

std::function<QString(const QString&)> PhosphorTiles::TilingAlgorithm::m_appIdResolver
protected

◆ m_registryId

QString PhosphorTiles::TilingAlgorithm::m_registryId
protected

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