2024-08-25 04:08:24 +00:00
|
|
|
#include <QKeySequence>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QList>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qkeysequence.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qkeysequence.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QKeySequence* QKeySequence_new() {
|
|
|
|
return new QKeySequence();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QKeySequence* QKeySequence_new2(struct miqt_string* key) {
|
|
|
|
QString key_QString = QString::fromUtf8(&key->data, key->len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QKeySequence(key_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QKeySequence* QKeySequence_new3(int k1) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QKeySequence(static_cast<int>(k1));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QKeySequence* QKeySequence_new4(QKeySequence* ks) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QKeySequence(*ks);
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QKeySequence* QKeySequence_new5(int key) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QKeySequence(static_cast<QKeySequence::StandardKey>(key));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QKeySequence* QKeySequence_new6(struct miqt_string* key, int format) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString key_QString = QString::fromUtf8(&key->data, key->len);
|
2024-08-29 07:01:51 +00:00
|
|
|
return new QKeySequence(key_QString, static_cast<QKeySequence::SequenceFormat>(format));
|
|
|
|
}
|
|
|
|
|
|
|
|
QKeySequence* QKeySequence_new7(int k1, int k2) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QKeySequence(static_cast<int>(k1), static_cast<int>(k2));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QKeySequence* QKeySequence_new8(int k1, int k2, int k3) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QKeySequence(static_cast<int>(k1), static_cast<int>(k2), static_cast<int>(k3));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QKeySequence* QKeySequence_new9(int k1, int k2, int k3, int k4) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QKeySequence(static_cast<int>(k1), static_cast<int>(k2), static_cast<int>(k3), static_cast<int>(k4));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QKeySequence_Count(const QKeySequence* self) {
|
|
|
|
return self->count();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QKeySequence_IsEmpty(const QKeySequence* self) {
|
|
|
|
return self->isEmpty();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QKeySequence_ToString(const QKeySequence* self) {
|
|
|
|
QString _ret = self->toString();
|
2024-08-29 07:01:51 +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-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QKeySequence* QKeySequence_FromString(struct miqt_string* str) {
|
|
|
|
QString str_QString = QString::fromUtf8(&str->data, str->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QKeySequence(QKeySequence::fromString(str_QString));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QKeySequence_ListFromString(struct miqt_string* str) {
|
|
|
|
QString str_QString = QString::fromUtf8(&str->data, str->len);
|
|
|
|
QList<QKeySequence> _ret = QKeySequence::listFromString(str_QString);
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QKeySequence** _arr = static_cast<QKeySequence**>(malloc(sizeof(QKeySequence*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QKeySequence(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-16 07:33:40 +00:00
|
|
|
struct miqt_string* QKeySequence_ListToString(struct miqt_array* /* of QKeySequence* */ list) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QKeySequence> list_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
list_QList.reserve(list->len);
|
|
|
|
QKeySequence** list_arr = static_cast<QKeySequence**>(list->data);
|
|
|
|
for(size_t i = 0; i < list->len; ++i) {
|
|
|
|
list_QList.push_back(*(list_arr[i]));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QKeySequence::listToString(list_QList);
|
2024-08-29 07:01:51 +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-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QKeySequence_Matches(const QKeySequence* self, QKeySequence* seq) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QKeySequence::SequenceMatch _ret = self->matches(*seq);
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QKeySequence* QKeySequence_Mnemonic(struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QKeySequence(QKeySequence::mnemonic(text_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
struct miqt_array* QKeySequence_KeyBindings(int key) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QList<QKeySequence> _ret = QKeySequence::keyBindings(static_cast<QKeySequence::StandardKey>(key));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QKeySequence** _arr = static_cast<QKeySequence**>(malloc(sizeof(QKeySequence*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QKeySequence(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QKeySequence_OperatorSubscript(const QKeySequence* self, unsigned int i) {
|
|
|
|
return self->operator[](static_cast<uint>(i));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QKeySequence_OperatorAssign(QKeySequence* self, QKeySequence* other) {
|
|
|
|
self->operator=(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QKeySequence_Swap(QKeySequence* self, QKeySequence* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QKeySequence_OperatorEqual(const QKeySequence* self, QKeySequence* other) {
|
|
|
|
return self->operator==(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QKeySequence_OperatorNotEqual(const QKeySequence* self, QKeySequence* other) {
|
|
|
|
return self->operator!=(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QKeySequence_OperatorLesser(const QKeySequence* self, QKeySequence* ks) {
|
|
|
|
return self->operator<(*ks);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QKeySequence_OperatorGreater(const QKeySequence* self, QKeySequence* other) {
|
|
|
|
return self->operator>(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QKeySequence_OperatorLesserOrEqual(const QKeySequence* self, QKeySequence* other) {
|
|
|
|
return self->operator<=(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QKeySequence_OperatorGreaterOrEqual(const QKeySequence* self, QKeySequence* other) {
|
|
|
|
return self->operator>=(*other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QKeySequence_IsDetached(const QKeySequence* self) {
|
|
|
|
return self->isDetached();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
struct miqt_string* QKeySequence_ToString1(const QKeySequence* self, int format) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->toString(static_cast<QKeySequence::SequenceFormat>(format));
|
2024-08-29 07:01:51 +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-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QKeySequence* QKeySequence_FromString2(struct miqt_string* str, int format) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString str_QString = QString::fromUtf8(&str->data, str->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QKeySequence(QKeySequence::fromString(str_QString, static_cast<QKeySequence::SequenceFormat>(format)));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
struct miqt_array* QKeySequence_ListFromString2(struct miqt_string* str, int format) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString str_QString = QString::fromUtf8(&str->data, str->len);
|
|
|
|
QList<QKeySequence> _ret = QKeySequence::listFromString(str_QString, static_cast<QKeySequence::SequenceFormat>(format));
|
2024-09-17 06:29:11 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
QKeySequence** _arr = static_cast<QKeySequence**>(malloc(sizeof(QKeySequence*) * _ret.length()));
|
2024-09-14 22:29:05 +00:00
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = new QKeySequence(_ret[i]);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
|
|
|
|
_out->len = _ret.length();
|
|
|
|
_out->data = static_cast<void*>(_arr);
|
|
|
|
return _out;
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
struct miqt_string* QKeySequence_ListToString2(struct miqt_array* /* of QKeySequence* */ list, int format) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QKeySequence> list_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
list_QList.reserve(list->len);
|
|
|
|
QKeySequence** list_arr = static_cast<QKeySequence**>(list->data);
|
|
|
|
for(size_t i = 0; i < list->len; ++i) {
|
|
|
|
list_QList.push_back(*(list_arr[i]));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = QKeySequence::listToString(list_QList, static_cast<QKeySequence::SequenceFormat>(format));
|
2024-08-29 07:01:51 +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 QKeySequence_Delete(QKeySequence* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|