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

Pluggable source of the connected-output set and its lifecycle. More...

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

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

Signals

void screenAdded (const PhysicalScreen &screen)
 A new output connected.
 
void screenRemoved (const PhysicalScreen &screen)
 An output disconnected.
 
void screenGeometryChanged (const PhysicalScreen &screen)
 A connected output's geometry changed (move, resize, rotate, scale).
 

Public Member Functions

 IScreenProvider (QObject *parent=nullptr)
 
 ~IScreenProvider () override=default
 
virtual QVector< PhysicalScreenscreens () const =0
 Every currently-connected output. Order is not significant.
 
virtual PhysicalScreen primaryScreen () const =0
 The primary output, or an invalid PhysicalScreen if there is none.
 

Detailed Description

Pluggable source of the connected-output set and its lifecycle.

ScreenManager enumerates outputs and reacts to add / remove / move / resize through this interface instead of touching QGuiApplication and QScreen directly. The production implementation (QtScreenProvider) is a thin wrapper over Qt; a test implementation (FakeScreenProvider) synthesizes outputs with arbitrary geometry and fires the lifecycle signals on demand — which is what makes the geometry-recompute path regression-testable (QScreen itself cannot be constructed by test code).

Mirrors the existing IPanelSource / IConfigStore seam pattern: the concrete provider is injected via ScreenManagerConfig and owned by the consumer; it must outlive the ScreenManager that holds the pointer.

Threading: ScreenManager calls screens() / primaryScreen() from the GUI thread; implementations must emit the signals on the GUI thread.

Constructor & Destructor Documentation

◆ IScreenProvider()

Phosphor::Screens::IScreenProvider::IScreenProvider ( QObject *  parent = nullptr)
inlineexplicit

◆ ~IScreenProvider()

Phosphor::Screens::IScreenProvider::~IScreenProvider ( )
overridedefault

Member Function Documentation

◆ primaryScreen()

virtual PhysicalScreen Phosphor::Screens::IScreenProvider::primaryScreen ( ) const
pure virtual

The primary output, or an invalid PhysicalScreen if there is none.

Implemented in Phosphor::Screens::QtScreenProvider.

◆ screenAdded

void Phosphor::Screens::IScreenProvider::screenAdded ( const PhysicalScreen screen)
signal

A new output connected.

The PhysicalScreen carries its geometry at emission time — which may still be a transient origin that settles via a subsequent screenGeometryChanged.

◆ screenGeometryChanged

void Phosphor::Screens::IScreenProvider::screenGeometryChanged ( const PhysicalScreen screen)
signal

A connected output's geometry changed (move, resize, rotate, scale).

The PhysicalScreen carries the NEW geometry — consumers replace any stored snapshot with this one.

◆ screenRemoved

void Phosphor::Screens::IScreenProvider::screenRemoved ( const PhysicalScreen screen)
signal

An output disconnected.

Identified by connector name; its geometry is whatever was last known.

◆ screens()

virtual QVector< PhysicalScreen > Phosphor::Screens::IScreenProvider::screens ( ) const
pure virtual

Every currently-connected output. Order is not significant.

Implemented in Phosphor::Screens::QtScreenProvider.


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