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 <QPainterPath>
#include "painter_path_ffi.h"

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

static void painter_path_swap(struct RUBase* self_c, struct RUBase* other) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->swap(*((QPainterPath*)other));
}

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

static void painter_path_close_subpath(struct RUBase* self_c) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->closeSubpath();
}

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

static void painter_path_move_to(struct RUBase* self_c, struct RUBase* p) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->moveTo(*((QPointF*)p));
}

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

static void painter_path_move_to(struct RUBase* self_c, float x, float y) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->moveTo(x, y);
}

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

static void painter_path_line_to(struct RUBase* self_c, struct RUBase* p) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->lineTo(*((QPointF*)p));
}

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

static void painter_path_line_to(struct RUBase* self_c, float x, float y) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->lineTo(x, y);
}

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

static void painter_path_arc_move_to(struct RUBase* self_c, struct RUBase* rect, float angle) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->arcMoveTo(*((QRectF*)rect), angle);
}

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

static void painter_path_arc_move_to(struct RUBase* self_c, float x, float y, float w, float h, float angle) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->arcMoveTo(x, y, w, h, angle);
}

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

static void painter_path_arc_to(struct RUBase* self_c, struct RUBase* rect, float start_angle, float arc_length) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->arcTo(*((QRectF*)rect), start_angle, arc_length);
}

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

static void painter_path_arc_to(struct RUBase* self_c, float x, float y, float w, float h, float start_angle, float arc_length) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->arcTo(x, y, w, h, start_angle, arc_length);
}

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

static void painter_path_cubic_to(struct RUBase* self_c, struct RUBase* ctrl_pt1, struct RUBase* ctrl_pt2, struct RUBase* end_pt) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->cubicTo(*((QPointF*)ctrl_pt1), *((QPointF*)ctrl_pt2), *((QPointF*)end_pt));
}

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

static void painter_path_cubic_to(struct RUBase* self_c, float ctrl_pt1x, float ctrl_pt1y, float ctrl_pt2x, float ctrl_pt2y, float end_ptx, float end_pty) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->cubicTo(ctrl_pt1x, ctrl_pt1y, ctrl_pt2x, ctrl_pt2y, end_ptx, end_pty);
}

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

static void painter_path_quad_to(struct RUBase* self_c, struct RUBase* ctrl_pt, struct RUBase* end_pt) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->quadTo(*((QPointF*)ctrl_pt), *((QPointF*)end_pt));
}

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

static void painter_path_quad_to(struct RUBase* self_c, float ctrl_ptx, float ctrl_pty, float end_ptx, float end_pty) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->quadTo(ctrl_ptx, ctrl_pty, end_ptx, end_pty);
}

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

static struct RUPointF painter_path_current_position(struct RUBase* self_c) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    auto ret_value = qt_value->currentPosition();
    * new_val = new ();
    *new_val = ret_value;
    struct RUPointF 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_f_all_funcs;
    return ctl;
}

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

static void painter_path_add_rect(struct RUBase* self_c, struct RUBase* rect) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addRect(*((QRectF*)rect));
}

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

static void painter_path_add_rect(struct RUBase* self_c, float x, float y, float w, float h) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addRect(x, y, w, h);
}

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

static void painter_path_add_ellipse(struct RUBase* self_c, struct RUBase* rect) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addEllipse(*((QRectF*)rect));
}

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

static void painter_path_add_ellipse(struct RUBase* self_c, float x, float y, float w, float h) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addEllipse(x, y, w, h);
}

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

static void painter_path_add_ellipse(struct RUBase* self_c, struct RUBase* center, float rx, float ry) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addEllipse(*((QPointF*)center), rx, ry);
}

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

static void painter_path_add_polygon(struct RUBase* self_c, struct RUBase* polygon) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addPolygon(*((QPolygonF*)polygon));
}

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

