Debian Codegraph @

wayland/qtwayland-dev/5.15.1/QtWaylandClient/private/qwaylandbuffer_p.h

raw symbols SCIP
1 // Copyright (C) 2018 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 QWAYLANDBUFFER_H
6 #define QWAYLANDBUFFER_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 <QtWaylandClient/qtwaylandclientglobal.h>
20
21 #include <QtCore/QSize>
22 #include <QtCore/QRect>
23
24 #include <wayland-client.h>
25 #include <wayland-client-protocol.h>
26
27 QT_BEGIN_NAMESPACE
28
29 namespace QtWaylandClient {
30
31 class Q_WAYLAND_CLIENT_EXPORT QWaylandBuffer {
32 public:
33 QWaylandBuffer();
34 virtual ~QWaylandBuffer();
35 void init(wl_buffer *buf);
36
37 wl_buffer *buffer() {return mBuffer;}
38 virtual QSize size() const = 0;
39 virtual int scale() const { return 1; }
40
41 void setBusy() { mBusy = true; }
42 bool busy() const { return mBusy; }
43
44 void setCommitted() { mCommitted = true; }
45 bool committed() const { return mCommitted; }
46
47 protected:
48 struct wl_buffer *mBuffer = nullptr;
49
50 private:
51 bool mBusy = false;
52 bool mCommitted = false;
53
54 static void release(void *data, wl_buffer *);
55 static const wl_buffer_listener listener;
56 };
57
58 }
59
60 QT_END_NAMESPACE
61
62 #endif // QWAYLANDBUFFER_H