2024-08-25 04:08:24 +00:00
|
|
|
#include <QList>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QStyle>
|
|
|
|
#include <QStyleFactory>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qstylefactory.h"
|
|
|
|
#include "gen_qstylefactory.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_array* QStyleFactory_Keys() {
|
|
|
|
QStringList _ret = QStyleFactory::keys();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QStringList from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QString _lv_ret = _ret[i];
|
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 _lv_b = _lv_ret.toUtf8();
|
|
|
|
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
|
2024-08-25 04:08:24 +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-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QStyle* QStyleFactory_Create(struct miqt_string* param1) {
|
|
|
|
QString param1_QString = QString::fromUtf8(¶m1->data, param1->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return QStyleFactory::create(param1_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QStyleFactory_Delete(QStyleFactory* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|