// This file was generated by qtwaylandscanner
// source file is /usr/share/deepin-wayland-protocols/strut.xml

#ifndef QT_WAYLAND_SERVER_STRUT
#define QT_WAYLAND_SERVER_STRUT

#include "wayland-server-core.h"
#include "wayland-strut-server-protocol.h"
#include <QByteArray>
#include <QMultiMap>
#include <QString>

#include <unistd.h>

#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  com_deepin_kwin_strut
    {
    public:
        com_deepin_kwin_strut(struct ::wl_client *client, int id, int version);
        com_deepin_kwin_strut(struct ::wl_display *display, int version);
        com_deepin_kwin_strut(struct ::wl_resource *resource);
        com_deepin_kwin_strut();

        virtual ~com_deepin_kwin_strut();

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

            com_deepin_kwin_strut *com_deepin_kwin_strut_object;
            com_deepin_kwin_strut *object() { return com_deepin_kwin_strut_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, int 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, int id, int version);
        Resource *add(struct wl_list *resource_list, struct ::wl_client *client, int 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 isGlobalRemoved() const { return m_globalRemovedEvent; }
        void globalRemove();

        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; }


    protected:
        virtual Resource *com_deepin_kwin_strut_allocate();

        virtual void com_deepin_kwin_strut_destroy_global();

        virtual void com_deepin_kwin_strut_bind_resource(Resource *resource);
        virtual void com_deepin_kwin_strut_destroy_resource(Resource *resource);

        virtual void com_deepin_kwin_strut_set_strut_partial(Resource *resource, struct ::wl_resource *surface, int32_t left, int32_t right, int32_t top, int32_t bottom, int32_t left_start_y, int32_t left_end_y, int32_t right_start_y, int32_t right_end_y, int32_t top_start_x, int32_t top_end_x, int32_t bottom_start_x, int32_t bottom_end_x);

    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);
        static int deferred_destroy_global_func(void *data);

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

        static const struct ::com_deepin_kwin_strut_interface m_com_deepin_kwin_strut_interface;

        static void handle_set_strut_partial(
            ::wl_client *client,
            struct wl_resource *resource,
            struct ::wl_resource *surface,
            int32_t left,
            int32_t right,
            int32_t top,
            int32_t bottom,
            int32_t left_start_y,
            int32_t left_end_y,
            int32_t right_start_y,
            int32_t right_end_y,
            int32_t top_start_x,
            int32_t top_end_x,
            int32_t bottom_start_x,
            int32_t bottom_end_x);

        QMultiMap<struct ::wl_client*, Resource*> m_resource_map;
        Resource *m_resource;
        struct ::wl_global *m_global;
        struct ::wl_display *m_display;
        struct wl_event_source *m_globalRemovedEvent;
        struct DisplayDestroyedListener : ::wl_listener {
            com_deepin_kwin_strut *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
