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 bool removeLayout (Layout *layout)=0
 
virtual bool 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, "autotile:<algorithmId>", or the bare "scrolling:" sentinel) for screenId, with cascade + level-1 provider fallback.
 
virtual ScrollingTemplateStorescrollingTemplateStore () const
 The native scrolling-template store wired into this registry, or null when none is (lightweight stubs, roots with no template feature).
 
virtual ScrollingTemplate scrollingTemplateForContext (const QString &screenId, int virtualDesktop, const QString &activity) const
 The resolved scrolling TEMPLATE for a context (the native ScrollingTemplate whose vocabularies and blueprint the engine push consumes), by value — isValid() is false when the context is not Scrolling, names no template and no default template answers, or the named template no longer exists in the store.
 
QString scrollingDisplayIdForContext (const QString &screenId, int virtualDesktop, const QString &activity) const
 The id the layout PICKER highlights for a scrolling context: the resolved template's bare UUID, the reserved no-template word when the context opted out explicitly, or the "scrolling:" sentinel (matches no card) when no template resolves for any other reason.
 
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 QString &mode=QString()) const
 Resolve the per-context gap override (zone padding + outer gaps) that 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 rules lock the active layout for the (screenId, virtualDesktop, activity) context — the rule-driven counterpart to the manual ToggleLayoutLock shortcut.
 
virtual std::optional< bool > resolveContextDragSelectorEnabled (const QString &screenId, int virtualDesktop, const QString &activity) const
 Resolve a per-context override of the drag selector popup — the edge-triggered zone / strip picker offered during a window drag — for the (screenId, virtualDesktop, activity) context.
 
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.
 
virtual bool scrollingTemplateExplicitlyNone (const QString &screenId, int virtualDesktop, const QString &activity) const
 Whether the context opted out of templates EXPLICITLY, as opposed to merely naming none (an unset slot, or one whose template is gone, or a context with no configured default to inherit).
 
- 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, "autotile:<algorithmId>", or the bare "scrolling:" sentinel) for screenId, with cascade + level-1 provider fallback.

An explicit mode-only Snapping pin settles as an EMPTY id (no layout identity exists for it) — see the concrete class doc.

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 bool 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.
Returns
true when the layout was removed. false when the removal was REFUSED and the layout is still registered: the implementation keeps the layout, its file and its settings sidecar mutually consistent rather than deleting a half of them, so a caller that announces the deletion (a layoutRemoved-style signal, an eviction of per-layout state) must gate that announcement on this result.

Implemented in PhosphorZones::LayoutRegistry.

◆ removeLayoutById()

virtual bool PhosphorZones::IZoneLayoutRegistry::removeLayoutById ( const QUuid &  id)
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.
Returns
true when the layout was removed. false when the removal was REFUSED and the layout is still registered: the implementation keeps the layout, its file and its settings sidecar mutually consistent rather than deleting a half of them, so a caller that announces the deletion (a layoutRemoved-style signal, an eviction of per-layout state) must gate that announcement on this result. Also returns false when no layout carries id.

Implemented in PhosphorZones::LayoutRegistry.

◆ resolveContextDragSelectorEnabled()

virtual std::optional< bool > PhosphorZones::IZoneLayoutRegistry::resolveContextDragSelectorEnabled ( const QString &  screenId,
int  virtualDesktop,
const QString &  activity 
) const
inlinevirtual

Resolve a per-context override of the drag selector popup — the edge-triggered zone / strip picker offered during a window drag — for the (screenId, virtualDesktop, activity) context.

An engaged true forces the popup on past the global selector toggle, an engaged false suppresses it, and std::nullopt means no rule fills the slot and the context follows the global toggle. The default returns std::nullopt; a registry that does not model context rules — e.g. a fixture stub — keeps the toggle-only behaviour.

Reimplemented in PhosphorZones::LayoutRegistry.

◆ resolveContextGaps()

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

Resolve the per-context gap override (zone padding + outer gaps) that 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.

mode is the placement-mode wire token ("snapping" / "tiling" / "scrolling") of the engine asking. It is matched against a context rule's Mode leaf, so a per-mode gap rule (e.g. a wider inner gap only while tiling) resolves for the matching engine and stays inert for the others. The snapping geometry path passes "snapping", the autotile path "tiling", the scroll engine's provider "scrolling". Left empty for a mode-agnostic caller (no Mode leaf then matches). An EMPTY mode means "mode-agnostic" and excludes Field::Mode structurally — see the LayoutRegistry override.

Reimplemented in PhosphorZones::LayoutRegistry.

◆ resolveContextLocked()

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

Resolve whether 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.

◆ scrollingDisplayIdForContext()

QString PhosphorZones::IZoneLayoutRegistry::scrollingDisplayIdForContext ( const QString &  screenId,
int  virtualDesktop,
const QString &  activity 
) const
inline

The id the layout PICKER highlights for a scrolling context: the resolved template's bare UUID, the reserved no-template word when the context opted out explicitly, or the "scrolling:" sentinel (matches no card) when no template resolves for any other reason.

The shared authority for the picker-highlight sites (UnifiedLayoutController::displayIdForAssignment and OverlayService::activeLayoutIdForScreen) — callers keep their own live-capability gates. Distinct from the rules-visible query stamp, which uses the PREFIXED "scrolling:<uuid>" form. Non-virtual on purpose: a pure convenience over the two virtuals above.

◆ scrollingTemplateExplicitlyNone()

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

Whether the context opted out of templates EXPLICITLY, as opposed to merely naming none (an unset slot, or one whose template is gone, or a context with no configured default to inherit).

The resolver answers invalid for all of those alike, so this is the only way to tell the deliberate choice from the incidental absence — which the picker needs, because one of them highlights its None card and the rest highlight nothing. Default false so lightweight stubs need not implement it.

Declared LAST among the virtuals on purpose. This is a PHOSPHORZONES_EXPORT class in a library with an soname, so a virtual added mid-class would renumber the vtable slot of every virtual below it and break any consumer built against the previous headers. New virtuals append here.

This one was MOVED here from mid-class, which is itself that renumber: every virtual it used to precede shifted a slot. Deliberate and safe only because the mid-class placement had not been released — an in-place move like it is an ABI break, not a cleanup, once consumers exist. The rule above is the one to follow instead.

Reimplemented in PhosphorZones::LayoutRegistry.

◆ scrollingTemplateForContext()

virtual ScrollingTemplate PhosphorZones::IZoneLayoutRegistry::scrollingTemplateForContext ( const QString &  screenId,
int  virtualDesktop,
const QString &  activity 
) const
inlinevirtual

The resolved scrolling TEMPLATE for a context (the native ScrollingTemplate whose vocabularies and blueprint the engine push consumes), by value — isValid() is false when the context is not Scrolling, names no template and no default template answers, or the named template no longer exists in the store.

Default invalid so lightweight test stubs need not implement the template feature.

Reimplemented in PhosphorZones::LayoutRegistry.

◆ scrollingTemplateStore()

virtual ScrollingTemplateStore * PhosphorZones::IZoneLayoutRegistry::scrollingTemplateStore ( ) const
inlinevirtual

The native scrolling-template store wired into this registry, or null when none is (lightweight stubs, roots with no template feature).

Consumers use it for template enumeration (picker lists); context RESOLUTION goes through scrollingTemplateForContext below.

Reimplemented 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: