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 QT_CONFIG(xkbcommon)
68 if (lowerCaseResource == "xkb_context") {
69 return m_integration->display()->xkbContext();
70 }
71#endif
72 if (lowerCaseResource == "serial")
73 return reinterpret_cast<void *>(quintptr(m_integration->display()->defaultInputDevice()->serial()));
74
75 return nullptr;
76}
77
82
84{
86 return compositor->object();
87 return nullptr;
88}
89
91{
93 return inputDevice->wl_seat();
94 }
95 return nullptr;
96}
97
99{
101 if (auto keyboard = inputDevice->keyboard())
102 return keyboard->wl_keyboard();
103 return nullptr;
104}
105
107{
109 if (auto pointer = inputDevice->pointer())
110 return pointer->wl_pointer();
111 return nullptr;
112}
113
115{
117 if (auto touch = inputDevice->touch())
118 return touch->wl_touch();
119 return nullptr;
120}
121
126
128{
130 return inputDevice->wl_seat();
131 return nullptr;
132}
133
134#if QT_CONFIG(xkbcommon)
136{
137 return m_integration->display()->xkbContext();
138}
139#endif
140
142{
144
145 if (lowerCaseResource == "display")
146 return m_integration->display()->wl_display();
147 if (lowerCaseResource == "compositor") {
149 return compositor->object();
150 }
151 if (lowerCaseResource == "surface") {
152 QWaylandWindow *w = static_cast<QWaylandWindow*>(window->handle());
153 return w ? w->wlSurface() : nullptr;
154 }
155
158
159#if QT_CONFIG(vulkan)
160 if (lowerCaseResource == "vksurface") {
162 // return a pointer to the VkSurfaceKHR value, not the value itself
163 return static_cast<QWaylandVulkanWindow *>(window->handle())->vkSurface();
164 }
165 }
166#endif
167
171
172 return nullptr;
173}
174
184
185#if QT_CONFIG(opengl)
187{
188#if QT_CONFIG(opengl)
190
193
196
199#endif
200
201 return nullptr;
202}
203#endif // opengl
204
215
221
227
233
239
244
246{
249}
250
251}
252
253QT_END_NAMESPACE