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

0001 /*
0002     SPDX-FileCopyrightText: 2022 Xaver Hugl <xaver.hugl@gmail.com>
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 "surface.h"
0009 
0010 #include "wayland/qwayland-server-content-type-v1.h"
0011 
0012 #include <QPointer>
0013 
0014 namespace KWin
0015 {
0016 
0017 class ContentTypeV1Interface;
0018 class Display;
0019 
0020 class ContentTypeManagerV1Interface : public QObject, private QtWaylandServer::wp_content_type_manager_v1
0021 {
0022 public:
0023     ContentTypeManagerV1Interface(Display *display, QObject *parent = nullptr);
0024 
0025 private:
0026     void wp_content_type_manager_v1_destroy(QtWaylandServer::wp_content_type_manager_v1::Resource *resource) override;
0027     void wp_content_type_manager_v1_get_surface_content_type(Resource *resource, uint32_t id, struct ::wl_resource *surface) override;
0028 };
0029 
0030 class ContentTypeV1Interface : public QObject, private QtWaylandServer::wp_content_type_v1
0031 {
0032     Q_OBJECT
0033 public:
0034     ContentTypeV1Interface(SurfaceInterface *surface, wl_client *client, uint32_t id);
0035 
0036 private:
0037     void wp_content_type_v1_set_content_type(QtWaylandServer::wp_content_type_v1::Resource *resource, uint32_t content_type) override;
0038     void wp_content_type_v1_destroy(QtWaylandServer::wp_content_type_v1::Resource *resource) override;
0039     void wp_content_type_v1_destroy_resource(QtWaylandServer::wp_content_type_v1::Resource *resource) override;
0040 
0041     const QPointer<SurfaceInterface> m_surface;
0042 };
0043 
0044 }