#pragma once
#include <cstdint>
#include <string>
#include <QtCore/QObject>
#include <QtCore/Qt>
#include <sys/types.h>
#include "rust/cxx.h"
static bool g_hasVoidTrampoline = false;
static bool g_hasBoolTrampoline = false;
static bool g_hasIntTrampoline = false;
static bool g_hasStringTrampoline = false;
static rust::Fn<void(uint64_t)> g_voidTrampoline;
static rust::Fn<void(uint64_t, bool)> g_boolTrampoline;
static rust::Fn<void(uint64_t, int32_t)> g_intTrampoline;
static rust::Fn<void(uint64_t, rust::String)> g_stringTrampoline;
inline void qtrs_setVoidTrampoline(rust::Fn<void(uint64_t)> t) {
g_voidTrampoline = t;
g_hasVoidTrampoline = true;
}
inline void qtrs_setBoolTrampoline(rust::Fn<void(uint64_t, bool)> t) {
g_boolTrampoline = t;
g_hasBoolTrampoline = true;
}
inline void qtrs_setIntTrampoline(rust::Fn<void(uint64_t, int32_t)> t) {
g_intTrampoline = t;
g_hasIntTrampoline = true;
}
inline void qtrs_setStringTrampoline(rust::Fn<void(uint64_t, rust::String)> t) {
g_stringTrampoline = t;
g_hasStringTrampoline = true;
}
inline bool QObject_connect(
QObject* sender,
const std::string& sig,
QObject* receiver,
const std::string& slt,
int connType
) {
Qt::ConnectionType type = static_cast<Qt::ConnectionType>(connType);
return QObject::connect(sender, sig.c_str(), receiver, slt.c_str(), type);
}
inline bool QObject_disconnect(
QObject* sender,
const std::string& sig,
QObject* receiver,
const std::string& slt
) {
return QObject::disconnect(sender, sig.c_str(), receiver, slt.c_str());
}