#include "../rute_base.h"
#include "../rute_manual.h"
#include <QStyle>
#include "style_ffi.h"
static void style_polish(struct RUBase* self_c, struct RUBase* widget) {
WRStyle* qt_value = (WRStyle*)self_c;
qt_value->polish((QWidget*)widget);
}
static void style_unpolish(struct RUBase* self_c, struct RUBase* widget) {
WRStyle* qt_value = (WRStyle*)self_c;
qt_value->unpolish((QWidget*)widget);
}
static void style_polish_2(struct RUBase* self_c, struct RUBase* application) {
WRStyle* qt_value = (WRStyle*)self_c;
qt_value->polish((QApplication*)application);
}
static void style_unpolish_2(struct RUBase* self_c, struct RUBase* application) {
WRStyle* qt_value = (WRStyle*)self_c;
qt_value->unpolish((QApplication*)application);
}
static void style_polish_3(struct RUBase* self_c, struct RUBase* palette) {
WRStyle* qt_value = (WRStyle*)self_c;
qt_value->polish(*((QPalette*)palette));
}
static struct RURect style_item_pixmap_rect(struct RUBase* self_c, struct RUBase* r, int flags, struct RUBase* pixmap) {
WRStyle* qt_value = (WRStyle*)self_c;
auto ret_value = qt_value->itemPixmapRect(*((QRect*)r), flags, *((QPixmap*)pixmap));
WRRect* new_val = new WRRect();
*new_val = ret_value;
struct RURect 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_all_funcs;
return ctl;
}
static void style_draw_item_text(struct RUBase* self_c, struct RUBase* painter, struct RUBase* rect, int flags, struct RUBase* pal, bool enabled, const char* text, int text_role) {
WRStyle* qt_value = (WRStyle*)self_c;
qt_value->drawItemText((QPainter*)painter, *((QRect*)rect), flags, *((QPalette*)pal), enabled, QString::fromUtf8(text), (QPalette::ColorRole)s_color_role_lookup[text_role]);
}
static void style_draw_item_pixmap(struct RUBase* self_c, struct RUBase* painter, struct RUBase* rect, int alignment, struct RUBase* pixmap) {
WRStyle* qt_value = (WRStyle*)self_c;
qt_value->drawItemPixmap((QPainter*)painter, *((QRect*)rect), alignment, *((QPixmap*)pixmap));
}
static struct RUPalette style_standard_palette(struct RUBase* self_c) {
WRStyle* qt_value = (WRStyle*)self_c;
auto ret_value = qt_value->standardPalette();
WRPalette* new_val = new WRPalette();
*new_val = ret_value;
struct RUPalette ctl;
ctl.qt_data = (struct RUBase*)new_val;
ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)new_val];
ctl.all_funcs = &s_palette_all_funcs;
return ctl;
}
static struct RUStyle style_proxy(struct RUBase* self_c) {
WRStyle* qt_value = (WRStyle*)self_c;
auto ret_value = qt_value->proxy();
struct RUStyle ctl;
ctl.qt_data = (struct RUBase*)ret_value;
ctl.host_data = (struct RUBase*)s_host_data_lookup[(void*)ret_value];
ctl.all_funcs = &s_style_all_funcs;
return ctl;
}
struct RUStyleFuncs s_style_funcs = {
style_polish,
style_unpolish,
style_polish_2,
style_unpolish_2,
style_polish_3,
style_item_pixmap_rect,
style_draw_item_text,
style_draw_item_pixmap,
style_standard_palette,
style_proxy,
};
struct RUStyleAllFuncs s_style_all_funcs = {
&s_object_funcs,
&s_style_funcs,
};