#ifndef QT_WAYLAND_CUSTOM
#define QT_WAYLAND_CUSTOM

#include "wayland-custom-client-protocol.h"
#include <QByteArray>
#include <QString>

struct wl_registry;

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

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

        virtual ~qt_example_extension();

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

        struct ::qt_example_extension *object() { return m_qt_example_extension; }
        const struct ::qt_example_extension *object() const { return m_qt_example_extension; }
        static qt_example_extension *fromObject(struct ::qt_example_extension *object);

        bool isInitialized() const;

        static const struct ::wl_interface *interface();

        enum decoration_state {
            decoration_state_hidden = 0, // Decorations are not shown
            decoration_state_shown = 1 // Decorations are shown
        };

        void register_surface(struct ::wl_surface *surface);
        void bounce(struct ::wl_surface *surface, uint32_t duration);
        void spin(struct ::wl_surface *surface, uint32_t duration);
        struct ::qt_example_local_object *create_local_object(const QString &color, const QString &text);

    protected:
        virtual void example_extension_close(struct ::wl_surface *surface);
        virtual void example_extension_set_font_size(struct ::wl_surface *surface, uint32_t pixel_size);
        virtual void example_extension_set_window_decoration(uint32_t state);

    private:
        void init_listener();
        static const struct qt_example_extension_listener m_qt_example_extension_listener;
        static void handle_close(
            void *data,
            struct ::qt_example_extension *object,
            struct ::wl_surface *surface);
        static void handle_set_font_size(
            void *data,
            struct ::qt_example_extension *object,
            struct ::wl_surface *surface,
            uint32_t pixel_size);
        static void handle_set_window_decoration(
            void *data,
            struct ::qt_example_extension *object,
            uint32_t state);
        struct ::qt_example_extension *m_qt_example_extension;
    };

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

        virtual ~qt_example_local_object();

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

        struct ::qt_example_local_object *object() { return m_qt_example_local_object; }
        const struct ::qt_example_local_object *object() const { return m_qt_example_local_object; }
        static qt_example_local_object *fromObject(struct ::qt_example_local_object *object);

        bool isInitialized() const;

        static const struct ::wl_interface *interface();

        void set_text(const QString &text);

    protected:
        virtual void example_local_object_clicked();

    private:
        void init_listener();
        static const struct qt_example_local_object_listener m_qt_example_local_object_listener;
        static void handle_clicked(
            void *data,
            struct ::qt_example_local_object *object);
        struct ::qt_example_local_object *m_qt_example_local_object;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
