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
4#ifndef QWAYLANDSHELLSURFACE_H
5#define QWAYLANDSHELLSURFACE_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtCore/QSize>
19#include <QObject>
20#include <QPoint>
21#include <QtWaylandClient/qtwaylandclientglobal.h>
22#include <QtCore/private/qglobal_p.h>
23
24#include <any>
25
26struct wl_surface;
27
28QT_BEGIN_NAMESPACE
29
30class QVariant;
31class QWindow;
32class QPlatformWindow;
33
34namespace QtWaylandClient {
35
36class QWaylandWindow;
37class QWaylandInputDevice;
38
39class Q_WAYLANDCLIENT_EXPORT QWaylandShellSurface : public QObject
40{
42public:
45 virtual bool resize(QWaylandInputDevice *, Qt::Edges) { return false; }
46 virtual bool move(QWaylandInputDevice *) { return false; }
47 virtual bool showWindowMenu(QWaylandInputDevice *seat) { Q_UNUSED(seat); return false; }
48 virtual void setTitle(const QString & /*title*/) {}
49 virtual void setAppId(const QString & /*appId*/) {}
50
51 virtual void setWindowFlags(Qt::WindowFlags flags);
52
53 virtual bool isExposed() const { return true; }
54
55 virtual void raise() {}
56 virtual void lower() {}
58 virtual void setContentGeometry(const QRect &rect) { Q_UNUSED(rect); }
59
60 virtual void sendProperty(const QString &name, const QVariant &value);
61
62 virtual void applyConfigure() {}
64 virtual bool wantsDecorations() const { return false; }
65 virtual QMargins serverSideFrameMargins() const { return QMargins(); }
66
67 virtual void propagateSizeHints() {}
68
69 virtual void setWindowGeometry(const QRect &rect);
71 virtual void setWindowSize(const QSize &size) { Q_UNUSED(size); }
72
73 virtual bool requestActivate() { return false; }
74 virtual bool requestActivateOnShow() { return false; }
75 virtual void setXdgActivationToken(const QString &token);
77
78 virtual void setAlertState(bool enabled) { Q_UNUSED(enabled); }
79 virtual bool isAlertState() const { return false; }
80
81 virtual QString externWindowHandle() { return QString(); }
82
83 inline QWaylandWindow *window() { return m_window; }
85 struct wl_surface *wlSurface();
86
87 virtual std::any surfaceRole() const { return std::any(); };
88
91
92 virtual void setIcon(const QIcon &icon) { Q_UNUSED(icon); }
93
94 virtual bool commitSurfaceRole() const;
95
96protected:
97 void resizeFromApplyConfigure(const QSize &sizeWithMargins, const QPoint &offset = {0, 0});
102
104
105private:
106 QWaylandWindow *m_window = nullptr;
107 friend class QWaylandWindow;
108};
109
110}
111
112QT_END_NAMESPACE
113
114#endif // QWAYLANDSHELLSURFACE_H
friend class QPainter
static QRegion marginsRegion(const QSize &size, const QMargins &margins)