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 <QPointF>
#include "point_f_ffi.h"

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

static float point_f_manhattan_length(struct RUBase* self_c) {
    WRPointF* qt_value = (WRPointF*)self_c;
    auto ret_value = qt_value->manhattanLength();
    return ret_value;
}

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

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

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

static float point_f_x(struct RUBase* self_c) {
    WRPointF* qt_value = (WRPointF*)self_c;
    auto ret_value = qt_value->x();
    return ret_value;
}

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

static float point_f_y(struct RUBase* self_c) {
    WRPointF* qt_value = (WRPointF*)self_c;
    auto ret_value = qt_value->y();
    return ret_value;
}

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

static void point_f_set_x(struct RUBase* self_c, float x) {
    WRPointF* qt_value = (WRPointF*)self_c;
    qt_value->setX(x);
}

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

static void point_f_set_y(struct RUBase* self_c, float y) {
    WRPointF* qt_value = (WRPointF*)self_c;
    qt_value->setY(y);
}

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

static float point_f_rx(struct RUBase* self_c) {
    WRPointF* qt_value = (WRPointF*)self_c;
    auto ret_value = qt_value->rx();
    return ret_value;
}

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

static float point_f_ry(struct RUBase* self_c) {
    WRPointF* qt_value = (WRPointF*)self_c;
    auto ret_value = qt_value->ry();
    return ret_value;
}

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

static float point_f_dot_product(struct RUBase* self_c, struct RUBase* p1, struct RUBase* p2) {
    WRPointF* qt_value = (WRPointF*)self_c;
    auto ret_value = qt_value->dotProduct(*((WRPointF*)p1), *((WRPointF*)p2));
    return ret_value;
}

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

static struct RUPoint point_f_to_point(struct RUBase* self_c) {
    WRPointF* qt_value = (WRPointF*)self_c;
    auto ret_value = qt_value->toPoint();
    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 RUPointF create_point_f(
    struct RUBase* priv_data,
    RUDeleteCallback delete_callback,
    void* private_user_data)
{
    auto ctl = generic_create_func_with_delete<struct RUPointF, WRPointF>(priv_data, delete_callback, private_user_data);
    ctl.all_funcs = &s_point_f_all_funcs;
    return ctl;
}

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

static void destroy_point_f(struct RUBase* priv_data) {
    destroy_generic<WRPointF>(priv_data);
}

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

static struct RUPointF get_point_f(struct RUBase* priv_data) {
    (void)priv_data;
    RUPointF ctl;
    ctl.qt_data = nullptr;
    ctl.host_data = nullptr;
    ctl.all_funcs = &s_point_f_all_funcs;
    return ctl;
}

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

struct RUPointFFuncs s_point_f_funcs = {
    destroy_point_f,
    point_f_manhattan_length,
    point_f_is_null,
    point_f_x,
    point_f_y,
    point_f_set_x,
    point_f_set_y,
    point_f_rx,
    point_f_ry,
    point_f_dot_product,
    point_f_to_point,
};

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

struct RUPointFAllFuncs s_point_f_all_funcs = {
    &s_point_f_funcs,
};