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
8#include "phosphorengine_export.h"
9
10#include <QRect>
11#include <QString>
12#include <QVector>
13
14namespace PhosphorEngine {
15namespace GeometryUtils {
16
23
24PHOSPHORENGINE_EXPORT QString serializeZoneAssignments(const QVector<ZoneAssignmentEntry>& entries);
25
37PHOSPHORENGINE_EXPORT QVector<ZoneAssignmentEntry> deserializeZoneAssignments(const QString& json,
38 QString* errorString = nullptr);
39
43PHOSPHORENGINE_EXPORT QRect carryRectOntoArea(const QRect& rect, const QRect& fromArea, const QRect& toArea);
44
45} // namespace GeometryUtils
46} // namespace PhosphorEngine
Definition GeometryUtils.h:15
PHOSPHORENGINE_EXPORT QRect carryRectOntoArea(const QRect &rect, const QRect &fromArea, const QRect &toArea)
rect carried from fromArea onto toArea: its position kept relative to the area, its size shrunk only ...
PHOSPHORENGINE_EXPORT QString serializeZoneAssignments(const QVector< ZoneAssignmentEntry > &entries)
PHOSPHORENGINE_EXPORT QVector< ZoneAssignmentEntry > deserializeZoneAssignments(const QString &json, QString *errorString=nullptr)
Parse the wire format serializeZoneAssignments produces back into entries — the two functions are the...
Definition DesktopRemap.h:12
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)