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
qminimaleglintegration.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
5
#
include
"qminimaleglintegration.h"
6
7
#
include
"qminimaleglwindow.h"
8
#
ifndef
QT_NO_OPENGL
9
#
include
"qminimaleglbackingstore.h"
10
#
endif
11
#
include
<
QtGui
/
private
/
qgenericunixfontdatabase_p
.
h
>
12
13
#
if
defined
(
Q_OS_UNIX
)
14
#
include
<
QtGui
/
private
/
qgenericunixeventdispatcher_p
.
h
>
15
#
elif
defined
(
Q_OS_WIN
)
16
#
include
<
QtGui
/
private
/
qwindowsguieventdispatcher_p
.
h
>
17
#
endif
18
19
#
include
<
qpa
/
qplatformwindow
.
h
>
20
#
include
<
QtGui
/
QSurfaceFormat
>
21
#
include
<
QtGui
/
QOpenGLContext
>
22
#
include
<
QtGui
/
QScreen
>
23
#
include
<
qpa
/
qwindowsysteminterface
.
h
>
24
25
// this is where EGL headers are pulled in, make sure it is last
26
#
include
"qminimaleglscreen.h"
27
28
QT_BEGIN_NAMESPACE
29
30
QMinimalEglIntegration::QMinimalEglIntegration()
31
: mFontDb(
new
QGenericUnixFontDatabase()), mScreen(
new
QMinimalEglScreen(EGL_DEFAULT_DISPLAY))
32
{
33
QWindowSystemInterface::handleScreenAdded(mScreen);
34
35
#
ifdef
QEGL_EXTRA_DEBUG
36
qWarning(
"QMinimalEglIntegration\n"
);
37
#
endif
38
}
39
40
QMinimalEglIntegration::~QMinimalEglIntegration()
41
{
42
QWindowSystemInterface::handleScreenRemoved(mScreen);
43
delete
mFontDb;
44
}
45
46
bool
QMinimalEglIntegration::hasCapability(QPlatformIntegration::Capability cap)
const
47
{
48
switch
(cap) {
49
case
ThreadedPixmaps:
return
true
;
50
case
OpenGL:
return
true
;
51
case
ThreadedOpenGL:
return
true
;
52
default
:
return
QPlatformIntegration::hasCapability(cap);
53
}
54
}
55
56
QPlatformWindow *QMinimalEglIntegration::createPlatformWindow(QWindow *window)
const
57
{
58
#
ifdef
QEGL_EXTRA_DEBUG
59
qWarning(
"QMinimalEglIntegration::createPlatformWindow %p\n"
,window);
60
#
endif
61
QPlatformWindow *w =
new
QMinimalEglWindow
(window);
62
w->requestActivateWindow();
63
return
w;
64
}
65
66
67
QPlatformBackingStore *QMinimalEglIntegration::createPlatformBackingStore(QWindow *window)
const
68
{
69
#
ifdef
QEGL_EXTRA_DEBUG
70
qWarning(
"QMinimalEglIntegration::createWindowSurface %p\n"
, window);
71
#
endif
72
#
ifndef
QT_NO_OPENGL
73
return
new
QMinimalEglBackingStore
(window);
74
#
else
75
Q_UNUSED(window);
76
return
nullptr
;
77
#
endif
78
}
79
#
ifndef
QT_NO_OPENGL
80
QPlatformOpenGLContext *QMinimalEglIntegration::createPlatformOpenGLContext(QOpenGLContext *context)
const
81
{
82
return
static_cast
<
QMinimalEglScreen
*>(context->screen()->handle())
->
platformContext
(
)
;
83
}
84
#
endif
85
86
QPlatformFontDatabase *QMinimalEglIntegration::fontDatabase()
const
87
{
88
return
mFontDb;
89
}
90
91
QAbstractEventDispatcher *QMinimalEglIntegration::createEventDispatcher()
const
92
{
93
#
if
defined
(
Q_OS_UNIX
)
94
return
createUnixEventDispatcher();
95
#
elif
defined
(
Q_OS_WIN
)
96
return
new
QWindowsGuiEventDispatcher;
97
#
else
98
return
nullptr
;
99
#
endif
100
}
101
102
QVariant QMinimalEglIntegration::styleHint(QPlatformIntegration::StyleHint hint)
const
103
{
104
if
(hint == QPlatformIntegration::ShowIsFullScreen)
105
return
true
;
106
107
return
QPlatformIntegration::styleHint(hint);
108
}
109
110
QT_END_NAMESPACE
QMinimalEglBackingStore
Definition
qminimaleglbackingstore.h:16
QMinimalEglScreen
Definition
qminimaleglscreen.h:19
QMinimalEglScreen::platformContext
QPlatformOpenGLContext * platformContext() const
Definition
qminimaleglscreen.cpp:167
QMinimalEglWindow
Definition
qminimaleglwindow.h:15
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qrandomaccessasyncfile_darwin.mm:17
qtbase
src
plugins
platforms
minimalegl
qminimaleglintegration.cpp
Generated on
for Qt by
1.16.1