2024-08-25 04:08:24 +00:00
|
|
|
#include <QColor>
|
|
|
|
#include <QColorDialog>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QWidget>
|
2024-10-16 05:07:56 +00:00
|
|
|
#include <qcolordialog.h>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "gen_qcolordialog.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QColorDialog* QColorDialog_new() {
|
|
|
|
return new QColorDialog();
|
|
|
|
}
|
|
|
|
|
|
|
|
QColorDialog* QColorDialog_new2(QColor* initial) {
|
|
|
|
return new QColorDialog(*initial);
|
|
|
|
}
|
|
|
|
|
|
|
|
QColorDialog* QColorDialog_new3(QWidget* parent) {
|
|
|
|
return new QColorDialog(parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
QColorDialog* QColorDialog_new4(QColor* initial, QWidget* parent) {
|
|
|
|
return new QColorDialog(*initial, parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QColorDialog_MetaObject(const QColorDialog* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QColorDialog_Metacast(QColorDialog* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QColorDialog_Tr(const char* s) {
|
|
|
|
QString _ret = QColorDialog::tr(s);
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QColorDialog_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QColorDialog::trUtf8(s);
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColorDialog_SetCurrentColor(QColorDialog* self, QColor* color) {
|
|
|
|
self->setCurrentColor(*color);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColorDialog_CurrentColor(const QColorDialog* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->currentColor());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QColor* QColorDialog_SelectedColor(const QColorDialog* self) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(self->selectedColor());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QColorDialog_SetOption(QColorDialog* self, int option) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setOption(static_cast<QColorDialog::ColorDialogOption>(option));
|
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
bool QColorDialog_TestOption(const QColorDialog* self, int option) {
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->testOption(static_cast<QColorDialog::ColorDialogOption>(option));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColorDialog_SetOptions(QColorDialog* self, int options) {
|
|
|
|
self->setOptions(static_cast<QColorDialog::ColorDialogOptions>(options));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QColorDialog_Options(const QColorDialog* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QColorDialog::ColorDialogOptions _ret = self->options();
|
|
|
|
return static_cast<int>(_ret);
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
void QColorDialog_SetVisible(QColorDialog* self, bool visible) {
|
|
|
|
self->setVisible(visible);
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
QColor* QColorDialog_GetColor() {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColorDialog::getColor());
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
unsigned int QColorDialog_GetRgba() {
|
2024-09-18 00:12:02 +00:00
|
|
|
QRgb _ret = QColorDialog::getRgba();
|
|
|
|
return static_cast<unsigned int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
int QColorDialog_CustomCount() {
|
|
|
|
return QColorDialog::customCount();
|
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColorDialog_CustomColor(int index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColorDialog::customColor(static_cast<int>(index)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColorDialog_SetCustomColor(int index, QColor* color) {
|
|
|
|
QColorDialog::setCustomColor(static_cast<int>(index), *color);
|
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColorDialog_StandardColor(int index) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColorDialog::standardColor(static_cast<int>(index)));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColorDialog_SetStandardColor(int index, QColor* color) {
|
|
|
|
QColorDialog::setStandardColor(static_cast<int>(index), *color);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColorDialog_CurrentColorChanged(QColorDialog* self, QColor* color) {
|
|
|
|
self->currentColorChanged(*color);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QColorDialog_connect_CurrentColorChanged(QColorDialog* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QColorDialog::connect(self, static_cast<void (QColorDialog::*)(const QColor&)>(&QColorDialog::currentColorChanged), self, [=](const QColor& color) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QColor& color_ret = color;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QColor* sigval1 = const_cast<QColor*>(&color_ret);
|
|
|
|
miqt_exec_callback_QColorDialog_CurrentColorChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QColorDialog_ColorSelected(QColorDialog* self, QColor* color) {
|
|
|
|
self->colorSelected(*color);
|
|
|
|
}
|
|
|
|
|
2024-10-13 06:06:06 +00:00
|
|
|
void QColorDialog_connect_ColorSelected(QColorDialog* self, intptr_t slot) {
|
2024-08-25 04:08:24 +00:00
|
|
|
QColorDialog::connect(self, static_cast<void (QColorDialog::*)(const QColor&)>(&QColorDialog::colorSelected), self, [=](const QColor& color) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QColor& color_ret = color;
|
|
|
|
// Cast returned reference into pointer
|
|
|
|
QColor* sigval1 = const_cast<QColor*>(&color_ret);
|
|
|
|
miqt_exec_callback_QColorDialog_ColorSelected(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QColorDialog_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QColorDialog::tr(s, c);
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QColorDialog_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QColorDialog::tr(s, c, static_cast<int>(n));
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QColorDialog_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QColorDialog::trUtf8(s, c);
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QColorDialog_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QColorDialog::trUtf8(s, c, static_cast<int>(n));
|
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
|
2024-09-14 22:29:05 +00:00
|
|
|
QByteArray _b = _ret.toUtf8();
|
|
|
|
return miqt_strdup(_b.data(), _b.length());
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
void QColorDialog_SetOption2(QColorDialog* self, int option, bool on) {
|
2024-08-29 07:01:51 +00:00
|
|
|
self->setOption(static_cast<QColorDialog::ColorDialogOption>(option), on);
|
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColorDialog_GetColor1(QColor* initial) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColorDialog::getColor(*initial));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
QColor* QColorDialog_GetColor2(QColor* initial, QWidget* parent) {
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColorDialog::getColor(*initial, parent));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QColor* QColorDialog_GetColor3(QColor* initial, QWidget* parent, struct miqt_string* title) {
|
|
|
|
QString title_QString = QString::fromUtf8(&title->data, title->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColorDialog::getColor(*initial, parent, title_QString));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QColor* QColorDialog_GetColor4(QColor* initial, QWidget* parent, struct miqt_string* title, int options) {
|
|
|
|
QString title_QString = QString::fromUtf8(&title->data, title->len);
|
2024-09-17 06:29:11 +00:00
|
|
|
return new QColor(QColorDialog::getColor(*initial, parent, title_QString, static_cast<QColorDialog::ColorDialogOptions>(options)));
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
unsigned int QColorDialog_GetRgba1(unsigned int rgba) {
|
2024-09-18 00:12:02 +00:00
|
|
|
QRgb _ret = QColorDialog::getRgba(static_cast<QRgb>(rgba));
|
|
|
|
return static_cast<unsigned int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int QColorDialog_GetRgba2(unsigned int rgba, bool* ok) {
|
2024-09-18 00:12:02 +00:00
|
|
|
QRgb _ret = QColorDialog::getRgba(static_cast<QRgb>(rgba), ok);
|
|
|
|
return static_cast<unsigned int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int QColorDialog_GetRgba3(unsigned int rgba, bool* ok, QWidget* parent) {
|
2024-09-18 00:12:02 +00:00
|
|
|
QRgb _ret = QColorDialog::getRgba(static_cast<QRgb>(rgba), ok, parent);
|
|
|
|
return static_cast<unsigned int>(_ret);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QColorDialog_Delete(QColorDialog* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|