Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qplatformwindow_p.h
Go to the documentation of this file.
1
// Copyright (C) 2016 The Qt Company Ltd.
2
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
// Qt-Security score:significant reason:default
4
5
#
ifndef
QPLATFORMWINDOW_P_H
6
#
define
QPLATFORMWINDOW_P_H
7
8
//
9
// W A R N I N G
10
// -------------
11
//
12
// This file is not part of the Qt API. It exists purely as an
13
// implementation detail. This header file may change from version to
14
// version without notice, or even be removed.
15
//
16
// We mean it.
17
//
18
19
#
include
<
QtGui
/
private
/
qtguiglobal_p
.
h
>
20
#
include
<
QtCore
/
qbasictimer
.
h
>
21
#
include
<
QtCore
/
qrect
.
h
>
22
#
include
<
QtCore
/
qnativeinterface
.
h
>
23
#
include
<
QtGui
/
qwindow
.
h
>
24
25
#
if
QT_CONFIG
(
wayland
)
26
#
include
<
any
>
27
#
include
<
QtCore
/
qobject
.
h
>
28
29
struct
wl_surface
;
30
#
endif
31
32
#
if
defined
(
Q_OS_MACOS
)
33
Q_FORWARD_DECLARE_OBJC_CLASS
(
NSView
);
34
Q_FORWARD_DECLARE_OBJC_CLASS
(
CALayer
);
35
typedef
long
NSInteger
;
36
enum
NSVisualEffectMaterial
:
NSInteger
;
37
enum
NSVisualEffectBlendingMode
:
NSInteger
;
38
enum
NSVisualEffectState
:
NSInteger
;
39
#
endif
40
41
#
if
defined
(
Q_OS_WIN
)
42
#
include
<
QtGui
/
qwindowdefs_win
.
h
>
43
#
endif
44
45
#
if
defined
(
Q_OS_HARMONY
)
46
#
include
<
optional
>
47
48
typedef
struct
ArkUI_Node
*
ArkUI_NodeHandle
;
49
#
endif
50
51
QT_BEGIN_NAMESPACE
52
53
class
QMargins
;
54
55
class
QPlatformWindowPrivate
56
{
57
public
:
58
QRect
rect
;
59
QBasicTimer
updateTimer
;
60
};
61
62
// ----------------- QNativeInterface -----------------
63
64
namespace
QNativeInterface::
Private
{
65
66
#
if
defined
(
Q_OS_WASM
)
||
defined
(
Q_QDOC
)
67
struct
Q_GUI_EXPORT
QWasmWindow
68
{
69
QT_DECLARE_NATIVE_INTERFACE
(
QWasmWindow
, 1,
QWindow
)
70
virtual
emscripten
::
val
document
()
const
= 0;
71
virtual
emscripten
::
val
clientArea
()
const
= 0;
72
virtual
emscripten
::
val
canvas
()
const
= 0;
73
};
74
#
endif
75
76
#
if
defined
(
Q_OS_MACOS
)
||
defined
(
Q_QDOC
)
77
struct
Q_GUI_EXPORT
QCocoaWindow
78
{
79
QT_DECLARE_NATIVE_INTERFACE
(
QCocoaWindow
, 5,
QWindow
)
80
virtual
NSView
*
view
()
const
= 0;
81
virtual
QPoint
bottomLeftClippedByNSWindowOffset
()
const
= 0;
82
virtual
CALayer
*
contentLayer
()
const
= 0;
83
virtual
void
manageVisualEffectArea
(
quintptr
identifier
,
const
QRect
&
rect
,
84
NSVisualEffectMaterial
material
,
NSVisualEffectBlendingMode
blendMode
,
85
NSVisualEffectState
activationState
) = 0;
86
virtual
void
enableTrackpadTouchDelivery
(
bool
enable
) = 0;
87
};
88
#
endif
89
90
#
if
QT_CONFIG
(
xcb
)
||
defined
(
Q_QDOC
)
91
struct
Q_GUI_EXPORT
QXcbWindow
92
{
93
QT_DECLARE_NATIVE_INTERFACE
(
QXcbWindow
, 1,
QWindow
)
94
95
enum
WindowType
{
96
None
= 0x000000,
97
Normal
= 0x000001,
98
Desktop
= 0x000002,
99
Dock
= 0x000004,
100
Toolbar
= 0x000008,
101
Menu
= 0x000010,
102
Utility
= 0x000020,
103
Splash
= 0x000040,
104
Dialog
= 0x000080,
105
DropDownMenu
= 0x000100,
106
PopupMenu
= 0x000200,
107
Tooltip
= 0x000400,
108
Notification
= 0x000800,
109
Combo
= 0x001000,
110
Dnd
= 0x002000,
111
KdeOverride
= 0x004000
112
};
113
Q_DECLARE_FLAGS
(
WindowTypes
,
WindowType
)
114
115
virtual
void
setWindowType
(
WindowTypes
type
) = 0;
116
virtual
void
setWindowRole
(
const
QString
&
role
) = 0;
117
virtual
void
setWindowIconText
(
const
QString
&
text
) = 0;
118
virtual
uint
visualId
()
const
= 0;
119
};
120
#
endif
// xcb
121
122
#
if
defined
(
Q_OS_WIN
)
||
defined
(
Q_QDOC
)
123
struct
Q_GUI_EXPORT
QWindowsWindow
124
{
125
QT_DECLARE_NATIVE_INTERFACE
(
QWindowsWindow
, 2,
QWindow
)
126
127
virtual
HWND
handle
()
const
= 0;
128
129
virtual
void
setHasBorderInFullScreen
(
bool
border
) = 0;
130
virtual
bool
hasBorderInFullScreen
()
const
= 0;
131
132
virtual
QMargins
customMargins
()
const
= 0;
133
virtual
void
setCustomMargins
(
const
QMargins
&
margins
) = 0;
134
};
135
#
endif
// Q_OS_WIN
136
137
#
if
QT_CONFIG
(
wayland
)
138
struct
Q_GUI_EXPORT
QWaylandWindow
:
public
QObject
139
{
140
Q_OBJECT
141
public
:
142
QT_DECLARE_NATIVE_INTERFACE
(
QWaylandWindow
, 1,
QWindow
)
143
144
enum
WindowType
{
145
Default
,
146
ToolTip
,
147
ComboBox
,
148
Menu
,
149
SubMenu
,
150
};
151
152
virtual
wl_surface
*
surface
()
const
= 0;
153
virtual
void
setCustomMargins
(
const
QMargins
&
margins
) = 0;
154
virtual
void
requestXdgActivationToken
(
uint
serial
) = 0;
155
template
<
typename
T
>
156
T
*
surfaceRole
()
const
157
{
158
std
::
any
anyRole
=
_surfaceRole
();
159
auto
role
=
std
::
any_cast
<
T
*>(&
anyRole
);
160
return
role
? *
role
:
nullptr
;
161
}
162
virtual
void
setSessionRestoreId
(
const
QString
&
role
) = 0;
163
164
virtual
void
setExtendedWindowType
(
WindowType
windowType
) = 0;
165
virtual
void
setParentControlGeometry
(
const
QRect
&
parentAnchor
) = 0;
166
167
Q_SIGNALS
:
168
void
surfaceCreated
();
169
void
surfaceDestroyed
();
170
void
surfaceRoleCreated
();
171
void
surfaceRoleDestroyed
();
172
void
xdgActivationTokenCreated
(
const
QString
&
token
);
173
174
protected
:
175
virtual
std
::
any
_surfaceRole
()
const
= 0;
176
};
177
#
endif
178
179
#
if
defined
(
Q_OS_HARMONY
)
180
struct
Q_GUI_EXPORT
QOhosWindow
181
{
182
QT_DECLARE_NATIVE_INTERFACE
(
QOhosWindow
, 1,
QWindow
)
183
static
QWindow
*
fromNative
(
ArkUI_NodeHandle
content
);
184
virtual
std
::
optional
<
double
>
windowId
()
const
= 0;
185
};
186
187
struct
Q_GUI_EXPORT
QOhosIntegration
188
{
189
QT_DECLARE_NATIVE_INTERFACE
(
QOhosIntegration
)
190
virtual
WId
windowHandle
(
ArkUI_NodeHandle
content
) = 0;
191
virtual
void
setMainWindowGeometryPersistenceEnabled
(
std
::
optional
<
bool
>
enabled
) = 0;
192
};
193
#
endif
// defined(Q_OS_HARMONY)
194
195
}
// QNativeInterface::Private
196
197
QT_END_NAMESPACE
198
199
#
endif
// QPLATFORMWINDOW_P_H
QMargins
\inmodule QtCore
Definition
qmargins.h:27
QPlatformWindowPrivate
Definition
qplatformwindow_p.h:56
QPlatformWindowPrivate::rect
QRect rect
Definition
qplatformwindow_p.h:58
QPlatformWindowPrivate::updateTimer
QBasicTimer updateTimer
Definition
qplatformwindow_p.h:59
QNativeInterface
Definition
qnativeinterface.h:51
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
fixInitialSize
static QSize fixInitialSize(QSize size, const QWindow *w, int deviceIndependentDefaultWidth, int deviceIndependentDefaultHeight)
Definition
qplatformwindow.cpp:670
effectiveScreen
static const QScreen * effectiveScreen(const QWindow *window)
Definition
qplatformwindow.cpp:634
QWINDOWSIZE_MAX
#define QWINDOWSIZE_MAX
Definition
qplatformwindow.h:28
qtbase
src
gui
kernel
qplatformwindow_p.h
Generated on
for Qt by
1.16.1