miqt/qt/gen_qfontdialog.cpp

700 lines
19 KiB
C++

#include <QCloseEvent>
#include <QContextMenuEvent>
#include <QDialog>
#include <QEvent>
#include <QFont>
#include <QFontDialog>
#include <QKeyEvent>
#include <QMetaObject>
#include <QObject>
#include <QPaintDevice>
#include <QResizeEvent>
#include <QShowEvent>
#include <QSize>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QWidget>
#include <qfontdialog.h>
#include "gen_qfontdialog.h"
#ifndef _Bool
#define _Bool bool
#endif
#include "_cgo_export.h"
class MiqtVirtualQFontDialog : public virtual QFontDialog {
public:
MiqtVirtualQFontDialog(QWidget* parent): QFontDialog(parent) {};
MiqtVirtualQFontDialog(): QFontDialog() {};
MiqtVirtualQFontDialog(const QFont& initial): QFontDialog(initial) {};
MiqtVirtualQFontDialog(const QFont& initial, QWidget* parent): QFontDialog(initial, parent) {};
virtual ~MiqtVirtualQFontDialog() = default;
// cgo.Handle value for overwritten implementation
intptr_t handle__SetVisible = 0;
// Subclass to allow providing a Go implementation
virtual void setVisible(bool visible) override {
if (handle__SetVisible == 0) {
QFontDialog::setVisible(visible);
return;
}
bool sigval1 = visible;
miqt_exec_callback_QFontDialog_SetVisible(this, handle__SetVisible, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_SetVisible(bool visible) {
QFontDialog::setVisible(visible);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__ChangeEvent = 0;
// Subclass to allow providing a Go implementation
virtual void changeEvent(QEvent* event) override {
if (handle__ChangeEvent == 0) {
QFontDialog::changeEvent(event);
return;
}
QEvent* sigval1 = event;
miqt_exec_callback_QFontDialog_ChangeEvent(this, handle__ChangeEvent, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_ChangeEvent(QEvent* event) {
QFontDialog::changeEvent(event);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__Done = 0;
// Subclass to allow providing a Go implementation
virtual void done(int result) override {
if (handle__Done == 0) {
QFontDialog::done(result);
return;
}
int sigval1 = result;
miqt_exec_callback_QFontDialog_Done(this, handle__Done, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_Done(int result) {
QFontDialog::done(static_cast<int>(result));
}
// cgo.Handle value for overwritten implementation
intptr_t handle__EventFilter = 0;
// Subclass to allow providing a Go implementation
virtual bool eventFilter(QObject* object, QEvent* event) override {
if (handle__EventFilter == 0) {
return QFontDialog::eventFilter(object, event);
}
QObject* sigval1 = object;
QEvent* sigval2 = event;
bool callback_return_value = miqt_exec_callback_QFontDialog_EventFilter(this, handle__EventFilter, sigval1, sigval2);
return callback_return_value;
}
// Wrapper to allow calling protected method
bool virtualbase_EventFilter(QObject* object, QEvent* event) {
return QFontDialog::eventFilter(object, event);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__SizeHint = 0;
// Subclass to allow providing a Go implementation
virtual QSize sizeHint() const override {
if (handle__SizeHint == 0) {
return QFontDialog::sizeHint();
}
QSize* callback_return_value = miqt_exec_callback_QFontDialog_SizeHint(const_cast<MiqtVirtualQFontDialog*>(this), handle__SizeHint);
return *callback_return_value;
}
// Wrapper to allow calling protected method
QSize* virtualbase_SizeHint() const {
return new QSize(QFontDialog::sizeHint());
}
// cgo.Handle value for overwritten implementation
intptr_t handle__MinimumSizeHint = 0;
// Subclass to allow providing a Go implementation
virtual QSize minimumSizeHint() const override {
if (handle__MinimumSizeHint == 0) {
return QFontDialog::minimumSizeHint();
}
QSize* callback_return_value = miqt_exec_callback_QFontDialog_MinimumSizeHint(const_cast<MiqtVirtualQFontDialog*>(this), handle__MinimumSizeHint);
return *callback_return_value;
}
// Wrapper to allow calling protected method
QSize* virtualbase_MinimumSizeHint() const {
return new QSize(QFontDialog::minimumSizeHint());
}
// cgo.Handle value for overwritten implementation
intptr_t handle__Open = 0;
// Subclass to allow providing a Go implementation
virtual void open() override {
if (handle__Open == 0) {
QFontDialog::open();
return;
}
miqt_exec_callback_QFontDialog_Open(this, handle__Open);
}
// Wrapper to allow calling protected method
void virtualbase_Open() {
QFontDialog::open();
}
// cgo.Handle value for overwritten implementation
intptr_t handle__Exec = 0;
// Subclass to allow providing a Go implementation
virtual int exec() override {
if (handle__Exec == 0) {
return QFontDialog::exec();
}
int callback_return_value = miqt_exec_callback_QFontDialog_Exec(this, handle__Exec);
return static_cast<int>(callback_return_value);
}
// Wrapper to allow calling protected method
int virtualbase_Exec() {
return QFontDialog::exec();
}
// cgo.Handle value for overwritten implementation
intptr_t handle__Accept = 0;
// Subclass to allow providing a Go implementation
virtual void accept() override {
if (handle__Accept == 0) {
QFontDialog::accept();
return;
}
miqt_exec_callback_QFontDialog_Accept(this, handle__Accept);
}
// Wrapper to allow calling protected method
void virtualbase_Accept() {
QFontDialog::accept();
}
// cgo.Handle value for overwritten implementation
intptr_t handle__Reject = 0;
// Subclass to allow providing a Go implementation
virtual void reject() override {
if (handle__Reject == 0) {
QFontDialog::reject();
return;
}
miqt_exec_callback_QFontDialog_Reject(this, handle__Reject);
}
// Wrapper to allow calling protected method
void virtualbase_Reject() {
QFontDialog::reject();
}
// cgo.Handle value for overwritten implementation
intptr_t handle__KeyPressEvent = 0;
// Subclass to allow providing a Go implementation
virtual void keyPressEvent(QKeyEvent* param1) override {
if (handle__KeyPressEvent == 0) {
QFontDialog::keyPressEvent(param1);
return;
}
QKeyEvent* sigval1 = param1;
miqt_exec_callback_QFontDialog_KeyPressEvent(this, handle__KeyPressEvent, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_KeyPressEvent(QKeyEvent* param1) {
QFontDialog::keyPressEvent(param1);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__CloseEvent = 0;
// Subclass to allow providing a Go implementation
virtual void closeEvent(QCloseEvent* param1) override {
if (handle__CloseEvent == 0) {
QFontDialog::closeEvent(param1);
return;
}
QCloseEvent* sigval1 = param1;
miqt_exec_callback_QFontDialog_CloseEvent(this, handle__CloseEvent, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_CloseEvent(QCloseEvent* param1) {
QFontDialog::closeEvent(param1);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__ShowEvent = 0;
// Subclass to allow providing a Go implementation
virtual void showEvent(QShowEvent* param1) override {
if (handle__ShowEvent == 0) {
QFontDialog::showEvent(param1);
return;
}
QShowEvent* sigval1 = param1;
miqt_exec_callback_QFontDialog_ShowEvent(this, handle__ShowEvent, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_ShowEvent(QShowEvent* param1) {
QFontDialog::showEvent(param1);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__ResizeEvent = 0;
// Subclass to allow providing a Go implementation
virtual void resizeEvent(QResizeEvent* param1) override {
if (handle__ResizeEvent == 0) {
QFontDialog::resizeEvent(param1);
return;
}
QResizeEvent* sigval1 = param1;
miqt_exec_callback_QFontDialog_ResizeEvent(this, handle__ResizeEvent, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_ResizeEvent(QResizeEvent* param1) {
QFontDialog::resizeEvent(param1);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__ContextMenuEvent = 0;
// Subclass to allow providing a Go implementation
virtual void contextMenuEvent(QContextMenuEvent* param1) override {
if (handle__ContextMenuEvent == 0) {
QFontDialog::contextMenuEvent(param1);
return;
}
QContextMenuEvent* sigval1 = param1;
miqt_exec_callback_QFontDialog_ContextMenuEvent(this, handle__ContextMenuEvent, sigval1);
}
// Wrapper to allow calling protected method
void virtualbase_ContextMenuEvent(QContextMenuEvent* param1) {
QFontDialog::contextMenuEvent(param1);
}
};
QFontDialog* QFontDialog_new(QWidget* parent) {
return new MiqtVirtualQFontDialog(parent);
}
QFontDialog* QFontDialog_new2() {
return new MiqtVirtualQFontDialog();
}
QFontDialog* QFontDialog_new3(QFont* initial) {
return new MiqtVirtualQFontDialog(*initial);
}
QFontDialog* QFontDialog_new4(QFont* initial, QWidget* parent) {
return new MiqtVirtualQFontDialog(*initial, parent);
}
void QFontDialog_virtbase(QFontDialog* src, QDialog** outptr_QDialog) {
*outptr_QDialog = static_cast<QDialog*>(src);
}
QMetaObject* QFontDialog_MetaObject(const QFontDialog* self) {
return (QMetaObject*) self->metaObject();
}
void* QFontDialog_Metacast(QFontDialog* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QFontDialog_Tr(const char* s) {
QString _ret = QFontDialog::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;
}
struct miqt_string QFontDialog_TrUtf8(const char* s) {
QString _ret = QFontDialog::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;
}
void QFontDialog_SetCurrentFont(QFontDialog* self, QFont* font) {
self->setCurrentFont(*font);
}
QFont* QFontDialog_CurrentFont(const QFontDialog* self) {
return new QFont(self->currentFont());
}
QFont* QFontDialog_SelectedFont(const QFontDialog* self) {
return new QFont(self->selectedFont());
}
void QFontDialog_SetOption(QFontDialog* self, int option) {
self->setOption(static_cast<QFontDialog::FontDialogOption>(option));
}
bool QFontDialog_TestOption(const QFontDialog* self, int option) {
return self->testOption(static_cast<QFontDialog::FontDialogOption>(option));
}
void QFontDialog_SetOptions(QFontDialog* self, int options) {
self->setOptions(static_cast<QFontDialog::FontDialogOptions>(options));
}
int QFontDialog_Options(const QFontDialog* self) {
QFontDialog::FontDialogOptions _ret = self->options();
return static_cast<int>(_ret);
}
void QFontDialog_SetVisible(QFontDialog* self, bool visible) {
self->setVisible(visible);
}
QFont* QFontDialog_GetFont(bool* ok) {
return new QFont(QFontDialog::getFont(ok));
}
QFont* QFontDialog_GetFont2(bool* ok, QFont* initial) {
return new QFont(QFontDialog::getFont(ok, *initial));
}
void QFontDialog_CurrentFontChanged(QFontDialog* self, QFont* font) {
self->currentFontChanged(*font);
}
void QFontDialog_connect_CurrentFontChanged(QFontDialog* self, intptr_t slot) {
MiqtVirtualQFontDialog::connect(self, static_cast<void (QFontDialog::*)(const QFont&)>(&QFontDialog::currentFontChanged), self, [=](const QFont& font) {
const QFont& font_ret = font;
// Cast returned reference into pointer
QFont* sigval1 = const_cast<QFont*>(&font_ret);
miqt_exec_callback_QFontDialog_CurrentFontChanged(slot, sigval1);
});
}
void QFontDialog_FontSelected(QFontDialog* self, QFont* font) {
self->fontSelected(*font);
}
void QFontDialog_connect_FontSelected(QFontDialog* self, intptr_t slot) {
MiqtVirtualQFontDialog::connect(self, static_cast<void (QFontDialog::*)(const QFont&)>(&QFontDialog::fontSelected), self, [=](const QFont& font) {
const QFont& font_ret = font;
// Cast returned reference into pointer
QFont* sigval1 = const_cast<QFont*>(&font_ret);
miqt_exec_callback_QFontDialog_FontSelected(slot, sigval1);
});
}
struct miqt_string QFontDialog_Tr2(const char* s, const char* c) {
QString _ret = QFontDialog::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;
}
struct miqt_string QFontDialog_Tr3(const char* s, const char* c, int n) {
QString _ret = QFontDialog::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;
}
struct miqt_string QFontDialog_TrUtf82(const char* s, const char* c) {
QString _ret = QFontDialog::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;
}
struct miqt_string QFontDialog_TrUtf83(const char* s, const char* c, int n) {
QString _ret = QFontDialog::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;
}
void QFontDialog_SetOption2(QFontDialog* self, int option, bool on) {
self->setOption(static_cast<QFontDialog::FontDialogOption>(option), on);
}
QFont* QFontDialog_GetFont22(bool* ok, QWidget* parent) {
return new QFont(QFontDialog::getFont(ok, parent));
}
QFont* QFontDialog_GetFont3(bool* ok, QFont* initial, QWidget* parent) {
return new QFont(QFontDialog::getFont(ok, *initial, parent));
}
QFont* QFontDialog_GetFont4(bool* ok, QFont* initial, QWidget* parent, struct miqt_string title) {
QString title_QString = QString::fromUtf8(title.data, title.len);
return new QFont(QFontDialog::getFont(ok, *initial, parent, title_QString));
}
QFont* QFontDialog_GetFont5(bool* ok, QFont* initial, QWidget* parent, struct miqt_string title, int options) {
QString title_QString = QString::fromUtf8(title.data, title.len);
return new QFont(QFontDialog::getFont(ok, *initial, parent, title_QString, static_cast<QFontDialog::FontDialogOptions>(options)));
}
void QFontDialog_override_virtual_SetVisible(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__SetVisible = slot;
}
void QFontDialog_virtualbase_SetVisible(void* self, bool visible) {
( (MiqtVirtualQFontDialog*)(self) )->virtualbase_SetVisible(visible);
}
void QFontDialog_override_virtual_ChangeEvent(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__ChangeEvent = slot;
}
void QFontDialog_virtualbase_ChangeEvent(void* self, QEvent* event) {
( (MiqtVirtualQFontDialog*)(self) )->virtualbase_ChangeEvent(event);
}
void QFontDialog_override_virtual_Done(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__Done = slot;
}
void QFontDialog_virtualbase_Done(void* self, int result) {
( (MiqtVirtualQFontDialog*)(self) )->virtualbase_Done(result);
}
void QFontDialog_override_virtual_EventFilter(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__EventFilter = slot;
}
bool QFontDialog_virtualbase_EventFilter(void* self, QObject* object, QEvent* event) {
return ( (MiqtVirtualQFontDialog*)(self) )->virtualbase_EventFilter(object, event);
}
void QFontDialog_override_virtual_SizeHint(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__SizeHint = slot;
}
QSize* QFontDialog_virtualbase_SizeHint(const void* self) {
return ( (const MiqtVirtualQFontDialog*)(self) )->virtualbase_SizeHint();
}
void QFontDialog_override_virtual_MinimumSizeHint(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__MinimumSizeHint = slot;
}
QSize* QFontDialog_virtualbase_MinimumSizeHint(const void* self) {
return ( (const MiqtVirtualQFontDialog*)(self) )->virtualbase_MinimumSizeHint();
}
void QFontDialog_override_virtual_Open(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__Open = slot;
}
void QFontDialog_virtualbase_Open(void* self) {
( (MiqtVirtualQFontDialog*)(self) )->virtualbase_Open();
}
void QFontDialog_override_virtual_Exec(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__Exec = slot;
}
int QFontDialog_virtualbase_Exec(void* self) {
return ( (MiqtVirtualQFontDialog*)(self) )->virtualbase_Exec();
}
void QFontDialog_override_virtual_Accept(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__Accept = slot;
}
void QFontDialog_virtualbase_Accept(void* self) {
( (MiqtVirtualQFontDialog*)(self) )->virtualbase_Accept();
}
void QFontDialog_override_virtual_Reject(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__Reject = slot;
}
void QFontDialog_virtualbase_Reject(void* self) {
( (MiqtVirtualQFontDialog*)(self) )->virtualbase_Reject();
}
void QFontDialog_override_virtual_KeyPressEvent(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__KeyPressEvent = slot;
}
void QFontDialog_virtualbase_KeyPressEvent(void* self, QKeyEvent* param1) {
( (MiqtVirtualQFontDialog*)(self) )->virtualbase_KeyPressEvent(param1);
}
void QFontDialog_override_virtual_CloseEvent(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__CloseEvent = slot;
}
void QFontDialog_virtualbase_CloseEvent(void* self, QCloseEvent* param1) {
( (MiqtVirtualQFontDialog*)(self) )->virtualbase_CloseEvent(param1);
}
void QFontDialog_override_virtual_ShowEvent(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__ShowEvent = slot;
}
void QFontDialog_virtualbase_ShowEvent(void* self, QShowEvent* param1) {
( (MiqtVirtualQFontDialog*)(self) )->virtualbase_ShowEvent(param1);
}
void QFontDialog_override_virtual_ResizeEvent(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__ResizeEvent = slot;
}
void QFontDialog_virtualbase_ResizeEvent(void* self, QResizeEvent* param1) {
( (MiqtVirtualQFontDialog*)(self) )->virtualbase_ResizeEvent(param1);
}
void QFontDialog_override_virtual_ContextMenuEvent(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQFontDialog*>( (QFontDialog*)(self) )->handle__ContextMenuEvent = slot;
}
void QFontDialog_virtualbase_ContextMenuEvent(void* self, QContextMenuEvent* param1) {
( (MiqtVirtualQFontDialog*)(self) )->virtualbase_ContextMenuEvent(param1);
}
void QFontDialog_Delete(QFontDialog* self, bool isSubclass) {
if (isSubclass) {
delete dynamic_cast<MiqtVirtualQFontDialog*>( self );
} else {
delete self;
}
}