2024-08-25 04:08:24 +00:00
|
|
|
#include <QFont>
|
|
|
|
#include <QFontDialog>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#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-10-16 05:07:56 +00:00
|
|
|
#include <qfontdialog.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qfontdialog.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QFontDialog* QFontDialog_new() {
|
|
|
|
return new QFontDialog();
|
|
|
|
}
|
|
|
|
|
|
|
|
QFontDialog* QFontDialog_new2(QFont* initial) {
|
|
|
|
return new QFontDialog(*initial);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFontDialog* QFontDialog_new3(QWidget* parent) {
|
|
|
|
return new QFontDialog(parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFontDialog* QFontDialog_new4(QFont* initial, QWidget* parent) {
|
|
|
|
return new QFontDialog(*initial, parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QFontDialog_MetaObject(const QFontDialog* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QFontDialog_Metacast(QFontDialog* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFontDialog_Tr(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QFontDialog::tr(s);
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFontDialog_TrUtf8(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QFontDialog::trUtf8(s);
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFontDialog_SetCurrentFont(QFontDialog* self, QFont* font) {
|
|
|
|
self->setCurrentFont(*font);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QFont* QFontDialog_CurrentFont(const QFontDialog* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QFont(self->currentFont());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QFont* QFontDialog_SelectedFont(const QFontDialog* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QFont(self->selectedFont());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QFontDialog_SetOption(QFontDialog* self, int option) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setOption(static_cast<QFontDialog::FontDialogOption>(option));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
bool QFontDialog_TestOption(const QFontDialog* self, int option) {
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->testOption(static_cast<QFontDialog::FontDialogOption>(option));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFontDialog_SetOptions(QFontDialog* self, int options) {
|
|
|
|
self->setOptions(static_cast<QFontDialog::FontDialogOptions>(options));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontDialog_Options(const QFontDialog* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QFontDialog::FontDialogOptions _ret = self->options();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QFontDialog_SetVisible(QFontDialog* self, bool visible) {
|
|
|
|
self->setVisible(visible);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFontDialog_GetFont(bool* ok) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QFont(QFontDialog::getFont(ok));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QFont* QFontDialog_GetFont2(bool* ok, QFont* initial) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QFont(QFontDialog::getFont(ok, *initial));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QFontDialog_CurrentFontChanged(QFontDialog* self, QFont* font) {
|
|
|
|
self->currentFontChanged(*font);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QFontDialog_connect_CurrentFontChanged(QFontDialog* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QFontDialog::connect(self, static_cast<void (QFontDialog::*)(const QFont&)>(&QFontDialog::currentFontChanged), self, [=](const QFont& font) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QFont& font_ret = font;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QFont* sigval1 = const_cast<QFont*>(&font_ret);
|
|
|
|
miqt_exec_callback_QFontDialog_CurrentFontChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFontDialog_FontSelected(QFontDialog* self, QFont* font) {
|
|
|
|
self->fontSelected(*font);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QFontDialog_connect_FontSelected(QFontDialog* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QFontDialog::connect(self, static_cast<void (QFontDialog::*)(const QFont&)>(&QFontDialog::fontSelected), self, [=](const QFont& font) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QFont& font_ret = font;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QFont* sigval1 = const_cast<QFont*>(&font_ret);
|
|
|
|
miqt_exec_callback_QFontDialog_FontSelected(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFontDialog_Tr2(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QFontDialog::tr(s, c);
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFontDialog_Tr3(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QFontDialog::tr(s, c, static_cast<int>(n));
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFontDialog_TrUtf82(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QFontDialog::trUtf8(s, c);
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFontDialog_TrUtf83(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QFontDialog::trUtf8(s, c, static_cast<int>(n));
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
2024-10-18 23:53:33 +00:00
|
|
|
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-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QFontDialog_SetOption2(QFontDialog* self, int option, bool on) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setOption(static_cast<QFontDialog::FontDialogOption>(option), on);
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFontDialog_GetFont22(bool* ok, QWidget* parent) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QFont(QFontDialog::getFont(ok, parent));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QFont* QFontDialog_GetFont3(bool* ok, QFont* initial, QWidget* parent) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QFont(QFontDialog::getFont(ok, *initial, parent));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QFont* QFontDialog_GetFont4(bool* ok, QFont* initial, QWidget* parent, struct miqt_string title) {
|
|
|
|
QString title_QString = QString::fromUtf8(title.data, title.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QFont(QFontDialog::getFont(ok, *initial, parent, title_QString));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QFont* QFontDialog_GetFont5(bool* ok, QFont* initial, QWidget* parent, struct miqt_string title, int options) {
|
|
|
|
QString title_QString = QString::fromUtf8(title.data, title.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QFont(QFontDialog::getFont(ok, *initial, parent, title_QString, static_cast<QFontDialog::FontDialogOptions>(options)));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QFontDialog_Delete(QFontDialog* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|