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

Enumeration + mutation surface for the in-memory zone-layout catalog. More...

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

Inheritance diagram for PhosphorZones::IZoneLayoutRegistry:
[legend]

Signals

void layoutAdded (Layout *layout)
 
void layoutRemoved (Layout *layout)
 
void activeLayoutChanged (Layout *layout)
 
void layoutAssigned (const QString &screenId, int virtualDesktop, Layout *layout)
 
- Signals inherited from PhosphorLayout::ILayoutSourceRegistry
void contentsChanged ()
 Emitted when the set of layouts this registry produces changes in any way that invalidates cached previews — entries added, removed, renamed, or re-parameterised.
 

Public Member Functions

 IZoneLayoutRegistry (QObject *parent=nullptr)
 
 ~IZoneLayoutRegistry () override
 
virtual QVector< Layout * > layouts () const =0
 Enumerate every known layout.
 
virtual int layoutCount () const =0
 
virtual Layoutlayout (int index) const =0
 
virtual LayoutlayoutByName (const QString &name) const =0
 
virtual LayoutlayoutById (const QUuid &id) const =0
 Resolve a layout by its stable UUID.
 
virtual void addLayout (Layout *layout)=0
 
virtual void removeLayout (Layout *layout)=0
 
virtual void removeLayoutById (const QUuid &id)=0
 
virtual LayoutduplicateLayout (Layout *source)=0
 
virtual LayoutactiveLayout () const =0
 
virtual void setActiveLayout (Layout *layout)=0
 
virtual void setActiveLayoutById (const QUuid &id)=0
 
