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
21QT_BEGIN_NAMESPACE
22
23class QWindow;
24class QPlatformOpenGLContext;
25class QSurfaceFormat;
26
27namespace QtWaylandClient {
28
29class QWaylandWindow;
30class QWaylandDisplay;
31
32class Q_WAYLANDCLIENT_EXPORT QWaylandClientBufferIntegration
33{
34public:
35 QWaylandClientBufferIntegration();
36 virtual ~QWaylandClientBufferIntegration();
37
38 virtual void initialize(QWaylandDisplay *display) = 0;
39
40 virtual bool isValid() const { return true; }
41
42 virtual bool supportsThreadedOpenGL() const { return false; }
43 virtual bool supportsWindowDecoration() const { return false; }
44
45 virtual QWaylandWindow *createEglWindow(QWindow *window) = 0;
46 virtual QPlatformOpenGLContext *createPlatformOpenGLContext(const QSurfaceFormat &glFormat, QPlatformOpenGLContext *share) const = 0;
47
48 enum NativeResource {
49 EglDisplay,
50 EglConfig,
51 EglContext
52 };
53 virtual void *nativeResource(NativeResource /*resource*/) { return nullptr; }
54 virtual void *nativeResourceForContext(NativeResource /*resource*/, QPlatformOpenGLContext */*context*/) { return nullptr; }
55};
56
57}
58
59QT_END_NAMESPACE
60
61#endif // QWAYLANDCLIENTBUFFERINTEGRATION_H
62

source code of qtwayland/src/client/hardwareintegration/qwaylandclientbufferintegration_p.h