mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
151 lines
5.4 KiB
C++
151 lines
5.4 KiB
C++
#include <QEasingCurve>
|
|
#include <QMetaObject>
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QByteArray>
|
|
#include <cstring>
|
|
#include <QVariant>
|
|
#include <QVariantAnimation>
|
|
#include "qvariantanimation.h"
|
|
|
|
#include "gen_qvariantanimation.h"
|
|
|
|
extern "C" {
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
}
|
|
|
|
QVariantAnimation* QVariantAnimation_new() {
|
|
return new QVariantAnimation();
|
|
}
|
|
|
|
QVariantAnimation* QVariantAnimation_new2(QObject* parent) {
|
|
return new QVariantAnimation(parent);
|
|
}
|
|
|
|
QMetaObject* QVariantAnimation_MetaObject(QVariantAnimation* self) {
|
|
return (QMetaObject*) const_cast<const QVariantAnimation*>(self)->metaObject();
|
|
}
|
|
|
|
void QVariantAnimation_Tr(const char* s, char** _out, int* _out_Strlen) {
|
|
QString ret = QVariantAnimation::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();
|
|
}
|
|
|
|
void QVariantAnimation_TrUtf8(const char* s, char** _out, int* _out_Strlen) {
|
|
QString ret = QVariantAnimation::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();
|
|
}
|
|
|
|
QVariant* QVariantAnimation_StartValue(QVariantAnimation* self) {
|
|
QVariant ret = const_cast<const QVariantAnimation*>(self)->startValue();
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
return static_cast<QVariant*>(new QVariant(ret));
|
|
}
|
|
|
|
void QVariantAnimation_SetStartValue(QVariantAnimation* self, QVariant* value) {
|
|
self->setStartValue(*value);
|
|
}
|
|
|
|
QVariant* QVariantAnimation_EndValue(QVariantAnimation* self) {
|
|
QVariant ret = const_cast<const QVariantAnimation*>(self)->endValue();
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
return static_cast<QVariant*>(new QVariant(ret));
|
|
}
|
|
|
|
void QVariantAnimation_SetEndValue(QVariantAnimation* self, QVariant* value) {
|
|
self->setEndValue(*value);
|
|
}
|
|
|
|
QVariant* QVariantAnimation_KeyValueAt(QVariantAnimation* self, double step) {
|
|
QVariant ret = const_cast<const QVariantAnimation*>(self)->keyValueAt(static_cast<qreal>(step));
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
return static_cast<QVariant*>(new QVariant(ret));
|
|
}
|
|
|
|
void QVariantAnimation_SetKeyValueAt(QVariantAnimation* self, double step, QVariant* value) {
|
|
self->setKeyValueAt(static_cast<qreal>(step), *value);
|
|
}
|
|
|
|
QVariant* QVariantAnimation_CurrentValue(QVariantAnimation* self) {
|
|
QVariant ret = const_cast<const QVariantAnimation*>(self)->currentValue();
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
return static_cast<QVariant*>(new QVariant(ret));
|
|
}
|
|
|
|
int QVariantAnimation_Duration(QVariantAnimation* self) {
|
|
return const_cast<const QVariantAnimation*>(self)->duration();
|
|
}
|
|
|
|
void QVariantAnimation_SetDuration(QVariantAnimation* self, int msecs) {
|
|
self->setDuration(static_cast<int>(msecs));
|
|
}
|
|
|
|
QEasingCurve* QVariantAnimation_EasingCurve(QVariantAnimation* self) {
|
|
QEasingCurve ret = const_cast<const QVariantAnimation*>(self)->easingCurve();
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
return static_cast<QEasingCurve*>(new QEasingCurve(ret));
|
|
}
|
|
|
|
void QVariantAnimation_SetEasingCurve(QVariantAnimation* self, QEasingCurve* easing) {
|
|
self->setEasingCurve(*easing);
|
|
}
|
|
|
|
void QVariantAnimation_ValueChanged(QVariantAnimation* self, QVariant* value) {
|
|
self->valueChanged(*value);
|
|
}
|
|
|
|
void QVariantAnimation_connect_ValueChanged(QVariantAnimation* self, void* slot) {
|
|
QVariantAnimation::connect(self, static_cast<void (QVariantAnimation::*)(const QVariant&)>(&QVariantAnimation::valueChanged), self, [=](const QVariant& value) {
|
|
miqt_exec_callback(slot, 0, nullptr);
|
|
});
|
|
}
|
|
|
|
void QVariantAnimation_Tr2(const char* s, const char* c, char** _out, int* _out_Strlen) {
|
|
QString ret = QVariantAnimation::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();
|
|
}
|
|
|
|
void QVariantAnimation_Tr3(const char* s, const char* c, int n, char** _out, int* _out_Strlen) {
|
|
QString ret = QVariantAnimation::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();
|
|
}
|
|
|
|
void QVariantAnimation_TrUtf82(const char* s, const char* c, char** _out, int* _out_Strlen) {
|
|
QString ret = QVariantAnimation::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();
|
|
}
|
|
|
|
void QVariantAnimation_TrUtf83(const char* s, const char* c, int n, char** _out, int* _out_Strlen) {
|
|
QString ret = QVariantAnimation::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 QVariantAnimation_Delete(QVariantAnimation* self) {
|
|
delete self;
|
|
}
|
|
|