#include #include #include #include #include #include #include #include #include #include #include #include #include "gen_qimagereader.h" #ifndef _Bool #define _Bool bool #endif #include "_cgo_export.h" QImageReader* QImageReader_new() { return new QImageReader(); } QImageReader* QImageReader_new2(QIODevice* device) { return new QImageReader(device); } QImageReader* QImageReader_new3(struct miqt_string fileName) { QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len); return new QImageReader(fileName_QString); } QImageReader* QImageReader_new4(QIODevice* device, struct miqt_string format) { QByteArray format_QByteArray(format.data, format.len); return new QImageReader(device, format_QByteArray); } QImageReader* QImageReader_new5(struct miqt_string fileName, struct miqt_string format) { QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len); QByteArray format_QByteArray(format.data, format.len); return new QImageReader(fileName_QString, format_QByteArray); } struct miqt_string QImageReader_Tr(const char* sourceText) { QString _ret = QImageReader::tr(sourceText); // 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(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QImageReader_SetFormat(QImageReader* self, struct miqt_string format) { QByteArray format_QByteArray(format.data, format.len); self->setFormat(format_QByteArray); } struct miqt_string QImageReader_Format(const QImageReader* self) { QByteArray _qb = self->format(); struct miqt_string _ms; _ms.len = _qb.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _qb.data(), _ms.len); return _ms; } void QImageReader_SetAutoDetectImageFormat(QImageReader* self, bool enabled) { self->setAutoDetectImageFormat(enabled); } bool QImageReader_AutoDetectImageFormat(const QImageReader* self) { return self->autoDetectImageFormat(); } void QImageReader_SetDecideFormatFromContent(QImageReader* self, bool ignored) { self->setDecideFormatFromContent(ignored); } bool QImageReader_DecideFormatFromContent(const QImageReader* self) { return self->decideFormatFromContent(); } void QImageReader_SetDevice(QImageReader* self, QIODevice* device) { self->setDevice(device); } QIODevice* QImageReader_Device(const QImageReader* self) { return self->device(); } void QImageReader_SetFileName(QImageReader* self, struct miqt_string fileName) { QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len); self->setFileName(fileName_QString); } struct miqt_string QImageReader_FileName(const QImageReader* self) { QString _ret = self->fileName(); // 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(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } QSize* QImageReader_Size(const QImageReader* self) { return new QSize(self->size()); } int QImageReader_ImageFormat(const QImageReader* self) { QImage::Format _ret = self->imageFormat(); return static_cast(_ret); } struct miqt_array /* of struct miqt_string */ QImageReader_TextKeys(const QImageReader* self) { QStringList _ret = self->textKeys(); // Convert QList<> from C++ memory to manually-managed C memory struct miqt_string* _arr = static_cast(malloc(sizeof(struct miqt_string) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QString _lv_ret = _ret[i]; // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _lv_b = _lv_ret.toUtf8(); struct miqt_string _lv_ms; _lv_ms.len = _lv_b.length(); _lv_ms.data = static_cast(malloc(_lv_ms.len)); memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len); _arr[i] = _lv_ms; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } struct miqt_string QImageReader_Text(const QImageReader* self, struct miqt_string key) { QString key_QString = QString::fromUtf8(key.data, key.len); QString _ret = self->text(key_QString); // 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(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QImageReader_SetClipRect(QImageReader* self, QRect* rect) { self->setClipRect(*rect); } QRect* QImageReader_ClipRect(const QImageReader* self) { return new QRect(self->clipRect()); } void QImageReader_SetScaledSize(QImageReader* self, QSize* size) { self->setScaledSize(*size); } QSize* QImageReader_ScaledSize(const QImageReader* self) { return new QSize(self->scaledSize()); } void QImageReader_SetQuality(QImageReader* self, int quality) { self->setQuality(static_cast(quality)); } int QImageReader_Quality(const QImageReader* self) { return self->quality(); } void QImageReader_SetScaledClipRect(QImageReader* self, QRect* rect) { self->setScaledClipRect(*rect); } QRect* QImageReader_ScaledClipRect(const QImageReader* self) { return new QRect(self->scaledClipRect()); } void QImageReader_SetBackgroundColor(QImageReader* self, QColor* color) { self->setBackgroundColor(*color); } QColor* QImageReader_BackgroundColor(const QImageReader* self) { return new QColor(self->backgroundColor()); } bool QImageReader_SupportsAnimation(const QImageReader* self) { return self->supportsAnimation(); } int QImageReader_Transformation(const QImageReader* self) { QImageIOHandler::Transformations _ret = self->transformation(); return static_cast(_ret); } void QImageReader_SetAutoTransform(QImageReader* self, bool enabled) { self->setAutoTransform(enabled); } bool QImageReader_AutoTransform(const QImageReader* self) { return self->autoTransform(); } struct miqt_string QImageReader_SubType(const QImageReader* self) { QByteArray _qb = self->subType(); struct miqt_string _ms; _ms.len = _qb.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _qb.data(), _ms.len); return _ms; } struct miqt_array /* of struct miqt_string */ QImageReader_SupportedSubTypes(const QImageReader* self) { QList _ret = self->supportedSubTypes(); // Convert QList<> from C++ memory to manually-managed C memory struct miqt_string* _arr = static_cast(malloc(sizeof(struct miqt_string) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QByteArray _lv_qb = _ret[i]; struct miqt_string _lv_ms; _lv_ms.len = _lv_qb.length(); _lv_ms.data = static_cast(malloc(_lv_ms.len)); memcpy(_lv_ms.data, _lv_qb.data(), _lv_ms.len); _arr[i] = _lv_ms; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } bool QImageReader_CanRead(const QImageReader* self) { return self->canRead(); } QImage* QImageReader_Read(QImageReader* self) { return new QImage(self->read()); } bool QImageReader_ReadWithImage(QImageReader* self, QImage* image) { return self->read(image); } bool QImageReader_JumpToNextImage(QImageReader* self) { return self->jumpToNextImage(); } bool QImageReader_JumpToImage(QImageReader* self, int imageNumber) { return self->jumpToImage(static_cast(imageNumber)); } int QImageReader_LoopCount(const QImageReader* self) { return self->loopCount(); } int QImageReader_ImageCount(const QImageReader* self) { return self->imageCount(); } int QImageReader_NextImageDelay(const QImageReader* self) { return self->nextImageDelay(); } int QImageReader_CurrentImageNumber(const QImageReader* self) { return self->currentImageNumber(); } QRect* QImageReader_CurrentImageRect(const QImageReader* self) { return new QRect(self->currentImageRect()); } int QImageReader_Error(const QImageReader* self) { QImageReader::ImageReaderError _ret = self->error(); return static_cast(_ret); } struct miqt_string QImageReader_ErrorString(const QImageReader* self) { QString _ret = self->errorString(); // 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(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } bool QImageReader_SupportsOption(const QImageReader* self, int option) { return self->supportsOption(static_cast(option)); } struct miqt_string QImageReader_ImageFormatWithFileName(struct miqt_string fileName) { QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len); QByteArray _qb = QImageReader::imageFormat(fileName_QString); struct miqt_string _ms; _ms.len = _qb.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _qb.data(), _ms.len); return _ms; } struct miqt_string QImageReader_ImageFormatWithDevice(QIODevice* device) { QByteArray _qb = QImageReader::imageFormat(device); struct miqt_string _ms; _ms.len = _qb.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _qb.data(), _ms.len); return _ms; } struct miqt_array /* of struct miqt_string */ QImageReader_SupportedImageFormats() { QList _ret = QImageReader::supportedImageFormats(); // Convert QList<> from C++ memory to manually-managed C memory struct miqt_string* _arr = static_cast(malloc(sizeof(struct miqt_string) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QByteArray _lv_qb = _ret[i]; struct miqt_string _lv_ms; _lv_ms.len = _lv_qb.length(); _lv_ms.data = static_cast(malloc(_lv_ms.len)); memcpy(_lv_ms.data, _lv_qb.data(), _lv_ms.len); _arr[i] = _lv_ms; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } struct miqt_array /* of struct miqt_string */ QImageReader_SupportedMimeTypes() { QList _ret = QImageReader::supportedMimeTypes(); // Convert QList<> from C++ memory to manually-managed C memory struct miqt_string* _arr = static_cast(malloc(sizeof(struct miqt_string) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QByteArray _lv_qb = _ret[i]; struct miqt_string _lv_ms; _lv_ms.len = _lv_qb.length(); _lv_ms.data = static_cast(malloc(_lv_ms.len)); memcpy(_lv_ms.data, _lv_qb.data(), _lv_ms.len); _arr[i] = _lv_ms; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } struct miqt_array /* of struct miqt_string */ QImageReader_ImageFormatsForMimeType(struct miqt_string mimeType) { QByteArray mimeType_QByteArray(mimeType.data, mimeType.len); QList _ret = QImageReader::imageFormatsForMimeType(mimeType_QByteArray); // Convert QList<> from C++ memory to manually-managed C memory struct miqt_string* _arr = static_cast(malloc(sizeof(struct miqt_string) * _ret.length())); for (size_t i = 0, e = _ret.length(); i < e; ++i) { QByteArray _lv_qb = _ret[i]; struct miqt_string _lv_ms; _lv_ms.len = _lv_qb.length(); _lv_ms.data = static_cast(malloc(_lv_ms.len)); memcpy(_lv_ms.data, _lv_qb.data(), _lv_ms.len); _arr[i] = _lv_ms; } struct miqt_array _out; _out.len = _ret.length(); _out.data = static_cast(_arr); return _out; } int QImageReader_AllocationLimit() { return QImageReader::allocationLimit(); } void QImageReader_SetAllocationLimit(int mbLimit) { QImageReader::setAllocationLimit(static_cast(mbLimit)); } struct miqt_string QImageReader_Tr2(const char* sourceText, const char* disambiguation) { QString _ret = QImageReader::tr(sourceText, disambiguation); // 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(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } struct miqt_string QImageReader_Tr3(const char* sourceText, const char* disambiguation, int n) { QString _ret = QImageReader::tr(sourceText, disambiguation, static_cast(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(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QImageReader_Delete(QImageReader* self, bool isSubclass) { if (isSubclass) { delete dynamic_cast( self ); } else { delete self; } }