miqt/qt/gen_qgraphicswidget.cpp

392 lines
13 KiB
C++
Raw Permalink Normal View History

#include <QAction>
#include <QFont>
2024-08-29 07:01:51 +00:00
#include <QGraphicsItem>
#include <QGraphicsLayout>
#include <QGraphicsWidget>
2024-08-29 07:01:51 +00:00
#include <QKeySequence>
#include <QList>
#include <QMarginsF>
#include <QMetaObject>
#include <QPainter>
#include <QPainterPath>
#include <QPalette>
#include <QRectF>
#include <QSizeF>
#include <QString>
2024-08-29 07:01:51 +00:00
#include <QByteArray>
#include <cstring>
#include <QStyle>
#include <QStyleOptionGraphicsItem>
#include <QWidget>
#include <qgraphicswidget.h>
2024-08-29 07:01:51 +00:00
#include "gen_qgraphicswidget.h"
#include "_cgo_export.h"
2024-08-29 07:01:51 +00:00
QGraphicsWidget* QGraphicsWidget_new() {
return new QGraphicsWidget();
}
QGraphicsWidget* QGraphicsWidget_new2(QGraphicsItem* parent) {
return new QGraphicsWidget(parent);
}
QGraphicsWidget* QGraphicsWidget_new3(QGraphicsItem* parent, int wFlags) {
return new QGraphicsWidget(parent, static_cast<Qt::WindowFlags>(wFlags));
}
QMetaObject* QGraphicsWidget_MetaObject(const QGraphicsWidget* self) {
return (QMetaObject*) self->metaObject();
}
void* QGraphicsWidget_Metacast(QGraphicsWidget* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string* QGraphicsWidget_Tr(const char* s) {
QString _ret = QGraphicsWidget::tr(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
struct miqt_string* QGraphicsWidget_TrUtf8(const char* s) {
QString _ret = QGraphicsWidget::trUtf8(s);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
QGraphicsLayout* QGraphicsWidget_Layout(const QGraphicsWidget* self) {
return self->layout();
}
void QGraphicsWidget_SetLayout(QGraphicsWidget* self, QGraphicsLayout* layout) {
self->setLayout(layout);
}
void QGraphicsWidget_AdjustSize(QGraphicsWidget* self) {
self->adjustSize();
}
int QGraphicsWidget_LayoutDirection(const QGraphicsWidget* self) {
Qt::LayoutDirection _ret = self->layoutDirection();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
void QGraphicsWidget_SetLayoutDirection(QGraphicsWidget* self, int direction) {
2024-08-29 07:01:51 +00:00
self->setLayoutDirection(static_cast<Qt::LayoutDirection>(direction));
}
void QGraphicsWidget_UnsetLayoutDirection(QGraphicsWidget* self) {
self->unsetLayoutDirection();
}
QStyle* QGraphicsWidget_Style(const QGraphicsWidget* self) {
return self->style();
}
void QGraphicsWidget_SetStyle(QGraphicsWidget* self, QStyle* style) {
self->setStyle(style);
}
QFont* QGraphicsWidget_Font(const QGraphicsWidget* self) {
return new QFont(self->font());
}
void QGraphicsWidget_SetFont(QGraphicsWidget* self, QFont* font) {
self->setFont(*font);
}
QPalette* QGraphicsWidget_Palette(const QGraphicsWidget* self) {
return new QPalette(self->palette());
}
void QGraphicsWidget_SetPalette(QGraphicsWidget* self, QPalette* palette) {
self->setPalette(*palette);
}
bool QGraphicsWidget_AutoFillBackground(const QGraphicsWidget* self) {
return self->autoFillBackground();
}
void QGraphicsWidget_SetAutoFillBackground(QGraphicsWidget* self, bool enabled) {
self->setAutoFillBackground(enabled);
}
void QGraphicsWidget_Resize(QGraphicsWidget* self, QSizeF* size) {
self->resize(*size);
}
void QGraphicsWidget_Resize2(QGraphicsWidget* self, double w, double h) {
self->resize(static_cast<qreal>(w), static_cast<qreal>(h));
}
QSizeF* QGraphicsWidget_Size(const QGraphicsWidget* self) {
return new QSizeF(self->size());
}
void QGraphicsWidget_SetGeometry(QGraphicsWidget* self, QRectF* rect) {
self->setGeometry(*rect);
}
void QGraphicsWidget_SetGeometry2(QGraphicsWidget* self, double x, double y, double w, double h) {
self->setGeometry(static_cast<qreal>(x), static_cast<qreal>(y), static_cast<qreal>(w), static_cast<qreal>(h));
}
QRectF* QGraphicsWidget_Rect(const QGraphicsWidget* self) {
return new QRectF(self->rect());
}
void QGraphicsWidget_SetContentsMargins(QGraphicsWidget* self, double left, double top, double right, double bottom) {
self->setContentsMargins(static_cast<qreal>(left), static_cast<qreal>(top), static_cast<qreal>(right), static_cast<qreal>(bottom));
}
void QGraphicsWidget_SetContentsMarginsWithMargins(QGraphicsWidget* self, QMarginsF* margins) {
self->setContentsMargins(*margins);
}
void QGraphicsWidget_GetContentsMargins(const QGraphicsWidget* self, double* left, double* top, double* right, double* bottom) {
self->getContentsMargins(static_cast<qreal*>(left), static_cast<qreal*>(top), static_cast<qreal*>(right), static_cast<qreal*>(bottom));
}
void QGraphicsWidget_SetWindowFrameMargins(QGraphicsWidget* self, double left, double top, double right, double bottom) {
self->setWindowFrameMargins(static_cast<qreal>(left), static_cast<qreal>(top), static_cast<qreal>(right), static_cast<qreal>(bottom));
}
void QGraphicsWidget_SetWindowFrameMarginsWithMargins(QGraphicsWidget* self, QMarginsF* margins) {
self->setWindowFrameMargins(*margins);
}
void QGraphicsWidget_GetWindowFrameMargins(const QGraphicsWidget* self, double* left, double* top, double* right, double* bottom) {
self->getWindowFrameMargins(static_cast<qreal*>(left), static_cast<qreal*>(top), static_cast<qreal*>(right), static_cast<qreal*>(bottom));
}
void QGraphicsWidget_UnsetWindowFrameMargins(QGraphicsWidget* self) {
self->unsetWindowFrameMargins();
}
QRectF* QGraphicsWidget_WindowFrameGeometry(const QGraphicsWidget* self) {
return new QRectF(self->windowFrameGeometry());
}
QRectF* QGraphicsWidget_WindowFrameRect(const QGraphicsWidget* self) {
return new QRectF(self->windowFrameRect());
}
int QGraphicsWidget_WindowFlags(const QGraphicsWidget* self) {
Qt::WindowFlags _ret = self->windowFlags();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
int QGraphicsWidget_WindowType(const QGraphicsWidget* self) {
Qt::WindowType _ret = self->windowType();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
void QGraphicsWidget_SetWindowFlags(QGraphicsWidget* self, int wFlags) {
self->setWindowFlags(static_cast<Qt::WindowFlags>(wFlags));
}
bool QGraphicsWidget_IsActiveWindow(const QGraphicsWidget* self) {
return self->isActiveWindow();
}
void QGraphicsWidget_SetWindowTitle(QGraphicsWidget* self, struct miqt_string* title) {
QString title_QString = QString::fromUtf8(&title->data, title->len);
self->setWindowTitle(title_QString);
}
struct miqt_string* QGraphicsWidget_WindowTitle(const QGraphicsWidget* self) {
QString _ret = self->windowTitle();
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
int QGraphicsWidget_FocusPolicy(const QGraphicsWidget* self) {
Qt::FocusPolicy _ret = self->focusPolicy();
return static_cast<int>(_ret);
2024-08-29 07:01:51 +00:00
}
void QGraphicsWidget_SetFocusPolicy(QGraphicsWidget* self, int policy) {
2024-08-29 07:01:51 +00:00
self->setFocusPolicy(static_cast<Qt::FocusPolicy>(policy));
}
void QGraphicsWidget_SetTabOrder(QGraphicsWidget* first, QGraphicsWidget* second) {
QGraphicsWidget::setTabOrder(first, second);
}
QGraphicsWidget* QGraphicsWidget_FocusWidget(const QGraphicsWidget* self) {
return self->focusWidget();
2024-08-29 07:01:51 +00:00
}
int QGraphicsWidget_GrabShortcut(QGraphicsWidget* self, QKeySequence* sequence) {
return self->grabShortcut(*sequence);
}
void QGraphicsWidget_ReleaseShortcut(QGraphicsWidget* self, int id) {
self->releaseShortcut(static_cast<int>(id));
}
void QGraphicsWidget_SetShortcutEnabled(QGraphicsWidget* self, int id) {
self->setShortcutEnabled(static_cast<int>(id));
}
void QGraphicsWidget_SetShortcutAutoRepeat(QGraphicsWidget* self, int id) {
self->setShortcutAutoRepeat(static_cast<int>(id));
}
void QGraphicsWidget_AddAction(QGraphicsWidget* self, QAction* action) {
self->addAction(action);
}
void QGraphicsWidget_AddActions(QGraphicsWidget* self, struct miqt_array* /* of QAction* */ actions) {
QList<QAction *> actions_QList;
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]);
}
self->addActions(actions_QList);
}
void QGraphicsWidget_InsertActions(QGraphicsWidget* self, QAction* before, struct miqt_array* /* of QAction* */ actions) {
QList<QAction *> actions_QList;
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]);
}
self->insertActions(before, actions_QList);
}
void QGraphicsWidget_InsertAction(QGraphicsWidget* self, QAction* before, QAction* action) {
self->insertAction(before, action);
}
void QGraphicsWidget_RemoveAction(QGraphicsWidget* self, QAction* action) {
self->removeAction(action);
}
struct miqt_array* QGraphicsWidget_Actions(const QGraphicsWidget* self) {
QList<QAction *> _ret = self->actions();
// Convert QList<> from C++ memory to manually-managed C memory
QAction** _arr = static_cast<QAction**>(malloc(sizeof(QAction*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
_arr[i] = _ret[i];
}
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;
}
void QGraphicsWidget_SetAttribute(QGraphicsWidget* self, int attribute) {
2024-08-29 07:01:51 +00:00
self->setAttribute(static_cast<Qt::WidgetAttribute>(attribute));
}
bool QGraphicsWidget_TestAttribute(const QGraphicsWidget* self, int attribute) {
return self->testAttribute(static_cast<Qt::WidgetAttribute>(attribute));
2024-08-29 07:01:51 +00:00
}
int QGraphicsWidget_Type(const QGraphicsWidget* self) {
return self->type();
}
void QGraphicsWidget_Paint(QGraphicsWidget* self, QPainter* painter, QStyleOptionGraphicsItem* option) {
self->paint(painter, option);
}
void QGraphicsWidget_PaintWindowFrame(QGraphicsWidget* self, QPainter* painter, QStyleOptionGraphicsItem* option) {
self->paintWindowFrame(painter, option);
}
QRectF* QGraphicsWidget_BoundingRect(const QGraphicsWidget* self) {
return new QRectF(self->boundingRect());
}
QPainterPath* QGraphicsWidget_Shape(const QGraphicsWidget* self) {
return new QPainterPath(self->shape());
}
void QGraphicsWidget_GeometryChanged(QGraphicsWidget* self) {
self->geometryChanged();
}
void QGraphicsWidget_connect_GeometryChanged(QGraphicsWidget* self, intptr_t slot) {
QGraphicsWidget::connect(self, static_cast<void (QGraphicsWidget::*)()>(&QGraphicsWidget::geometryChanged), self, [=]() {
miqt_exec_callback_QGraphicsWidget_GeometryChanged(slot);
});
}
void QGraphicsWidget_LayoutChanged(QGraphicsWidget* self) {
self->layoutChanged();
}
void QGraphicsWidget_connect_LayoutChanged(QGraphicsWidget* self, intptr_t slot) {
QGraphicsWidget::connect(self, static_cast<void (QGraphicsWidget::*)()>(&QGraphicsWidget::layoutChanged), self, [=]() {
miqt_exec_callback_QGraphicsWidget_LayoutChanged(slot);
});
}
bool QGraphicsWidget_Close(QGraphicsWidget* self) {
return self->close();
}
struct miqt_string* QGraphicsWidget_Tr2(const char* s, const char* c) {
QString _ret = QGraphicsWidget::tr(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
struct miqt_string* QGraphicsWidget_Tr3(const char* s, const char* c, int n) {
QString _ret = QGraphicsWidget::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();
return miqt_strdup(_b.data(), _b.length());
}
struct miqt_string* QGraphicsWidget_TrUtf82(const char* s, const char* c) {
QString _ret = QGraphicsWidget::trUtf8(s, c);
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _b = _ret.toUtf8();
return miqt_strdup(_b.data(), _b.length());
}
struct miqt_string* QGraphicsWidget_TrUtf83(const char* s, const char* c, int n) {
QString _ret = QGraphicsWidget::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();
return miqt_strdup(_b.data(), _b.length());
}
int QGraphicsWidget_GrabShortcut2(QGraphicsWidget* self, QKeySequence* sequence, int context) {
2024-08-29 07:01:51 +00:00
return self->grabShortcut(*sequence, static_cast<Qt::ShortcutContext>(context));
}
void QGraphicsWidget_SetShortcutEnabled2(QGraphicsWidget* self, int id, bool enabled) {
self->setShortcutEnabled(static_cast<int>(id), enabled);
}
void QGraphicsWidget_SetShortcutAutoRepeat2(QGraphicsWidget* self, int id, bool enabled) {
self->setShortcutAutoRepeat(static_cast<int>(id), enabled);
}
void QGraphicsWidget_SetAttribute2(QGraphicsWidget* self, int attribute, bool on) {
2024-08-29 07:01:51 +00:00
self->setAttribute(static_cast<Qt::WidgetAttribute>(attribute), on);
}
void QGraphicsWidget_Paint3(QGraphicsWidget* self, QPainter* painter, QStyleOptionGraphicsItem* option, QWidget* widget) {
self->paint(painter, option, widget);
}
void QGraphicsWidget_PaintWindowFrame3(QGraphicsWidget* self, QPainter* painter, QStyleOptionGraphicsItem* option, QWidget* widget) {
self->paintWindowFrame(painter, option, widget);
}
void QGraphicsWidget_Delete(QGraphicsWidget* self) {
delete self;
}