#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "qmainwindow.h" #include "gen_qmainwindow.h" extern "C" { extern void miqt_exec_callback(void* cb, int argc, void* argv); } QMainWindow* QMainWindow_new() { return new QMainWindow(); } QMainWindow* QMainWindow_new2(QWidget* parent) { return new QMainWindow(parent); } QMainWindow* QMainWindow_new3(QWidget* parent, int flags) { return new QMainWindow(parent, static_cast(flags)); } QMetaObject* QMainWindow_MetaObject(const QMainWindow* self) { return (QMetaObject*) self->metaObject(); } void QMainWindow_Tr(const char* s, char** _out, int* _out_Strlen) { QString ret = QMainWindow::tr(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QMainWindow_TrUtf8(const char* s, char** _out, int* _out_Strlen) { QString ret = QMainWindow::trUtf8(s); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } QSize* QMainWindow_IconSize(const QMainWindow* self) { QSize ret = self->iconSize(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QSize(ret)); } void QMainWindow_SetIconSize(QMainWindow* self, QSize* iconSize) { self->setIconSize(*iconSize); } uintptr_t QMainWindow_ToolButtonStyle(const QMainWindow* self) { Qt::ToolButtonStyle ret = self->toolButtonStyle(); return static_cast(ret); } void QMainWindow_SetToolButtonStyle(QMainWindow* self, uintptr_t toolButtonStyle) { self->setToolButtonStyle(static_cast(toolButtonStyle)); } bool QMainWindow_IsAnimated(const QMainWindow* self) { return self->isAnimated(); } bool QMainWindow_IsDockNestingEnabled(const QMainWindow* self) { return self->isDockNestingEnabled(); } bool QMainWindow_DocumentMode(const QMainWindow* self) { return self->documentMode(); } void QMainWindow_SetDocumentMode(QMainWindow* self, bool enabled) { self->setDocumentMode(enabled); } uintptr_t QMainWindow_TabShape(const QMainWindow* self) { QTabWidget::TabShape ret = self->tabShape(); return static_cast(ret); } void QMainWindow_SetTabShape(QMainWindow* self, uintptr_t tabShape) { self->setTabShape(static_cast(tabShape)); } uintptr_t QMainWindow_TabPosition(const QMainWindow* self, uintptr_t area) { QTabWidget::TabPosition ret = self->tabPosition(static_cast(area)); return static_cast(ret); } void QMainWindow_SetTabPosition(QMainWindow* self, int areas, uintptr_t tabPosition) { self->setTabPosition(static_cast(areas), static_cast(tabPosition)); } void QMainWindow_SetDockOptions(QMainWindow* self, int options) { self->setDockOptions(static_cast(options)); } int QMainWindow_DockOptions(const QMainWindow* self) { QMainWindow::DockOptions ret = self->dockOptions(); return static_cast(ret); } bool QMainWindow_IsSeparator(const QMainWindow* self, QPoint* pos) { return self->isSeparator(*pos); } QMenuBar* QMainWindow_MenuBar(const QMainWindow* self) { return self->menuBar(); } void QMainWindow_SetMenuBar(QMainWindow* self, QMenuBar* menubar) { self->setMenuBar(menubar); } QWidget* QMainWindow_MenuWidget(const QMainWindow* self) { return self->menuWidget(); } void QMainWindow_SetMenuWidget(QMainWindow* self, QWidget* menubar) { self->setMenuWidget(menubar); } QStatusBar* QMainWindow_StatusBar(const QMainWindow* self) { return self->statusBar(); } void QMainWindow_SetStatusBar(QMainWindow* self, QStatusBar* statusbar) { self->setStatusBar(statusbar); } QWidget* QMainWindow_CentralWidget(const QMainWindow* self) { return self->centralWidget(); } void QMainWindow_SetCentralWidget(QMainWindow* self, QWidget* widget) { self->setCentralWidget(widget); } QWidget* QMainWindow_TakeCentralWidget(QMainWindow* self) { return self->takeCentralWidget(); } void QMainWindow_SetCorner(QMainWindow* self, uintptr_t corner, uintptr_t area) { self->setCorner(static_cast(corner), static_cast(area)); } uintptr_t QMainWindow_Corner(const QMainWindow* self, uintptr_t corner) { Qt::DockWidgetArea ret = self->corner(static_cast(corner)); return static_cast(ret); } void QMainWindow_AddToolBarBreak(QMainWindow* self) { self->addToolBarBreak(); } void QMainWindow_InsertToolBarBreak(QMainWindow* self, QToolBar* before) { self->insertToolBarBreak(before); } void QMainWindow_AddToolBar(QMainWindow* self, uintptr_t area, QToolBar* toolbar) { self->addToolBar(static_cast(area), toolbar); } void QMainWindow_AddToolBarWithToolbar(QMainWindow* self, QToolBar* toolbar) { self->addToolBar(toolbar); } QToolBar* QMainWindow_AddToolBarWithTitle(QMainWindow* self, const char* title, size_t title_Strlen) { QString title_QString = QString::fromUtf8(title, title_Strlen); return self->addToolBar(title_QString); } void QMainWindow_InsertToolBar(QMainWindow* self, QToolBar* before, QToolBar* toolbar) { self->insertToolBar(before, toolbar); } void QMainWindow_RemoveToolBar(QMainWindow* self, QToolBar* toolbar) { self->removeToolBar(toolbar); } void QMainWindow_RemoveToolBarBreak(QMainWindow* self, QToolBar* before) { self->removeToolBarBreak(before); } bool QMainWindow_UnifiedTitleAndToolBarOnMac(const QMainWindow* self) { return self->unifiedTitleAndToolBarOnMac(); } uintptr_t QMainWindow_ToolBarArea(const QMainWindow* self, QToolBar* toolbar) { Qt::ToolBarArea ret = self->toolBarArea(toolbar); return static_cast(ret); } bool QMainWindow_ToolBarBreak(const QMainWindow* self, QToolBar* toolbar) { return self->toolBarBreak(toolbar); } void QMainWindow_AddDockWidget(QMainWindow* self, uintptr_t area, QDockWidget* dockwidget) { self->addDockWidget(static_cast(area), dockwidget); } void QMainWindow_AddDockWidget2(QMainWindow* self, uintptr_t area, QDockWidget* dockwidget, uintptr_t orientation) { self->addDockWidget(static_cast(area), dockwidget, static_cast(orientation)); } void QMainWindow_SplitDockWidget(QMainWindow* self, QDockWidget* after, QDockWidget* dockwidget, uintptr_t orientation) { self->splitDockWidget(after, dockwidget, static_cast(orientation)); } void QMainWindow_TabifyDockWidget(QMainWindow* self, QDockWidget* first, QDockWidget* second) { self->tabifyDockWidget(first, second); } void QMainWindow_TabifiedDockWidgets(const QMainWindow* self, QDockWidget* dockwidget, QDockWidget*** _out, size_t* _out_len) { QList ret = self->tabifiedDockWidgets(dockwidget); // Convert QList<> from C++ memory to manually-managed C memory QDockWidget** __out = static_cast(malloc(sizeof(QDockWidget*) * ret.length())); for (size_t i = 0, e = ret.length(); i < e; ++i) { __out[i] = ret[i]; } *_out = __out; *_out_len = ret.length(); } void QMainWindow_RemoveDockWidget(QMainWindow* self, QDockWidget* dockwidget) { self->removeDockWidget(dockwidget); } bool QMainWindow_RestoreDockWidget(QMainWindow* self, QDockWidget* dockwidget) { return self->restoreDockWidget(dockwidget); } uintptr_t QMainWindow_DockWidgetArea(const QMainWindow* self, QDockWidget* dockwidget) { Qt::DockWidgetArea ret = self->dockWidgetArea(dockwidget); return static_cast(ret); } void QMainWindow_ResizeDocks(QMainWindow* self, QDockWidget** docks, size_t docks_len, int* sizes, size_t sizes_len, uintptr_t orientation) { QList docks_QList; docks_QList.reserve(docks_len); for(size_t i = 0; i < docks_len; ++i) { docks_QList.push_back(docks[i]); } QList sizes_QList; sizes_QList.reserve(sizes_len); for(size_t i = 0; i < sizes_len; ++i) { sizes_QList.push_back(sizes[i]); } self->resizeDocks(docks_QList, sizes_QList, static_cast(orientation)); } QByteArray* QMainWindow_SaveState(const QMainWindow* self) { QByteArray ret = self->saveState(); // Copy-construct value returned type into heap-allocated copy return static_cast(new QByteArray(ret)); } bool QMainWindow_RestoreState(QMainWindow* self, QByteArray* state) { return self->restoreState(*state); } QMenu* QMainWindow_CreatePopupMenu(QMainWindow* self) { return self->createPopupMenu(); } void QMainWindow_SetAnimated(QMainWindow* self, bool enabled) { self->setAnimated(enabled); } void QMainWindow_SetDockNestingEnabled(QMainWindow* self, bool enabled) { self->setDockNestingEnabled(enabled); } void QMainWindow_SetUnifiedTitleAndToolBarOnMac(QMainWindow* self, bool set) { self->setUnifiedTitleAndToolBarOnMac(set); } void QMainWindow_IconSizeChanged(QMainWindow* self, QSize* iconSize) { self->iconSizeChanged(*iconSize); } void QMainWindow_connect_IconSizeChanged(QMainWindow* self, void* slot) { QMainWindow::connect(self, static_cast(&QMainWindow::iconSizeChanged), self, [=](const QSize& iconSize) { miqt_exec_callback(slot, 0, nullptr); }); } void QMainWindow_ToolButtonStyleChanged(QMainWindow* self, uintptr_t toolButtonStyle) { self->toolButtonStyleChanged(static_cast(toolButtonStyle)); } void QMainWindow_connect_ToolButtonStyleChanged(QMainWindow* self, void* slot) { QMainWindow::connect(self, static_cast(&QMainWindow::toolButtonStyleChanged), self, [=](Qt::ToolButtonStyle toolButtonStyle) { miqt_exec_callback(slot, 0, nullptr); }); } void QMainWindow_TabifiedDockWidgetActivated(QMainWindow* self, QDockWidget* dockWidget) { self->tabifiedDockWidgetActivated(dockWidget); } void QMainWindow_connect_TabifiedDockWidgetActivated(QMainWindow* self, void* slot) { QMainWindow::connect(self, static_cast(&QMainWindow::tabifiedDockWidgetActivated), self, [=](QDockWidget* dockWidget) { miqt_exec_callback(slot, 0, nullptr); }); } void QMainWindow_Tr2(const char* s, const char* c, char** _out, int* _out_Strlen) { QString ret = QMainWindow::tr(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QMainWindow_Tr3(const char* s, const char* c, int n, char** _out, int* _out_Strlen) { QString ret = QMainWindow::tr(s, c, static_cast(n)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QMainWindow_TrUtf82(const char* s, const char* c, char** _out, int* _out_Strlen) { QString ret = QMainWindow::trUtf8(s, c); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QMainWindow_TrUtf83(const char* s, const char* c, int n, char** _out, int* _out_Strlen) { QString ret = QMainWindow::trUtf8(s, c, static_cast(n)); // Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory QByteArray b = ret.toUtf8(); *_out = static_cast(malloc(b.length())); memcpy(*_out, b.data(), b.length()); *_out_Strlen = b.length(); } void QMainWindow_AddToolBarBreak1(QMainWindow* self, uintptr_t area) { self->addToolBarBreak(static_cast(area)); } QByteArray* QMainWindow_SaveState1(const QMainWindow* self, int version) { QByteArray ret = self->saveState(static_cast(version)); // Copy-construct value returned type into heap-allocated copy return static_cast(new QByteArray(ret)); } bool QMainWindow_RestoreState2(QMainWindow* self, QByteArray* state, int version) { return self->restoreState(*state, static_cast(version)); } void QMainWindow_Delete(QMainWindow* self) { delete self; }