miqt/qt/gen_qsocketnotifier.cpp

111 lines
3.5 KiB
C++
Raw Normal View History

#include <QMetaObject>
2024-08-29 07:01:51 +00:00
#include <QObject>
#include <QSocketDescriptor>
#include <QSocketNotifier>
#include <QString>
2024-08-29 07:01:51 +00:00
#include <QByteArray>
#include <cstring>
#include "qsocketnotifier.h"
#include "gen_qsocketnotifier.h"
#include "_cgo_export.h"
QSocketNotifier* QSocketNotifier_new(uintptr_t socket, uintptr_t param2) {
return new QSocketNotifier(static_cast<qptrdiff>(socket), static_cast<QSocketNotifier::Type>(param2));
2024-08-29 07:01:51 +00:00
}
QSocketNotifier* QSocketNotifier_new2(uintptr_t socket, uintptr_t param2, QObject* parent) {
return new QSocketNotifier(static_cast<qptrdiff>(socket), static_cast<QSocketNotifier::Type>(param2), parent);
2024-08-29 07:01:51 +00:00
}
QMetaObject* QSocketNotifier_MetaObject(const QSocketNotifier* self) {
return (QMetaObject*) self->metaObject();
}
struct miqt_string* QSocketNotifier_Tr(const char* s) {
QString _ret = QSocketNotifier::tr(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
struct miqt_string* QSocketNotifier_TrUtf8(const char* s) {
QString _ret = QSocketNotifier::trUtf8(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
ptrdiff_t QSocketNotifier_Socket(const QSocketNotifier* self) {
return self->socket();
2024-08-29 07:01:51 +00:00
}
uintptr_t QSocketNotifier_Type(const QSocketNotifier* self) {
QSocketNotifier::Type _ret = self->type();
return static_cast<uintptr_t>(_ret);
}
bool QSocketNotifier_IsEnabled(const QSocketNotifier* self) {
return self->isEnabled();
}
void QSocketNotifier_SetEnabled(QSocketNotifier* self, bool enabled) {
self->setEnabled(enabled);
}
struct miqt_string* QSocketNotifier_Tr2(const char* s, const char* c) {
QString _ret = QSocketNotifier::tr(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
struct miqt_string* QSocketNotifier_Tr3(const char* s, const char* c, int n) {
QString _ret = QSocketNotifier::tr(s, c, static_cast<int>(n));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
struct miqt_string* QSocketNotifier_TrUtf82(const char* s, const char* c) {
QString _ret = QSocketNotifier::trUtf8(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
struct miqt_string* QSocketNotifier_TrUtf83(const char* s, const char* c, int n) {
QString _ret = QSocketNotifier::trUtf8(s, c, static_cast<int>(n));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
void QSocketNotifier_Delete(QSocketNotifier* self) {
delete self;
}
2024-08-29 07:01:51 +00:00
QSocketDescriptor* QSocketDescriptor_new() {
return new QSocketDescriptor();
}
QSocketDescriptor* QSocketDescriptor_new2(QSocketDescriptor* param1) {
return new QSocketDescriptor(*param1);
}
2024-08-29 07:01:51 +00:00
QSocketDescriptor* QSocketDescriptor_new3(uintptr_t descriptor) {
#ifdef Q_OS_LINUX
2024-08-29 07:01:51 +00:00
return new QSocketDescriptor(static_cast<QSocketDescriptor::DescriptorType>(descriptor));
#else
return nullptr;
#endif
2024-08-29 07:01:51 +00:00
}
bool QSocketDescriptor_IsValid(const QSocketDescriptor* self) {
return self->isValid();
}
void QSocketDescriptor_Delete(QSocketDescriptor* self) {
delete self;
}