2024-08-25 04:08:24 +00:00
|
|
|
#include <QFileIconProvider>
|
|
|
|
#include <QFileInfo>
|
|
|
|
#include <QIcon>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qfileiconprovider.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qfileiconprovider.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QFileIconProvider* QFileIconProvider_new() {
|
|
|
|
return new QFileIconProvider();
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
QIcon* QFileIconProvider_Icon(const QFileIconProvider* self, int typeVal) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QIcon(self->icon(static_cast<QFileIconProvider::IconType>(typeVal)));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QIcon* QFileIconProvider_IconWithInfo(const QFileIconProvider* self, QFileInfo* info) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QIcon(self->icon(*info));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFileIconProvider_Type(const QFileIconProvider* self, QFileInfo* info) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->type(*info);
|
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();
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string _ms;
|
|
|
|
_ms.len = _b.length();
|
|
|
|
_ms.data = static_cast<char*>(malloc(_ms.len));
|
|
|
|
memcpy(_ms.data, _b.data(), _ms.len);
|
|
|
|
return _ms;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QFileIconProvider_SetOptions(QFileIconProvider* self, int options) {
|
|
|
|
self->setOptions(static_cast<QFileIconProvider::Options>(options));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFileIconProvider_Options(const QFileIconProvider* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QFileIconProvider::Options _ret = self->options();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QFileIconProvider_Delete(QFileIconProvider* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|