miqt/qt/gen_qaccessiblewidget.cpp

131 lines
4.8 KiB
C++

#define WORKAROUND_INNER_CLASS_DEFINITION_QAccessible__State
#include <QAccessibleInterface>
#include <QAccessibleWidget>
#include <QColor>
#include <QList>
#include <QRect>
#include <QString>
#include <QByteArray>
#include <cstring>
#include <QWidget>
#include <QWindow>
#include "qaccessiblewidget.h"
#include "gen_qaccessiblewidget.h"
#include "_cgo_export.h"
QAccessibleWidget* QAccessibleWidget_new(QWidget* o) {
return new QAccessibleWidget(o);
}
QAccessibleWidget* QAccessibleWidget_new2(QWidget* o, uintptr_t r) {
return new QAccessibleWidget(o, static_cast<QAccessible::Role>(r));
}
QAccessibleWidget* QAccessibleWidget_new3(QWidget* o, uintptr_t r, struct miqt_string* name) {
QString name_QString = QString::fromUtf8(&name->data, name->len);
return new QAccessibleWidget(o, static_cast<QAccessible::Role>(r), name_QString);
}
bool QAccessibleWidget_IsValid(const QAccessibleWidget* self) {
return self->isValid();
}
QWindow* QAccessibleWidget_Window(const QAccessibleWidget* self) {
return self->window();
}
int QAccessibleWidget_ChildCount(const QAccessibleWidget* self) {
return self->childCount();
}
int QAccessibleWidget_IndexOfChild(const QAccessibleWidget* self, QAccessibleInterface* child) {
return self->indexOfChild(child);
}
QAccessibleInterface* QAccessibleWidget_FocusChild(const QAccessibleWidget* self) {
return self->focusChild();
}
QRect* QAccessibleWidget_Rect(const QAccessibleWidget* self) {
QRect _ret = self->rect();
// Copy-construct value returned type into heap-allocated copy
return static_cast<QRect*>(new QRect(_ret));
}
QAccessibleInterface* QAccessibleWidget_Parent(const QAccessibleWidget* self) {
return self->parent();
}
QAccessibleInterface* QAccessibleWidget_Child(const QAccessibleWidget* self, int index) {
return self->child(static_cast<int>(index));
}
struct miqt_string* QAccessibleWidget_Text(const QAccessibleWidget* self, uintptr_t t) {
QString _ret = self->text(static_cast<QAccessible::Text>(t));
// 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());
}
uintptr_t QAccessibleWidget_Role(const QAccessibleWidget* self) {
QAccessible::Role _ret = self->role();
return static_cast<uintptr_t>(_ret);
}
QAccessible__State* QAccessibleWidget_State(const QAccessibleWidget* self) {
QAccessible::State _ret = self->state();
// Copy-construct value returned type into heap-allocated copy
return static_cast<QAccessible::State*>(new QAccessible::State(_ret));
}
QColor* QAccessibleWidget_ForegroundColor(const QAccessibleWidget* self) {
QColor _ret = self->foregroundColor();
// Copy-construct value returned type into heap-allocated copy
return static_cast<QColor*>(new QColor(_ret));
}
QColor* QAccessibleWidget_BackgroundColor(const QAccessibleWidget* self) {
QColor _ret = self->backgroundColor();
// Copy-construct value returned type into heap-allocated copy
return static_cast<QColor*>(new QColor(_ret));
}
struct miqt_array* QAccessibleWidget_ActionNames(const QAccessibleWidget* self) {
QStringList _ret = self->actionNames();
// Convert QStringList from C++ memory to manually-managed C memory
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
QString _lv_ret = _ret[i];
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _lv_b = _lv_ret.toUtf8();
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
}
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 QAccessibleWidget_DoAction(QAccessibleWidget* self, struct miqt_string* actionName) {
QString actionName_QString = QString::fromUtf8(&actionName->data, actionName->len);
self->doAction(actionName_QString);
}
struct miqt_array* QAccessibleWidget_KeyBindingsForAction(const QAccessibleWidget* self, struct miqt_string* actionName) {
QString actionName_QString = QString::fromUtf8(&actionName->data, actionName->len);
QStringList _ret = self->keyBindingsForAction(actionName_QString);
// Convert QStringList from C++ memory to manually-managed C memory
struct miqt_string** _arr = static_cast<struct miqt_string**>(malloc(sizeof(struct miqt_string*) * _ret.length()));
for (size_t i = 0, e = _ret.length(); i < e; ++i) {
QString _lv_ret = _ret[i];
// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory
QByteArray _lv_b = _lv_ret.toUtf8();
_arr[i] = miqt_strdup(_lv_b.data(), _lv_b.length());
}
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;
}