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

Represents a collection of zones that form a layout. More...

#include <PhosphorZones/Layout.h>

Inheritance diagram for PhosphorZones::Layout:
[legend]

Public Types

using ScreenIdResolver = std::function<QString(const QString&)>
 Screen-id resolver.

Signals

void nameChanged ()
void descriptionChanged ()
void zonePaddingChanged ()
void outerGapChanged ()
void showZoneNumbersChanged ()
void overlayDisplayModeChanged ()
void sourcePathChanged ()
void aspectRatioClassChanged ()
void hiddenFromSelectorChanged ()
void allowedScreensChanged ()
void allowedDesktopsChanged ()
void allowedActivitiesChanged ()
void autoAssignChanged ()
void useFullScreenGeometryChanged ()
void zonesChanged ()
void zoneAdded (Zone *zone)
void zoneRemoved (Zone *zone)
void layoutModified ()
void fixedGeometryInDevicePixelsChanged ()

Public Member Functions

 Layout (QObject *parent=nullptr)
 Layout (const QString &name, QObject *parent=nullptr)
 ~Layout () override
 Layout (const Layout &)=delete
Layout & operator= (const Layout &)=delete
Layout * clone (QObject *parent=nullptr) const
 Deep-copy this layout into a new, independently owned Layout.
QUuid id () const
QString name () const
void setName (const QString &name)
QString description () const
void setDescription (const QString &description)
int zonePadding () const
void setZonePadding (int padding)
bool hasZonePaddingOverride () const
void clearZonePaddingOverride ()
int outerGap () const
void setOuterGap (int gap)
bool hasOuterGapOverride () const
void clearOuterGapOverride ()
bool usePerSideOuterGap () const
void setUsePerSideOuterGap (bool enabled)
int outerGapTop () const
void setOuterGapTop (int gap)
int outerGapBottom () const
void setOuterGapBottom (int gap)
int outerGapLeft () const
void setOuterGapLeft (int gap)
int outerGapRight () const
void setOuterGapRight (int gap)
bool hasPerSideOuterGapOverride () const
::PhosphorLayout::EdgeGaps rawOuterGaps () const
 Raw per-side gap overrides.
bool showZoneNumbers () const
void setShowZoneNumbers (bool show)
int overlayDisplayMode () const
void setOverlayDisplayMode (int mode)
bool hasOverlayDisplayModeOverride () const
void clearOverlayDisplayModeOverride ()
QString sourcePath () const
void setSourcePath (const QString &path)
bool isSystemLayout () const
QString systemSourcePath () const
void setSystemSourcePath (const QString &path)
bool hasSystemOrigin () const
::PhosphorLayout::AspectRatioClass aspectRatioClass () const
void setAspectRatioClass (::PhosphorLayout::AspectRatioClass cls)
int aspectRatioClassInt () const
void setAspectRatioClassInt (int cls)
qreal minAspectRatio () const
void setMinAspectRatio (qreal ratio)
qreal maxAspectRatio () const
void setMaxAspectRatio (qreal ratio)
bool matchesAspectRatio (qreal screenAspectRatio) const
 Check if this layout is suitable for a screen with the given aspect ratio.
bool hiddenFromSelector () const
void setHiddenFromSelector (bool hidden)
QStringList allowedScreens () const
void setAllowedScreens (const QStringList &screens)
QList< int > allowedDesktops () const
void setAllowedDesktops (const QList< int > &desktops)
QStringList allowedActivities () const
void setAllowedActivities (const QStringList &activities)
bool autoAssign () const
void setAutoAssign (bool enabled)
bool useFullScreenGeometry () const
void setUseFullScreenGeometry (bool enabled)
bool fixedGeometryInDevicePixels () const
 Whether this layout's fixed-geometry zones count DEVICE pixels.
void setFixedGeometryInDevicePixels (bool enabled)
qreal fixedGeometryDivisor (qreal screenScale) const
 What a fixed geometry is divided by on an output whose logical scale is screenScale: that scale when fixedGeometryInDevicePixels() is on and the scale is usable, 1.0 otherwise.
bool hasFixedGeometryZones () const
 Returns true if any zone uses fixed (pixel) geometry mode.
