File indexing completed on 2024-05-19 16:35:29
0001 /* 0002 SPDX-FileCopyrightText: 2019 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 #pragma once 0007 0008 #include <QByteArray> 0009 #include <QPointer> 0010 0011 namespace KWaylandServer 0012 { 0013 class SurfaceInterface; 0014 0015 class SurfaceRole 0016 { 0017 public: 0018 SurfaceRole(SurfaceInterface *surface, const QByteArray &name); 0019 virtual ~SurfaceRole(); 0020 0021 QByteArray name() const; 0022 const QPointer<SurfaceInterface> &surface() const 0023 { 0024 return m_surface; 0025 } 0026 0027 virtual void commit() = 0; 0028 0029 static SurfaceRole *get(SurfaceInterface *surface); 0030 0031 private: 0032 QPointer<SurfaceInterface> m_surface; 0033 QByteArray m_name; 0034 0035 Q_DISABLE_COPY(SurfaceRole) 0036 }; 0037 0038 }