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
qwaylandxdgshell_p.h
Go to the documentation of this file.
1
// Copyright (C) 2017 The Qt Company Ltd.
2
// Copyright (C) 2017 Eurogiciel, author: <philippe.coval@eurogiciel.fr>
3
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5
#
ifndef
QWAYLANDXDGSHELL_H
6
#
define
QWAYLANDXDGSHELL_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
"qwayland-xdg-shell.h"
20
21
#
include
"qwaylandxdgdecorationv1_p.h"
22
#
include
"qwaylandxdgactivationv1_p.h"
23
24
#
include
<
QtWaylandClient
/
qtwaylandclientglobal
.
h
>
25
#
include
<
QtWaylandClient
/
private
/
qwaylandshellsurface_p
.
h
>
26
#
include
<
QtWaylandClient
/
private
/
qwaylandwindow_p
.
h
>
27
28
#
include
<
QtCore
/
QSize
>
29
#
include
<
QtGui
/
QRegion
>
30
31
QT_BEGIN_NAMESPACE
32
33
namespace
QtWaylandClient
{
34
35
class
QWaylandDisplay;
36
class
QWaylandInputDevice;
37
class
QWaylandXdgShell;
38
class
QWaylandXdgExportedV2
;
39
class
QWaylandShmBuffer;
40
class
QWaylandXdgExporterV2
;
41
class
QWaylandXdgDialogWmV1
;
42
class
QWaylandXdgDialogV1
;
43
class
QWaylandXdgToplevelIconManagerV1
;
44
45
class
Q_WAYLANDCLIENT_EXPORT
QWaylandXdgSurface
:
public
QWaylandShellSurface
,
public
QtWayland
::
xdg_surface
46
{
47
Q_OBJECT
48
public
:
49
QWaylandXdgSurface
(
QWaylandXdgShell
*
shell
, ::
xdg_surface
*
surface
,
QWaylandWindow
*
window
);
50
~
QWaylandXdgSurface
()
override
;
51
52
bool
resize
(
QWaylandInputDevice
*
inputDevice
,
Qt
::
Edges
edges
)
override
;
53
bool
move
(
QWaylandInputDevice
*
inputDevice
)
override
;
54
bool
showWindowMenu
(
QWaylandInputDevice
*
seat
)
override
;
55
void
setTitle
(
const
QString
&
title
)
override
;
56
void
setAppId
(
const
QString
&
appId
)
override
;
57
void
setWindowFlags
(
Qt
::
WindowFlags
flags
)
override
;
58
59
bool
isExposed
()
const
override
;
60
bool
handleExpose
(
const
QRegion
&)
override
;
61
bool
handlesActiveState
()
const
{
return
m_toplevel
; }
62
void
applyConfigure
()
override
;
63
bool
wantsDecorations
()
const
override
;
64
void
propagateSizeHints
()
override
;
65
void
setContentGeometry
(
const
QRect
&
rect
)
override
;
66
bool
requestActivate
()
override
;
67
bool
requestActivateOnShow
()
override
;
68
void
setXdgActivationToken
(
const
QString
&
token
)
override
;
69
void
requestXdgActivationToken
(
quint32
serial
)
override
;
70
void
setAlertState
(
bool
enabled
)
override
;
71
bool
isAlertState
()
const
override
{
return
m_alertState
; }
72
QString
externWindowHandle
()
override
;
73
void
setWindowPosition
(
const
QPoint
&
position
)
override
;
74
void
setIcon
(
const
QIcon
&
icon
)
override
;
75
76
void
setSizeHints
();
77
78
void
*
nativeResource
(
const
QByteArray
&
resource
);
79
80
std
::
any
surfaceRole
()
const
override
;
81
82
protected
:
83
void
requestWindowStates
(
Qt
::
WindowStates
states
)
override
;
84
void
xdg_surface_configure
(
uint32_t
serial
)
override
;
85
86
private
:
87
class
Toplevel
:
public
QtWayland
::
xdg_toplevel
88
{
89
public
:
90
Toplevel
(
QWaylandXdgSurface
*
xdgSurface
);
91
~
Toplevel
()
override
;
92
93
void
applyConfigure
();
94
bool
wantsDecorations
();
95
96
void
xdg_toplevel_configure
(
int32_t
width
,
int32_t
height
,
wl_array
*
states
)
override
;
97
void
xdg_toplevel_close
()
override
;
98
void
xdg_toplevel_configure_bounds
(
int32_t
width
,
int32_t
height
)
override
;
99
100
void
requestWindowFlags
(
Qt
::
WindowFlags
flags
);
101
void
requestWindowStates
(
Qt
::
WindowStates
states
);
102
103
static
resize_edge
convertToResizeEdges
(
Qt
::
Edges
edges
);
104
105
struct
{
106
QSize
bounds
= {0, 0};
107
QSize
size
= {0, 0};
108
Qt
::
WindowStates
states
=
Qt
::
WindowNoState
;
109
bool
suspended
=
false
;
110
}
m_pending
,
m_applied
;
111
QWaylandWindow
::
ToplevelWindowTilingStates
m_toplevelStates
=
QWaylandWindow
::
WindowNoState
;
112
QSize
m_normalSize
;
113
114
QWaylandXdgSurface
*
m_xdgSurface
=
nullptr
;
115
QWaylandXdgToplevelDecorationV1
*
m_decoration
=
nullptr
;
116
QScopedPointer
<
QWaylandXdgExportedV2
>
m_exported
;
117
QScopedPointer
<
QWaylandXdgDialogV1
>
m_xdgDialog
;
118
};
119
120
class
Positioner
:
public
QtWayland
::
xdg_positioner
{
121
public
:
122
Positioner
(
QWaylandXdgShell
*
xdgShell
);
123
~
Positioner
()
override
;
124
};
125
126
class
Popup
:
public
QtWayland
::
xdg_popup
{
127
public
:
128
Popup
(
QWaylandXdgSurface
*
xdgSurface
,
QWaylandWindow
*
parent
,
Positioner
*
positioner
);
129
~
Popup
()
override
;
130
131
void
applyConfigure
();
132
void
resetConfiguration
();
133
134
void
grab
(
QWaylandInputDevice
*
seat
,
uint
serial
);
135
void
xdg_popup_configure
(
int32_t
x
,
int32_t
y
,
int32_t
width
,
int32_t
height
)
override
;
136
void
xdg_popup_popup_done
()
override
;
137
void
xdg_popup_repositioned
(
uint32_t
token
)
override
;
138
139
QWaylandXdgSurface
*
m_xdgSurface
=
nullptr
;
140
QWaylandXdgSurface
*
m_parentXdgSurface
=
nullptr
;
141
QWaylandWindow
*
m_parent
=
nullptr
;
142
bool
m_grabbing
=
false
;
143
144
QRect
m_pendingGeometry
;
145
bool
m_waitingForReposition
=
false
;
146
uint32_t
m_waitingForRepositionSerial
= 0;
147
};
148
149
void
setToplevel
();
150
void
setPopup
(
QWaylandWindow
*
parent
);
151
void
setGrabPopup
(
QWaylandWindow
*
parent
,
QWaylandInputDevice
*
device
,
int
serial
);
152
std
::
unique_ptr
<
Positioner
>
createPositioner
(
QWaylandWindow
*
parent
);
153
154
QWaylandXdgShell
*
m_shell
=
nullptr
;
155
QWaylandWindow
*
m_window
=
nullptr
;
156
Toplevel
*
m_toplevel
=
nullptr
;
157
Popup
*
m_popup
=
nullptr
;
158
bool
m_configured
=
false
;
159
uint
m_pendingConfigureSerial
= 0;
160
uint
m_appliedConfigureSerial
= 0;
161
QString
m_activationToken
;
162
QString
m_appId
;
163
bool
m_alertState
=
false
;
164
165
friend
class
QWaylandXdgShell
;
166
};
167
168
class
Q_WAYLANDCLIENT_EXPORT
QWaylandXdgShell
169
{
170
public
:
171
QWaylandXdgShell
(
QWaylandDisplay
*
display
,
QtWayland
::
xdg_wm_base
*
xdg_wm_base
);
172
~
QWaylandXdgShell
();
173
174
QWaylandDisplay
*
display
()
const
{
return
m_display
; }
175
176
QWaylandXdgDecorationManagerV1
*
decorationManager
() {
return
m_xdgDecorationManager
.
data
(); }
177
QWaylandXdgActivationV1
*
activation
()
const
{
return
m_xdgActivation
.
data
(); }
178
QWaylandXdgExporterV2
*
exporter
()
const
{
return
m_xdgExporter
.
data
(); }
179
QWaylandXdgSurface
*
getXdgSurface
(
QWaylandWindow
*
window
);
180
181
private
:
182
static
void
handleRegistryGlobal
(
void
*
data
, ::
wl_registry
*
registry
,
uint
id
,
183
const
QString
&
interface
,
uint
version
);
184
185
QWaylandDisplay
*
m_display
=
nullptr
;
186
QtWayland
::
xdg_wm_base
*
m_xdgWmBase
=
nullptr
;
187
QScopedPointer
<
QWaylandXdgDecorationManagerV1
>
m_xdgDecorationManager
;
188
QScopedPointer
<
QWaylandXdgActivationV1
>
m_xdgActivation
;
189
QScopedPointer
<
QWaylandXdgExporterV2
>
m_xdgExporter
;
190
QScopedPointer
<
QWaylandXdgDialogWmV1
>
m_xdgDialogWm
;
191
QScopedPointer
<
QWaylandXdgToplevelIconManagerV1
>
m_topLevelIconManager
;
192
193
friend
class
QWaylandXdgSurface
;
194
};
195
196
QT_END_NAMESPACE
197
198
}
199
200
#
endif
// QWAYLANDXDGSHELL_H
QtWaylandClient::QWaylandXdgDecorationManagerV1
Definition
qwaylandxdgdecorationv1_p.h:32
QtWaylandClient::QWaylandXdgDialogV1
Definition
qwaylandxdgdialogv1_p.h:14
QtWaylandClient::QWaylandXdgDialogWmV1
Definition
qwaylandxdgdialogv1_p.h:21
QtWaylandClient::QWaylandXdgExportedV2
Definition
qwaylandxdgexporterv2_p.h:27
QtWaylandClient::QWaylandXdgExporterV2
Definition
qwaylandxdgexporterv2_p.h:39
QtWaylandClient::QWaylandXdgShell
Definition
qwaylandxdgshell_p.h:169
QtWaylandClient::QWaylandXdgSurface
Definition
qwaylandxdgshell_p.h:46
QtWaylandClient::QWaylandXdgToplevelDecorationV1
Definition
qwaylandxdgdecorationv1_p.h:40
QtWaylandClient::QWaylandXdgToplevelIconManagerV1
Definition
qwaylandxdgtopleveliconv1_p.h:33
QtWaylandClient
Definition
qwaylandclientextension.h:15
qtwayland
src
plugins
shellintegration
xdg-shell
qwaylandxdgshell_p.h
Generated on Mon Mar 10 2025 00:55:07 for Qt by
1.13.2