2024-08-25 04:08:24 +00:00
|
|
|
#include <QChar>
|
|
|
|
#include <QFont>
|
|
|
|
#include <QFontMetrics>
|
|
|
|
#include <QFontMetricsF>
|
|
|
|
#include <QPaintDevice>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QRectF>
|
|
|
|
#include <QSize>
|
|
|
|
#include <QSizeF>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qfontmetrics.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qfontmetrics.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QFontMetrics* QFontMetrics_new(QFont* param1) {
|
|
|
|
return new QFontMetrics(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QFontMetrics* QFontMetrics_new2(QFont* font, QPaintDevice* pd) {
|
|
|
|
return new QFontMetrics(*font, pd);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QFontMetrics* QFontMetrics_new3(QFontMetrics* param1) {
|
|
|
|
return new QFontMetrics(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFontMetrics_OperatorAssign(QFontMetrics* self, QFontMetrics* param1) {
|
|
|
|
self->operator=(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFontMetrics_Swap(QFontMetrics* self, QFontMetrics* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_Ascent(const QFontMetrics* self) {
|
|
|
|
return self->ascent();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_CapHeight(const QFontMetrics* self) {
|
|
|
|
return self->capHeight();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_Descent(const QFontMetrics* self) {
|
|
|
|
return self->descent();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_Height(const QFontMetrics* self) {
|
|
|
|
return self->height();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_Leading(const QFontMetrics* self) {
|
|
|
|
return self->leading();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_LineSpacing(const QFontMetrics* self) {
|
|
|
|
return self->lineSpacing();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_MinLeftBearing(const QFontMetrics* self) {
|
|
|
|
return self->minLeftBearing();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_MinRightBearing(const QFontMetrics* self) {
|
|
|
|
return self->minRightBearing();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_MaxWidth(const QFontMetrics* self) {
|
|
|
|
return self->maxWidth();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_XHeight(const QFontMetrics* self) {
|
|
|
|
return self->xHeight();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_AverageCharWidth(const QFontMetrics* self) {
|
|
|
|
return self->averageCharWidth();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFontMetrics_InFont(const QFontMetrics* self, QChar* param1) {
|
|
|
|
return self->inFont(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFontMetrics_InFontUcs4(const QFontMetrics* self, unsigned int ucs4) {
|
|
|
|
return self->inFontUcs4(static_cast<uint>(ucs4));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_LeftBearing(const QFontMetrics* self, QChar* param1) {
|
|
|
|
return self->leftBearing(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_RightBearing(const QFontMetrics* self, QChar* param1) {
|
|
|
|
return self->rightBearing(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
int QFontMetrics_Width(const QFontMetrics* self, struct miqt_string param1) {
|
|
|
|
QString param1_QString = QString::fromUtf8(param1.data, param1.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->width(param1_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
int QFontMetrics_Width2(const QFontMetrics* self, struct miqt_string param1, int lenVal, int flags) {
|
|
|
|
QString param1_QString = QString::fromUtf8(param1.data, param1.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->width(param1_QString, static_cast<int>(lenVal), static_cast<int>(flags));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_WidthWithQChar(const QFontMetrics* self, QChar* param1) {
|
|
|
|
return self->width(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
int QFontMetrics_HorizontalAdvance(const QFontMetrics* self, struct miqt_string param1) {
|
|
|
|
QString param1_QString = QString::fromUtf8(param1.data, param1.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->horizontalAdvance(param1_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_HorizontalAdvanceWithQChar(const QFontMetrics* self, QChar* param1) {
|
|
|
|
return self->horizontalAdvance(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
int QFontMetrics_CharWidth(const QFontMetrics* self, struct miqt_string str, int pos) {
|
|
|
|
QString str_QString = QString::fromUtf8(str.data, str.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->charWidth(str_QString, static_cast<int>(pos));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRect* QFontMetrics_BoundingRect(const QFontMetrics* self, QChar* param1) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->boundingRect(*param1));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRect* QFontMetrics_BoundingRectWithText(const QFontMetrics* self, struct miqt_string text) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->boundingRect(text_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRect* QFontMetrics_BoundingRect2(const QFontMetrics* self, QRect* r, int flags, struct miqt_string text) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->boundingRect(*r, static_cast<int>(flags), text_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRect* QFontMetrics_BoundingRect3(const QFontMetrics* self, int x, int y, int w, int h, int flags, struct miqt_string text) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->boundingRect(static_cast<int>(x), static_cast<int>(y), static_cast<int>(w), static_cast<int>(h), static_cast<int>(flags), text_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSize* QFontMetrics_Size(const QFontMetrics* self, int flags, struct miqt_string str) {
|
|
|
|
QString str_QString = QString::fromUtf8(str.data, str.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QSize(self->size(static_cast<int>(flags), str_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRect* QFontMetrics_TightBoundingRect(const QFontMetrics* self, struct miqt_string text) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->tightBoundingRect(text_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFontMetrics_ElidedText(const QFontMetrics* self, struct miqt_string text, int mode, int width) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->elidedText(text_QString, static_cast<Qt::TextElideMode>(mode), static_cast<int>(width));
|
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();
|
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-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_UnderlinePos(const QFontMetrics* self) {
|
|
|
|
return self->underlinePos();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_OverlinePos(const QFontMetrics* self) {
|
|
|
|
return self->overlinePos();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_StrikeOutPos(const QFontMetrics* self) {
|
|
|
|
return self->strikeOutPos();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QFontMetrics_LineWidth(const QFontMetrics* self) {
|
|
|
|
return self->lineWidth();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetrics_FontDpi(const QFontMetrics* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->fontDpi();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFontMetrics_OperatorEqual(const QFontMetrics* self, QFontMetrics* other) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self == *other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFontMetrics_OperatorNotEqual(const QFontMetrics* self, QFontMetrics* other) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self != *other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
int QFontMetrics_Width22(const QFontMetrics* self, struct miqt_string param1, int lenVal) {
|
|
|
|
QString param1_QString = QString::fromUtf8(param1.data, param1.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->width(param1_QString, static_cast<int>(lenVal));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
int QFontMetrics_HorizontalAdvance2(const QFontMetrics* self, struct miqt_string param1, int lenVal) {
|
|
|
|
QString param1_QString = QString::fromUtf8(param1.data, param1.len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->horizontalAdvance(param1_QString, static_cast<int>(lenVal));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRect* QFontMetrics_BoundingRect4(const QFontMetrics* self, QRect* r, int flags, struct miqt_string text, int tabstops) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->boundingRect(*r, static_cast<int>(flags), text_QString, static_cast<int>(tabstops)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRect* QFontMetrics_BoundingRect5(const QFontMetrics* self, QRect* r, int flags, struct miqt_string text, int tabstops, int* tabarray) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->boundingRect(*r, static_cast<int>(flags), text_QString, static_cast<int>(tabstops), static_cast<int*>(tabarray)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRect* QFontMetrics_BoundingRect7(const QFontMetrics* self, int x, int y, int w, int h, int flags, struct miqt_string text, int tabstops) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->boundingRect(static_cast<int>(x), static_cast<int>(y), static_cast<int>(w), static_cast<int>(h), static_cast<int>(flags), text_QString, static_cast<int>(tabstops)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRect* QFontMetrics_BoundingRect8(const QFontMetrics* self, int x, int y, int w, int h, int flags, struct miqt_string text, int tabstops, int* tabarray) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRect(self->boundingRect(static_cast<int>(x), static_cast<int>(y), static_cast<int>(w), static_cast<int>(h), static_cast<int>(flags), text_QString, static_cast<int>(tabstops), static_cast<int*>(tabarray)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSize* QFontMetrics_Size3(const QFontMetrics* self, int flags, struct miqt_string str, int tabstops) {
|
|
|
|
QString str_QString = QString::fromUtf8(str.data, str.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QSize(self->size(static_cast<int>(flags), str_QString, static_cast<int>(tabstops)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSize* QFontMetrics_Size4(const QFontMetrics* self, int flags, struct miqt_string str, int tabstops, int* tabarray) {
|
|
|
|
QString str_QString = QString::fromUtf8(str.data, str.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QSize(self->size(static_cast<int>(flags), str_QString, static_cast<int>(tabstops), static_cast<int*>(tabarray)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFontMetrics_ElidedText4(const QFontMetrics* self, struct miqt_string text, int mode, int width, int flags) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->elidedText(text_QString, static_cast<Qt::TextElideMode>(mode), static_cast<int>(width), static_cast<int>(flags));
|
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();
|
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-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QFontMetrics_Delete(QFontMetrics* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QFontMetrics*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QFontMetricsF* QFontMetricsF_new(QFont* font) {
|
|
|
|
return new QFontMetricsF(*font);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QFontMetricsF* QFontMetricsF_new2(QFont* font, QPaintDevice* pd) {
|
|
|
|
return new QFontMetricsF(*font, pd);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QFontMetricsF* QFontMetricsF_new3(QFontMetrics* param1) {
|
|
|
|
return new QFontMetricsF(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QFontMetricsF* QFontMetricsF_new4(QFontMetricsF* param1) {
|
|
|
|
return new QFontMetricsF(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QFontMetricsF_OperatorAssign(QFontMetricsF* self, QFontMetricsF* param1) {
|
|
|
|
self->operator=(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFontMetricsF_OperatorAssignWithQFontMetrics(QFontMetricsF* self, QFontMetrics* param1) {
|
|
|
|
self->operator=(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QFontMetricsF_Swap(QFontMetricsF* self, QFontMetricsF* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_Ascent(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->ascent();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_CapHeight(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->capHeight();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_Descent(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->descent();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_Height(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->height();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_Leading(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->leading();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_LineSpacing(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->lineSpacing();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_MinLeftBearing(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->minLeftBearing();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_MinRightBearing(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->minRightBearing();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_MaxWidth(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->maxWidth();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_XHeight(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->xHeight();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_AverageCharWidth(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->averageCharWidth();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFontMetricsF_InFont(const QFontMetricsF* self, QChar* param1) {
|
|
|
|
return self->inFont(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFontMetricsF_InFontUcs4(const QFontMetricsF* self, unsigned int ucs4) {
|
|
|
|
return self->inFontUcs4(static_cast<uint>(ucs4));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_LeftBearing(const QFontMetricsF* self, QChar* param1) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->leftBearing(*param1);
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_RightBearing(const QFontMetricsF* self, QChar* param1) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->rightBearing(*param1);
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
double QFontMetricsF_Width(const QFontMetricsF* self, struct miqt_string stringVal) {
|
|
|
|
QString stringVal_QString = QString::fromUtf8(stringVal.data, stringVal.len);
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->width(stringVal_QString);
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_WidthWithQChar(const QFontMetricsF* self, QChar* param1) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->width(*param1);
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
double QFontMetricsF_HorizontalAdvance(const QFontMetricsF* self, struct miqt_string stringVal) {
|
|
|
|
QString stringVal_QString = QString::fromUtf8(stringVal.data, stringVal.len);
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->horizontalAdvance(stringVal_QString);
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_HorizontalAdvanceWithQChar(const QFontMetricsF* self, QChar* param1) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->horizontalAdvance(*param1);
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRectF* QFontMetricsF_BoundingRect(const QFontMetricsF* self, struct miqt_string stringVal) {
|
|
|
|
QString stringVal_QString = QString::fromUtf8(stringVal.data, stringVal.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRectF(self->boundingRect(stringVal_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRectF* QFontMetricsF_BoundingRectWithQChar(const QFontMetricsF* self, QChar* param1) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRectF(self->boundingRect(*param1));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRectF* QFontMetricsF_BoundingRect2(const QFontMetricsF* self, QRectF* r, int flags, struct miqt_string stringVal) {
|
|
|
|
QString stringVal_QString = QString::fromUtf8(stringVal.data, stringVal.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRectF(self->boundingRect(*r, static_cast<int>(flags), stringVal_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSizeF* QFontMetricsF_Size(const QFontMetricsF* self, int flags, struct miqt_string str) {
|
|
|
|
QString str_QString = QString::fromUtf8(str.data, str.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QSizeF(self->size(static_cast<int>(flags), str_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRectF* QFontMetricsF_TightBoundingRect(const QFontMetricsF* self, struct miqt_string text) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRectF(self->tightBoundingRect(text_QString));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFontMetricsF_ElidedText(const QFontMetricsF* self, struct miqt_string text, int mode, double width) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->elidedText(text_QString, static_cast<Qt::TextElideMode>(mode), static_cast<qreal>(width));
|
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();
|
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-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_UnderlinePos(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->underlinePos();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_OverlinePos(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->overlinePos();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_StrikeOutPos(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->strikeOutPos();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_LineWidth(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->lineWidth();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QFontMetricsF_FontDpi(const QFontMetricsF* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->fontDpi();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFontMetricsF_OperatorEqual(const QFontMetricsF* self, QFontMetricsF* other) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self == *other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QFontMetricsF_OperatorNotEqual(const QFontMetricsF* self, QFontMetricsF* other) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self != *other);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
double QFontMetricsF_HorizontalAdvance2(const QFontMetricsF* self, struct miqt_string stringVal, int length) {
|
|
|
|
QString stringVal_QString = QString::fromUtf8(stringVal.data, stringVal.len);
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->horizontalAdvance(stringVal_QString, static_cast<int>(length));
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRectF* QFontMetricsF_BoundingRect4(const QFontMetricsF* self, QRectF* r, int flags, struct miqt_string stringVal, int tabstops) {
|
|
|
|
QString stringVal_QString = QString::fromUtf8(stringVal.data, stringVal.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRectF(self->boundingRect(*r, static_cast<int>(flags), stringVal_QString, static_cast<int>(tabstops)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QRectF* QFontMetricsF_BoundingRect5(const QFontMetricsF* self, QRectF* r, int flags, struct miqt_string stringVal, int tabstops, int* tabarray) {
|
|
|
|
QString stringVal_QString = QString::fromUtf8(stringVal.data, stringVal.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QRectF(self->boundingRect(*r, static_cast<int>(flags), stringVal_QString, static_cast<int>(tabstops), static_cast<int*>(tabarray)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSizeF* QFontMetricsF_Size3(const QFontMetricsF* self, int flags, struct miqt_string str, int tabstops) {
|
|
|
|
QString str_QString = QString::fromUtf8(str.data, str.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QSizeF(self->size(static_cast<int>(flags), str_QString, static_cast<int>(tabstops)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
QSizeF* QFontMetricsF_Size4(const QFontMetricsF* self, int flags, struct miqt_string str, int tabstops, int* tabarray) {
|
|
|
|
QString str_QString = QString::fromUtf8(str.data, str.len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QSizeF(self->size(static_cast<int>(flags), str_QString, static_cast<int>(tabstops), static_cast<int*>(tabarray)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-18 23:53:33 +00:00
|
|
|
struct miqt_string QFontMetricsF_ElidedText4(const QFontMetricsF* self, struct miqt_string text, int mode, double width, int flags) {
|
|
|
|
QString text_QString = QString::fromUtf8(text.data, text.len);
|
2024-09-14 22:29:05 +00:00
|
|
|
QString _ret = self->elidedText(text_QString, static_cast<Qt::TextElideMode>(mode), static_cast<qreal>(width), static_cast<int>(flags));
|
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();
|
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-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QFontMetricsF_Delete(QFontMetricsF* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QFontMetricsF*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|