// This file was generated by qtwaylandscanner
// source file is pointer-constraints-unstable-v1.xml

#ifndef QT_WAYLAND_SERVER_POINTER_CONSTRAINTS_UNSTABLE_V1
#define QT_WAYLAND_SERVER_POINTER_CONSTRAINTS_UNSTABLE_V1

#include "wayland-server-core.h"
#include "wayland-pointer-constraints-unstable-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")

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

        virtual ~zwp_pointer_constraints_v1();

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

            zwp_pointer_constraints_v1 *zwp_pointer_constraints_v1_object;
            zwp_pointer_constraints_v1 *object() { return zwp_pointer_constraints_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; }

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


        enum error {
            error_already_constrained = 1, // pointer constraint already requested on that surface
        };

        enum lifetime {
            lifetime_oneshot = 1,
            lifetime_persistent = 2,
        };

    protected:
        virtual Resource *zwp_pointer_constraints_v1_allocate();

        virtual void zwp_pointer_constraints_v1_destroy_global();

        virtual void zwp_pointer_constraints_v1_bind_resource(Resource *resource);
        virtual void zwp_pointer_constraints_v1_destroy_resource(Resource *resource);

        virtual void zwp_pointer_constraints_v1_destroy(Resource *resource);
        virtual void zwp_pointer_constraints_v1_lock_pointer(Resource *resource, uint32_t id, struct ::wl_resource *surface, struct ::wl_resource *pointer, struct ::wl_resource *region, uint32_t lifetime);
        virtual void zwp_pointer_constraints_v1_confine_pointer(Resource *resource, uint32_t id, struct ::wl_resource *surface, struct ::wl_resource *pointer, struct ::wl_resource *region, uint32_t lifetime);

    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 ::zwp_pointer_constraints_v1_interface m_zwp_pointer_constraints_v1_interface;

        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_lock_pointer(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id,
            struct ::wl_resource *surface,
            struct ::wl_resource *pointer,
            struct ::wl_resource *region,
            uint32_t lifetime);
        static void handle_confine_pointer(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id,
            struct ::wl_resource *surface,
            struct ::wl_resource *pointer,
            struct ::wl_resource *region,
            uint32_t lifetime);

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

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

        virtual ~zwp_locked_pointer_v1();

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

            zwp_locked_pointer_v1 *zwp_locked_pointer_v1_object;
            zwp_locked_pointer_v1 *object() { return zwp_locked_pointer_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; }

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


        void send_locked();
        void send_locked(struct ::wl_resource *resource);
        void send_unlocked();
        void send_unlocked(struct ::wl_resource *resource);

    protected:
        virtual Resource *zwp_locked_pointer_v1_allocate();

        virtual void zwp_locked_pointer_v1_destroy_global();

        virtual void zwp_locked_pointer_v1_bind_resource(Resource *resource);
        virtual void zwp_locked_pointer_v1_destroy_resource(Resource *resource);

        virtual void zwp_locked_pointer_v1_destroy(Resource *resource);
        virtual void zwp_locked_pointer_v1_set_cursor_position_hint(Resource *resource, wl_fixed_t surface_x, wl_fixed_t surface_y);
        virtual void zwp_locked_pointer_v1_set_region(Resource *resource, struct ::wl_resource *region);

    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 ::zwp_locked_pointer_v1_interface m_zwp_locked_pointer_v1_interface;

        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_set_cursor_position_hint(
            ::wl_client *client,
            struct wl_resource *resource,
            wl_fixed_t surface_x,
            wl_fixed_t surface_y);
        static void handle_set_region(
            ::wl_client *client,
            struct wl_resource *resource,
            struct ::wl_resource *region);

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

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

        virtual ~zwp_confined_pointer_v1();

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

            zwp_confined_pointer_v1 *zwp_confined_pointer_v1_object;
            zwp_confined_pointer_v1 *object() { return zwp_confined_pointer_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; }

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


        void send_confined();
        void send_confined(struct ::wl_resource *resource);
        void send_unconfined();
        void send_unconfined(struct ::wl_resource *resource);

    protected:
        virtual Resource *zwp_confined_pointer_v1_allocate();

        virtual void zwp_confined_pointer_v1_destroy_global();

        virtual void zwp_confined_pointer_v1_bind_resource(Resource *resource);
        virtual void zwp_confined_pointer_v1_destroy_resource(Resource *resource);

        virtual void zwp_confined_pointer_v1_destroy(Resource *resource);
        virtual void zwp_confined_pointer_v1_set_region(Resource *resource, struct ::wl_resource *region);

    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 ::zwp_confined_pointer_v1_interface m_zwp_confined_pointer_v1_interface;

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

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

QT_WARNING_POP
QT_END_NAMESPACE

#endif
