File indexing completed on 2024-03-24 17:07:35

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 class QWaylandLayerShell;
0020 
0021 class LAYERSHELLQT_EXPORT QWaylandLayerSurface : public QtWaylandClient::QWaylandShellSurface, public QtWayland::zwlr_layer_surface_v1
0022 {
0023     Q_OBJECT
0024 public:
0025     QWaylandLayerSurface(QWaylandLayerShell *shell, QtWaylandClient::QWaylandWindow *window);
0026     ~QWaylandLayerSurface() override;
0027 
0028     bool isExposed() const override
0029     {
0030         return m_configured;
0031     }
0032 
0033     void setAnchor(uint32_t anchor);
0034     void setExclusiveZone(int32_t zone);
0035     void setMargins(const QMargins &margins);
0036     void setKeyboardInteractivity(uint32_t interactivity);
0037     void setLayer(uint32_t layer);
0038 
0039     void applyConfigure() override;
0040 
0041 private:
0042     void zwlr_layer_surface_v1_configure(uint32_t serial, uint32_t width, uint32_t height) override;
0043     void zwlr_layer_surface_v1_closed() override;
0044 
0045     QSize m_pendingSize;
0046     bool m_configured = false;
0047 };
0048 
0049 }
0050 
0051 #endif