mirror of
https://github.com/mappu/miqt.git
synced 2025-02-01 11:00:22 +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.
48 lines
983 B
C++
48 lines
983 B
C++
#include <QScriptContext>
|
|
#include <QScriptEngine>
|
|
#include <QScriptValue>
|
|
#include <QScriptable>
|
|
#include <qscriptable.h>
|
|
#include "gen_qscriptable.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
} /* extern C */
|
|
#endif
|
|
|
|
QScriptable* QScriptable_new() {
|
|
return new QScriptable();
|
|
}
|
|
|
|
QScriptEngine* QScriptable_Engine(const QScriptable* self) {
|
|
return self->engine();
|
|
}
|
|
|
|
QScriptContext* QScriptable_Context(const QScriptable* self) {
|
|
return self->context();
|
|
}
|
|
|
|
QScriptValue* QScriptable_ThisObject(const QScriptable* self) {
|
|
return new QScriptValue(self->thisObject());
|
|
}
|
|
|
|
int QScriptable_ArgumentCount(const QScriptable* self) {
|
|
return self->argumentCount();
|
|
}
|
|
|
|
QScriptValue* QScriptable_Argument(const QScriptable* self, int index) {
|
|
return new QScriptValue(self->argument(static_cast<int>(index)));
|
|
}
|
|
|
|
void QScriptable_Delete(QScriptable* self, bool isSubclass) {
|
|
if (isSubclass) {
|
|
delete dynamic_cast<QScriptable*>( self );
|
|
} else {
|
|
delete self;
|
|
}
|
|
}
|
|
|