| 1 |
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. |
| 2 |
// |
| 3 |
// SPDX-License-Identifier: LGPL-3.0-or-later |
| 4 |
|
| 5 |
#ifndef DXCBPLATFORMWINDOWINTERFACE_H |
| 6 |
#define DXCBPLATFORMWINDOWINTERFACE_H |
| 7 |
|
| 8 |
#include "private/dplatformwindowinterface_p.h" |
| 9 |
|
| 10 |
#include <QWindow> |
| 11 |
|
| 12 |
DGUI_BEGIN_NAMESPACE |
| 13 |
|
| 14 |
class DXCBPlatformWindowInterface : public QObject, public DPlatformWindowInterface |
| 15 |
{ |
| 16 |
Q_OBJECT |
| 17 |
public: |
| 18 |
DXCBPlatformWindowInterface(QWindow *window, DPlatformHandle *platformHandle, QObject *parent = nullptr); |
| 19 |
~DXCBPlatformWindowInterface() override; |
| 20 |
|
| 21 |
static QString pluginVersion(); |
| 22 |
static bool isDXcbPlatform(); |
| 23 |
static bool connectWindowManagerChangedSignal(QObject *object, std::function<void ()> slot); |
| 24 |
static bool connectHasBlurWindowChanged(QObject *object, std::function<void ()> slot); |
| 25 |
static WId windowLeader(); |
| 26 |
|
| 27 |
void enableDXcb(bool redirectContent); |
| 28 |
|
| 29 |
bool setWindowBlurArea(const QVector<DPlatformHandle::WMBlurArea> &area); |
| 30 |
bool setWindowBlurArea(const QList<QPainterPath> &paths); |
| 31 |
bool setWindowWallpaperPara(const QRect &area, DPlatformHandle::WallpaperScaleMode sMode, DPlatformHandle::WallpaperFillMode fMode); |
| 32 |
|
| 33 |
bool autoInputMaskByClipPath() const; |
| 34 |
void setAutoInputMaskByClipPath(bool autoInputMaskByClipPath); |
| 35 |
|
| 36 |
WId realWindowId() const; |
| 37 |
|
| 38 |
void setEnabled(bool enabled) override; |
| 39 |
bool isEnabled() const override; |
| 40 |
|
| 41 |
void setDisableWindowOverrideCursor(bool disable) override; |
| 42 |
|
| 43 |
bool isEnabledNoTitlebar() const override; |
| 44 |
bool setEnabledNoTitlebar(bool enable) override; |
| 45 |
|
| 46 |
int windowRadius() const override; |
| 47 |
void setWindowRadius(int windowRadius) override; |
| 48 |
|
| 49 |
int borderWidth() const override; |
| 50 |
void setBorderWidth(int borderWidth) override; |
| 51 |
|
| 52 |
QColor borderColor() const override; |
| 53 |
void setBorderColor(const QColor &borderColor) override; |
| 54 |
|
| 55 |
int shadowRadius() const override; |
| 56 |
void setShadowRadius(int shadowRadius) override; |
| 57 |
|
| 58 |
QPoint shadowOffset() const override; |
| 59 |
void setShadowOffset(const QPoint &shadowOffset) override; |
| 60 |
|
| 61 |
QColor shadowColor() const override; |
| 62 |
void setShadowColor(const QColor &shadowColor) override; |
| 63 |
|
| 64 |
DPlatformHandle::EffectScene windowEffect() override; |
| 65 |
void setWindowEffect(DPlatformHandle::EffectScenes effectScene) override; |
| 66 |
|
| 67 |
DPlatformHandle::EffectType windowStartUpEffect() override; |
| 68 |
void setWindowStartUpEffect(DPlatformHandle::EffectTypes effectType) override; |
| 69 |
|
| 70 |
QPainterPath clipPath() const override; |
| 71 |
void setClipPath(const QPainterPath &clipPath) override; |
| 72 |
|
| 73 |
QRegion frameMask() const override; |
| 74 |
void setFrameMask(const QRegion &frameMask) override; |
| 75 |
|
| 76 |
QMargins frameMargins() const override; |
| 77 |
|
| 78 |
bool translucentBackground() const override; |
| 79 |
void setTranslucentBackground(bool translucentBackground) override; |
| 80 |
|
| 81 |
bool enableSystemResize() const override; |
| 82 |
void setEnableSystemResize(bool enableSystemResize) override; |
| 83 |
|
| 84 |
bool enableSystemMove() const override; |
| 85 |
void setEnableSystemMove(bool enableSystemMove) override; |
| 86 |
|
| 87 |
bool enableBlurWindow() const override; |
| 88 |
void setEnableBlurWindow(bool enableBlurWindow) override; |
| 89 |
|
| 90 |
protected: |
| 91 |
bool eventFilter(QObject *watched, QEvent *event) override; |
| 92 |
}; |
| 93 |
|
| 94 |
DGUI_END_NAMESPACE |
| 95 |
#endif // DXCBPLATFORMWINDOWINTERFACE_H |