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
qwaylandnativeinterface.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 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
15#include <QtCore/private/qnativeinterface_p.h>
16#include <QtGui/private/qguiapplication_p.h>
17#include <QtGui/QScreen>
18#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
19#if QT_CONFIG(vulkan)
20#include <QtWaylandClient/private/qwaylandvulkanwindow_p.h>
21#endif
22
24
25namespace QtWaylandClient {
26
31
33{
35
36 if (lowerCaseResource == "display" || lowerCaseResource == "wl_display" || lowerCaseResource == "nativedisplay")
37 return m_integration->display()->wl_display();
38 if (lowerCaseResource == "compositor") {
40 return compositor->object();
41 }
42 if (lowerCaseResource == "server_buffer_integration")
44
47
48 if (lowerCaseResource == "wl_seat")
50 if (lowerCaseResource == "wl_keyboard") {
52 if (keyboard)
53 return keyboard->wl_keyboard();
54 return nullptr;
55 }
56 if (lowerCaseResource == "wl_pointer") {
58 if (pointer)
59 return pointer->wl_pointer();
60 return nullptr;
61 }
62 if (lowerCaseResource == "wl_touch") {
64 if (touch)
65 return touch->wl_touch();
66 return nullptr;
67 }
68#if QT_CONFIG(xkbcommon)
69 if (lowerCaseResource == "xkb_context") {
70 return m_integration->display()->xkbContext();
71 }
72#endif
73 if (lowerCaseResource == "serial")
74 return reinterpret_cast<void *>(quintptr(m_integration->display()->defaultInputDevice()->serial()));
75
76 return nullptr;
77}
78
83
85{
87 return compositor->object();
88 return nullptr;
89}
90
92{
94 return inputDevice->wl_seat();
95 }
96 return nullptr;
97}
98
100{
102 if (auto keyboard = inputDevice->keyboard())
103 return keyboard->wl_keyboard();
104 return nullptr;
105}
106
108{
110 if (auto pointer = inputDevice->pointer())
111 return pointer->wl_pointer();
112 return nullptr;
113}
114
116{
118 if (auto touch = inputDevice->touch())
119 return touch->wl_touch();
120 return nullptr;
121}
122
127
129{
131 return inputDevice->wl_seat();
132 return nullptr;
133}
134
135#if QT_CONFIG(xkbcommon)
137{
138 return m_integration->display()->xkbContext();
139}
140#endif
141
143{
145
146 if (lowerCaseResource == "display")
147 return m_integration->display()->wl_display();
148 if (lowerCaseResource == "compositor") {
150 return compositor->object();
151 }
152 if (lowerCaseResource == "surface") {
153 QWaylandWindow *w = static_cast<QWaylandWindow*>(window->handle());
154 return w ? w->wlSurface() : nullptr;
155 }
156
159
160#if QT_CONFIG(vulkan)
161 if (lowerCaseResource == "vksurface") {
163 // return a pointer to the VkSurfaceKHR value, not the value itself
164 return static_cast<QWaylandVulkanWindow *>(window->handle())->vkSurface();
165 }
166 }
167#endif
168
172
173 return nullptr;
174}
175
185
186#if QT_CONFIG(opengl)
188{
189#if QT_CONFIG(opengl)
191
194
197
200#endif
201
202 return nullptr;
203}
204#endif // opengl
205
216
222
228
234
240
245
247{
250}
251
252}
253
254QT_END_NAMESPACE
Combined button and popup list for selecting options.