miqt/qt/gen_qmdiarea.cpp

274 lines
7.9 KiB
C++
Raw Permalink Normal View History

#include <QBrush>
2024-08-29 07:01:51 +00:00
#include <QList>
#include <QMdiArea>
#include <QMdiSubWindow>
#include <QMetaObject>
#include <QSize>
#include <QString>
2024-08-29 07:01:51 +00:00
#include <QByteArray>
#include <cstring>
#include <QWidget>
#include <qmdiarea.h>
2024-08-29 07:01:51 +00:00
#include "gen_qmdiarea.h"
#include "_cgo_export.h"
QMdiArea* QMdiArea_new(QWidget* parent) {
return new QMdiArea(parent);
}
QMdiArea* QMdiArea_new2() {
return new QMdiArea();
}
QMetaObject* QMdiArea_MetaObject(const QMdiArea* self) {
return (QMetaObject*) self->metaObject();
}
void* QMdiArea_Metacast(QMdiArea* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QMdiArea_Tr(const char* s) {
QString _ret = QMdiArea::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;
}
struct miqt_string QMdiArea_TrUtf8(const char* s) {
QString _ret = QMdiArea::trUtf8(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;
}
QSize* QMdiArea_SizeHint(const QMdiArea* self) {
return new QSize(self->sizeHint());
}
QSize* QMdiArea_MinimumSizeHint(const QMdiArea* self) {
return new QSize(self->minimumSizeHint());
}
QMdiSubWindow* QMdiArea_CurrentSubWindow(const QMdiArea* self) {
return self->currentSubWindow();
}
QMdiSubWindow* QMdiArea_ActiveSubWindow(const QMdiArea* self) {
return self->activeSubWindow();
2024-08-29 07:01:51 +00:00
}
struct miqt_array* QMdiArea_SubWindowList(const QMdiArea* self) {
QList<QMdiSubWindow *> _ret = self->subWindowList();
2024-08-29 07:01:51 +00:00
// Convert QList<> from C++ memory to manually-managed C memory
QMdiSubWindow** _arr = static_cast<QMdiSubWindow**>(malloc(sizeof(QMdiSubWindow*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
_arr[i] = _ret[i];
2024-08-29 07:01:51 +00:00
}
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
_out->len = _ret.length();
_out->data = static_cast<void*>(_arr);
return _out;
2024-08-29 07:01:51 +00:00
}
QMdiSubWindow* QMdiArea_AddSubWindow(QMdiArea* self, QWidget* widget) {
return self->addSubWindow(widget);
}
void QMdiArea_RemoveSubWindow(QMdiArea* self, QWidget* widget) {
self->removeSubWindow(widget);
}
QBrush* QMdiArea_Background(const QMdiArea* self) {
return new QBrush(self->background());
}
void QMdiArea_SetBackground(QMdiArea* self, QBrush* background) {
self->setBackground(*background);
}
int QMdiArea_ActivationOrder(const QMdiArea* self) {
QMdiArea::WindowOrder _ret = self->activationOrder();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
void QMdiArea_SetActivationOrder(QMdiArea* self, int order) {
2024-08-29 07:01:51 +00:00
self->setActivationOrder(static_cast<QMdiArea::WindowOrder>(order));
}
void QMdiArea_SetOption(QMdiArea* self, int option) {
2024-08-29 07:01:51 +00:00
self->setOption(static_cast<QMdiArea::AreaOption>(option));
}
bool QMdiArea_TestOption(const QMdiArea* self, int opton) {
return self->testOption(static_cast<QMdiArea::AreaOption>(opton));
2024-08-29 07:01:51 +00:00
}
void QMdiArea_SetViewMode(QMdiArea* self, int mode) {
2024-08-29 07:01:51 +00:00
self->setViewMode(static_cast<QMdiArea::ViewMode>(mode));
}
int QMdiArea_ViewMode(const QMdiArea* self) {
QMdiArea::ViewMode _ret = self->viewMode();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
bool QMdiArea_DocumentMode(const QMdiArea* self) {
return self->documentMode();
}
void QMdiArea_SetDocumentMode(QMdiArea* self, bool enabled) {
self->setDocumentMode(enabled);
}
void QMdiArea_SetTabsClosable(QMdiArea* self, bool closable) {
self->setTabsClosable(closable);
}
bool QMdiArea_TabsClosable(const QMdiArea* self) {
return self->tabsClosable();
}
void QMdiArea_SetTabsMovable(QMdiArea* self, bool movable) {
self->setTabsMovable(movable);
}
bool QMdiArea_TabsMovable(const QMdiArea* self) {
return self->tabsMovable();
2024-08-29 07:01:51 +00:00
}
void QMdiArea_SetTabShape(QMdiArea* self, int shape) {
2024-08-29 07:01:51 +00:00
self->setTabShape(static_cast<QTabWidget::TabShape>(shape));
}
int QMdiArea_TabShape(const QMdiArea* self) {
QTabWidget::TabShape _ret = self->tabShape();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
void QMdiArea_SetTabPosition(QMdiArea* self, int position) {
2024-08-29 07:01:51 +00:00
self->setTabPosition(static_cast<QTabWidget::TabPosition>(position));
}
int QMdiArea_TabPosition(const QMdiArea* self) {
QTabWidget::TabPosition _ret = self->tabPosition();
return static_cast<int>(_ret);
}
void QMdiArea_SubWindowActivated(QMdiArea* self, QMdiSubWindow* param1) {
self->subWindowActivated(param1);
}
void QMdiArea_connect_SubWindowActivated(QMdiArea* self, intptr_t slot) {
QMdiArea::connect(self, static_cast<void (QMdiArea::*)(QMdiSubWindow*)>(&QMdiArea::subWindowActivated), self, [=](QMdiSubWindow* param1) {
QMdiSubWindow* sigval1 = param1;
miqt_exec_callback_QMdiArea_SubWindowActivated(slot, sigval1);
});
}
void QMdiArea_SetActiveSubWindow(QMdiArea* self, QMdiSubWindow* window) {
self->setActiveSubWindow(window);
}
void QMdiArea_TileSubWindows(QMdiArea* self) {
self->tileSubWindows();
}
void QMdiArea_CascadeSubWindows(QMdiArea* self) {
self->cascadeSubWindows();
}
void QMdiArea_CloseActiveSubWindow(QMdiArea* self) {
self->closeActiveSubWindow();
}
void QMdiArea_CloseAllSubWindows(QMdiArea* self) {
self->closeAllSubWindows();
}
void QMdiArea_ActivateNextSubWindow(QMdiArea* self) {
self->activateNextSubWindow();
}
void QMdiArea_ActivatePreviousSubWindow(QMdiArea* self) {
self->activatePreviousSubWindow();
}
struct miqt_string QMdiArea_Tr2(const char* s, const char* c) {
QString _ret = QMdiArea::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 QMdiArea_Tr3(const char* s, const char* c, int n) {
QString _ret = QMdiArea::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;
}
struct miqt_string QMdiArea_TrUtf82(const char* s, const char* c) {
QString _ret = QMdiArea::trUtf8(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 QMdiArea_TrUtf83(const char* s, const char* c, int n) {
QString _ret = QMdiArea::trUtf8(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;
}
struct miqt_array* QMdiArea_SubWindowList1(const QMdiArea* self, int order) {
QList<QMdiSubWindow *> _ret = self->subWindowList(static_cast<QMdiArea::WindowOrder>(order));
2024-08-29 07:01:51 +00:00
// Convert QList<> from C++ memory to manually-managed C memory
QMdiSubWindow** _arr = static_cast<QMdiSubWindow**>(malloc(sizeof(QMdiSubWindow*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
_arr[i] = _ret[i];
2024-08-29 07:01:51 +00:00
}
struct miqt_array* _out = static_cast<struct miqt_array*>(malloc(sizeof(struct miqt_array)));
_out->len = _ret.length();
_out->data = static_cast<void*>(_arr);
return _out;
2024-08-29 07:01:51 +00:00
}
QMdiSubWindow* QMdiArea_AddSubWindow2(QMdiArea* self, QWidget* widget, int flags) {
return self->addSubWindow(widget, static_cast<Qt::WindowFlags>(flags));
}
void QMdiArea_SetOption2(QMdiArea* self, int option, bool on) {
2024-08-29 07:01:51 +00:00
self->setOption(static_cast<QMdiArea::AreaOption>(option), on);
}
void QMdiArea_Delete(QMdiArea* self) {
delete self;
}