2024-08-25 04:08:24 +00:00
|
|
|
#include <QRunnable>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qrunnable.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qrunnable.h"
|
2024-12-11 06:55:47 +00:00
|
|
|
|
|
|
|
#ifndef _Bool
|
|
|
|
#define _Bool bool
|
|
|
|
#endif
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-11-23 06:34:52 +00:00
|
|
|
class MiqtVirtualQRunnable : public virtual QRunnable {
|
|
|
|
public:
|
|
|
|
|
|
|
|
MiqtVirtualQRunnable(): QRunnable() {};
|
|
|
|
|
|
|
|
virtual ~MiqtVirtualQRunnable() = default;
|
|
|
|
|
|
|
|
// cgo.Handle value for overwritten implementation
|
|
|
|
intptr_t handle__Run = 0;
|
|
|
|
|
|
|
|
// Subclass to allow providing a Go implementation
|
|
|
|
virtual void run() override {
|
|
|
|
if (handle__Run == 0) {
|
|
|
|
return; // Pure virtual, there is no base we can call
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
miqt_exec_callback_QRunnable_Run(this, handle__Run);
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QRunnable* QRunnable_new() {
|
|
|
|
return new MiqtVirtualQRunnable();
|
2024-11-23 06:34:52 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QRunnable_Run(QRunnable* self) {
|
|
|
|
self->run();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QRunnable_AutoDelete(const QRunnable* self) {
|
|
|
|
return self->autoDelete();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QRunnable_SetAutoDelete(QRunnable* self, bool _autoDelete) {
|
|
|
|
self->setAutoDelete(_autoDelete);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QRunnable_OperatorAssign(QRunnable* self, QRunnable* param1) {
|
|
|
|
self->operator=(*param1);
|
|
|
|
}
|
|
|
|
|
2024-11-23 06:34:52 +00:00
|
|
|
void QRunnable_override_virtual_Run(void* self, intptr_t slot) {
|
|
|
|
dynamic_cast<MiqtVirtualQRunnable*>( (QRunnable*)(self) )->handle__Run = slot;
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QRunnable_Delete(QRunnable* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
2024-11-23 06:34:52 +00:00
|
|
|
delete dynamic_cast<MiqtVirtualQRunnable*>( self );
|
2024-11-19 06:29:06 +00:00
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|