File indexing completed on 2024-05-19 05:32:32
0001 /* 0002 SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org> 0003 SPDX-FileCopyrightText: 2015 Marco Martin <mart@kde.org> 0004 SPDX-FileCopyrightText: 2020 David Edmundson <davidedmundson@kde.org> 0005 0006 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL 0007 */ 0008 #pragma once 0009 0010 #include "kwin_export.h" 0011 0012 #include <QObject> 0013 #include <memory> 0014 0015 struct wl_resource; 0016 0017 namespace KWin 0018 { 0019 class Display; 0020 class BlurManagerInterfacePrivate; 0021 class BlurInterfacePrivate; 0022 0023 /** 0024 * @brief Represents the Global for org_kde_kwin_blur_manager interface. 0025 * 0026 * This class creates BlurInterfaces and attaches them to SurfaceInterfaces. 0027 * 0028 * @see BlurInterface 0029 * @see SurfaceInterface 0030 */ 0031 class KWIN_EXPORT BlurManagerInterface : public QObject 0032 { 0033 Q_OBJECT 0034 public: 0035 explicit BlurManagerInterface(Display *display, QObject *parent = nullptr); 0036 ~BlurManagerInterface() override; 0037 0038 void remove(); 0039 0040 private: 0041 std::unique_ptr<BlurManagerInterfacePrivate> d; 0042 }; 0043 0044 /** 0045 * @brief Represents the Resource for the org_kde_kwin_blur interface. 0046 * 0047 * Instances of this class are only generated by the BlurManagerInterface. 0048 * The BlurInterface gets attached to a SurfaceInterface and can be assessed 0049 * from there using @link SurfaceInterface::blur() @endlink. Please note that 0050 * the BlurInterface is only available on the SurfaceInterface after it has been 0051 * committed. 0052 * 0053 * Lifespan matches the underlying client resource 0054 * 0055 * @see BlurManagerInterface 0056 * @see SurfaceInterface 0057 */ 0058 class KWIN_EXPORT BlurInterface : public QObject 0059 { 0060 Q_OBJECT 0061 public: 0062 ~BlurInterface() override; 0063 0064 /** 0065 * @returns The region or the SurfaceInterface which should be blurred, null Region implies complete surface. 0066 */ 0067 QRegion region(); 0068 0069 private: 0070 explicit BlurInterface(wl_resource *resource); 0071 friend class BlurManagerInterfacePrivate; 0072 0073 std::unique_ptr<BlurInterfacePrivate> d; 0074 }; 0075 0076 }