Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
LayoutComputeService.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#include <QHash>
9#include <QObject>
10#include <QPointer>
11
12class QThread;
13
14namespace PhosphorZones {
15
16class Layout;
17class LayoutRegistry;
18class LayoutWorker;
19
20class PHOSPHORZONES_EXPORT LayoutComputeService : public QObject
21{
22 Q_OBJECT
23
24public:
25 explicit LayoutComputeService(QObject* parent = nullptr);
27
29
30 bool requestRecalculate(Layout* layout, const QString& screenId, const QRectF& screenGeometry);
31
32 static void recalculateSync(Layout* layout, const QRectF& screenGeometry);
33
34Q_SIGNALS:
35 void geometriesComputed(const QString& screenId, const QUuid& layoutId, PhosphorZones::Layout* layout);
36 void requestCompute(const PhosphorZones::LayoutSnapshot& snapshot, uint64_t generation);
37
38private:
39 static LayoutSnapshot buildSnapshot(Layout* layout, const QString& screenId, const QRectF& screenGeometry);
40 void applyResult(const LayoutComputeResult& result);
41 void onLayoutRemoved(const QUuid& layoutId);
42
43 QHash<QUuid, QPointer<Layout>> m_trackedLayouts;
44 QHash<QString, uint64_t> m_screenGeneration;
45 QPointer<LayoutRegistry> m_layoutManager;
46 QThread* m_thread = nullptr;
47 LayoutWorker* m_worker = nullptr;
48};
49
50} // namespace PhosphorZones
Definition LayoutComputeService.h:21
void setLayoutManager(LayoutRegistry *manager)
static void recalculateSync(Layout *layout, const QRectF &screenGeometry)
LayoutComputeService(QObject *parent=nullptr)
bool requestRecalculate(Layout *layout, const QString &screenId, const QRectF &screenGeometry)
void geometriesComputed(const QString &screenId, const QUuid &layoutId, PhosphorZones::Layout *layout)
void requestCompute(const PhosphorZones::LayoutSnapshot &snapshot, uint64_t generation)
Manual zone-layout registry + per-context assignment store.
Definition LayoutRegistry.h:48
Definition LayoutWorker.h:13
Represents a collection of zones that form a layout.
Definition Layout.h:74
constexpr QLatin1String LayoutRegistry("org.plasmazones.LayoutRegistry")
Definition IWindowTrackingService.h:22
Definition LayoutComputeTypes.h:41
Definition LayoutComputeTypes.h:27