// This file was generated by qtwaylandscanner
// source file is /usr/share/wayland-protocols/staging/drm-lease/drm-lease-v1.xml

#ifndef QT_WAYLAND_SERVER_DRM_LEASE_V1
#define QT_WAYLAND_SERVER_DRM_LEASE_V1

#include "wayland-server-core.h"
#include "wayland-drm-lease-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  wp_drm_lease_device_v1
    {
    public:
        wp_drm_lease_device_v1(struct ::wl_client *client, int id, int version);
        wp_drm_lease_device_v1(struct ::wl_display *display, int version);
        wp_drm_lease_device_v1(struct ::wl_resource *resource);
        wp_drm_lease_device_v1();

        virtual ~wp_drm_lease_device_v1();

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

            wp_drm_lease_device_v1 *wp_drm_lease_device_v1_object;
            wp_drm_lease_device_v1 *object() { return wp_drm_lease_device_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_drm_fd(int32_t fd);
        void send_drm_fd(struct ::wl_resource *resource, int32_t fd);
        void send_connector(struct ::wl_resource *id);
        void send_connector(struct ::wl_resource *resource, struct ::wl_resource *id);
        void send_done();
        void send_done(struct ::wl_resource *resource);
        void send_released();
        void send_released(struct ::wl_resource *resource);

    protected:
        virtual Resource *wp_drm_lease_device_v1_allocate();

        virtual void wp_drm_lease_device_v1_destroy_global();

        virtual void wp_drm_lease_device_v1_bind_resource(Resource *resource);
        virtual void wp_drm_lease_device_v1_destroy_resource(Resource *resource);

        virtual void wp_drm_lease_device_v1_create_lease_request(Resource *resource, uint32_t id);
        virtual void wp_drm_lease_device_v1_release(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 ::wp_drm_lease_device_v1_interface m_wp_drm_lease_device_v1_interface;

        static void handle_create_lease_request(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id);
        static void handle_release(
            ::wl_client *client,
            struct wl_resource *resource);

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

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

        virtual ~wp_drm_lease_connector_v1();

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

            wp_drm_lease_connector_v1 *wp_drm_lease_connector_v1_object;
            wp_drm_lease_connector_v1 *object() { return wp_drm_lease_connector_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_name(const QString &name);
        void send_name(struct ::wl_resource *resource, const QString &name);
        void send_description(const QString &description);
        void send_description(struct ::wl_resource *resource, const QString &description);
        void send_connector_id(uint32_t connector_id);
        void send_connector_id(struct ::wl_resource *resource, uint32_t connector_id);
        void send_done();
        void send_done(struct ::wl_resource *resource);
        void send_withdrawn();
        void send_withdrawn(struct ::wl_resource *resource);

    protected:
        virtual Resource *wp_drm_lease_connector_v1_allocate();

        virtual void wp_drm_lease_connector_v1_destroy_global();

        virtual void wp_drm_lease_connector_v1_bind_resource(Resource *resource);
        virtual void wp_drm_lease_connector_v1_destroy_resource(Resource *resource);

        virtual void wp_drm_lease_connector_v1_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 ::wp_drm_lease_connector_v1_interface m_wp_drm_lease_connector_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_global *m_global;
        struct ::wl_display *m_display;
        struct wl_event_source *m_globalRemovedEvent;
        struct DisplayDestroyedListener : ::wl_listener {
            wp_drm_lease_connector_v1 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };

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

        virtual ~wp_drm_lease_request_v1();

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

            wp_drm_lease_request_v1 *wp_drm_lease_request_v1_object;
            wp_drm_lease_request_v1 *object() { return wp_drm_lease_request_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_wrong_device = 0, // requested a connector from a different lease device
            error_duplicate_connector = 1, // requested a connector twice
            error_empty_lease = 2, // requested a lease without requesting a connector
        };

    protected:
        virtual Resource *wp_drm_lease_request_v1_allocate();

        virtual void wp_drm_lease_request_v1_destroy_global();

        virtual void wp_drm_lease_request_v1_bind_resource(Resource *resource);
        virtual void wp_drm_lease_request_v1_destroy_resource(Resource *resource);

        virtual void wp_drm_lease_request_v1_request_connector(Resource *resource, struct ::wl_resource *connector);
        virtual void wp_drm_lease_request_v1_submit(Resource *resource, 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 ::wp_drm_lease_request_v1_interface m_wp_drm_lease_request_v1_interface;

        static void handle_request_connector(
            ::wl_client *client,
            struct wl_resource *resource,
            struct ::wl_resource *connector);
        static void handle_submit(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t id);

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

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

        virtual ~wp_drm_lease_v1();

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

            wp_drm_lease_v1 *wp_drm_lease_v1_object;
            wp_drm_lease_v1 *object() { return wp_drm_lease_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_lease_fd(int32_t leased_fd);
        void send_lease_fd(struct ::wl_resource *resource, int32_t leased_fd);
        void send_finished();
        void send_finished(struct ::wl_resource *resource);

    protected:
        virtual Resource *wp_drm_lease_v1_allocate();

        virtual void wp_drm_lease_v1_destroy_global();

        virtual void wp_drm_lease_v1_bind_resource(Resource *resource);
        virtual void wp_drm_lease_v1_destroy_resource(Resource *resource);

        virtual void wp_drm_lease_v1_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 ::wp_drm_lease_v1_interface m_wp_drm_lease_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_global *m_global;
        struct ::wl_display *m_display;
        struct wl_event_source *m_globalRemovedEvent;
        struct DisplayDestroyedListener : ::wl_listener {
            wp_drm_lease_v1 *parent;
        };
        DisplayDestroyedListener m_displayDestroyedListener;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
