| 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 QWAYLANDCLIENTBUFFERINTEGRATION_H |
| 5 | #define QWAYLANDCLIENTBUFFERINTEGRATION_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 <QtCore/private/qglobal_p.h> |
| 19 | #include <QtWaylandClient/qtwaylandclientglobal.h> |
| 20 | #if QT_CONFIG(opengl) |
| 21 | #include <QtGui/private/qeglplatformcontext_p.h> |
| 22 | #endif |
| 23 | |
| 24 | QT_BEGIN_NAMESPACE |
| 25 | |
| 26 | class QWindow; |
| 27 | #if QT_CONFIG(opengl) |
| 28 | class QOpenGLContext; |
| 29 | #endif |
| 30 | class QPlatformOpenGLContext; |
| 31 | class QSurfaceFormat; |
| 32 | |
| 33 | namespace QtWaylandClient { |
| 34 | |
| 35 | class QWaylandWindow; |
| 36 | class QWaylandDisplay; |
| 37 | |
| 38 | class Q_WAYLANDCLIENT_EXPORT QWaylandClientBufferIntegration |
| 39 | { |
| 40 | public: |
| 41 | QWaylandClientBufferIntegration(); |
| 42 | virtual ~QWaylandClientBufferIntegration(); |
| 43 | |
| 44 | virtual void initialize(QWaylandDisplay *display) = 0; |
| 45 | |
| 46 | virtual bool isValid() const { return true; } |
| 47 | |
| 48 | virtual bool supportsThreadedOpenGL() const { return false; } |
| 49 | virtual bool supportsWindowDecoration() const { return false; } |
| 50 | |
| 51 | virtual QWaylandWindow *createEglWindow(QWindow *window) = 0; |
| 52 | virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0; |
| 53 | #if QT_CONFIG(opengl) |
| 54 | virtual QOpenGLContext *createOpenGLContext(EGLContext context, EGLDisplay contextDisplay, QOpenGLContext *shareContext) const = 0; |
| 55 | #endif |
| 56 | |
| 57 | enum NativeResource { |
| 58 | EglDisplay, |
| 59 | EglConfig, |
| 60 | EglContext |
| 61 | }; |
| 62 | virtual void *nativeResource(NativeResource /*resource*/) { return nullptr; } |
| 63 | virtual void *nativeResourceForContext(NativeResource /*resource*/, QPlatformOpenGLContext */*context*/) { return nullptr; } |
| 64 | }; |
| 65 | |
| 66 | } |
| 67 | |
| 68 | QT_END_NAMESPACE |
| 69 | |
| 70 | #endif // QWAYLANDCLIENTBUFFERINTEGRATION_H |
| 71 | |