| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#ifndef QWAYLANDBUFFER_H |
| 6 |
#define QWAYLANDBUFFER_H |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 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 |