2024-08-25 04:08:24 +00:00
|
|
|
#include <QBrush>
|
|
|
|
#include <QColor>
|
|
|
|
#include <QList>
|
|
|
|
#include <QPen>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qpen.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qpen.h"
|
2024-12-11 06:55:47 +00:00
|
|
|
|
|
|
|
#ifndef _Bool
|
|
|
|
#define _Bool bool
|
|
|
|
#endif
|
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
|
|
|
QPen* QPen_new() {
|
|
|
|
return new QPen();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QPen* QPen_new2(int param1) {
|
|
|
|
return new QPen(static_cast<Qt::PenStyle>(param1));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QPen* QPen_new3(QColor* color) {
|
|
|
|
return new QPen(*color);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QPen* QPen_new4(QBrush* brush, double width) {
|
|
|
|
return new QPen(*brush, static_cast<qreal>(width));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QPen* QPen_new5(QPen* pen) {
|
|
|
|
return new QPen(*pen);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QPen* QPen_new6(QBrush* brush, double width, int s) {
|
|
|
|
return new QPen(*brush, static_cast<qreal>(width), static_cast<Qt::PenStyle>(s));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QPen* QPen_new7(QBrush* brush, double width, int s, int c) {
|
|
|
|
return new QPen(*brush, static_cast<qreal>(width), static_cast<Qt::PenStyle>(s), static_cast<Qt::PenCapStyle>(c));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
QPen* QPen_new8(QBrush* brush, double width, int s, int c, int j) {
|
|
|
|
return new QPen(*brush, static_cast<qreal>(width), static_cast<Qt::PenStyle>(s), static_cast<Qt::PenCapStyle>(c), static_cast<Qt::PenJoinStyle>(j));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QPen_OperatorAssign(QPen* self, QPen* pen) {
|
|
|
|
self->operator=(*pen);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QPen_Swap(QPen* self, QPen* other) {
|
|
|
|
self->swap(*other);
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QPen_Style(const QPen* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::PenStyle _ret = self->style();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QPen_SetStyle(QPen* self, int style) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setStyle(static_cast<Qt::PenStyle>(style));
|
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
struct miqt_array /* of double */ QPen_DashPattern(const QPen* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
QVector<qreal> _ret = self->dashPattern();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Convert QList<> from C++ memory to manually-managed C memory
|
2024-09-14 22:29:05 +00:00
|
|
|
double* _arr = static_cast<double*>(malloc(sizeof(double) * _ret.length()));
|
|
|
|
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
|
|
|
|
_arr[i] = _ret[i];
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
2024-11-04 07:18:27 +00:00
|
|
|
struct miqt_array _out;
|
|
|
|
_out.len = _ret.length();
|
|
|
|
_out.data = static_cast<void*>(_arr);
|
2024-09-14 22:29:05 +00:00
|
|
|
return _out;
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-17 06:21:37 +00:00
|
|
|
void QPen_SetDashPattern(QPen* self, struct miqt_array /* of double */ pattern) {
|
2024-10-16 05:07:56 +00:00
|
|
|
QVector<qreal> pattern_QList;
|
2024-11-04 07:18:27 +00:00
|
|
|
pattern_QList.reserve(pattern.len);
|
|
|
|
double* pattern_arr = static_cast<double*>(pattern.data);
|
|
|
|
for(size_t i = 0; i < pattern.len; ++i) {
|
2024-09-17 07:43:35 +00:00
|
|
|
pattern_QList.push_back(static_cast<double>(pattern_arr[i]));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
self->setDashPattern(pattern_QList);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QPen_DashOffset(const QPen* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->dashOffset();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPen_SetDashOffset(QPen* self, double doffset) {
|
|
|
|
self->setDashOffset(static_cast<qreal>(doffset));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QPen_MiterLimit(const QPen* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->miterLimit();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPen_SetMiterLimit(QPen* self, double limit) {
|
|
|
|
self->setMiterLimit(static_cast<qreal>(limit));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
double QPen_WidthF(const QPen* self) {
|
2024-09-18 00:12:02 +00:00
|
|
|
qreal _ret = self->widthF();
|
|
|
|
return static_cast<double>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPen_SetWidthF(QPen* self, double width) {
|
|
|
|
self->setWidthF(static_cast<qreal>(width));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QPen_Width(const QPen* self) {
|
|
|
|
return self->width();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPen_SetWidth(QPen* self, int width) {
|
|
|
|
self->setWidth(static_cast<int>(width));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QPen_Color(const QPen* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->color());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPen_SetColor(QPen* self, QColor* color) {
|
|
|
|
self->setColor(*color);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QBrush* QPen_Brush(const QPen* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QBrush(self->brush());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPen_SetBrush(QPen* self, QBrush* brush) {
|
|
|
|
self->setBrush(*brush);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPen_IsSolid(const QPen* self) {
|
|
|
|
return self->isSolid();
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QPen_CapStyle(const QPen* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::PenCapStyle _ret = self->capStyle();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QPen_SetCapStyle(QPen* self, int pcs) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setCapStyle(static_cast<Qt::PenCapStyle>(pcs));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
int QPen_JoinStyle(const QPen* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
Qt::PenJoinStyle _ret = self->joinStyle();
|
2024-09-18 00:12:02 +00:00
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QPen_SetJoinStyle(QPen* self, int pcs) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setJoinStyle(static_cast<Qt::PenJoinStyle>(pcs));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPen_IsCosmetic(const QPen* self) {
|
|
|
|
return self->isCosmetic();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QPen_SetCosmetic(QPen* self, bool cosmetic) {
|
|
|
|
self->setCosmetic(cosmetic);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPen_OperatorEqual(const QPen* self, QPen* p) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self == *p);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QPen_OperatorNotEqual(const QPen* self, QPen* p) {
|
2024-11-22 06:06:01 +00:00
|
|
|
return (*self != *p);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QPen_IsDetached(QPen* self) {
|
|
|
|
return self->isDetached();
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
void QPen_Delete(QPen* self, bool isSubclass) {
|
|
|
|
if (isSubclass) {
|
|
|
|
delete dynamic_cast<QPen*>( self );
|
|
|
|
} else {
|
|
|
|
delete self;
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|