| 1 |
// Copyright (C) 2016 The Qt Company Ltd. |
| 2 |
// SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 |
|
| 4 |
#ifndef QXCBGLINTEGRATION_H |
| 5 |
|
| 6 |
#include "qxcbexport.h" |
| 7 |
#include "qxcbwindow.h" |
| 8 |
|
| 9 |
#include <QtCore/QLoggingCategory> |
| 10 |
|
| 11 |
QT_BEGIN_NAMESPACE |
| 12 |
|
| 13 |
class QPlatformOffscreenSurface; |
| 14 |
class QOffscreenSurface; |
| 15 |
class QXcbNativeInterfaceHandler; |
| 16 |
|
| 17 |
Q_XCB_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaGl) |
| 18 |
|
| 19 |
class Q_XCB_EXPORT QXcbGlIntegration |
| 20 |
{ |
| 21 |
public: |
| 22 |
QXcbGlIntegration(); |
| 23 |
virtual ~QXcbGlIntegration(); |
| 24 |
virtual bool initialize(QXcbConnection *connection) = 0; |
| 25 |
|
| 26 |
virtual bool supportsThreadedOpenGL() const { return false; } |
| 27 |
virtual bool supportsSwitchableWidgetComposition() const { return true; } |
| 28 |
virtual bool handleXcbEvent(xcb_generic_event_t *event, uint responseType); |
| 29 |
|
| 30 |
virtual QXcbWindow *createWindow(QWindow *window) const = 0; |
| 31 |
#ifndef QT_NO_OPENGL |
| 32 |
virtual QPlatformOpenGLContext *createPlatformOpenGLContext(QOpenGLContext *context) const = 0; |
| 33 |
#endif |
| 34 |
virtual QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const = 0; |
| 35 |
|
| 36 |
virtual QXcbNativeInterfaceHandler *nativeInterfaceHandler() const { return nullptr; } |
| 37 |
}; |
| 38 |
|
| 39 |
QT_END_NAMESPACE |
| 40 |
|
| 41 |
#endif //QXCBGLINTEGRATION_H |