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
4
#
ifndef
QPLATFORMWINDOW_P_H
5
#
define
QPLATFORMWINDOW_P_H
6
7
//
8
// W A R N I N G
9
// -------------
10
//
11
// This file is not part of the Qt API. It exists purely as an
12
// implementation detail. This header file may change from version to
13
// version without notice, or even be removed.
14
//
15
// We mean it.
16
//
17
18
#
include
<
QtGui
/
private
/
qtguiglobal_p
.
h
>
19
#
include
<
QtCore
/
qbasictimer
.
h
>
20
#
include
<
QtCore
/
qrect
.
h
>
21
#
include
<
QtCore
/
qnativeinterface
.
h
>
22
#
include
<
QtGui
/
qwindow
.
h
>
23
24
#
if
QT_CONFIG
(
wayland
)
25
#
include
<
any
>
26
#
include
<
QtCore
/
qobject
.
h
>
27
28
struct
wl_surface
;
29
#
endif
30
31
#
if
defined
(
Q_OS_MACOS
)
32
Q_FORWARD_DECLARE_OBJC_CLASS
(
CALayer
);
33
typedef
long
NSInteger
;
34
enum
NSVisualEffectMaterial
:
NSInteger
;
35
enum
NSVisualEffectBlendingMode
:
NSInteger
;
36
enum
NSVisualEffectState
:
NSInteger
;
37
#
endif
38
39
QT_BEGIN_NAMESPACE
40
41
class
QMargins
;
42
43
class
QPlatformWindowPrivate
44
{
45
public
:
46
QRect
rect
;
47
QBasicTimer
updateTimer
;
48
};
49
50
// ----------------- QNativeInterface -----------------
51
52
namespace
QNativeInterface::
Private
{
53
54
#
if
defined
(
Q_OS_WASM
)
||
defined
(
Q_QDOC
)
55
struct
Q_GUI_EXPORT
QWasmWindow
56
{
57
QT_DECLARE_NATIVE_INTERFACE
(
QWasmWindow
, 1,
QWindow
)
58
virtual
emscripten
::
val
document
()
const
= 0;
59
virtual
emscripten
::
val
clientArea
()
const
= 0;
60
};
61
#
endif
62
63
#
if
defined
(
Q_OS_MACOS
)
||
defined
(
Q_QDOC
)
64
struct
Q_GUI_EXPORT
QCocoaWindow
65
{
66
QT_DECLARE_NATIVE_INTERFACE
(
QCocoaWindow
, 2,
QWindow
)
67
virtual
void
setContentBorderEnabled
(
bool
enable
) = 0;
68
virtual
QPoint
bottomLeftClippedByNSWindowOffset
()
const
= 0;
69
virtual
CALayer
*
contentLayer
()
const
= 0;
70
virtual
void
manageVisualEffectArea
(
quintptr
identifier
,
const
QRect
&
rect
,
71
NSVisualEffectMaterial
material
,
NSVisualEffectBlendingMode
blendMode
,
72
NSVisualEffectState
activationState
) = 0;
73
};
74
#
endif
75
76
#
if
QT_CONFIG
(
xcb
)
||
defined
(
Q_QDOC
)
77
struct
Q_GUI_EXPORT
QXcbWindow
78
{
79
QT_DECLARE_NATIVE_INTERFACE
(
QXcbWindow
, 1,
QWindow
)
80
81
enum
WindowType
{
82
None
= 0x000000,
83
Normal
= 0x000001,
84
Desktop
= 0x000002,
85
Dock
= 0x000004,
86
Toolbar
= 0x000008,
87
Menu
= 0x000010,
88
Utility
= 0x000020,
89
Splash
= 0x000040,
90
Dialog
= 0x000080,
91
DropDownMenu
= 0x000100,
92
PopupMenu
= 0x000200,
93
Tooltip
= 0x000400,
94
Notification
= 0x000800,
95
Combo
= 0x001000,
96
Dnd
= 0x002000,
97
KdeOverride
= 0x004000
98
};
99
Q_DECLARE_FLAGS
(
WindowTypes
,
WindowType
)
100
101
virtual
void
setWindowType
(
WindowTypes
type
) = 0;
102
virtual
void
setWindowRole
(
const
QString
&
role
) = 0;
103
virtual
void
setWindowIconText
(
const
QString
&
text
) = 0;
104
virtual
uint
visualId
()
const
= 0;
105
};
106
#
endif
// xcb
107
108
#
if
defined
(
Q_OS_WIN
)
||
defined
(
Q_QDOC
)
109
struct
Q_GUI_EXPORT
QWindowsWindow
110
{
111
QT_DECLARE_NATIVE_INTERFACE
(
QWindowsWindow
, 1,
QWindow
)
112
113
virtual
void
setHasBorderInFullScreen
(
bool
border
) = 0;
114
virtual
bool
hasBorderInFullScreen
()
const
= 0;
115
116
virtual
QMargins
customMargins
()
const
= 0;
117
virtual
void
setCustomMargins
(
const
QMargins
&
margins
) = 0;
118
};
119
#
endif
// Q_OS_WIN
120
121
#
if
QT_CONFIG
(
wayland
)
122
struct
Q_GUI_EXPORT
QWaylandWindow
:
public
QObject
123
{
124
Q_OBJECT
125
public
:
126
QT_DECLARE_NATIVE_INTERFACE
(
QWaylandWindow
, 1,
QWindow
)
127
128
virtual
wl_surface
*
surface
()
const
= 0;
129
virtual
void
setCustomMargins
(
const
QMargins
&
margins
) = 0;
130
virtual
void
requestXdgActivationToken
(
uint
serial
) = 0;
131
template
<
typename
T
>
132
T
*
surfaceRole
()
const
133
{
134
std
::
any
anyRole
=
_surfaceRole
();
135
auto
role
=
std
::
any_cast
<
T
*>(&
anyRole
);
136
return
role
? *
role
:
nullptr
;
137
}
138
virtual
void
setSessionRestoreId
(
const
QString
&
role
) = 0;
139
Q_SIGNALS
:
140
void
surfaceCreated
();
141
void
surfaceDestroyed
();
142
void
surfaceRoleCreated
();
143
void
surfaceRoleDestroyed
();
144
void
xdgActivationTokenCreated
(
const
QString
&
token
);
145
146
protected
:
147
virtual
std
::
any
_surfaceRole
()
const
= 0;
148
};
149
#
endif
150
151
}
// QNativeInterface::Private
152
153
QT_END_NAMESPACE
154
155
#
endif
// QPLATFORMWINDOW_P_H
QMargins
\inmodule QtCore
Definition
qmargins.h:26
QPlatformWindowPrivate
Definition
qplatformwindow_p.h:44
QPlatformWindowPrivate::rect
QRect rect
Definition
qplatformwindow_p.h:46
QPlatformWindowPrivate::updateTimer
QBasicTimer updateTimer
Definition
qplatformwindow_p.h:47
QNativeInterface
Definition
qnativeinterface.h:50
QPlatformGraphicsBufferHelper
\inmodule QtGui
fixInitialSize
static QSize fixInitialSize(QSize size, const QWindow *w, int deviceIndependentDefaultWidth, int deviceIndependentDefaultHeight)
Definition
qplatformwindow.cpp:669
effectiveScreen
static const QScreen * effectiveScreen(const QWindow *window)
Definition
qplatformwindow.cpp:633
QWINDOWSIZE_MAX
#define QWINDOWSIZE_MAX
Definition
qplatformwindow.h:27
qtbase
src
gui
kernel
qplatformwindow_p.h
Generated on
for Qt by
1.14.0