QRectF fixedZoneBoundingBox () const
 Bounding box of all fixed-geometry zones, anchored at (0, 0), in the LOGICAL units of the last recalculation: device-pixel geometry is divided by lastRecalcScale() so the box compares with lastRecalcGeometry().
QRectF fixedZoneReferenceGeometry () const
 Reference geometry suitable for normalizing fixed-pixel zones to 0–1 relative coordinates.
int defaultOrder () const
void setDefaultOrder (int order)
int zoneCount () const
QVector< Zone * > zones () const
Zone * zone (int index) const
Zone * zoneById (const QUuid &id) const
Zone * zoneByNumber (int number) const
Zone * zoneByName (const QString &name) const
 First zone (in zone-number order) whose name equals name after trimming, compared case-insensitively.
void addZone (Zone *zone)
void removeZone (Zone *zone)
void removeZoneAt (int index)
void clearZones ()
void moveZone (int fromIndex, int toIndex)
Zone * zoneAtPoint (const QPointF &point) const
Zone * nearestZone (const QPointF &point, qreal maxDistance=-1) const
QVector< Zone * > zonesInRect (const QRectF &rect) const
QVector< Zone * > adjacentZones (const QPointF &point, qreal threshold=20) const
void renumberZones ()
QRectF lastRecalcGeometry () const
void setLastRecalcGeometry (const QRectF &geom, qreal screenScale=0.0)
 Stamps the rect, and a positive screenScale as the scale with it.
bool needsRecalc (const QRectF &screenGeometry, qreal screenScale=0.0) const
 The complete staleness predicate recalculateZoneGeometries() gates on: the screen rect changed OR the zone geometry inputs changed since the last pass (m_zoneGeometryDirty: a zone-set edit or a flip of the fixed-geometry unit).
qreal lastRecalcScale () const
 The newest output scale a recalculation was asked for (1.0 until a scale is known).
quint64 zoneGeometryEpoch () const
 Bumped when the zone set changes (a zone added, removed or replaced) or the fixed-geometry unit flips, each of which also sets the dirty bit needsRecalc() reads.
quint64 syncRecalcEpoch () const
 Bumped by every recalculateZoneGeometries() call, including one that finds nothing to recompute, because each call records the frame its caller wants now.
void markRecalculated (const QRectF &geom, qreal screenScale=0.0)
 Full-recalc bookkeeping for external appliers (the async worker path): stamps the rect AND clears the dirty bit, exactly as recalculateZoneGeometries() does internally.
QJsonObject toJson () const
bool isDirty () const
void markDirty ()
void clearDirty ()
void beginBatchModify ()
void endBatchModify ()
void recalculateZoneGeometries (const QRectF &screenGeometry, qreal screenScale=0.0)
 Recalculate every zone's absolute geometry against screenGeometry.

Static Public Member Functions

static Layout * fromJson (const QJsonObject &json, QObject *parent=nullptr)
static void setScreenIdResolver (ScreenIdResolver resolver)
static ScreenIdResolver screenIdResolver ()
 Returns a copy of the currently-installed resolver (empty if none).
static Layout * createColumnsLayout (int columns, QObject *parent=nullptr)
static Layout * createRowsLayout (int rows, QObject *parent=nullptr)
static Layout * createGridLayout (int columns, int rows, QObject *parent=nullptr)
static Layout * createPriorityGridLayout (QObject *parent=nullptr)
static Layout * createFocusLayout (QObject *parent=nullptr)

Static Public Attributes

static constexpr int DefaultOrderUnset = 999
 Sentinel for "no explicit default order set" on defaultOrder.

Detailed Description

Represents a collection of zones that form a layout.

Layouts can be assigned to specific monitors, virtual desktops, and activities. Supports both predefined templates and custom canvas-style layouts.

Member Typedef Documentation

◆ ScreenIdResolver

using PhosphorZones::Layout::ScreenIdResolver = std::function<QString(const QString&)>

Screen-id resolver.

Install a callback that maps a legacy connector name (e.g. "DP-2") to the application's stable screen identifier (EDID-based, "LG:Model:Serial"). The library calls it for every entry in allowedScreens during fromJson so in-memory layouts hold normalized IDs regardless of what the file stores.

