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 QXCBGLINTEGRATION_H
5
6#include "qxcbexport.h"
7#include "qxcbwindow.h"
8
9#include <QtCore/QLoggingCategory>
10
11QT_BEGIN_NAMESPACE
12
13class QPlatformOffscreenSurface;
14class QOffscreenSurface;
15class QXcbNativeInterfaceHandler;
16
17Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaGl, Q_XCB_EXPORT)
18
19class Q_XCB_EXPORT QXcbGlIntegration
20{
21public:
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
39QT_END_NAMESPACE
40
41#endif //QXCBGLINTEGRATION_H
42

source code of qtbase/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h