miqt/qt/gen_qiconengine.cpp

151 lines
5.5 KiB
C++
Raw Permalink Normal View History

#include <QDataStream>
#include <QIconEngine>
2024-08-29 07:01:51 +00:00
#define WORKAROUND_INNER_CLASS_DEFINITION_QIconEngine__AvailableSizesArgument
#define WORKAROUND_INNER_CLASS_DEFINITION_QIconEngine__ScaledPixmapArgument
#include <QList>
#include <QPainter>
#include <QPixmap>
#include <QRect>
#include <QSize>
#include <QString>
2024-08-29 07:01:51 +00:00
#include <QByteArray>
#include <cstring>
#include <qiconengine.h>
2024-08-29 07:01:51 +00:00
#include "gen_qiconengine.h"
#include "_cgo_export.h"
void QIconEngine_Paint(QIconEngine* self, QPainter* painter, QRect* rect, int mode, int state) {
2024-08-29 07:01:51 +00:00
self->paint(painter, *rect, static_cast<QIcon::Mode>(mode), static_cast<QIcon::State>(state));
}
QSize* QIconEngine_ActualSize(QIconEngine* self, QSize* size, int mode, int state) {
return new QSize(self->actualSize(*size, static_cast<QIcon::Mode>(mode), static_cast<QIcon::State>(state)));
2024-08-29 07:01:51 +00:00
}
QPixmap* QIconEngine_Pixmap(QIconEngine* self, QSize* size, int mode, int state) {
return new QPixmap(self->pixmap(*size, static_cast<QIcon::Mode>(mode), static_cast<QIcon::State>(state)));
2024-08-29 07:01:51 +00:00
}
void QIconEngine_AddPixmap(QIconEngine* self, QPixmap* pixmap, int mode, int state) {
2024-08-29 07:01:51 +00:00
self->addPixmap(*pixmap, static_cast<QIcon::Mode>(mode), static_cast<QIcon::State>(state));
}
void QIconEngine_AddFile(QIconEngine* self, struct miqt_string fileName, QSize* size, int mode, int state) {
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
2024-08-29 07:01:51 +00:00
self->addFile(fileName_QString, *size, static_cast<QIcon::Mode>(mode), static_cast<QIcon::State>(state));
}
struct miqt_string QIconEngine_Key(const QIconEngine* self) {
QString _ret = self->key();
// 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;
}
QIconEngine* QIconEngine_Clone(const QIconEngine* self) {
return self->clone();
}
bool QIconEngine_Read(QIconEngine* self, QDataStream* in) {
return self->read(*in);
}
bool QIconEngine_Write(const QIconEngine* self, QDataStream* out) {
return self->write(*out);
2024-08-29 07:01:51 +00:00
}
struct miqt_array* QIconEngine_AvailableSizes(const QIconEngine* self) {
QList<QSize> _ret = self->availableSizes();
// Convert QList<> from C++ memory to manually-managed C memory
QSize** _arr = static_cast<QSize**>(malloc(sizeof(QSize*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
_arr[i] = new QSize(_ret[i]);
2024-08-29 07:01:51 +00:00
}
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
_out->len = _ret.length();
_out->data = static_cast<void*>(_arr);
return _out;
}
struct miqt_string QIconEngine_IconName(const QIconEngine* self) {
QString _ret = self->iconName();
// 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;
}
bool QIconEngine_IsNull(const QIconEngine* self) {
return self->isNull();
2024-08-29 07:01:51 +00:00
}
QPixmap* QIconEngine_ScaledPixmap(QIconEngine* self, QSize* size, int mode, int state, double scale) {
return new QPixmap(self->scaledPixmap(*size, static_cast<QIcon::Mode>(mode), static_cast<QIcon::State>(state), static_cast<qreal>(scale)));
2024-08-29 07:01:51 +00:00
}
void QIconEngine_VirtualHook(QIconEngine* self, int id, void* data) {
self->virtual_hook(static_cast<int>(id), data);
}
struct miqt_array* QIconEngine_AvailableSizes1(const QIconEngine* self, int mode) {
QList<QSize> _ret = self->availableSizes(static_cast<QIcon::Mode>(mode));
// Convert QList<> from C++ memory to manually-managed C memory
QSize** _arr = static_cast<QSize**>(malloc(sizeof(QSize*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
_arr[i] = new QSize(_ret[i]);
2024-08-29 07:01:51 +00:00
}
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
_out->len = _ret.length();
_out->data = static_cast<void*>(_arr);
return _out;
2024-08-29 07:01:51 +00:00
}
struct miqt_array* QIconEngine_AvailableSizes2(const QIconEngine* self, int mode, int state) {
QList<QSize> _ret = self->availableSizes(static_cast<QIcon::Mode>(mode), static_cast<QIcon::State>(state));
// Convert QList<> from C++ memory to manually-managed C memory
QSize** _arr = static_cast<QSize**>(malloc(sizeof(QSize*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
_arr[i] = new QSize(_ret[i]);
2024-08-29 07:01:51 +00:00
}
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
_out->len = _ret.length();
_out->data = static_cast<void*>(_arr);
return _out;
}
void QIconEngine_Delete(QIconEngine* self) {
delete self;
}
2024-08-29 07:01:51 +00:00
QIconEngine__AvailableSizesArgument* QIconEngine__AvailableSizesArgument_new(QIconEngine__AvailableSizesArgument* param1) {
return new QIconEngine::AvailableSizesArgument(*param1);
}
void QIconEngine__AvailableSizesArgument_OperatorAssign(QIconEngine__AvailableSizesArgument* self, QIconEngine__AvailableSizesArgument* param1) {
self->operator=(*param1);
}
2024-08-29 07:01:51 +00:00
void QIconEngine__AvailableSizesArgument_Delete(QIconEngine__AvailableSizesArgument* self) {
delete self;
}
QIconEngine__ScaledPixmapArgument* QIconEngine__ScaledPixmapArgument_new(QIconEngine__ScaledPixmapArgument* param1) {
return new QIconEngine::ScaledPixmapArgument(*param1);
}
void QIconEngine__ScaledPixmapArgument_OperatorAssign(QIconEngine__ScaledPixmapArgument* self, QIconEngine__ScaledPixmapArgument* param1) {
self->operator=(*param1);
}
2024-08-29 07:01:51 +00:00
void QIconEngine__ScaledPixmapArgument_Delete(QIconEngine__ScaledPixmapArgument* self) {
delete self;
}