The callback typically requires a live QGuiApplication (to enumerate connected QScreens). Install from the daemon / editor / settings processes only; leave unset for headless / test code, in which case strings are stored verbatim.

Passing a default-constructed function clears the resolver.

Constructor & Destructor Documentation

◆ Layout() [1/3]

PhosphorZones::Layout::Layout ( QObject * parent = nullptr)
explicit

◆ Layout() [2/3]

PhosphorZones::Layout::Layout ( const QString & name,
QObject * parent = nullptr )
explicit

◆ ~Layout()

PhosphorZones::Layout::~Layout ( )
override

◆ Layout() [3/3]

PhosphorZones::Layout::Layout ( const Layout & )
delete

Member Function Documentation

◆ addZone()

void PhosphorZones::Layout::addZone ( Zone * zone)

◆ adjacentZones()

QVector< Zone * > PhosphorZones::Layout::adjacentZones ( const QPointF & point,
qreal threshold = 20 ) const

◆ allowedActivities()

QStringList PhosphorZones::Layout::allowedActivities ( ) const
inline

◆ allowedActivitiesChanged

void PhosphorZones::Layout::allowedActivitiesChanged ( )
signal

◆ allowedDesktops()

QList< int > PhosphorZones::Layout::allowedDesktops ( ) const
inline

◆ allowedDesktopsChanged

void PhosphorZones::Layout::allowedDesktopsChanged ( )
signal

◆ allowedScreens()

QStringList PhosphorZones::Layout::allowedScreens ( ) const
inline

◆ allowedScreensChanged

void PhosphorZones::Layout::allowedScreensChanged ( )
signal

◆ aspectRatioClass()

::PhosphorLayout::AspectRatioClass PhosphorZones::Layout::aspectRatioClass ( ) const
inline

◆ aspectRatioClassChanged

void PhosphorZones::Layout::aspectRatioClassChanged ( )
signal

◆ aspectRatioClassInt()

int PhosphorZones::Layout::aspectRatioClassInt ( ) const
inline

◆ autoAssign()

bool PhosphorZones::Layout::autoAssign ( ) const
inline

◆ autoAssignChanged

void PhosphorZones::Layout::autoAssignChanged ( )
signal

◆ beginBatchModify()

void PhosphorZones::Layout::beginBatchModify ( )

◆ clearDirty()

void PhosphorZones::Layout::clearDirty ( )
inline

◆ clearOuterGapOverride()

void PhosphorZones::Layout::clearOuterGapOverride ( )

◆ clearOverlayDisplayModeOverride()

void PhosphorZones::Layout::clearOverlayDisplayModeOverride ( )

◆ clearZonePaddingOverride()

void PhosphorZones::Layout::clearZonePaddingOverride ( )

◆ clearZones()

void PhosphorZones::Layout::clearZones ( )

◆ clone()

Layout * PhosphorZones::Layout::clone ( QObject * parent = nullptr) const

Deep-copy this layout into a new, independently owned Layout.

The clone represents a distinct USER-owned layout: it gets a fresh id, and it deliberately carries over neither sourcePath nor systemSourcePath, so a clone of a system layout is a plain user layout and the "restore system original" path cannot mistake it for a user override of the same entry. Its zones are deep-copied (Zone::clone).

parent is the clone's QObject owner and defaults to none. Pass the registry that will hold it, or leave it unparented and let the registry's addLayout() take ownership — do NOT pass the SOURCE's parent by reflex: the clone would appear as a child of a registry that never inserted it into its own layout list.

◆ createColumnsLayout()

Layout * PhosphorZones::Layout::createColumnsLayout ( int columns,
QObject * parent = nullptr )
static

◆ createFocusLayout()

Layout * PhosphorZones::Layout::createFocusLayout ( QObject * parent = nullptr)
static

◆ createGridLayout()

Layout * PhosphorZones::Layout::createGridLayout ( int columns,
int rows,
QObject * parent = nullptr )
static

◆ createPriorityGridLayout()

Layout * PhosphorZones::Layout::createPriorityGridLayout ( QObject * parent = nullptr)
static

◆ createRowsLayout()

Layout * PhosphorZones::Layout::createRowsLayout ( int rows,
QObject * parent = nullptr )
static

◆ defaultOrder()

