miqt/qt/gen_qcolor.cpp

615 lines
19 KiB
C++
Raw Permalink Normal View History

#include <QColor>
#include <QList>
#include <QRgba64>
#include <QString>
2024-08-29 07:01:51 +00:00
#include <QByteArray>
#include <cstring>
#include <qcolor.h>
2024-08-29 07:01:51 +00:00
#include "gen_qcolor.h"
#include "_cgo_export.h"
QColor* QColor_new() {
return new QColor();
}
QColor* QColor_new2(int color) {
2024-08-29 07:01:51 +00:00
return new QColor(static_cast<Qt::GlobalColor>(color));
}
QColor* QColor_new3(int r, int g, int b) {
return new QColor(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b));
}
2024-08-29 07:01:51 +00:00
QColor* QColor_new4(unsigned int rgb) {
return new QColor(static_cast<QRgb>(rgb));
}
2024-08-29 07:01:51 +00:00
QColor* QColor_new5(QRgba64* rgba64) {
return new QColor(*rgba64);
}
QColor* QColor_new6(struct miqt_string* name) {
QString name_QString = QString::fromUtf8(&name->data, name->len);
return new QColor(name_QString);
}
2024-08-29 07:01:51 +00:00
QColor* QColor_new7(const char* aname) {
return new QColor(aname);
}
QColor* QColor_new8(int spec) {
2024-08-29 07:01:51 +00:00
return new QColor(static_cast<QColor::Spec>(spec));
}
QColor* QColor_new9(QColor* color) {
return new QColor(*color);
}
QColor* QColor_new10(int spec, uint16_t a1, uint16_t a2, uint16_t a3, uint16_t a4) {
2024-08-29 07:01:51 +00:00
return new QColor(static_cast<QColor::Spec>(spec), static_cast<ushort>(a1), static_cast<ushort>(a2), static_cast<ushort>(a3), static_cast<ushort>(a4));
}
QColor* QColor_new11(int r, int g, int b, int a) {
return new QColor(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b), static_cast<int>(a));
}
QColor* QColor_new12(int spec, uint16_t a1, uint16_t a2, uint16_t a3, uint16_t a4, uint16_t a5) {
2024-08-29 07:01:51 +00:00
return new QColor(static_cast<QColor::Spec>(spec), static_cast<ushort>(a1), static_cast<ushort>(a2), static_cast<ushort>(a3), static_cast<ushort>(a4), static_cast<ushort>(a5));
}
void QColor_OperatorAssign(QColor* self, QColor* param1) {
self->operator=(*param1);
}
void QColor_OperatorAssignWithColor(QColor* self, int color) {
2024-08-29 07:01:51 +00:00
self->operator=(static_cast<Qt::GlobalColor>(color));
}
bool QColor_IsValid(const QColor* self) {
return self->isValid();
}
struct miqt_string* QColor_Name(const QColor* self) {
QString _ret = self->name();
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
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
2024-08-29 07:01:51 +00:00
}
struct miqt_string* QColor_NameWithFormat(const QColor* self, int format) {
QString _ret = self->name(static_cast<QColor::NameFormat>(format));
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
void QColor_SetNamedColor(QColor* self, struct miqt_string* name) {
QString name_QString = QString::fromUtf8(&name->data, name->len);
self->setNamedColor(name_QString);
}
struct miqt_array* QColor_ColorNames() {
QStringList _ret = QColor::colorNames();
// Convert QList<> from C++ memory to manually-managed C memory
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
QString _lv_ret = _ret[i];
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _lv_b = _lv_ret.toUtf8();
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
}
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
_out->len = _ret.length();
_out->data = static_cast<void*>(_arr);
return _out;
}
int QColor_Spec(const QColor* self) {
QColor::Spec _ret = self->spec();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
int QColor_Alpha(const QColor* self) {
return self->alpha();
}
void QColor_SetAlpha(QColor* self, int alpha) {
self->setAlpha(static_cast<int>(alpha));
}
double QColor_AlphaF(const QColor* self) {
qreal _ret = self->alphaF();
return static_cast<double>(_ret);
}
void QColor_SetAlphaF(QColor* self, double alpha) {
self->setAlphaF(static_cast<qreal>(alpha));
}
int QColor_Red(const QColor* self) {
return self->red();
}
int QColor_Green(const QColor* self) {
return self->green();
}
int QColor_Blue(const QColor* self) {
return self->blue();
}
void QColor_SetRed(QColor* self, int red) {
self->setRed(static_cast<int>(red));
}
void QColor_SetGreen(QColor* self, int green) {
self->setGreen(static_cast<int>(green));
}
void QColor_SetBlue(QColor* self, int blue) {
self->setBlue(static_cast<int>(blue));
}
double QColor_RedF(const QColor* self) {
qreal _ret = self->redF();
return static_cast<double>(_ret);
}
double QColor_GreenF(const QColor* self) {
qreal _ret = self->greenF();
return static_cast<double>(_ret);
}
double QColor_BlueF(const QColor* self) {
qreal _ret = self->blueF();
return static_cast<double>(_ret);
}
void QColor_SetRedF(QColor* self, double red) {
self->setRedF(static_cast<qreal>(red));
}
void QColor_SetGreenF(QColor* self, double green) {
self->setGreenF(static_cast<qreal>(green));
}
void QColor_SetBlueF(QColor* self, double blue) {
self->setBlueF(static_cast<qreal>(blue));
}
void QColor_GetRgb(const QColor* self, int* r, int* g, int* b) {
self->getRgb(static_cast<int*>(r), static_cast<int*>(g), static_cast<int*>(b));
}
void QColor_SetRgb(QColor* self, int r, int g, int b) {
self->setRgb(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b));
}
void QColor_GetRgbF(const QColor* self, double* r, double* g, double* b) {
self->getRgbF(static_cast<qreal*>(r), static_cast<qreal*>(g), static_cast<qreal*>(b));
}
void QColor_SetRgbF(QColor* self, double r, double g, double b) {
self->setRgbF(static_cast<qreal>(r), static_cast<qreal>(g), static_cast<qreal>(b));
}
QRgba64* QColor_Rgba64(const QColor* self) {
return new QRgba64(self->rgba64());
}
void QColor_SetRgba64(QColor* self, QRgba64* rgba) {
self->setRgba64(*rgba);
}
unsigned int QColor_Rgba(const QColor* self) {
QRgb _ret = self->rgba();
return static_cast<unsigned int>(_ret);
}
void QColor_SetRgba(QColor* self, unsigned int rgba) {
self->setRgba(static_cast<QRgb>(rgba));
}
unsigned int QColor_Rgb(const QColor* self) {
QRgb _ret = self->rgb();
return static_cast<unsigned int>(_ret);
}
void QColor_SetRgbWithRgb(QColor* self, unsigned int rgb) {
self->setRgb(static_cast<QRgb>(rgb));
}
int QColor_Hue(const QColor* self) {
return self->hue();
}
int QColor_Saturation(const QColor* self) {
return self->saturation();
}
int QColor_HsvHue(const QColor* self) {
return self->hsvHue();
}
int QColor_HsvSaturation(const QColor* self) {
return self->hsvSaturation();
}
int QColor_Value(const QColor* self) {
return self->value();
}
double QColor_HueF(const QColor* self) {
qreal _ret = self->hueF();
return static_cast<double>(_ret);
}
double QColor_SaturationF(const QColor* self) {
qreal _ret = self->saturationF();
return static_cast<double>(_ret);
}
double QColor_HsvHueF(const QColor* self) {
qreal _ret = self->hsvHueF();
return static_cast<double>(_ret);
}
double QColor_HsvSaturationF(const QColor* self) {
qreal _ret = self->hsvSaturationF();
return static_cast<double>(_ret);
}
double QColor_ValueF(const QColor* self) {
qreal _ret = self->valueF();
return static_cast<double>(_ret);
}
void QColor_GetHsv(const QColor* self, int* h, int* s, int* v) {
self->getHsv(static_cast<int*>(h), static_cast<int*>(s), static_cast<int*>(v));
}
void QColor_SetHsv(QColor* self, int h, int s, int v) {
self->setHsv(static_cast<int>(h), static_cast<int>(s), static_cast<int>(v));
}
void QColor_GetHsvF(const QColor* self, double* h, double* s, double* v) {
self->getHsvF(static_cast<qreal*>(h), static_cast<qreal*>(s), static_cast<qreal*>(v));
}
void QColor_SetHsvF(QColor* self, double h, double s, double v) {
self->setHsvF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(v));
}
int QColor_Cyan(const QColor* self) {
return self->cyan();
}
int QColor_Magenta(const QColor* self) {
return self->magenta();
}
int QColor_Yellow(const QColor* self) {
return self->yellow();
}
int QColor_Black(const QColor* self) {
return self->black();
}
double QColor_CyanF(const QColor* self) {
qreal _ret = self->cyanF();
return static_cast<double>(_ret);
}
double QColor_MagentaF(const QColor* self) {
qreal _ret = self->magentaF();
return static_cast<double>(_ret);
}
double QColor_YellowF(const QColor* self) {
qreal _ret = self->yellowF();
return static_cast<double>(_ret);
}
double QColor_BlackF(const QColor* self) {
qreal _ret = self->blackF();
return static_cast<double>(_ret);
}
void QColor_GetCmyk(QColor* self, int* c, int* m, int* y, int* k) {
self->getCmyk(static_cast<int*>(c), static_cast<int*>(m), static_cast<int*>(y), static_cast<int*>(k));
}
void QColor_GetCmyk2(const QColor* self, int* c, int* m, int* y, int* k) {
self->getCmyk(static_cast<int*>(c), static_cast<int*>(m), static_cast<int*>(y), static_cast<int*>(k));
}
void QColor_SetCmyk(QColor* self, int c, int m, int y, int k) {
self->setCmyk(static_cast<int>(c), static_cast<int>(m), static_cast<int>(y), static_cast<int>(k));
}
void QColor_GetCmykF(QColor* self, double* c, double* m, double* y, double* k) {
self->getCmykF(static_cast<qreal*>(c), static_cast<qreal*>(m), static_cast<qreal*>(y), static_cast<qreal*>(k));
}
void QColor_GetCmykF2(const QColor* self, double* c, double* m, double* y, double* k) {
self->getCmykF(static_cast<qreal*>(c), static_cast<qreal*>(m), static_cast<qreal*>(y), static_cast<qreal*>(k));
}
void QColor_SetCmykF(QColor* self, double c, double m, double y, double k) {
self->setCmykF(static_cast<qreal>(c), static_cast<qreal>(m), static_cast<qreal>(y), static_cast<qreal>(k));
}
int QColor_HslHue(const QColor* self) {
return self->hslHue();
}
int QColor_HslSaturation(const QColor* self) {
return self->hslSaturation();
}
int QColor_Lightness(const QColor* self) {
return self->lightness();
}
double QColor_HslHueF(const QColor* self) {
qreal _ret = self->hslHueF();
return static_cast<double>(_ret);
}
double QColor_HslSaturationF(const QColor* self) {
qreal _ret = self->hslSaturationF();
return static_cast<double>(_ret);
}
double QColor_LightnessF(const QColor* self) {
qreal _ret = self->lightnessF();
return static_cast<double>(_ret);
}
void QColor_GetHsl(const QColor* self, int* h, int* s, int* l) {
self->getHsl(static_cast<int*>(h), static_cast<int*>(s), static_cast<int*>(l));
}
void QColor_SetHsl(QColor* self, int h, int s, int l) {
self->setHsl(static_cast<int>(h), static_cast<int>(s), static_cast<int>(l));
}
void QColor_GetHslF(const QColor* self, double* h, double* s, double* l) {
self->getHslF(static_cast<qreal*>(h), static_cast<qreal*>(s), static_cast<qreal*>(l));
}
void QColor_SetHslF(QColor* self, double h, double s, double l) {
self->setHslF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(l));
}
QColor* QColor_ToRgb(const QColor* self) {
return new QColor(self->toRgb());
}
QColor* QColor_ToHsv(const QColor* self) {
return new QColor(self->toHsv());
}
QColor* QColor_ToCmyk(const QColor* self) {
return new QColor(self->toCmyk());
}
QColor* QColor_ToHsl(const QColor* self) {
return new QColor(self->toHsl());
}
QColor* QColor_ToExtendedRgb(const QColor* self) {
return new QColor(self->toExtendedRgb());
2024-08-29 07:01:51 +00:00
}
QColor* QColor_ConvertTo(const QColor* self, int colorSpec) {
return new QColor(self->convertTo(static_cast<QColor::Spec>(colorSpec)));
}
QColor* QColor_FromRgb(unsigned int rgb) {
return new QColor(QColor::fromRgb(static_cast<QRgb>(rgb)));
}
QColor* QColor_FromRgba(unsigned int rgba) {
return new QColor(QColor::fromRgba(static_cast<QRgb>(rgba)));
}
QColor* QColor_FromRgb2(int r, int g, int b) {
return new QColor(QColor::fromRgb(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b)));
}
QColor* QColor_FromRgbF(double r, double g, double b) {
return new QColor(QColor::fromRgbF(static_cast<qreal>(r), static_cast<qreal>(g), static_cast<qreal>(b)));
}
QColor* QColor_FromRgba64(uint16_t r, uint16_t g, uint16_t b) {
return new QColor(QColor::fromRgba64(static_cast<ushort>(r), static_cast<ushort>(g), static_cast<ushort>(b)));
}
QColor* QColor_FromRgba64WithRgba(QRgba64* rgba) {
return new QColor(QColor::fromRgba64(*rgba));
}
QColor* QColor_FromHsv(int h, int s, int v) {
return new QColor(QColor::fromHsv(static_cast<int>(h), static_cast<int>(s), static_cast<int>(v)));
}
QColor* QColor_FromHsvF(double h, double s, double v) {
return new QColor(QColor::fromHsvF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(v)));
}
QColor* QColor_FromCmyk(int c, int m, int y, int k) {
return new QColor(QColor::fromCmyk(static_cast<int>(c), static_cast<int>(m), static_cast<int>(y), static_cast<int>(k)));
}
QColor* QColor_FromCmykF(double c, double m, double y, double k) {
return new QColor(QColor::fromCmykF(static_cast<qreal>(c), static_cast<qreal>(m), static_cast<qreal>(y), static_cast<qreal>(k)));
}
QColor* QColor_FromHsl(int h, int s, int l) {
return new QColor(QColor::fromHsl(static_cast<int>(h), static_cast<int>(s), static_cast<int>(l)));
}
QColor* QColor_FromHslF(double h, double s, double l) {
return new QColor(QColor::fromHslF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(l)));
}
QColor* QColor_Light(const QColor* self) {
return new QColor(self->light());
}
QColor* QColor_Dark(const QColor* self) {
return new QColor(self->dark());
}
QColor* QColor_Lighter(const QColor* self) {
return new QColor(self->lighter());
}
QColor* QColor_Darker(const QColor* self) {
return new QColor(self->darker());
}
bool QColor_OperatorEqual(const QColor* self, QColor* c) {
return self->operator==(*c);
}
bool QColor_OperatorNotEqual(const QColor* self, QColor* c) {
return self->operator!=(*c);
}
bool QColor_IsValidColor(struct miqt_string* name) {
QString name_QString = QString::fromUtf8(&name->data, name->len);
return QColor::isValidColor(name_QString);
}
void QColor_GetRgb4(const QColor* self, int* r, int* g, int* b, int* a) {
self->getRgb(static_cast<int*>(r), static_cast<int*>(g), static_cast<int*>(b), static_cast<int*>(a));
}
void QColor_SetRgb4(QColor* self, int r, int g, int b, int a) {
self->setRgb(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b), static_cast<int>(a));
}
void QColor_GetRgbF4(const QColor* self, double* r, double* g, double* b, double* a) {
self->getRgbF(static_cast<qreal*>(r), static_cast<qreal*>(g), static_cast<qreal*>(b), static_cast<qreal*>(a));
}
void QColor_SetRgbF4(QColor* self, double r, double g, double b, double a) {
self->setRgbF(static_cast<qreal>(r), static_cast<qreal>(g), static_cast<qreal>(b), static_cast<qreal>(a));
}
void QColor_GetHsv4(const QColor* self, int* h, int* s, int* v, int* a) {
self->getHsv(static_cast<int*>(h), static_cast<int*>(s), static_cast<int*>(v), static_cast<int*>(a));
}
void QColor_SetHsv4(QColor* self, int h, int s, int v, int a) {
self->setHsv(static_cast<int>(h), static_cast<int>(s), static_cast<int>(v), static_cast<int>(a));
}
void QColor_GetHsvF4(const QColor* self, double* h, double* s, double* v, double* a) {
self->getHsvF(static_cast<qreal*>(h), static_cast<qreal*>(s), static_cast<qreal*>(v), static_cast<qreal*>(a));
}
void QColor_SetHsvF4(QColor* self, double h, double s, double v, double a) {
self->setHsvF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(v), static_cast<qreal>(a));
}
void QColor_GetCmyk5(QColor* self, int* c, int* m, int* y, int* k, int* a) {
self->getCmyk(static_cast<int*>(c), static_cast<int*>(m), static_cast<int*>(y), static_cast<int*>(k), static_cast<int*>(a));
}
void QColor_GetCmyk52(const QColor* self, int* c, int* m, int* y, int* k, int* a) {
self->getCmyk(static_cast<int*>(c), static_cast<int*>(m), static_cast<int*>(y), static_cast<int*>(k), static_cast<int*>(a));
}
void QColor_SetCmyk5(QColor* self, int c, int m, int y, int k, int a) {
self->setCmyk(static_cast<int>(c), static_cast<int>(m), static_cast<int>(y), static_cast<int>(k), static_cast<int>(a));
}
void QColor_GetCmykF5(QColor* self, double* c, double* m, double* y, double* k, double* a) {
self->getCmykF(static_cast<qreal*>(c), static_cast<qreal*>(m), static_cast<qreal*>(y), static_cast<qreal*>(k), static_cast<qreal*>(a));
}
void QColor_GetCmykF52(const QColor* self, double* c, double* m, double* y, double* k, double* a) {
self->getCmykF(static_cast<qreal*>(c), static_cast<qreal*>(m), static_cast<qreal*>(y), static_cast<qreal*>(k), static_cast<qreal*>(a));
}
void QColor_SetCmykF5(QColor* self, double c, double m, double y, double k, double a) {
self->setCmykF(static_cast<qreal>(c), static_cast<qreal>(m), static_cast<qreal>(y), static_cast<qreal>(k), static_cast<qreal>(a));
}
void QColor_GetHsl4(const QColor* self, int* h, int* s, int* l, int* a) {
self->getHsl(static_cast<int*>(h), static_cast<int*>(s), static_cast<int*>(l), static_cast<int*>(a));
}
void QColor_SetHsl4(QColor* self, int h, int s, int l, int a) {
self->setHsl(static_cast<int>(h), static_cast<int>(s), static_cast<int>(l), static_cast<int>(a));
}
void QColor_GetHslF4(const QColor* self, double* h, double* s, double* l, double* a) {
self->getHslF(static_cast<qreal*>(h), static_cast<qreal*>(s), static_cast<qreal*>(l), static_cast<qreal*>(a));
}
void QColor_SetHslF4(QColor* self, double h, double s, double l, double a) {
self->setHslF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(l), static_cast<qreal>(a));
}
QColor* QColor_FromRgb4(int r, int g, int b, int a) {
return new QColor(QColor::fromRgb(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b), static_cast<int>(a)));
}
QColor* QColor_FromRgbF4(double r, double g, double b, double a) {
return new QColor(QColor::fromRgbF(static_cast<qreal>(r), static_cast<qreal>(g), static_cast<qreal>(b), static_cast<qreal>(a)));
}
QColor* QColor_FromRgba644(uint16_t r, uint16_t g, uint16_t b, uint16_t a) {
return new QColor(QColor::fromRgba64(static_cast<ushort>(r), static_cast<ushort>(g), static_cast<ushort>(b), static_cast<ushort>(a)));
}
QColor* QColor_FromHsv4(int h, int s, int v, int a) {
return new QColor(QColor::fromHsv(static_cast<int>(h), static_cast<int>(s), static_cast<int>(v), static_cast<int>(a)));
}
QColor* QColor_FromHsvF4(double h, double s, double v, double a) {
return new QColor(QColor::fromHsvF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(v), static_cast<qreal>(a)));
}
QColor* QColor_FromCmyk5(int c, int m, int y, int k, int a) {
return new QColor(QColor::fromCmyk(static_cast<int>(c), static_cast<int>(m), static_cast<int>(y), static_cast<int>(k), static_cast<int>(a)));
}
QColor* QColor_FromCmykF5(double c, double m, double y, double k, double a) {
return new QColor(QColor::fromCmykF(static_cast<qreal>(c), static_cast<qreal>(m), static_cast<qreal>(y), static_cast<qreal>(k), static_cast<qreal>(a)));
}
QColor* QColor_FromHsl4(int h, int s, int l, int a) {
return new QColor(QColor::fromHsl(static_cast<int>(h), static_cast<int>(s), static_cast<int>(l), static_cast<int>(a)));
}
QColor* QColor_FromHslF4(double h, double s, double l, double a) {
return new QColor(QColor::fromHslF(static_cast<qreal>(h), static_cast<qreal>(s), static_cast<qreal>(l), static_cast<qreal>(a)));
}
QColor* QColor_Light1(const QColor* self, int f) {
return new QColor(self->light(static_cast<int>(f)));
}
QColor* QColor_Dark1(const QColor* self, int f) {
return new QColor(self->dark(static_cast<int>(f)));
}
QColor* QColor_Lighter1(const QColor* self, int f) {
return new QColor(self->lighter(static_cast<int>(f)));
}
QColor* QColor_Darker1(const QColor* self, int f) {
return new QColor(self->darker(static_cast<int>(f)));
}
void QColor_Delete(QColor* self) {
delete self;
}