Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
IPanelSource.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
6#include "phosphorscreenscore_export.h"
7
8#include <QObject>
9
10class QScreen;
11
12namespace Phosphor::Screens {
13
32class PHOSPHORSCREENSCORE_EXPORT IPanelSource : public QObject
33{
34 Q_OBJECT
35public:
39 struct Offsets
40 {
41 int top = 0;
42 int bottom = 0;
43 int left = 0;
44 int right = 0;
45
46 bool isZero() const noexcept
47 {
48 return top == 0 && bottom == 0 && left == 0 && right == 0;
49 }
50 bool operator==(const Offsets&) const = default;
51 };
52
53 explicit IPanelSource(QObject* parent = nullptr)
54 : QObject(parent)
55 {
56 }
57 ~IPanelSource() override = default;
58
62 virtual void start() = 0;
63
66 virtual void stop() = 0;
67
70 virtual Offsets currentOffsets(QScreen* screen) const = 0;
71
83 virtual bool ready() const = 0;
84
90 virtual void requestRequery(int delayMs = 0) = 0;
91
92Q_SIGNALS:
95 void panelOffsetsChanged(QScreen* screen);
96
102};
103
104} // namespace Phosphor::Screens
Pluggable producer of panel-reservation offsets per screen.
Definition IPanelSource.h:33
virtual void requestRequery(int delayMs=0)=0
Best-effort: ask the backend to re-query immediately, optionally after a short delay (e....
void requeryCompleted()
A requestRequery cycle completed.
virtual bool ready() const =0
Has any successful query landed? Drives ScreenManager's panelGeometryReady one-shot signal — consumer...
virtual void stop()=0
Stop watching.
virtual Offsets currentOffsets(QScreen *screen) const =0
Snapshot for a given screen.
virtual void start()=0
Begin watching.
IPanelSource(QObject *parent=nullptr)
Definition IPanelSource.h:53
~IPanelSource() override=default
void panelOffsetsChanged(QScreen *screen)
Offsets for screen changed.
Definition IWindowTrackingService.h:26
Per-edge reserved geometry, in physical pixels relative to the screen's top-left.
Definition IPanelSource.h:40
bool operator==(const Offsets &) const =default
bool isZero() const noexcept
Definition IPanelSource.h:46