2024-08-25 04:08:24 +00:00
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QProgressBar>
|
|
|
|
#include <QSize>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QWidget>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qprogressbar.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qprogressbar.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
QProgressBar* QProgressBar_new() {
|
|
|
|
return new QProgressBar();
|
|
|
|
}
|
|
|
|
|
|
|
|
QProgressBar* QProgressBar_new2(QWidget* parent) {
|
|
|
|
return new QProgressBar(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QProgressBar_MetaObject(const QProgressBar* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QProgressBar_Tr(const char* s, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QProgressBar::tr(s);
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QProgressBar_TrUtf8(const char* s, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QProgressBar::trUtf8(s);
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QProgressBar_Minimum(const QProgressBar* self) {
|
|
|
|
return self->minimum();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QProgressBar_Maximum(const QProgressBar* self) {
|
|
|
|
return self->maximum();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QProgressBar_Value(const QProgressBar* self) {
|
|
|
|
return self->value();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QProgressBar_Text(const QProgressBar* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->text();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_SetTextVisible(QProgressBar* self, bool visible) {
|
|
|
|
self->setTextVisible(visible);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QProgressBar_IsTextVisible(const QProgressBar* self) {
|
|
|
|
return self->isTextVisible();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QProgressBar_Alignment(const QProgressBar* self) {
|
|
|
|
Qt::Alignment ret = self->alignment();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<int>(ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_SetAlignment(QProgressBar* self, int alignment) {
|
|
|
|
self->setAlignment(static_cast<Qt::Alignment>(alignment));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QSize* QProgressBar_SizeHint(const QProgressBar* self) {
|
|
|
|
QSize ret = self->sizeHint();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QSize*>(new QSize(ret));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QSize* QProgressBar_MinimumSizeHint(const QProgressBar* self) {
|
|
|
|
QSize ret = self->minimumSizeHint();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QSize*>(new QSize(ret));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QProgressBar_Orientation(const QProgressBar* self) {
|
|
|
|
Qt::Orientation ret = self->orientation();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QProgressBar_SetInvertedAppearance(QProgressBar* self, bool invert) {
|
|
|
|
self->setInvertedAppearance(invert);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QProgressBar_InvertedAppearance(const QProgressBar* self) {
|
|
|
|
return self->invertedAppearance();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_SetTextDirection(QProgressBar* self, uintptr_t textDirection) {
|
|
|
|
self->setTextDirection(static_cast<QProgressBar::Direction>(textDirection));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QProgressBar_TextDirection(const QProgressBar* self) {
|
|
|
|
QProgressBar::Direction ret = self->textDirection();
|
2024-08-29 07:01:51 +00:00
|
|
|
return static_cast<uintptr_t>(ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_SetFormat(QProgressBar* self, const char* format, size_t format_Strlen) {
|
|
|
|
QString format_QString = QString::fromUtf8(format, format_Strlen);
|
|
|
|
self->setFormat(format_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_ResetFormat(QProgressBar* self) {
|
|
|
|
self->resetFormat();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
void QProgressBar_Format(const QProgressBar* self, char** _out, int* _out_Strlen) {
|
|
|
|
QString ret = self->format();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_Reset(QProgressBar* self) {
|
|
|
|
self->reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_SetRange(QProgressBar* self, int minimum, int maximum) {
|
|
|
|
self->setRange(static_cast<int>(minimum), static_cast<int>(maximum));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_SetMinimum(QProgressBar* self, int minimum) {
|
|
|
|
self->setMinimum(static_cast<int>(minimum));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_SetMaximum(QProgressBar* self, int maximum) {
|
|
|
|
self->setMaximum(static_cast<int>(maximum));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_SetValue(QProgressBar* self, int value) {
|
|
|
|
self->setValue(static_cast<int>(value));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QProgressBar_SetOrientation(QProgressBar* self, uintptr_t orientation) {
|
|
|
|
self->setOrientation(static_cast<Qt::Orientation>(orientation));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QProgressBar_ValueChanged(QProgressBar* self, int value) {
|
|
|
|
self->valueChanged(static_cast<int>(value));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_connect_ValueChanged(QProgressBar* self, void* slot) {
|
|
|
|
QProgressBar::connect(self, static_cast<void (QProgressBar::*)(int)>(&QProgressBar::valueChanged), self, [=](int value) {
|
|
|
|
miqt_exec_callback(slot, 0, nullptr);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QProgressBar_Tr2(const char* s, const char* c, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QProgressBar::tr(s, c);
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QProgressBar_Tr3(const char* s, const char* c, int n, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QProgressBar::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();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QProgressBar_TrUtf82(const char* s, const char* c, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QProgressBar::trUtf8(s, c);
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QProgressBar_TrUtf83(const char* s, const char* c, int n, char** _out, int* _out_Strlen) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QString ret = QProgressBar::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();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QProgressBar_Delete(QProgressBar* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|