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

0001 /*
0002     SPDX-FileCopyrightText: 2020 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 "qwayland-server-viewporter.h"
0010 
0011 #include <QPointer>
0012 
0013 namespace KWin
0014 {
0015 class SurfaceInterface;
0016 
0017 class ViewportInterface : public QtWaylandServer::wp_viewport
0018 {
0019 public:
0020     ViewportInterface(SurfaceInterface *surface, wl_resource *resource);
0021     ~ViewportInterface() override;
0022 
0023     static ViewportInterface *get(SurfaceInterface *surface);
0024 
0025     QPointer<SurfaceInterface> surface;
0026 
0027 protected:
0028     void wp_viewport_destroy_resource(Resource *resource) override;
0029     void wp_viewport_destroy(Resource *resource) override;
0030     void wp_viewport_set_source(Resource *resource, wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height) override;
0031     void wp_viewport_set_destination(Resource *resource, int32_t width, int32_t height) override;
0032 };
0033 
0034 } // namespace KWin