Pluggable source of the connected-output set and its lifecycle. More...
#include <phosphor-screens/include/PhosphorScreens/IScreenProvider.h>
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< PhysicalScreen > | screens () 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. | |
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.
|
inlineexplicit |
|
overridedefault |
|
pure virtual |
The primary output, or an invalid PhysicalScreen if there is none.
Implemented in Phosphor::Screens::QtScreenProvider.
|
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.
|
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.
|
signal |
An output disconnected.
Identified by connector name; its geometry is whatever was last known.
|
pure virtual |
Every currently-connected output. Order is not significant.
Implemented in Phosphor::Screens::QtScreenProvider.