// This file was generated by qtwaylandscanner
// source file is frog-color-management-v1.xml

#ifndef QT_WAYLAND_SERVER_FROG_COLOR_MANAGEMENT_V1
#define QT_WAYLAND_SERVER_FROG_COLOR_MANAGEMENT_V1

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

        virtual ~frog_color_management_factory_v1();

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

            frog_color_management_factory_v1 *frog_color_management_factory_v1_object;
            frog_color_management_factory_v1 *object() { return frog_color_management_factory_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 *add(struct ::wl_resource *resource);

        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 *frog_color_management_factory_v1_allocate();

        virtual void frog_color_management_factory_v1_destroy_global();

        virtual void frog_color_management_factory_v1_bind_resource(Resource *resource);
        virtual void frog_color_management_factory_v1_destroy_resource(Resource *resource);

        virtual void frog_color_management_factory_v1_destroy(Resource *resource);
        virtual void frog_color_management_factory_v1_get_color_managed_surface(Resource *resource, struct ::wl_resource *surface, uint32_t callback);

    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 ::frog_color_management_factory_v1_interface m_frog_color_management_factory_v1_interface;

        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_get_color_managed_surface(
            ::wl_client *client,
            struct wl_resource *resource,
            struct ::wl_resource *surface,
            uint32_t callback);

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

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

        virtual ~frog_color_managed_surface();

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

            frog_color_managed_surface *frog_color_managed_surface_object;
            frog_color_managed_surface *object() { return frog_color_managed_surface_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 *add(struct ::wl_resource *resource);

        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 transfer_function {
            transfer_function_undefined = 0, // specifies undefined, implementation-specific handling of the surface's transfer function.
            transfer_function_srgb = 1, // specifies the sRGB non-linear EOTF. An implementation may: display this as Gamma 2.2 for the purposes of being consistent with content rendering across displays, rendering_intent and user expectations.
            transfer_function_gamma_22 = 2, // specifies gamma 2.2 power curve as the EOTF
            transfer_function_st2084_pq = 3, // specifies the SMPTE ST2084 Perceptual Quantizer (PQ) EOTF
            transfer_function_scrgb_linear = 4, // specifies the scRGB (extended sRGB) linear EOTF. Note: Primaries outside the gamut triangle specified can be expressed with negative values for this transfer function.
        };

        enum primaries {
            primaries_undefined = 0, // specifies undefined, implementation-specific handling
            primaries_rec709 = 1, // specifies Rec.709/sRGB primaries with D65 white point
            primaries_rec2020 = 2, // specifies Rec.2020/HDR10 primaries with D65 white point
        };

        enum render_intent {
            render_intent_perceptual = 0, // perceptual
        };

        void send_preferred_metadata(uint32_t transfer_function, uint32_t output_display_primary_red_x, uint32_t output_display_primary_red_y, uint32_t output_display_primary_green_x, uint32_t output_display_primary_green_y, uint32_t output_display_primary_blue_x, uint32_t output_display_primary_blue_y, uint32_t output_white_point_x, uint32_t output_white_point_y, uint32_t max_luminance, uint32_t min_luminance, uint32_t max_full_frame_luminance);
        void send_preferred_metadata(struct ::wl_resource *resource, uint32_t transfer_function, uint32_t output_display_primary_red_x, uint32_t output_display_primary_red_y, uint32_t output_display_primary_green_x, uint32_t output_display_primary_green_y, uint32_t output_display_primary_blue_x, uint32_t output_display_primary_blue_y, uint32_t output_white_point_x, uint32_t output_white_point_y, uint32_t max_luminance, uint32_t min_luminance, uint32_t max_full_frame_luminance);

    protected:
        virtual Resource *frog_color_managed_surface_allocate();

        virtual void frog_color_managed_surface_destroy_global();

        virtual void frog_color_managed_surface_bind_resource(Resource *resource);
        virtual void frog_color_managed_surface_destroy_resource(Resource *resource);

        virtual void frog_color_managed_surface_destroy(Resource *resource);
        virtual void frog_color_managed_surface_set_known_transfer_function(Resource *resource, uint32_t transfer_function);
        virtual void frog_color_managed_surface_set_known_container_color_volume(Resource *resource, uint32_t primaries);
        virtual void frog_color_managed_surface_set_render_intent(Resource *resource, uint32_t render_intent);
        virtual void frog_color_managed_surface_set_hdr_metadata(Resource *resource, uint32_t mastering_display_primary_red_x, uint32_t mastering_display_primary_red_y, uint32_t mastering_display_primary_green_x, uint32_t mastering_display_primary_green_y, uint32_t mastering_display_primary_blue_x, uint32_t mastering_display_primary_blue_y, uint32_t mastering_white_point_x, uint32_t mastering_white_point_y, uint32_t max_display_mastering_luminance, uint32_t min_display_mastering_luminance, uint32_t max_cll, uint32_t max_fall);

    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 ::frog_color_managed_surface_interface m_frog_color_managed_surface_interface;

        static void handle_destroy(
            ::wl_client *client,
            struct wl_resource *resource);
        static void handle_set_known_transfer_function(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t transfer_function);
        static void handle_set_known_container_color_volume(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t primaries);
        static void handle_set_render_intent(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t render_intent);
        static void handle_set_hdr_metadata(
            ::wl_client *client,
            struct wl_resource *resource,
            uint32_t mastering_display_primary_red_x,
            uint32_t mastering_display_primary_red_y,
            uint32_t mastering_display_primary_green_x,
            uint32_t mastering_display_primary_green_y,
            uint32_t mastering_display_primary_blue_x,
            uint32_t mastering_display_primary_blue_y,
            uint32_t mastering_white_point_x,
            uint32_t mastering_white_point_y,
            uint32_t max_display_mastering_luminance,
            uint32_t min_display_mastering_luminance,
            uint32_t max_cll,
            uint32_t max_fall);

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

QT_WARNING_POP
QT_END_NAMESPACE

#endif
