mirror of
https://github.com/mappu/miqt.git
synced 2025-01-20 21:50:38 +00:00
a0c6344ecd
The expected type of the callback is already known from the AST - this change reduces dependency on cgo specifics and makes the generated C ABI entirely cgo-independent - in particular, there is no need to include `_cgo_export.h` any more.
50 lines
993 B
C++
50 lines
993 B
C++
#include <QBasicTimer>
|
|
#include <QObject>
|
|
#include <qbasictimer.h>
|
|
#include "gen_qbasictimer.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
} /* extern C */
|
|
#endif
|
|
|
|
QBasicTimer* QBasicTimer_new() {
|
|
return new QBasicTimer();
|
|
}
|
|
|
|
void QBasicTimer_Swap(QBasicTimer* self, QBasicTimer* other) {
|
|
self->swap(*other);
|
|
}
|
|
|
|
bool QBasicTimer_IsActive(const QBasicTimer* self) {
|
|
return self->isActive();
|
|
}
|
|
|
|
int QBasicTimer_TimerId(const QBasicTimer* self) {
|
|
return self->timerId();
|
|
}
|
|
|
|
void QBasicTimer_Start(QBasicTimer* self, int msec, QObject* obj) {
|
|
self->start(static_cast<int>(msec), obj);
|
|
}
|
|
|
|
void QBasicTimer_Start2(QBasicTimer* self, int msec, int timerType, QObject* obj) {
|
|
self->start(static_cast<int>(msec), static_cast<Qt::TimerType>(timerType), obj);
|
|
}
|
|
|
|
void QBasicTimer_Stop(QBasicTimer* self) {
|
|
self->stop();
|
|
}
|
|
|
|
void QBasicTimer_Delete(QBasicTimer* self, bool isSubclass) {
|
|
if (isSubclass) {
|
|
delete dynamic_cast<QBasicTimer*>( self );
|
|
} else {
|
|
delete self;
|
|
}
|
|
}
|
|
|