2024-08-25 04:08:24 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QIODevice>
|
|
|
|
#include <QImage>
|
|
|
|
#include <QImageIOHandler>
|
|
|
|
#include <QImageIOPlugin>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
|
|
|
#include <QVariant>
|
|
|
|
#include "qimageiohandler.h"
|
|
|
|
#include "gen_qimageiohandler.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
void QImageIOHandler_SetDevice(QImageIOHandler* self, QIODevice* device) {
|
|
|
|
self->setDevice(device);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QIODevice* QImageIOHandler_Device(const QImageIOHandler* self) {
|
|
|
|
return self->device();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QImageIOHandler_SetFormat(QImageIOHandler* self, QByteArray* format) {
|
|
|
|
self->setFormat(*format);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QImageIOHandler_SetFormatWithFormat(const QImageIOHandler* self, QByteArray* format) {
|
|
|
|
self->setFormat(*format);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QByteArray* QImageIOHandler_Format(const QImageIOHandler* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _ret = self->format();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QByteArray*>(new QByteArray(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QByteArray* QImageIOHandler_Name(const QImageIOHandler* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _ret = self->name();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QByteArray*>(new QByteArray(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QImageIOHandler_CanRead(const QImageIOHandler* self) {
|
|
|
|
return self->canRead();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QImageIOHandler_Read(QImageIOHandler* self, QImage* image) {
|
|
|
|
return self->read(image);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QImageIOHandler_Write(QImageIOHandler* self, QImage* image) {
|
|
|
|
return self->write(*image);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QVariant* QImageIOHandler_Option(const QImageIOHandler* self, uintptr_t option) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QVariant _ret = self->option(static_cast<QImageIOHandler::ImageOption>(option));
|
2024-08-29 07:01:51 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QVariant*>(new QVariant(_ret));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QImageIOHandler_SetOption(QImageIOHandler* self, uintptr_t option, QVariant* value) {
|
|
|
|
self->setOption(static_cast<QImageIOHandler::ImageOption>(option), *value);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QImageIOHandler_SupportsOption(const QImageIOHandler* self, uintptr_t option) {
|
|
|
|
return self->supportsOption(static_cast<QImageIOHandler::ImageOption>(option));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
bool QImageIOHandler_JumpToNextImage(QImageIOHandler* self) {
|
|
|
|
return self->jumpToNextImage();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QImageIOHandler_JumpToImage(QImageIOHandler* self, int imageNumber) {
|
|
|
|
return self->jumpToImage(static_cast<int>(imageNumber));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QImageIOHandler_LoopCount(const QImageIOHandler* self) {
|
|
|
|
return self->loopCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QImageIOHandler_ImageCount(const QImageIOHandler* self) {
|
|
|
|
return self->imageCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QImageIOHandler_NextImageDelay(const QImageIOHandler* self) {
|
|
|
|
return self->nextImageDelay();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QImageIOHandler_CurrentImageNumber(const QImageIOHandler* self) {
|
|
|
|
return self->currentImageNumber();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRect* QImageIOHandler_CurrentImageRect(const QImageIOHandler* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QRect _ret = self->currentImageRect();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QRect*>(new QRect(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QImageIOHandler_Delete(QImageIOHandler* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QImageIOPlugin_MetaObject(const QImageIOPlugin* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QImageIOPlugin_Tr(const char* s) {
|
|
|
|
QString _ret = QImageIOPlugin::tr(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QImageIOPlugin_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QImageIOPlugin::trUtf8(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QImageIOPlugin_Capabilities(const QImageIOPlugin* self, QIODevice* device, QByteArray* format) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QImageIOPlugin::Capabilities _ret = self->capabilities(device, *format);
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QImageIOHandler* QImageIOPlugin_Create(const QImageIOPlugin* self, QIODevice* device) {
|
|
|
|
return self->create(device);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QImageIOPlugin_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QImageIOPlugin::tr(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QImageIOPlugin_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QImageIOPlugin::tr(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QImageIOPlugin_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QImageIOPlugin::trUtf8(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QImageIOPlugin_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QImageIOPlugin::trUtf8(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QImageIOHandler* QImageIOPlugin_Create2(const QImageIOPlugin* self, QIODevice* device, QByteArray* format) {
|
|
|
|
return self->create(device, *format);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QImageIOPlugin_Delete(QImageIOPlugin* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|