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.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:significant reason:default
4
5#ifndef QWAYLANDWLSHELL_H
6#define QWAYLANDWLSHELL_H
7
8#include <QtWaylandCompositor/QWaylandCompositorExtension>
9#include <QtWaylandCompositor/QWaylandResource>
10#include <QtWaylandCompositor/QWaylandShell>
11#include <QtWaylandCompositor/QWaylandShellSurface>
12#if QT_CONFIG(wayland_compositor_quick)
13#include <QtWaylandCompositor/qwaylandquickchildren.h>
14#endif
15
16#include <QtCore/QSize>
17
18QT_BEGIN_NAMESPACE
19
20class QWaylandWlShellPrivate;
21class QWaylandWlShellSurfacePrivate;
22class QWaylandSurface;
23class QWaylandClient;
24class QWaylandSeat;
25class QWaylandOutput;
27class QWaylandWlShellSurface;
28
29class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandWlShell : public QWaylandShellTemplate<QWaylandWlShell>
30{
31 Q_OBJECT
32 Q_DECLARE_PRIVATE(QWaylandWlShell)
33public:
34 QWaylandWlShell();
35 QWaylandWlShell(QWaylandCompositor *compositor);
36
37 void initialize() override;
38 QList<QWaylandWlShellSurface *> shellSurfaces() const;
39 QList<QWaylandWlShellSurface *> shellSurfacesForClient(QWaylandClient* client) const;
40 QList<QWaylandWlShellSurface *> mappedPopups() const;
41 QWaylandClient *popupClient() const;
42
43 static const struct wl_interface *interface();
44 static QByteArray interfaceName();
45
46public Q_SLOTS:
47 void closeAllPopups();
48
49Q_SIGNALS:
50 void wlShellSurfaceRequested(QWaylandSurface *surface, const QWaylandResource &resource);
51 void wlShellSurfaceCreated(QWaylandWlShellSurface *shellSurface);
52};
53
54class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandWlShellSurface : public QWaylandShellSurfaceTemplate<QWaylandWlShellSurface>
55{
56 Q_OBJECT
57 Q_DECLARE_PRIVATE(QWaylandWlShellSurface)
58#if QT_CONFIG(wayland_compositor_quick)
59 Q_WAYLAND_COMPOSITOR_DECLARE_QUICK_CHILDREN(QWaylandWlShellSurface)
60#endif
61 Q_PROPERTY(QWaylandSurface *surface READ surface NOTIFY surfaceChanged)
62 Q_PROPERTY(QWaylandWlShell *shell READ shell NOTIFY shellChanged)
63 Q_PROPERTY(QString title READ title NOTIFY titleChanged)
64 Q_PROPERTY(QString className READ className NOTIFY classNameChanged)
65 Q_MOC_INCLUDE("qwaylandsurface.h")
66
67public:
68 enum FullScreenMethod {
69 DefaultFullScreen,
70 ScaleFullScreen,
71 DriverFullScreen,
72 FillFullScreen
73 };
74 Q_ENUM(FullScreenMethod);
75
76 enum ResizeEdge {
77 NoneEdge = 0,
78 TopEdge = 1,
79 BottomEdge = 2,
80 LeftEdge = 4,
81 TopLeftEdge = 5,
82 BottomLeftEdge = 6,
83 RightEdge = 8,
84 TopRightEdge = 9,
85 BottomRightEdge = 10
86 };
87 Q_ENUM(ResizeEdge);
88
89 QWaylandWlShellSurface();
90 QWaylandWlShellSurface(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &resource);
91 ~QWaylandWlShellSurface() override;
92
93 Q_INVOKABLE void initialize(QWaylandWlShell *shell, QWaylandSurface *surface, const QWaylandResource &resource);
94
95 QString title() const;
96 QString className() const;
97
98 QWaylandSurface *surface() const;
99 QWaylandWlShell *shell() const;
100
101 Qt::WindowType windowType() const override;
102
103 static const struct wl_interface *interface();
104 static QByteArray interfaceName();
105 static QWaylandSurfaceRole *role();
106
107 static QWaylandWlShellSurface *fromResource(wl_resource *res);
108
109 Q_INVOKABLE QSize sizeForResize(const QSizeF &size, const QPointF &delta, ResizeEdge edges);
110 Q_INVOKABLE void sendConfigure(const QSize &size, ResizeEdge edges);
111 Q_INVOKABLE void sendPopupDone();
112
113#if QT_CONFIG(wayland_compositor_quick)
114 QWaylandQuickShellIntegration *createIntegration(QWaylandQuickShellSurfaceItem *item) override;
115#endif
116
117public Q_SLOTS:
118 void ping();
119
120Q_SIGNALS:
121 void surfaceChanged();
122 void shellChanged();
123 void titleChanged();
124 void classNameChanged();
125 void pong();
126 void startMove(QWaylandSeat *seat);
127 void startResize(QWaylandSeat *seat, ResizeEdge edges);
128
129 void setDefaultToplevel();
130 void setTransient(QWaylandSurface *parentSurface, const QPoint &relativeToParent, bool inactive);
131 void setFullScreen(FullScreenMethod method, uint framerate, QWaylandOutput *output);
132 void setPopup(QWaylandSeat *seat, QWaylandSurface *parentSurface, const QPoint &relativeToParent);
133 void setMaximized(QWaylandOutput *output);
134
135private:
136 void initialize() override;
137};
138
139QT_END_NAMESPACE
140
141#endif /*QWAYLANDWLSHELL_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.