#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define WORKAROUND_INNER_CLASS_DEFINITION_QTextLayout__FormatRange #include #include #include "qtextlayout.h" #include "gen_qtextlayout.h" extern "C" { extern void miqt_exec_callback(void* cb, int argc, void* argv); } QTextInlineObject* QTextInlineObject_new() { return new QTextInlineObject(); } bool QTextInlineObject_IsValid(QTextInlineObject* self) { return const_cast(self)->isValid(); } QRectF* QTextInlineObject_Rect(QTextInlineObject* self) { QRectF ret = const_cast(self)->rect(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QRectF(ret)); } double QTextInlineObject_Width(QTextInlineObject* self) { return const_cast(self)->width(); } double QTextInlineObject_Ascent(QTextInlineObject* self) { return const_cast(self)->ascent(); } double QTextInlineObject_Descent(QTextInlineObject* self) { return const_cast(self)->descent(); } double QTextInlineObject_Height(QTextInlineObject* self) { return const_cast(self)->height(); } uintptr_t QTextInlineObject_TextDirection(QTextInlineObject* self) { Qt::LayoutDirection ret = const_cast(self)->textDirection(); return static_cast(ret); } void QTextInlineObject_SetWidth(QTextInlineObject* self, double w) { self->setWidth(static_cast(w)); } void QTextInlineObject_SetAscent(QTextInlineObject* self, double a) { self->setAscent(static_cast(a)); } void QTextInlineObject_SetDescent(QTextInlineObject* self, double d) { self->setDescent(static_cast(d)); } int QTextInlineObject_TextPosition(QTextInlineObject* self) { return const_cast(self)->textPosition(); } int QTextInlineObject_FormatIndex(QTextInlineObject* self) { return const_cast(self)->formatIndex(); } QTextFormat* QTextInlineObject_Format(QTextInlineObject* self) { QTextFormat ret = const_cast(self)->format(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QTextFormat(ret)); } void QTextInlineObject_Delete(QTextInlineObject* self) { delete self; } QTextLayout* QTextLayout_new() { return new QTextLayout(); } QTextLayout* QTextLayout_new2(const char* text, size_t text_Strlen) { QString text_QString = QString::fromUtf8(text, text_Strlen); return new QTextLayout(text_QString); } QTextLayout* QTextLayout_new3(const char* text, size_t text_Strlen, QFont* font) { QString text_QString = QString::fromUtf8(text, text_Strlen); return new QTextLayout(text_QString, *font); } QTextLayout* QTextLayout_new4(QTextBlock* b) { return new QTextLayout(*b); } QTextLayout* QTextLayout_new5(const char* text, size_t text_Strlen, QFont* font, QPaintDevice* paintdevice) { QString text_QString = QString::fromUtf8(text, text_Strlen); return new QTextLayout(text_QString, *font, paintdevice); } void QTextLayout_SetFont(QTextLayout* self, QFont* f) { self->setFont(*f); } QFont* QTextLayout_Font(QTextLayout* self) { QFont ret = const_cast(self)->font(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QFont(ret)); } void QTextLayout_SetRawFont(QTextLayout* self, QRawFont* rawFont) { self->setRawFont(*rawFont); } void QTextLayout_SetText(QTextLayout* self, const char* stringVal, size_t stringVal_Strlen) { QString stringVal_QString = QString::fromUtf8(stringVal, stringVal_Strlen); self->setText(stringVal_QString); } void QTextLayout_Text(QTextLayout* self, char** _out, int* _out_Strlen) { QString ret = const_cast(self)->text(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QTextLayout_SetTextOption(QTextLayout* self, QTextOption* option) { self->setTextOption(*option); } QTextOption* QTextLayout_TextOption(QTextLayout* self) { const QTextOption& ret = const_cast(self)->textOption(); // Cast returned reference into pointer return const_cast(&ret); } void QTextLayout_SetPreeditArea(QTextLayout* self, int position, const char* text, size_t text_Strlen) { QString text_QString = QString::fromUtf8(text, text_Strlen); self->setPreeditArea(static_cast(position), text_QString); } int QTextLayout_PreeditAreaPosition(QTextLayout* self) { return const_cast(self)->preeditAreaPosition(); } void QTextLayout_PreeditAreaText(QTextLayout* self, char** _out, int* _out_Strlen) { QString ret = const_cast(self)->preeditAreaText(); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QTextLayout_SetAdditionalFormats(QTextLayout* self, QTextLayout__FormatRange** overrides, size_t overrides_len) { QList overrides_QList; overrides_QList.reserve(overrides_len); for(size_t i = 0; i < overrides_len; ++i) { overrides_QList.push_back(*(overrides[i])); } self->setAdditionalFormats(overrides_QList); } void QTextLayout_AdditionalFormats(QTextLayout* self, QTextLayout__FormatRange*** _out, size_t* _out_len) { QList ret = const_cast(self)->additionalFormats(); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QTextLayout__FormatRange** __out = static_cast(malloc(sizeof(QTextLayout__FormatRange**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QTextLayout::FormatRange(ret[i]); } *_out = __out; *_out_len = ret.length(); } void QTextLayout_ClearAdditionalFormats(QTextLayout* self) { self->clearAdditionalFormats(); } void QTextLayout_SetFormats(QTextLayout* self, QTextLayout__FormatRange** overrides, size_t overrides_len) { QVector overrides_QList; overrides_QList.reserve(overrides_len); for(size_t i = 0; i < overrides_len; ++i) { overrides_QList.push_back(*(overrides[i])); } self->setFormats(overrides_QList); } void QTextLayout_Formats(QTextLayout* self, QTextLayout__FormatRange*** _out, size_t* _out_len) { QVector ret = const_cast(self)->formats(); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QTextLayout__FormatRange** __out = static_cast(malloc(sizeof(QTextLayout__FormatRange**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QTextLayout::FormatRange(ret[i]); } *_out = __out; *_out_len = ret.length(); } void QTextLayout_ClearFormats(QTextLayout* self) { self->clearFormats(); } void QTextLayout_SetCacheEnabled(QTextLayout* self, bool enable) { self->setCacheEnabled(enable); } bool QTextLayout_CacheEnabled(QTextLayout* self) { return const_cast(self)->cacheEnabled(); } void QTextLayout_SetCursorMoveStyle(QTextLayout* self, uintptr_t style) { self->setCursorMoveStyle(static_cast(style)); } uintptr_t QTextLayout_CursorMoveStyle(QTextLayout* self) { Qt::CursorMoveStyle ret = const_cast(self)->cursorMoveStyle(); return static_cast(ret); } void QTextLayout_BeginLayout(QTextLayout* self) { self->beginLayout(); } void QTextLayout_EndLayout(QTextLayout* self) { self->endLayout(); } void QTextLayout_ClearLayout(QTextLayout* self) { self->clearLayout(); } QTextLine* QTextLayout_CreateLine(QTextLayout* self) { QTextLine ret = self->createLine(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QTextLine(ret)); } int QTextLayout_LineCount(QTextLayout* self) { return const_cast(self)->lineCount(); } QTextLine* QTextLayout_LineAt(QTextLayout* self, int i) { QTextLine ret = const_cast(self)->lineAt(static_cast(i)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QTextLine(ret)); } QTextLine* QTextLayout_LineForTextPosition(QTextLayout* self, int pos) { QTextLine ret = const_cast(self)->lineForTextPosition(static_cast(pos)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QTextLine(ret)); } bool QTextLayout_IsValidCursorPosition(QTextLayout* self, int pos) { return const_cast(self)->isValidCursorPosition(static_cast(pos)); } int QTextLayout_NextCursorPosition(QTextLayout* self, int oldPos) { return const_cast(self)->nextCursorPosition(static_cast(oldPos)); } int QTextLayout_PreviousCursorPosition(QTextLayout* self, int oldPos) { return const_cast(self)->previousCursorPosition(static_cast(oldPos)); } int QTextLayout_LeftCursorPosition(QTextLayout* self, int oldPos) { return const_cast(self)->leftCursorPosition(static_cast(oldPos)); } int QTextLayout_RightCursorPosition(QTextLayout* self, int oldPos) { return const_cast(self)->rightCursorPosition(static_cast(oldPos)); } void QTextLayout_Draw(QTextLayout* self, QPainter* p, QPointF* pos) { const_cast(self)->draw(p, *pos); } void QTextLayout_DrawCursor(QTextLayout* self, QPainter* p, QPointF* pos, int cursorPosition) { const_cast(self)->drawCursor(p, *pos, static_cast(cursorPosition)); } void QTextLayout_DrawCursor2(QTextLayout* self, QPainter* p, QPointF* pos, int cursorPosition, int width) { const_cast(self)->drawCursor(p, *pos, static_cast(cursorPosition), static_cast(width)); } QPointF* QTextLayout_Position(QTextLayout* self) { QPointF ret = const_cast(self)->position(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QPointF(ret)); } void QTextLayout_SetPosition(QTextLayout* self, QPointF* p) { self->setPosition(*p); } QRectF* QTextLayout_BoundingRect(QTextLayout* self) { QRectF ret = const_cast(self)->boundingRect(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QRectF(ret)); } double QTextLayout_MinimumWidth(QTextLayout* self) { return const_cast(self)->minimumWidth(); } double QTextLayout_MaximumWidth(QTextLayout* self) { return const_cast(self)->maximumWidth(); } void QTextLayout_GlyphRuns(QTextLayout* self, QGlyphRun*** _out, size_t* _out_len) { QList ret = const_cast(self)->glyphRuns(); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QGlyphRun** __out = static_cast(malloc(sizeof(QGlyphRun**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QGlyphRun(ret[i]); } *_out = __out; *_out_len = ret.length(); } void QTextLayout_SetFlags(QTextLayout* self, int flags) { self->setFlags(static_cast(flags)); } int QTextLayout_NextCursorPosition2(QTextLayout* self, int oldPos, uintptr_t mode) { return self->nextCursorPosition(static_cast(oldPos), static_cast(mode)); } int QTextLayout_PreviousCursorPosition2(QTextLayout* self, int oldPos, uintptr_t mode) { return self->previousCursorPosition(static_cast(oldPos), static_cast(mode)); } void QTextLayout_Draw3(QTextLayout* self, QPainter* p, QPointF* pos, QTextLayout__FormatRange** selections, size_t selections_len) { QVector selections_QList; selections_QList.reserve(selections_len); for(size_t i = 0; i < selections_len; ++i) { selections_QList.push_back(*(selections[i])); } self->draw(p, *pos, selections_QList); } void QTextLayout_Draw4(QTextLayout* self, QPainter* p, QPointF* pos, QTextLayout__FormatRange** selections, size_t selections_len, QRectF* clip) { QVector selections_QList; selections_QList.reserve(selections_len); for(size_t i = 0; i < selections_len; ++i) { selections_QList.push_back(*(selections[i])); } self->draw(p, *pos, selections_QList, *clip); } void QTextLayout_GlyphRuns1(QTextLayout* self, int from, QGlyphRun*** _out, size_t* _out_len) { QList ret = self->glyphRuns(static_cast(from)); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QGlyphRun** __out = static_cast(malloc(sizeof(QGlyphRun**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QGlyphRun(ret[i]); } *_out = __out; *_out_len = ret.length(); } void QTextLayout_GlyphRuns2(QTextLayout* self, int from, int length, QGlyphRun*** _out, size_t* _out_len) { QList ret = self->glyphRuns(static_cast(from), static_cast(length)); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QGlyphRun** __out = static_cast(malloc(sizeof(QGlyphRun**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QGlyphRun(ret[i]); } *_out = __out; *_out_len = ret.length(); } void QTextLayout_Delete(QTextLayout* self) { delete self; } QTextLine* QTextLine_new() { return new QTextLine(); } bool QTextLine_IsValid(QTextLine* self) { return const_cast(self)->isValid(); } QRectF* QTextLine_Rect(QTextLine* self) { QRectF ret = const_cast(self)->rect(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QRectF(ret)); } double QTextLine_X(QTextLine* self) { return const_cast(self)->x(); } double QTextLine_Y(QTextLine* self) { return const_cast(self)->y(); } double QTextLine_Width(QTextLine* self) { return const_cast(self)->width(); } double QTextLine_Ascent(QTextLine* self) { return const_cast(self)->ascent(); } double QTextLine_Descent(QTextLine* self) { return const_cast(self)->descent(); } double QTextLine_Height(QTextLine* self) { return const_cast(self)->height(); } double QTextLine_Leading(QTextLine* self) { return const_cast(self)->leading(); } void QTextLine_SetLeadingIncluded(QTextLine* self, bool included) { self->setLeadingIncluded(included); } bool QTextLine_LeadingIncluded(QTextLine* self) { return const_cast(self)->leadingIncluded(); } double QTextLine_NaturalTextWidth(QTextLine* self) { return const_cast(self)->naturalTextWidth(); } double QTextLine_HorizontalAdvance(QTextLine* self) { return const_cast(self)->horizontalAdvance(); } QRectF* QTextLine_NaturalTextRect(QTextLine* self) { QRectF ret = const_cast(self)->naturalTextRect(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QRectF(ret)); } double QTextLine_CursorToX(QTextLine* self, int* cursorPos) { return const_cast(self)->cursorToX(static_cast(cursorPos)); } double QTextLine_CursorToXWithCursorPos(QTextLine* self, int cursorPos) { return const_cast(self)->cursorToX(static_cast(cursorPos)); } int QTextLine_XToCursor(QTextLine* self, double x) { return const_cast(self)->xToCursor(static_cast(x)); } void QTextLine_SetLineWidth(QTextLine* self, double width) { self->setLineWidth(static_cast(width)); } void QTextLine_SetNumColumns(QTextLine* self, int columns) { self->setNumColumns(static_cast(columns)); } void QTextLine_SetNumColumns2(QTextLine* self, int columns, double alignmentWidth) { self->setNumColumns(static_cast(columns), static_cast(alignmentWidth)); } void QTextLine_SetPosition(QTextLine* self, QPointF* pos) { self->setPosition(*pos); } QPointF* QTextLine_Position(QTextLine* self) { QPointF ret = const_cast(self)->position(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QPointF(ret)); } int QTextLine_TextStart(QTextLine* self) { return const_cast(self)->textStart(); } int QTextLine_TextLength(QTextLine* self) { return const_cast(self)->textLength(); } int QTextLine_LineNumber(QTextLine* self) { return const_cast(self)->lineNumber(); } void QTextLine_Draw(QTextLine* self, QPainter* p, QPointF* point) { const_cast(self)->draw(p, *point); } void QTextLine_GlyphRuns(QTextLine* self, QGlyphRun*** _out, size_t* _out_len) { QList ret = const_cast(self)->glyphRuns(); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QGlyphRun** __out = static_cast(malloc(sizeof(QGlyphRun**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QGlyphRun(ret[i]); } *_out = __out; *_out_len = ret.length(); } double QTextLine_CursorToX2(QTextLine* self, int* cursorPos, uintptr_t edge) { return self->cursorToX(static_cast(cursorPos), static_cast(edge)); } double QTextLine_CursorToX22(QTextLine* self, int cursorPos, uintptr_t edge) { return self->cursorToX(static_cast(cursorPos), static_cast(edge)); } int QTextLine_XToCursor2(QTextLine* self, double x, uintptr_t param2) { return self->xToCursor(static_cast(x), static_cast(param2)); } void QTextLine_Draw3(QTextLine* self, QPainter* p, QPointF* point, QTextLayout__FormatRange* selection) { self->draw(p, *point, selection); } void QTextLine_GlyphRuns1(QTextLine* self, int from, QGlyphRun*** _out, size_t* _out_len) { QList ret = self->glyphRuns(static_cast(from)); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QGlyphRun** __out = static_cast(malloc(sizeof(QGlyphRun**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QGlyphRun(ret[i]); } *_out = __out; *_out_len = ret.length(); } void QTextLine_GlyphRuns2(QTextLine* self, int from, int length, QGlyphRun*** _out, size_t* _out_len) { QList ret = self->glyphRuns(static_cast(from), static_cast(length)); // Convert QList<> from C++ memory to manually-managed C memory of copy-constructed pointers QGlyphRun** __out = static_cast(malloc(sizeof(QGlyphRun**) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = new QGlyphRun(ret[i]); } *_out = __out; *_out_len = ret.length(); } void QTextLine_Delete(QTextLine* self) { delete self; } void QTextLayout__FormatRange_Delete(QTextLayout__FormatRange* self) { delete self; }