| 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 |
|
| 4 |
#ifndef QEGLFSDEVICEINTEGRATION_H |
| 5 |
#define QEGLFSDEVICEINTEGRATION_H |
| 6 |
|
| 7 |
// |
| 8 |
// W A R N I N G |
| 9 |
// ------------- |
| 10 |
// |
| 11 |
// This file is not part of the Qt API. It exists purely as an |
| 12 |
// implementation detail. This header file may change from version to |
| 13 |
// version without notice, or even be removed. |
| 14 |
// |
| 15 |
// We mean it. |
| 16 |
// |
| 17 |
|
| 18 |
#include "qeglfsglobal_p.h" |
| 19 |
#include <qpa/qplatformintegration.h> |
| 20 |
#include <qpa/qplatformscreen.h> |
| 21 |
#include <QtCore/QString> |
| 22 |
#include <QtCore/QLoggingCategory> |
| 23 |
#include <QtGui/QSurfaceFormat> |
| 24 |
#include <QtGui/QImage> |
| 25 |
|
| 26 |
QT_BEGIN_NAMESPACE |
| 27 |
|
| 28 |
Q_DECLARE_LOGGING_CATEGORY(qLcEglDevDebug) |
| 29 |
|
| 30 |
class QPlatformSurface; |
| 31 |
class QEglFSWindow; |
| 32 |
|
| 33 |
#define QEglFSDeviceIntegrationFactoryInterface_iid "org.qt-project.qt.qpa.egl.QEglFSDeviceIntegrationFactoryInterface.5.5" |
| 34 |
|
| 35 |
class Q_EGLFS_EXPORT QEglFSDeviceIntegration |
| 36 |
{ |
| 37 |
public: |
| 38 |
virtual ~QEglFSDeviceIntegration() { } |
| 39 |
|
| 40 |
virtual void platformInit(); |
| 41 |
virtual void platformDestroy(); |
| 42 |
virtual EGLNativeDisplayType platformDisplay() const; |
| 43 |
virtual EGLDisplay createDisplay(EGLNativeDisplayType nativeDisplay); |
| 44 |
virtual bool usesDefaultScreen(); |
| 45 |
virtual void screenInit(); |
| 46 |
virtual void screenDestroy(); |
| 47 |
virtual QSizeF physicalScreenSize() const; |
| 48 |
virtual QSize screenSize() const; |
| 49 |
virtual QDpi logicalDpi() const; |
| 50 |
virtual QDpi logicalBaseDpi() const; |
| 51 |
virtual Qt::ScreenOrientation nativeOrientation() const; |
| 52 |
virtual Qt::ScreenOrientation orientation() const; |
| 53 |
virtual int screenDepth() const; |
| 54 |
virtual QImage::Format screenFormat() const; |
| 55 |
virtual qreal refreshRate() const; |
| 56 |
virtual QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const; |
| 57 |
virtual EGLint surfaceType() const; |
| 58 |
virtual QEglFSWindow *createWindow(QWindow *window) const; |
| 59 |
virtual EGLNativeWindowType createNativeWindow(QPlatformWindow *platformWindow, |
| 60 |
const QSize &size, |
| 61 |
const QSurfaceFormat &format); |
| 62 |
virtual EGLNativeWindowType createNativeOffscreenWindow(const QSurfaceFormat &format); |
| 63 |
virtual void destroyNativeWindow(EGLNativeWindowType window); |
| 64 |
virtual bool hasCapability(QPlatformIntegration::Capability cap) const; |
| 65 |
virtual QPlatformCursor *createCursor(QPlatformScreen *screen) const; |
| 66 |
virtual bool filterConfig(EGLDisplay display, EGLConfig config) const; |
| 67 |
virtual void waitForVSync(QPlatformSurface *surface) const; |
| 68 |
virtual void presentBuffer(QPlatformSurface *surface); |
| 69 |
virtual QByteArray fbDeviceName() const; |
| 70 |
virtual int framebufferIndex() const; |
| 71 |
virtual bool supportsPBuffers() const; |
| 72 |
virtual bool supportsSurfacelessContexts() const; |
| 73 |
virtual QFunctionPointer platformFunction(const QByteArray &function) const; |
| 74 |
virtual void *nativeResourceForIntegration(const QByteArray &name); |
| 75 |
virtual void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen); |
| 76 |
virtual void *wlDisplay() const; |
| 77 |
|
| 78 |
static EGLConfig chooseConfig(EGLDisplay display, const QSurfaceFormat &format); |
| 79 |
}; |
| 80 |
|
| 81 |
class Q_EGLFS_EXPORT QEglFSDeviceIntegrationPlugin : public QObject |
| 82 |
{ |
| 83 |
Q_OBJECT |
| 84 |
|
| 85 |
public: |
| 86 |
virtual QEglFSDeviceIntegration *create() = 0; |
| 87 |
|
| 88 |
// the pattern expected by qLoadPlugin calls for a QString argument. |
| 89 |
// we don't need it, so don't bother subclasses with it: |
| 90 |
QEglFSDeviceIntegration *create(const QString &) { return create(); } |
| 91 |
}; |
| 92 |
|
| 93 |
class Q_EGLFS_EXPORT QEglFSDeviceIntegrationFactory |
| 94 |
{ |
| 95 |
public: |
| 96 |
static QStringList keys(); |
| 97 |
static QEglFSDeviceIntegration *create(const QString &name); |
| 98 |
}; |
| 99 |
|
| 100 |
QT_END_NAMESPACE |
| 101 |
|
| 102 |
#endif // QEGLDEVICEINTEGRATION_H |