int PhosphorZones::Layout::defaultOrder ( ) const
inline

◆ description()

QString PhosphorZones::Layout::description ( ) const
inline

◆ descriptionChanged

void PhosphorZones::Layout::descriptionChanged ( )
signal

◆ endBatchModify()

void PhosphorZones::Layout::endBatchModify ( )

◆ fixedGeometryDivisor()

qreal PhosphorZones::Layout::fixedGeometryDivisor ( qreal screenScale) const
inline

What a fixed geometry is divided by on an output whose logical scale is screenScale: that scale when fixedGeometryInDevicePixels() is on and the scale is usable, 1.0 otherwise.

The single definition every resolver shares, so a fixed zone cannot be read in two units, and Zone::fixedGeometryToLogical() applies it.

The scale is taken as given: a non-positive one is "no scale" and answers 1.0. Zone::fixedGeometryDivisor() differs on purpose, because it reads a zero scale as "the scale of the last recalculation" and asks this function with that one instead.

◆ fixedGeometryInDevicePixels()

bool PhosphorZones::Layout::fixedGeometryInDevicePixels ( ) const
inline

Whether this layout's fixed-geometry zones count DEVICE pixels.

Off (the default, and every layout written before the option existed), a fixed zone's numbers are logical pixels like every other size in the desktop, so the zone scales with the display. On, they are the output's own pixels and are divided by its scale when resolved, so a zone keeps its size on the panel whatever scaling the display runs at.

◆ fixedGeometryInDevicePixelsChanged

void PhosphorZones::Layout::fixedGeometryInDevicePixelsChanged ( )
signal

◆ fixedZoneBoundingBox()

QRectF PhosphorZones::Layout::fixedZoneBoundingBox ( ) const

Bounding box of all fixed-geometry zones, anchored at (0, 0), in the LOGICAL units of the last recalculation: device-pixel geometry is divided by lastRecalcScale() so the box compares with lastRecalcGeometry().

Empty rect if no fixed-geometry zones exist.

◆ fixedZoneReferenceGeometry()

QRectF PhosphorZones::Layout::fixedZoneReferenceGeometry ( ) const

Reference geometry suitable for normalizing fixed-pixel zones to 0–1 relative coordinates.

Returns lastRecalcGeometry() when it accommodates fixedZoneBoundingBox(), with less than one logical pixel of slack so a device-pixel box that exactly fills the screen still fits after the division by a fractional scale. Falls back to the bounding box in exactly two cases: the fixed zones overflow the last recalculation rect, or no rect is known yet. It does not detect a stale rect that still happens to hold the box. Empty rect when the layout has no fixed-geometry zones.

◆ fromJson()

Layout * PhosphorZones::Layout::fromJson ( const QJsonObject & json,
QObject * parent = nullptr )
static

◆ hasFixedGeometryZones()

bool PhosphorZones::Layout::hasFixedGeometryZones ( ) const

Returns true if any zone uses fixed (pixel) geometry mode.

◆ hasOuterGapOverride()

bool PhosphorZones::Layout::hasOuterGapOverride ( ) const
inline

◆ hasOverlayDisplayModeOverride()

bool PhosphorZones::Layout::hasOverlayDisplayModeOverride ( ) const
inline

◆ hasPerSideOuterGapOverride()

bool PhosphorZones::Layout::hasPerSideOuterGapOverride ( ) const
inline

◆ hasSystemOrigin()

bool PhosphorZones::Layout::hasSystemOrigin ( ) const
inline

◆ hasZonePaddingOverride()

bool PhosphorZones::Layout::hasZonePaddingOverride ( ) const
inline

◆ hiddenFromSelector()

bool PhosphorZones::Layout::hiddenFromSelector ( ) const
inline

◆ hiddenFromSelectorChanged

void PhosphorZones::Layout::hiddenFromSelectorChanged ( )
signal

◆ id()

QUuid PhosphorZones::Layout::id ( ) const
inline

◆ isDirty()

bool PhosphorZones::Layout::isDirty ( ) const
inline

◆ isSystemLayout()

bool PhosphorZones::Layout::isSystemLayout ( ) const

◆ lastRecalcGeometry()

QRectF PhosphorZones::Layout::lastRecalcGeometry ( ) const
inline

