Phosphor
Qt6 / Wayland library suite for window-management tools
Loading...
Searching...
No Matches
PhosphorZones::GeometryUtils Namespace Reference

Functions

PHOSPHORZONES_EXPORT QRectF availableAreaToOverlayCoordinates (const QRectF &geometry, QScreen *screen)
PHOSPHORZONES_EXPORT QRectF getZoneGeometryWithGaps (PhosphorScreens::ScreenManager *mgr, PhosphorZones::Zone *zone, QScreen *screen, int innerGap, const ::PhosphorLayout::EdgeGaps &outerGaps, bool useAvailableGeometry=true, const QString &screenId={})
PHOSPHORZONES_EXPORT QRectF getZoneGeometryWithGaps (PhosphorScreens::ScreenManager *mgr, PhosphorZones::Zone *zone, const QRect &screenGeometry, const QRect &availableGeometry, int innerGap, const ::PhosphorLayout::EdgeGaps &outerGaps, bool useAvailableGeometry=true, const QString &screenId={})
PHOSPHORZONES_EXPORT QRect getZoneGeometryForScreen (PhosphorScreens::ScreenManager *mgr, PhosphorZones::Zone *zone, QScreen *screen, const QString &screenId, PhosphorZones::Layout *layout, int zonePadding, const ::PhosphorLayout::EdgeGaps &outerGaps)
PHOSPHORZONES_EXPORT QRectF getZoneGeometryForScreenF (PhosphorScreens::ScreenManager *mgr, PhosphorZones::Zone *zone, QScreen *screen, const QString &screenId, PhosphorZones::Layout *layout, int zonePadding, const ::PhosphorLayout::EdgeGaps &outerGaps)
PHOSPHORZONES_EXPORT qreal screenScale (PhosphorScreens::ScreenManager *mgr, const QString &screenId, QScreen *screen=nullptr)
 The logical scale of the output screenId lives on (a virtual screen answers for its physical output), falling back to screen when the id does not resolve.
PHOSPHORZONES_EXPORT QRectF effectiveScreenGeometry (PhosphorScreens::ScreenManager *mgr, PhosphorZones::Layout *layout, QScreen *screen)
PHOSPHORZONES_EXPORT QRectF effectiveScreenGeometry (PhosphorScreens::ScreenManager *mgr, PhosphorZones::Layout *layout, const QString &screenId)
 The rect layout resolves against on screenId: its full or available geometry as the manager reports it.
PHOSPHORZONES_EXPORT QRectF extractZoneGeometry (const QVariantMap &zone)
PHOSPHORZONES_EXPORT void setZoneGeometry (QVariantMap &zone, const QRectF &rect)
PHOSPHORGEOMETRY_EXPORT QRectF availableAreaToOverlayCoordinates (const QRectF &geometry, const QRect &overlayGeometry)
PHOSPHORGEOMETRY_EXPORT void clampZonesToScreen (QVector< QRect > &zones, const QVector< QSize > &minSizes, const QRect &screen)
PHOSPHORGEOMETRY_EXPORT void enforceMinSizes (QVector< QRect > &zones, const QVector< QSize > &minSizes, int gapThreshold, int innerGap=0)
PHOSPHORGEOMETRY_EXPORT QString rectToJson (const QRect &rect)
PHOSPHORGEOMETRY_EXPORT void removeRectOverlaps (QVector< QRect > &zones, const QVector< QSize > &minSizes={}, int innerGap=0)
PHOSPHORGEOMETRY_EXPORT QRect snapToRect (const QRectF &rf)

Function Documentation

◆ availableAreaToOverlayCoordinates() [1/2]

PHOSPHORGEOMETRY_EXPORT QRectF PhosphorGeometry::availableAreaToOverlayCoordinates ( const QRectF & geometry,
const QRect & overlayGeometry )

◆ availableAreaToOverlayCoordinates() [2/2]

PHOSPHORZONES_EXPORT QRectF PhosphorZones::GeometryUtils::availableAreaToOverlayCoordinates ( const QRectF & geometry,
QScreen * screen )

◆ clampZonesToScreen()

PHOSPHORGEOMETRY_EXPORT void PhosphorGeometry::clampZonesToScreen ( QVector< QRect > & zones,
const QVector< QSize > & minSizes,
const QRect & screen )

◆ effectiveScreenGeometry() [1/2]

