// This file was generated by qtwaylandscanner
// source file is /usr/share/treeland-protocols/treeland-foreign-toplevel-manager-v1.xml

#ifndef QT_WAYLAND_SERVER_TREELAND_FOREIGN_TOPLEVEL_MANAGER_V1
#define QT_WAYLAND_SERVER_TREELAND_FOREIGN_TOPLEVEL_MANAGER_V1

#include "wayland-server-core.h"
#include "wayland-treeland-foreign-toplevel-manager-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_foreign_toplevel_manager_v1
    {
    public:
        treeland_foreign_toplevel_manager_v1(struct ::wl_client *client, int id, int version);
        treeland_foreign_toplevel_manager_v1(struct ::wl_display *display, int version);
        treeland_foreign_toplevel_manager_v1(struct ::wl_resource *resource);
        treeland_foreign_toplevel_manager_v1();

        virtual ~treeland_foreign_toplevel_manager_v1();

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

            treeland_foreign_toplevel_manager_v1 *treeland_foreign_toplevel_manager_v1_object;
            treeland_foreign_toplevel_manager_v1 *object() { return treeland_foreign_toplevel_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; }


        void send_toplevel(struct ::wl_resource *toplevel);
        void send_toplevel(struct ::wl_resource *resource, struct ::wl_resource *toplevel);
        void send_finished();
        void send_finished(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 stop(Resource *resource);
        virtual void get_dock_preview_context(Resource *resource, struct ::wl_resource *relative_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);
        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_foreign_toplevel_manager_v1_interface m_treeland_foreign_toplevel_manager_v1_interface;

        static void handle_stop(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_get_dock_preview_context(
            ::wl_client *client,
            struct wl_resource *resource,
            struct ::wl_resource *relative_surface,
            uint32_t id);

        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_foreign_toplevel_manager_v1 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };

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

        virtual ~treeland_foreign_toplevel_handle_v1();

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

            treeland_foreign_toplevel_handle_v1 *treeland_foreign_toplevel_handle_v1_object;
            treeland_foreign_toplevel_handle_v1 *object() { return treeland_foreign_toplevel_handle_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 state {
            state_maximized = 0, // the toplevel is maximized
            state_minimized = 1, // the toplevel is minimized
            state_activated = 2, // the toplevel is active
            state_fullscreen = 3, // the toplevel is fullscreen
            state_attention = 4, // the toplevel is demanding attention
        };

        enum error {
            error_invalid_rectangle = 0, // the provided rectangle is invalid
        };

        void send_pid(uint32_t pid);
        void send_pid(struct ::wl_resource *resource, uint32_t pid);
        void send_title(const QString &title);
        void send_title(struct ::wl_resource *resource, const QString &title);
        void send_app_id(const QString &app_id);
        void send_app_id(struct ::wl_resource *resource, const QString &app_id);
        void send_identifier(uint32_t identifier);
        void send_identifier(struct ::wl_resource *resource, uint32_t identifier);
        void send_output_enter(struct ::wl_resource *output);
        void send_output_enter(struct ::wl_resource *resource, struct ::wl_resource *output);
        void send_output_leave(struct ::wl_resource *output);
        void send_output_leave(struct ::wl_resource *resource, struct ::wl_resource *output);
        void send_state(const QByteArray &state);
        void send_state(struct ::wl_resource *resource, const QByteArray &state);
        void send_done();
        void send_done(struct ::wl_resource *resource);
        void send_closed();
        void send_closed(struct ::wl_resource *resource);
        void send_parent(struct ::wl_resource *parent);
        void send_parent(struct ::wl_resource *resource, struct ::wl_resource *parent);
    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 set_maximized(Resource *resource);
        virtual void unset_maximized(Resource *resource);
        virtual void set_minimized(Resource *resource);
        virtual void unset_minimized(Resource *resource);
        virtual void activate(Resource *resource, struct ::wl_resource *seat);
        virtual void close(Resource *resource);
        virtual void set_rectangle(Resource *resource, struct ::wl_resource *surface, int32_t x, int32_t y, int32_t width, int32_t height);
        virtual void destroy(Resource *resource);
        virtual void set_fullscreen(Resource *resource, struct ::wl_resource *output);
        virtual void unset_fullscreen(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_foreign_toplevel_handle_v1_interface m_treeland_foreign_toplevel_handle_v1_interface;

        static void handle_set_maximized(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_unset_maximized(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_set_minimized(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_unset_minimized(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_activate(
            ::wl_client *client,
            struct wl_resource *resource,
            struct ::wl_resource *seat);
        static void handle_close(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_set_rectangle(
            ::wl_client *client,
            struct wl_resource *resource,
            struct ::wl_resource *surface,
            int32_t x,
            int32_t y,
            int32_t width,
            int32_t height);
        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_set_fullscreen(
            ::wl_client *client,
            struct wl_resource *resource,
            struct ::wl_resource *output);
        static void handle_unset_fullscreen(
            ::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_foreign_toplevel_handle_v1 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };

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

        virtual ~treeland_dock_preview_context_v1();

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

            treeland_dock_preview_context_v1 *treeland_dock_preview_context_v1_object;
            treeland_dock_preview_context_v1 *object() { return treeland_dock_preview_context_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 direction {
            direction_top = 0, // top
            direction_right = 1, // right
            direction_bottom = 2, // bottom
            direction_left = 3, // left
        };

        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 show(Resource *resource, wl_array *surfaces, int32_t x, int32_t y, uint32_t direction);
        virtual void show_tooltip(Resource *resource, const QString &tooltip, int32_t x, int32_t y, uint32_t direction);
        virtual void close(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_dock_preview_context_v1_interface m_treeland_dock_preview_context_v1_interface;

        static void handle_show(
            ::wl_client *client,
            struct wl_resource *resource,
            wl_array *surfaces,
            int32_t x,
            int32_t y,
            uint32_t direction);
        static void handle_show_tooltip(
            ::wl_client *client,
            struct wl_resource *resource,
            const char *tooltip,
            int32_t x,
            int32_t y,
            uint32_t direction);
        static void handle_close(
            ::wl_client *client,
            struct wl_resource *resource);
        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_dock_preview_context_v1 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
