summaryrefslogtreecommitdiff
path: root/tests/manual/server-buffer/cpp-client/sharebufferextension.h
blob: 78e3ca7f14c52572c9bd7e71c4f73455e53ccb1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (C) 2017 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#ifndef SHAREBUFFEREXTENSION_H
#define SHAREBUFFEREXTENSION_H

#include <qpa/qwindowsysteminterface.h>
#include <QtWaylandClient/private/qwayland-wayland.h>
#include <QtWaylandClient/qwaylandclientextension.h>
#include "qwayland-share-buffer.h"

QT_BEGIN_NAMESPACE

namespace QtWaylandClient {
    class QWaylandServerBuffer;
    class QWaylandServerBufferIntegration;
};

class ShareBufferExtension : public QWaylandClientExtensionTemplate<ShareBufferExtension>
        , public QtWayland::qt_share_buffer
{
    Q_OBJECT
public:
    ShareBufferExtension();

signals:
    void bufferReceived(QtWaylandClient::QWaylandServerBuffer *buffer);

private:
    void share_buffer_cross_buffer(struct ::qt_server_buffer *buffer) override;
    QtWaylandClient::QWaylandServerBufferIntegration *m_server_buffer_integration = nullptr;
};

QT_END_NAMESPACE

#endif // SHAREBUFFEREXTENSION_H