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
qwaylandqtshell_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QWAYLANDQTSHELL_P_H
6#define QWAYLANDQTSHELL_P_H
7
8#include <QtWaylandCompositor/private/qwaylandshellsurface_p.h>
9#include <QtWaylandCompositor/QWaylandSurfaceRole>
10
11#include <QHash>
12
13#include "qwayland-server-qt-shell-unstable-v1.h"
15
16//
17// W A R N I N G
18// -------------
19//
20// This file is not part of the Qt API. It exists purely as an
21// implementation detail. This header file may change from version to
22// version without notice, or even be removed.
23//
24// We mean it.
25//
26
28
29class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandQtShellPrivate
30 : public QWaylandCompositorExtensionPrivate
31 , public QtWaylandServer::zqt_shell_v1
32{
33 Q_DECLARE_PUBLIC(QWaylandQtShell)
34
35public:
36 QWaylandQtShellPrivate();
37 static QWaylandQtShellPrivate *get(QWaylandQtShell *qtShell) { return qtShell->d_func(); }
38 void unregisterQtShellSurface(QWaylandQtShellSurface *qtShellSurface);
39
40 QList<QWaylandQtShellChrome *> m_chromes;
41
42protected:
43 void zqt_shell_v1_surface_create(Resource *resource, wl_resource *surface, uint32_t id) override;
44};
45
46class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandQtShellSurfacePrivate
47 : public QWaylandShellSurfacePrivate
48 , public QtWaylandServer::zqt_shell_surface_v1
49{
50 Q_DECLARE_PUBLIC(QWaylandQtShellSurface)
51
52public:
53 QWaylandQtShellSurfacePrivate();
54 static QWaylandQtShellSurfacePrivate *get(QWaylandQtShellSurface *qtShellSurface)
55 {
56 return qtShellSurface->d_func();
57 }
58
59 void updateFrameMargins();
60 void configure(uint windowState, const QRect &newGeometry);
61
62protected:
63 void zqt_shell_surface_v1_destroy_resource(Resource *resource) override;
64 void zqt_shell_surface_v1_destroy(Resource *resource) override;
65 void zqt_shell_surface_v1_reposition(Resource *resource, int32_t x, int32_t y) override;
66 void zqt_shell_surface_v1_set_size(Resource *resource, int32_t width, int32_t height) override;
67 void zqt_shell_surface_v1_set_minimum_size(Resource *resource, int32_t width, int32_t height) override;
68 void zqt_shell_surface_v1_set_maximum_size(Resource *resource, int32_t width, int32_t height) override;
69 void zqt_shell_surface_v1_set_window_title(Resource *resource, const QString &title) override;
70 void zqt_shell_surface_v1_set_window_flags(Resource *resource, uint32_t flags) override;
71 void zqt_shell_surface_v1_change_window_state(Resource *resource, uint32_t state) override;
72 void zqt_shell_surface_v1_ack_configure(Resource *resource, uint32_t serial) override;
73
74 void zqt_shell_surface_v1_start_system_resize(Resource *resource, uint32_t serial, uint32_t edge) override;
75 void zqt_shell_surface_v1_start_system_move(Resource *resource, uint32_t serial) override;
76
77 void zqt_shell_surface_v1_raise(Resource *resource) override;
78 void zqt_shell_surface_v1_lower(Resource *resource) override;
79
80 void zqt_shell_surface_v1_request_activate(Resource *resource) override;
81
82private:
83 QWaylandQtShell *m_qtShell = nullptr;
84 QWaylandSurface *m_surface = nullptr;
85 QRect m_windowGeometry;
86 QSize m_minimumSize;
87 QSize m_maximumSize;
88 uint m_windowFlags = 0;
89 uint m_windowState = 0;
90 QString m_windowTitle;
91 QMargins m_frameMargins;
92 bool m_positionSet = false;
93 bool m_active = false;
94
95 QPoint m_pendingPosition;
96 bool m_pendingPositionValid = false;
97 QSize m_pendingSize;
98
99 uint32_t m_lastAckedConfigure = UINT32_MAX;
100 QMap<uint32_t, std::pair<uint, QRect> > m_pendingConfigures;
101
102 QWaylandQtShellSurface::CapabilityFlags m_capabilities;
103
104 static QWaylandSurfaceRole s_role;
105};
106
107QT_END_NAMESPACE
108
109#endif // QWAYLANDQTSHELL_P_H
\inmodule QtWaylandCompositor
Combined button and popup list for selecting options.