2024-08-25 04:08:24 +00:00
|
|
|
#include <QFutureInterfaceBase>
|
|
|
|
#include <QMutex>
|
|
|
|
#include <QRunnable>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QThreadPool>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qfutureinterface.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qfutureinterface.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QFutureInterfaceBase_new(QFutureInterfaceBase** outptr_QFutureInterfaceBase) {
|
|
|
|
QFutureInterfaceBase* ret = new QFutureInterfaceBase();
|
|
|
|
*outptr_QFutureInterfaceBase = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QFutureInterfaceBase_new2(QFutureInterfaceBase* other, QFutureInterfaceBase** outptr_QFutureInterfaceBase) {
|
|
|
|
QFutureInterfaceBase* ret = new QFutureInterfaceBase(*other);
|
|
|
|
*outptr_QFutureInterfaceBase = ret;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QFutureInterfaceBase_new3(int initialState, QFutureInterfaceBase** outptr_QFutureInterfaceBase) {
|
|
|
|
QFutureInterfaceBase* ret = new QFutureInterfaceBase(static_cast<QFutureInterfaceBase::State>(initialState));
|
|
|
|
*outptr_QFutureInterfaceBase = ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QFutureInterfaceBase_ReportStarted(QFutureInterfaceBase* self) {
|
|
|
|
self->reportStarted();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_ReportFinished(QFutureInterfaceBase* self) {
|
|
|
|
self->reportFinished();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_ReportCanceled(QFutureInterfaceBase* self) {
|
|
|
|
self->reportCanceled();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_ReportResultsReady(QFutureInterfaceBase* self, int beginIndex, int endIndex) {
|
|
|
|
self->reportResultsReady(static_cast<int>(beginIndex), static_cast<int>(endIndex));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_SetRunnable(QFutureInterfaceBase* self, QRunnable* runnable) {
|
|
|
|
self->setRunnable(runnable);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_SetThreadPool(QFutureInterfaceBase* self, QThreadPool* pool) {
|
|
|
|
self->setThreadPool(pool);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_SetFilterMode(QFutureInterfaceBase* self, bool enable) {
|
|
|
|
self->setFilterMode(enable);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_SetProgressRange(QFutureInterfaceBase* self, int minimum, int maximum) {
|
|
|
|
self->setProgressRange(static_cast<int>(minimum), static_cast<int>(maximum));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFutureInterfaceBase_ProgressMinimum(const QFutureInterfaceBase* self) {
|
|
|
|
return self->progressMinimum();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFutureInterfaceBase_ProgressMaximum(const QFutureInterfaceBase* self) {
|
|
|
|
return self->progressMaximum();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFutureInterfaceBase_IsProgressUpdateNeeded(const QFutureInterfaceBase* self) {
|
|
|
|
return self->isProgressUpdateNeeded();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_SetProgressValue(QFutureInterfaceBase* self, int progressValue) {
|
|
|
|
self->setProgressValue(static_cast<int>(progressValue));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFutureInterfaceBase_ProgressValue(const QFutureInterfaceBase* self) {
|
|
|
|
return self->progressValue();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
void QFutureInterfaceBase_SetProgressValueAndText(QFutureInterfaceBase* self, int progressValue, struct miqt_string progressText) {
|
|
|
|
QString progressText_QString = QString::fromUtf8(progressText.data, progressText.len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setProgressValueAndText(static_cast<int>(progressValue), progressText_QString);
|
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFutureInterfaceBase_ProgressText(const QFutureInterfaceBase* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->progressText();
|
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 QFutureInterfaceBase_SetExpectedResultCount(QFutureInterfaceBase* self, int resultCount) {
|
|
|
|
self->setExpectedResultCount(static_cast<int>(resultCount));
|
|
|
|
}
|
|
|
|
|
|
|
|
int QFutureInterfaceBase_ExpectedResultCount(QFutureInterfaceBase* self) {
|
|
|
|
return self->expectedResultCount();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFutureInterfaceBase_ResultCount(const QFutureInterfaceBase* self) {
|
|
|
|
return self->resultCount();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
bool QFutureInterfaceBase_QueryState(const QFutureInterfaceBase* self, int state) {
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->queryState(static_cast<QFutureInterfaceBase::State>(state));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFutureInterfaceBase_IsRunning(const QFutureInterfaceBase* self) {
|
|
|
|
return self->isRunning();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFutureInterfaceBase_IsStarted(const QFutureInterfaceBase* self) {
|
|
|
|
return self->isStarted();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFutureInterfaceBase_IsCanceled(const QFutureInterfaceBase* self) {
|
|
|
|
return self->isCanceled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFutureInterfaceBase_IsFinished(const QFutureInterfaceBase* self) {
|
|
|
|
return self->isFinished();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFutureInterfaceBase_IsPaused(const QFutureInterfaceBase* self) {
|
|
|
|
return self->isPaused();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFutureInterfaceBase_IsThrottled(const QFutureInterfaceBase* self) {
|
|
|
|
return self->isThrottled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFutureInterfaceBase_IsResultReadyAt(const QFutureInterfaceBase* self, int index) {
|
|
|
|
return self->isResultReadyAt(static_cast<int>(index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_Cancel(QFutureInterfaceBase* self) {
|
|
|
|
self->cancel();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_SetPaused(QFutureInterfaceBase* self, bool paused) {
|
|
|
|
self->setPaused(paused);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_TogglePaused(QFutureInterfaceBase* self) {
|
|
|
|
self->togglePaused();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_SetThrottled(QFutureInterfaceBase* self, bool enable) {
|
|
|
|
self->setThrottled(enable);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_WaitForFinished(QFutureInterfaceBase* self) {
|
|
|
|
self->waitForFinished();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFutureInterfaceBase_WaitForNextResult(QFutureInterfaceBase* self) {
|
|
|
|
return self->waitForNextResult();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_WaitForResult(QFutureInterfaceBase* self, int resultIndex) {
|
|
|
|
self->waitForResult(static_cast<int>(resultIndex));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_WaitForResume(QFutureInterfaceBase* self) {
|
|
|
|
self->waitForResume();
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMutex* QFutureInterfaceBase_Mutex(const QFutureInterfaceBase* self) {
|
|
|
|
return self->mutex();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMutex* QFutureInterfaceBase_MutexWithInt(const QFutureInterfaceBase* self, int param1) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QMutex& _ret = self->mutex(static_cast<int>(param1));
|
2024-08-29 07:01:51 +00:00
|
|
|
// Cast returned reference into pointer
|
2024-09-14 22:29:05 +00:00
|
|
|
return &_ret;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFutureInterfaceBase_OperatorEqual(const QFutureInterfaceBase* self, QFutureInterfaceBase* other) {
|
|
|
|
return self->operator==(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFutureInterfaceBase_OperatorNotEqual(const QFutureInterfaceBase* self, QFutureInterfaceBase* other) {
|
|
|
|
return self->operator!=(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFutureInterfaceBase_OperatorAssign(QFutureInterfaceBase* self, QFutureInterfaceBase* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QFutureInterfaceBase_Delete(QFutureInterfaceBase* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QFutureInterfaceBase*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|