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

Per-screen mode dispatcher adapter. More...

#include <PhosphorContext/IContextInputs.h>

Public Member Functions

virtual ~IModeProvider ()=default
virtual PhosphorZones::AssignmentEntry::Mode modeFor (const QString &screenId) const =0
 Resolve screenId to a Mode.

Detailed Description

Per-screen mode dispatcher adapter.

Resolves an opaque screen id to its current AssignmentEntry::Mode (Snapping / Autotile / future modes). Daemon-side this is a one-line wrapper around ScreenModeRouter::modeFor(screenId). Kept as a separate interface so the resolver does not transitively pull in the entire ScreenModeRouter API (which carries IPlacementEngine* references that an LGPL lib should not see).

Unknown screen ids must resolve to the implementation's documented default mode (typically Snapping per the daemon's ScreenModeRouter adapter, but the chosen default is observable through IContextResolver::globalHandle()'s mode field and may be overridden by test or future-provider implementations). The resolver does not validate the screen id itself — that is the daemon's responsibility upstream.

Constructor & Destructor Documentation

◆ ~IModeProvider()

virtual PhosphorContext::IModeProvider::~IModeProvider ( )
virtualdefault

Member Function Documentation

◆ modeFor()

virtual PhosphorZones::AssignmentEntry::Mode PhosphorContext::IModeProvider::modeFor ( const QString & screenId) const
pure virtual

Resolve screenId to a Mode.

Implementations must return a deterministic value for any input — never an undefined-behaviour path. Concrete implementations document their own fallback: the daemon's DaemonScreenModeAdapter (contextresolverwiring.cpp) returns AssignmentEntry::Snapping when its router is null; when the router IS wired, the result for an empty / unknown screenId flows through ScreenModeRouter::modeFor, which may return any registered mode based on the cascade. The chosen value is observable through IContextResolver::globalHandle()'s mode field, so an adapter override (e.g. in tests) propagates transparently.


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