Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwaylandqtwindowmanager.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// Copyright (C) 2017 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4
5#include <QtCore/QObject>
6#include <QtCore/QUrl>
7
8#include <QtWaylandCompositor/QWaylandCompositor>
9#include <QtWaylandCompositor/QWaylandClient>
10
13
15
19
21{
22 send_hints(resource->handle, static_cast<int32_t>(showIsFullScreen));
23}
24
26{
27 urls.remove(resource);
28}
29
30void QWaylandQtWindowManagerPrivate::windowmanager_open_url(Resource *resource, uint32_t remaining, const QString &newUrl)
31{
33
34 QWaylandCompositor *compositor = static_cast<QWaylandCompositor *>(q->extensionContainer());
35 if (!compositor) {
36 qWarning() << "Failed to find QWaylandCompositor from QWaylandQtWindowManager::windowmanager_open_url()";
37 return;
38 }
39
40 QString url = urls.value(resource, QString());
41
42 url.append(newUrl);
43
44 if (remaining)
45 urls.insert(resource, url);
46 else {
47 urls.remove(resource);
48 q->openUrl(QWaylandClient::fromWlClient(compositor, resource->client()), QUrl(url));
49 }
50}
51
56
61
63{
64 Q_D(const QWaylandQtWindowManager);
65 return d->showIsFullScreen;
66}
67
69{
71
72 if (d->showIsFullScreen == value)
73 return;
74
75 d->showIsFullScreen = value;
76 const auto resMap = d->resourceMap();
77 for (QWaylandQtWindowManagerPrivate::Resource *resource : resMap) {
78 d->send_hints(resource->handle, static_cast<int32_t>(d->showIsFullScreen));
79 }
81}
82
84{
86 QWaylandQtWindowManagerPrivate::Resource *resource = d->resourceMap().value(client->client());
87
88 if (resource)
89 d->send_quit(resource->handle);
90}
91
93{
95
98 if (!compositor) {
99 qWarning() << "Failed to find QWaylandCompositor when initializing QWaylandQtWindowManager";
100 return;
101 }
102 d->init(compositor->display(), 1);
103}
104
105const struct wl_interface *QWaylandQtWindowManager::interface()
106{
107 return QWaylandQtWindowManagerPrivate::interface();
108}
109
111{
112 return QWaylandQtWindowManagerPrivate::interfaceName();
113}
114
116
117#include "moc_qwaylandqtwindowmanager.cpp"
\inmodule QtCore
Definition qbytearray.h:57
iterator insert(const Key &key, const T &value)
Definition qmap.h:688
T value(const Key &key, const T &defaultValue=T()) const
Definition qmap.h:357
size_type remove(const Key &key)
Definition qmap.h:300
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
\qmltype WaylandClient \instantiates QWaylandClient \inqmlmodule QtWayland.Compositor
static QWaylandClient * fromWlClient(QWaylandCompositor *compositor, wl_client *wlClient)
Returns the QWaylandClient corresponding to the Wayland client wlClient and compositor.
wl_client * client() const
Returns the Wayland client of this QWaylandClient.
virtual void initialize()
Initializes the QWaylandCompositorExtension.
\qmltype WaylandCompositor \instantiates QWaylandCompositor \inqmlmodule QtWayland....
void windowmanager_destroy_resource(Resource *resource) override
void windowmanager_bind_resource(Resource *resource) override
void windowmanager_open_url(Resource *resource, uint32_t remaining, const QString &url) override
void sendQuitMessage(QWaylandClient *client)
void initialize() override
Initializes the QWaylandCompositorExtension.
static const struct wl_interface * interface()
Combined button and popup list for selecting options.
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define qWarning
Definition qlogging.h:166
static QOpenGLCompositor * compositor
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
#define Q_EMIT
QUrl url("example.com")
[constructor-url-reference]