2024-08-25 04:08:24 +00:00
|
|
|
#include <QBrush>
|
|
|
|
#include <QFont>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QImage>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QLine>
|
|
|
|
#include <QLineF>
|
|
|
|
#include <QMatrix>
|
|
|
|
#include <QPaintDevice>
|
|
|
|
#include <QPaintEngine>
|
|
|
|
#include <QPaintEngineState>
|
|
|
|
#include <QPainter>
|
|
|
|
#include <QPainterPath>
|
|
|
|
#include <QPen>
|
|
|
|
#include <QPixmap>
|
|
|
|
#include <QPoint>
|
|
|
|
#include <QPointF>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QRectF>
|
|
|
|
#include <QRegion>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QTextItem>
|
|
|
|
#include <QTransform>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qpaintengine.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qpaintengine.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
double QTextItem_Descent(QTextItem* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QTextItem*>(self)->descent();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double QTextItem_Ascent(QTextItem* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QTextItem*>(self)->ascent();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double QTextItem_Width(QTextItem* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QTextItem*>(self)->width();
|
|
|
|
}
|
|
|
|
|
|
|
|
int QTextItem_RenderFlags(QTextItem* self) {
|
|
|
|
QTextItem::RenderFlags ret = const_cast<const QTextItem*>(self)->renderFlags();
|
|
|
|
return static_cast<int>(ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QTextItem_Text(QTextItem* self, char** _out, int* _out_Strlen) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QString ret = const_cast<const QTextItem*>(self)->text();
|
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
|
|
|
|
QByteArray b = ret.toUtf8();
|
|
|
|
*_out = static_cast<char*>(malloc(b.length()));
|
|
|
|
memcpy(*_out, b.data(), b.length());
|
|
|
|
*_out_Strlen = b.length();
|
|
|
|
}
|
|
|
|
|
|
|
|
QFont* QTextItem_Font(QTextItem* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QFont ret = const_cast<const QTextItem*>(self)->font();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QFont*>(new QFont(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QTextItem_Delete(QTextItem* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPaintEngine_IsActive(QPaintEngine* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPaintEngine*>(self)->isActive();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_SetActive(QPaintEngine* self, bool newState) {
|
|
|
|
self->setActive(newState);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPaintEngine_Begin(QPaintEngine* self, QPaintDevice* pdev) {
|
|
|
|
return self->begin(pdev);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPaintEngine_End(QPaintEngine* self) {
|
|
|
|
return self->end();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_UpdateState(QPaintEngine* self, QPaintEngineState* state) {
|
|
|
|
self->updateState(*state);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawRects(QPaintEngine* self, QRect* rects, int rectCount) {
|
|
|
|
self->drawRects(rects, static_cast<int>(rectCount));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawRects2(QPaintEngine* self, QRectF* rects, int rectCount) {
|
|
|
|
self->drawRects(rects, static_cast<int>(rectCount));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawLines(QPaintEngine* self, QLine* lines, int lineCount) {
|
|
|
|
self->drawLines(lines, static_cast<int>(lineCount));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawLines2(QPaintEngine* self, QLineF* lines, int lineCount) {
|
|
|
|
self->drawLines(lines, static_cast<int>(lineCount));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawEllipse(QPaintEngine* self, QRectF* r) {
|
|
|
|
self->drawEllipse(*r);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawEllipseWithQRect(QPaintEngine* self, QRect* r) {
|
|
|
|
self->drawEllipse(*r);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawPath(QPaintEngine* self, QPainterPath* path) {
|
|
|
|
self->drawPath(*path);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawPoints(QPaintEngine* self, QPointF* points, int pointCount) {
|
|
|
|
self->drawPoints(points, static_cast<int>(pointCount));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawPoints2(QPaintEngine* self, QPoint* points, int pointCount) {
|
|
|
|
self->drawPoints(points, static_cast<int>(pointCount));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QPaintEngine_DrawPolygon(QPaintEngine* self, QPointF* points, int pointCount, uintptr_t mode) {
|
|
|
|
self->drawPolygon(points, static_cast<int>(pointCount), static_cast<QPaintEngine::PolygonDrawMode>(mode));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawPolygon2(QPaintEngine* self, QPoint* points, int pointCount, uintptr_t mode) {
|
|
|
|
self->drawPolygon(points, static_cast<int>(pointCount), static_cast<QPaintEngine::PolygonDrawMode>(mode));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QPaintEngine_DrawPixmap(QPaintEngine* self, QRectF* r, QPixmap* pm, QRectF* sr) {
|
|
|
|
self->drawPixmap(*r, *pm, *sr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawTextItem(QPaintEngine* self, QPointF* p, QTextItem* textItem) {
|
|
|
|
self->drawTextItem(*p, *textItem);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawTiledPixmap(QPaintEngine* self, QRectF* r, QPixmap* pixmap, QPointF* s) {
|
|
|
|
self->drawTiledPixmap(*r, *pixmap, *s);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
void QPaintEngine_DrawImage(QPaintEngine* self, QRectF* r, QImage* pm, QRectF* sr) {
|
|
|
|
self->drawImage(*r, *pm, *sr);
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QPaintEngine_SetPaintDevice(QPaintEngine* self, QPaintDevice* device) {
|
|
|
|
self->setPaintDevice(device);
|
|
|
|
}
|
|
|
|
|
|
|
|
QPaintDevice* QPaintEngine_PaintDevice(QPaintEngine* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPaintEngine*>(self)->paintDevice();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_SetSystemClip(QPaintEngine* self, QRegion* baseClip) {
|
|
|
|
self->setSystemClip(*baseClip);
|
|
|
|
}
|
|
|
|
|
|
|
|
QRegion* QPaintEngine_SystemClip(QPaintEngine* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QRegion ret = const_cast<const QPaintEngine*>(self)->systemClip();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QRegion*>(new QRegion(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_SetSystemRect(QPaintEngine* self, QRect* rect) {
|
|
|
|
self->setSystemRect(*rect);
|
|
|
|
}
|
|
|
|
|
|
|
|
QRect* QPaintEngine_SystemRect(QPaintEngine* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QRect ret = const_cast<const QPaintEngine*>(self)->systemRect();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QRect*>(new QRect(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QPoint* QPaintEngine_CoordinateOffset(QPaintEngine* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QPoint ret = const_cast<const QPaintEngine*>(self)->coordinateOffset();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QPoint*>(new QPoint(ret));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
uintptr_t QPaintEngine_Type(QPaintEngine* self) {
|
|
|
|
QPaintEngine::Type ret = const_cast<const QPaintEngine*>(self)->type();
|
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QPaintEngine_FixNegRect(QPaintEngine* self, int* x, int* y, int* w, int* h) {
|
|
|
|
self->fix_neg_rect(static_cast<int*>(x), static_cast<int*>(y), static_cast<int*>(w), static_cast<int*>(h));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
bool QPaintEngine_TestDirty(QPaintEngine* self, int df) {
|
|
|
|
return self->testDirty(static_cast<QPaintEngine::DirtyFlags>(df));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_SetDirty(QPaintEngine* self, int df) {
|
|
|
|
self->setDirty(static_cast<QPaintEngine::DirtyFlags>(df));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_ClearDirty(QPaintEngine* self, int df) {
|
|
|
|
self->clearDirty(static_cast<QPaintEngine::DirtyFlags>(df));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPaintEngine_HasFeature(QPaintEngine* self, int feature) {
|
|
|
|
return const_cast<const QPaintEngine*>(self)->hasFeature(static_cast<QPaintEngine::PaintEngineFeatures>(feature));
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
QPainter* QPaintEngine_Painter(QPaintEngine* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPaintEngine*>(self)->painter();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_SyncState(QPaintEngine* self) {
|
|
|
|
self->syncState();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPaintEngine_IsExtended(QPaintEngine* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPaintEngine*>(self)->isExtended();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_DrawImage4(QPaintEngine* self, QRectF* r, QImage* pm, QRectF* sr, int flags) {
|
|
|
|
self->drawImage(*r, *pm, *sr, static_cast<Qt::ImageConversionFlags>(flags));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngine_Delete(QPaintEngine* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
int QPaintEngineState_State(QPaintEngineState* self) {
|
|
|
|
QPaintEngine::DirtyFlags ret = const_cast<const QPaintEngineState*>(self)->state();
|
|
|
|
return static_cast<int>(ret);
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
QPen* QPaintEngineState_Pen(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QPen ret = const_cast<const QPaintEngineState*>(self)->pen();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QPen*>(new QPen(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QBrush* QPaintEngineState_Brush(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QBrush ret = const_cast<const QPaintEngineState*>(self)->brush();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QBrush*>(new QBrush(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QPointF* QPaintEngineState_BrushOrigin(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QPointF ret = const_cast<const QPaintEngineState*>(self)->brushOrigin();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QPointF*>(new QPointF(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QBrush* QPaintEngineState_BackgroundBrush(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QBrush ret = const_cast<const QPaintEngineState*>(self)->backgroundBrush();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QBrush*>(new QBrush(ret));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
uintptr_t QPaintEngineState_BackgroundMode(QPaintEngineState* self) {
|
|
|
|
Qt::BGMode ret = const_cast<const QPaintEngineState*>(self)->backgroundMode();
|
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
QFont* QPaintEngineState_Font(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QFont ret = const_cast<const QPaintEngineState*>(self)->font();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QFont*>(new QFont(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QMatrix* QPaintEngineState_Matrix(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QMatrix ret = const_cast<const QPaintEngineState*>(self)->matrix();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QMatrix*>(new QMatrix(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QTransform* QPaintEngineState_Transform(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QTransform ret = const_cast<const QPaintEngineState*>(self)->transform();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QTransform*>(new QTransform(ret));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
uintptr_t QPaintEngineState_ClipOperation(QPaintEngineState* self) {
|
|
|
|
Qt::ClipOperation ret = const_cast<const QPaintEngineState*>(self)->clipOperation();
|
|
|
|
return static_cast<uintptr_t>(ret);
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
QRegion* QPaintEngineState_ClipRegion(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QRegion ret = const_cast<const QPaintEngineState*>(self)->clipRegion();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QRegion*>(new QRegion(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QPainterPath* QPaintEngineState_ClipPath(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QPainterPath ret = const_cast<const QPaintEngineState*>(self)->clipPath();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QPainterPath*>(new QPainterPath(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QPaintEngineState_IsClipEnabled(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPaintEngineState*>(self)->isClipEnabled();
|
|
|
|
}
|
|
|
|
|
|
|
|
int QPaintEngineState_RenderHints(QPaintEngineState* self) {
|
|
|
|
QPainter::RenderHints ret = const_cast<const QPaintEngineState*>(self)->renderHints();
|
|
|
|
return static_cast<int>(ret);
|
|
|
|
}
|
|
|
|
|
|
|
|
uintptr_t QPaintEngineState_CompositionMode(QPaintEngineState* self) {
|
|
|
|
QPainter::CompositionMode ret = const_cast<const QPaintEngineState*>(self)->compositionMode();
|
|
|
|
return static_cast<uintptr_t>(ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double QPaintEngineState_Opacity(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPaintEngineState*>(self)->opacity();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QPainter* QPaintEngineState_Painter(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPaintEngineState*>(self)->painter();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QPaintEngineState_BrushNeedsResolving(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPaintEngineState*>(self)->brushNeedsResolving();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QPaintEngineState_PenNeedsResolving(QPaintEngineState* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QPaintEngineState*>(self)->penNeedsResolving();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPaintEngineState_Delete(QPaintEngineState* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|