Definition of a single virtual screen within a physical screen. More...
#include <phosphor-screens/include/PhosphorScreens/VirtualScreen.h>
Classes | |
| struct | PhysicalEdges |
| Check which edges of this virtual screen are at the physical screen boundary (vs internal edges shared with another virtual screen). More... | |
Public Member Functions | |
| QRect | absoluteGeometry (const QRect &physicalGeometry) const |
| Compute absolute geometry from the physical screen's geometry. | |
| bool | operator== (const VirtualScreenDef &) const =default |
| Exact bitwise equality across every field. | |
| bool | approxEqual (const VirtualScreenDef &other) const |
| Tolerance-aware comparison for change-detection paths that round through JSON. | |
| bool | isValid () const |
| Check if the definition is valid: non-empty id, non-empty physicalScreenId, non-negative origin, non-zero size, region within [0,1] bounds. | |
| PhysicalEdges | physicalEdges () const |
Public Attributes | |
| QString | id |
| Full ID: "physicalId/vs:N". | |
| QString | physicalScreenId |
| Owning physical screen's stable EDID ID. | |
| QString | displayName |
| User-facing name, e.g. "Left", "Right". | |
| QRectF | region |
| Relative geometry within physical screen (0-1) | |
| int | index = 0 |
| Index within the physical screen's subdivision. | |
Static Public Attributes | |
| static constexpr qreal | Tolerance = 1e-3 |
| Shared tolerance for floating-point region comparisons. | |
Definition of a single virtual screen within a physical screen.
A virtual screen represents a rectangular sub-region of a physical monitor. Each virtual screen gets its own screen ID, layout assignments, autotile state, overlay windows, and all other per-screen functionality.
|
inline |
Compute absolute geometry from the physical screen's geometry.
Uses edge-consistent rounding to avoid 1px gaps/overlaps between adjacent screens.
|
inline |
Tolerance-aware comparison for change-detection paths that round through JSON.
Non-transitive by construction — do NOT use as a hashed-container equality predicate; use operator== there.
|
inline |
Check if the definition is valid: non-empty id, non-empty physicalScreenId, non-negative origin, non-zero size, region within [0,1] bounds.
Uses Tolerance to handle float serialization precision loss. Note: slightly negative coordinates (within -Tolerance) are accepted and clamped to zero by absoluteGeometry(). Always use absoluteGeometry() to obtain pixel coordinates rather than consuming region directly.
|
default |
Exact bitwise equality across every field.
Safe for hashed containers (transitive) and for tests that need deterministic round-trip asserts. Change-detection sites that want to swallow JSON-serialisation precision noise should use approxEqual explicitly — making the default operator fuzzy used to hide a non-transitivity trap from every consumer (a==b ∧ b==c did not imply a==c once region deltas chained across the tolerance window).
|
inline |
| QString Phosphor::Screens::VirtualScreenDef::displayName |
User-facing name, e.g. "Left", "Right".
| QString Phosphor::Screens::VirtualScreenDef::id |
Full ID: "physicalId/vs:N".
| int Phosphor::Screens::VirtualScreenDef::index = 0 |
Index within the physical screen's subdivision.
| QString Phosphor::Screens::VirtualScreenDef::physicalScreenId |
Owning physical screen's stable EDID ID.
| QRectF Phosphor::Screens::VirtualScreenDef::region |
Relative geometry within physical screen (0-1)
|
staticconstexpr |
Shared tolerance for floating-point region comparisons.
Used by isValid() and physicalEdges() to handle serialization precision loss.