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
24QT_BEGIN_NAMESPACE
25
26namespace QtWaylandClient {
27 class QWaylandServerBuffer;
28 class QWaylandServerBufferIntegration;
29};
30
31class TextureSharingExtension : public QWaylandClientExtensionTemplate<TextureSharingExtension>
32 , public QtWayland::zqt_texture_sharing_v1
33{
34 Q_OBJECT
35public:
36 TextureSharingExtension();
37
38public slots:
39 void requestImage(const QString &key);
40 void abandonImage(const QString &key);
41
42signals:
43 void bufferReceived(QtWaylandClient::QWaylandServerBuffer *buffer, const QString &key);
44
45private:
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
51QT_END_NAMESPACE
52
53#endif // TEXTURESHARINGEXTENSION_H
54

source code of qtwayland/src/imports/texture-sharing/texturesharingextension_p.h