mirror of
https://github.com/mappu/miqt.git
synced 2024-12-23 01:18:37 +00:00
123 lines
3.2 KiB
C++
123 lines
3.2 KiB
C++
#include <QIcon>
|
|
#include <QMetaObject>
|
|
#include <QString>
|
|
#include <QByteArray>
|
|
#include <cstring>
|
|
#include <QUndoGroup>
|
|
#include <QUndoStack>
|
|
#include <QUndoView>
|
|
#include <QWidget>
|
|
#include <qundoview.h>
|
|
#include "gen_qundoview.h"
|
|
#include "_cgo_export.h"
|
|
|
|
QUndoView* QUndoView_new() {
|
|
return new QUndoView();
|
|
}
|
|
|
|
QUndoView* QUndoView_new2(QUndoStack* stack) {
|
|
return new QUndoView(stack);
|
|
}
|
|
|
|
QUndoView* QUndoView_new3(QUndoGroup* group) {
|
|
return new QUndoView(group);
|
|
}
|
|
|
|
QUndoView* QUndoView_new4(QWidget* parent) {
|
|
return new QUndoView(parent);
|
|
}
|
|
|
|
QUndoView* QUndoView_new5(QUndoStack* stack, QWidget* parent) {
|
|
return new QUndoView(stack, parent);
|
|
}
|
|
|
|
QUndoView* QUndoView_new6(QUndoGroup* group, QWidget* parent) {
|
|
return new QUndoView(group, parent);
|
|
}
|
|
|
|
QMetaObject* QUndoView_MetaObject(const QUndoView* self) {
|
|
return (QMetaObject*) self->metaObject();
|
|
}
|
|
|
|
void* QUndoView_Metacast(QUndoView* self, const char* param1) {
|
|
return self->qt_metacast(param1);
|
|
}
|
|
|
|
struct miqt_string QUndoView_Tr(const char* s) {
|
|
QString _ret = QUndoView::tr(s);
|
|
// 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;
|
|
}
|
|
|
|
QUndoStack* QUndoView_Stack(const QUndoView* self) {
|
|
return self->stack();
|
|
}
|
|
|
|
QUndoGroup* QUndoView_Group(const QUndoView* self) {
|
|
return self->group();
|
|
}
|
|
|
|
void QUndoView_SetEmptyLabel(QUndoView* self, struct miqt_string label) {
|
|
QString label_QString = QString::fromUtf8(label.data, label.len);
|
|
self->setEmptyLabel(label_QString);
|
|
}
|
|
|
|
struct miqt_string QUndoView_EmptyLabel(const QUndoView* self) {
|
|
QString _ret = self->emptyLabel();
|
|
// 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;
|
|
}
|
|
|
|
void QUndoView_SetCleanIcon(QUndoView* self, QIcon* icon) {
|
|
self->setCleanIcon(*icon);
|
|
}
|
|
|
|
QIcon* QUndoView_CleanIcon(const QUndoView* self) {
|
|
return new QIcon(self->cleanIcon());
|
|
}
|
|
|
|
void QUndoView_SetStack(QUndoView* self, QUndoStack* stack) {
|
|
self->setStack(stack);
|
|
}
|
|
|
|
void QUndoView_SetGroup(QUndoView* self, QUndoGroup* group) {
|
|
self->setGroup(group);
|
|
}
|
|
|
|
struct miqt_string QUndoView_Tr2(const char* s, const char* c) {
|
|
QString _ret = QUndoView::tr(s, c);
|
|
// 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;
|
|
}
|
|
|
|
struct miqt_string QUndoView_Tr3(const char* s, const char* c, int n) {
|
|
QString _ret = QUndoView::tr(s, c, static_cast<int>(n));
|
|
// 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;
|
|
}
|
|
|
|
void QUndoView_Delete(QUndoView* self) {
|
|
delete self;
|
|
}
|
|
|