140 lines
3.4 KiB
C++
Raw Normal View History

2024-11-06 18:30:07 +13:00
#include <QColor>
#include <QFont>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <qscistyle.h>
#include "gen_qscistyle.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
2024-11-06 18:30:07 +13:00
2024-12-07 17:15:57 +13:00
QsciStyle* QsciStyle_new() {
return new QsciStyle();
2024-11-06 18:30:07 +13:00
}
2024-12-07 17:15:57 +13:00
QsciStyle* QsciStyle_new2(int style, struct miqt_string description, QColor* color, QColor* paper, QFont* font) {
2024-11-06 18:30:07 +13:00
QString description_QString = QString::fromUtf8(description.data, description.len);
2024-12-07 17:15:57 +13:00
return new QsciStyle(static_cast<int>(style), description_QString, *color, *paper, *font);
2024-11-06 18:30:07 +13:00
}
2024-12-07 17:15:57 +13:00
QsciStyle* QsciStyle_new3(QsciStyle* param1) {
return new QsciStyle(*param1);
2024-11-06 18:30:07 +13:00
}
2024-12-07 17:15:57 +13:00
QsciStyle* QsciStyle_new4(int style) {
return new QsciStyle(static_cast<int>(style));
2024-11-06 18:30:07 +13:00
}
2024-12-07 17:15:57 +13:00
QsciStyle* QsciStyle_new5(int style, struct miqt_string description, QColor* color, QColor* paper, QFont* font, bool eolFill) {
2024-11-06 18:30:07 +13:00
QString description_QString = QString::fromUtf8(description.data, description.len);
2024-12-07 17:15:57 +13:00
return new QsciStyle(static_cast<int>(style), description_QString, *color, *paper, *font, eolFill);
2024-11-06 18:30:07 +13:00
}
2025-02-01 13:45:16 +13:00
void QsciStyle_apply(const QsciStyle* self, QsciScintillaBase* sci) {
2024-11-06 18:30:07 +13:00
self->apply(sci);
}
2025-02-01 13:45:16 +13:00
void QsciStyle_setStyle(QsciStyle* self, int style) {
2024-11-06 18:30:07 +13:00
self->setStyle(static_cast<int>(style));
}
2025-02-01 13:45:16 +13:00
int QsciStyle_style(const QsciStyle* self) {
2024-11-06 18:30:07 +13:00
return self->style();
}
2025-02-01 13:45:16 +13:00
void QsciStyle_setDescription(QsciStyle* self, struct miqt_string description) {
2024-11-06 18:30:07 +13:00
QString description_QString = QString::fromUtf8(description.data, description.len);
self->setDescription(description_QString);
}
2025-02-01 13:45:16 +13:00
struct miqt_string QsciStyle_description(const QsciStyle* self) {
2024-11-06 18:30:07 +13:00
QString _ret = self->description();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
struct miqt_string _ms;
_ms.len = _b.length();
_ms.data = static_cast<char*>(malloc(_ms.len));
memcpy(_ms.data, _b.data(), _ms.len);
return _ms;
}
2025-02-01 13:45:16 +13:00
void QsciStyle_setColor(QsciStyle* self, QColor* color) {
2024-11-06 18:30:07 +13:00
self->setColor(*color);
}
2025-02-01 13:45:16 +13:00
QColor* QsciStyle_color(const QsciStyle* self) {
2024-11-06 18:30:07 +13:00
return new QColor(self->color());
}
2025-02-01 13:45:16 +13:00
void QsciStyle_setPaper(QsciStyle* self, QColor* paper) {
2024-11-06 18:30:07 +13:00
self->setPaper(*paper);
}
2025-02-01 13:45:16 +13:00
QColor* QsciStyle_paper(const QsciStyle* self) {
2024-11-06 18:30:07 +13:00
return new QColor(self->paper());
}
2025-02-01 13:45:16 +13:00
void QsciStyle_setFont(QsciStyle* self, QFont* font) {
2024-11-06 18:30:07 +13:00
self->setFont(*font);
}
2025-02-01 13:45:16 +13:00
QFont* QsciStyle_font(const QsciStyle* self) {
2024-11-06 18:30:07 +13:00
return new QFont(self->font());
}
2025-02-01 13:45:16 +13:00
void QsciStyle_setEolFill(QsciStyle* self, bool fill) {
2024-11-06 18:30:07 +13:00
self->setEolFill(fill);
}
2025-02-01 13:45:16 +13:00
bool QsciStyle_eolFill(const QsciStyle* self) {
2024-11-06 18:30:07 +13:00
return self->eolFill();
}
2025-02-01 13:45:16 +13:00
void QsciStyle_setTextCase(QsciStyle* self, int text_case) {
2024-11-06 18:30:07 +13:00
self->setTextCase(static_cast<QsciStyle::TextCase>(text_case));
}
2025-02-01 13:45:16 +13:00
int QsciStyle_textCase(const QsciStyle* self) {
2024-11-06 18:30:07 +13:00
QsciStyle::TextCase _ret = self->textCase();
return static_cast<int>(_ret);
}
2025-02-01 13:45:16 +13:00
void QsciStyle_setVisible(QsciStyle* self, bool visible) {
2024-11-06 18:30:07 +13:00
self->setVisible(visible);
}
2025-02-01 13:45:16 +13:00
bool QsciStyle_visible(const QsciStyle* self) {
2024-11-06 18:30:07 +13:00
return self->visible();
}
2025-02-01 13:45:16 +13:00
void QsciStyle_setChangeable(QsciStyle* self, bool changeable) {
2024-11-06 18:30:07 +13:00
self->setChangeable(changeable);
}
2025-02-01 13:45:16 +13:00
bool QsciStyle_changeable(const QsciStyle* self) {
2024-11-06 18:30:07 +13:00
return self->changeable();
}
2025-02-01 13:45:16 +13:00
void QsciStyle_setHotspot(QsciStyle* self, bool hotspot) {
2024-11-06 18:30:07 +13:00
self->setHotspot(hotspot);
}
2025-02-01 13:45:16 +13:00
bool QsciStyle_hotspot(const QsciStyle* self) {
2024-11-06 18:30:07 +13:00
return self->hotspot();
}
2025-02-01 13:45:16 +13:00
void QsciStyle_refresh(QsciStyle* self) {
2024-11-06 18:30:07 +13:00
self->refresh();
}
2025-02-01 13:45:16 +13:00
void QsciStyle_delete(QsciStyle* self) {
delete self;
2024-11-06 18:30:07 +13:00
}