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
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
31QT_BEGIN_NAMESPACE
32
33namespace QtWaylandClient {
34
35class QWaylandDisplay;
36class QWaylandInputDevice;
37class QWaylandXdgShell;
39class QWaylandShmBuffer;
44
45class Q_WAYLANDCLIENT_EXPORT QWaylandXdgSurface : public QWaylandShellSurface, public QtWayland::xdg_surface
46{
48public:
51
55 void setTitle(const QString &title) override;
56 void setAppId(const QString &appId) override;
58
59 bool isExposed() const override;
60 bool handleExpose(const QRegion &) override;
61 bool handlesActiveState() const { return m_toplevel; }
63 bool wantsDecorations() const override;
71 bool isAlertState() const override { return m_alertState; }
74 void setIcon(const QIcon &icon) override;
75
76 void setSizeHints();
77
79
80 std::any surfaceRole() const override;
81
82protected:
85
86private:
87 class Toplevel: public QtWayland::xdg_toplevel
88 {
89 public:
92
93 void applyConfigure();
94 bool wantsDecorations();
95
99
102
104
105 struct {
106 QSize bounds = {0, 0};
107 QSize size = {0, 0};
109 bool suspended = false;
113
118 };
119
120 class Positioner : public QtWayland::xdg_positioner {
121 public:
124 };
125
126 class Popup : public QtWayland::xdg_popup {
127 public:
129 ~Popup() override;
130
131 void applyConfigure();
132 void resetConfiguration();
133
138
141 QWaylandWindow *m_parent = nullptr;
142 bool m_grabbing = false;
143
145 bool m_waitingForReposition = false;
147 };
148
149 void setToplevel();
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;
163 bool m_alertState = false;
164
165 friend class QWaylandXdgShell;
166};
167
195
197
198}
199
200#endif // QWAYLANDXDGSHELL_H