#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "qproxystyle.h" #include "gen_qproxystyle.h" extern "C" { extern void miqt_exec_callback(void* cb, int argc, void* argv); } QProxyStyle* QProxyStyle_new() { return new QProxyStyle(); } QProxyStyle* QProxyStyle_new2(const char* key, size_t key_Strlen) { QString key_QString = QString::fromUtf8(key, key_Strlen); return new QProxyStyle(key_QString); } QProxyStyle* QProxyStyle_new3(QStyle* style) { return new QProxyStyle(style); } QMetaObject* QProxyStyle_MetaObject(QProxyStyle* self) { return (QMetaObject*) const_cast(self)->metaObject(); } void QProxyStyle_Tr(const char* s, char** _out, int* _out_Strlen) { QString ret = QProxyStyle::tr(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QProxyStyle_TrUtf8(const char* s, char** _out, int* _out_Strlen) { QString ret = QProxyStyle::trUtf8(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } QStyle* QProxyStyle_BaseStyle(QProxyStyle* self) { return const_cast(self)->baseStyle(); } void QProxyStyle_SetBaseStyle(QProxyStyle* self, QStyle* style) { self->setBaseStyle(style); } void QProxyStyle_DrawPrimitive(QProxyStyle* self, uintptr_t element, QStyleOption* option, QPainter* painter) { const_cast(self)->drawPrimitive(static_cast(element), option, painter); } void QProxyStyle_DrawControl(QProxyStyle* self, uintptr_t element, QStyleOption* option, QPainter* painter) { const_cast(self)->drawControl(static_cast(element), option, painter); } void QProxyStyle_DrawComplexControl(QProxyStyle* self, uintptr_t control, QStyleOptionComplex* option, QPainter* painter) { const_cast(self)->drawComplexControl(static_cast(control), option, painter); } void QProxyStyle_DrawItemText(QProxyStyle* self, QPainter* painter, QRect* rect, int flags, QPalette* pal, bool enabled, const char* text, size_t text_Strlen) { QString text_QString = QString::fromUtf8(text, text_Strlen); const_cast(self)->drawItemText(painter, *rect, static_cast(flags), *pal, enabled, text_QString); } void QProxyStyle_DrawItemPixmap(QProxyStyle* self, QPainter* painter, QRect* rect, int alignment, QPixmap* pixmap) { const_cast(self)->drawItemPixmap(painter, *rect, static_cast(alignment), *pixmap); } QSize* QProxyStyle_SizeFromContents(QProxyStyle* self, uintptr_t typeVal, QStyleOption* option, QSize* size, QWidget* widget) { QSize ret = const_cast(self)->sizeFromContents(static_cast(typeVal), option, *size, widget); // Copy-construct value returned type into heap-allocated copy return static_cast(new QSize(ret)); } QRect* QProxyStyle_SubElementRect(QProxyStyle* self, uintptr_t element, QStyleOption* option, QWidget* widget) { QRect ret = const_cast(self)->subElementRect(static_cast(element), option, widget); // Copy-construct value returned type into heap-allocated copy return static_cast(new QRect(ret)); } QRect* QProxyStyle_SubControlRect(QProxyStyle* self, uintptr_t cc, QStyleOptionComplex* opt, uintptr_t sc, QWidget* widget) { QRect ret = const_cast(self)->subControlRect(static_cast(cc), opt, static_cast(sc), widget); // Copy-construct value returned type into heap-allocated copy return static_cast(new QRect(ret)); } QRect* QProxyStyle_ItemTextRect(QProxyStyle* self, QFontMetrics* fm, QRect* r, int flags, bool enabled, const char* text, size_t text_Strlen) { QString text_QString = QString::fromUtf8(text, text_Strlen); QRect ret = const_cast(self)->itemTextRect(*fm, *r, static_cast(flags), enabled, text_QString); // Copy-construct value returned type into heap-allocated copy return static_cast(new QRect(ret)); } QRect* QProxyStyle_ItemPixmapRect(QProxyStyle* self, QRect* r, int flags, QPixmap* pixmap) { QRect ret = const_cast(self)->itemPixmapRect(*r, static_cast(flags), *pixmap); // Copy-construct value returned type into heap-allocated copy return static_cast(new QRect(ret)); } uintptr_t QProxyStyle_HitTestComplexControl(QProxyStyle* self, uintptr_t control, QStyleOptionComplex* option, QPoint* pos) { QStyle::SubControl ret = const_cast(self)->hitTestComplexControl(static_cast(control), option, *pos); return static_cast(ret); } int QProxyStyle_StyleHint(QProxyStyle* self, uintptr_t hint) { return const_cast(self)->styleHint(static_cast(hint)); } int QProxyStyle_PixelMetric(QProxyStyle* self, uintptr_t metric) { return const_cast(self)->pixelMetric(static_cast(metric)); } int QProxyStyle_LayoutSpacing(QProxyStyle* self, uintptr_t control1, uintptr_t control2, uintptr_t orientation) { return const_cast(self)->layoutSpacing(static_cast(control1), static_cast(control2), static_cast(orientation)); } QIcon* QProxyStyle_StandardIcon(QProxyStyle* self, uintptr_t standardIcon) { QIcon ret = const_cast(self)->standardIcon(static_cast(standardIcon)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QIcon(ret)); } QPixmap* QProxyStyle_StandardPixmap(QProxyStyle* self, uintptr_t standardPixmap, QStyleOption* opt) { QPixmap ret = const_cast(self)->standardPixmap(static_cast(standardPixmap), opt); // Copy-construct value returned type into heap-allocated copy return static_cast(new QPixmap(ret)); } QPixmap* QProxyStyle_GeneratedIconPixmap(QProxyStyle* self, uintptr_t iconMode, QPixmap* pixmap, QStyleOption* opt) { QPixmap ret = const_cast(self)->generatedIconPixmap(static_cast(iconMode), *pixmap, opt); // Copy-construct value returned type into heap-allocated copy return static_cast(new QPixmap(ret)); } QPalette* QProxyStyle_StandardPalette(QProxyStyle* self) { QPalette ret = const_cast(self)->standardPalette(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QPalette(ret)); } void QProxyStyle_Polish(QProxyStyle* self, QWidget* widget) { self->polish(widget); } void QProxyStyle_PolishWithPal(QProxyStyle* self, QPalette* pal) { self->polish(*pal); } void QProxyStyle_PolishWithApp(QProxyStyle* self, QApplication* app) { self->polish(app); } void QProxyStyle_Unpolish(QProxyStyle* self, QWidget* widget) { self->unpolish(widget); } void QProxyStyle_UnpolishWithApp(QProxyStyle* self, QApplication* app) { self->unpolish(app); } void QProxyStyle_Tr2(const char* s, const char* c, char** _out, int* _out_Strlen) { QString ret = QProxyStyle::tr(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QProxyStyle_Tr3(const char* s, const char* c, int n, char** _out, int* _out_Strlen) { QString ret = QProxyStyle::tr(s, c, static_cast(n)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QProxyStyle_TrUtf82(const char* s, const char* c, char** _out, int* _out_Strlen) { QString ret = QProxyStyle::trUtf8(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QProxyStyle_TrUtf83(const char* s, const char* c, int n, char** _out, int* _out_Strlen) { QString ret = QProxyStyle::trUtf8(s, c, static_cast(n)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QProxyStyle_DrawPrimitive4(QProxyStyle* self, uintptr_t element, QStyleOption* option, QPainter* painter, QWidget* widget) { const_cast(self)->drawPrimitive(static_cast(element), option, painter, widget); } void QProxyStyle_DrawControl4(QProxyStyle* self, uintptr_t element, QStyleOption* option, QPainter* painter, QWidget* widget) { const_cast(self)->drawControl(static_cast(element), option, painter, widget); } void QProxyStyle_DrawComplexControl4(QProxyStyle* self, uintptr_t control, QStyleOptionComplex* option, QPainter* painter, QWidget* widget) { const_cast(self)->drawComplexControl(static_cast(control), option, painter, widget); } void QProxyStyle_DrawItemText7(QProxyStyle* self, QPainter* painter, QRect* rect, int flags, QPalette* pal, bool enabled, const char* text, size_t text_Strlen, uintptr_t textRole) { QString text_QString = QString::fromUtf8(text, text_Strlen); const_cast(self)->drawItemText(painter, *rect, static_cast(flags), *pal, enabled, text_QString, static_cast(textRole)); } uintptr_t QProxyStyle_HitTestComplexControl4(QProxyStyle* self, uintptr_t control, QStyleOptionComplex* option, QPoint* pos, QWidget* widget) { QStyle::SubControl ret = const_cast(self)->hitTestComplexControl(static_cast(control), option, *pos, widget); return static_cast(ret); } int QProxyStyle_StyleHint2(QProxyStyle* self, uintptr_t hint, QStyleOption* option) { return const_cast(self)->styleHint(static_cast(hint), option); } int QProxyStyle_StyleHint3(QProxyStyle* self, uintptr_t hint, QStyleOption* option, QWidget* widget) { return const_cast(self)->styleHint(static_cast(hint), option, widget); } int QProxyStyle_StyleHint4(QProxyStyle* self, uintptr_t hint, QStyleOption* option, QWidget* widget, QStyleHintReturn* returnData) { return const_cast(self)->styleHint(static_cast(hint), option, widget, returnData); } int QProxyStyle_PixelMetric2(QProxyStyle* self, uintptr_t metric, QStyleOption* option) { return const_cast(self)->pixelMetric(static_cast(metric), option); } int QProxyStyle_PixelMetric3(QProxyStyle* self, uintptr_t metric, QStyleOption* option, QWidget* widget) { return const_cast(self)->pixelMetric(static_cast(metric), option, widget); } int QProxyStyle_LayoutSpacing4(QProxyStyle* self, uintptr_t control1, uintptr_t control2, uintptr_t orientation, QStyleOption* option) { return const_cast(self)->layoutSpacing(static_cast(control1), static_cast(control2), static_cast(orientation), option); } int QProxyStyle_LayoutSpacing5(QProxyStyle* self, uintptr_t control1, uintptr_t control2, uintptr_t orientation, QStyleOption* option, QWidget* widget) { return const_cast(self)->layoutSpacing(static_cast(control1), static_cast(control2), static_cast(orientation), option, widget); } QIcon* QProxyStyle_StandardIcon2(QProxyStyle* self, uintptr_t standardIcon, QStyleOption* option) { QIcon ret = const_cast(self)->standardIcon(static_cast(standardIcon), option); // Copy-construct value returned type into heap-allocated copy return static_cast(new QIcon(ret)); } QIcon* QProxyStyle_StandardIcon3(QProxyStyle* self, uintptr_t standardIcon, QStyleOption* option, QWidget* widget) { QIcon ret = const_cast(self)->standardIcon(static_cast(standardIcon), option, widget); // Copy-construct value returned type into heap-allocated copy return static_cast(new QIcon(ret)); } QPixmap* QProxyStyle_StandardPixmap3(QProxyStyle* self, uintptr_t standardPixmap, QStyleOption* opt, QWidget* widget) { QPixmap ret = const_cast(self)->standardPixmap(static_cast(standardPixmap), opt, widget); // Copy-construct value returned type into heap-allocated copy return static_cast(new QPixmap(ret)); } void QProxyStyle_Delete(QProxyStyle* self) { delete self; }