2024-08-25 04:08:24 +00:00
|
|
|
#include <QAction>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QObject>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QUndoCommand>
|
|
|
|
#include <QUndoStack>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qundostack.h"
|
|
|
|
#include "gen_qundostack.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QUndoCommand* QUndoCommand_new() {
|
|
|
|
return new QUndoCommand();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QUndoCommand* QUndoCommand_new2(struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QUndoCommand(text_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QUndoCommand* QUndoCommand_new3(QUndoCommand* parent) {
|
|
|
|
return new QUndoCommand(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QUndoCommand* QUndoCommand_new4(struct miqt_string* text, QUndoCommand* parent) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QUndoCommand(text_QString, parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoCommand_Undo(QUndoCommand* self) {
|
|
|
|
self->undo();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoCommand_Redo(QUndoCommand* self) {
|
|
|
|
self->redo();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QUndoCommand_Text(const QUndoCommand* self) {
|
|
|
|
QString _ret = self->text();
|
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* QUndoCommand_ActionText(const QUndoCommand* self) {
|
|
|
|
QString _ret = self->actionText();
|
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
|
|
|
void QUndoCommand_SetText(QUndoCommand* self, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setText(text_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QUndoCommand_IsObsolete(const QUndoCommand* self) {
|
|
|
|
return self->isObsolete();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoCommand_SetObsolete(QUndoCommand* self, bool obsolete) {
|
|
|
|
self->setObsolete(obsolete);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QUndoCommand_Id(const QUndoCommand* self) {
|
|
|
|
return self->id();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
bool QUndoCommand_MergeWith(QUndoCommand* self, QUndoCommand* other) {
|
|
|
|
return self->mergeWith(other);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QUndoCommand_ChildCount(const QUndoCommand* self) {
|
|
|
|
return self->childCount();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QUndoCommand* QUndoCommand_Child(const QUndoCommand* self, int index) {
|
|
|
|
return (QUndoCommand*) self->child(static_cast<int>(index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoCommand_Delete(QUndoCommand* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|
|
|
|
QUndoStack* QUndoStack_new() {
|
|
|
|
return new QUndoStack();
|
|
|
|
}
|
|
|
|
|
|
|
|
QUndoStack* QUndoStack_new2(QObject* parent) {
|
|
|
|
return new QUndoStack(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QUndoStack_MetaObject(const QUndoStack* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
void* QUndoStack_Metacast(QUndoStack* self, const char* param1) {
|
|
|
|
return self->qt_metacast(param1);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QUndoStack_Tr(const char* s) {
|
|
|
|
QString _ret = QUndoStack::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* QUndoStack_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QUndoStack::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 QUndoStack_Clear(QUndoStack* self) {
|
|
|
|
self->clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_Push(QUndoStack* self, QUndoCommand* cmd) {
|
|
|
|
self->push(cmd);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QUndoStack_CanUndo(const QUndoStack* self) {
|
|
|
|
return self->canUndo();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QUndoStack_CanRedo(const QUndoStack* self) {
|
|
|
|
return self->canRedo();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QUndoStack_UndoText(const QUndoStack* self) {
|
|
|
|
QString _ret = self->undoText();
|
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* QUndoStack_RedoText(const QUndoStack* self) {
|
|
|
|
QString _ret = self->redoText();
|
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-11 05:41:09 +00:00
|
|
|
int QUndoStack_Count(const QUndoStack* self) {
|
|
|
|
return self->count();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QUndoStack_Index(const QUndoStack* self) {
|
|
|
|
return self->index();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QUndoStack_Text(const QUndoStack* self, int idx) {
|
|
|
|
QString _ret = self->text(static_cast<int>(idx));
|
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-11 05:41:09 +00:00
|
|
|
QAction* QUndoStack_CreateUndoAction(const QUndoStack* self, QObject* parent) {
|
|
|
|
return self->createUndoAction(parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QAction* QUndoStack_CreateRedoAction(const QUndoStack* self, QObject* parent) {
|
|
|
|
return self->createRedoAction(parent);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QUndoStack_IsActive(const QUndoStack* self) {
|
|
|
|
return self->isActive();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QUndoStack_IsClean(const QUndoStack* self) {
|
|
|
|
return self->isClean();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QUndoStack_CleanIndex(const QUndoStack* self) {
|
|
|
|
return self->cleanIndex();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QUndoStack_BeginMacro(QUndoStack* self, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->beginMacro(text_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_EndMacro(QUndoStack* self) {
|
|
|
|
self->endMacro();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_SetUndoLimit(QUndoStack* self, int limit) {
|
|
|
|
self->setUndoLimit(static_cast<int>(limit));
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
int QUndoStack_UndoLimit(const QUndoStack* self) {
|
|
|
|
return self->undoLimit();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QUndoCommand* QUndoStack_Command(const QUndoStack* self, int index) {
|
|
|
|
return (QUndoCommand*) self->command(static_cast<int>(index));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_SetClean(QUndoStack* self) {
|
|
|
|
self->setClean();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_ResetClean(QUndoStack* self) {
|
|
|
|
self->resetClean();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_SetIndex(QUndoStack* self, int idx) {
|
|
|
|
self->setIndex(static_cast<int>(idx));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_Undo(QUndoStack* self) {
|
|
|
|
self->undo();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_Redo(QUndoStack* self) {
|
|
|
|
self->redo();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_SetActive(QUndoStack* self) {
|
|
|
|
self->setActive();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_IndexChanged(QUndoStack* self, int idx) {
|
|
|
|
self->indexChanged(static_cast<int>(idx));
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_connect_IndexChanged(QUndoStack* self, void* slot) {
|
|
|
|
QUndoStack::connect(self, static_cast<void (QUndoStack::*)(int)>(&QUndoStack::indexChanged), self, [=](int idx) {
|
2024-09-14 22:29:05 +00:00
|
|
|
int sigval1 = idx;
|
|
|
|
miqt_exec_callback_QUndoStack_IndexChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_CleanChanged(QUndoStack* self, bool clean) {
|
|
|
|
self->cleanChanged(clean);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_connect_CleanChanged(QUndoStack* self, void* slot) {
|
|
|
|
QUndoStack::connect(self, static_cast<void (QUndoStack::*)(bool)>(&QUndoStack::cleanChanged), self, [=](bool clean) {
|
2024-09-14 22:29:05 +00:00
|
|
|
bool sigval1 = clean;
|
|
|
|
miqt_exec_callback_QUndoStack_CleanChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_CanUndoChanged(QUndoStack* self, bool canUndo) {
|
|
|
|
self->canUndoChanged(canUndo);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_connect_CanUndoChanged(QUndoStack* self, void* slot) {
|
|
|
|
QUndoStack::connect(self, static_cast<void (QUndoStack::*)(bool)>(&QUndoStack::canUndoChanged), self, [=](bool canUndo) {
|
2024-09-14 22:29:05 +00:00
|
|
|
bool sigval1 = canUndo;
|
|
|
|
miqt_exec_callback_QUndoStack_CanUndoChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_CanRedoChanged(QUndoStack* self, bool canRedo) {
|
|
|
|
self->canRedoChanged(canRedo);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_connect_CanRedoChanged(QUndoStack* self, void* slot) {
|
|
|
|
QUndoStack::connect(self, static_cast<void (QUndoStack::*)(bool)>(&QUndoStack::canRedoChanged), self, [=](bool canRedo) {
|
2024-09-14 22:29:05 +00:00
|
|
|
bool sigval1 = canRedo;
|
|
|
|
miqt_exec_callback_QUndoStack_CanRedoChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QUndoStack_UndoTextChanged(QUndoStack* self, struct miqt_string* undoText) {
|
|
|
|
QString undoText_QString = QString::fromUtf8(&undoText->data, undoText->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->undoTextChanged(undoText_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_connect_UndoTextChanged(QUndoStack* self, void* slot) {
|
|
|
|
QUndoStack::connect(self, static_cast<void (QUndoStack::*)(const QString&)>(&QUndoStack::undoTextChanged), self, [=](const QString& undoText) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QString undoText_ret = undoText;
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray undoText_b = undoText_ret.toUtf8();
|
|
|
|
struct miqt_string* sigval1 = miqt_strdup(undoText_b.data(), undoText_b.length());
|
|
|
|
miqt_exec_callback_QUndoStack_UndoTextChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
void QUndoStack_RedoTextChanged(QUndoStack* self, struct miqt_string* redoText) {
|
|
|
|
QString redoText_QString = QString::fromUtf8(&redoText->data, redoText->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->redoTextChanged(redoText_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_connect_RedoTextChanged(QUndoStack* self, void* slot) {
|
|
|
|
QUndoStack::connect(self, static_cast<void (QUndoStack::*)(const QString&)>(&QUndoStack::redoTextChanged), self, [=](const QString& redoText) {
|
2024-09-14 22:29:05 +00:00
|
|
|
const QString redoText_ret = redoText;
|
|
|
|
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
|
|
|
|
QByteArray redoText_b = redoText_ret.toUtf8();
|
|
|
|
struct miqt_string* sigval1 = miqt_strdup(redoText_b.data(), redoText_b.length());
|
|
|
|
miqt_exec_callback_QUndoStack_RedoTextChanged(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QUndoStack_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QUndoStack::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* QUndoStack_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QUndoStack::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* QUndoStack_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QUndoStack::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* QUndoStack_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QUndoStack::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-14 22:29:05 +00:00
|
|
|
QAction* QUndoStack_CreateUndoAction2(const QUndoStack* self, QObject* parent, struct miqt_string* prefix) {
|
|
|
|
QString prefix_QString = QString::fromUtf8(&prefix->data, prefix->len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->createUndoAction(parent, prefix_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QUndoStack_CreateRedoAction2(const QUndoStack* self, QObject* parent, struct miqt_string* prefix) {
|
|
|
|
QString prefix_QString = QString::fromUtf8(&prefix->data, prefix->len);
|
2024-09-11 05:41:09 +00:00
|
|
|
return self->createRedoAction(parent, prefix_QString);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_SetActive1(QUndoStack* self, bool active) {
|
|
|
|
self->setActive(active);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QUndoStack_Delete(QUndoStack* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|