Enumeration + mutation surface for the in-memory zone-layout catalog. More...
#include <phosphor-zones/include/PhosphorZones/IZoneLayoutRegistry.h>
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 Layout * | layout (int index) const =0 |
| virtual Layout * | layoutByName (const QString &name) const =0 |
| virtual Layout * | layoutById (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 Layout * | duplicateLayout (Layout *source)=0 |
| virtual Layout * | activeLayout () const =0 |
| virtual void | setActiveLayout (Layout *layout)=0 |
| virtual void | setActiveLayoutById (const QUuid &id)=0 |
| virtual Layout * | layoutForScreen (const QString &screenId, int virtualDesktop=0, const QString &activity=QString()) const =0 |
Cascade-resolve the manual layout for screenId. | |
| virtual Layout * | resolveLayoutForScreen (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 ScrollingTemplateStore * | scrollingTemplateStore () 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 Layout * | defaultLayout () 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 | |
Enumeration + mutation surface for the in-memory zone-layout catalog.
Fixture tests can stub this contract without implementing persistence / assignments / quick-slots.
|
explicit |
|
override |
|
pure virtual |
Implemented in PhosphorZones::LayoutRegistry.
|
signal |
|
pure virtual |
| layout | Ownership transferred - the registry adopts layout and is responsible for its lifetime from this call on. |
Implemented in PhosphorZones::LayoutRegistry.
|
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.
|
pure virtual |
Implemented in PhosphorZones::LayoutRegistry.
|
pure virtual |
Implemented in PhosphorZones::LayoutRegistry.
|
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.
|
pure virtual |
Effective global default layout (snap-only fallback).
Implemented in PhosphorZones::LayoutRegistry.
|
pure virtual |
| source | Borrowed - caller retains ownership. |
addLayout semantics). Returns nullptr if source is unknown. Implemented in PhosphorZones::LayoutRegistry.
|
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.
|
pure virtual |
Implemented in PhosphorZones::LayoutRegistry.
|
signal |
|
signal |
|
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.
|
pure virtual |
Implemented in PhosphorZones::LayoutRegistry.
|
pure virtual |
Implemented in PhosphorZones::LayoutRegistry.
|
pure virtual |
Cascade-resolve the manual layout for screenId.
Returns defaultLayout() when no explicit assignment matches.
Implemented in PhosphorZones::LayoutRegistry.
|
signal |
|
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.
|
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.
|
pure virtual |
| layout | Borrowed - 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. |
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.
|
pure virtual |
| layout | Borrowed - 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. |
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.
|
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.
|
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.
|
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.
|
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.
|
pure virtual |
Convenience: resolve a layout using the registry's current (desktop, activity) context.
Implemented in PhosphorZones::LayoutRegistry.
|
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.
|
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.
|
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.
|
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.
|
pure virtual |
Implemented in PhosphorZones::LayoutRegistry.
|
pure virtual |
Implemented in PhosphorZones::LayoutRegistry.
|
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.