// This file was generated by qtwaylandscanner
// source file is linux-dmabuf-unstable-v1.xml

#ifndef QT_WAYLAND_LINUX_DMABUF_UNSTABLE_V1
#define QT_WAYLAND_LINUX_DMABUF_UNSTABLE_V1

#include "wayland-linux-dmabuf-unstable-v1-client-protocol.h"
#include <QByteArray>
#include <QString>

struct wl_registry;

QT_BEGIN_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers")
QT_WARNING_DISABLE_CLANG("-Wmissing-field-initializers")

namespace QtWayland {
    class  zwp_linux_dmabuf_v1
    {
    public:
        zwp_linux_dmabuf_v1(struct ::wl_registry *registry, uint32_t id, int version);
        zwp_linux_dmabuf_v1(struct ::zwp_linux_dmabuf_v1 *object);
        zwp_linux_dmabuf_v1();

        virtual ~zwp_linux_dmabuf_v1();

        void init(struct ::wl_registry *registry, uint32_t id, int version);
        void init(struct ::zwp_linux_dmabuf_v1 *object);

        struct ::zwp_linux_dmabuf_v1 *object() { return m_zwp_linux_dmabuf_v1; }
        const struct ::zwp_linux_dmabuf_v1 *object() const { return m_zwp_linux_dmabuf_v1; }
        static zwp_linux_dmabuf_v1 *fromObject(struct ::zwp_linux_dmabuf_v1 *object);

        bool isInitialized() const;

        uint32_t version() const;
        static const struct ::wl_interface *interface();

        void destroy();
        struct ::zwp_linux_buffer_params_v1 *create_params();
        struct ::zwp_linux_dmabuf_feedback_v1 *get_default_feedback();
        struct ::zwp_linux_dmabuf_feedback_v1 *get_surface_feedback(struct ::wl_surface *surface);

    protected:
        virtual void zwp_linux_dmabuf_v1_format(uint32_t format);
        virtual void zwp_linux_dmabuf_v1_modifier(uint32_t format, uint32_t modifier_hi, uint32_t modifier_lo);

    private:
        void init_listener();
        static const struct zwp_linux_dmabuf_v1_listener m_zwp_linux_dmabuf_v1_listener;
        static void handle_format(
            void *data,
            struct ::zwp_linux_dmabuf_v1 *object,
            uint32_t format);
        static void handle_modifier(
            void *data,
            struct ::zwp_linux_dmabuf_v1 *object,
            uint32_t format,
            uint32_t modifier_hi,
            uint32_t modifier_lo);
        struct ::zwp_linux_dmabuf_v1 *m_zwp_linux_dmabuf_v1;
    };

    class  zwp_linux_buffer_params_v1
    {
    public:
        zwp_linux_buffer_params_v1(struct ::wl_registry *registry, uint32_t id, int version);
        zwp_linux_buffer_params_v1(struct ::zwp_linux_buffer_params_v1 *object);
        zwp_linux_buffer_params_v1();

        virtual ~zwp_linux_buffer_params_v1();

        void init(struct ::wl_registry *registry, uint32_t id, int version);
        void init(struct ::zwp_linux_buffer_params_v1 *object);

        struct ::zwp_linux_buffer_params_v1 *object() { return m_zwp_linux_buffer_params_v1; }
        const struct ::zwp_linux_buffer_params_v1 *object() const { return m_zwp_linux_buffer_params_v1; }
        static zwp_linux_buffer_params_v1 *fromObject(struct ::zwp_linux_buffer_params_v1 *object);

        bool isInitialized() const;

        uint32_t version() const;
        static const struct ::wl_interface *interface();

        enum error {
            error_already_used = 0, // the dmabuf_batch object has already been used to create a wl_buffer
            error_plane_idx = 1, // plane index out of bounds
            error_plane_set = 2, // the plane index was already set
            error_incomplete = 3, // missing or too many planes to create a buffer
            error_invalid_format = 4, // format not supported
            error_invalid_dimensions = 5, // invalid width or height
            error_out_of_bounds = 6, // offset + stride * height goes out of dmabuf bounds
            error_invalid_wl_buffer = 7, // invalid wl_buffer resulted from importing dmabufs via                the create_immed request on given buffer_params
        };

