miqt/qt/gen_qproxystyle.cpp

280 lines
11 KiB
C++
Raw Normal View History

#include <QApplication>
#include <QFontMetrics>
2024-08-29 07:01:51 +00:00
#include <QIcon>
#include <QMetaObject>
#include <QPainter>
#include <QPalette>
#include <QPixmap>
2024-08-29 07:01:51 +00:00
#include <QPoint>
#include <QProxyStyle>
#include <QRect>
2024-08-29 07:01:51 +00:00
#include <QSize>
#include <QString>
2024-08-29 07:01:51 +00:00
#include <QByteArray>
#include <cstring>
#include <QStyle>
2024-08-29 07:01:51 +00:00
#include <QStyleHintReturn>
#include <QStyleOption>
#include <QStyleOptionComplex>
#include <QWidget>
#include <qproxystyle.h>
2024-08-29 07:01:51 +00:00
#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);
2024-08-29 07:01:51 +00:00
}
void QProxyStyle_DrawControl(const QProxyStyle* self, int element, QStyleOption* option, QPainter* painter) {
self->drawControl(static_cast<QStyle::ControlElement>(element), option, painter);
2024-08-29 07:01:51 +00:00
}
void QProxyStyle_DrawComplexControl(const QProxyStyle* self, int control, QStyleOptionComplex* option, QPainter* painter) {
self->drawComplexControl(static_cast<QStyle::ComplexControl>(control), option, painter);
2024-08-29 07:01:51 +00:00
}
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);
2024-08-29 07:01:51 +00:00
}
void QProxyStyle_DrawItemPixmap(const QProxyStyle* self, QPainter* painter, QRect* rect, int alignment, QPixmap* pixmap) {
self->drawItemPixmap(painter, *rect, static_cast<int>(alignment), *pixmap);
2024-08-29 07:01:51 +00:00
}
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));
2024-08-29 07:01:51 +00:00
}
QRect* QProxyStyle_SubElementRect(const QProxyStyle* self, int element, QStyleOption* option, QWidget* widget) {
return new QRect(self->subElementRect(static_cast<QStyle::SubElement>(element), option, widget));
2024-08-29 07:01:51 +00:00
}
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);
2024-08-29 07:01:51 +00:00
}
int QProxyStyle_StyleHint(const QProxyStyle* self, int hint) {
return self->styleHint(static_cast<QStyle::StyleHint>(hint));
2024-08-29 07:01:51 +00:00
}
int QProxyStyle_PixelMetric(const QProxyStyle* self, int metric) {
return self->pixelMetric(static_cast<QStyle::PixelMetric>(metric));
2024-08-29 07:01:51 +00:00
}
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));
2024-08-29 07:01:51 +00:00
}
QIcon* QProxyStyle_StandardIcon(const QProxyStyle* self, int standardIcon) {
return new QIcon(self->standardIcon(static_cast<QStyle::StandardPixmap>(standardIcon)));
2024-08-29 07:01:51 +00:00
}
QPixmap* QProxyStyle_StandardPixmap(const QProxyStyle* self, int standardPixmap, QStyleOption* opt) {
return new QPixmap(self->standardPixmap(static_cast<QStyle::StandardPixmap>(standardPixmap), opt));
2024-08-29 07:01:51 +00:00
}
QPixmap* QProxyStyle_GeneratedIconPixmap(const QProxyStyle* self, int iconMode, QPixmap* pixmap, QStyleOption* opt) {
return new QPixmap(self->generatedIconPixmap(static_cast<QIcon::Mode>(iconMode), *pixmap, opt));
2024-08-29 07:01:51 +00:00
}
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);
2024-08-29 07:01:51 +00:00
}
void QProxyStyle_DrawControl4(const QProxyStyle* self, int element, QStyleOption* option, QPainter* painter, QWidget* widget) {
self->drawControl(static_cast<QStyle::ControlElement>(element), option, painter, widget);
2024-08-29 07:01:51 +00:00
}
void QProxyStyle_DrawComplexControl4(const QProxyStyle* self, int control, QStyleOptionComplex* option, QPainter* painter, QWidget* widget) {
self->drawComplexControl(static_cast<QStyle::ComplexControl>(control), option, painter, widget);
2024-08-29 07:01:51 +00:00
}
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));
2024-08-29 07:01:51 +00:00
}
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);
2024-08-29 07:01:51 +00:00
}
int QProxyStyle_StyleHint2(const QProxyStyle* self, int hint, QStyleOption* option) {
return self->styleHint(static_cast<QStyle::StyleHint>(hint), option);
2024-08-29 07:01:51 +00:00
}
int QProxyStyle_StyleHint3(const QProxyStyle* self, int hint, QStyleOption* option, QWidget* widget) {
return self->styleHint(static_cast<QStyle::StyleHint>(hint), option, widget);
2024-08-29 07:01:51 +00:00
}
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);
2024-08-29 07:01:51 +00:00
}
int QProxyStyle_PixelMetric2(const QProxyStyle* self, int metric, QStyleOption* option) {
return self->pixelMetric(static_cast<QStyle::PixelMetric>(metric), option);
2024-08-29 07:01:51 +00:00
}
int QProxyStyle_PixelMetric3(const QProxyStyle* self, int metric, QStyleOption* option, QWidget* widget) {
return self->pixelMetric(static_cast<QStyle::PixelMetric>(metric), option, widget);
2024-08-29 07:01:51 +00:00
}
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);
2024-08-29 07:01:51 +00:00
}
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);
2024-08-29 07:01:51 +00:00
}
QIcon* QProxyStyle_StandardIcon2(const QProxyStyle* self, int standardIcon, QStyleOption* option) {
return new QIcon(self->standardIcon(static_cast<QStyle::StandardPixmap>(standardIcon), option));
2024-08-29 07:01:51 +00:00
}
QIcon* QProxyStyle_StandardIcon3(const QProxyStyle* self, int standardIcon, QStyleOption* option, QWidget* widget) {
return new QIcon(self->standardIcon(static_cast<QStyle::StandardPixmap>(standardIcon), option, widget));
2024-08-29 07:01:51 +00:00
}
QPixmap* QProxyStyle_StandardPixmap3(const QProxyStyle* self, int standardPixmap, QStyleOption* opt, QWidget* widget) {
return new QPixmap(self->standardPixmap(static_cast<QStyle::StandardPixmap>(standardPixmap), opt, widget));
2024-08-29 07:01:51 +00:00
}
void QProxyStyle_Delete(QProxyStyle* self) {
delete self;
}