File indexing completed on 2025-04-20 05:00:04
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 KWin 0019 { 0020 0021 class Display; 0022 class SurfaceInterface; 0023 class SurfaceRole; 0024 class XwaylandShellV1Interface; 0025 class XwaylandShellV1InterfacePrivate; 0026 class XwaylandSurfaceV1InterfacePrivate; 0027 0028 class KWIN_EXPORT XwaylandSurfaceV1Interface : public QObject 0029 { 0030 Q_OBJECT 0031 0032 public: 0033 XwaylandSurfaceV1Interface(XwaylandShellV1Interface *shell, SurfaceInterface *surface, wl_client *client, uint32_t id, int version); 0034 ~XwaylandSurfaceV1Interface() override; 0035 0036 static SurfaceRole *role(); 0037 0038 SurfaceInterface *surface() const; 0039 std::optional<uint64_t> serial() const; 0040 0041 private: 0042 std::unique_ptr<XwaylandSurfaceV1InterfacePrivate> d; 0043 }; 0044 0045 class KWIN_EXPORT XwaylandShellV1Interface : public QObject 0046 { 0047 Q_OBJECT 0048 0049 public: 0050 explicit XwaylandShellV1Interface(Display *display, QObject *parent = nullptr); 0051 ~XwaylandShellV1Interface() override; 0052 0053 XwaylandSurfaceV1Interface *findSurface(uint64_t serial) const; 0054 0055 Q_SIGNALS: 0056 void surfaceAssociated(XwaylandSurfaceV1Interface *surface); 0057 0058 private: 0059 std::unique_ptr<XwaylandShellV1InterfacePrivate> d; 0060 }; 0061 0062 } // namespace KWin