// This file was generated by qtwaylandscanner
// source file is viewporter.xml

#ifndef QT_WAYLAND_VIEWPORTER
#define QT_WAYLAND_VIEWPORTER

#include <QtWaylandClient/private/wayland-viewporter-client-protocol.h>
#include <QByteArray>
#include <QString>

struct wl_registry;

QT_BEGIN_NAMESPACE
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers")
QT_WARNING_DISABLE_CLANG("-Wmissing-field-initializers")
#if !defined(Q_WAYLAND_CLIENT_VIEWPORTER_EXPORT)
#  if defined(QT_SHARED) && !defined(QT_STATIC)
#    if defined(QT_BUILD_WAYLANDCLIENT_LIB)
#      define Q_WAYLAND_CLIENT_VIEWPORTER_EXPORT Q_DECL_EXPORT
#    else
#      define Q_WAYLAND_CLIENT_VIEWPORTER_EXPORT Q_DECL_IMPORT
#    endif
#  else
#    define Q_WAYLAND_CLIENT_VIEWPORTER_EXPORT
#  endif
#endif

namespace QtWayland {
    class Q_WAYLAND_CLIENT_VIEWPORTER_EXPORT wp_viewporter
    {
    public:
        wp_viewporter(struct ::wl_registry *registry, uint32_t id, int version);
        wp_viewporter(struct ::wp_viewporter *object);
        wp_viewporter();

        virtual ~wp_viewporter();

        void init(struct ::wl_registry *registry, uint32_t id, int version);
        void init(struct ::wp_viewporter *object);

        struct ::wp_viewporter *object() { return m_wp_viewporter; }
        const struct ::wp_viewporter *object() const { return m_wp_viewporter; }
        static wp_viewporter *fromObject(struct ::wp_viewporter *object);

        bool isInitialized() const;

        uint32_t version() const;
        static const struct ::wl_interface *interface();

        enum error {
            error_viewport_exists = 0, // the surface already has a viewport object associated
        };

        void destroy();
        struct ::wp_viewport *get_viewport(struct ::wl_surface *surface);

    private:
        struct ::wp_viewporter *m_wp_viewporter;
    };

    class Q_WAYLAND_CLIENT_VIEWPORTER_EXPORT wp_viewport
    {
    public:
        wp_viewport(struct ::wl_registry *registry, uint32_t id, int version);
        wp_viewport(struct ::wp_viewport *object);
        wp_viewport();

        virtual ~wp_viewport();

        void init(struct ::wl_registry *registry, uint32_t id, int version);
        void init(struct ::wp_viewport *object);

        struct ::wp_viewport *object() { return m_wp_viewport; }
        const struct ::wp_viewport *object() const { return m_wp_viewport; }
        static wp_viewport *fromObject(struct ::wp_viewport *object);

        bool isInitialized() const;

        uint32_t version() const;
        static const struct ::wl_interface *interface();

        enum error {
            error_bad_value = 0, // negative or zero values in width or height
            error_bad_size = 1, // destination size is not integer
            error_out_of_buffer = 2, // source rectangle extends outside of the content area
            error_no_surface = 3, // the wl_surface was destroyed
        };

        void destroy();
        void set_source(wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height);
        void set_destination(int32_t width, int32_t height);

    private:
        struct ::wp_viewport *m_wp_viewport;
    };
}

QT_WARNING_POP
QT_END_NAMESPACE

#endif