static void painter_path_add_text(struct RUBase* self_c, struct RUBase* point, struct RUBase* f, const char* text) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addText(*((QPointF*)point), *((QFont*)f), QString::fromUtf8(text));
}

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

static void painter_path_add_text(struct RUBase* self_c, float x, float y, struct RUBase* f, const char* text) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addText(x, y, *((QFont*)f), QString::fromUtf8(text));
}

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

static void painter_path_add_path(struct RUBase* self_c, struct RUBase* path) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addPath(*((QPainterPath*)path));
}

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

static void painter_path_add_region(struct RUBase* self_c, struct RUBase* region) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addRegion(*((QRegion*)region));
}

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

static void painter_path_add_rounded_rect(struct RUBase* self_c, struct RUBase* rect, float x_radius, float y_radius, int mode) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addRoundedRect(*((QRectF*)rect), x_radius, y_radius, (Qt::SizeMode)s_size_mode_lookup[mode]);
}

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

static void painter_path_add_rounded_rect(struct RUBase* self_c, float x, float y, float w, float h, float x_radius, float y_radius, int mode) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addRoundedRect(x, y, w, h, x_radius, y_radius, (Qt::SizeMode)s_size_mode_lookup[mode]);
}

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

static void painter_path_add_round_rect(struct RUBase* self_c, struct RUBase* rect, int x_rnd, int y_rnd) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addRoundRect(*((QRectF*)rect), x_rnd, y_rnd);
}

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

static void painter_path_add_round_rect(struct RUBase* self_c, float x, float y, float w, float h, int x_rnd, int y_rnd) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addRoundRect(x, y, w, h, x_rnd, y_rnd);
}

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

static void painter_path_add_round_rect(struct RUBase* self_c, struct RUBase* rect, int roundness) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addRoundRect(*((QRectF*)rect), roundness);
}

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

static void painter_path_add_round_rect(struct RUBase* self_c, float x, float y, float w, float h, int roundness) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->addRoundRect(x, y, w, h, roundness);
}

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

static void painter_path_connect_path(struct RUBase* self_c, struct RUBase* path) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->connectPath(*((QPainterPath*)path));
}

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

static bool painter_path_contains(struct RUBase* self_c, struct RUBase* pt) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    auto ret_value = qt_value->contains(*((QPointF*)pt));
    return ret_value;
}

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

static bool painter_path_contains(struct RUBase* self_c, struct RUBase* rect) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    auto ret_value = qt_value->contains(*((QRectF*)rect));
    return ret_value;
}

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

static bool painter_path_intersects(struct RUBase* self_c, struct RUBase* rect) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    auto ret_value = qt_value->intersects(*((QRectF*)rect));
    return ret_value;
}

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

static struct RURectF painter_path_bounding_rect(struct RUBase* self_c) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    auto ret_value = qt_value->boundingRect();
    * new_val = new ();
    *new_val = ret_value;
    struct RURectF ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_rect_f_all_funcs;
    return ctl;
}

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

static int painter_path_fill_rule(struct RUBase* self_c) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    auto ret_value = qt_value->fillRule();
    return s_fill_rule_lookup[(int)ret_value];
}

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

static void painter_path_set_fill_rule(struct RUBase* self_c, int fill_rule) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    qt_value->setFillRule((Qt::FillRule)s_fill_rule_lookup[fill_rule]);
}

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

static bool painter_path_is_empty(struct RUBase* self_c) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    auto ret_value = qt_value->isEmpty();
    return ret_value;
}

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

static struct RUPainterPath painter_path_to_reversed(struct RUBase* self_c) {
    WRPainterPath* qt_value = (WRPainterPath*)self_c;
    auto ret_value = qt_value->toReversed();
    WRPainterPath* new_val = new WRPainterPath();
    *new_val = ret_value;
    struct RUPainterPath ctl;
    ctl.qt_data = (struct RUBase*)new_val;
    ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
    ctl.all_funcs = &s_painter_path_all_funcs;
    return ctl;
}

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