// This file was generated by qtwaylandscanner
// source file is qt-shell-unstable-v1.xml

#ifndef QT_WAYLAND_SERVER_QT_SHELL_UNSTABLE_V1
#define QT_WAYLAND_SERVER_QT_SHELL_UNSTABLE_V1

#include "wayland-server-core.h"
#include "wayland-qt-shell-unstable-v1-server-protocol.h"
#include <QByteArray>
#include <QMultiMap>
#include <QString>

#ifndef WAYLAND_VERSION_CHECK
#define WAYLAND_VERSION_CHECK(major, minor, micro) \
    ((WAYLAND_VERSION_MAJOR > (major)) || \
    (WAYLAND_VERSION_MAJOR == (major) && WAYLAND_VERSION_MINOR > (minor)) || \
    (WAYLAND_VERSION_MAJOR == (major) && WAYLAND_VERSION_MINOR == (minor) && WAYLAND_VERSION_MICRO >= (micro)))
#endif

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

namespace QtWaylandServer {
    class  zqt_shell_surface_v1
    {
    public:
        zqt_shell_surface_v1(struct ::wl_client *client, uint32_t id, int version);
        zqt_shell_surface_v1(struct ::wl_display *display, int version);
        zqt_shell_surface_v1(struct ::wl_resource *resource);
        zqt_shell_surface_v1();

        virtual ~zqt_shell_surface_v1();

        class Resource
        {
        public:
            Resource() : zqt_shell_surface_v1_object(nullptr), handle(nullptr) {}
            virtual ~Resource() {}

            zqt_shell_surface_v1 *zqt_shell_surface_v1_object;
            zqt_shell_surface_v1 *object() { return zqt_shell_surface_v1_object; } 
            struct ::wl_resource *handle;

            struct ::wl_client *client() const { return wl_resource_get_client(handle); }
            int version() const { return wl_resource_get_version(handle); }

            static Resource *fromResource(struct ::wl_resource *resource);
        };

        void init(struct ::wl_client *client, uint32_t id, int version);
        void init(struct ::wl_display *display, int version);
        void init(struct ::wl_resource *resource);

        Resource *add(struct ::wl_client *client, int version);
        Resource *add(struct ::wl_client *client, uint32_t id, int version);
        Resource *add(struct wl_list *resource_list, struct ::wl_client *client, uint32_t id, int version);

        Resource *resource() { return m_resource; }
        const Resource *resource() const { return m_resource; }

        QMultiMap<struct ::wl_client*, Resource*> resourceMap() { return m_resource_map; }
        const QMultiMap<struct ::wl_client*, Resource*> resourceMap() const { return m_resource_map; }

        bool isGlobal() const { return m_global != nullptr; }
        bool isResource() const { return m_resource != nullptr; }

        static const struct ::wl_interface *interface();
        static QByteArray interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }


        enum window_state {
            window_state_no_state = 0,
            window_state_minimized = 1,
            window_state_maximized = 2,
            window_state_fullscreen = 4,
        };

        enum capabilities {
            capabilities_interactive_move = 1,
            capabilities_interactive_resize = 2,
        };

        void send_resize(uint32_t serial, int32_t width, int32_t height);
        void send_resize(struct ::wl_resource *resource, uint32_t serial, int32_t width, int32_t height);
        void send_set_position(uint32_t serial, int32_t x, int32_t y);
        void send_set_position(struct ::wl_resource *resource, uint32_t serial, int32_t x, int32_t y);
        void send_set_window_state(uint32_t serial, uint32_t state);
        void send_set_window_state(struct ::wl_resource *resource, uint32_t serial, uint32_t state);
        void send_configure(uint32_t serial);
        void send_configure(struct ::wl_resource *resource, uint32_t serial);
        void send_set_frame_margins(uint32_t left, uint32_t right, uint32_t top, uint32_t bottom);
        void send_set_frame_margins(struct ::wl_resource *resource, uint32_t left, uint32_t right, uint32_t top, uint32_t bottom);
        void send_close();
        void send_close(struct ::wl_resource *resource);
        void send_set_capabilities(uint32_t capabilities);
        void send_set_capabilities(struct ::wl_resource *resource, uint32_t capabilities);

    protected:
        virtual Resource *zqt_shell_surface_v1_allocate();

        virtual void zqt_shell_surface_v1_bind_resource(Resource *resource);
        virtual void zqt_shell_surface_v1_destroy_resource(Resource *resource);

        virtual void zqt_shell_surface_v1_destroy(Resource *resource);
        virtual void zqt_shell_surface_v1_reposition(Resource *resource, int32_t x, int32_t y);
        virtual void zqt_shell_surface_v1_request_activate(Resource *resource);
        virtual void zqt_shell_surface_v1_set_size(Resource *resource, int32_t width, int32_t height);
        virtual void zqt_shell_surface_v1_set_minimum_size(Resource *resource, int32_t width, int32_t height);
        virtual void zqt_shell_surface_v1_set_maximum_size(Resource *resource, int32_t width, int32_t height);
        virtual void zqt_shell_surface_v1_set_window_title(Resource *resource, const QString &window_title);
        virtual void zqt_shell_surface_v1_set_window_flags(Resource *resource, uint32_t flags);
        virtual void zqt_shell_surface_v1_start_system_resize(Resource *resource, uint32_t serial, uint32_t edge);
        virtual void zqt_shell_surface_v1_start_system_move(Resource *resource, uint32_t serial);
        virtual void zqt_shell_surface_v1_change_window_state(Resource *resource, uint32_t state);
        virtual void zqt_shell_surface_v1_raise(Resource *resource);
        virtual void zqt_shell_surface_v1_lower(Resource *resource);
        virtual void zqt_shell_surface_v1_ack_configure(Resource *resource, uint32_t serial);