◆ lastRecalcScale()

qreal PhosphorZones::Layout::lastRecalcScale ( ) const
inline

The newest output scale a recalculation was asked for (1.0 until a scale is known).

A recalculation asked with a positive scale stamps it, the ones that find nothing to recompute included, so a reader that divides by it (the bounding box, the serialized relative hint, the variant lists) holds the output's current scale even on a layout the scale cannot move. A call with scale zero keeps the last one, and an async result a later sync recalculation superseded stamps nothing.

◆ layoutModified

void PhosphorZones::Layout::layoutModified ( )
signal

◆ markDirty()

void PhosphorZones::Layout::markDirty ( )
inline

◆ markRecalculated()

void PhosphorZones::Layout::markRecalculated ( const QRectF & geom,
qreal screenScale = 0.0 )
inline

Full-recalc bookkeeping for external appliers (the async worker path): stamps the rect AND clears the dirty bit, exactly as recalculateZoneGeometries() does internally.

Use only when the applied geometries were computed from the layout's current inputs, that is at the current zoneGeometryEpoch(). A positive screenScale is stamped as the scale too; zero keeps the last one.

◆ matchesAspectRatio()

bool PhosphorZones::Layout::matchesAspectRatio ( qreal screenAspectRatio) const

Check if this layout is suitable for a screen with the given aspect ratio.

Uses explicit min/max bounds if set, otherwise falls back to class matching.

◆ maxAspectRatio()

qreal PhosphorZones::Layout::maxAspectRatio ( ) const
inline

◆ minAspectRatio()

qreal PhosphorZones::Layout::minAspectRatio ( ) const
inline

◆ moveZone()

void PhosphorZones::Layout::moveZone ( int fromIndex,
int toIndex )

◆ name()

QString PhosphorZones::Layout::name ( ) const
inline

◆ nameChanged

void PhosphorZones::Layout::nameChanged ( )
signal

◆ nearestZone()

Zone * PhosphorZones::Layout::nearestZone ( const QPointF & point,
qreal maxDistance = -1 ) const

◆ needsRecalc()

bool PhosphorZones::Layout::needsRecalc ( const QRectF & screenGeometry,
qreal screenScale = 0.0 ) const
inline

The complete staleness predicate recalculateZoneGeometries() gates on: the screen rect changed OR the zone geometry inputs changed since the last pass (m_zoneGeometryDirty: a zone-set edit or a flip of the fixed-geometry unit).

Callers that skip work when a recalc "already happened" MUST use this, not a bare lastRecalcGeometry() comparison — the rect alone reads as fresh after a zone add/remove at unchanged screen geometry, leaving the new zones with no absolute geometry.

The output's logical scale screenScale is an input too, because a device-pixel layout resolves its fixed zones differently at the same logical rect once the scale moves (and the scale settles only after an output's sensor maps, with the rect unchanged). A layout whose fixed geometry is logical, or that has no fixed zone at all, ignores the scale, since it cannot change anything for it. Zero (the default) asks about the rect and the inputs alone.

◆ operator=()

Layout & PhosphorZones::Layout::operator= ( const Layout & )
delete

◆ outerGap()

int PhosphorZones::Layout::outerGap ( ) const
inline

◆ outerGapBottom()

int PhosphorZones::Layout::outerGapBottom ( ) const
inline

◆ outerGapChanged

void PhosphorZones::Layout::outerGapChanged ( )
signal

◆ outerGapLeft()

int PhosphorZones::Layout::outerGapLeft ( ) const
inline

◆ outerGapRight()

int PhosphorZones::Layout::outerGapRight ( ) const
inline

◆ outerGapTop()

int PhosphorZones::Layout::outerGapTop ( ) const
inline

◆ overlayDisplayMode()

int PhosphorZones::Layout::overlayDisplayMode ( ) const
inline

◆ overlayDisplayModeChanged

void PhosphorZones::Layout::overlayDisplayModeChanged ( )
signal

◆ rawOuterGaps()

::PhosphorLayout::EdgeGaps PhosphorZones::Layout::rawOuterGaps ( ) const
inline

Raw per-side gap overrides.

Values may be -1 (use global). Callers should use GeometryUtils::getEffectiveOuterGaps() instead for resolved pixel values.

