miqt/qt/gen_qrubberband.cpp

102 lines
3.2 KiB
C++
Raw Normal View History

#include "gen_qrubberband.h"
#include "qrubberband.h"
#include <QMetaObject>
#include <QPoint>
#include <QRect>
#include <QRubberBand>
#include <QSize>
#include <QString>
extern "C" {
extern void miqt_exec_callback(void* cb, int argc, void* argv);
}
QMetaObject* QRubberBand_MetaObject(QRubberBand* self) {
return (QMetaObject*) self->metaObject();
}
void QRubberBand_Tr(char* s, char** _out, int* _out_Strlen) {
QString ret = QRubberBand::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 QRubberBand_TrUtf8(char* s, char** _out, int* _out_Strlen) {
QString ret = QRubberBand::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();
}
void QRubberBand_SetGeometry(QRubberBand* self, QRect* r) {
self->setGeometry(*r);
}
void QRubberBand_SetGeometry2(QRubberBand* self, int x, int y, int w, int h) {
self->setGeometry(static_cast<int>(x), static_cast<int>(y), static_cast<int>(w), static_cast<int>(h));
}
void QRubberBand_Move(QRubberBand* self, int x, int y) {
self->move(static_cast<int>(x), static_cast<int>(y));
}
void QRubberBand_MoveWithQPoint(QRubberBand* self, QPoint* p) {
self->move(*p);
}
void QRubberBand_Resize(QRubberBand* self, int w, int h) {
self->resize(static_cast<int>(w), static_cast<int>(h));
}
void QRubberBand_ResizeWithQSize(QRubberBand* self, QSize* s) {
self->resize(*s);
}
void QRubberBand_Tr2(char* s, char* c, char** _out, int* _out_Strlen) {
QString ret = QRubberBand::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 QRubberBand_Tr3(char* s, char* c, int n, char** _out, int* _out_Strlen) {
QString ret = QRubberBand::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 QRubberBand_TrUtf82(char* s, char* c, char** _out, int* _out_Strlen) {
QString ret = QRubberBand::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 QRubberBand_TrUtf83(char* s, char* c, int n, char** _out, int* _out_Strlen) {
QString ret = QRubberBand::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 QRubberBand_Delete(QRubberBand* self) {
delete self;
}