mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 08:58:37 +00:00
280 lines
11 KiB
C++
280 lines
11 KiB
C++
#include <QApplication>
|
|
#include <QFontMetrics>
|
|
#include <QIcon>
|
|
#include <QMetaObject>
|
|
#include <QPainter>
|
|
#include <QPalette>
|
|
#include <QPixmap>
|
|
#include <QPoint>
|
|
#include <QProxyStyle>
|
|
#include <QRect>
|
|
#include <QSize>
|
|
#include <QString>
|
|
#include <QByteArray>
|
|
#include <cstring>
|
|
#include <QStyle>
|
|
#include <QStyleHintReturn>
|
|
#include <QStyleOption>
|
|
#include <QStyleOptionComplex>
|
|
#include <QWidget>
|
|
#include <qproxystyle.h>
|
|
#include "gen_qproxystyle.h"
|
|
#include "_cgo_export.h"
|
|
|
|
QProxyStyle* QProxyStyle_new() {
|
|
return new QProxyStyle();
|
|
}
|
|
|
|
QProxyStyle* QProxyStyle_new2(struct miqt_string key) {
|
|
QString key_QString = QString::fromUtf8(key.data, key.len);
|
|
return new QProxyStyle(key_QString);
|
|
}
|
|
|
|
QProxyStyle* QProxyStyle_new3(QStyle* style) {
|
|
return new QProxyStyle(style);
|
|
}
|
|
|
|
QMetaObject* QProxyStyle_MetaObject(const QProxyStyle* self) {
|
|
return (QMetaObject*) self->metaObject();
|
|
}
|
|
|
|
void* QProxyStyle_Metacast(QProxyStyle* self, const char* param1) {
|
|
return self->qt_metacast(param1);
|
|
}
|
|
|
|
struct miqt_string QProxyStyle_Tr(const char* s) {
|
|
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();
|
|
struct miqt_string _ms;
|
|
_ms.len = _b.length();
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
return _ms;
|
|
}
|
|
|
|
struct miqt_string QProxyStyle_TrUtf8(const char* s) {
|
|
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();
|
|
struct miqt_string _ms;
|
|
_ms.len = _b.length();
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
return _ms;
|
|
}
|
|
|
|
QStyle* QProxyStyle_BaseStyle(const QProxyStyle* self) {
|
|
return self->baseStyle();
|
|
}
|
|
|
|
void QProxyStyle_SetBaseStyle(QProxyStyle* self, QStyle* style) {
|
|
self->setBaseStyle(style);
|
|
}
|
|
|
|
void QProxyStyle_DrawPrimitive(const QProxyStyle* self, int element, QStyleOption* option, QPainter* painter) {
|
|
self->drawPrimitive(static_cast<QStyle::PrimitiveElement>(element), option, painter);
|
|
}
|
|
|
|
void QProxyStyle_DrawControl(const QProxyStyle* self, int element, QStyleOption* option, QPainter* painter) {
|
|
self->drawControl(static_cast<QStyle::ControlElement>(element), option, painter);
|
|
}
|
|
|
|
void QProxyStyle_DrawComplexControl(const QProxyStyle* self, int control, QStyleOptionComplex* option, QPainter* painter) {
|
|
self->drawComplexControl(static_cast<QStyle::ComplexControl>(control), option, painter);
|
|
}
|
|
|
|
void QProxyStyle_DrawItemText(const QProxyStyle* self, QPainter* painter, QRect* rect, int flags, QPalette* pal, bool enabled, struct miqt_string text) {
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
|
self->drawItemText(painter, *rect, static_cast<int>(flags), *pal, enabled, text_QString);
|
|
}
|
|
|
|
void QProxyStyle_DrawItemPixmap(const QProxyStyle* self, QPainter* painter, QRect* rect, int alignment, QPixmap* pixmap) {
|
|
self->drawItemPixmap(painter, *rect, static_cast<int>(alignment), *pixmap);
|
|
}
|
|
|
|
QSize* QProxyStyle_SizeFromContents(const QProxyStyle* self, int typeVal, QStyleOption* option, QSize* size, QWidget* widget) {
|
|
return new QSize(self->sizeFromContents(static_cast<QStyle::ContentsType>(typeVal), option, *size, widget));
|
|
}
|
|
|
|
QRect* QProxyStyle_SubElementRect(const QProxyStyle* self, int element, QStyleOption* option, QWidget* widget) {
|
|
return new QRect(self->subElementRect(static_cast<QStyle::SubElement>(element), option, widget));
|
|
}
|
|
|
|
QRect* QProxyStyle_SubControlRect(const QProxyStyle* self, int cc, QStyleOptionComplex* opt, int sc, QWidget* widget) {
|
|
return new QRect(self->subControlRect(static_cast<QStyle::ComplexControl>(cc), opt, static_cast<QStyle::SubControl>(sc), widget));
|
|
}
|
|
|
|
QRect* QProxyStyle_ItemTextRect(const QProxyStyle* self, QFontMetrics* fm, QRect* r, int flags, bool enabled, struct miqt_string text) {
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
|
return new QRect(self->itemTextRect(*fm, *r, static_cast<int>(flags), enabled, text_QString));
|
|
}
|
|
|
|
QRect* QProxyStyle_ItemPixmapRect(const QProxyStyle* self, QRect* r, int flags, QPixmap* pixmap) {
|
|
return new QRect(self->itemPixmapRect(*r, static_cast<int>(flags), *pixmap));
|
|
}
|
|
|
|
int QProxyStyle_HitTestComplexControl(const QProxyStyle* self, int control, QStyleOptionComplex* option, QPoint* pos) {
|
|
QStyle::SubControl _ret = self->hitTestComplexControl(static_cast<QStyle::ComplexControl>(control), option, *pos);
|
|
return static_cast<int>(_ret);
|
|
}
|
|
|
|
int QProxyStyle_StyleHint(const QProxyStyle* self, int hint) {
|
|
return self->styleHint(static_cast<QStyle::StyleHint>(hint));
|
|
}
|
|
|
|
int QProxyStyle_PixelMetric(const QProxyStyle* self, int metric) {
|
|
return self->pixelMetric(static_cast<QStyle::PixelMetric>(metric));
|
|
}
|
|
|
|
int QProxyStyle_LayoutSpacing(const QProxyStyle* self, int control1, int control2, int orientation) {
|
|
return self->layoutSpacing(static_cast<QSizePolicy::ControlType>(control1), static_cast<QSizePolicy::ControlType>(control2), static_cast<Qt::Orientation>(orientation));
|
|
}
|
|
|
|
QIcon* QProxyStyle_StandardIcon(const QProxyStyle* self, int standardIcon) {
|
|
return new QIcon(self->standardIcon(static_cast<QStyle::StandardPixmap>(standardIcon)));
|
|
}
|
|
|
|
QPixmap* QProxyStyle_StandardPixmap(const QProxyStyle* self, int standardPixmap, QStyleOption* opt) {
|
|
return new QPixmap(self->standardPixmap(static_cast<QStyle::StandardPixmap>(standardPixmap), opt));
|
|
}
|
|
|
|
QPixmap* QProxyStyle_GeneratedIconPixmap(const QProxyStyle* self, int iconMode, QPixmap* pixmap, QStyleOption* opt) {
|
|
return new QPixmap(self->generatedIconPixmap(static_cast<QIcon::Mode>(iconMode), *pixmap, opt));
|
|
}
|
|
|
|
QPalette* QProxyStyle_StandardPalette(const QProxyStyle* self) {
|
|
return new QPalette(self->standardPalette());
|
|
}
|
|
|
|
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);
|
|
}
|
|
|
|
struct miqt_string QProxyStyle_Tr2(const char* s, const char* c) {
|
|
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();
|
|
struct miqt_string _ms;
|
|
_ms.len = _b.length();
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
return _ms;
|
|
}
|
|
|
|
struct miqt_string QProxyStyle_Tr3(const char* s, const char* c, int n) {
|
|
QString _ret = QProxyStyle::tr(s, c, static_cast<int>(n));
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
QByteArray _b = _ret.toUtf8();
|
|
struct miqt_string _ms;
|
|
_ms.len = _b.length();
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
return _ms;
|
|
}
|
|
|
|
struct miqt_string QProxyStyle_TrUtf82(const char* s, const char* c) {
|
|
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();
|
|
struct miqt_string _ms;
|
|
_ms.len = _b.length();
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
return _ms;
|
|
}
|
|
|
|
struct miqt_string QProxyStyle_TrUtf83(const char* s, const char* c, int n) {
|
|
QString _ret = QProxyStyle::trUtf8(s, c, static_cast<int>(n));
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
QByteArray _b = _ret.toUtf8();
|
|
struct miqt_string _ms;
|
|
_ms.len = _b.length();
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
return _ms;
|
|
}
|
|
|
|
void QProxyStyle_DrawPrimitive4(const QProxyStyle* self, int element, QStyleOption* option, QPainter* painter, QWidget* widget) {
|
|
self->drawPrimitive(static_cast<QStyle::PrimitiveElement>(element), option, painter, widget);
|
|
}
|
|
|
|
void QProxyStyle_DrawControl4(const QProxyStyle* self, int element, QStyleOption* option, QPainter* painter, QWidget* widget) {
|
|
self->drawControl(static_cast<QStyle::ControlElement>(element), option, painter, widget);
|
|
}
|
|
|
|
void QProxyStyle_DrawComplexControl4(const QProxyStyle* self, int control, QStyleOptionComplex* option, QPainter* painter, QWidget* widget) {
|
|
self->drawComplexControl(static_cast<QStyle::ComplexControl>(control), option, painter, widget);
|
|
}
|
|
|
|
void QProxyStyle_DrawItemText7(const QProxyStyle* self, QPainter* painter, QRect* rect, int flags, QPalette* pal, bool enabled, struct miqt_string text, int textRole) {
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
|
self->drawItemText(painter, *rect, static_cast<int>(flags), *pal, enabled, text_QString, static_cast<QPalette::ColorRole>(textRole));
|
|
}
|
|
|
|
int QProxyStyle_HitTestComplexControl4(const QProxyStyle* self, int control, QStyleOptionComplex* option, QPoint* pos, QWidget* widget) {
|
|
QStyle::SubControl _ret = self->hitTestComplexControl(static_cast<QStyle::ComplexControl>(control), option, *pos, widget);
|
|
return static_cast<int>(_ret);
|
|
}
|
|
|
|
int QProxyStyle_StyleHint2(const QProxyStyle* self, int hint, QStyleOption* option) {
|
|
return self->styleHint(static_cast<QStyle::StyleHint>(hint), option);
|
|
}
|
|
|
|
int QProxyStyle_StyleHint3(const QProxyStyle* self, int hint, QStyleOption* option, QWidget* widget) {
|
|
return self->styleHint(static_cast<QStyle::StyleHint>(hint), option, widget);
|
|
}
|
|
|
|
int QProxyStyle_StyleHint4(const QProxyStyle* self, int hint, QStyleOption* option, QWidget* widget, QStyleHintReturn* returnData) {
|
|
return self->styleHint(static_cast<QStyle::StyleHint>(hint), option, widget, returnData);
|
|
}
|
|
|
|
int QProxyStyle_PixelMetric2(const QProxyStyle* self, int metric, QStyleOption* option) {
|
|
return self->pixelMetric(static_cast<QStyle::PixelMetric>(metric), option);
|
|
}
|
|
|
|
int QProxyStyle_PixelMetric3(const QProxyStyle* self, int metric, QStyleOption* option, QWidget* widget) {
|
|
return self->pixelMetric(static_cast<QStyle::PixelMetric>(metric), option, widget);
|
|
}
|
|
|
|
int QProxyStyle_LayoutSpacing4(const QProxyStyle* self, int control1, int control2, int orientation, QStyleOption* option) {
|
|
return self->layoutSpacing(static_cast<QSizePolicy::ControlType>(control1), static_cast<QSizePolicy::ControlType>(control2), static_cast<Qt::Orientation>(orientation), option);
|
|
}
|
|
|
|
int QProxyStyle_LayoutSpacing5(const QProxyStyle* self, int control1, int control2, int orientation, QStyleOption* option, QWidget* widget) {
|
|
return self->layoutSpacing(static_cast<QSizePolicy::ControlType>(control1), static_cast<QSizePolicy::ControlType>(control2), static_cast<Qt::Orientation>(orientation), option, widget);
|
|
}
|
|
|
|
QIcon* QProxyStyle_StandardIcon2(const QProxyStyle* self, int standardIcon, QStyleOption* option) {
|
|
return new QIcon(self->standardIcon(static_cast<QStyle::StandardPixmap>(standardIcon), option));
|
|
}
|
|
|
|
QIcon* QProxyStyle_StandardIcon3(const QProxyStyle* self, int standardIcon, QStyleOption* option, QWidget* widget) {
|
|
return new QIcon(self->standardIcon(static_cast<QStyle::StandardPixmap>(standardIcon), option, widget));
|
|
}
|
|
|
|
QPixmap* QProxyStyle_StandardPixmap3(const QProxyStyle* self, int standardPixmap, QStyleOption* opt, QWidget* widget) {
|
|
return new QPixmap(self->standardPixmap(static_cast<QStyle::StandardPixmap>(standardPixmap), opt, widget));
|
|
}
|
|
|
|
void QProxyStyle_Delete(QProxyStyle* self) {
|
|
delete self;
|
|
}
|
|
|