File indexing completed on 2024-05-19 05:32:32

0001 /*
0002     SPDX-FileCopyrightText: 2014 Martin Gräßlin <mgraesslin@kde.org>
0003     SPDX-FileCopyrightText: 2020 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
0004 
0005     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0006 */
0007 #pragma once
0008 
0009 #include "kwin_export.h"
0010 
0011 #include "surface.h"
0012 
0013 #include <QObject>
0014 
0015 namespace KWin
0016 {
0017 class CompositorInterfacePrivate;
0018 class Display;
0019 
0020 /**
0021  * The CompositorInterface global allows clients to create surfaces and region objects.
0022  *
0023  * The CompositorInterface corresponds to the Wayland interface @c wl_compositor.
0024  */
0025 class KWIN_EXPORT CompositorInterface : public QObject
0026 {
0027     Q_OBJECT
0028 
0029 public:
0030     explicit CompositorInterface(Display *display, QObject *parent = nullptr);
0031     ~CompositorInterface() override;
0032 
0033     /**
0034      * Returns the Display object for this CompositorInterface.
0035      */
0036     Display *display() const;
0037 
0038 Q_SIGNALS:
0039     /**
0040      * This signal is emitted when a new SurfaceInterface @a surface has been created.
0041      */
0042     void surfaceCreated(KWin::SurfaceInterface *surface);
0043 
0044 private:
0045     std::unique_ptr<CompositorInterfacePrivate> d;
0046 };
0047 
0048 } // namespace KWin