// This file was generated by qtwaylandscanner
// source file is /usr/share/treeland-protocols/treeland-dde-shell-v1.xml

#ifndef QT_WAYLAND_SERVER_TREELAND_DDE_SHELL_V1
#define QT_WAYLAND_SERVER_TREELAND_DDE_SHELL_V1

#include "wayland-server-core.h"
#include "wayland-treeland-dde-shell-v1-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")
QT_WARNING_DISABLE_GCC("-Wreorder")
QT_WARNING_DISABLE_CLANG("-Wreorder")

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

        virtual ~treeland_dde_shell_manager_v1();

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

            treeland_dde_shell_manager_v1 *treeland_dde_shell_manager_v1_object;
            treeland_dde_shell_manager_v1 *object() { return treeland_dde_shell_manager_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, 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; }

        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 QByteArrayView interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }

    protected:
        struct ::wl_global *m_global;

    protected:
        virtual Resource *allocate();

        virtual void destroy_global();

        virtual void bind_resource(Resource *resource);
        virtual void destroy_resource(Resource *resource);

        virtual void get_window_overlap_checker(Resource *resource, uint32_t id);
        virtual void get_shell_surface(Resource *resource, uint32_t id, struct ::wl_resource *surface);
        virtual void get_treeland_dde_active(Resource *resource, uint32_t id, struct ::wl_resource *seat);
        virtual void get_treeland_multitaskview(Resource *resource, uint32_t id);
        virtual void get_treeland_window_picker(Resource *resource, uint32_t id);
        virtual void get_treeland_lockscreen(Resource *resource, uint32_t id);
        virtual void set_xwindow_position_relative(Resource *resource, uint32_t callback, uint32_t wid, struct ::wl_resource *anchor, wl_fixed_t dx, wl_fixed_t dy);
        virtual void destroy(Resource *resource);

    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 ::treeland_dde_shell_manager_v1_interface m_treeland_dde_shell_manager_v1_interface;

        static void handle_get_window_overlap_checker(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id);
        static void handle_get_shell_surface(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id,
            struct ::wl_resource *surface);
        static void handle_get_treeland_dde_active(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id,
            struct ::wl_resource *seat);
        static void handle_get_treeland_multitaskview(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id);
        static void handle_get_treeland_window_picker(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id);
        static void handle_get_treeland_lockscreen(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id);
        static void handle_set_xwindow_position_relative(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t callback,
            uint32_t wid,
            struct ::wl_resource *anchor,
            wl_fixed_t dx,
            wl_fixed_t dy);
        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);

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

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

        virtual ~treeland_window_overlap_checker();

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

            treeland_window_overlap_checker *treeland_window_overlap_checker_object;
            treeland_window_overlap_checker *object() { return treeland_window_overlap_checker_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; }

        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 QByteArrayView interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }


        enum anchor {
            anchor_top = 1, // the top edge of the anchor rectangle
            anchor_bottom = 2, // the bottom edge of the anchor rectangle
            anchor_left = 4, // the left edge of the anchor rectangle
            anchor_right = 8, // the right edge of the anchor rectangle
        };

        void send_enter();
        void send_enter(struct ::wl_resource *resource);
        void send_leave();
        void send_leave(struct ::wl_resource *resource);
    protected:
        struct ::wl_global *m_global;

    protected:
        virtual Resource *allocate();

        virtual void destroy_global();

        virtual void bind_resource(Resource *resource);
        virtual void destroy_resource(Resource *resource);

        virtual void update(Resource *resource, int32_t width, int32_t height, uint32_t anchor, struct ::wl_resource *output);
        virtual void destroy(Resource *resource);

    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 ::treeland_window_overlap_checker_interface m_treeland_window_overlap_checker_interface;

        static void handle_update(
            ::wl_client *client,
            struct wl_resource *resource,
            int32_t width,
            int32_t height,
            uint32_t anchor,
            struct ::wl_resource *output);
        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);

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

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

        virtual ~treeland_dde_shell_surface_v1();

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

            treeland_dde_shell_surface_v1 *treeland_dde_shell_surface_v1_object;
            treeland_dde_shell_surface_v1 *object() { return treeland_dde_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, 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; }

        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 QByteArrayView interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }


        enum role {
            role_overlay = 1,
        };
    protected:
        struct ::wl_global *m_global;

    protected:
        virtual Resource *allocate();

        virtual void destroy_global();

        virtual void bind_resource(Resource *resource);
        virtual void destroy_resource(Resource *resource);

        virtual void destroy(Resource *resource);
        virtual void set_surface_position(Resource *resource, int32_t x, int32_t y);
        virtual void set_role(Resource *resource, uint32_t role);
        virtual void set_auto_placement(Resource *resource, uint32_t y_offset);
        virtual void set_skip_switcher(Resource *resource, uint32_t skip);
        virtual void set_skip_dock_preview(Resource *resource, uint32_t skip);
        virtual void set_skip_muti_task_view(Resource *resource, uint32_t skip);
        virtual void set_accept_keyboard_focus(Resource *resource, uint32_t accept);

    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 ::treeland_dde_shell_surface_v1_interface m_treeland_dde_shell_surface_v1_interface;

        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_set_surface_position(
            ::wl_client *client,
            struct wl_resource *resource,
            int32_t x,
            int32_t y);
        static void handle_set_role(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t role);
        static void handle_set_auto_placement(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t y_offset);
        static void handle_set_skip_switcher(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t skip);
        static void handle_set_skip_dock_preview(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t skip);
        static void handle_set_skip_muti_task_view(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t skip);
        static void handle_set_accept_keyboard_focus(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t accept);

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

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

        virtual ~treeland_dde_active_v1();

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

            treeland_dde_active_v1 *treeland_dde_active_v1_object;
            treeland_dde_active_v1 *object() { return treeland_dde_active_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, 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; }

        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 QByteArrayView interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }


        enum reason {
            reason_mouse = 0,
            reason_wheel = 1,
        };

        void send_active_in(uint32_t reason);
        void send_active_in(struct ::wl_resource *resource, uint32_t reason);
        void send_active_out(uint32_t reason);
        void send_active_out(struct ::wl_resource *resource, uint32_t reason);
        void send_start_drag();
        void send_start_drag(struct ::wl_resource *resource);
        void send_drop();
        void send_drop(struct ::wl_resource *resource);
    protected:
        struct ::wl_global *m_global;

    protected:
        virtual Resource *allocate();

        virtual void destroy_global();

        virtual void bind_resource(Resource *resource);
        virtual void destroy_resource(Resource *resource);

        virtual void destroy(Resource *resource);

    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 ::treeland_dde_active_v1_interface m_treeland_dde_active_v1_interface;

        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);

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

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

        virtual ~treeland_multitaskview_v1();

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

            treeland_multitaskview_v1 *treeland_multitaskview_v1_object;
            treeland_multitaskview_v1 *object() { return treeland_multitaskview_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, 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; }

        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 QByteArrayView interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }

    protected:
        struct ::wl_global *m_global;

    protected:
        virtual Resource *allocate();

        virtual void destroy_global();

        virtual void bind_resource(Resource *resource);
        virtual void destroy_resource(Resource *resource);

        virtual void destroy(Resource *resource);
        virtual void toggle(Resource *resource);

    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 ::treeland_multitaskview_v1_interface m_treeland_multitaskview_v1_interface;

        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_toggle(
            ::wl_client *client,
            struct wl_resource *resource);

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

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

        virtual ~treeland_window_picker_v1();

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

            treeland_window_picker_v1 *treeland_window_picker_v1_object;
            treeland_window_picker_v1 *object() { return treeland_window_picker_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, 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; }

        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 QByteArrayView interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }


        void send_window(int32_t pid);
        void send_window(struct ::wl_resource *resource, int32_t pid);
    protected:
        struct ::wl_global *m_global;

    protected:
        virtual Resource *allocate();

        virtual void destroy_global();

        virtual void bind_resource(Resource *resource);
        virtual void destroy_resource(Resource *resource);

        virtual void destroy(Resource *resource);
        virtual void pick(Resource *resource, const QString &hint);

    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 ::treeland_window_picker_v1_interface m_treeland_window_picker_v1_interface;

        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_pick(
            ::wl_client *client,
            struct wl_resource *resource,
            const char *hint);

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

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

        virtual ~treeland_lockscreen_v1();

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

            treeland_lockscreen_v1 *treeland_lockscreen_v1_object;
            treeland_lockscreen_v1 *object() { return treeland_lockscreen_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, 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; }

        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 QByteArrayView interfaceName() { return interface()->name; }
        static int interfaceVersion() { return interface()->version; }

    protected:
        struct ::wl_global *m_global;

    protected:
        virtual Resource *allocate();

        virtual void destroy_global();

        virtual void bind_resource(Resource *resource);
        virtual void destroy_resource(Resource *resource);

        virtual void destroy(Resource *resource);
        virtual void lock(Resource *resource);
        virtual void shutdown(Resource *resource);
        virtual void switch_user(Resource *resource);

    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 ::treeland_lockscreen_v1_interface m_treeland_lockscreen_v1_interface;

        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_lock(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_shutdown(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_switch_user(
            ::wl_client *client,
            struct wl_resource *resource);

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

QT_WARNING_POP
QT_END_NAMESPACE

#endif