virtual LayoutlayoutForScreen (const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const =0
 Cascade-resolve the manual layout for screenId.
 
virtual LayoutresolveLayoutForScreen (const QString &screenId) const =0
 Convenience: resolve a layout using the registry's current (desktop, activity) context.
 
virtual QString assignmentIdForScreen (const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const =0
 Raw assignment id (manual-layout UUID or "autotile:<algorithmId>") for screenId, with cascade + level-1 provider fallback.
 
virtual LayoutdefaultLayout () const =0
 Effective global default layout (snap-only fallback).
 
virtual int currentVirtualDesktop () const =0
 
virtual int currentVirtualDesktopForScreen (const QString &screenId) const
 This screen's current virtual desktop (Plasma 6.7 per-output virtual desktops, #648).
 
virtual QString currentActivity () const =0
 
virtual QJsonObject loadAutotileOverrides (const QString &algorithmId) const
 Per-algorithm autotile settings (gaps, shader, hiddenFromSelector, …) stored in the unified layout-settings.json sidecar, keyed by raw algorithm id.
 
virtual QString tilingAlgorithmForScreen (const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const
 Raw id of the tiling algorithm active for the (screenId, virtualDesktop, activity) context, or empty when none resolves.
 
virtual ContextGapOverride resolveContextGaps (const QString &screenId, int virtualDesktop, const QString &activity) const
 Resolve the per-context gap override (zone padding + outer gaps) that window rules pin for the (screenId, virtualDesktop, activity) context — the same resolution the daemon's geometry resolver uses on the snap-commit path.
 
virtual bool resolveContextLocked (const QString &screenId, int virtualDesktop, const QString &activity) const
 Resolve whether window rules lock the active layout for the (screenId, virtualDesktop, activity) context — the rule-driven counterpart to the manual ToggleLayoutLock shortcut.
 
virtual bool isContextActiveLayoutSuppressed (const QString &screenId, int virtualDesktop, const QString &activity) const
 True iff the (screenId, virtualDesktop, activity) context has no active layout specifically because the default assignment is suppressed — globally or by a per-context DefaultLayoutAssignment rule.
 
virtual ContextOverlayOverride resolveContextOverlay (const QString &screenId, int virtualDesktop, const QString &activity) const
 Resolve the per-context overlay-property override for the (screenId, virtualDesktop, activity) context — a per-slot read across all matching context rules (mirrors resolveContextGaps), so independent shader / style rules compose.
 
- Public Member Functions inherited from PhosphorLayout::ILayoutSourceRegistry
 ILayoutSourceRegistry (QObject *parent=nullptr)
 
 ~ILayoutSourceRegistry () override
 

Detailed Description

Enumeration + mutation surface for the in-memory zone-layout catalog.

Fixture tests can stub this contract without implementing persistence / assignments / quick-slots.

Constructor & Destructor Documentation

◆ IZoneLayoutRegistry()

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

◆ ~IZoneLayoutRegistry()

PhosphorZones::IZoneLayoutRegistry::~IZoneLayoutRegistry ( )
override

Member Function Documentation

◆ activeLayout()

virtual Layout * PhosphorZones::IZoneLayoutRegistry::activeLayout ( ) const
pure virtual

◆ activeLayoutChanged

void PhosphorZones::IZoneLayoutRegistry::activeLayoutChanged ( Layout layout)
signal

◆ addLayout()

virtual void PhosphorZones::IZoneLayoutRegistry::addLayout ( Layout layout)
pure virtual
Parameters
layoutOwnership transferred - the registry adopts layout and is responsible for its lifetime from this call on.

Implemented in PhosphorZones::LayoutRegistry.

◆ assignmentIdForScreen()

virtual QString PhosphorZones::IZoneLayoutRegistry::assignmentIdForScreen ( const QString &  screenId,
int  virtualDesktop = 0,
const QString &  activity = QString() 
) const
pure virtual

Raw assignment id (manual-layout UUID or "autotile:<algorithmId>") for screenId, with cascade + level-1 provider fallback.

Implemented in PhosphorZones::LayoutRegistry.

◆ currentActivity()

virtual QString PhosphorZones::IZoneLayoutRegistry::currentActivity ( ) const
pure virtual

◆ currentVirtualDesktop()

virtual int PhosphorZones::IZoneLayoutRegistry::currentVirtualDesktop ( ) const
pure virtual

◆ currentVirtualDesktopForScreen()

virtual int PhosphorZones::IZoneLayoutRegistry::currentVirtualDesktopForScreen ( const QString &  screenId) const
inlinevirtual

This screen's current virtual desktop (Plasma 6.7 per-output virtual desktops, #648).

Default ignores the screen and returns the global currentVirtualDesktop(), so non-per-output implementers are unaffected.

Reimplemented in PhosphorZones::LayoutRegistry.

◆ defaultLayout()

virtual Layout * PhosphorZones::IZoneLayoutRegistry::defaultLayout ( ) const
pure virtual

Effective global default layout (snap-only fallback).

Implemented in PhosphorZones::LayoutRegistry.

◆ duplicateLayout()

virtual Layout * PhosphorZones::IZoneLayoutRegistry::duplicateLayout ( Layout source)
pure virtual
Parameters
sourceBorrowed - caller retains ownership.
Returns
Newly allocated copy; ownership transferred to the registry (mirrors addLayout semantics). Returns nullptr if source is unknown.

Implemented in PhosphorZones::LayoutRegistry.

◆ isContextActiveLayoutSuppressed()

virtual bool PhosphorZones::IZoneLayoutRegistry::isContextActiveLayoutSuppressed ( const QString &  screenId,
int  virtualDesktop,
const QString &  activity 
) const
inlinevirtual

True iff the (screenId, virtualDesktop, activity) context has no active layout specifically because the default assignment is suppressed — globally or by a per-context DefaultLayoutAssignment rule.

Daemon overlay / display paths that otherwise fall back to defaultLayout on a missing assignment use this to treat a suppressed context as "no layout, engine inactive" without regressing other empty-assignment states. The default returns false (a stub registry never suppresses).

Reimplemented in PhosphorZones::LayoutRegistry.

◆ layout()

virtual Layout * PhosphorZones::IZoneLayoutRegistry::layout ( int  index) const
pure virtual

◆ layoutAdded

void PhosphorZones::IZoneLayoutRegistry::layoutAdded ( Layout layout)
signal

◆ layoutAssigned

void PhosphorZones::IZoneLayoutRegistry::layoutAssigned ( const QString &  screenId,
int  virtualDesktop,
Layout layout 
)
signal

◆ layoutById()

virtual Layout * PhosphorZones::IZoneLayoutRegistry::layoutById ( const QUuid &  id) const
pure virtual

Resolve a layout by its stable UUID.

Returns nullptr when no layout with that id is known to the registry.

Implemented in PhosphorZones::LayoutRegistry.

◆ layoutByName()

virtual Layout * PhosphorZones::IZoneLayoutRegistry::layoutByName ( const QString &  name) const
pure virtual

◆ layoutCount()

virtual int PhosphorZones::IZoneLayoutRegistry::layoutCount ( ) const
pure virtual

◆ layoutForScreen()

virtual Layout * PhosphorZones::IZoneLayoutRegistry::layoutForScreen ( const QString &  screenId,
int  virtualDesktop = 0,
const QString &  activity = QString() 
) const
pure virtual

Cascade-resolve the manual layout for screenId.

Returns defaultLayout() when no explicit assignment matches.

Implemented in PhosphorZones::LayoutRegistry.

◆ layoutRemoved

void PhosphorZones::IZoneLayoutRegistry::layoutRemoved ( Layout layout)
signal

◆ layouts()

virtual QVector< Layout * > PhosphorZones::IZoneLayoutRegistry::layouts ( ) const
pure virtual

Enumerate every known layout.

Borrowed pointers - owned by the concrete registry (typically LayoutManager). Order is the registry's natural iteration order.

Implemented in PhosphorZones::LayoutRegistry.

◆ loadAutotileOverrides()

virtual QJsonObject PhosphorZones::IZoneLayoutRegistry::loadAutotileOverrides ( const QString &  algorithmId) const
inlinevirtual

Per-algorithm autotile settings (gaps, shader, hiddenFromSelector, …) stored in the unified layout-settings.json sidecar, keyed by raw algorithm id.

Default returns empty so non-persisting implementers and the unified-list builder degrade to "no overrides". Concrete registries (LayoutRegistry) read the sidecar.

Reimplemented in PhosphorZones::LayoutRegistry.

◆ removeLayout()

virtual void PhosphorZones::IZoneLayoutRegistry::removeLayout ( Layout layout)
pure virtual
Parameters
layoutBorrowed - caller hands the pointer in; the registry un-registers it and schedules deletion via deleteLater (matching how the registry adopted it in addLayout). Callers must drop any other references before this call returns.

Implemented in PhosphorZones::LayoutRegistry.

◆ removeLayoutById()

virtual void PhosphorZones::IZoneLayoutRegistry::removeLayoutById ( const QUuid &  id)
pure virtual

◆ resolveContextGaps()

virtual ContextGapOverride PhosphorZones::IZoneLayoutRegistry::resolveContextGaps ( const QString &  screenId,
int  virtualDesktop,
const QString &  activity 
) const
inlinevirtual

Resolve the per-context gap override (zone padding + outer gaps) that window rules pin for the (screenId, virtualDesktop, activity) context — the same resolution the daemon's geometry resolver uses on the snap-commit path.

Context-aware geometry consumers (drag preview, empty- zone overlay, zone-detection query) call this through the interface so their geometry matches the committed result. The default returns an empty override (no rule gaps); a registry that does not model context rules — e.g. a fixture stub — keeps the legacy per-screen/layout/global cascade.

Reimplemented in PhosphorZones::LayoutRegistry.

◆ resolveContextLocked()

virtual bool PhosphorZones::IZoneLayoutRegistry::resolveContextLocked ( const QString &  screenId,
int  virtualDesktop,
const QString &  activity 
) const
inlinevirtual

Resolve whether window rules lock the active layout for the (screenId, virtualDesktop, activity) context — the rule-driven counterpart to the manual ToggleLayoutLock shortcut.

A context rule carrying an ActionType::LockContext action whose value is true locks the context; the daemon ORs this into its context-lock check (across both engine modes) so a locked context refuses layout switches. Mode- agnostic and never persisted. The default returns false (no rule lock); a registry that does not model context rules — e.g. a fixture stub — keeps only the persisted manual-lock behaviour.

Reimplemented in PhosphorZones::LayoutRegistry.

◆ resolveContextOverlay()

virtual ContextOverlayOverride PhosphorZones::IZoneLayoutRegistry::resolveContextOverlay ( const QString &  screenId,
int  virtualDesktop,
const QString &  activity 
) const
inlinevirtual

Resolve the per-context overlay-property override for the (screenId, virtualDesktop, activity) context — a per-slot read across all matching context rules (mirrors resolveContextGaps), so independent shader / style rules compose.

The overlay service applies a populated field over the active layout's own value. The default returns an empty override (no rule overlay overrides); a registry that does not model context rules — e.g. a fixture stub — keeps the layout's own overlay properties.

Reimplemented in PhosphorZones::LayoutRegistry.

◆ resolveLayoutForScreen()

virtual Layout * PhosphorZones::IZoneLayoutRegistry::resolveLayoutForScreen ( const QString &  screenId) const
pure virtual

Convenience: resolve a layout using the registry's current (desktop, activity) context.

Implemented in PhosphorZones::LayoutRegistry.

◆ setActiveLayout()

virtual void PhosphorZones::IZoneLayoutRegistry::setActiveLayout ( Layout layout)
pure virtual

◆ setActiveLayoutById()

virtual void PhosphorZones::IZoneLayoutRegistry::setActiveLayoutById ( const QUuid &  id)
pure virtual

◆ tilingAlgorithmForScreen()

virtual QString PhosphorZones::IZoneLayoutRegistry::tilingAlgorithmForScreen ( const QString &  screenId,
int  virtualDesktop = 0,
const QString &  activity = QString() 
) const
inlinevirtual

Raw id of the tiling algorithm active for the (screenId, virtualDesktop, activity) context, or empty when none resolves.

Used by the unified-list builder to keep the active algorithm visible in the picker even when it's been hidden (mirrors the active-layout exemption for manual layouts). Default empty for non-resolving implementers.

Reimplemented in PhosphorZones::LayoutRegistry.


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