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 <QBrush>
#include "brush_ffi.h"

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

static void brush_swap(struct RUBase* self_c, struct RUBase* other) {
    WRBrush* qt_value = (WRBrush*)self_c;
    qt_value->swap(*((QBrush*)other));
}

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

static int brush_style(struct RUBase* self_c) {
    WRBrush* qt_value = (WRBrush*)self_c;
    auto ret_value = qt_value->style();
    return s_brush_style_lookup[(int)ret_value];
}

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

static void brush_set_style(struct RUBase* self_c, int arg0) {
    WRBrush* qt_value = (WRBrush*)self_c;
    qt_value->setStyle((Qt::BrushStyle)s_brush_style_lookup[arg0]);
}

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

static void brush_set_transform(struct RUBase* self_c, struct RUBase* arg0) {
    WRBrush* qt_value = (WRBrush*)self_c;
    qt_value->setTransform(*((QTransform*)arg0));
}

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

static struct RUPixmap brush_texture(struct RUBase* self_c) {
    WRBrush* qt_value = (WRBrush*)self_c;
    auto ret_value = qt_value->texture();
    WRPixmap* new_val = new WRPixmap();
    *new_val = ret_value;
    struct RUPixmap ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_pixmap_all_funcs;
    return ctl;
}

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

static void brush_set_texture(struct RUBase* self_c, struct RUBase* pixmap) {
    WRBrush* qt_value = (WRBrush*)self_c;
    qt_value->setTexture(*((QPixmap*)pixmap));
}

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

static struct RUImage brush_texture_image(struct RUBase* self_c) {
    WRBrush* qt_value = (WRBrush*)self_c;
    auto ret_value = qt_value->textureImage();
    WRImage* new_val = new WRImage();
    *new_val = ret_value;
    struct RUImage ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_image_all_funcs;
    return ctl;
}

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

static void brush_set_texture_image(struct RUBase* self_c, struct RUBase* image) {
    WRBrush* qt_value = (WRBrush*)self_c;
    qt_value->setTextureImage(*((QImage*)image));
}

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

static struct RUColor brush_color(struct RUBase* self_c) {
    WRBrush* qt_value = (WRBrush*)self_c;
    auto ret_value = qt_value->color();
    WRColor* new_val = new WRColor();
    *new_val = ret_value;
    struct RUColor ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_color_all_funcs;
    return ctl;
}

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

static void brush_set_color(struct RUBase* self_c, struct RUBase* color) {
    WRBrush* qt_value = (WRBrush*)self_c;
    qt_value->setColor(*((QColor*)color));
}

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

static void brush_set_color_2(struct RUBase* self_c, int color) {
    WRBrush* qt_value = (WRBrush*)self_c;
    qt_value->setColor((Qt::GlobalColor)s_global_color_lookup[color]);
}

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

static bool brush_is_opaque(struct RUBase* self_c) {
    WRBrush* qt_value = (WRBrush*)self_c;
    auto ret_value = qt_value->isOpaque();
    return ret_value;
}

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

static bool brush_is_detached(struct RUBase* self_c) {
    WRBrush* qt_value = (WRBrush*)self_c;
    auto ret_value = qt_value->isDetached();
    return ret_value;
}

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

static struct RUBrush create_brush(
    struct RUBase* priv_data,
    RUDeleteCallback delete_callback,
    void* private_user_data)
{
    auto ctl = generic_create_func_with_delete<struct RUBrush, WRBrush>(priv_data, delete_callback, private_user_data);
    ctl.all_funcs = &s_brush_all_funcs;
    return ctl;
}

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

static void destroy_brush(struct RUBase* priv_data) {
    destroy_generic<WRBrush>(priv_data);
}

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

struct RUBrushFuncs s_brush_funcs = {
    destroy_brush,
    brush_swap,
    brush_style,
    brush_set_style,
    brush_set_transform,
    brush_texture,
    brush_set_texture,
    brush_texture_image,
    brush_set_texture_image,
    brush_color,
    brush_set_color,
    brush_set_color_2,
    brush_is_opaque,
    brush_is_detached,
};

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

struct RUBrushAllFuncs s_brush_all_funcs = {
    &s_brush_funcs,
};