2024-10-20 05:21:03 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <QFont>
|
|
|
|
#include <QFontDatabase>
|
|
|
|
#include <QFontInfo>
|
|
|
|
#include <QList>
|
|
|
|
#include <QString>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
|
|
|
#include <qfontdatabase.h>
|
|
|
|
#include "gen_qfontdatabase.h"
|
2024-12-11 06:55:47 +00:00
|
|
|
|
|
|
|
#ifndef _Bool
|
|
|
|
#define _Bool bool
|
|
|
|
#endif
|
2024-10-20 05:21:03 +00:00
|
|
|
#include "_cgo_export.h"
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QFontDatabase* QFontDatabase_new() {
|
|
|
|
return new QFontDatabase();
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of int */ QFontDatabase_StandardSizes() {
|
2024-10-20 05:21:03 +00:00
|
|
|
QList<int> _ret = QFontDatabase::standardSizes();
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
int* _arr = static_cast<int*>(malloc(sizeof(int) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = _ret[i];
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-10-20 05:21:03 +00:00
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of int */ QFontDatabase_WritingSystems() {
|
2024-10-20 05:21:03 +00:00
|
|
|
QList<QFontDatabase::WritingSystem> _ret = QFontDatabase::writingSystems();
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
int* _arr = static_cast<int*>(malloc(sizeof(int) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QFontDatabase::WritingSystem _lv_ret = _ret[i];
|
|
|
|
_arr[i] = static_cast<int>(_lv_ret);
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-10-20 05:21:03 +00:00
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of int */ QFontDatabase_WritingSystemsWithFamily(struct miqt_string family) {
|
2024-10-20 05:21:03 +00:00
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QList<QFontDatabase::WritingSystem> _ret = QFontDatabase::writingSystems(family_QString);
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
int* _arr = static_cast<int*>(malloc(sizeof(int) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
QFontDatabase::WritingSystem _lv_ret = _ret[i];
|
|
|
|
_arr[i] = static_cast<int>(_lv_ret);
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-10-20 05:21:03 +00:00
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QFontDatabase_Families() {
|
2024-10-20 05:21:03 +00:00
|
|
|
QStringList _ret = QFontDatabase::families();
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
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];
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-10-20 05:21:03 +00:00
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QFontDatabase_Styles(struct miqt_string family) {
|
2024-10-20 05:21:03 +00:00
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QStringList _ret = QFontDatabase::styles(family_QString);
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
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];
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-10-20 05:21:03 +00:00
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of int */ QFontDatabase_PointSizes(struct miqt_string family) {
|
2024-10-20 05:21:03 +00:00
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QList<int> _ret = QFontDatabase::pointSizes(family_QString);
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
int* _arr = static_cast<int*>(malloc(sizeof(int) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = _ret[i];
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-10-20 05:21:03 +00:00
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of int */ QFontDatabase_SmoothSizes(struct miqt_string family, struct miqt_string style) {
|
2024-10-20 05:21:03 +00:00
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QString style_QString = QString::fromUtf8(style.data, style.len);
|
|
|
|
QList<int> _ret = QFontDatabase::smoothSizes(family_QString, style_QString);
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
int* _arr = static_cast<int*>(malloc(sizeof(int) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = _ret[i];
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-10-20 05:21:03 +00:00
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct miqt_string QFontDatabase_StyleString(QFont* font) {
|
|
|
|
QString _ret = QFontDatabase::styleString(*font);
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct miqt_string QFontDatabase_StyleStringWithFontInfo(QFontInfo* fontInfo) {
|
|
|
|
QString _ret = QFontDatabase::styleString(*fontInfo);
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFontDatabase_Font(struct miqt_string family, struct miqt_string style, int pointSize) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QString style_QString = QString::fromUtf8(style.data, style.len);
|
|
|
|
return new QFont(QFontDatabase::font(family_QString, style_QString, static_cast<int>(pointSize)));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_IsBitmapScalable(struct miqt_string family) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
return QFontDatabase::isBitmapScalable(family_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_IsSmoothlyScalable(struct miqt_string family) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
return QFontDatabase::isSmoothlyScalable(family_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_IsScalable(struct miqt_string family) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
return QFontDatabase::isScalable(family_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_IsFixedPitch(struct miqt_string family) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
return QFontDatabase::isFixedPitch(family_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_Italic(struct miqt_string family, struct miqt_string style) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QString style_QString = QString::fromUtf8(style.data, style.len);
|
|
|
|
return QFontDatabase::italic(family_QString, style_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_Bold(struct miqt_string family, struct miqt_string style) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QString style_QString = QString::fromUtf8(style.data, style.len);
|
|
|
|
return QFontDatabase::bold(family_QString, style_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
int QFontDatabase_Weight(struct miqt_string family, struct miqt_string style) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QString style_QString = QString::fromUtf8(style.data, style.len);
|
|
|
|
return QFontDatabase::weight(family_QString, style_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_HasFamily(struct miqt_string family) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
return QFontDatabase::hasFamily(family_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_IsPrivateFamily(struct miqt_string family) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
return QFontDatabase::isPrivateFamily(family_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
struct miqt_string QFontDatabase_WritingSystemName(int writingSystem) {
|
|
|
|
QString _ret = QFontDatabase::writingSystemName(static_cast<QFontDatabase::WritingSystem>(writingSystem));
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
struct miqt_string QFontDatabase_WritingSystemSample(int writingSystem) {
|
|
|
|
QString _ret = QFontDatabase::writingSystemSample(static_cast<QFontDatabase::WritingSystem>(writingSystem));
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
|
|
|
int QFontDatabase_AddApplicationFont(struct miqt_string fileName) {
|
|
|
|
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
|
|
|
|
return QFontDatabase::addApplicationFont(fileName_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
int QFontDatabase_AddApplicationFontFromData(struct miqt_string fontData) {
|
|
|
|
QByteArray fontData_QByteArray(fontData.data, fontData.len);
|
|
|
|
return QFontDatabase::addApplicationFontFromData(fontData_QByteArray);
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QFontDatabase_ApplicationFontFamilies(int id) {
|
2024-10-20 05:21:03 +00:00
|
|
|
QStringList _ret = QFontDatabase::applicationFontFamilies(static_cast<int>(id));
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
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];
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-10-20 05:21:03 +00:00
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_RemoveApplicationFont(int id) {
|
|
|
|
return QFontDatabase::removeApplicationFont(static_cast<int>(id));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_RemoveAllApplicationFonts() {
|
|
|
|
return QFontDatabase::removeAllApplicationFonts();
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QFontDatabase_SystemFont(int typeVal) {
|
|
|
|
return new QFont(QFontDatabase::systemFont(static_cast<QFontDatabase::SystemFont>(typeVal)));
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of struct miqt_string */ QFontDatabase_Families1(int writingSystem) {
|
2024-10-20 05:21:03 +00:00
|
|
|
QStringList _ret = QFontDatabase::families(static_cast<QFontDatabase::WritingSystem>(writingSystem));
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
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];
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray _lv_b = _lv_ret.toUtf8();
|
|
|
|
struct miqt_string _lv_ms;
|
|
|
|
_lv_ms.len = _lv_b.length();
|
|
|
|
_lv_ms.data = static_cast<char*>(malloc(_lv_ms.len));
|
|
|
|
memcpy(_lv_ms.data, _lv_b.data(), _lv_ms.len);
|
|
|
|
_arr[i] = _lv_ms;
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-10-20 05:21:03 +00:00
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of int */ QFontDatabase_PointSizes2(struct miqt_string family, struct miqt_string style) {
|
2024-10-20 05:21:03 +00:00
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QString style_QString = QString::fromUtf8(style.data, style.len);
|
|
|
|
QList<int> _ret = QFontDatabase::pointSizes(family_QString, style_QString);
|
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
|
|
|
int* _arr = static_cast<int*>(malloc(sizeof(int) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = _ret[i];
|
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-10-20 05:21:03 +00:00
|
|
|
return _out;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_IsBitmapScalable2(struct miqt_string family, struct miqt_string style) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QString style_QString = QString::fromUtf8(style.data, style.len);
|
|
|
|
return QFontDatabase::isBitmapScalable(family_QString, style_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_IsSmoothlyScalable2(struct miqt_string family, struct miqt_string style) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QString style_QString = QString::fromUtf8(style.data, style.len);
|
|
|
|
return QFontDatabase::isSmoothlyScalable(family_QString, style_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_IsScalable2(struct miqt_string family, struct miqt_string style) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QString style_QString = QString::fromUtf8(style.data, style.len);
|
|
|
|
return QFontDatabase::isScalable(family_QString, style_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QFontDatabase_IsFixedPitch2(struct miqt_string family, struct miqt_string style) {
|
|
|
|
QString family_QString = QString::fromUtf8(family.data, family.len);
|
|
|
|
QString style_QString = QString::fromUtf8(style.data, style.len);
|
|
|
|
return QFontDatabase::isFixedPitch(family_QString, style_QString);
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QFontDatabase_Delete(QFontDatabase* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QFontDatabase*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|