2024-08-25 04:08:24 +00:00
|
|
|
#include <QLine>
|
|
|
|
#include <QLineF>
|
|
|
|
#include <QMatrix>
|
|
|
|
#include <QPainterPath>
|
|
|
|
#include <QPoint>
|
|
|
|
#include <QPointF>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QRectF>
|
|
|
|
#include <QRegion>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qmatrix.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qmatrix.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
extern void miqt_exec_callback(void* cb, int argc, void* argv);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QMatrix* QMatrix_new(uintptr_t param1) {
|
|
|
|
return new QMatrix(static_cast<Qt::Initialization>(param1));
|
|
|
|
}
|
|
|
|
|
|
|
|
QMatrix* QMatrix_new2() {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QMatrix();
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QMatrix* QMatrix_new3(double m11, double m12, double m21, double m22, double dx, double dy) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QMatrix(static_cast<qreal>(m11), static_cast<qreal>(m12), static_cast<qreal>(m21), static_cast<qreal>(m22), static_cast<qreal>(dx), static_cast<qreal>(dy));
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QMatrix* QMatrix_new4(QMatrix* other) {
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QMatrix(*other);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMatrix_OperatorAssign(QMatrix* self, QMatrix* param1) {
|
|
|
|
self->operator=(*param1);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMatrix_SetMatrix(QMatrix* self, double m11, double m12, double m21, double m22, double dx, double dy) {
|
|
|
|
self->setMatrix(static_cast<qreal>(m11), static_cast<qreal>(m12), static_cast<qreal>(m21), static_cast<qreal>(m22), static_cast<qreal>(dx), static_cast<qreal>(dy));
|
|
|
|
}
|
|
|
|
|
|
|
|
double QMatrix_M11(QMatrix* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QMatrix*>(self)->m11();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double QMatrix_M12(QMatrix* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QMatrix*>(self)->m12();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double QMatrix_M21(QMatrix* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QMatrix*>(self)->m21();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double QMatrix_M22(QMatrix* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QMatrix*>(self)->m22();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double QMatrix_Dx(QMatrix* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QMatrix*>(self)->dx();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double QMatrix_Dy(QMatrix* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QMatrix*>(self)->dy();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMatrix_Map(QMatrix* self, int x, int y, int* tx, int* ty) {
|
2024-08-29 07:01:51 +00:00
|
|
|
const_cast<const QMatrix*>(self)->map(static_cast<int>(x), static_cast<int>(y), static_cast<int*>(tx), static_cast<int*>(ty));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMatrix_Map2(QMatrix* self, double x, double y, double* tx, double* ty) {
|
2024-08-29 07:01:51 +00:00
|
|
|
const_cast<const QMatrix*>(self)->map(static_cast<qreal>(x), static_cast<qreal>(y), static_cast<qreal*>(tx), static_cast<qreal*>(ty));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QRect* QMatrix_MapRect(QMatrix* self, QRect* param1) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QRect ret = const_cast<const QMatrix*>(self)->mapRect(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QRect*>(new QRect(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QRectF* QMatrix_MapRectWithQRectF(QMatrix* self, QRectF* param1) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QRectF ret = const_cast<const QMatrix*>(self)->mapRect(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QRectF*>(new QRectF(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QPoint* QMatrix_MapWithQPoint(QMatrix* self, QPoint* p) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QPoint ret = const_cast<const QMatrix*>(self)->map(*p);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QPoint*>(new QPoint(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QPointF* QMatrix_MapWithQPointF(QMatrix* self, QPointF* p) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QPointF ret = const_cast<const QMatrix*>(self)->map(*p);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QPointF*>(new QPointF(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QLine* QMatrix_MapWithQLine(QMatrix* self, QLine* l) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QLine ret = const_cast<const QMatrix*>(self)->map(*l);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QLine*>(new QLine(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QLineF* QMatrix_MapWithQLineF(QMatrix* self, QLineF* l) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QLineF ret = const_cast<const QMatrix*>(self)->map(*l);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QLineF*>(new QLineF(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QRegion* QMatrix_MapWithQRegion(QMatrix* self, QRegion* r) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QRegion ret = const_cast<const QMatrix*>(self)->map(*r);
|
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* QMatrix_MapWithQPainterPath(QMatrix* self, QPainterPath* p) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QPainterPath ret = const_cast<const QMatrix*>(self)->map(*p);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QPainterPath*>(new QPainterPath(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMatrix_Reset(QMatrix* self) {
|
|
|
|
self->reset();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QMatrix_IsIdentity(QMatrix* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QMatrix*>(self)->isIdentity();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QMatrix* QMatrix_Translate(QMatrix* self, double dx, double dy) {
|
|
|
|
QMatrix& ret = self->translate(static_cast<qreal>(dx), static_cast<qreal>(dy));
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
return &ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
QMatrix* QMatrix_Scale(QMatrix* self, double sx, double sy) {
|
|
|
|
QMatrix& ret = self->scale(static_cast<qreal>(sx), static_cast<qreal>(sy));
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
return &ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
QMatrix* QMatrix_Shear(QMatrix* self, double sh, double sv) {
|
|
|
|
QMatrix& ret = self->shear(static_cast<qreal>(sh), static_cast<qreal>(sv));
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
return &ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
QMatrix* QMatrix_Rotate(QMatrix* self, double a) {
|
|
|
|
QMatrix& ret = self->rotate(static_cast<qreal>(a));
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
return &ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QMatrix_IsInvertible(QMatrix* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QMatrix*>(self)->isInvertible();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
double QMatrix_Determinant(QMatrix* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QMatrix*>(self)->determinant();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QMatrix* QMatrix_Inverted(QMatrix* self) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QMatrix ret = const_cast<const QMatrix*>(self)->inverted();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QMatrix*>(new QMatrix(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
bool QMatrix_OperatorEqual(QMatrix* self, QMatrix* param1) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QMatrix*>(self)->operator==(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QMatrix_OperatorNotEqual(QMatrix* self, QMatrix* param1) {
|
2024-08-29 07:01:51 +00:00
|
|
|
return const_cast<const QMatrix*>(self)->operator!=(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QMatrix* QMatrix_OperatorMultiplyAssign(QMatrix* self, QMatrix* param1) {
|
|
|
|
QMatrix& ret = self->operator*=(*param1);
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
return &ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
QMatrix* QMatrix_OperatorMultiply(QMatrix* self, QMatrix* o) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QMatrix ret = const_cast<const QMatrix*>(self)->operator*(*o);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QMatrix*>(new QMatrix(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
QMatrix* QMatrix_Inverted1(QMatrix* self, bool* invertible) {
|
|
|
|
QMatrix ret = self->inverted(invertible);
|
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
|
|
|
return static_cast<QMatrix*>(new QMatrix(ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMatrix_Delete(QMatrix* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|