Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
GeometryUtils.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
7#include <phosphorzones_export.h>
8
10
11#include <QRect>
12#include <QRectF>
13#include <QString>
14#include <QVariantMap>
15
16class QScreen;
17
18namespace PhosphorZones {
19class Layout;
20class Zone;
21}
22
23namespace Phosphor::Screens {
24class ScreenManager;
25}
26
27namespace PhosphorZones {
28namespace GeometryUtils {
29
36
37PHOSPHORZONES_EXPORT QRectF availableAreaToOverlayCoordinates(const QRectF& geometry, QScreen* screen);
38
40 QScreen* screen, int innerGap,
41 const ::PhosphorLayout::EdgeGaps& outerGaps,
42 bool useAvailableGeometry = true, const QString& screenId = {});
43
45 const QRect& screenGeometry, const QRect& availableGeometry,
46 int innerGap, const ::PhosphorLayout::EdgeGaps& outerGaps,
47 bool useAvailableGeometry = true, const QString& screenId = {});
48
50 QScreen* screen, const QString& screenId,
51 PhosphorZones::Layout* layout, int zonePadding,
52 const ::PhosphorLayout::EdgeGaps& outerGaps);
53
55 QScreen* screen, const QString& screenId,
56 PhosphorZones::Layout* layout, int zonePadding,
57 const ::PhosphorLayout::EdgeGaps& outerGaps);
58
60 PhosphorZones::Layout* layout, QScreen* screen);
61
63 PhosphorZones::Layout* layout, const QString& screenId);
64
65PHOSPHORZONES_EXPORT QRectF extractZoneGeometry(const QVariantMap& zone);
66PHOSPHORZONES_EXPORT void setZoneGeometry(QVariantMap& zone, const QRectF& rect);
67
68} // namespace GeometryUtils
69} // namespace PhosphorZones
Represents a collection of zones that form a layout.
Definition Layout.h:74
Represents a single zone within a layout.
Definition Zone.h:44
Centralized screen-topology service.
Definition Manager.h:75
PHOSPHORGEOMETRY_EXPORT QString rectToJson(const QRect &rect)
PHOSPHORGEOMETRY_EXPORT void enforceMinSizes(QVector< QRect > &zones, const QVector< QSize > &minSizes, int gapThreshold, int innerGap=0)
PHOSPHORGEOMETRY_EXPORT void removeRectOverlaps(QVector< QRect > &zones, const QVector< QSize > &minSizes={}, int innerGap=0)
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 QRect snapToRect(const QRectF &rf)
PHOSPHORZONES_EXPORT QRectF getZoneGeometryWithGaps(Phosphor::Screens::ScreenManager *mgr, PhosphorZones::Zone *zone, QScreen *screen, int innerGap, const ::PhosphorLayout::EdgeGaps &outerGaps, bool useAvailableGeometry=true, const QString &screenId={})
PHOSPHORZONES_EXPORT QRectF getZoneGeometryForScreenF(Phosphor::Screens::ScreenManager *mgr, PhosphorZones::Zone *zone, QScreen *screen, const QString &screenId, PhosphorZones::Layout *layout, int zonePadding, const ::PhosphorLayout::EdgeGaps &outerGaps)
PHOSPHORZONES_EXPORT QRectF extractZoneGeometry(const QVariantMap &zone)
PHOSPHORZONES_EXPORT void setZoneGeometry(QVariantMap &zone, const QRectF &rect)
PHOSPHORZONES_EXPORT QRect getZoneGeometryForScreen(Phosphor::Screens::ScreenManager *mgr, PhosphorZones::Zone *zone, QScreen *screen, const QString &screenId, PhosphorZones::Layout *layout, int zonePadding, const ::PhosphorLayout::EdgeGaps &outerGaps)
PHOSPHORZONES_EXPORT QRectF effectiveScreenGeometry(Phosphor::Screens::ScreenManager *mgr, PhosphorZones::Layout *layout, QScreen *screen)
Definition IWindowTrackingService.h:22
Definition IWindowTrackingService.h:26