#include #include #include #include #include #include #include "gen_qwebenginescript.h" #ifndef _Bool #define _Bool bool #endif #include "_cgo_export.h" QWebEngineScript* QWebEngineScript_new() { return new QWebEngineScript(); } QWebEngineScript* QWebEngineScript_new2(QWebEngineScript* other) { return new QWebEngineScript(*other); } void QWebEngineScript_OperatorAssign(QWebEngineScript* self, QWebEngineScript* other) { self->operator=(*other); } struct miqt_string QWebEngineScript_Name(const QWebEngineScript* self) { QString _ret = self->name(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QWebEngineScript_SetName(QWebEngineScript* self, struct miqt_string name) { QString name_QString = QString::fromUtf8(name.data, name.len); self->setName(name_QString); } QUrl* QWebEngineScript_SourceUrl(const QWebEngineScript* self) { return new QUrl(self->sourceUrl()); } void QWebEngineScript_SetSourceUrl(QWebEngineScript* self, QUrl* url) { self->setSourceUrl(*url); } struct miqt_string QWebEngineScript_SourceCode(const QWebEngineScript* self) { QString _ret = self->sourceCode(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray _b = _ret.toUtf8(); struct miqt_string _ms; _ms.len = _b.length(); _ms.data = static_cast(malloc(_ms.len)); memcpy(_ms.data, _b.data(), _ms.len); return _ms; } void QWebEngineScript_SetSourceCode(QWebEngineScript* self, struct miqt_string sourceCode) { QString sourceCode_QString = QString::fromUtf8(sourceCode.data, sourceCode.len); self->setSourceCode(sourceCode_QString); } int QWebEngineScript_InjectionPoint(const QWebEngineScript* self) { QWebEngineScript::InjectionPoint _ret = self->injectionPoint(); return static_cast(_ret); } void QWebEngineScript_SetInjectionPoint(QWebEngineScript* self, int injectionPoint) { self->setInjectionPoint(static_cast(injectionPoint)); } unsigned int QWebEngineScript_WorldId(const QWebEngineScript* self) { quint32 _ret = self->worldId(); return static_cast(_ret); } void QWebEngineScript_SetWorldId(QWebEngineScript* self, unsigned int worldId) { self->setWorldId(static_cast(worldId)); } bool QWebEngineScript_RunsOnSubFrames(const QWebEngineScript* self) { return self->runsOnSubFrames(); } void QWebEngineScript_SetRunsOnSubFrames(QWebEngineScript* self, bool on) { self->setRunsOnSubFrames(on); } bool QWebEngineScript_OperatorEqual(const QWebEngineScript* self, QWebEngineScript* other) { return (*self == *other); } bool QWebEngineScript_OperatorNotEqual(const QWebEngineScript* self, QWebEngineScript* other) { return (*self != *other); } void QWebEngineScript_Swap(QWebEngineScript* self, QWebEngineScript* other) { self->swap(*other); } void QWebEngineScript_Delete(QWebEngineScript* self, bool isSubclass) { if (isSubclass) { delete dynamic_cast( self ); } else { delete self; } }