#include "../rute_base.h"
#include "../rute_manual.h"
#include <QPolygonF>
#include "polygon_f_ffi.h"
static void polygon_f_swap(struct RUBase* self_c, struct RUBase* other) {
WRPolygonF* qt_value = (WRPolygonF*)self_c;
qt_value->swap(*((QPolygonF*)other));
}
static struct RUPolygon polygon_f_to_polygon(struct RUBase* self_c) {
WRPolygonF* qt_value = (WRPolygonF*)self_c;
auto ret_value = qt_value->toPolygon();
WRPolygon* new_val = new WRPolygon();
*new_val = ret_value;
struct RUPolygon ctl;
ctl.qt_data = (struct RUBase*)new_val;
ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
ctl.all_funcs = &s_polygon_all_funcs;
return ctl;
}
static bool polygon_f_is_closed(struct RUBase* self_c) {
WRPolygonF* qt_value = (WRPolygonF*)self_c;
auto ret_value = qt_value->isClosed();
return ret_value;
}
static struct RURectF polygon_f_bounding_rect(struct RUBase* self_c) {
WRPolygonF* qt_value = (WRPolygonF*)self_c;
auto ret_value = qt_value->boundingRect();
WRRectF* new_val = new WRRectF();
*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 bool polygon_f_contains_point(struct RUBase* self_c, struct RUBase* pt, int fill_rule) {
WRPolygonF* qt_value = (WRPolygonF*)self_c;
auto ret_value = qt_value->containsPoint(*((QPointF*)pt), (Qt::FillRule)s_fill_rule_lookup[fill_rule]);
return ret_value;
}
static struct RUPolygonF polygon_f_united(struct RUBase* self_c, struct RUBase* r) {
WRPolygonF* qt_value = (WRPolygonF*)self_c;
auto ret_value = qt_value->united(*((QPolygonF*)r));
WRPolygonF* new_val = new WRPolygonF();
*new_val = ret_value;
struct RUPolygonF ctl;
ctl.qt_data = (struct RUBase*)new_val;
ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
ctl.all_funcs = &s_polygon_f_all_funcs;
return ctl;
}
static struct RUPolygonF polygon_f_intersected(struct RUBase* self_c, struct RUBase* r) {
WRPolygonF* qt_value = (WRPolygonF*)self_c;
auto ret_value = qt_value->intersected(*((QPolygonF*)r));
WRPolygonF* new_val = new WRPolygonF();
*new_val = ret_value;
struct RUPolygonF ctl;
ctl.qt_data = (struct RUBase*)new_val;
ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
ctl.all_funcs = &s_polygon_f_all_funcs;
return ctl;
}
static bool polygon_f_intersects(struct RUBase* self_c, struct RUBase* r) {
WRPolygonF* qt_value = (WRPolygonF*)self_c;
auto ret_value = qt_value->intersects(*((QPolygonF*)r));
return ret_value;
}
static struct RUPolygonF create_polygon_f(
struct RUBase* priv_data,
RUDeleteCallback delete_callback,
void* private_user_data)
{
auto ctl = generic_create_func_with_delete<struct RUPolygonF, WRPolygonF>(priv_data, delete_callback, private_user_data);
ctl.all_funcs = &s_polygon_f_all_funcs;
return ctl;
}
static void destroy_polygon_f(struct RUBase* priv_data) {
destroy_generic<WRPolygonF>(priv_data);
}
struct RUPolygonFFuncs s_polygon_f_funcs = {
destroy_polygon_f,
polygon_f_swap,
polygon_f_to_polygon,
polygon_f_is_closed,
polygon_f_bounding_rect,
polygon_f_contains_point,
polygon_f_united,
polygon_f_intersected,
polygon_f_intersects,
};
struct RUPolygonFAllFuncs s_polygon_f_all_funcs = {
&s_polygon_f_funcs,
};