miqt/qt/printsupport/gen_qprintdialog.cpp

154 lines
4.6 KiB
C++
Raw Normal View History

2024-10-16 05:08:07 +00:00
#include <QMetaObject>
#include <QPrintDialog>
#include <QPrinter>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QWidget>
#include <qprintdialog.h>
#include "gen_qprintdialog.h"
#include "_cgo_export.h"
QPrintDialog* QPrintDialog_new(QWidget* parent) {
return new QPrintDialog(parent);
}
QPrintDialog* QPrintDialog_new2(QPrinter* printer) {
2024-10-16 05:08:07 +00:00
return new QPrintDialog(printer);
}
QPrintDialog* QPrintDialog_new3() {
2024-10-16 05:08:07 +00:00
return new QPrintDialog();
}
QPrintDialog* QPrintDialog_new4(QPrinter* printer, QWidget* parent) {
2024-10-16 05:08:07 +00:00
return new QPrintDialog(printer, parent);
}
QMetaObject* QPrintDialog_MetaObject(const QPrintDialog* self) {
return (QMetaObject*) self->metaObject();
}
void* QPrintDialog_Metacast(QPrintDialog* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QPrintDialog_Tr(const char* s) {
2024-10-16 05:08:07 +00:00
QString _ret = QPrintDialog::tr(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
2024-10-16 05:08:07 +00:00
}
struct miqt_string QPrintDialog_TrUtf8(const char* s) {
2024-10-16 05:08:07 +00:00
QString _ret = QPrintDialog::trUtf8(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
2024-10-16 05:08:07 +00:00
}
int QPrintDialog_Exec(QPrintDialog* self) {
return self->exec();
}
void QPrintDialog_Accept(QPrintDialog* self) {
self->accept();
}
void QPrintDialog_Done(QPrintDialog* self, int result) {
self->done(static_cast<int>(result));
}
void QPrintDialog_SetOption(QPrintDialog* self, int option) {
self->setOption(static_cast<QAbstractPrintDialog::PrintDialogOption>(option));
}
bool QPrintDialog_TestOption(const QPrintDialog* self, int option) {
return self->testOption(static_cast<QAbstractPrintDialog::PrintDialogOption>(option));
}
void QPrintDialog_SetOptions(QPrintDialog* self, int options) {
self->setOptions(static_cast<QAbstractPrintDialog::PrintDialogOptions>(options));
}
int QPrintDialog_Options(const QPrintDialog* self) {
QAbstractPrintDialog::PrintDialogOptions _ret = self->options();
return static_cast<int>(_ret);
}
void QPrintDialog_SetVisible(QPrintDialog* self, bool visible) {
self->setVisible(visible);
}
void QPrintDialog_Accepted(QPrintDialog* self, QPrinter* printer) {
self->accepted(printer);
}
void QPrintDialog_connect_Accepted(QPrintDialog* self, intptr_t slot) {
QPrintDialog::connect(self, static_cast<void (QPrintDialog::*)(QPrinter*)>(&QPrintDialog::accepted), self, [=](QPrinter* printer) {
QPrinter* sigval1 = printer;
miqt_exec_callback_QPrintDialog_Accepted(slot, sigval1);
});
}
struct miqt_string QPrintDialog_Tr2(const char* s, const char* c) {
2024-10-16 05:08:07 +00:00
QString _ret = QPrintDialog::tr(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
2024-10-16 05:08:07 +00:00
}
struct miqt_string QPrintDialog_Tr3(const char* s, const char* c, int n) {
2024-10-16 05:08:07 +00:00
QString _ret = QPrintDialog::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();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
2024-10-16 05:08:07 +00:00
}
struct miqt_string QPrintDialog_TrUtf82(const char* s, const char* c) {
2024-10-16 05:08:07 +00:00
QString _ret = QPrintDialog::trUtf8(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
2024-10-16 05:08:07 +00:00
}
struct miqt_string QPrintDialog_TrUtf83(const char* s, const char* c, int n) {
2024-10-16 05:08:07 +00:00
QString _ret = QPrintDialog::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();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
2024-10-16 05:08:07 +00:00
}
void QPrintDialog_SetOption2(QPrintDialog* self, int option, bool on) {
self->setOption(static_cast<QAbstractPrintDialog::PrintDialogOption>(option), on);
}
void QPrintDialog_Delete(QPrintDialog* self) {
delete self;
}