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

0001 /*
0002     SPDX-FileCopyrightText: 2022 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include <kwin_export.h>
0010 
0011 #include <QObject>
0012 
0013 #include <memory>
0014 #include <optional>
0015 
0016 struct wl_client;
0017 
0018 namespace KWaylandServer
0019 {
0020 
0021 class Display;
0022 class SurfaceInterface;
0023 class XwaylandShellV1Interface;
0024 class XwaylandShellV1InterfacePrivate;
0025 class XwaylandSurfaceV1InterfacePrivate;
0026 
0027 class KWIN_EXPORT XwaylandSurfaceV1Interface : public QObject
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     XwaylandSurfaceV1Interface(XwaylandShellV1Interface *shell, SurfaceInterface *surface, wl_client *client, uint32_t id, int version);
0033     ~XwaylandSurfaceV1Interface() override;
0034 
0035     SurfaceInterface *surface() const;
0036     std::optional<uint64_t> serial() const;
0037 
0038 private:
0039     std::unique_ptr<XwaylandSurfaceV1InterfacePrivate> d;
0040 };
0041 
0042 class KWIN_EXPORT XwaylandShellV1Interface : public QObject
0043 {
0044     Q_OBJECT
0045 
0046 public:
0047     explicit XwaylandShellV1Interface(Display *display, QObject *parent = nullptr);
0048     ~XwaylandShellV1Interface() override;
0049 
0050     XwaylandSurfaceV1Interface *findSurface(uint64_t serial) const;
0051 
0052 Q_SIGNALS:
0053     void surfaceAssociated(XwaylandSurfaceV1Interface *surface);
0054 
0055 private:
0056     std::unique_ptr<XwaylandShellV1InterfacePrivate> d;
0057 };
0058 
0059 } // namespace KWaylandServer