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
14#include <QtCore/private/qnativeinterface_p.h>
15#include <QtGui/private/qguiapplication_p.h>
16#include <QtGui/QScreen>
17#include <QtWaylandClient/private/qwaylandclientbufferintegration_p.h>
18#if QT_CONFIG(vulkan)
19#include <QtWaylandClient/private/qwaylandvulkanwindow_p.h>
20#endif
21
23
24namespace QtWaylandClient {
25
30
32{
34
35 if (lowerCaseResource == "display" || lowerCaseResource == "wl_display" || lowerCaseResource == "nativedisplay")
36 return m_integration->display()->wl_display();
37 if (lowerCaseResource == "compositor") {
39 return compositor->object();
40 }
41 if (lowerCaseResource == "server_buffer_integration")
43
46
47 if (lowerCaseResource == "wl_seat")
49 if (lowerCaseResource == "wl_keyboard") {
51 if (keyboard)
52 return keyboard->wl_keyboard();
53 return nullptr;
54 }
55 if (lowerCaseResource == "wl_pointer") {
57 if (pointer)
58 return pointer->wl_pointer();
59 return nullptr;
60 }
61 if (lowerCaseResource == "wl_touch") {
63 if (touch)
64 return touch->wl_touch();
65 return nullptr;
66 }
67 if (lowerCaseResource == "serial")
68 return reinterpret_cast<void *>(quintptr(m_integration->display()->defaultInputDevice()->serial()));
69
70 return nullptr;
71}
72
77
79{
81 return compositor->object();
82 return nullptr;
83}
84
86{
88 return inputDevice->wl_seat();
89 }
90 return nullptr;
91}
92
94{
96 if (auto keyboard = inputDevice->keyboard())
97 return keyboard->wl_keyboard();
98 return nullptr;
99}
100
102{
104 if (auto pointer = inputDevice->pointer())
105 return pointer->wl_pointer();
106 return nullptr;
107}
108
110{
112 if (auto touch = inputDevice->touch())
113 return touch->wl_touch();
114 return nullptr;
115}
116
121
123{
125 return inputDevice->wl_seat();
126 return nullptr;
127}
128
130{
132
133 if (lowerCaseResource == "display")
134 return m_integration->display()->wl_display();
135 if (lowerCaseResource == "compositor") {
137 return compositor->object();
138 }
139 if (lowerCaseResource == "surface") {
140 QWaylandWindow *w = static_cast<QWaylandWindow*>(window->handle());
141 return w ? w->wlSurface() : nullptr;
142 }
143
146
147#if QT_CONFIG(vulkan)
148 if (lowerCaseResource == "vksurface") {
150 // return a pointer to the VkSurfaceKHR value, not the value itself
151 return static_cast<QWaylandVulkanWindow *>(window->handle())->vkSurface();
152 }
153 }
154#endif
155
159
160 return nullptr;
161}
162
172
173#if QT_CONFIG(opengl)
175{
176#if QT_CONFIG(opengl)
178
181
184
187#endif
188
189 return nullptr;
190}
191#endif // opengl
192
203
209
215
221
227
232
234{
237}
238
239}
240
241QT_END_NAMESPACE
Combined button and popup list for selecting options.