4#include <QtCore/qtextstream.h>
5#include <QtGui/private/qguiapplication_p.h>
7#include <qpa/qplatformwindow.h>
8#include <QtGui/QSurfaceFormat>
9#include <QtGui/QScreen>
11# include <QtGui/QOpenGLContext>
12# include <QtGui/QOffscreenSurface>
14#include <QtGui/QWindow>
15#include <QtCore/QLoggingCategory>
16#include <qpa/qwindowsysteminterface.h>
17#include <qpa/qplatforminputcontextfactory_p.h>
28#include <QtGui/private/qeglconvenience_p.h>
30# include <QtGui/private/qeglplatformcontext_p.h>
31# include <QtGui/private/qeglpbuffer_p.h>
34#include <QtGui/private/qgenericunixfontdatabase_p.h>
35#include <QtGui/private/qgenericunixservices_p.h>
36#include <QtGui/private/qgenericunixthemes_p.h>
37#include <QtGui/private/qgenericunixeventdispatcher_p.h>
38#include <QtFbSupport/private/qfbvthandler_p.h>
40# include <QtOpenGL/private/qopenglcompositorbackingstore_p.h>
43#if QT_CONFIG(libinput)
44#include <QtInputSupport/private/qlibinputhandler_p.h>
48#include <QtInputSupport/private/qevdevmousemanager_p.h>
49#include <QtInputSupport/private/qevdevkeyboardmanager_p.h>
50#include <QtInputSupport/private/qevdevtouchmanager_p.h>
54#include <QtInputSupport/private/qtslib_p.h>
57#if QT_CONFIG(integrityhid)
58#include <QtInputSupport/qintegrityhidmanager.h>
74 m_display(EGL_NO_DISPLAY),
78 m_disableInputHandlers(
false)
91 qFatal(
"Could not open egl display");
94 if (
Q_UNLIKELY(!eglInitialize(m_display, &major, &minor)))
95 qFatal(
"Could not initialize egl display");
107 if (!m_disableInputHandlers)
118 if (m_display != EGL_NO_DISPLAY)
119 eglTerminate(m_display);
126 return createUnixEventDispatcher();
131 return m_services.
data();
136 return m_fontDb.
data();
164 const auto showWithoutActivating =
window->property(
"_q_showWithoutActivating");
165 if (showWithoutActivating.isValid() && showWithoutActivating.toBool())
170 w->requestActivateWindow();
191 return QEGLPlatformContext::createFrom<QEglFSContext>(
context, contextDisplay,
display(), shareContext);
199 QEGLPlatformContext::Flags
flags;
223 case OpenGL:
return false;
279 result =
reinterpret_cast<void*
>(nativeDisplay());
300 result =
reinterpret_cast<void*
>(nativeDisplay());
390void QEglFSIntegration::loadKeymap(
const QString &filename)
395 qWarning(
"QEglFSIntegration: Cannot load keymap, no keyboard handler found");
398void QEglFSIntegration::switchLang()
403 qWarning(
"QEglFSIntegration: Cannot switch language, no keyboard handler found");
409#if QT_CONFIG(libinput)
431#if QT_CONFIG(integrityhid)
436EGLNativeDisplayType QEglFSIntegration::nativeDisplay()
const
int compare(QByteArrayView a, Qt::CaseSensitivity cs=Qt::CaseSensitive) const noexcept
A pbuffer-based implementation of QPlatformOffscreenSurface for EGL.
EGLContext eglContext() const
virtual void platformInit()
virtual void platformDestroy()
virtual QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const
virtual void screenInit()
virtual void * nativeResourceForIntegration(const QByteArray &name)
static EGLConfig chooseConfig(EGLDisplay display, const QSurfaceFormat &format)
virtual QFunctionPointer platformFunction(const QByteArray &function) const
virtual QEglFSWindow * createWindow(QWindow *window) const
virtual void * wlDisplay() const
virtual EGLDisplay createDisplay(EGLNativeDisplayType nativeDisplay)
virtual EGLNativeDisplayType platformDisplay() const
virtual void screenDestroy()
virtual void * nativeResourceForScreen(const QByteArray &resource, QScreen *screen)
bool hasCapability(QPlatformIntegration::Capability cap) const override
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
QPlatformTheme * createPlatformTheme(const QString &name) const override
QFunctionPointer platformFunction(const QByteArray &function) const override
void initialize() override
Performs initialization steps that depend on having an event dispatcher available.
void * nativeResourceForWindow(const QByteArray &resource, QWindow *window) override
virtual void createInputHandlers()
void * nativeResourceForScreen(const QByteArray &resource, QScreen *screen) override
void * nativeResourceForIntegration(const QByteArray &resource) override
QPlatformNativeInterface * nativeInterface() const override
QPlatformOffscreenSurface * createPlatformOffscreenSurface(QOffscreenSurface *surface) const override
Factory function for QOffscreenSurface.
QOpenGLContext * createOpenGLContext(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext) const override
QPlatformFontDatabase * fontDatabase() const override
Accessor for the platform integration's fontdatabase.
EGLDisplay display() const
QEvdevKeyboardManager * m_kbdMgr
QPlatformWindow * createPlatformWindow(QWindow *window) const override
Factory function for QPlatformWindow.
void destroy() override
Called before the platform integration is deleted.
NativeResourceForContextFunction nativeResourceFunctionForContext(const QByteArray &resource) override
void * nativeResourceForContext(const QByteArray &resource, QOpenGLContext *context) override
QPlatformServices * services() const override
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
Factory function for QPlatformBackingStore.
QPlatformOpenGLContext * createPlatformOpenGLContext(QOpenGLContext *context) const override
Factory function for QPlatformOpenGLContext.
void loadKeymap(const QString &file)
static QPlatformTheme * createUnixTheme(const QString &name)
Creates a UNIX theme according to the detected desktop environment.
QScreen * primaryScreen
the primary (or default) screen of the application.
QScreen * screen() const
Returns the screen to which the offscreen surface is connected.
QSurfaceFormat requestedFormat() const
Returns the requested surfaceformat of this offscreen surface.
A backing store implementation for OpenGL.
static QPlatformInputContext * create()
The QPlatformOpenGLContext class provides an abstraction for native GL contexts.
T * data() const noexcept
Returns the value of the pointer referenced by this object.
void reset(T *other=nullptr) noexcept(noexcept(Cleanup::cleanup(std::declval< T * >())))
Deletes the existing object it is pointing to (if any), and sets its pointer to other.
The QScreen class is used to query screen properties. \inmodule QtGui.
QPlatformScreen * handle() const
Get the platform screen handle.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static bool flushWindowSystemEvents(QEventLoop::ProcessEventsFlags flags=QEventLoop::AllEvents)
Make Qt Gui process all events on the event queue immediately.
static void handleScreenAdded(QPlatformScreen *screen, bool isPrimary=false)
Should be called by the implementation whenever a new screen is added.
Combined button and popup list for selecting options.
#define QByteArrayLiteral(str)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction function
QEglFSDeviceIntegration * qt_egl_device_integration()
static void initResources()
static int resourceType(const QByteArray &key)
static void * eglContextForContext(QOpenGLContext *context)
typedef EGLDisplay(EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC)(EGLenum platform
GLuint64 GLenum void * handle
GLfloat GLfloat GLfloat w
[0]
static void initResources()
Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nullptr) noexcept
#define Q_INIT_RESOURCE(name)
QVideoFrameFormat::PixelFormat fmt