    private:
        static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id);
        static void destroy_func(struct ::wl_resource *client_resource);
        static void display_destroy_func(struct ::wl_listener *listener, void *data);

        Resource *bind(struct ::wl_client *client, uint32_t id, int version);
        Resource *bind(struct ::wl_resource *handle);

        static const struct ::zqt_shell_surface_v1_interface m_zqt_shell_surface_v1_interface;

        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_reposition(
            ::wl_client *client,
            struct wl_resource *resource,
            int32_t x,
            int32_t y);
        static void handle_request_activate(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_set_size(
            ::wl_client *client,
            struct wl_resource *resource,
            int32_t width,
            int32_t height);
        static void handle_set_minimum_size(
            ::wl_client *client,
            struct wl_resource *resource,
            int32_t width,
            int32_t height);
        static void handle_set_maximum_size(
            ::wl_client *client,
            struct wl_resource *resource,
            int32_t width,
            int32_t height);
        static void handle_set_window_title(
            ::wl_client *client,
            struct wl_resource *resource,
            const char *window_title);
        static void handle_set_window_flags(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t flags);
        static void handle_start_system_resize(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t serial,
            uint32_t edge);
        static void handle_start_system_move(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t serial);
        static void handle_change_window_state(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t state);
        static void handle_raise(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_lower(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_ack_configure(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t serial);

        QMultiMap<struct ::wl_client*, Resource*> m_resource_map;
        Resource *m_resource;
        struct ::wl_global *m_global;
        struct DisplayDestroyedListener : ::wl_listener {
            zqt_shell_surface_v1 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };

    class  zqt_shell_v1
    {
    public:
        zqt_shell_v1(struct ::wl_client *client, uint32_t id, int version);
        zqt_shell_v1(struct ::wl_display *display, int version);
        zqt_shell_v1(struct ::wl_resource *resource);
        zqt_shell_v1();

        virtual ~zqt_shell_v1();

        class Resource
        {
        public:
            Resource() : zqt_shell_v1_object(nullptr), handle(nullptr) {}
            virtual ~Resource() {}

            zqt_shell_v1 *zqt_shell_v1_object;
            zqt_shell_v1 *object() { return zqt_shell_v1_object; } 
            struct ::wl_resource *handle;

            struct ::wl_client *client() const { return wl_resource_get_client(handle); }
            int version() const { return wl_resource_get_version(handle); }

            static Resource *fromResource(struct ::wl_resource *resource);
        };

        void init(struct ::wl_client *client, uint32_t id, int version);
        void init(struct ::wl_display *display, int version);
        void init(struct ::wl_resource *resource);

        Resource *add(struct ::wl_client *client, int version);
        Resource *add(struct ::wl_client *client, uint32_t id, int version);
        Resource *add(struct wl_list *resource_list, struct ::wl_client *client, uint32_t id, int version);

        Resource *resource() { return m_resource; }
        const Resource *resource() const { return m_resource; }

        QMultiMap<struct ::wl_client*, Resource*> resourceMap() { return m_resource_map; }
        const QMultiMap<struct ::wl_client*, Resource*> resourceMap() const { return m_resource_map; }

        bool isGlobal() const { return m_global != nullptr; }
        bool isResource() const { return m_resource != nullptr; }

        static const struct ::wl_interface *interface();
        static QByteArray interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }


        enum error {
            error_role = 0, // wl_surface already has a different role
        };

    protected:
        virtual Resource *zqt_shell_v1_allocate();

        virtual void zqt_shell_v1_bind_resource(Resource *resource);
        virtual void zqt_shell_v1_destroy_resource(Resource *resource);

        virtual void zqt_shell_v1_surface_create(Resource *resource, struct ::wl_resource *surface, uint32_t id);

    private:
        static void bind_func(struct ::wl_client *client, void *data, uint32_t version, uint32_t id);
        static void destroy_func(struct ::wl_resource *client_resource);
        static void display_destroy_func(struct ::wl_listener *listener, void *data);

        Resource *bind(struct ::wl_client *client, uint32_t id, int version);
        Resource *bind(struct ::wl_resource *handle);

        static const struct ::zqt_shell_v1_interface m_zqt_shell_v1_interface;

        static void handle_surface_create(
            ::wl_client *client,
            struct wl_resource *resource,
            struct ::wl_resource *surface,
            uint32_t id);

        QMultiMap<struct ::wl_client*, Resource*> m_resource_map;
        Resource *m_resource;
        struct ::wl_global *m_global;
        struct DisplayDestroyedListener : ::wl_listener {
            zqt_shell_v1 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
