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
qwaylandwlshell_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:critical reason:network-protocol
4
5#ifndef QWAYLANDWLSHELL_P_H
6#define QWAYLANDWLSHELL_P_H
7
8#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
9#include <QtWaylandCompositor/qwaylandsurface.h>
10#include <QtWaylandCompositor/private/qwaylandshellsurface_p.h>
11#include <QtWaylandCompositor/private/qwaylandshell_p.h>
12#include <QtWaylandCompositor/QWaylandWlShellSurface>
13#include <QtWaylandCompositor/QWaylandSeat>
14
15#include <wayland-server-core.h>
16#include <QHash>
17#include <QPoint>
18#include <QSet>
19
20#include <QtWaylandCompositor/private/qwayland-server-wayland.h>
21
22#include <QtCore/qpointer.h>
23
24//
25// W A R N I N G
26// -------------
27//
28// This file is not part of the Qt API. It exists purely as an
29// implementation detail. This header file may change from version to
30// version without notice, or even be removed.
31//
32// We mean it.
33//
34
36
38 : public QWaylandShellPrivate
39 , public QtWaylandServer::wl_shell
40{
41 Q_DECLARE_PUBLIC(QWaylandWlShell)
42public:
43 QWaylandWlShellPrivate();
44
45 void unregisterShellSurface(QWaylandWlShellSurface *shellSurface);
46
47 static QWaylandWlShellPrivate *get(QWaylandWlShell *shell) { return shell->d_func(); }
48
49protected:
50 void shell_get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface) override;
51
52 QList<QWaylandWlShellSurface *> m_shellSurfaces;
53};
54
55class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandWlShellSurfacePrivate
56 : public QWaylandShellSurfacePrivate
57 , public QtWaylandServer::wl_shell_surface
58{
59 Q_DECLARE_PUBLIC(QWaylandWlShellSurface)
60public:
61 QWaylandWlShellSurfacePrivate();
62 ~QWaylandWlShellSurfacePrivate() override;
63
64 static QWaylandWlShellSurfacePrivate *get(QWaylandWlShellSurface *surface) { return surface->d_func(); }
65
66 void ping(uint32_t serial);
67
68 void setWindowType(Qt::WindowType windowType);
69
70private:
71 QWaylandWlShell *m_shell = nullptr;
72 QPointer<QWaylandSurface> m_surface;
73
74 QSet<uint32_t> m_pings;
75
76 QString m_title;
77 QString m_className;
78 Qt::WindowType m_windowType = Qt::WindowType::Window;
79
80 void shell_surface_destroy_resource(Resource *resource) override;
81
82 void shell_surface_move(Resource *resource,
83 struct wl_resource *input_device_super,
84 uint32_t time) override;
85 void shell_surface_resize(Resource *resource,
86 struct wl_resource *input_device,
87 uint32_t time,
88 uint32_t edges) override;
89 void shell_surface_set_toplevel(Resource *resource) override;
90 void shell_surface_set_transient(Resource *resource,
91 struct wl_resource *parent_surface_resource,
92 int x,
93 int y,
94 uint32_t flags) override;
95 void shell_surface_set_fullscreen(Resource *resource,
96 uint32_t method,
97 uint32_t framerate,
98 struct wl_resource *output_resource) override;
99 void shell_surface_set_popup(Resource *resource,
100 struct wl_resource *input_device,
101 uint32_t time,
102 struct wl_resource *parent,
103 int32_t x,
104 int32_t y,
105 uint32_t flags) override;
106 void shell_surface_set_maximized(Resource *resource,
107 struct wl_resource *output_resource) override;
108 void shell_surface_pong(Resource *resource,
109 uint32_t serial) override;
110 void shell_surface_set_title(Resource *resource,
111 const QString &title) override;
112 void shell_surface_set_class(Resource *resource,
113 const QString &class_) override;
114
115 static QWaylandSurfaceRole s_role;
116};
117
118QT_END_NAMESPACE
119
120#endif // QWAYLANDWLSHELL_P_H
\inmodule QtWaylandCompositor
\qmltype WlShellSurface \nativetype QWaylandWlShellSurface \inqmlmodule QtWayland....
\qmltype WlShell \nativetype QWaylandWlShell \inqmlmodule QtWayland.Compositor.WlShell
Combined button and popup list for selecting options.