Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
ILayerShellTransport.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 <PhosphorLayer/phosphorlayer_export.h>
8
9#include <QMargins>
10#include <QObject>
11#include <QSize>
12#include <QString>
13#include <QtGlobal>
14
15#include <functional>
16#include <memory>
17
18QT_BEGIN_NAMESPACE
19class QQuickWindow;
20class QScreen;
21QT_END_NAMESPACE
22
23namespace PhosphorLayer {
24
42
52class PHOSPHORLAYER_EXPORT ITransportHandle
53{
54public:
55 ITransportHandle() = default;
56 virtual ~ITransportHandle() = default;
57 Q_DISABLE_COPY_MOVE(ITransportHandle)
58
59
60 virtual QQuickWindow* window() const = 0;
61
65 virtual bool isConfigured() const = 0;
66
77 virtual void setMargins(QMargins m) = 0;
78 virtual void setLayer(Layer l) = 0;
79 virtual void setExclusiveZone(int z) = 0;
80 virtual void setKeyboardInteractivity(KeyboardInteractivity k) = 0;
81 virtual void setAnchors(Anchors a) = 0;
82
95 virtual void setDesiredSize(QSize size) = 0;
97
100 virtual QSize configuredSize() const = 0;
101};
102
110class PHOSPHORLAYER_EXPORT ILayerShellTransport
111{
112public:
114 virtual ~ILayerShellTransport() = default;
115 Q_DISABLE_COPY_MOVE(ILayerShellTransport)
116
117
119 virtual bool isSupported() const = 0;
120
132 virtual std::unique_ptr<ITransportHandle> attach(QQuickWindow* win, const TransportAttachArgs& args) = 0;
133
149 using CompositorLostCallback = std::function<void()>;
150 using CompositorLostCookie = quint64;
151 [[nodiscard]] virtual CompositorLostCookie addCompositorLostCallback(CompositorLostCallback cb) = 0;
152 virtual void removeCompositorLostCallback(CompositorLostCookie cookie) = 0;
153};
154
155} // namespace PhosphorLayer
Abstracts the layer-shell protocol binding.
Definition ILayerShellTransport.h:111
quint64 CompositorLostCookie
Definition ILayerShellTransport.h:150
std::function< void()> CompositorLostCallback
Register a callback fired when the compositor's layer-shell global is removed (compositor crash / res...
Definition ILayerShellTransport.h:149
virtual ~ILayerShellTransport()=default
Handle returned by attach(); lets the caller mutate post-show properties that the wlr-layer-shell pro...
Definition ILayerShellTransport.h:53
virtual ~ITransportHandle()=default
Definition SurfaceAnimator.h:26
KeyboardInteractivity
Keyboard focus policy (wlr-layer-shell v4 adds OnDemand).
Definition Role.h:51
@ None
Surface never receives keyboard focus (click-through)
Layer
Meta-object context for namespace-level enums so QML and QMetaEnum can stringify them.
Definition Role.h:24
@ Overlay
Above everything including fullscreen (HUDs, OSDs)
constexpr Anchors AnchorNone
Definition Role.h:47
Arguments passed to ILayerShellTransport::attach().
Definition ILayerShellTransport.h:33
Layer layer
Definition ILayerShellTransport.h:35
QScreen * screen
Definition ILayerShellTransport.h:34
KeyboardInteractivity keyboard
Definition ILayerShellTransport.h:38
QMargins margins
Definition ILayerShellTransport.h:39
QString scope
Fully-qualified scope (prefix + instance disambiguator)
Definition ILayerShellTransport.h:40
Anchors anchors
Definition ILayerShellTransport.h:36
int exclusiveZone
Definition ILayerShellTransport.h:37