◆ recalculateZoneGeometries()

void PhosphorZones::Layout::recalculateZoneGeometries ( const QRectF & screenGeometry,
qreal screenScale = 0.0 )

Recalculate every zone's absolute geometry against screenGeometry.

Public, and nothing restricts who calls it. Daemon code goes through LayoutComputeService::recalculateSync by convention, and the editor calls it directly on a temporary layout it owns. A direct call on a layout the compute service also tracks is safe: it bumps syncRecalcEpoch(), and the service will not let an async result asked for before the call overwrite the frame it stamps. Call it on the GUI thread only, as with every other Layout member.

screenScale is the logical scale of the output screenGeometry belongs to, which a device-pixel layout divides its fixed geometries by. Zero (the default) keeps the scale of the last recalculation.

◆ removeZone()

void PhosphorZones::Layout::removeZone ( Zone * zone)

◆ removeZoneAt()

void PhosphorZones::Layout::removeZoneAt ( int index)

◆ renumberZones()

void PhosphorZones::Layout::renumberZones ( )

◆ screenIdResolver()

ScreenIdResolver PhosphorZones::Layout::screenIdResolver ( )
static

Returns a copy of the currently-installed resolver (empty if none).

Returning a copy rather than a reference keeps readers race-free against a concurrent setScreenIdResolver on another thread — the resolver itself is guarded internally, and the returned copy can be invoked without holding the lock.

◆ setAllowedActivities()

void PhosphorZones::Layout::setAllowedActivities ( const QStringList & activities)

◆ setAllowedDesktops()

void PhosphorZones::Layout::setAllowedDesktops ( const QList< int > & desktops)

◆ setAllowedScreens()

void PhosphorZones::Layout::setAllowedScreens ( const QStringList & screens)

◆ setAspectRatioClass()

void PhosphorZones::Layout::setAspectRatioClass ( ::PhosphorLayout::AspectRatioClass cls)

◆ setAspectRatioClassInt()

void PhosphorZones::Layout::setAspectRatioClassInt ( int cls)

◆ setAutoAssign()

void PhosphorZones::Layout::setAutoAssign ( bool enabled)

◆ setDefaultOrder()

void PhosphorZones::Layout::setDefaultOrder ( int order)
inline

◆ setDescription()

void PhosphorZones::Layout::setDescription ( const QString & description)

◆ setFixedGeometryInDevicePixels()

void PhosphorZones::Layout::setFixedGeometryInDevicePixels ( bool enabled)

◆ setHiddenFromSelector()

void PhosphorZones::Layout::setHiddenFromSelector ( bool hidden)

◆ setLastRecalcGeometry()

void PhosphorZones::Layout::setLastRecalcGeometry ( const QRectF & geom,
qreal screenScale = 0.0 )
inline

Stamps the rect, and a positive screenScale as the scale with it.

◆ setMaxAspectRatio()

void PhosphorZones::Layout::setMaxAspectRatio ( qreal ratio)

◆ setMinAspectRatio()

void PhosphorZones::Layout::setMinAspectRatio ( qreal ratio)

◆ setName()

void PhosphorZones::Layout::setName ( const QString & name)

◆ setOuterGap()

void PhosphorZones::Layout::setOuterGap ( int gap)

◆ setOuterGapBottom()

void PhosphorZones::Layout::setOuterGapBottom ( int gap)

◆ setOuterGapLeft()

void PhosphorZones::Layout::setOuterGapLeft ( int gap)

◆ setOuterGapRight()

void PhosphorZones::Layout::setOuterGapRight ( int gap)

◆ setOuterGapTop()

void PhosphorZones::Layout::setOuterGapTop ( int gap)

◆ setOverlayDisplayMode()

void PhosphorZones::Layout::setOverlayDisplayMode ( int mode)

◆ setScreenIdResolver()

void PhosphorZones::Layout::setScreenIdResolver ( ScreenIdResolver resolver)
static

◆ setShowZoneNumbers()

void PhosphorZones::Layout::setShowZoneNumbers ( bool show)

◆ setSourcePath()

void PhosphorZones::Layout::setSourcePath ( const QString & path)

◆ setSystemSourcePath()

void PhosphorZones::Layout::setSystemSourcePath ( const QString & path)
inline

