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 <QLine>
#include "line_ffi.h"

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

static bool line_is_null(struct RUBase* self_c) {
    WRLine* qt_value = (WRLine*)self_c;
    auto ret_value = qt_value->isNull();
    return ret_value;
}

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

static struct RUPoint line_p1(struct RUBase* self_c) {
    WRLine* qt_value = (WRLine*)self_c;
    auto ret_value = qt_value->p1();
    WRPoint* new_val = new WRPoint();
    *new_val = ret_value;
    struct RUPoint ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_point_all_funcs;
    return ctl;
}

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

static struct RUPoint line_p2(struct RUBase* self_c) {
    WRLine* qt_value = (WRLine*)self_c;
    auto ret_value = qt_value->p2();
    WRPoint* new_val = new WRPoint();
    *new_val = ret_value;
    struct RUPoint ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_point_all_funcs;
    return ctl;
}

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

static int line_x1(struct RUBase* self_c) {
    WRLine* qt_value = (WRLine*)self_c;
    auto ret_value = qt_value->x1();
    return ret_value;
}

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

static int line_y1(struct RUBase* self_c) {
    WRLine* qt_value = (WRLine*)self_c;
    auto ret_value = qt_value->y1();
    return ret_value;
}

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

static int line_x2(struct RUBase* self_c) {
    WRLine* qt_value = (WRLine*)self_c;
    auto ret_value = qt_value->x2();
    return ret_value;
}

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

static int line_y2(struct RUBase* self_c) {
    WRLine* qt_value = (WRLine*)self_c;
    auto ret_value = qt_value->y2();
    return ret_value;
}

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

static int line_dx(struct RUBase* self_c) {
    WRLine* qt_value = (WRLine*)self_c;
    auto ret_value = qt_value->dx();
    return ret_value;
}

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

static int line_dy(struct RUBase* self_c) {
    WRLine* qt_value = (WRLine*)self_c;
    auto ret_value = qt_value->dy();
    return ret_value;
}

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

static struct RUPoint line_center(struct RUBase* self_c) {
    WRLine* qt_value = (WRLine*)self_c;
    auto ret_value = qt_value->center();
    WRPoint* new_val = new WRPoint();
    *new_val = ret_value;
    struct RUPoint ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_point_all_funcs;
    return ctl;
}

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

static void line_set_p1(struct RUBase* self_c, struct RUBase* p1) {
    WRLine* qt_value = (WRLine*)self_c;
    qt_value->setP1(*((WRPoint*)p1));
}

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

static void line_set_p2(struct RUBase* self_c, struct RUBase* p2) {
    WRLine* qt_value = (WRLine*)self_c;
    qt_value->setP2(*((WRPoint*)p2));
}

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

static void line_set_points(struct RUBase* self_c, struct RUBase* p1, struct RUBase* p2) {
    WRLine* qt_value = (WRLine*)self_c;
    qt_value->setPoints(*((WRPoint*)p1), *((WRPoint*)p2));
}

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

static void line_set_line(struct RUBase* self_c, int x1, int y1, int x2, int y2) {
    WRLine* qt_value = (WRLine*)self_c;
    qt_value->setLine(x1, y1, x2, y2);
}

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

static struct RULine create_line(
    struct RUBase* priv_data,
    RUDeleteCallback delete_callback,
    void* private_user_data)
{
    auto ctl = generic_create_func_with_delete<struct RULine, WRLine>(priv_data, delete_callback, private_user_data);
    ctl.all_funcs = &s_line_all_funcs;
    return ctl;
}

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

static void destroy_line(struct RUBase* priv_data) {
    destroy_generic<WRLine>(priv_data);
}

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

struct RULineFuncs s_line_funcs = {
    destroy_line,
    line_is_null,
    line_p1,
    line_p2,
    line_x1,
    line_y1,
    line_x2,
    line_y2,
    line_dx,
    line_dy,
    line_center,
    line_set_p1,
    line_set_p2,
    line_set_points,
    line_set_line,
};

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

struct RULineAllFuncs s_line_all_funcs = {
    &s_line_funcs,
};