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
(
CALayer
);
34
typedef
long
NSInteger
;
35
enum
NSVisualEffectMaterial
:
NSInteger
;
36
enum
NSVisualEffectBlendingMode
:
NSInteger
;
37
enum
NSVisualEffectState
:
NSInteger
;
38
#
endif
39
40
QT_BEGIN_NAMESPACE
41
42
class
QMargins
;
43
44
class
QPlatformWindowPrivate
45
{
46
public
:
47
QRect
rect
;
48
QBasicTimer
updateTimer
;
49
};
50
51
// ----------------- QNativeInterface -----------------
52
53
namespace
QNativeInterface::
Private
{
54
55
#
if
defined
(
Q_OS_WASM
)
||
defined
(
Q_QDOC
)
56
struct
Q_GUI_EXPORT
QWasmWindow
57
{
58
QT_DECLARE_NATIVE_INTERFACE
(
QWasmWindow
, 1,
QWindow
)
59
virtual
emscripten
::
val
document
()
const
= 0;
60
virtual
emscripten
::
val
clientArea
()
const
= 0;
61
};
62
#
endif
63
64
#
if
defined
(
Q_OS_MACOS
)
||
defined
(
Q_QDOC
)
65
struct
Q_GUI_EXPORT
QCocoaWindow
66
{
67
QT_DECLARE_NATIVE_INTERFACE
(
QCocoaWindow
, 2,
QWindow
)
68
virtual
void
setContentBorderEnabled
(
bool
enable
) = 0;
69
virtual
QPoint
bottomLeftClippedByNSWindowOffset
()
const
= 0;
70
virtual
CALayer
*
contentLayer
()
const
= 0;
71
virtual
void
manageVisualEffectArea
(
quintptr
identifier
,
const
QRect
&
rect
,
72
NSVisualEffectMaterial
material
,
NSVisualEffectBlendingMode
blendMode
,
73
NSVisualEffectState
activationState
) = 0;
74
};
75
#
endif
76
77
#
if
QT_CONFIG
(
xcb
)
||
defined
(
Q_QDOC
)
78
struct
Q_GUI_EXPORT
QXcbWindow
79
{
80
QT_DECLARE_NATIVE_INTERFACE
(
QXcbWindow
, 1,
QWindow
)
81
82
enum
WindowType
{
83
None
= 0x000000,
84
Normal
= 0x000001,
85
Desktop
= 0x000002,
86
Dock
= 0x000004,
87
Toolbar
= 0x000008,
88
Menu
= 0x000010,
89
Utility
= 0x000020,
90
Splash
= 0x000040,
91
Dialog
= 0x000080,
92
DropDownMenu
= 0x000100,
93
PopupMenu
= 0x000200,
94
Tooltip
= 0x000400,
95
Notification
= 0x000800,
96
Combo
= 0x001000,
97
Dnd
= 0x002000,
98
KdeOverride
= 0x004000
99
};
100
Q_DECLARE_FLAGS
(
WindowTypes
,
WindowType
)
101
102
virtual
void
setWindowType
(
WindowTypes
type
) = 0;
103
virtual
void
setWindowRole
(
const
QString
&
role
) = 0;
104
virtual
void
setWindowIconText
(
const
QString
&
text
) = 0;
105
virtual
uint
visualId
()
const
= 0;
106
};
107
#
endif
// xcb
108
109
#
if
defined
(
Q_OS_WIN
)
||
defined
(
Q_QDOC
)
110
struct
Q_GUI_EXPORT
QWindowsWindow
111
{
112
QT_DECLARE_NATIVE_INTERFACE
(
QWindowsWindow
, 1,
QWindow
)
113
114
virtual
void
setHasBorderInFullScreen
(
bool
border
) = 0;
115
virtual
bool
hasBorderInFullScreen
()
const
= 0;
116
117
virtual
QMargins
customMargins
()
const
= 0;
118
virtual
void
setCustomMargins
(
const
QMargins
&
margins
) = 0;
119
};
120
#
endif
// Q_OS_WIN
121
122
#
if
QT_CONFIG
(
wayland
)
123
struct
Q_GUI_EXPORT
QWaylandWindow
:
public
QObject
124
{
125
Q_OBJECT
126
public
:
127
QT_DECLARE_NATIVE_INTERFACE
(
QWaylandWindow
, 1,
QWindow
)
128
129
enum
WindowType
{
130
Default
,
131
ToolTip
,
132
ComboBox
,
133
Menu
,
134
SubMenu
,
135
};
136
137
virtual
wl_surface
*
surface
()
const
= 0;
138
virtual
void
setCustomMargins
(
const
QMargins
&
margins
) = 0;
139
virtual
void
requestXdgActivationToken
(
uint
serial
) = 0;
140
template
<
typename
T
>
141
T
*
surfaceRole
()
const
142
{
143
std
::
any
anyRole
=
_surfaceRole
();
144
auto
role
=
std
::
any_cast
<
T
*>(&
anyRole
);
145
return
role
? *
role
:
nullptr
;
146
}
147
virtual
void
setSessionRestoreId
(
const
QString
&
role
) = 0;
148
149
virtual
void
setExtendedWindowType
(
WindowType
windowType
) = 0;
150
virtual
void
setParentControlGeometry
(
const
QRect
&
parentAnchor
) = 0;
151
152
Q_SIGNALS
:
153
void
surfaceCreated
();
154
void
surfaceDestroyed
();
155
void
surfaceRoleCreated
();
156
void
surfaceRoleDestroyed
();
157
void
xdgActivationTokenCreated
(
const
QString
&
token
);
158
159
protected
:
160
virtual
std
::
any
_surfaceRole
()
const
= 0;
161
};
162
#
endif
163
164
}
// QNativeInterface::Private
165
166
QT_END_NAMESPACE
167
168
#
endif
// QPLATFORMWINDOW_P_H
QMargins
\inmodule QtCore
Definition
qmargins.h:27
QPlatformWindowPrivate
Definition
qplatformwindow_p.h:45
QPlatformWindowPrivate::rect
QRect rect
Definition
qplatformwindow_p.h:47
QPlatformWindowPrivate::updateTimer
QBasicTimer updateTimer
Definition
qplatformwindow_p.h:48
QNativeInterface
Definition
qnativeinterface.h:51
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
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