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
qwaylandshellsurface_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 LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QWAYLANDSHELLSURFACE_H
6#define QWAYLANDSHELLSURFACE_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 <QtCore/QSize>
20#include <QObject>
21#include <QPoint>
22#include <QtWaylandClient/qtwaylandclientglobal.h>
23#include <QtCore/private/qglobal_p.h>
24
25#include <any>
26
27struct wl_surface;
28
29QT_BEGIN_NAMESPACE
30
31class QVariant;
32class QWindow;
33class QPlatformWindow;
34
35namespace QtWaylandClient {
36
37class QWaylandWindow;
38class QWaylandInputDevice;
39
40class Q_WAYLANDCLIENT_EXPORT QWaylandShellSurface : public QObject
41{
43public:
46 virtual bool resize(QWaylandInputDevice *, Qt::Edges) { return false; }
47 virtual bool move(QWaylandInputDevice *) { return false; }
48 virtual bool showWindowMenu(QWaylandInputDevice *seat) { Q_UNUSED(seat); return false; }
49 virtual void setTitle(const QString & /*title*/) {}
50 virtual void setAppId(const QString & /*appId*/) {}
51
52 virtual void setWindowFlags(Qt::WindowFlags flags);
53
54 virtual bool isExposed() const { return true; }
55
56 virtual void raise() {}
57 virtual void lower() {}
59 virtual void setContentGeometry(const QRect &rect) { Q_UNUSED(rect); }
60
61 virtual void sendProperty(const QString &name, const QVariant &value);
62
63 virtual void applyConfigure() {}
65 virtual bool wantsDecorations() const { return false; }
66 virtual QMargins serverSideFrameMargins() const { return QMargins(); }
67
68 virtual void propagateSizeHints() {}
69
70 virtual void setWindowGeometry(const QRect &rect);
72 virtual void setWindowSize(const QSize &size) { Q_UNUSED(size); }
73
74 virtual bool requestActivate() { return false; }
75 virtual bool requestActivateOnShow() { return false; }
76 virtual void setXdgActivationToken(const QString &token);
78
79 virtual void setAlertState(bool enabled) { Q_UNUSED(enabled); }
80 virtual bool isAlertState() const { return false; }
81
82 virtual QString externWindowHandle() { return QString(); }
83
84 inline QWaylandWindow *window() { return m_window; }
86 struct wl_surface *wlSurface();
87
88 virtual std::any surfaceRole() const { return std::any(); };
89
92
93 virtual void setIcon(const QIcon &icon) { Q_UNUSED(icon); }
94
95 virtual bool commitSurfaceRole() const;
96
97protected:
98 void resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset = {0, 0});
103
105
106private:
107 QWaylandWindow *m_window = nullptr;
108 friend class QWaylandWindow;
109};
110
111}
112
113QT_END_NAMESPACE
114
115#endif // QWAYLANDSHELLSURFACE_H
friend class QPainter
Combined button and popup list for selecting options.
static QRegion marginsRegion(const QSize &size, const QMargins &margins)