Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qqnxnativeinterface.cpp
Go to the documentation of this file.
1
// Copyright (C) 2012 Research In Motion
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
5
#
include
"qqnxnativeinterface.h"
6
7
#
if
!
defined
(
QT_NO_OPENGL
)
8
#
include
"qqnxglcontext.h"
9
#
endif
10
11
#
if
QT_CONFIG
(
vulkan
)
12
#
include
"qqnxvulkanwindow.h"
13
#
endif
14
15
#
include
"qqnxscreen.h"
16
#
include
"qqnxwindow.h"
17
#
if
defined
(
QQNX_IMF
)
18
#
include
"qqnxinputcontext_imf.h"
19
#
endif
20
21
#
include
"qqnxintegration.h"
22
23
#
if
!
defined
(
QT_NO_OPENGL
)
24
#
include
<
QtGui
/
QOpenGLContext
>
25
#
endif
26
27
#
include
<
QtGui
/
QScreen
>
28
#
include
<
QtGui
/
QWindow
>
29
30
QT_BEGIN_NAMESPACE
31
32
using
namespace
Qt::StringLiterals;
33
34
QQnxNativeInterface
::
QQnxNativeInterface
(
QQnxIntegration
*integration)
35
: m_integration(integration)
36
{
37
}
38
39
void
*
QQnxNativeInterface
::
nativeResourceForWindow
(
const
QByteArray &resource, QWindow *window)
40
{
41
#
if
QT_CONFIG
(
vulkan
)
42
if
(resource ==
"vkSurface"
) {
43
if
(window && window->surfaceType() == QSurface::VulkanSurface && window->handle())
44
return
static_cast
<QQnxVulkanWindow *>(window->handle())->surface();
45
return
nullptr
;
46
}
47
#
endif
48
49
if
(resource ==
"windowGroup"
&& window && window->screen()) {
50
QQnxScreen
*
const
screen =
static_cast
<
QQnxScreen
*>(window->screen()->handle());
51
if
(screen) {
52
screen_window_t screenWindow =
reinterpret_cast
<screen_window_t>(window->winId());
53
QQnxWindow
*qnxWindow = screen->findWindow(screenWindow);
54
// We can't just call data() instead of constData() here, since that would detach
55
// and the lifetime of the char * would not be long enough. Therefore the const_cast.
56
return
qnxWindow ?
const_cast
<
char
*>(qnxWindow->groupName().constData()) : 0;
57
}
58
}
59
60
return
0;
61
}
62
63
void
*
QQnxNativeInterface
::
nativeResourceForScreen
(
const
QByteArray &resource, QScreen *screen)
64
{
65
if
(resource ==
"QObject*"
&& screen)
66
return
static_cast
<QObject*>(
static_cast
<
QQnxScreen
*>(screen->handle()));
67
68
return
0;
69
}
70
71
void
*
QQnxNativeInterface
::
nativeResourceForIntegration
(
const
QByteArray &resource)
72
{
73
if
(resource ==
"screenContext"
)
74
return
m_integration->screenContext();
75
76
#
if
QT_CONFIG
(
opengl
)
77
if
(resource.toLower() ==
"egldisplay"
)
78
return
m_integration->eglDisplay();
79
#
endif
80
81
return
0;
82
}
83
84
#
if
!
defined
(
QT_NO_OPENGL
)
85
void
*
QQnxNativeInterface
::
nativeResourceForContext
(
const
QByteArray &resource, QOpenGLContext *context)
86
{
87
if
(resource ==
"eglcontext"
&& context)
88
return
static_cast
<
QQnxGLContext
*>(context->handle())->eglContext();
89
90
return
0;
91
}
92
#
endif
93
94
void
QQnxNativeInterface
::
setWindowProperty
(QPlatformWindow *window,
const
QString &name,
const
QVariant &value)
95
{
96
QQnxWindow
*qnxWindow =
static_cast
<
QQnxWindow
*>(window);
97
98
if
(name ==
"qnxWindowGroup"_L1
) {
99
if
(value.isNull())
100
qnxWindow->joinWindowGroup(QByteArray());
101
else
if
(value.canConvert<QByteArray>())
102
qnxWindow->joinWindowGroup(value.toByteArray());
103
}
104
}
105
106
QPlatformNativeInterface
::
NativeResourceForIntegrationFunction
QQnxNativeInterface
::
nativeResourceFunctionForIntegration
(
const
QByteArray &resource)
107
{
108
#
if
defined
(
QQNX_IMF
)
109
if
(resource ==
"blackberryIMFSetHighlightColor"
)
110
return
reinterpret_cast
<NativeResourceForIntegrationFunction>(QQnxInputContext::setHighlightColor);
111
if
(resource ==
"blackberryIMFCheckSpelling"
)
112
return
reinterpret_cast
<NativeResourceForIntegrationFunction>(QQnxInputContext::checkSpelling);
113
#
else
114
Q_UNUSED(resource);
115
#
endif
116
return
0;
117
}
118
119
QT_END_NAMESPACE
QQnxGLContext
Definition
qqnxglcontext.h:24
QQnxIntegration
Definition
qqnxintegration.h:47
QQnxNativeInterface
Definition
qqnxnativeinterface.h:15
QQnxNativeInterface::nativeResourceForScreen
void * nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override
Definition
qqnxnativeinterface.cpp:63
QQnxNativeInterface::nativeResourceForWindow
void * nativeResourceForWindow(const QByteArray &resource, QWindow *window) override
Definition
qqnxnativeinterface.cpp:39
QQnxNativeInterface::nativeResourceForContext
void * nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override
Definition
qqnxnativeinterface.cpp:85
QQnxNativeInterface::QQnxNativeInterface
QQnxNativeInterface(QQnxIntegration *integration)
Definition
qqnxnativeinterface.cpp:34
QQnxNativeInterface::nativeResourceForIntegration
void * nativeResourceForIntegration(const QByteArray &resource) override
Definition
qqnxnativeinterface.cpp:71
QQnxNativeInterface::nativeResourceFunctionForIntegration
NativeResourceForIntegrationFunction nativeResourceFunctionForIntegration(const QByteArray &resource) override
Definition
qqnxnativeinterface.cpp:106
QQnxNativeInterface::setWindowProperty
void setWindowProperty(QPlatformWindow *window, const QString &name, const QVariant &value) override
Sets a window property with name to value.
Definition
qqnxnativeinterface.cpp:94
QQnxScreen
Definition
qqnxscreen.h:39
QQnxWindow
The QQnxWindow is the base class of the various classes used as instances of QPlatformWindow in the Q...
Definition
qqnxwindow.h:32
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtbase
src
plugins
platforms
qnx
qqnxnativeinterface.cpp
Generated on
for Qt by
1.18.0