        enum flags {
            flags_y_invert = 1, // contents are y-inverted
            flags_interlaced = 2, // content is interlaced
            flags_bottom_first = 4, // bottom field first
        };

        void destroy();
        void add(int32_t fd, uint32_t plane_idx, uint32_t offset, uint32_t stride, uint32_t modifier_hi, uint32_t modifier_lo);
        void create(int32_t width, int32_t height, uint32_t format, uint32_t flags);
        struct ::wl_buffer *create_immed(int32_t width, int32_t height, uint32_t format, uint32_t flags);

    protected:
        virtual void zwp_linux_buffer_params_v1_created(struct ::wl_buffer *buffer);
        virtual void zwp_linux_buffer_params_v1_failed();

    private:
        void init_listener();
        static const struct zwp_linux_buffer_params_v1_listener m_zwp_linux_buffer_params_v1_listener;
        static void handle_created(
            void *data,
            struct ::zwp_linux_buffer_params_v1 *object,
            struct ::wl_buffer *buffer);
        static void handle_failed(
            void *data,
            struct ::zwp_linux_buffer_params_v1 *object);
        struct ::zwp_linux_buffer_params_v1 *m_zwp_linux_buffer_params_v1;
    };

    class  zwp_linux_dmabuf_feedback_v1
    {
    public:
        zwp_linux_dmabuf_feedback_v1(struct ::wl_registry *registry, uint32_t id, int version);
        zwp_linux_dmabuf_feedback_v1(struct ::zwp_linux_dmabuf_feedback_v1 *object);
        zwp_linux_dmabuf_feedback_v1();

        virtual ~zwp_linux_dmabuf_feedback_v1();

        void init(struct ::wl_registry *registry, uint32_t id, int version);
        void init(struct ::zwp_linux_dmabuf_feedback_v1 *object);

        struct ::zwp_linux_dmabuf_feedback_v1 *object() { return m_zwp_linux_dmabuf_feedback_v1; }
        const struct ::zwp_linux_dmabuf_feedback_v1 *object() const { return m_zwp_linux_dmabuf_feedback_v1; }
        static zwp_linux_dmabuf_feedback_v1 *fromObject(struct ::zwp_linux_dmabuf_feedback_v1 *object);

        bool isInitialized() const;

        uint32_t version() const;
        static const struct ::wl_interface *interface();

        enum tranche_flags {
            tranche_flags_scanout = 1, // direct scan-out tranche
        };

        void destroy();

    protected:
        virtual void zwp_linux_dmabuf_feedback_v1_done();
        virtual void zwp_linux_dmabuf_feedback_v1_format_table(int32_t fd, uint32_t size);
        virtual void zwp_linux_dmabuf_feedback_v1_main_device(wl_array *device);
        virtual void zwp_linux_dmabuf_feedback_v1_tranche_done();
        virtual void zwp_linux_dmabuf_feedback_v1_tranche_target_device(wl_array *device);
        virtual void zwp_linux_dmabuf_feedback_v1_tranche_formats(wl_array *indices);
        virtual void zwp_linux_dmabuf_feedback_v1_tranche_flags(uint32_t flags);

    private:
        void init_listener();
        static const struct zwp_linux_dmabuf_feedback_v1_listener m_zwp_linux_dmabuf_feedback_v1_listener;
        static void handle_done(
            void *data,
            struct ::zwp_linux_dmabuf_feedback_v1 *object);
        static void handle_format_table(
            void *data,
            struct ::zwp_linux_dmabuf_feedback_v1 *object,
            int32_t fd,
            uint32_t size);
        static void handle_main_device(
            void *data,
            struct ::zwp_linux_dmabuf_feedback_v1 *object,
            wl_array *device);
        static void handle_tranche_done(
            void *data,
            struct ::zwp_linux_dmabuf_feedback_v1 *object);
        static void handle_tranche_target_device(
            void *data,
            struct ::zwp_linux_dmabuf_feedback_v1 *object,
            wl_array *device);
        static void handle_tranche_formats(
            void *data,
            struct ::zwp_linux_dmabuf_feedback_v1 *object,
            wl_array *indices);
        static void handle_tranche_flags(
            void *data,
            struct ::zwp_linux_dmabuf_feedback_v1 *object,
            uint32_t flags);
        struct ::zwp_linux_dmabuf_feedback_v1 *m_zwp_linux_dmabuf_feedback_v1;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