◆ setUseFullScreenGeometry()

void PhosphorZones::Layout::setUseFullScreenGeometry ( bool enabled)

◆ setUsePerSideOuterGap()

void PhosphorZones::Layout::setUsePerSideOuterGap ( bool enabled)

◆ setZonePadding()

void PhosphorZones::Layout::setZonePadding ( int padding)

◆ showZoneNumbers()

bool PhosphorZones::Layout::showZoneNumbers ( ) const
inline

◆ showZoneNumbersChanged

void PhosphorZones::Layout::showZoneNumbersChanged ( )
signal

◆ sourcePath()

QString PhosphorZones::Layout::sourcePath ( ) const
inline

◆ sourcePathChanged

void PhosphorZones::Layout::sourcePathChanged ( )
signal

◆ syncRecalcEpoch()

quint64 PhosphorZones::Layout::syncRecalcEpoch ( ) const
inline

Bumped by every recalculateZoneGeometries() call, including one that finds nothing to recompute, because each call records the frame its caller wants now.

An async result whose snapshot was taken before the bump was asked for earlier, so it must not overwrite that frame.

◆ systemSourcePath()

QString PhosphorZones::Layout::systemSourcePath ( ) const
inline

◆ toJson()

QJsonObject PhosphorZones::Layout::toJson ( ) const

◆ useFullScreenGeometry()

bool PhosphorZones::Layout::useFullScreenGeometry ( ) const
inline

◆ useFullScreenGeometryChanged

void PhosphorZones::Layout::useFullScreenGeometryChanged ( )
signal

◆ usePerSideOuterGap()

bool PhosphorZones::Layout::usePerSideOuterGap ( ) const
inline

◆ zone()

Zone * PhosphorZones::Layout::zone ( int index) const

◆ zoneAdded

void PhosphorZones::Layout::zoneAdded ( Zone * zone)
signal

◆ zoneAtPoint()

Zone * PhosphorZones::Layout::zoneAtPoint ( const QPointF & point) const

◆ zoneById()

Zone * PhosphorZones::Layout::zoneById ( const QUuid & id) const

◆ zoneByName()

Zone * PhosphorZones::Layout::zoneByName ( const QString & name) const

First zone (in zone-number order) whose name equals name after trimming, compared case-insensitively.

Zone names are not unique, so a duplicate name resolves to the lowest-numbered zone. Returns nullptr for a blank name or no match.

◆ zoneByNumber()

Zone * PhosphorZones::Layout::zoneByNumber ( int number) const

◆ zoneCount()

int PhosphorZones::Layout::zoneCount ( ) const
inline

◆ zoneGeometryEpoch()

quint64 PhosphorZones::Layout::zoneGeometryEpoch ( ) const
inline

Bumped when the zone set changes (a zone added, removed or replaced) or the fixed-geometry unit flips, each of which also sets the dirty bit needsRecalc() reads.

A per-zone setter on an existing zone does not bump it. The async compute path carries it through the worker, so a result computed from an older zone set is never mistaken for one that covers the current zones, even when the zone ids match.

◆ zonePadding()

int PhosphorZones::Layout::zonePadding ( ) const
inline

◆ zonePaddingChanged

void PhosphorZones::Layout::zonePaddingChanged ( )
signal

◆ zoneRemoved

void PhosphorZones::Layout::zoneRemoved ( Zone * zone)
signal

◆ zones()

QVector< Zone * > PhosphorZones::Layout::zones ( ) const
inline

◆ zonesChanged

void PhosphorZones::Layout::zonesChanged ( )
signal

◆ zonesInRect()

QVector< Zone * > PhosphorZones::Layout::zonesInRect ( const QRectF & rect) const

Member Data Documentation

◆ DefaultOrderUnset

int PhosphorZones::Layout::DefaultOrderUnset = 999
staticconstexpr

Sentinel for "no explicit default order set" on defaultOrder.

Ordering is ascending (lower sorts first), so an unset layout has to sort after every ordered one. This is a large value rather than a negative one for that reason. Unset layouts are also omitted from toJson, so the key is absent rather than written out as a magic number.


The documentation for this class was generated from the following file:
  • phosphor-zones/include/PhosphorZones/Layout.h