summaryrefslogtreecommitdiffstats
path: root/src/qt-compositor/hardware_integration/xcomposite_share/xcompositebuffer.h
blob: 52154d406ec025faa97edce8c55710f7537d6c12 (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
37
38
39
40
41
42
43
#ifndef XCOMPOSITEBUFFER_H
#define XCOMPOSITEBUFFER_H

#include "waylandobject.h"
#include "wayland_wrapper/wlcompositor.h"

#include <QtCore/QSize>

#include <QtCore/QTextStream>
#include <QtCore/QDataStream>
#include <QtCore/QMetaType>
#include <QtCore/QVariant>
#include <QtWidgets/QWidget>

#include <X11/X.h>

class XCompositeBuffer : public Wayland::Object<struct wl_buffer>
{
public:
    XCompositeBuffer(Wayland::Compositor *compositor, Window window, const QSize &size);

    Window window();

    static struct wl_buffer_interface buffer_interface;
    static void delete_resource(struct wl_resource *resource);

    bool isYInverted() const { return mInvertedY; }
    void setInvertedY(bool inverted) { mInvertedY = inverted; }
private:
    Window mWindow;
    bool mInvertedY;

    static void buffer_interface_destroy(struct wl_client *client,
                        struct wl_resource *buffer);
    static void buffer_interface_damage(struct wl_client *client,
                   struct wl_resource *buffer,
                   int x,
                   int y,
                   int width,
                   int height);
};

#endif // XCOMPOSITORBUFFER_H