miqt/qt6/svg/gen_qgraphicssvgitem.cpp

284 lines
8.7 KiB
C++

#include <QEvent>
#include <QGraphicsItem>
#include <QGraphicsObject>
#include <QGraphicsSvgItem>
#include <QMetaObject>
#include <QObject>
#include <QPainter>
#include <QRectF>
#include <QSize>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QStyleOptionGraphicsItem>
#include <QSvgRenderer>
#include <QWidget>
#include <qgraphicssvgitem.h>
#include "gen_qgraphicssvgitem.h"
#ifndef _Bool
#define _Bool bool
#endif
#include "_cgo_export.h"
class MiqtVirtualQGraphicsSvgItem : public virtual QGraphicsSvgItem {
public:
MiqtVirtualQGraphicsSvgItem(): QGraphicsSvgItem() {};
MiqtVirtualQGraphicsSvgItem(const QString& fileName): QGraphicsSvgItem(fileName) {};
MiqtVirtualQGraphicsSvgItem(QGraphicsItem* parentItem): QGraphicsSvgItem(parentItem) {};
MiqtVirtualQGraphicsSvgItem(const QString& fileName, QGraphicsItem* parentItem): QGraphicsSvgItem(fileName, parentItem) {};
virtual ~MiqtVirtualQGraphicsSvgItem() = default;
// cgo.Handle value for overwritten implementation
intptr_t handle__BoundingRect = 0;
// Subclass to allow providing a Go implementation
virtual QRectF boundingRect() const override {
if (handle__BoundingRect == 0) {
return QGraphicsSvgItem::boundingRect();
}
QRectF* callback_return_value = miqt_exec_callback_QGraphicsSvgItem_BoundingRect(const_cast<MiqtVirtualQGraphicsSvgItem*>(this), handle__BoundingRect);
return *callback_return_value;
}
// Wrapper to allow calling protected method
QRectF* virtualbase_BoundingRect() const {
return new QRectF(QGraphicsSvgItem::boundingRect());
}
// cgo.Handle value for overwritten implementation
intptr_t handle__Paint = 0;
// Subclass to allow providing a Go implementation
virtual void paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget) override {
if (handle__Paint == 0) {
QGraphicsSvgItem::paint(painter, option, widget);
return;
}
QPainter* sigval1 = painter;
QStyleOptionGraphicsItem* sigval2 = (QStyleOptionGraphicsItem*) option;
QWidget* sigval3 = widget;
miqt_exec_callback_QGraphicsSvgItem_Paint(this, handle__Paint, sigval1, sigval2, sigval3);
}
// Wrapper to allow calling protected method
void virtualbase_Paint(QPainter* painter, QStyleOptionGraphicsItem* option, QWidget* widget) {
QGraphicsSvgItem::paint(painter, option, widget);
}
// cgo.Handle value for overwritten implementation
intptr_t handle__Type = 0;
// Subclass to allow providing a Go implementation
virtual int type() const override {
if (handle__Type == 0) {
return QGraphicsSvgItem::type();
}
int callback_return_value = miqt_exec_callback_QGraphicsSvgItem_Type(const_cast<MiqtVirtualQGraphicsSvgItem*>(this), handle__Type);
return static_cast<int>(callback_return_value);
}
// Wrapper to allow calling protected method
int virtualbase_Type() const {
return QGraphicsSvgItem::type();
}
// cgo.Handle value for overwritten implementation
intptr_t handle__Event = 0;
// Subclass to allow providing a Go implementation
virtual bool event(QEvent* ev) override {
if (handle__Event == 0) {
return QGraphicsSvgItem::event(ev);
}
QEvent* sigval1 = ev;
bool callback_return_value = miqt_exec_callback_QGraphicsSvgItem_Event(this, handle__Event, sigval1);
return callback_return_value;
}
// Wrapper to allow calling protected method
bool virtualbase_Event(QEvent* ev) {
return QGraphicsSvgItem::event(ev);
}
};
QGraphicsSvgItem* QGraphicsSvgItem_new() {
return new MiqtVirtualQGraphicsSvgItem();
}
QGraphicsSvgItem* QGraphicsSvgItem_new2(struct miqt_string fileName) {
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
return new MiqtVirtualQGraphicsSvgItem(fileName_QString);
}
QGraphicsSvgItem* QGraphicsSvgItem_new3(QGraphicsItem* parentItem) {
return new MiqtVirtualQGraphicsSvgItem(parentItem);
}
QGraphicsSvgItem* QGraphicsSvgItem_new4(struct miqt_string fileName, QGraphicsItem* parentItem) {
QString fileName_QString = QString::fromUtf8(fileName.data, fileName.len);
return new MiqtVirtualQGraphicsSvgItem(fileName_QString, parentItem);
}
void QGraphicsSvgItem_virtbase(QGraphicsSvgItem* src, QGraphicsObject** outptr_QGraphicsObject) {
*outptr_QGraphicsObject = static_cast<QGraphicsObject*>(src);
}
QMetaObject* QGraphicsSvgItem_MetaObject(const QGraphicsSvgItem* self) {
return (QMetaObject*) self->metaObject();
}
void* QGraphicsSvgItem_Metacast(QGraphicsSvgItem* self, const char* param1) {
return self->qt_metacast(param1);
}
struct miqt_string QGraphicsSvgItem_Tr(const char* s) {
QString _ret = QGraphicsSvgItem::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;
}
void QGraphicsSvgItem_SetSharedRenderer(QGraphicsSvgItem* self, QSvgRenderer* renderer) {
self->setSharedRenderer(renderer);
}
QSvgRenderer* QGraphicsSvgItem_Renderer(const QGraphicsSvgItem* self) {
return self->renderer();
}
void QGraphicsSvgItem_SetElementId(QGraphicsSvgItem* self, struct miqt_string id) {
QString id_QString = QString::fromUtf8(id.data, id.len);
self->setElementId(id_QString);
}
struct miqt_string QGraphicsSvgItem_ElementId(const QGraphicsSvgItem* self) {
QString _ret = self->elementId();
// 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 QGraphicsSvgItem_SetCachingEnabled(QGraphicsSvgItem* self, bool cachingEnabled) {
self->setCachingEnabled(cachingEnabled);
}
bool QGraphicsSvgItem_IsCachingEnabled(const QGraphicsSvgItem* self) {
return self->isCachingEnabled();
}
void QGraphicsSvgItem_SetMaximumCacheSize(QGraphicsSvgItem* self, QSize* size) {
self->setMaximumCacheSize(*size);
}
QSize* QGraphicsSvgItem_MaximumCacheSize(const QGraphicsSvgItem* self) {
return new QSize(self->maximumCacheSize());
}
QRectF* QGraphicsSvgItem_BoundingRect(const QGraphicsSvgItem* self) {
return new QRectF(self->boundingRect());
}
void QGraphicsSvgItem_Paint(QGraphicsSvgItem* self, QPainter* painter, QStyleOptionGraphicsItem* option, QWidget* widget) {
self->paint(painter, option, widget);
}
int QGraphicsSvgItem_Type(const QGraphicsSvgItem* self) {
return self->type();
}
struct miqt_string QGraphicsSvgItem_Tr2(const char* s, const char* c) {
QString _ret = QGraphicsSvgItem::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 QGraphicsSvgItem_Tr3(const char* s, const char* c, int n) {
QString _ret = QGraphicsSvgItem::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 QGraphicsSvgItem_override_virtual_BoundingRect(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQGraphicsSvgItem*>( (QGraphicsSvgItem*)(self) )->handle__BoundingRect = slot;
}
QRectF* QGraphicsSvgItem_virtualbase_BoundingRect(const void* self) {
return ( (const MiqtVirtualQGraphicsSvgItem*)(self) )->virtualbase_BoundingRect();
}
void QGraphicsSvgItem_override_virtual_Paint(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQGraphicsSvgItem*>( (QGraphicsSvgItem*)(self) )->handle__Paint = slot;
}
void QGraphicsSvgItem_virtualbase_Paint(void* self, QPainter* painter, QStyleOptionGraphicsItem* option, QWidget* widget) {
( (MiqtVirtualQGraphicsSvgItem*)(self) )->virtualbase_Paint(painter, option, widget);
}
void QGraphicsSvgItem_override_virtual_Type(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQGraphicsSvgItem*>( (QGraphicsSvgItem*)(self) )->handle__Type = slot;
}
int QGraphicsSvgItem_virtualbase_Type(const void* self) {
return ( (const MiqtVirtualQGraphicsSvgItem*)(self) )->virtualbase_Type();
}
void QGraphicsSvgItem_override_virtual_Event(void* self, intptr_t slot) {
dynamic_cast<MiqtVirtualQGraphicsSvgItem*>( (QGraphicsSvgItem*)(self) )->handle__Event = slot;
}
bool QGraphicsSvgItem_virtualbase_Event(void* self, QEvent* ev) {
return ( (MiqtVirtualQGraphicsSvgItem*)(self) )->virtualbase_Event(ev);
}
void QGraphicsSvgItem_Delete(QGraphicsSvgItem* self, bool isSubclass) {
if (isSubclass) {
delete dynamic_cast<MiqtVirtualQGraphicsSvgItem*>( self );
} else {
delete self;
}
}