2024-08-25 04:08:24 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QIODevice>
|
|
|
|
#include <QList>
|
|
|
|
#include <QPaintEngine>
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QPicture>
|
|
|
|
#include <QPictureIO>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qpicture.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qpicture.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QPicture* QPicture_new() {
|
|
|
|
return new QPicture();
|
|
|
|
}
|
|
|
|
|
|
|
|
QPicture* QPicture_new2(QPicture* param1) {
|
|
|
|
return new QPicture(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
QPicture* QPicture_new3(int formatVersion) {
|
|
|
|
return new QPicture(static_cast<int>(formatVersion));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPicture_IsNull(const QPicture* self) {
|
|
|
|
return self->isNull();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QPicture_DevType(const QPicture* self) {
|
|
|
|
return self->devType();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
unsigned int QPicture_Size(const QPicture* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
uint _ret = self->size();
|
|
|
|
return static_cast<unsigned int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
const char* QPicture_Data(const QPicture* self) {
|
|
|
|
return (const char*) self->data();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QPicture_SetData(QPicture* self, const char* data, unsigned int size) {
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setData(data, static_cast<uint>(size));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPicture_Play(QPicture* self, QPainter* p) {
|
|
|
|
return self->play(p);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPicture_Load(QPicture* self, QIODevice* dev) {
|
|
|
|
return self->load(dev);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
bool QPicture_LoadWithFileName(QPicture* self, struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->load(fileName_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPicture_Save(QPicture* self, QIODevice* dev) {
|
|
|
|
return self->save(dev);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
bool QPicture_SaveWithFileName(QPicture* self, struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->save(fileName_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRect* QPicture_BoundingRect(const QPicture* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->boundingRect());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPicture_SetBoundingRect(QPicture* self, QRect* r) {
|
|
|
|
self->setBoundingRect(*r);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPicture_OperatorAssign(QPicture* self, QPicture* p) {
|
|
|
|
self->operator=(*p);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPicture_Swap(QPicture* self, QPicture* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPicture_Detach(QPicture* self) {
|
|
|
|
self->detach();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPicture_IsDetached(const QPicture* self) {
|
|
|
|
return self->isDetached();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
const char* QPicture_PictureFormat(struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return (const char*) QPicture::pictureFormat(fileName_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QPicture_InputFormats() {
|
|
|
|
QList<QByteArray> _ret = QPicture::inputFormats();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QByteArray** _arr = static_cast<QByteArray**>(malloc(sizeof(QByteArray*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QByteArray(_ret[i]);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QPicture_OutputFormats() {
|
|
|
|
QList<QByteArray> _ret = QPicture::outputFormats();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QByteArray** _arr = static_cast<QByteArray**>(malloc(sizeof(QByteArray*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QByteArray(_ret[i]);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QPicture_InputFormatList() {
|
|
|
|
QStringList _ret = QPicture::inputFormatList();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
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 _lv_b = _lv_ret.toUtf8();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QPicture_OutputFormatList() {
|
|
|
|
QStringList _ret = QPicture::outputFormatList();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
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 _lv_b = _lv_ret.toUtf8();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QPaintEngine* QPicture_PaintEngine(const QPicture* self) {
|
|
|
|
return self->paintEngine();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QPicture_Load2(QPicture* self, QIODevice* dev, const char* format) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->load(dev, format);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
bool QPicture_Load22(QPicture* self, struct miqt_string* fileName, const char* format) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->load(fileName_QString, format);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QPicture_Save2(QPicture* self, QIODevice* dev, const char* format) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->save(dev, format);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
bool QPicture_Save22(QPicture* self, struct miqt_string* fileName, const char* format) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->save(fileName_QString, format);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPicture_Delete(QPicture* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
|
|
|
QPictureIO* QPictureIO_new() {
|
|
|
|
return new QPictureIO();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QPictureIO* QPictureIO_new2(QIODevice* ioDevice, const char* format) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QPictureIO(ioDevice, format);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QPictureIO* QPictureIO_new3(struct miqt_string* fileName, const char* format) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QPictureIO(fileName_QString, format);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QPicture* QPictureIO_Picture(const QPictureIO* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QPicture& _ret = self->picture();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return const_cast<QPicture*>(&_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QPictureIO_Status(const QPictureIO* self) {
|
|
|
|
return self->status();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
const char* QPictureIO_Format(const QPictureIO* self) {
|
|
|
|
return (const char*) self->format();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QIODevice* QPictureIO_IoDevice(const QPictureIO* self) {
|
|
|
|
return self->ioDevice();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QPictureIO_FileName(const QPictureIO* self) {
|
|
|
|
QString _ret = self->fileName();
|
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 QPictureIO_Quality(const QPictureIO* self) {
|
|
|
|
return self->quality();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QPictureIO_Description(const QPictureIO* self) {
|
|
|
|
QString _ret = self->description();
|
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
|
|
|
const char* QPictureIO_Parameters(const QPictureIO* self) {
|
|
|
|
return (const char*) self->parameters();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
float QPictureIO_Gamma(const QPictureIO* self) {
|
|
|
|
return self->gamma();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPictureIO_SetPicture(QPictureIO* self, QPicture* picture) {
|
|
|
|
self->setPicture(*picture);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPictureIO_SetStatus(QPictureIO* self, int status) {
|
|
|
|
self->setStatus(static_cast<int>(status));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QPictureIO_SetFormat(QPictureIO* self, const char* format) {
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setFormat(format);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPictureIO_SetIODevice(QPictureIO* self, QIODevice* iODevice) {
|
|
|
|
self->setIODevice(iODevice);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QPictureIO_SetFileName(QPictureIO* self, struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setFileName(fileName_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPictureIO_SetQuality(QPictureIO* self, int quality) {
|
|
|
|
self->setQuality(static_cast<int>(quality));
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QPictureIO_SetDescription(QPictureIO* self, struct miqt_string* description) {
|
|
|
|
QString description_QString = QString::fromUtf8(&description->data, description->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setDescription(description_QString);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QPictureIO_SetParameters(QPictureIO* self, const char* parameters) {
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setParameters(parameters);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPictureIO_SetGamma(QPictureIO* self, float gamma) {
|
|
|
|
self->setGamma(static_cast<float>(gamma));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPictureIO_Read(QPictureIO* self) {
|
|
|
|
return self->read();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPictureIO_Write(QPictureIO* self) {
|
|
|
|
return self->write();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray* QPictureIO_PictureFormat(struct miqt_string* fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(&fileName->data, fileName->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QByteArray(QPictureIO::pictureFormat(fileName_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QByteArray* QPictureIO_PictureFormatWithQIODevice(QIODevice* param1) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QByteArray(QPictureIO::pictureFormat(param1));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QPictureIO_InputFormats() {
|
|
|
|
QList<QByteArray> _ret = QPictureIO::inputFormats();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QByteArray** _arr = static_cast<QByteArray**>(malloc(sizeof(QByteArray*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QByteArray(_ret[i]);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QPictureIO_OutputFormats() {
|
|
|
|
QList<QByteArray> _ret = QPictureIO::outputFormats();
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QByteArray** _arr = static_cast<QByteArray**>(malloc(sizeof(QByteArray*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QByteArray(_ret[i]);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +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-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPictureIO_Delete(QPictureIO* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|