Debian Codegraph @

wayland/qtwayland-dev/5.11.3/QtWaylandClient/private/qwaylandserverbufferintegration_p.h

raw
1 // Copyright (C) 2019 The Qt Company Ltd.
2 //
3 // SPDX-License-Identifier: LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5 #ifndef QWAYLANDSERVERBUFFERINTEGRATION_H
6 #define QWAYLANDSERVERBUFFERINTEGRATION_H
7
8 //
9 // W A R N I N G
10 // -------------
11 //
12 // This file is not part of the Qt API. It exists purely as an
13 // implementation detail. This header file may change from version to
14 // version without notice, or even be removed.
15 //
16 // We mean it.
17 //
18
19 #include <QtCore/QSize>
20 #include <QtGui/qopengl.h>
21
22 #include <QtWaylandClient/private/qwayland-server-buffer-extension.h>
23 #include <QtWaylandClient/qtwaylandclientglobal.h>
24
25 QT_BEGIN_NAMESPACE
26
27 class QOpenGLTexture;
28
29 namespace QtWaylandClient {
30
31 class QWaylandDisplay;
32
33 class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBuffer
34 {
35 public:
36 enum Format {
37 RGBA32,
38 A8
39 };
40
41 QWaylandServerBuffer();
42 virtual ~QWaylandServerBuffer();
43
44 virtual QOpenGLTexture *toOpenGlTexture() = 0;
45
46 Format format() const;
47 QSize size() const;
48
49 void setUserData(void *userData);
50 void *userData() const;
51
52 protected:
53 Format m_format;
54 QSize m_size;
55
56 private:
57 void *m_user_data = nullptr;
58 };
59
60 class Q_WAYLAND_CLIENT_EXPORT QWaylandServerBufferIntegration
61 {
62 public:
63 QWaylandServerBufferIntegration();
64 virtual ~QWaylandServerBufferIntegration();
65
66 virtual void initialize(QWaylandDisplay *display) = 0;
67
68 virtual QWaylandServerBuffer *serverBuffer(struct qt_server_buffer *buffer) = 0;
69 };
70
71 }
72
73 QT_END_NAMESPACE
74
75 #endif