rute 0.0.4

UI library implemented on top of Qt
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// This file is auto-generated by rute_gen. DO NOT EDIT
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#include "../rute_base.h"
#include "../rute_manual.h"
#include <QGradient>
#include "gradient_ffi.h"

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int gradient_get_type(struct RUBase* self_c) {
    WRGradient* qt_value = (WRGradient*)self_c;
    auto ret_value = qt_value->type();
    return s_type_lookup[(int)ret_value];
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void gradient_set_spread(struct RUBase* self_c, int spread) {
    WRGradient* qt_value = (WRGradient*)self_c;
    qt_value->setSpread((QGradient::Spread)s_spread_lookup[spread]);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int gradient_spread(struct RUBase* self_c) {
    WRGradient* qt_value = (WRGradient*)self_c;
    auto ret_value = qt_value->spread();
    return s_spread_lookup[(int)ret_value];
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void gradient_set_color_at(struct RUBase* self_c, float pos, struct RUBase* color) {
    WRGradient* qt_value = (WRGradient*)self_c;
    qt_value->setColorAt(pos, *((QColor*)color));
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int gradient_coordinate_mode(struct RUBase* self_c) {
    WRGradient* qt_value = (WRGradient*)self_c;
    auto ret_value = qt_value->coordinateMode();
    return s_coordinate_mode_lookup[(int)ret_value];
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void gradient_set_coordinate_mode(struct RUBase* self_c, int mode) {
    WRGradient* qt_value = (WRGradient*)self_c;
    qt_value->setCoordinateMode((QGradient::CoordinateMode)s_coordinate_mode_lookup[mode]);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static int gradient_interpolation_mode(struct RUBase* self_c) {
    WRGradient* qt_value = (WRGradient*)self_c;
    auto ret_value = qt_value->interpolationMode();
    return s_interpolation_mode_lookup[(int)ret_value];
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void gradient_set_interpolation_mode(struct RUBase* self_c, int mode) {
    WRGradient* qt_value = (WRGradient*)self_c;
    qt_value->setInterpolationMode((QGradient::InterpolationMode)s_interpolation_mode_lookup[mode]);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static struct RUGradient create_gradient(
    struct RUBase* priv_data,
    RUDeleteCallback delete_callback,
    void* private_user_data)
{
    auto ctl = generic_create_func_with_delete<struct RUGradient, WRGradient>(priv_data, delete_callback, private_user_data);
    ctl.all_funcs = &s_gradient_all_funcs;
    return ctl;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

static void destroy_gradient(struct RUBase* priv_data) {
    destroy_generic<WRGradient>(priv_data);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

struct RUGradientFuncs s_gradient_funcs = {
    destroy_gradient,
    gradient_get_type,
    gradient_set_spread,
    gradient_spread,
    gradient_set_color_at,
    gradient_coordinate_mode,
    gradient_set_coordinate_mode,
    gradient_interpolation_mode,
    gradient_set_interpolation_mode,
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

struct RUGradientAllFuncs s_gradient_all_funcs = {
    &s_gradient_funcs,
};