mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
153 lines
4.9 KiB
C++
153 lines
4.9 KiB
C++
#include "gen_qdialogbuttonbox.h"
|
|
#include "qdialogbuttonbox.h"
|
|
|
|
#include <QAbstractButton>
|
|
#include <QDialogButtonBox>
|
|
#include <QList>
|
|
#include <QMetaObject>
|
|
#include <QString>
|
|
#include <QWidget>
|
|
|
|
|
|
extern "C" {
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
}
|
|
|
|
QDialogButtonBox* QDialogButtonBox_new() {
|
|
return new QDialogButtonBox();
|
|
}
|
|
|
|
QDialogButtonBox* QDialogButtonBox_new2(QWidget* parent) {
|
|
return new QDialogButtonBox(parent);
|
|
}
|
|
|
|
QMetaObject* QDialogButtonBox_MetaObject(QDialogButtonBox* self) {
|
|
return (QMetaObject*) self->metaObject();
|
|
}
|
|
|
|
void QDialogButtonBox_Tr(char* s, char** _out, int* _out_Strlen) {
|
|
QString ret = QDialogButtonBox::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 QDialogButtonBox_TrUtf8(char* s, char** _out, int* _out_Strlen) {
|
|
QString ret = QDialogButtonBox::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 QDialogButtonBox_RemoveButton(QDialogButtonBox* self, QAbstractButton* button) {
|
|
self->removeButton(button);
|
|
}
|
|
|
|
void QDialogButtonBox_Clear(QDialogButtonBox* self) {
|
|
self->clear();
|
|
}
|
|
|
|
void QDialogButtonBox_Buttons(QDialogButtonBox* self, QAbstractButton*** _out, size_t* _out_len) {
|
|
QList<QAbstractButton *> ret = self->buttons();
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
QAbstractButton** __out = static_cast<QAbstractButton**>(malloc(sizeof(QAbstractButton*) * ret.length()));
|
|
for (size_t i = 0, e = ret.length(); i < e; ++i) {
|
|
__out[i] = ret[i];
|
|
}
|
|
*_out = __out;
|
|
*_out_len = ret.length();
|
|
}
|
|
|
|
void QDialogButtonBox_SetCenterButtons(QDialogButtonBox* self, bool center) {
|
|
self->setCenterButtons(center);
|
|
}
|
|
|
|
bool QDialogButtonBox_CenterButtons(QDialogButtonBox* self) {
|
|
return self->centerButtons();
|
|
}
|
|
|
|
void QDialogButtonBox_Clicked(QDialogButtonBox* self, QAbstractButton* button) {
|
|
self->clicked(button);
|
|
}
|
|
|
|
void QDialogButtonBox_connect_Clicked(QDialogButtonBox* self, void* slot) {
|
|
QDialogButtonBox::connect(self, static_cast<void (QDialogButtonBox::*)(QAbstractButton*)>(&QDialogButtonBox::clicked), self, [=](QAbstractButton* button) {
|
|
miqt_exec_callback(slot, 0, nullptr);
|
|
});
|
|
}
|
|
|
|
void QDialogButtonBox_Accepted(QDialogButtonBox* self) {
|
|
self->accepted();
|
|
}
|
|
|
|
void QDialogButtonBox_connect_Accepted(QDialogButtonBox* self, void* slot) {
|
|
QDialogButtonBox::connect(self, static_cast<void (QDialogButtonBox::*)()>(&QDialogButtonBox::accepted), self, [=]() {
|
|
miqt_exec_callback(slot, 0, nullptr);
|
|
});
|
|
}
|
|
|
|
void QDialogButtonBox_HelpRequested(QDialogButtonBox* self) {
|
|
self->helpRequested();
|
|
}
|
|
|
|
void QDialogButtonBox_connect_HelpRequested(QDialogButtonBox* self, void* slot) {
|
|
QDialogButtonBox::connect(self, static_cast<void (QDialogButtonBox::*)()>(&QDialogButtonBox::helpRequested), self, [=]() {
|
|
miqt_exec_callback(slot, 0, nullptr);
|
|
});
|
|
}
|
|
|
|
void QDialogButtonBox_Rejected(QDialogButtonBox* self) {
|
|
self->rejected();
|
|
}
|
|
|
|
void QDialogButtonBox_connect_Rejected(QDialogButtonBox* self, void* slot) {
|
|
QDialogButtonBox::connect(self, static_cast<void (QDialogButtonBox::*)()>(&QDialogButtonBox::rejected), self, [=]() {
|
|
miqt_exec_callback(slot, 0, nullptr);
|
|
});
|
|
}
|
|
|
|
void QDialogButtonBox_Tr2(char* s, char* c, char** _out, int* _out_Strlen) {
|
|
QString ret = QDialogButtonBox::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 QDialogButtonBox_Tr3(char* s, char* c, int n, char** _out, int* _out_Strlen) {
|
|
QString ret = QDialogButtonBox::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 QDialogButtonBox_TrUtf82(char* s, char* c, char** _out, int* _out_Strlen) {
|
|
QString ret = QDialogButtonBox::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 QDialogButtonBox_TrUtf83(char* s, char* c, int n, char** _out, int* _out_Strlen) {
|
|
QString ret = QDialogButtonBox::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 QDialogButtonBox_Delete(QDialogButtonBox* self) {
|
|
delete self;
|
|
}
|
|
|