PHOSPHORZONES_EXPORT QRectF PhosphorZones::GeometryUtils::effectiveScreenGeometry ( PhosphorScreens::ScreenManager * mgr,
PhosphorZones::Layout * layout,
const QString & screenId )

The rect layout resolves against on screenId: its full or available geometry as the manager reports it.

An id the manager cannot resolve falls back to the QScreen it names, except a virtual-screen id, which answers an empty rect, the same rule getZoneGeometryForScreenF follows.

◆ effectiveScreenGeometry() [2/2]

PHOSPHORZONES_EXPORT QRectF PhosphorZones::GeometryUtils::effectiveScreenGeometry ( PhosphorScreens::ScreenManager * mgr,
PhosphorZones::Layout * layout,
QScreen * screen )

◆ enforceMinSizes()

PHOSPHORGEOMETRY_EXPORT void PhosphorGeometry::enforceMinSizes ( QVector< QRect > & zones,
const QVector< QSize > & minSizes,
int gapThreshold,
int innerGap = 0 )

◆ extractZoneGeometry()

PHOSPHORZONES_EXPORT QRectF PhosphorZones::GeometryUtils::extractZoneGeometry ( const QVariantMap & zone)

◆ getZoneGeometryForScreen()

PHOSPHORZONES_EXPORT QRect PhosphorZones::GeometryUtils::getZoneGeometryForScreen ( PhosphorScreens::ScreenManager * mgr,
PhosphorZones::Zone * zone,
QScreen * screen,
const QString & screenId,
PhosphorZones::Layout * layout,
int zonePadding,
const ::PhosphorLayout::EdgeGaps & outerGaps )

◆ getZoneGeometryForScreenF()

PHOSPHORZONES_EXPORT QRectF PhosphorZones::GeometryUtils::getZoneGeometryForScreenF ( PhosphorScreens::ScreenManager * mgr,
PhosphorZones::Zone * zone,
QScreen * screen,
const QString & screenId,
PhosphorZones::Layout * layout,
int zonePadding,
const ::PhosphorLayout::EdgeGaps & outerGaps )

◆ getZoneGeometryWithGaps() [1/2]

PHOSPHORZONES_EXPORT QRectF PhosphorZones::GeometryUtils::getZoneGeometryWithGaps ( PhosphorScreens::ScreenManager * mgr,
PhosphorZones::Zone * zone,
const QRect & screenGeometry,
const QRect & availableGeometry,
int innerGap,
const ::PhosphorLayout::EdgeGaps & outerGaps,
bool useAvailableGeometry = true,
const QString & screenId = {} )

◆ getZoneGeometryWithGaps() [2/2]

PHOSPHORZONES_EXPORT QRectF PhosphorZones::GeometryUtils::getZoneGeometryWithGaps ( PhosphorScreens::ScreenManager * mgr,
PhosphorZones::Zone * zone,
QScreen * screen,
int innerGap,
const ::PhosphorLayout::EdgeGaps & outerGaps,
bool useAvailableGeometry = true,
const QString & screenId = {} )

◆ rectToJson()

PHOSPHORGEOMETRY_EXPORT QString PhosphorGeometry::rectToJson ( const QRect & rect)

◆ removeRectOverlaps()

PHOSPHORGEOMETRY_EXPORT void PhosphorGeometry::removeRectOverlaps ( QVector< QRect > & zones,
const QVector< QSize > & minSizes = {},
int innerGap = 0 )

◆ screenScale()

PHOSPHORZONES_EXPORT qreal PhosphorZones::GeometryUtils::screenScale ( PhosphorScreens::ScreenManager * mgr,
const QString & screenId,
QScreen * screen = nullptr )

The logical scale of the output screenId lives on (a virtual screen answers for its physical output), falling back to screen when the id does not resolve.

Zero when there is no manager, or when neither the id nor screen resolves, and every geometry entry point reads zero as "the layout's last recalculation scale". This is the scale a layout whose fixed geometry counts device pixels divides by.

◆ setZoneGeometry()

PHOSPHORZONES_EXPORT void PhosphorZones::GeometryUtils::setZoneGeometry ( QVariantMap & zone,
const QRectF & rect )

◆ snapToRect()

PHOSPHORGEOMETRY_EXPORT QRect PhosphorGeometry::snapToRect ( const QRectF & rf)