2024-08-25 04:08:24 +00:00
|
|
|
#include <QDrag>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QMimeData>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QPixmap>
|
|
|
|
#include <QPoint>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
|
|
|
#include "qdrag.h"
|
|
|
|
#include "gen_qdrag.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QDrag* QDrag_new(QObject* dragSource) {
|
|
|
|
return new QDrag(dragSource);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QDrag_MetaObject(const QDrag* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDrag_Tr(const char* s) {
|
|
|
|
QString _ret = QDrag::tr(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDrag_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QDrag::trUtf8(s);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QDrag_SetMimeData(QDrag* self, QMimeData* data) {
|
|
|
|
self->setMimeData(data);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMimeData* QDrag_MimeData(const QDrag* self) {
|
|
|
|
return self->mimeData();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QDrag_SetPixmap(QDrag* self, QPixmap* pixmap) {
|
|
|
|
self->setPixmap(*pixmap);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QPixmap* QDrag_Pixmap(const QDrag* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QPixmap(self->pixmap());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QDrag_SetHotSpot(QDrag* self, QPoint* hotspot) {
|
|
|
|
self->setHotSpot(*hotspot);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QPoint* QDrag_HotSpot(const QDrag* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QPoint(self->hotSpot());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QObject* QDrag_Source(const QDrag* self) {
|
|
|
|
return self->source();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QObject* QDrag_Target(const QDrag* self) {
|
|
|
|
return self->target();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uintptr_t QDrag_Start(QDrag* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::DropAction _ret = self->start();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uintptr_t QDrag_Exec(QDrag* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::DropAction _ret = self->exec();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uintptr_t QDrag_Exec2(QDrag* self, int supportedActions, uintptr_t defaultAction) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::DropAction _ret = self->exec(static_cast<Qt::DropActions>(supportedActions), static_cast<Qt::DropAction>(defaultAction));
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QDrag_SetDragCursor(QDrag* self, QPixmap* cursor, uintptr_t action) {
|
|
|
|
self->setDragCursor(*cursor, static_cast<Qt::DropAction>(action));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QPixmap* QDrag_DragCursor(const QDrag* self, uintptr_t action) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QPixmap(self->dragCursor(static_cast<Qt::DropAction>(action)));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QDrag_SupportedActions(const QDrag* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::DropActions _ret = self->supportedActions();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
uintptr_t QDrag_DefaultAction(const QDrag* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::DropAction _ret = self->defaultAction();
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QDrag_Cancel() {
|
|
|
|
QDrag::cancel();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QDrag_ActionChanged(QDrag* self, uintptr_t action) {
|
|
|
|
self->actionChanged(static_cast<Qt::DropAction>(action));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QDrag_connect_ActionChanged(QDrag* self, void* slot) {
|
|
|
|
QDrag::connect(self, static_cast<void (QDrag::*)(Qt::DropAction)>(&QDrag::actionChanged), self, [=](Qt::DropAction action) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::DropAction action_ret = action;
|
|
|
|
uintptr_t sigval1 = static_cast<uintptr_t>(action_ret);
|
|
|
|
miqt_exec_callback_QDrag_ActionChanged(slot, sigval1);
|
2024-08-29 07:01:51 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QDrag_TargetChanged(QDrag* self, QObject* newTarget) {
|
|
|
|
self->targetChanged(newTarget);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QDrag_connect_TargetChanged(QDrag* self, void* slot) {
|
|
|
|
QDrag::connect(self, static_cast<void (QDrag::*)(QObject*)>(&QDrag::targetChanged), self, [=](QObject* newTarget) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QObject* sigval1 = newTarget;
|
|
|
|
miqt_exec_callback_QDrag_TargetChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDrag_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QDrag::tr(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDrag_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QDrag::tr(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDrag_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QDrag::trUtf8(s, c);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QDrag_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QDrag::trUtf8(s, c, static_cast<int>(n));
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
uintptr_t QDrag_Start1(QDrag* self, int supportedActions) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::DropAction _ret = self->start(static_cast<Qt::DropActions>(supportedActions));
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
uintptr_t QDrag_Exec1(QDrag* self, int supportedActions) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::DropAction _ret = self->exec(static_cast<Qt::DropActions>(supportedActions));
|
|
|
|
return static_cast<uintptr_t>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QDrag_Delete(QDrag* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|