mirror of
https://github.com/mappu/miqt.git
synced 2024-12-22 17:08:38 +00:00
484 lines
16 KiB
C++
484 lines
16 KiB
C++
#include <QChildEvent>
|
|
#include <QEvent>
|
|
#include <QLocale>
|
|
#include <QMetaMethod>
|
|
#include <QMetaObject>
|
|
#include <QObject>
|
|
#include <QString>
|
|
#include <QByteArray>
|
|
#include <cstring>
|
|
#include <QTimerEvent>
|
|
#include <QTranslator>
|
|
#include <qtranslator.h>
|
|
#include "gen_qtranslator.h"
|
|
#include "_cgo_export.h"
|
|
|
|
class MiqtVirtualQTranslator : public virtual QTranslator {
|
|
public:
|
|
|
|
MiqtVirtualQTranslator(): QTranslator() {};
|
|
MiqtVirtualQTranslator(QObject* parent): QTranslator(parent) {};
|
|
|
|
virtual ~MiqtVirtualQTranslator() = default;
|
|
|
|
// cgo.Handle value for overwritten implementation
|
|
intptr_t handle__Translate = 0;
|
|
|
|
// Subclass to allow providing a Go implementation
|
|
virtual QString translate(const char* context, const char* sourceText, const char* disambiguation, int n) const override {
|
|
if (handle__Translate == 0) {
|
|
return QTranslator::translate(context, sourceText, disambiguation, n);
|
|
}
|
|
|
|
const char* sigval1 = (const char*) context;
|
|
const char* sigval2 = (const char*) sourceText;
|
|
const char* sigval3 = (const char*) disambiguation;
|
|
int sigval4 = n;
|
|
|
|
struct miqt_string callback_return_value = miqt_exec_callback_QTranslator_Translate(const_cast<MiqtVirtualQTranslator*>(this), handle__Translate, sigval1, sigval2, sigval3, sigval4);
|
|
QString callback_return_value_QString = QString::fromUtf8(callback_return_value.data, callback_return_value.len);
|
|
|
|
return callback_return_value_QString;
|
|
}
|
|
|
|
// Wrapper to allow calling protected method
|
|
struct miqt_string virtualbase_Translate(const char* context, const char* sourceText, const char* disambiguation, int n) const {
|
|
|
|
QString _ret = QTranslator::translate(context, sourceText, disambiguation, 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;
|
|
|
|
}
|
|
|
|
// cgo.Handle value for overwritten implementation
|
|
intptr_t handle__IsEmpty = 0;
|
|
|
|
// Subclass to allow providing a Go implementation
|
|
virtual bool isEmpty() const override {
|
|
if (handle__IsEmpty == 0) {
|
|
return QTranslator::isEmpty();
|
|
}
|
|
|
|
|
|
bool callback_return_value = miqt_exec_callback_QTranslator_IsEmpty(const_cast<MiqtVirtualQTranslator*>(this), handle__IsEmpty);
|
|
|
|
return callback_return_value;
|
|
}
|
|
|
|
// Wrapper to allow calling protected method
|
|
bool virtualbase_IsEmpty() const {
|
|
|
|
return QTranslator::isEmpty();
|
|
|
|
}
|
|
|
|
// cgo.Handle value for overwritten implementation
|
|
intptr_t handle__Event = 0;
|
|
|
|
// Subclass to allow providing a Go implementation
|
|
virtual bool event(QEvent* event) override {
|
|
if (handle__Event == 0) {
|
|
return QTranslator::event(event);
|
|
}
|
|
|
|
QEvent* sigval1 = event;
|
|
|
|
bool callback_return_value = miqt_exec_callback_QTranslator_Event(this, handle__Event, sigval1);
|
|
|
|
return callback_return_value;
|
|
}
|
|
|
|
// Wrapper to allow calling protected method
|
|
bool virtualbase_Event(QEvent* event) {
|
|
|
|
return QTranslator::event(event);
|
|
|
|
}
|
|
|
|
// cgo.Handle value for overwritten implementation
|
|
intptr_t handle__EventFilter = 0;
|
|
|
|
// Subclass to allow providing a Go implementation
|
|
virtual bool eventFilter(QObject* watched, QEvent* event) override {
|
|
if (handle__EventFilter == 0) {
|
|
return QTranslator::eventFilter(watched, event);
|
|
}
|
|
|
|
QObject* sigval1 = watched;
|
|
QEvent* sigval2 = event;
|
|
|
|
bool callback_return_value = miqt_exec_callback_QTranslator_EventFilter(this, handle__EventFilter, sigval1, sigval2);
|
|
|
|
return callback_return_value;
|
|
}
|
|
|
|
// Wrapper to allow calling protected method
|
|
bool virtualbase_EventFilter(QObject* watched, QEvent* event) {
|
|
|
|
return QTranslator::eventFilter(watched, event);
|
|
|
|
}
|
|
|
|
// cgo.Handle value for overwritten implementation
|
|
intptr_t handle__TimerEvent = 0;
|
|
|
|
// Subclass to allow providing a Go implementation
|
|
virtual void timerEvent(QTimerEvent* event) override {
|
|
if (handle__TimerEvent == 0) {
|
|
QTranslator::timerEvent(event);
|
|
return;
|
|
}
|
|
|
|
QTimerEvent* sigval1 = event;
|
|
|
|
miqt_exec_callback_QTranslator_TimerEvent(this, handle__TimerEvent, sigval1);
|
|
|
|
|
|
}
|
|
|
|
// Wrapper to allow calling protected method
|
|
void virtualbase_TimerEvent(QTimerEvent* event) {
|
|
|
|
QTranslator::timerEvent(event);
|
|
|
|
}
|
|
|
|
// cgo.Handle value for overwritten implementation
|
|
intptr_t handle__ChildEvent = 0;
|
|
|
|
// Subclass to allow providing a Go implementation
|
|
virtual void childEvent(QChildEvent* event) override {
|
|
if (handle__ChildEvent == 0) {
|
|
QTranslator::childEvent(event);
|
|
return;
|
|
}
|
|
|
|
QChildEvent* sigval1 = event;
|
|
|
|
miqt_exec_callback_QTranslator_ChildEvent(this, handle__ChildEvent, sigval1);
|
|
|
|
|
|
}
|
|
|
|
// Wrapper to allow calling protected method
|
|
void virtualbase_ChildEvent(QChildEvent* event) {
|
|
|
|
QTranslator::childEvent(event);
|
|
|
|
}
|
|
|
|
// cgo.Handle value for overwritten implementation
|
|
intptr_t handle__CustomEvent = 0;
|
|
|
|
// Subclass to allow providing a Go implementation
|
|
virtual void customEvent(QEvent* event) override {
|
|
if (handle__CustomEvent == 0) {
|
|
QTranslator::customEvent(event);
|
|
return;
|
|
}
|
|
|
|
QEvent* sigval1 = event;
|
|
|
|
miqt_exec_callback_QTranslator_CustomEvent(this, handle__CustomEvent, sigval1);
|
|
|
|
|
|
}
|
|
|
|
// Wrapper to allow calling protected method
|
|
void virtualbase_CustomEvent(QEvent* event) {
|
|
|
|
QTranslator::customEvent(event);
|
|
|
|
}
|
|
|
|
// cgo.Handle value for overwritten implementation
|
|
intptr_t handle__ConnectNotify = 0;
|
|
|
|
// Subclass to allow providing a Go implementation
|
|
virtual void connectNotify(const QMetaMethod& signal) override {
|
|
if (handle__ConnectNotify == 0) {
|
|
QTranslator::connectNotify(signal);
|
|
return;
|
|
}
|
|
|
|
const QMetaMethod& signal_ret = signal;
|
|
// Cast returned reference into pointer
|
|
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
|
|
|
miqt_exec_callback_QTranslator_ConnectNotify(this, handle__ConnectNotify, sigval1);
|
|
|
|
|
|
}
|
|
|
|
// Wrapper to allow calling protected method
|
|
void virtualbase_ConnectNotify(QMetaMethod* signal) {
|
|
|
|
QTranslator::connectNotify(*signal);
|
|
|
|
}
|
|
|
|
// cgo.Handle value for overwritten implementation
|
|
intptr_t handle__DisconnectNotify = 0;
|
|
|
|
// Subclass to allow providing a Go implementation
|
|
virtual void disconnectNotify(const QMetaMethod& signal) override {
|
|
if (handle__DisconnectNotify == 0) {
|
|
QTranslator::disconnectNotify(signal);
|
|
return;
|
|
}
|
|
|
|
const QMetaMethod& signal_ret = signal;
|
|
// Cast returned reference into pointer
|
|
QMetaMethod* sigval1 = const_cast<QMetaMethod*>(&signal_ret);
|
|
|
|
miqt_exec_callback_QTranslator_DisconnectNotify(this, handle__DisconnectNotify, sigval1);
|
|
|
|
|
|
}
|
|
|
|
// Wrapper to allow calling protected method
|
|
void virtualbase_DisconnectNotify(QMetaMethod* signal) {
|
|
|
|
QTranslator::disconnectNotify(*signal);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
void QTranslator_new(QTranslator** outptr_QTranslator, QObject** outptr_QObject) {
|
|
MiqtVirtualQTranslator* ret = new MiqtVirtualQTranslator();
|
|
*outptr_QTranslator = ret;
|
|
*outptr_QObject = static_cast<QObject*>(ret);
|
|
}
|
|
|
|
void QTranslator_new2(QObject* parent, QTranslator** outptr_QTranslator, QObject** outptr_QObject) {
|
|
MiqtVirtualQTranslator* ret = new MiqtVirtualQTranslator(parent);
|
|
*outptr_QTranslator = ret;
|
|
*outptr_QObject = static_cast<QObject*>(ret);
|
|
}
|
|
|
|
QMetaObject* QTranslator_MetaObject(const QTranslator* self) {
|
|
return (QMetaObject*) self->metaObject();
|
|
}
|
|
|
|
void* QTranslator_Metacast(QTranslator* self, const char* param1) {
|
|
return self->qt_metacast(param1);
|
|
}
|
|
|
|
struct miqt_string QTranslator_Tr(const char* s) {
|
|
QString _ret = QTranslator::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 QTranslator_Translate(const QTranslator* self, const char* context, const char* sourceText, const char* disambiguation, int n) {
|
|
QString _ret = self->translate(context, sourceText, disambiguation, 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;
|
|
}
|
|
|
|
bool QTranslator_IsEmpty(const QTranslator* self) {
|
|
return self->isEmpty();
|
|
}
|
|
|
|
struct miqt_string QTranslator_Language(const QTranslator* self) {
|
|
QString _ret = self->language();
|
|
// 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 QTranslator_FilePath(const QTranslator* self) {
|
|
QString _ret = self->filePath();
|
|
// 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;
|
|
}
|
|
|
|
bool QTranslator_Load(QTranslator* self, struct miqt_string filename) {
|
|
QString filename_QString = QString::fromUtf8(filename.data, filename.len);
|
|
return self->load(filename_QString);
|
|
}
|
|
|
|
bool QTranslator_Load2(QTranslator* self, QLocale* locale, struct miqt_string filename) {
|
|
QString filename_QString = QString::fromUtf8(filename.data, filename.len);
|
|
return self->load(*locale, filename_QString);
|
|
}
|
|
|
|
bool QTranslator_Load3(QTranslator* self, const unsigned char* data, int lenVal) {
|
|
return self->load(static_cast<const uchar*>(data), static_cast<int>(lenVal));
|
|
}
|
|
|
|
struct miqt_string QTranslator_Tr2(const char* s, const char* c) {
|
|
QString _ret = QTranslator::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 QTranslator_Tr3(const char* s, const char* c, int n) {
|
|
QString _ret = QTranslator::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;
|
|
}
|
|
|
|
bool QTranslator_Load22(QTranslator* self, struct miqt_string filename, struct miqt_string directory) {
|
|
QString filename_QString = QString::fromUtf8(filename.data, filename.len);
|
|
QString directory_QString = QString::fromUtf8(directory.data, directory.len);
|
|
return self->load(filename_QString, directory_QString);
|
|
}
|
|
|
|
bool QTranslator_Load32(QTranslator* self, struct miqt_string filename, struct miqt_string directory, struct miqt_string search_delimiters) {
|
|
QString filename_QString = QString::fromUtf8(filename.data, filename.len);
|
|
QString directory_QString = QString::fromUtf8(directory.data, directory.len);
|
|
QString search_delimiters_QString = QString::fromUtf8(search_delimiters.data, search_delimiters.len);
|
|
return self->load(filename_QString, directory_QString, search_delimiters_QString);
|
|
}
|
|
|
|
bool QTranslator_Load4(QTranslator* self, struct miqt_string filename, struct miqt_string directory, struct miqt_string search_delimiters, struct miqt_string suffix) {
|
|
QString filename_QString = QString::fromUtf8(filename.data, filename.len);
|
|
QString directory_QString = QString::fromUtf8(directory.data, directory.len);
|
|
QString search_delimiters_QString = QString::fromUtf8(search_delimiters.data, search_delimiters.len);
|
|
QString suffix_QString = QString::fromUtf8(suffix.data, suffix.len);
|
|
return self->load(filename_QString, directory_QString, search_delimiters_QString, suffix_QString);
|
|
}
|
|
|
|
bool QTranslator_Load33(QTranslator* self, QLocale* locale, struct miqt_string filename, struct miqt_string prefix) {
|
|
QString filename_QString = QString::fromUtf8(filename.data, filename.len);
|
|
QString prefix_QString = QString::fromUtf8(prefix.data, prefix.len);
|
|
return self->load(*locale, filename_QString, prefix_QString);
|
|
}
|
|
|
|
bool QTranslator_Load42(QTranslator* self, QLocale* locale, struct miqt_string filename, struct miqt_string prefix, struct miqt_string directory) {
|
|
QString filename_QString = QString::fromUtf8(filename.data, filename.len);
|
|
QString prefix_QString = QString::fromUtf8(prefix.data, prefix.len);
|
|
QString directory_QString = QString::fromUtf8(directory.data, directory.len);
|
|
return self->load(*locale, filename_QString, prefix_QString, directory_QString);
|
|
}
|
|
|
|
bool QTranslator_Load5(QTranslator* self, QLocale* locale, struct miqt_string filename, struct miqt_string prefix, struct miqt_string directory, struct miqt_string suffix) {
|
|
QString filename_QString = QString::fromUtf8(filename.data, filename.len);
|
|
QString prefix_QString = QString::fromUtf8(prefix.data, prefix.len);
|
|
QString directory_QString = QString::fromUtf8(directory.data, directory.len);
|
|
QString suffix_QString = QString::fromUtf8(suffix.data, suffix.len);
|
|
return self->load(*locale, filename_QString, prefix_QString, directory_QString, suffix_QString);
|
|
}
|
|
|
|
bool QTranslator_Load34(QTranslator* self, const unsigned char* data, int lenVal, struct miqt_string directory) {
|
|
QString directory_QString = QString::fromUtf8(directory.data, directory.len);
|
|
return self->load(static_cast<const uchar*>(data), static_cast<int>(lenVal), directory_QString);
|
|
}
|
|
|
|
void QTranslator_override_virtual_Translate(void* self, intptr_t slot) {
|
|
dynamic_cast<MiqtVirtualQTranslator*>( (QTranslator*)(self) )->handle__Translate = slot;
|
|
}
|
|
|
|
struct miqt_string QTranslator_virtualbase_Translate(const void* self, const char* context, const char* sourceText, const char* disambiguation, int n) {
|
|
return ( (const MiqtVirtualQTranslator*)(self) )->virtualbase_Translate(context, sourceText, disambiguation, n);
|
|
}
|
|
|
|
void QTranslator_override_virtual_IsEmpty(void* self, intptr_t slot) {
|
|
dynamic_cast<MiqtVirtualQTranslator*>( (QTranslator*)(self) )->handle__IsEmpty = slot;
|
|
}
|
|
|
|
bool QTranslator_virtualbase_IsEmpty(const void* self) {
|
|
return ( (const MiqtVirtualQTranslator*)(self) )->virtualbase_IsEmpty();
|
|
}
|
|
|
|
void QTranslator_override_virtual_Event(void* self, intptr_t slot) {
|
|
dynamic_cast<MiqtVirtualQTranslator*>( (QTranslator*)(self) )->handle__Event = slot;
|
|
}
|
|
|
|
bool QTranslator_virtualbase_Event(void* self, QEvent* event) {
|
|
return ( (MiqtVirtualQTranslator*)(self) )->virtualbase_Event(event);
|
|
}
|
|
|
|
void QTranslator_override_virtual_EventFilter(void* self, intptr_t slot) {
|
|
dynamic_cast<MiqtVirtualQTranslator*>( (QTranslator*)(self) )->handle__EventFilter = slot;
|
|
}
|
|
|
|
bool QTranslator_virtualbase_EventFilter(void* self, QObject* watched, QEvent* event) {
|
|
return ( (MiqtVirtualQTranslator*)(self) )->virtualbase_EventFilter(watched, event);
|
|
}
|
|
|
|
void QTranslator_override_virtual_TimerEvent(void* self, intptr_t slot) {
|
|
dynamic_cast<MiqtVirtualQTranslator*>( (QTranslator*)(self) )->handle__TimerEvent = slot;
|
|
}
|
|
|
|
void QTranslator_virtualbase_TimerEvent(void* self, QTimerEvent* event) {
|
|
( (MiqtVirtualQTranslator*)(self) )->virtualbase_TimerEvent(event);
|
|
}
|
|
|
|
void QTranslator_override_virtual_ChildEvent(void* self, intptr_t slot) {
|
|
dynamic_cast<MiqtVirtualQTranslator*>( (QTranslator*)(self) )->handle__ChildEvent = slot;
|
|
}
|
|
|
|
void QTranslator_virtualbase_ChildEvent(void* self, QChildEvent* event) {
|
|
( (MiqtVirtualQTranslator*)(self) )->virtualbase_ChildEvent(event);
|
|
}
|
|
|
|
void QTranslator_override_virtual_CustomEvent(void* self, intptr_t slot) {
|
|
dynamic_cast<MiqtVirtualQTranslator*>( (QTranslator*)(self) )->handle__CustomEvent = slot;
|
|
}
|
|
|
|
void QTranslator_virtualbase_CustomEvent(void* self, QEvent* event) {
|
|
( (MiqtVirtualQTranslator*)(self) )->virtualbase_CustomEvent(event);
|
|
}
|
|
|
|
void QTranslator_override_virtual_ConnectNotify(void* self, intptr_t slot) {
|
|
dynamic_cast<MiqtVirtualQTranslator*>( (QTranslator*)(self) )->handle__ConnectNotify = slot;
|
|
}
|
|
|
|
void QTranslator_virtualbase_ConnectNotify(void* self, QMetaMethod* signal) {
|
|
( (MiqtVirtualQTranslator*)(self) )->virtualbase_ConnectNotify(signal);
|
|
}
|
|
|
|
void QTranslator_override_virtual_DisconnectNotify(void* self, intptr_t slot) {
|
|
dynamic_cast<MiqtVirtualQTranslator*>( (QTranslator*)(self) )->handle__DisconnectNotify = slot;
|
|
}
|
|
|
|
void QTranslator_virtualbase_DisconnectNotify(void* self, QMetaMethod* signal) {
|
|
( (MiqtVirtualQTranslator*)(self) )->virtualbase_DisconnectNotify(signal);
|
|
}
|
|
|
|
void QTranslator_Delete(QTranslator* self, bool isSubclass) {
|
|
if (isSubclass) {
|
|
delete dynamic_cast<MiqtVirtualQTranslator*>( self );
|
|
} else {
|
|
delete self;
|
|
}
|
|
}
|
|
|