miqt/qt-restricted-extras/qscintilla6/gen_qscicommand.cpp

59 lines
1.3 KiB
C++
Raw Normal View History

2024-11-06 18:30:07 +13:00
#include <QString>
#include <QByteArray>
#include <cstring>
#include <qscicommand.h>
#include "gen_qscicommand.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
} /* extern C */
#endif
2024-11-06 18:30:07 +13:00
2025-02-01 13:45:16 +13:00
int QsciCommand_command(const QsciCommand* self) {
2024-11-06 18:30:07 +13:00
QsciCommand::Command _ret = self->command();
return static_cast<int>(_ret);
}
2025-02-01 13:45:16 +13:00
void QsciCommand_execute(QsciCommand* self) {
2024-11-06 18:30:07 +13:00
self->execute();
}
2025-02-01 13:45:16 +13:00
void QsciCommand_setKey(QsciCommand* self, int key) {
2024-11-06 18:30:07 +13:00
self->setKey(static_cast<int>(key));
}
2025-02-01 13:45:16 +13:00
void QsciCommand_setAlternateKey(QsciCommand* self, int altkey) {
2024-11-06 18:30:07 +13:00
self->setAlternateKey(static_cast<int>(altkey));
}
2025-02-01 13:45:16 +13:00
int QsciCommand_key(const QsciCommand* self) {
2024-11-06 18:30:07 +13:00
return self->key();
}
2025-02-01 13:45:16 +13:00
int QsciCommand_alternateKey(const QsciCommand* self) {
2024-11-06 18:30:07 +13:00
return self->alternateKey();
}
2025-02-01 13:45:16 +13:00
bool QsciCommand_validKey(int key) {
2024-11-06 18:30:07 +13:00
return QsciCommand::validKey(static_cast<int>(key));
}
2025-02-01 13:45:16 +13:00
struct miqt_string QsciCommand_description(const QsciCommand* 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 QsciCommand_delete(QsciCommand* self) {
delete self;
2024-11-06 18:30:07 +13:00
}