File indexing completed on 2023-12-03 12:24:54
0001 /* 0002 * SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez <aleixpol@blue-systems.com> 0003 * SPDX-FileCopyrightText: 2018 Drew DeVault <sir@cmpwn.com> 0004 * 0005 * SPDX-License-Identifier: LGPL-3.0-or-later 0006 */ 0007 0008 #ifndef _LAYERSURFACE_H 0009 #define _LAYERSURFACE_H 0010 0011 #include <wayland-client.h> 0012 0013 #include "layershellqt_export.h" 0014 #include <QtWaylandClient/private/qwaylandshellsurface_p.h> 0015 #include <qwayland-wlr-layer-shell-unstable-v1.h> 0016 0017 namespace LayerShellQt 0018 { 0019 0020 class Window; 0021 0022 class LAYERSHELLQT_EXPORT QWaylandLayerSurface : public QtWaylandClient::QWaylandShellSurface, public QtWayland::zwlr_layer_surface_v1 0023 { 0024 Q_OBJECT 0025 public: 0026 QWaylandLayerSurface(QtWayland::zwlr_layer_shell_v1 *shell, QtWaylandClient::QWaylandWindow *window); 0027 ~QWaylandLayerSurface() override; 0028 0029 bool isExposed() const override 0030 { 0031 return m_configured; 0032 } 0033 #if QT_VERSION >= QT_VERSION_CHECK(6, 6, 0) 0034 void attachPopup(QtWaylandClient::QWaylandShellSurface *popup) override; 0035 #endif 0036 0037 void setAnchor(uint32_t anchor); 0038 void setExclusiveZone(int32_t zone); 0039 void setMargins(const QMargins &margins); 0040 void setKeyboardInteractivity(uint32_t interactivity); 0041 void setLayer(uint32_t layer); 0042 0043 void applyConfigure() override; 0044 void setWindowGeometry(const QRect &geometry) override; 0045 0046 private: 0047 void zwlr_layer_surface_v1_configure(uint32_t serial, uint32_t width, uint32_t height) override; 0048 void zwlr_layer_surface_v1_closed() override; 0049 0050 LayerShellQt::Window *m_interface; 0051 QSize m_pendingSize; 0052 bool m_configured = false; 0053 }; 0054 0055 } 0056 0057 #endif