File indexing completed on 2024-05-19 16:35:27

0001 /*
0002     SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 #pragma once
0007 
0008 #include "kwin_export.h"
0009 
0010 #include <QMarginsF>
0011 #include <QObject>
0012 #include <memory>
0013 
0014 struct wl_resource;
0015 
0016 namespace KWaylandServer
0017 {
0018 class ClientBuffer;
0019 class Display;
0020 class ShadowManagerInterfacePrivate;
0021 class ShadowInterfacePrivate;
0022 
0023 class KWIN_EXPORT ShadowManagerInterface : public QObject
0024 {
0025     Q_OBJECT
0026 
0027 public:
0028     explicit ShadowManagerInterface(Display *display, QObject *parent = nullptr);
0029     ~ShadowManagerInterface() override;
0030 
0031     Display *display() const;
0032 
0033 private:
0034     std::unique_ptr<ShadowManagerInterfacePrivate> d;
0035 };
0036 
0037 class KWIN_EXPORT ShadowInterface : public QObject
0038 {
0039     Q_OBJECT
0040 public:
0041     ~ShadowInterface() override;
0042 
0043     ClientBuffer *left() const;
0044     ClientBuffer *topLeft() const;
0045     ClientBuffer *top() const;
0046     ClientBuffer *topRight() const;
0047     ClientBuffer *right() const;
0048     ClientBuffer *bottomRight() const;
0049     ClientBuffer *bottom() const;
0050     ClientBuffer *bottomLeft() const;
0051 
0052     QMarginsF offset() const;
0053 
0054 private:
0055     explicit ShadowInterface(ShadowManagerInterface *manager, wl_resource *resource);
0056     friend class ShadowManagerInterfacePrivate;
0057 
0058     std::unique_ptr<ShadowInterfacePrivate> d;
0059 };
0060 
0061 }