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 <QtGui/QSurfaceFormat>
23#include <QtGui/QImage>
24
25QT_BEGIN_NAMESPACE
26
27class QPlatformSurface;
28class QEglFSWindow;
29
30#define QEglFSDeviceIntegrationFactoryInterface_iid "org.qt-project.qt.qpa.egl.QEglFSDeviceIntegrationFactoryInterface.5.5"
31
32class Q_EGLFS_EXPORT QEglFSDeviceIntegration
33{
34public:
35 virtual ~QEglFSDeviceIntegration() { }
36
37 virtual void platformInit();
38 virtual void platformDestroy();
39 virtual EGLNativeDisplayType platformDisplay() const;
40 virtual EGLDisplay createDisplay(EGLNativeDisplayType nativeDisplay);
41 virtual bool usesDefaultScreen();
42 virtual void screenInit();
43 virtual void screenDestroy();
44 virtual QSizeF physicalScreenSize() const;
45 virtual QSize screenSize() const;
46 virtual QDpi logicalDpi() const;
47 virtual QDpi logicalBaseDpi() const;
48 virtual Qt::ScreenOrientation nativeOrientation() const;
49 virtual Qt::ScreenOrientation orientation() const;
50 virtual int screenDepth() const;
51 virtual QImage::Format screenFormat() const;
52 virtual qreal refreshRate() const;
53 virtual QSurfaceFormat surfaceFormatFor(const QSurfaceFormat &inputFormat) const;
54 virtual EGLint surfaceType() const;
55 virtual QEglFSWindow *createWindow(QWindow *window) const;
56 virtual EGLNativeWindowType createNativeWindow(QPlatformWindow *platformWindow,
57 const QSize &size,
58 const QSurfaceFormat &format);
59 virtual EGLNativeWindowType createNativeOffscreenWindow(const QSurfaceFormat &format);
60 virtual void destroyNativeWindow(EGLNativeWindowType window);
61 virtual bool hasCapability(QPlatformIntegration::Capability cap) const;
62 virtual QPlatformCursor *createCursor(QPlatformScreen *screen) const;
63 virtual bool filterConfig(EGLDisplay display, EGLConfig config) const;
64 virtual void waitForVSync(QPlatformSurface *surface) const;
65 virtual void presentBuffer(QPlatformSurface *surface);
66 virtual QByteArray fbDeviceName() const;
67 virtual int framebufferIndex() const;
68 virtual bool supportsPBuffers() const;
69 virtual bool supportsSurfacelessContexts() const;
70 virtual QFunctionPointer platformFunction(const QByteArray &function) const;
71 virtual void *nativeResourceForIntegration(const QByteArray &name);
72 virtual void *nativeResourceForScreen(const QByteArray &resource, QScreen *screen);
73 virtual void *wlDisplay() const;
74
75 static EGLConfig chooseConfig(EGLDisplay display, const QSurfaceFormat &format);
76};
77
78class Q_EGLFS_EXPORT QEglFSDeviceIntegrationPlugin : public QObject
79{
80 Q_OBJECT
81
82public:
83 virtual QEglFSDeviceIntegration *create() = 0;
84
85 // the pattern expected by qLoadPlugin calls for a QString argument.
86 // we don't need it, so don't bother subclasses with it:
87 QEglFSDeviceIntegration *create(const QString &) { return create(); }
88};
89
90class Q_EGLFS_EXPORT QEglFSDeviceIntegrationFactory
91{
92public:
93 static QStringList keys();
94 static QEglFSDeviceIntegration *create(const QString &name);
95};
96
97QT_END_NAMESPACE
98
99#endif // QEGLDEVICEINTEGRATION_H
100

source code of qtbase/src/plugins/platforms/eglfs/api/qeglfsdeviceintegration_p.h