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

D-Bus adaptor for the org.plasmazones.Screen screen-topology surface: screen queries, virtual-screen mutation, the JSON round-trip for setVirtualScreenConfig, caches, and signals. More...

#include <phosphor-screens/include/PhosphorScreens/DBusScreenAdaptor.h>

Inheritance diagram for Phosphor::Screens::DBusScreenAdaptor:
[legend]

Public Slots

QStringList getScreens ()
 
QString getScreenInfo (const QString &screenId)
 
QString getPrimaryScreen ()
 
QString getScreenId (const QString &connectorName)
 
void setPrimaryScreenFromKWin (const QString &connectorName)
 
void setAvailableGeometryFromKWin (const QString &screenName, int x, int y, int width, int height)
 Record the authoritative per-screen available geometry as reported by the compositor (the KWin effect's clientArea(MaximizeArea) query).
 
QRect getAvailableGeometry (const QString &screenId)
 
QRect getScreenGeometry (const QString &screenId)
 
QString getVirtualScreenConfig (const QString &physicalScreenId)
 
QString setVirtualScreenConfig (const QString &physicalScreenId, const QString &configJson)
 Set the virtual screen subdivision configuration for a physical screen.
 
QStringList getPhysicalScreens ()
 
QString getEffectiveScreenAt (int x, int y)
 
QString swapVirtualScreenInDirection (const QString &currentVirtualScreenId, const QString &direction)
 Swap the region of currentVirtualScreenId with the adjacent sibling VS in the given direction (left/right/up/down) within the same physical monitor.
 
QString rotateVirtualScreens (const QString &physicalScreenId, bool clockwise)
 Rotate every VS region on physicalScreenId through a spatial clockwise ring order.
 

Signals

void screenAdded (const QString &screenId)
 
void screenRemoved (const QString &screenId)
 
void screenGeometryChanged (const QString &screenId)
 
void virtualScreensChanged (const QString &physicalScreenId)
 

Public Member Functions

 DBusScreenAdaptor (ScreenManager *manager, IConfigStore *store, QObject *parent=nullptr)
 Primary constructor: wires the screen-topology service and the VS config store at construction time.
 
 ~DBusScreenAdaptor () override
 

Protected Member Functions

ScreenManagerscreenManager () const
 
IConfigStoreconfigStore () const
 

Detailed Description

D-Bus adaptor for the org.plasmazones.Screen screen-topology surface: screen queries, virtual-screen mutation, the JSON round-trip for setVirtualScreenConfig, caches, and signals.

The D-Bus interface name is declared HERE via Q_CLASSINFO, on the class that declares the signals — not on a host subclass. Qt derives a signal's D-Bus interface from the metaobject that declares the signal: a subclass-only Q_CLASSINFO fixes incoming method dispatch (that walks the whole adaptor hierarchy) but leaves every signal in this class emitting on an auto-generated junk interface name, which no consumer's match rule ever sees. The bus service name and object path — the parts that genuinely vary per host — are still chosen by the host at registerObject time.

Lifetimes: pointers are non-owning. ScreenManager and IConfigStore must outlive this adaptor.

Constructor & Destructor Documentation

◆ DBusScreenAdaptor()

Phosphor::Screens::DBusScreenAdaptor::DBusScreenAdaptor ( ScreenManager manager,
IConfigStore store,
QObject *  parent = nullptr 
)
explicit

Primary constructor: wires the screen-topology service and the VS config store at construction time.

manager and store may be null for bring-up paths that don't need either (most methods return empty results / rejection tokens in that case).

◆ ~DBusScreenAdaptor()

Phosphor::Screens::DBusScreenAdaptor::~DBusScreenAdaptor ( )
override

Member Function Documentation

◆ configStore()

IConfigStore * Phosphor::Screens::DBusScreenAdaptor::configStore ( ) const
protected
Returns
the wired IConfigStore pointer (may be null, QPointer-guarded).

◆ getAvailableGeometry

QRect Phosphor::Screens::DBusScreenAdaptor::getAvailableGeometry ( const QString &  screenId)
slot

◆ getEffectiveScreenAt

QString Phosphor::Screens::DBusScreenAdaptor::getEffectiveScreenAt ( int  x,
int  y 
)
slot

◆ getPhysicalScreens

QStringList Phosphor::Screens::DBusScreenAdaptor::getPhysicalScreens ( )
slot

◆ getPrimaryScreen

QString Phosphor::Screens::DBusScreenAdaptor::getPrimaryScreen ( )
slot

◆ getScreenGeometry

QRect Phosphor::Screens::DBusScreenAdaptor::getScreenGeometry ( const QString &  screenId)
slot

◆ getScreenId

QString Phosphor::Screens::DBusScreenAdaptor::getScreenId ( const QString &  connectorName)
slot

◆ getScreenInfo

QString Phosphor::Screens::DBusScreenAdaptor::getScreenInfo ( const QString &  screenId)
slot

◆ getScreens

QStringList Phosphor::Screens::DBusScreenAdaptor::getScreens ( )
slot

◆ getVirtualScreenConfig

QString Phosphor::Screens::DBusScreenAdaptor::getVirtualScreenConfig ( const QString &  physicalScreenId)
slot

◆ rotateVirtualScreens

QString Phosphor::Screens::DBusScreenAdaptor::rotateVirtualScreens ( const QString &  physicalScreenId,
bool  clockwise 
)
slot

Rotate every VS region on physicalScreenId through a spatial clockwise ring order.

Returns
Empty string on success, otherwise a stable rejection token from VirtualScreenSwapper::reasonString().

◆ screenAdded

void Phosphor::Screens::DBusScreenAdaptor::screenAdded ( const QString &  screenId)
signal

◆ screenGeometryChanged

void Phosphor::Screens::DBusScreenAdaptor::screenGeometryChanged ( const QString &  screenId)
signal

◆ screenManager()

ScreenManager * Phosphor::Screens::DBusScreenAdaptor::screenManager ( ) const
protected
Returns
the wired ScreenManager pointer (may be null, including when the wired manager has since been destroyed — QPointer tracks that). Defined out-of-line so callers don't need the complete ScreenManager / IConfigStore types just to include this header.

◆ screenRemoved

void Phosphor::Screens::DBusScreenAdaptor::screenRemoved ( const QString &  screenId)
signal

◆ setAvailableGeometryFromKWin

void Phosphor::Screens::DBusScreenAdaptor::setAvailableGeometryFromKWin ( const QString &  screenName,
int  x,
int  y,
int  width,
int  height 
)
slot

Record the authoritative per-screen available geometry as reported by the compositor (the KWin effect's clientArea(MaximizeArea) query).

Overrides the panel-strut heuristic in ScreenManager. screenName is a connector name (e.g. DP-1); x / y / width / height are the work-area rect. An invalid or zero-size rect clears the override — a defensive contract; the effect itself always reports a valid rect.

◆ setPrimaryScreenFromKWin

void Phosphor::Screens::DBusScreenAdaptor::setPrimaryScreenFromKWin ( const QString &  connectorName)
slot

◆ setVirtualScreenConfig

QString Phosphor::Screens::DBusScreenAdaptor::setVirtualScreenConfig ( const QString &  physicalScreenId,
const QString &  configJson 
)
slot

Set the virtual screen subdivision configuration for a physical screen.

Returns
Empty string on success, otherwise a stable rejection token (e.g. parse_error, missing_screens, bad_index, store_rejected) so D-Bus callers can distinguish failure modes without parsing logs. Matches the pattern used by swapVirtualScreenInDirection / rotateVirtualScreens.

◆ swapVirtualScreenInDirection

QString Phosphor::Screens::DBusScreenAdaptor::swapVirtualScreenInDirection ( const QString &  currentVirtualScreenId,
const QString &  direction 
)
slot

Swap the region of currentVirtualScreenId with the adjacent sibling VS in the given direction (left/right/up/down) within the same physical monitor.

No-op if the current id is not virtual or no sibling lies in that direction. All per-VS state (windows, layout, autotile) follows the new geometry automatically.

Returns
Empty string on success, otherwise a stable rejection token from VirtualScreenSwapper::reasonString() so callers can distinguish failure modes without parsing logs.

◆ virtualScreensChanged

void Phosphor::Screens::DBusScreenAdaptor::virtualScreensChanged ( const QString &  physicalScreenId)
signal

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