5#ifndef DPLATFORMHANDLE_H
6#define DPLATFORMHANDLE_H
8#include <dtkgui_global.h>
11#include <QPainterPath>
27 Q_PROPERTY(
int windowRadius READ windowRadius WRITE setWindowRadius NOTIFY windowRadiusChanged)
28 Q_PROPERTY(
int borderWidth READ borderWidth WRITE setBorderWidth NOTIFY borderWidthChanged)
29 Q_PROPERTY(QColor borderColor READ borderColor WRITE setBorderColor NOTIFY borderColorChanged)
30 Q_PROPERTY(
int shadowRadius READ shadowRadius WRITE setShadowRadius NOTIFY shadowRadiusChanged)
31 Q_PROPERTY(
QPoint shadowOffset READ shadowOffset WRITE setShadowOffset NOTIFY shadowOffsetChanged)
32 Q_PROPERTY(QColor shadowColor READ shadowColor WRITE setShadowColor NOTIFY shadowColorChanged)
33 Q_PROPERTY(QPainterPath clipPath READ clipPath WRITE setClipPath NOTIFY clipPathChanged)
34 Q_PROPERTY(QRegion frameMask READ frameMask WRITE setFrameMask NOTIFY frameMaskChanged)
35 Q_PROPERTY(
QMargins frameMargins READ frameMargins NOTIFY frameMarginsChanged)
36 Q_PROPERTY(
bool translucentBackground READ translucentBackground WRITE setTranslucentBackground NOTIFY translucentBackgroundChanged)
37 Q_PROPERTY(
bool enableSystemResize READ enableSystemResize WRITE setEnableSystemResize NOTIFY enableSystemResizeChanged)
38 Q_PROPERTY(
bool enableSystemMove READ enableSystemMove WRITE setEnableSystemMove NOTIFY enableSystemMoveChanged)
39 Q_PROPERTY(
bool enableBlurWindow READ enableBlurWindow WRITE setEnableBlurWindow NOTIFY enableBlurWindowChanged)
40 Q_PROPERTY(
bool autoInputMaskByClipPath READ autoInputMaskByClipPath WRITE setAutoInputMaskByClipPath NOTIFY autoInputMaskByClipPathChanged)
41 Q_PROPERTY(WId realWindowId READ realWindowId CONSTANT)
47 static bool isDXcbPlatform();
49 static void enableDXcbForWindow(QWindow *window);
50 static void enableDXcbForWindow(QWindow *window,
bool redirectContent);
51 static bool isEnabledDXcb(
const QWindow *window);
53 static bool setEnabledNoTitlebarForWindow(QWindow *window,
bool enable);
54 static bool isEnabledNoTitlebar(
const QWindow *window);
65 enum WallpaperScaleMode {
66 FollowScreen = 0x00000000,
67 FollowWindow = 0x00010000
70 enum WallpaperFillMode {
71 PreserveAspectCrop = 0x00000000,
72 PreserveAspectFit = 0x00000001
77 static bool setWindowWallpaperParaByWM(QWindow *window,
const QRect &area, WallpaperScaleMode sMode, WallpaperFillMode fMode);
78 static bool connectWindowManagerChangedSignal(
QObject *
object, std::function<
void ()> slot);
79 static bool connectHasBlurWindowChanged(
QObject *
object, std::function<
void ()> slot);
84 static void setDisableWindowOverrideCursor(QWindow *window,
bool disable);
86 int windowRadius()
const;
88 int borderWidth()
const;
89 QColor borderColor()
const;
91 int shadowRadius()
const;
92 QPoint shadowOffset()
const;
93 QColor shadowColor()
const;
95 QPainterPath clipPath()
const;
96 QRegion frameMask()
const;
99 bool translucentBackground()
const;
100 bool enableSystemResize()
const;
101 bool enableSystemMove()
const;
102 bool enableBlurWindow()
const;
103 bool autoInputMaskByClipPath()
const;
105 WId realWindowId()
const;
106 static WId windowLeader();
109 void setWindowRadius(
int windowRadius);
111 void setBorderWidth(
int borderWidth);
112 void setBorderColor(
const QColor &borderColor);
114 void setShadowRadius(
int shadowRadius);
115 void setShadowOffset(
const QPoint &shadowOffset);
116 void setShadowColor(
const QColor &shadowColor);
118 void setClipPath(
const QPainterPath &clipPath);
119 void setFrameMask(
const QRegion &frameMask);
121 void setTranslucentBackground(
bool translucentBackground);
122 void setEnableSystemResize(
bool enableSystemResize);
123 void setEnableSystemMove(
bool enableSystemMove);
124 void setEnableBlurWindow(
bool enableBlurWindow);
125 void setAutoInputMaskByClipPath(
bool autoInputMaskByClipPath);
144 bool eventFilter(
QObject *obj,
QEvent *event) Q_DECL_OVERRIDE;
171Q_DECLARE_METATYPE(QPainterPath)
172Q_DECLARE_METATYPE(QRegion)