rute 0.0.6

UI library implemented on top of Qt
Documentation
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// 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 uint32_t gradient_get_type(struct RUBase* self_c) {
    WRGradient* qt_value = (WRGradient*)self_c;
    auto ret_value = qt_value->type();
    return (uint32_t)ret_value;
}

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

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

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

static uint32_t gradient_spread(struct RUBase* self_c) {
    WRGradient* qt_value = (WRGradient*)self_c;
    auto ret_value = qt_value->spread();
    return (uint32_t)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, *((WRColor*)color));
}

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

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

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

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

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

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

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

static void gradient_set_interpolation_mode(struct RUBase* self_c, uint32_t mode) {
    WRGradient* qt_value = (WRGradient*)self_c;
    qt_value->setInterpolationMode((QGradient::InterpolationMode)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,
};