2024-08-25 04:08:24 +00:00
|
|
|
#include <QAction>
|
|
|
|
#include <QIcon>
|
|
|
|
#include <QList>
|
|
|
|
#include <QMenu>
|
|
|
|
#include <QMetaObject>
|
|
|
|
#include <QPoint>
|
|
|
|
#include <QRect>
|
|
|
|
#include <QSize>
|
|
|
|
#include <QString>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include <QByteArray>
|
|
|
|
#include <cstring>
|
2024-08-25 04:08:24 +00:00
|
|
|
#include <QWidget>
|
2024-08-29 07:01:51 +00:00
|
|
|
#include "qmenu.h"
|
|
|
|
#include "gen_qmenu.h"
|
2024-09-14 22:29:05 +00:00
|
|
|
#include "_cgo_export.h"
|
2024-08-25 04:08:24 +00:00
|
|
|
|
|
|
|
QMenu* QMenu_new() {
|
|
|
|
return new QMenu();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QMenu* QMenu_new2(struct miqt_string* title) {
|
|
|
|
QString title_QString = QString::fromUtf8(&title->data, title->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QMenu(title_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QMenu* QMenu_new3(QWidget* parent) {
|
|
|
|
return new QMenu(parent);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QMenu* QMenu_new4(struct miqt_string* title, QWidget* parent) {
|
|
|
|
QString title_QString = QString::fromUtf8(&title->data, title->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return new QMenu(title_QString, parent);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QMetaObject* QMenu_MetaObject(const QMenu* self) {
|
|
|
|
return (QMetaObject*) self->metaObject();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QMenu_Tr(const char* s) {
|
|
|
|
QString _ret = QMenu::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* QMenu_TrUtf8(const char* s) {
|
|
|
|
QString _ret = QMenu::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
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QMenu_AddAction(QMenu* self, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->addAction(text_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QMenu_AddAction2(QMenu* self, QIcon* icon, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->addAction(*icon, text_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QAction* QMenu_AddMenu(QMenu* self, QMenu* menu) {
|
|
|
|
return self->addMenu(menu);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QMenu* QMenu_AddMenuWithTitle(QMenu* self, struct miqt_string* title) {
|
|
|
|
QString title_QString = QString::fromUtf8(&title->data, title->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->addMenu(title_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QMenu* QMenu_AddMenu2(QMenu* self, QIcon* icon, struct miqt_string* title) {
|
|
|
|
QString title_QString = QString::fromUtf8(&title->data, title->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->addMenu(*icon, title_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QAction* QMenu_AddSeparator(QMenu* self) {
|
|
|
|
return self->addSeparator();
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QMenu_AddSection(QMenu* self, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->addSection(text_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QMenu_AddSection2(QMenu* self, QIcon* icon, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->addSection(*icon, text_QString);
|
|
|
|
}
|
|
|
|
|
|
|
|
QAction* QMenu_InsertMenu(QMenu* self, QAction* before, QMenu* menu) {
|
|
|
|
return self->insertMenu(before, menu);
|
|
|
|
}
|
|
|
|
|
|
|
|
QAction* QMenu_InsertSeparator(QMenu* self, QAction* before) {
|
|
|
|
return self->insertSeparator(before);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QMenu_InsertSection(QMenu* self, QAction* before, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->insertSection(before, text_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QMenu_InsertSection2(QMenu* self, QAction* before, QIcon* icon, struct miqt_string* text) {
|
|
|
|
QString text_QString = QString::fromUtf8(&text->data, text->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
return self->insertSection(before, *icon, text_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QMenu_IsEmpty(const QMenu* self) {
|
|
|
|
return self->isEmpty();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_Clear(QMenu* self) {
|
|
|
|
self->clear();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_SetTearOffEnabled(QMenu* self, bool tearOffEnabled) {
|
|
|
|
self->setTearOffEnabled(tearOffEnabled);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QMenu_IsTearOffEnabled(const QMenu* self) {
|
|
|
|
return self->isTearOffEnabled();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QMenu_IsTearOffMenuVisible(const QMenu* self) {
|
|
|
|
return self->isTearOffMenuVisible();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_ShowTearOffMenu(QMenu* self) {
|
|
|
|
self->showTearOffMenu();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_ShowTearOffMenuWithPos(QMenu* self, QPoint* pos) {
|
|
|
|
self->showTearOffMenu(*pos);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_HideTearOffMenu(QMenu* self) {
|
|
|
|
self->hideTearOffMenu();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_SetDefaultAction(QMenu* self, QAction* defaultAction) {
|
|
|
|
self->setDefaultAction(defaultAction);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QAction* QMenu_DefaultAction(const QMenu* self) {
|
|
|
|
return self->defaultAction();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_SetActiveAction(QMenu* self, QAction* act) {
|
|
|
|
self->setActiveAction(act);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QAction* QMenu_ActiveAction(const QMenu* self) {
|
|
|
|
return self->activeAction();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_Popup(QMenu* self, QPoint* pos) {
|
|
|
|
self->popup(*pos);
|
|
|
|
}
|
|
|
|
|
|
|
|
QAction* QMenu_Exec(QMenu* self) {
|
|
|
|
return self->exec();
|
|
|
|
}
|
|
|
|
|
|
|
|
QAction* QMenu_ExecWithPos(QMenu* self, QPoint* pos) {
|
|
|
|
return self->exec(*pos);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QMenu_Exec2(struct miqt_array* /* of QAction* */ actions, QPoint* pos) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QAction*> actions_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
actions_QList.reserve(actions->len);
|
|
|
|
QAction** actions_arr = static_cast<QAction**>(actions->data);
|
|
|
|
for(size_t i = 0; i < actions->len; ++i) {
|
|
|
|
actions_QList.push_back(actions_arr[i]);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
return QMenu::exec(actions_QList, *pos);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QSize* QMenu_SizeHint(const QMenu* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QSize _ret = self->sizeHint();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QSize*>(new QSize(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QRect* QMenu_ActionGeometry(const QMenu* self, QAction* param1) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QRect _ret = self->actionGeometry(param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QRect*>(new QRect(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QAction* QMenu_ActionAt(const QMenu* self, QPoint* param1) {
|
|
|
|
return self->actionAt(*param1);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QAction* QMenu_MenuAction(const QMenu* self) {
|
|
|
|
return self->menuAction();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QMenu_Title(const QMenu* self) {
|
|
|
|
QString _ret = self->title();
|
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 QMenu_SetTitle(QMenu* self, struct miqt_string* title) {
|
|
|
|
QString title_QString = QString::fromUtf8(&title->data, title->len);
|
2024-08-25 04:08:24 +00:00
|
|
|
self->setTitle(title_QString);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
QIcon* QMenu_Icon(const QMenu* self) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QIcon _ret = self->icon();
|
2024-08-25 04:08:24 +00:00
|
|
|
// Copy-construct value returned type into heap-allocated copy
|
2024-09-14 22:29:05 +00:00
|
|
|
return static_cast<QIcon*>(new QIcon(_ret));
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_SetIcon(QMenu* self, QIcon* icon) {
|
|
|
|
self->setIcon(*icon);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_SetNoReplayFor(QMenu* self, QWidget* widget) {
|
|
|
|
self->setNoReplayFor(widget);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QMenu_SeparatorsCollapsible(const QMenu* self) {
|
|
|
|
return self->separatorsCollapsible();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_SetSeparatorsCollapsible(QMenu* self, bool collapse) {
|
|
|
|
self->setSeparatorsCollapsible(collapse);
|
|
|
|
}
|
|
|
|
|
2024-09-11 05:41:09 +00:00
|
|
|
bool QMenu_ToolTipsVisible(const QMenu* self) {
|
|
|
|
return self->toolTipsVisible();
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_SetToolTipsVisible(QMenu* self, bool visible) {
|
|
|
|
self->setToolTipsVisible(visible);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_AboutToShow(QMenu* self) {
|
|
|
|
self->aboutToShow();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_connect_AboutToShow(QMenu* self, void* slot) {
|
|
|
|
QMenu::connect(self, static_cast<void (QMenu::*)()>(&QMenu::aboutToShow), self, [=]() {
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QMenu_AboutToShow(slot);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_AboutToHide(QMenu* self) {
|
|
|
|
self->aboutToHide();
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_connect_AboutToHide(QMenu* self, void* slot) {
|
|
|
|
QMenu::connect(self, static_cast<void (QMenu::*)()>(&QMenu::aboutToHide), self, [=]() {
|
2024-09-14 22:29:05 +00:00
|
|
|
miqt_exec_callback_QMenu_AboutToHide(slot);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_Triggered(QMenu* self, QAction* action) {
|
|
|
|
self->triggered(action);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_connect_Triggered(QMenu* self, void* slot) {
|
|
|
|
QMenu::connect(self, static_cast<void (QMenu::*)(QAction*)>(&QMenu::triggered), self, [=](QAction* action) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* sigval1 = action;
|
|
|
|
miqt_exec_callback_QMenu_Triggered(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_Hovered(QMenu* self, QAction* action) {
|
|
|
|
self->hovered(action);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_connect_Hovered(QMenu* self, void* slot) {
|
|
|
|
QMenu::connect(self, static_cast<void (QMenu::*)(QAction*)>(&QMenu::hovered), self, [=](QAction* action) {
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* sigval1 = action;
|
|
|
|
miqt_exec_callback_QMenu_Hovered(slot, sigval1);
|
2024-08-25 04:08:24 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
struct miqt_string* QMenu_Tr2(const char* s, const char* c) {
|
|
|
|
QString _ret = QMenu::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* QMenu_Tr3(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QMenu::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* QMenu_TrUtf82(const char* s, const char* c) {
|
|
|
|
QString _ret = QMenu::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* QMenu_TrUtf83(const char* s, const char* c, int n) {
|
|
|
|
QString _ret = QMenu::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
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_Popup2(QMenu* self, QPoint* pos, QAction* at) {
|
|
|
|
self->popup(*pos, at);
|
|
|
|
}
|
|
|
|
|
|
|
|
QAction* QMenu_Exec22(QMenu* self, QPoint* pos, QAction* at) {
|
|
|
|
return self->exec(*pos, at);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QMenu_Exec3(struct miqt_array* /* of QAction* */ actions, QPoint* pos, QAction* at) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QAction*> actions_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
actions_QList.reserve(actions->len);
|
|
|
|
QAction** actions_arr = static_cast<QAction**>(actions->data);
|
|
|
|
for(size_t i = 0; i < actions->len; ++i) {
|
|
|
|
actions_QList.push_back(actions_arr[i]);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
return QMenu::exec(actions_QList, *pos, at);
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
QAction* QMenu_Exec4(struct miqt_array* /* of QAction* */ actions, QPoint* pos, QAction* at, QWidget* parent) {
|
2024-08-29 07:01:51 +00:00
|
|
|
QList<QAction*> actions_QList;
|
2024-09-14 22:29:05 +00:00
|
|
|
actions_QList.reserve(actions->len);
|
|
|
|
QAction** actions_arr = static_cast<QAction**>(actions->data);
|
|
|
|
for(size_t i = 0; i < actions->len; ++i) {
|
|
|
|
actions_QList.push_back(actions_arr[i]);
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
return QMenu::exec(actions_QList, *pos, at, parent);
|
|
|
|
}
|
|
|
|
|
|
|
|
void QMenu_Delete(QMenu* self) {
|
|
|
|
delete self;
|
|
|
|
}
|
|
|
|
|