2024-08-25 04:08:24 +00:00
|
|
|
#include <QEvent>
|
|
|
|
#include <QEventLoop>
|
|
|
|
#include <QEventLoopLocker>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QThread>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qeventloop.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qeventloop.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QEventLoop* QEventLoop_new() {
|
|
|
|
return new QEventLoop();
|
|
|
|
}
|
|
|
|
|
|
|
|
QEventLoop* QEventLoop_new2(QObject* parent) {
|
|
|
|
return new QEventLoop(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QEventLoop_MetaObject(const QEventLoop* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QEventLoop_Metacast(QEventLoop* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QEventLoop_Tr(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QEventLoop::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 QEventLoop_TrUtf8(const char* s) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QEventLoop::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
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QEventLoop_ProcessEvents(QEventLoop* self) {
|
|
|
|
return self->processEvents();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QEventLoop_ProcessEvents2(QEventLoop* self, int flags, int maximumTime) {
|
|
|
|
self->processEvents(static_cast<QEventLoop::ProcessEventsFlags>(flags), static_cast<int>(maximumTime));
|
|
|
|
}
|
|
|
|
|
|
|
|
int QEventLoop_Exec(QEventLoop* self) {
|
|
|
|
return self->exec();
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QEventLoop_Exit(QEventLoop* self) {
|
|
|
|
self->exit();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QEventLoop_IsRunning(const QEventLoop* self) {
|
|
|
|
return self->isRunning();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QEventLoop_WakeUp(QEventLoop* self) {
|
|
|
|
self->wakeUp();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QEventLoop_Event(QEventLoop* self, QEvent* event) {
|
|
|
|
return self->event(event);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QEventLoop_Quit(QEventLoop* self) {
|
|
|
|
self->quit();
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QEventLoop_Tr2(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QEventLoop::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 QEventLoop_Tr3(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QEventLoop::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 QEventLoop_TrUtf82(const char* s, const char* c) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QEventLoop::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 QEventLoop_TrUtf83(const char* s, const char* c, int n) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QEventLoop::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-08-29 07:01:51 +00:00
|
|
|
bool QEventLoop_ProcessEvents1(QEventLoop* self, int flags) {
|
|
|
|
return self->processEvents(static_cast<QEventLoop::ProcessEventsFlags>(flags));
|
|
|
|
}
|
|
|
|
|
|
|
|
int QEventLoop_Exec1(QEventLoop* self, int flags) {
|
|
|
|
return self->exec(static_cast<QEventLoop::ProcessEventsFlags>(flags));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QEventLoop_Exit1(QEventLoop* self, int returnCode) {
|
|
|
|
self->exit(static_cast<int>(returnCode));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QEventLoop_Delete(QEventLoop* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
|
|
|
QEventLoopLocker* QEventLoopLocker_new() {
|
|
|
|
return new QEventLoopLocker();
|
|
|
|
}
|
|
|
|
|
|
|
|
QEventLoopLocker* QEventLoopLocker_new2(QEventLoop* loop) {
|
|
|
|
return new QEventLoopLocker(loop);
|
|
|
|
}
|
|
|
|
|
|
|
|
QEventLoopLocker* QEventLoopLocker_new3(QThread* thread) {
|
|
|
|
return new QEventLoopLocker(thread);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QEventLoopLocker_Delete(QEventLoopLocker* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|