DtkGui
DTK Gui module
载入中...
搜索中...
未找到
dwin32platformwindowinterface.h
1// SPDX-FileCopyrightText: 2026 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DWIN32PLATFORMWINDOWINTERFACE_H
6#define DWIN32PLATFORMWINDOWINTERFACE_H
7
8#include "private/dplatformwindowinterface_p.h"
9
10#include <QWindow>
11
12DGUI_BEGIN_NAMESPACE
13
15{
16 Q_OBJECT
17public:
18 DWin32PlatformWindowInterface(QWindow *window, DPlatformHandle *platformHandle, QObject *parent = nullptr);
20
21 void setEnabled(bool enabled) override;
22 bool isEnabled() const override;
23
24 bool isEnabledNoTitlebar() const override;
25 bool setEnabledNoTitlebar(bool enable) override;
26
27 int windowRadius() const override;
28 void setWindowRadius(int windowRadius) override;
29
30 int borderWidth() const override;
31 void setBorderWidth(int borderWidth) override;
32
33 QColor borderColor() const override;
34 void setBorderColor(const QColor &borderColor) override;
35
36 int shadowRadius() const override;
37 void setShadowRadius(int shadowRadius) override;
38
39 QPoint shadowOffset() const override;
40 void setShadowOffset(const QPoint &shadowOffset) override;
41
42 QColor shadowColor() const override;
43 void setShadowColor(const QColor &shadowColor) override;
44
45 void setDisableWindowOverrideCursor(bool disable) override;
46
47 DPlatformHandle::EffectScene windowEffect() override;
48 void setWindowEffect(DPlatformHandle::EffectScenes effectScene) override;
49
50 DPlatformHandle::EffectType windowStartUpEffect() override;
51 void setWindowStartUpEffect(DPlatformHandle::EffectTypes effectType) override;
52
53 QPainterPath clipPath() const override;
54 void setClipPath(const QPainterPath &clipPath) override;
55
56 QRegion frameMask() const override;
57 void setFrameMask(const QRegion &frameMask) override;
58
59 QMargins frameMargins() const override;
60
61 bool translucentBackground() const override;
62 void setTranslucentBackground(bool translucentBackground) override;
63
64 bool enableSystemResize() const override;
65 void setEnableSystemResize(bool enableSystemResize) override;
66
67 bool enableSystemMove() const override;
68 void setEnableSystemMove(bool enableSystemMove) override;
69
70 bool enableBlurWindow() const override;
71 void setEnableBlurWindow(bool enableBlurWindow) override;
72
73protected:
74 bool eventFilter(QObject *watched, QEvent *event) override;
75
76private:
77 void updateShadow();
78 void updateRoundedCorners();
79 void updateSystemTheme();
80 void *hwnd() const;
81
82 void updateClipPath();
83 void updateFrameMask();
84 void updateTranslucentBackground();
85 void updateBlurWindow();
86
87 int m_windowRadius = 12;
88 int m_borderWidth = 1;
89 QColor m_borderColor;
90 int m_shadowRadius = -1;
91 QPoint m_shadowOffset;
92 QColor m_shadowColor;
93 DPlatformHandle::EffectScenes m_windowEffect;
94 DPlatformHandle::EffectTypes m_windowStartUpEffect;
95 QPainterPath m_clipPath;
96 QRegion m_frameMask;
97 bool m_translucentBackground = false;
98 bool m_enableSystemResize = true;
99 bool m_enableSystemMove = true;
100 bool m_enableBlurWindow = false;
101 bool m_disableOverrideCursor = false;
102 bool m_enabled = false;
103 bool m_windowVisible = false;
104 bool m_systemDarkMode = false;
105 bool m_windowMoving = false;
106 QPointF m_pressPoint;
107};
108
109DGUI_END_NAMESPACE
110#endif // DWIN32PLATFORMWINDOWINTERFACE_H
一个和Qt dxcb平台插件交互的工具类.
Definition dplatformhandle.h:24
Definition dplatformwindowinterface_p.h:16
Definition dwin32platformwindowinterface.h:15