1 | // Copyright (C) 2021 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 | // |
5 | // W A R N I N G |
6 | // ------------- |
7 | // |
8 | // This file is not part of the Qt API. It exists purely as an |
9 | // implementation detail. This header file may change from version to |
10 | // version without notice, or even be removed. |
11 | // |
12 | // We mean it. |
13 | // |
14 | |
15 | #ifndef TEXTURESHARINGEXTENSION_H |
16 | #define TEXTURESHARINGEXTENSION_H |
17 | |
18 | #include <qpa/qwindowsysteminterface.h> |
19 | #include <QtWaylandClient/private/qwayland-wayland.h> |
20 | #include <QtWaylandClient/qwaylandclientextension.h> |
21 | #include "qwayland-qt-texture-sharing-unstable-v1.h" |
22 | #include "private/qglobal_p.h" |
23 | |
24 | QT_BEGIN_NAMESPACE |
25 | |
26 | namespace QtWaylandClient { |
27 | class QWaylandServerBuffer; |
28 | class QWaylandServerBufferIntegration; |
29 | }; |
30 | |
31 | class TextureSharingExtension : public QWaylandClientExtensionTemplate<TextureSharingExtension> |
32 | , public QtWayland::zqt_texture_sharing_v1 |
33 | { |
34 | Q_OBJECT |
35 | public: |
36 | TextureSharingExtension(); |
37 | |
38 | public slots: |
39 | void requestImage(const QString &key); |
40 | void abandonImage(const QString &key); |
41 | |
42 | signals: |
43 | void bufferReceived(QtWaylandClient::QWaylandServerBuffer *buffer, const QString &key); |
44 | |
45 | private: |
46 | void zqt_texture_sharing_v1_provide_buffer(struct ::qt_server_buffer *buffer, const QString &key) override; |
47 | void zqt_texture_sharing_v1_image_failed(const QString &key, const QString &message) override; |
48 | QtWaylandClient::QWaylandServerBufferIntegration *m_server_buffer_integration = nullptr; |
49 | }; |
50 | |
51 | QT_END_NAMESPACE |
52 | |
53 | #endif // TEXTURESHARINGEXTENSION_H |
54 |