DtkGui
DTK Gui module
载入中...
搜索中...
未找到
treelandbackgroundeffectclientextension.h
1// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef TREELANDBACKGROUNDEFFECTCLIENTEXTENSION_H
6#define TREELANDBACKGROUNDEFFECTCLIENTEXTENSION_H
7
8#include "qwayland-ext-background-effect-v1.h"
9
10#include <dtkgui_global.h>
11#include <QRegion>
12#include <private/qwaylanddisplay_p.h>
13
14#include <QtWaylandClient/QWaylandClientExtension>
15#include <QWaylandClientExtensionTemplate>
16
17DGUI_BEGIN_NAMESPACE
18
19class BackgroundEffectManager : public QWaylandClientExtensionTemplate<BackgroundEffectManager>,
20 public QtWayland::ext_background_effect_manager_v1
21{
22 Q_OBJECT
23public:
24 static BackgroundEffectManager *instance();
25
26 [[nodiscard]] inline bool isSupported() const { return m_isSupported; }
27 [[nodiscard]] inline bool hasBlurCapability() const { return m_hasBlurCapability; }
28
29Q_SIGNALS:
30 void blurCapabilityChanged();
31
32private:
33 void addListener();
34 void removeListener();
35
36 explicit BackgroundEffectManager();
37 static void handleListenerGlobal(void *data, wl_registry *registry, uint32_t id, const QString &interface, uint32_t version);
38
39protected:
40 void ext_background_effect_manager_v1_capabilities(uint32_t flags) override;
41
42private:
43 QtWaylandClient::QWaylandDisplay *m_waylandDisplay = nullptr;
44 bool m_isSupported;
45 bool m_hasBlurCapability;
46};
47
48class BackgroundEffectSurface : public QWaylandClientExtensionTemplate<BackgroundEffectSurface>,
49 public QtWayland::ext_background_effect_surface_v1
50{
51 Q_OBJECT
52public:
53 explicit BackgroundEffectSurface(struct ::ext_background_effect_surface_v1 *surface);
54 ~BackgroundEffectSurface() override;
55
56 void setBlurRegion(const QRegion &region, QtWaylandClient::QWaylandDisplay *display);
57};
58
59DGUI_END_NAMESPACE
60
61#endif // TREELANDBACKGROUNDEFFECTCLIENTEXTENSION_H
Definition treelandbackgroundeffectclientextension.h:21
Definition treelandbackgroundeffectclientextension.h:50