morpheus

A Matrix client written in Go-QT
git clone git://archive.git.mtrnord.blog/Nordgedanken/morpheus.git
Log | Files | Refs | README | LICENSE

commit 66a42c9da25c2c844421a0b9e345b35ace8a7311
parent f0be186a82cb2154147cfd04d6ccaaa9c5e4e4f9
Author: MTRNord <mtrnord1@gmail.com>
Date:   Mon, 16 Oct 2017 22:51:03 +0200

Preapre Room List, fix #26, fix avatar radius and avatar generating, make message background a bot darker, move some functions in the MainUI to another Method to keep it clean, add one more linter

Signed-off-by: MTRNord <mtrnord1@gmail.com>

Diffstat:
Melements/messageList.go | 4+++-
Melements/moc.cpp | 319+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Melements/moc.go | 763+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Melements/moc.h | 54++++++++++++++++++++++++++++++++++++++++++++++++++++++
Melements/moc_moc.h | 92+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Melements/roomlist.go | 86++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------
Mlinter.json | 3++-
Mmatrix/user.go | 47++++++++++++++++++++++++++++++++---------------
Mqml/ui/message.ui | 58++++++++++++++--------------------------------------------
Mui/MainUI.go | 225+++++++++++++++++++++++++++++++++++++++++++------------------------------------
10 files changed, 1471 insertions(+), 180 deletions(-)

diff --git a/elements/messageList.go b/elements/messageList.go @@ -1,6 +1,7 @@ package elements import ( + "fmt" "github.com/Nordgedanken/Morpheus/matrix" "github.com/matrix-org/gomatrix" "github.com/rhinoman/go-commonmark" @@ -42,7 +43,7 @@ func NewMessageList(scrollArea *widgets.QScrollArea, messageView *widgets.QWidge // NewMessage adds a new message object to the view func (messageViewLayout *QVBoxLayoutWithTriggerSlot) NewMessage(body string, cli *gomatrix.Client, sender string, scrollArea *widgets.QScrollArea) (err error) { - avatar, AvatarErr := matrix.GetUserAvatar(cli, sender) + avatar, AvatarErr := matrix.GetUserAvatar(cli, sender, 61) if err != nil { err = AvatarErr return @@ -67,6 +68,7 @@ func (messageViewLayout *QVBoxLayoutWithTriggerSlot) NewMessage(body string, cli messageContent.SetText(markdownMessage) senderDisplayNameResp, _ := cli.GetDisplayName(sender) + fmt.Println(senderDisplayNameResp) senderDisplayName := senderDisplayNameResp.DisplayName senderContent.SetText(senderDisplayName) avatarLogo.SetPixmap(avatar) diff --git a/elements/moc.cpp b/elements/moc.cpp @@ -27,6 +27,55 @@ #include <QWidget> +class QRoomVBoxLayoutWithTriggerSlot: public QVBoxLayout +{ +Q_OBJECT +public: + QRoomVBoxLayoutWithTriggerSlot() : QVBoxLayout() {qRegisterMetaType<quintptr>("quintptr");QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType();QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaTypes();callbackQRoomVBoxLayoutWithTriggerSlot_Constructor(this);}; + QRoomVBoxLayoutWithTriggerSlot(QWidget *parent) : QVBoxLayout(parent) {qRegisterMetaType<quintptr>("quintptr");QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType();QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaTypes();callbackQRoomVBoxLayoutWithTriggerSlot_Constructor(this);}; + QLayoutItem * takeAt(int index) { return static_cast<QLayoutItem*>(callbackQRoomVBoxLayoutWithTriggerSlot_TakeAt(this, index)); }; + void addItem(QLayoutItem * item) { callbackQRoomVBoxLayoutWithTriggerSlot_AddItem(this, item); }; + void invalidate() { callbackQRoomVBoxLayoutWithTriggerSlot_Invalidate(this); }; + void setGeometry(const QRect & r) { callbackQRoomVBoxLayoutWithTriggerSlot_SetGeometry(this, const_cast<QRect*>(&r)); }; + QLayoutItem * itemAt(int index) const { return static_cast<QLayoutItem*>(callbackQRoomVBoxLayoutWithTriggerSlot_ItemAt(const_cast<void*>(static_cast<const void*>(this)), index)); }; + QSize maximumSize() const { return *static_cast<QSize*>(callbackQRoomVBoxLayoutWithTriggerSlot_MaximumSize(const_cast<void*>(static_cast<const void*>(this)))); }; + QSize minimumSize() const { return *static_cast<QSize*>(callbackQRoomVBoxLayoutWithTriggerSlot_MinimumSize(const_cast<void*>(static_cast<const void*>(this)))); }; + QSize sizeHint() const { return *static_cast<QSize*>(callbackQRoomVBoxLayoutWithTriggerSlot_SizeHint(const_cast<void*>(static_cast<const void*>(this)))); }; + Qt::Orientations expandingDirections() const { return static_cast<Qt::Orientation>(callbackQRoomVBoxLayoutWithTriggerSlot_ExpandingDirections(const_cast<void*>(static_cast<const void*>(this)))); }; + bool hasHeightForWidth() const { return callbackQRoomVBoxLayoutWithTriggerSlot_HasHeightForWidth(const_cast<void*>(static_cast<const void*>(this))) != 0; }; + int count() const { return callbackQRoomVBoxLayoutWithTriggerSlot_Count(const_cast<void*>(static_cast<const void*>(this))); }; + int heightForWidth(int w) const { return callbackQRoomVBoxLayoutWithTriggerSlot_HeightForWidth(const_cast<void*>(static_cast<const void*>(this)), w); }; + int minimumHeightForWidth(int w) const { return callbackQRoomVBoxLayoutWithTriggerSlot_MinimumHeightForWidth(const_cast<void*>(static_cast<const void*>(this)), w); }; + QLayout * layout() { return static_cast<QLayout*>(callbackQRoomVBoxLayoutWithTriggerSlot_Layout(this)); }; + void childEvent(QChildEvent * e) { callbackQRoomVBoxLayoutWithTriggerSlot_ChildEvent(this, e); }; + QRect geometry() const { return *static_cast<QRect*>(callbackQRoomVBoxLayoutWithTriggerSlot_Geometry(const_cast<void*>(static_cast<const void*>(this)))); }; + QSizePolicy::ControlTypes controlTypes() const { return static_cast<QSizePolicy::ControlType>(callbackQRoomVBoxLayoutWithTriggerSlot_ControlTypes(const_cast<void*>(static_cast<const void*>(this)))); }; + bool isEmpty() const { return callbackQRoomVBoxLayoutWithTriggerSlot_IsEmpty(const_cast<void*>(static_cast<const void*>(this))) != 0; }; + int indexOf(QWidget * widget) const { return callbackQRoomVBoxLayoutWithTriggerSlot_IndexOf(const_cast<void*>(static_cast<const void*>(this)), widget); }; + bool event(QEvent * e) { return callbackQRoomVBoxLayoutWithTriggerSlot_Event(this, e) != 0; }; + bool eventFilter(QObject * watched, QEvent * event) { return callbackQRoomVBoxLayoutWithTriggerSlot_EventFilter(this, watched, event) != 0; }; + void connectNotify(const QMetaMethod & sign) { callbackQRoomVBoxLayoutWithTriggerSlot_ConnectNotify(this, const_cast<QMetaMethod*>(&sign)); }; + void customEvent(QEvent * event) { callbackQRoomVBoxLayoutWithTriggerSlot_CustomEvent(this, event); }; + void deleteLater() { callbackQRoomVBoxLayoutWithTriggerSlot_DeleteLater(this); }; + void Signal_Destroyed(QObject * obj) { callbackQRoomVBoxLayoutWithTriggerSlot_Destroyed(this, obj); }; + void disconnectNotify(const QMetaMethod & sign) { callbackQRoomVBoxLayoutWithTriggerSlot_DisconnectNotify(this, const_cast<QMetaMethod*>(&sign)); }; + void Signal_ObjectNameChanged(const QString & objectName) { QByteArray taa2c4f = objectName.toUtf8(); Moc_PackedString objectNamePacked = { const_cast<char*>(taa2c4f.prepend("WHITESPACE").constData()+10), taa2c4f.size()-10 };callbackQRoomVBoxLayoutWithTriggerSlot_ObjectNameChanged(this, objectNamePacked); }; + void timerEvent(QTimerEvent * event) { callbackQRoomVBoxLayoutWithTriggerSlot_TimerEvent(this, event); }; + + QSpacerItem * spacerItem() { return static_cast<QSpacerItem*>(callbackQRoomVBoxLayoutWithTriggerSlot_SpacerItem(this)); }; + QWidget * widget() { return static_cast<QWidget*>(callbackQRoomVBoxLayoutWithTriggerSlot_Widget(this)); }; +signals: +public slots: + void TriggerMessage(QString messageBody, QString sender) { QByteArray t59bf16 = messageBody.toUtf8(); Moc_PackedString messageBodyPacked = { const_cast<char*>(t59bf16.prepend("WHITESPACE").constData()+10), t59bf16.size()-10 };QByteArray tacc6a3 = sender.toUtf8(); Moc_PackedString senderPacked = { const_cast<char*>(tacc6a3.prepend("WHITESPACE").constData()+10), tacc6a3.size()-10 };callbackQRoomVBoxLayoutWithTriggerSlot_TriggerMessage(this, messageBodyPacked, senderPacked); }; +private: +}; + +Q_DECLARE_METATYPE(QRoomVBoxLayoutWithTriggerSlot*) + + +void QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaTypes() { +} + class QVBoxLayoutWithTriggerSlot: public QVBoxLayout { Q_OBJECT @@ -76,6 +125,276 @@ Q_DECLARE_METATYPE(QVBoxLayoutWithTriggerSlot*) void QVBoxLayoutWithTriggerSlot_QVBoxLayoutWithTriggerSlot_QRegisterMetaTypes() { } +void QRoomVBoxLayoutWithTriggerSlot_TriggerMessage(void* ptr, struct Moc_PackedString messageBody, struct Moc_PackedString sender) +{ + QMetaObject::invokeMethod(static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr), "TriggerMessage", Q_ARG(QString, QString::fromUtf8(messageBody.data, messageBody.len)), Q_ARG(QString, QString::fromUtf8(sender.data, sender.len))); +} + +int QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType() +{ + return qRegisterMetaType<QRoomVBoxLayoutWithTriggerSlot*>(); +} + +int QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType2(char* typeName) +{ + return qRegisterMetaType<QRoomVBoxLayoutWithTriggerSlot*>(const_cast<const char*>(typeName)); +} + +int QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QmlRegisterType() +{ +#ifdef QT_QML_LIB + return qmlRegisterType<QRoomVBoxLayoutWithTriggerSlot>(); +#else + return 0; +#endif +} + +int QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QmlRegisterType2(char* uri, int versionMajor, int versionMinor, char* qmlName) +{ +#ifdef QT_QML_LIB + return qmlRegisterType<QRoomVBoxLayoutWithTriggerSlot>(const_cast<const char*>(uri), versionMajor, versionMinor, const_cast<const char*>(qmlName)); +#else + return 0; +#endif +} + +void* QRoomVBoxLayoutWithTriggerSlot___dynamicPropertyNames_atList(void* ptr, int i) +{ + return new QByteArray(static_cast<QList<QByteArray>*>(ptr)->at(i)); +} + +void QRoomVBoxLayoutWithTriggerSlot___dynamicPropertyNames_setList(void* ptr, void* i) +{ + static_cast<QList<QByteArray>*>(ptr)->append(*static_cast<QByteArray*>(i)); +} + +void* QRoomVBoxLayoutWithTriggerSlot___dynamicPropertyNames_newList(void* ptr) +{ + Q_UNUSED(ptr); + return new QList<QByteArray>; +} + +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_atList2(void* ptr, int i) +{ + return const_cast<QObject*>(static_cast<QList<QObject*>*>(ptr)->at(i)); +} + +void QRoomVBoxLayoutWithTriggerSlot___findChildren_setList2(void* ptr, void* i) +{ + static_cast<QList<QObject*>*>(ptr)->append(static_cast<QObject*>(i)); +} + +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_newList2(void* ptr) +{ + Q_UNUSED(ptr); + return new QList<QObject*>; +} + +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_atList3(void* ptr, int i) +{ + return const_cast<QObject*>(static_cast<QList<QObject*>*>(ptr)->at(i)); +} + +void QRoomVBoxLayoutWithTriggerSlot___findChildren_setList3(void* ptr, void* i) +{ + static_cast<QList<QObject*>*>(ptr)->append(static_cast<QObject*>(i)); +} + +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_newList3(void* ptr) +{ + Q_UNUSED(ptr); + return new QList<QObject*>; +} + +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_atList(void* ptr, int i) +{ + return const_cast<QObject*>(static_cast<QList<QObject*>*>(ptr)->at(i)); +} + +void QRoomVBoxLayoutWithTriggerSlot___findChildren_setList(void* ptr, void* i) +{ + static_cast<QList<QObject*>*>(ptr)->append(static_cast<QObject*>(i)); +} + +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_newList(void* ptr) +{ + Q_UNUSED(ptr); + return new QList<QObject*>; +} + +void* QRoomVBoxLayoutWithTriggerSlot___children_atList(void* ptr, int i) +{ + return const_cast<QObject*>(static_cast<QList<QObject *>*>(ptr)->at(i)); +} + +void QRoomVBoxLayoutWithTriggerSlot___children_setList(void* ptr, void* i) +{ + static_cast<QList<QObject *>*>(ptr)->append(static_cast<QObject*>(i)); +} + +void* QRoomVBoxLayoutWithTriggerSlot___children_newList(void* ptr) +{ + Q_UNUSED(ptr); + return new QList<QObject *>; +} + +void* QRoomVBoxLayoutWithTriggerSlot_NewQRoomVBoxLayoutWithTriggerSlot() +{ + return new QRoomVBoxLayoutWithTriggerSlot(); +} + +void* QRoomVBoxLayoutWithTriggerSlot_NewQRoomVBoxLayoutWithTriggerSlot2(void* parent) +{ + return new QRoomVBoxLayoutWithTriggerSlot(static_cast<QWidget*>(parent)); +} + +void QRoomVBoxLayoutWithTriggerSlot_DestroyQRoomVBoxLayoutWithTriggerSlot(void* ptr) +{ + static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->~QRoomVBoxLayoutWithTriggerSlot(); +} + +void* QRoomVBoxLayoutWithTriggerSlot_TakeAtDefault(void* ptr, int index) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::takeAt(index); +} + +void QRoomVBoxLayoutWithTriggerSlot_AddItemDefault(void* ptr, void* item) +{ + static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::addItem(static_cast<QLayoutItem*>(item)); +} + +void QRoomVBoxLayoutWithTriggerSlot_InvalidateDefault(void* ptr) +{ + static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::invalidate(); +} + +void QRoomVBoxLayoutWithTriggerSlot_SetGeometryDefault(void* ptr, void* r) +{ + static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::setGeometry(*static_cast<QRect*>(r)); +} + +void* QRoomVBoxLayoutWithTriggerSlot_ItemAtDefault(void* ptr, int index) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::itemAt(index); +} + +void* QRoomVBoxLayoutWithTriggerSlot_MaximumSizeDefault(void* ptr) +{ + return ({ QSize tmpValue = static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::maximumSize(); new QSize(tmpValue.width(), tmpValue.height()); }); +} + +void* QRoomVBoxLayoutWithTriggerSlot_MinimumSizeDefault(void* ptr) +{ + return ({ QSize tmpValue = static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::minimumSize(); new QSize(tmpValue.width(), tmpValue.height()); }); +} + +void* QRoomVBoxLayoutWithTriggerSlot_SizeHintDefault(void* ptr) +{ + return ({ QSize tmpValue = static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::sizeHint(); new QSize(tmpValue.width(), tmpValue.height()); }); +} + +long long QRoomVBoxLayoutWithTriggerSlot_ExpandingDirectionsDefault(void* ptr) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::expandingDirections(); +} + +char QRoomVBoxLayoutWithTriggerSlot_HasHeightForWidthDefault(void* ptr) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::hasHeightForWidth(); +} + +int QRoomVBoxLayoutWithTriggerSlot_CountDefault(void* ptr) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::count(); +} + +int QRoomVBoxLayoutWithTriggerSlot_HeightForWidthDefault(void* ptr, int w) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::heightForWidth(w); +} + +int QRoomVBoxLayoutWithTriggerSlot_MinimumHeightForWidthDefault(void* ptr, int w) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::minimumHeightForWidth(w); +} + +void* QRoomVBoxLayoutWithTriggerSlot_LayoutDefault(void* ptr) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::layout(); +} + +void QRoomVBoxLayoutWithTriggerSlot_ChildEventDefault(void* ptr, void* e) +{ + static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::childEvent(static_cast<QChildEvent*>(e)); +} + +void* QRoomVBoxLayoutWithTriggerSlot_GeometryDefault(void* ptr) +{ + return ({ QRect tmpValue = static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::geometry(); new QRect(tmpValue.x(), tmpValue.y(), tmpValue.width(), tmpValue.height()); }); +} + +long long QRoomVBoxLayoutWithTriggerSlot_ControlTypesDefault(void* ptr) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::controlTypes(); +} + +char QRoomVBoxLayoutWithTriggerSlot_IsEmptyDefault(void* ptr) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::isEmpty(); +} + +int QRoomVBoxLayoutWithTriggerSlot_IndexOfDefault(void* ptr, void* widget) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::indexOf(static_cast<QWidget*>(widget)); +} + +char QRoomVBoxLayoutWithTriggerSlot_EventDefault(void* ptr, void* e) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::event(static_cast<QEvent*>(e)); +} + +char QRoomVBoxLayoutWithTriggerSlot_EventFilterDefault(void* ptr, void* watched, void* event) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::eventFilter(static_cast<QObject*>(watched), static_cast<QEvent*>(event)); +} + +void QRoomVBoxLayoutWithTriggerSlot_ConnectNotifyDefault(void* ptr, void* sign) +{ + static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::connectNotify(*static_cast<QMetaMethod*>(sign)); +} + +void QRoomVBoxLayoutWithTriggerSlot_CustomEventDefault(void* ptr, void* event) +{ + static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::customEvent(static_cast<QEvent*>(event)); +} + +void QRoomVBoxLayoutWithTriggerSlot_DeleteLaterDefault(void* ptr) +{ + static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::deleteLater(); +} + +void QRoomVBoxLayoutWithTriggerSlot_DisconnectNotifyDefault(void* ptr, void* sign) +{ + static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::disconnectNotify(*static_cast<QMetaMethod*>(sign)); +} + +void QRoomVBoxLayoutWithTriggerSlot_TimerEventDefault(void* ptr, void* event) +{ + static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::timerEvent(static_cast<QTimerEvent*>(event)); +} + + + +void* QRoomVBoxLayoutWithTriggerSlot_SpacerItemDefault(void* ptr) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::spacerItem(); +} + +void* QRoomVBoxLayoutWithTriggerSlot_WidgetDefault(void* ptr) +{ + return static_cast<QRoomVBoxLayoutWithTriggerSlot*>(ptr)->QVBoxLayout::widget(); +} + void QVBoxLayoutWithTriggerSlot_TriggerMessage(void* ptr, struct Moc_PackedString messageBody, struct Moc_PackedString sender) { QMetaObject::invokeMethod(static_cast<QVBoxLayoutWithTriggerSlot*>(ptr), "TriggerMessage", Q_ARG(QString, QString::fromUtf8(messageBody.data, messageBody.len)), Q_ARG(QString, QString::fromUtf8(sender.data, sender.len))); diff --git a/elements/moc.go b/elements/moc.go @@ -21,6 +21,769 @@ func cGoUnpackString(s C.struct_Moc_PackedString) string { return C.GoStringN(s.data, C.int(s.len)) } +type QRoomVBoxLayoutWithTriggerSlot_ITF interface { + std_widgets.QVBoxLayout_ITF + QRoomVBoxLayoutWithTriggerSlot_PTR() *QRoomVBoxLayoutWithTriggerSlot +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) QRoomVBoxLayoutWithTriggerSlot_PTR() *QRoomVBoxLayoutWithTriggerSlot { + return ptr +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) Pointer() unsafe.Pointer { + if ptr != nil { + return ptr.QVBoxLayout_PTR().Pointer() + } + return nil +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) SetPointer(p unsafe.Pointer) { + if ptr != nil { + ptr.QVBoxLayout_PTR().SetPointer(p) + } +} + +func PointerFromQRoomVBoxLayoutWithTriggerSlot(ptr QRoomVBoxLayoutWithTriggerSlot_ITF) unsafe.Pointer { + if ptr != nil { + return ptr.QRoomVBoxLayoutWithTriggerSlot_PTR().Pointer() + } + return nil +} + +func NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr unsafe.Pointer) *QRoomVBoxLayoutWithTriggerSlot { + var n *QRoomVBoxLayoutWithTriggerSlot + if gPtr, ok := qt.Receive(ptr); !ok { + n = new(QRoomVBoxLayoutWithTriggerSlot) + n.SetPointer(ptr) + } else { + switch deduced := gPtr.(type) { + case *QRoomVBoxLayoutWithTriggerSlot: + n = deduced + + case *std_widgets.QVBoxLayout: + n = &QRoomVBoxLayoutWithTriggerSlot{QVBoxLayout: *deduced} + + default: + n = new(QRoomVBoxLayoutWithTriggerSlot) + n.SetPointer(ptr) + } + } + return n +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_Constructor +func callbackQRoomVBoxLayoutWithTriggerSlot_Constructor(ptr unsafe.Pointer) { + gPtr := NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr) + qt.Register(ptr, gPtr) +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_TriggerMessage +func callbackQRoomVBoxLayoutWithTriggerSlot_TriggerMessage(ptr unsafe.Pointer, messageBody C.struct_Moc_PackedString, sender C.struct_Moc_PackedString) { + if signal := qt.GetSignal(ptr, "TriggerMessage"); signal != nil { + signal.(func(string, string))(cGoUnpackString(messageBody), cGoUnpackString(sender)) + } + +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) ConnectTriggerMessage(f func(messageBody string, sender string)) { + if ptr.Pointer() != nil { + + if signal := qt.LendSignal(ptr.Pointer(), "TriggerMessage"); signal != nil { + qt.ConnectSignal(ptr.Pointer(), "TriggerMessage", func(messageBody string, sender string) { + signal.(func(string, string))(messageBody, sender) + f(messageBody, sender) + }) + } else { + qt.ConnectSignal(ptr.Pointer(), "TriggerMessage", f) + } + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) DisconnectTriggerMessage() { + if ptr.Pointer() != nil { + + qt.DisconnectSignal(ptr.Pointer(), "TriggerMessage") + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) TriggerMessage(messageBody string, sender string) { + if ptr.Pointer() != nil { + var messageBodyC *C.char + if messageBody != "" { + messageBodyC = C.CString(messageBody) + defer C.free(unsafe.Pointer(messageBodyC)) + } + var senderC *C.char + if sender != "" { + senderC = C.CString(sender) + defer C.free(unsafe.Pointer(senderC)) + } + C.QRoomVBoxLayoutWithTriggerSlot_TriggerMessage(ptr.Pointer(), C.struct_Moc_PackedString{data: messageBodyC, len: C.longlong(len(messageBody))}, C.struct_Moc_PackedString{data: senderC, len: C.longlong(len(sender))}) + } +} + +func QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType() int { + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType())) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) QRegisterMetaType() int { + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType())) +} + +func QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType2(typeName string) int { + var typeNameC *C.char + if typeName != "" { + typeNameC = C.CString(typeName) + defer C.free(unsafe.Pointer(typeNameC)) + } + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType2(typeNameC))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) QRegisterMetaType2(typeName string) int { + var typeNameC *C.char + if typeName != "" { + typeNameC = C.CString(typeName) + defer C.free(unsafe.Pointer(typeNameC)) + } + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType2(typeNameC))) +} + +func QRoomVBoxLayoutWithTriggerSlot_QmlRegisterType() int { + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QmlRegisterType())) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) QmlRegisterType() int { + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QmlRegisterType())) +} + +func QRoomVBoxLayoutWithTriggerSlot_QmlRegisterType2(uri string, versionMajor int, versionMinor int, qmlName string) int { + var uriC *C.char + if uri != "" { + uriC = C.CString(uri) + defer C.free(unsafe.Pointer(uriC)) + } + var qmlNameC *C.char + if qmlName != "" { + qmlNameC = C.CString(qmlName) + defer C.free(unsafe.Pointer(qmlNameC)) + } + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QmlRegisterType2(uriC, C.int(int32(versionMajor)), C.int(int32(versionMinor)), qmlNameC))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) QmlRegisterType2(uri string, versionMajor int, versionMinor int, qmlName string) int { + var uriC *C.char + if uri != "" { + uriC = C.CString(uri) + defer C.free(unsafe.Pointer(uriC)) + } + var qmlNameC *C.char + if qmlName != "" { + qmlNameC = C.CString(qmlName) + defer C.free(unsafe.Pointer(qmlNameC)) + } + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QmlRegisterType2(uriC, C.int(int32(versionMajor)), C.int(int32(versionMinor)), qmlNameC))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __dynamicPropertyNames_atList(i int) *std_core.QByteArray { + if ptr.Pointer() != nil { + var tmpValue = std_core.NewQByteArrayFromPointer(C.QRoomVBoxLayoutWithTriggerSlot___dynamicPropertyNames_atList(ptr.Pointer(), C.int(int32(i)))) + runtime.SetFinalizer(tmpValue, (*std_core.QByteArray).DestroyQByteArray) + return tmpValue + } + return nil +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __dynamicPropertyNames_setList(i std_core.QByteArray_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot___dynamicPropertyNames_setList(ptr.Pointer(), std_core.PointerFromQByteArray(i)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __dynamicPropertyNames_newList() unsafe.Pointer { + return unsafe.Pointer(C.QRoomVBoxLayoutWithTriggerSlot___dynamicPropertyNames_newList(ptr.Pointer())) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __findChildren_atList2(i int) *std_core.QObject { + if ptr.Pointer() != nil { + var tmpValue = std_core.NewQObjectFromPointer(C.QRoomVBoxLayoutWithTriggerSlot___findChildren_atList2(ptr.Pointer(), C.int(int32(i)))) + if !qt.ExistsSignal(tmpValue.Pointer(), "destroyed") { + tmpValue.ConnectDestroyed(func(*std_core.QObject) { tmpValue.SetPointer(nil) }) + } + return tmpValue + } + return nil +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __findChildren_setList2(i std_core.QObject_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot___findChildren_setList2(ptr.Pointer(), std_core.PointerFromQObject(i)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __findChildren_newList2() unsafe.Pointer { + return unsafe.Pointer(C.QRoomVBoxLayoutWithTriggerSlot___findChildren_newList2(ptr.Pointer())) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __findChildren_atList3(i int) *std_core.QObject { + if ptr.Pointer() != nil { + var tmpValue = std_core.NewQObjectFromPointer(C.QRoomVBoxLayoutWithTriggerSlot___findChildren_atList3(ptr.Pointer(), C.int(int32(i)))) + if !qt.ExistsSignal(tmpValue.Pointer(), "destroyed") { + tmpValue.ConnectDestroyed(func(*std_core.QObject) { tmpValue.SetPointer(nil) }) + } + return tmpValue + } + return nil +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __findChildren_setList3(i std_core.QObject_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot___findChildren_setList3(ptr.Pointer(), std_core.PointerFromQObject(i)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __findChildren_newList3() unsafe.Pointer { + return unsafe.Pointer(C.QRoomVBoxLayoutWithTriggerSlot___findChildren_newList3(ptr.Pointer())) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __findChildren_atList(i int) *std_core.QObject { + if ptr.Pointer() != nil { + var tmpValue = std_core.NewQObjectFromPointer(C.QRoomVBoxLayoutWithTriggerSlot___findChildren_atList(ptr.Pointer(), C.int(int32(i)))) + if !qt.ExistsSignal(tmpValue.Pointer(), "destroyed") { + tmpValue.ConnectDestroyed(func(*std_core.QObject) { tmpValue.SetPointer(nil) }) + } + return tmpValue + } + return nil +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __findChildren_setList(i std_core.QObject_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot___findChildren_setList(ptr.Pointer(), std_core.PointerFromQObject(i)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __findChildren_newList() unsafe.Pointer { + return unsafe.Pointer(C.QRoomVBoxLayoutWithTriggerSlot___findChildren_newList(ptr.Pointer())) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __children_atList(i int) *std_core.QObject { + if ptr.Pointer() != nil { + var tmpValue = std_core.NewQObjectFromPointer(C.QRoomVBoxLayoutWithTriggerSlot___children_atList(ptr.Pointer(), C.int(int32(i)))) + if !qt.ExistsSignal(tmpValue.Pointer(), "destroyed") { + tmpValue.ConnectDestroyed(func(*std_core.QObject) { tmpValue.SetPointer(nil) }) + } + return tmpValue + } + return nil +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __children_setList(i std_core.QObject_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot___children_setList(ptr.Pointer(), std_core.PointerFromQObject(i)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) __children_newList() unsafe.Pointer { + return unsafe.Pointer(C.QRoomVBoxLayoutWithTriggerSlot___children_newList(ptr.Pointer())) +} + +func NewQRoomVBoxLayoutWithTriggerSlot() *QRoomVBoxLayoutWithTriggerSlot { + var tmpValue = NewQRoomVBoxLayoutWithTriggerSlotFromPointer(C.QRoomVBoxLayoutWithTriggerSlot_NewQRoomVBoxLayoutWithTriggerSlot()) + if !qt.ExistsSignal(tmpValue.Pointer(), "destroyed") { + tmpValue.ConnectDestroyed(func(*std_core.QObject) { tmpValue.SetPointer(nil) }) + } + return tmpValue +} + +func NewQRoomVBoxLayoutWithTriggerSlot2(parent std_widgets.QWidget_ITF) *QRoomVBoxLayoutWithTriggerSlot { + var tmpValue = NewQRoomVBoxLayoutWithTriggerSlotFromPointer(C.QRoomVBoxLayoutWithTriggerSlot_NewQRoomVBoxLayoutWithTriggerSlot2(std_widgets.PointerFromQWidget(parent))) + if !qt.ExistsSignal(tmpValue.Pointer(), "destroyed") { + tmpValue.ConnectDestroyed(func(*std_core.QObject) { tmpValue.SetPointer(nil) }) + } + return tmpValue +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) DestroyQRoomVBoxLayoutWithTriggerSlot() { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot_DestroyQRoomVBoxLayoutWithTriggerSlot(ptr.Pointer()) + ptr.SetPointer(nil) + runtime.SetFinalizer(ptr, nil) + } +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_TakeAt +func callbackQRoomVBoxLayoutWithTriggerSlot_TakeAt(ptr unsafe.Pointer, index C.int) unsafe.Pointer { + if signal := qt.GetSignal(ptr, "takeAt"); signal != nil { + return std_widgets.PointerFromQLayoutItem(signal.(func(int) *std_widgets.QLayoutItem)(int(int32(index)))) + } + + return std_widgets.PointerFromQLayoutItem(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).TakeAtDefault(int(int32(index)))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) TakeAtDefault(index int) *std_widgets.QLayoutItem { + if ptr.Pointer() != nil { + return std_widgets.NewQLayoutItemFromPointer(C.QRoomVBoxLayoutWithTriggerSlot_TakeAtDefault(ptr.Pointer(), C.int(int32(index)))) + } + return nil +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_AddItem +func callbackQRoomVBoxLayoutWithTriggerSlot_AddItem(ptr unsafe.Pointer, item unsafe.Pointer) { + if signal := qt.GetSignal(ptr, "addItem"); signal != nil { + signal.(func(*std_widgets.QLayoutItem))(std_widgets.NewQLayoutItemFromPointer(item)) + } else { + NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).AddItemDefault(std_widgets.NewQLayoutItemFromPointer(item)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) AddItemDefault(item std_widgets.QLayoutItem_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot_AddItemDefault(ptr.Pointer(), std_widgets.PointerFromQLayoutItem(item)) + } +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_Invalidate +func callbackQRoomVBoxLayoutWithTriggerSlot_Invalidate(ptr unsafe.Pointer) { + if signal := qt.GetSignal(ptr, "invalidate"); signal != nil { + signal.(func())() + } else { + NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).InvalidateDefault() + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) InvalidateDefault() { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot_InvalidateDefault(ptr.Pointer()) + } +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_SetGeometry +func callbackQRoomVBoxLayoutWithTriggerSlot_SetGeometry(ptr unsafe.Pointer, r unsafe.Pointer) { + if signal := qt.GetSignal(ptr, "setGeometry"); signal != nil { + signal.(func(*std_core.QRect))(std_core.NewQRectFromPointer(r)) + } else { + NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).SetGeometryDefault(std_core.NewQRectFromPointer(r)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) SetGeometryDefault(r std_core.QRect_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot_SetGeometryDefault(ptr.Pointer(), std_core.PointerFromQRect(r)) + } +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_ItemAt +func callbackQRoomVBoxLayoutWithTriggerSlot_ItemAt(ptr unsafe.Pointer, index C.int) unsafe.Pointer { + if signal := qt.GetSignal(ptr, "itemAt"); signal != nil { + return std_widgets.PointerFromQLayoutItem(signal.(func(int) *std_widgets.QLayoutItem)(int(int32(index)))) + } + + return std_widgets.PointerFromQLayoutItem(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).ItemAtDefault(int(int32(index)))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) ItemAtDefault(index int) *std_widgets.QLayoutItem { + if ptr.Pointer() != nil { + return std_widgets.NewQLayoutItemFromPointer(C.QRoomVBoxLayoutWithTriggerSlot_ItemAtDefault(ptr.Pointer(), C.int(int32(index)))) + } + return nil +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_MaximumSize +func callbackQRoomVBoxLayoutWithTriggerSlot_MaximumSize(ptr unsafe.Pointer) unsafe.Pointer { + if signal := qt.GetSignal(ptr, "maximumSize"); signal != nil { + return std_core.PointerFromQSize(signal.(func() *std_core.QSize)()) + } + + return std_core.PointerFromQSize(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).MaximumSizeDefault()) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) MaximumSizeDefault() *std_core.QSize { + if ptr.Pointer() != nil { + var tmpValue = std_core.NewQSizeFromPointer(C.QRoomVBoxLayoutWithTriggerSlot_MaximumSizeDefault(ptr.Pointer())) + runtime.SetFinalizer(tmpValue, (*std_core.QSize).DestroyQSize) + return tmpValue + } + return nil +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_MinimumSize +func callbackQRoomVBoxLayoutWithTriggerSlot_MinimumSize(ptr unsafe.Pointer) unsafe.Pointer { + if signal := qt.GetSignal(ptr, "minimumSize"); signal != nil { + return std_core.PointerFromQSize(signal.(func() *std_core.QSize)()) + } + + return std_core.PointerFromQSize(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).MinimumSizeDefault()) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) MinimumSizeDefault() *std_core.QSize { + if ptr.Pointer() != nil { + var tmpValue = std_core.NewQSizeFromPointer(C.QRoomVBoxLayoutWithTriggerSlot_MinimumSizeDefault(ptr.Pointer())) + runtime.SetFinalizer(tmpValue, (*std_core.QSize).DestroyQSize) + return tmpValue + } + return nil +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_SizeHint +func callbackQRoomVBoxLayoutWithTriggerSlot_SizeHint(ptr unsafe.Pointer) unsafe.Pointer { + if signal := qt.GetSignal(ptr, "sizeHint"); signal != nil { + return std_core.PointerFromQSize(signal.(func() *std_core.QSize)()) + } + + return std_core.PointerFromQSize(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).SizeHintDefault()) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) SizeHintDefault() *std_core.QSize { + if ptr.Pointer() != nil { + var tmpValue = std_core.NewQSizeFromPointer(C.QRoomVBoxLayoutWithTriggerSlot_SizeHintDefault(ptr.Pointer())) + runtime.SetFinalizer(tmpValue, (*std_core.QSize).DestroyQSize) + return tmpValue + } + return nil +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_ExpandingDirections +func callbackQRoomVBoxLayoutWithTriggerSlot_ExpandingDirections(ptr unsafe.Pointer) C.longlong { + if signal := qt.GetSignal(ptr, "expandingDirections"); signal != nil { + return C.longlong(signal.(func() std_core.Qt__Orientation)()) + } + + return C.longlong(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).ExpandingDirectionsDefault()) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) ExpandingDirectionsDefault() std_core.Qt__Orientation { + if ptr.Pointer() != nil { + return std_core.Qt__Orientation(C.QRoomVBoxLayoutWithTriggerSlot_ExpandingDirectionsDefault(ptr.Pointer())) + } + return 0 +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_HasHeightForWidth +func callbackQRoomVBoxLayoutWithTriggerSlot_HasHeightForWidth(ptr unsafe.Pointer) C.char { + if signal := qt.GetSignal(ptr, "hasHeightForWidth"); signal != nil { + return C.char(int8(qt.GoBoolToInt(signal.(func() bool)()))) + } + + return C.char(int8(qt.GoBoolToInt(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).HasHeightForWidthDefault()))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) HasHeightForWidthDefault() bool { + if ptr.Pointer() != nil { + return C.QRoomVBoxLayoutWithTriggerSlot_HasHeightForWidthDefault(ptr.Pointer()) != 0 + } + return false +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_Count +func callbackQRoomVBoxLayoutWithTriggerSlot_Count(ptr unsafe.Pointer) C.int { + if signal := qt.GetSignal(ptr, "count"); signal != nil { + return C.int(int32(signal.(func() int)())) + } + + return C.int(int32(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).CountDefault())) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) CountDefault() int { + if ptr.Pointer() != nil { + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_CountDefault(ptr.Pointer()))) + } + return 0 +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_HeightForWidth +func callbackQRoomVBoxLayoutWithTriggerSlot_HeightForWidth(ptr unsafe.Pointer, w C.int) C.int { + if signal := qt.GetSignal(ptr, "heightForWidth"); signal != nil { + return C.int(int32(signal.(func(int) int)(int(int32(w))))) + } + + return C.int(int32(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).HeightForWidthDefault(int(int32(w))))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) HeightForWidthDefault(w int) int { + if ptr.Pointer() != nil { + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_HeightForWidthDefault(ptr.Pointer(), C.int(int32(w))))) + } + return 0 +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_MinimumHeightForWidth +func callbackQRoomVBoxLayoutWithTriggerSlot_MinimumHeightForWidth(ptr unsafe.Pointer, w C.int) C.int { + if signal := qt.GetSignal(ptr, "minimumHeightForWidth"); signal != nil { + return C.int(int32(signal.(func(int) int)(int(int32(w))))) + } + + return C.int(int32(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).MinimumHeightForWidthDefault(int(int32(w))))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) MinimumHeightForWidthDefault(w int) int { + if ptr.Pointer() != nil { + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_MinimumHeightForWidthDefault(ptr.Pointer(), C.int(int32(w))))) + } + return 0 +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_Layout +func callbackQRoomVBoxLayoutWithTriggerSlot_Layout(ptr unsafe.Pointer) unsafe.Pointer { + if signal := qt.GetSignal(ptr, "layout"); signal != nil { + return std_widgets.PointerFromQLayout(signal.(func() *std_widgets.QLayout)()) + } + + return std_widgets.PointerFromQLayout(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).LayoutDefault()) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) LayoutDefault() *std_widgets.QLayout { + if ptr.Pointer() != nil { + var tmpValue = std_widgets.NewQLayoutFromPointer(C.QRoomVBoxLayoutWithTriggerSlot_LayoutDefault(ptr.Pointer())) + if !qt.ExistsSignal(tmpValue.Pointer(), "destroyed") { + tmpValue.ConnectDestroyed(func(*std_core.QObject) { tmpValue.SetPointer(nil) }) + } + return tmpValue + } + return nil +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_ChildEvent +func callbackQRoomVBoxLayoutWithTriggerSlot_ChildEvent(ptr unsafe.Pointer, e unsafe.Pointer) { + if signal := qt.GetSignal(ptr, "childEvent"); signal != nil { + signal.(func(*std_core.QChildEvent))(std_core.NewQChildEventFromPointer(e)) + } else { + NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).ChildEventDefault(std_core.NewQChildEventFromPointer(e)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) ChildEventDefault(e std_core.QChildEvent_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot_ChildEventDefault(ptr.Pointer(), std_core.PointerFromQChildEvent(e)) + } +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_Geometry +func callbackQRoomVBoxLayoutWithTriggerSlot_Geometry(ptr unsafe.Pointer) unsafe.Pointer { + if signal := qt.GetSignal(ptr, "geometry"); signal != nil { + return std_core.PointerFromQRect(signal.(func() *std_core.QRect)()) + } + + return std_core.PointerFromQRect(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).GeometryDefault()) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) GeometryDefault() *std_core.QRect { + if ptr.Pointer() != nil { + var tmpValue = std_core.NewQRectFromPointer(C.QRoomVBoxLayoutWithTriggerSlot_GeometryDefault(ptr.Pointer())) + runtime.SetFinalizer(tmpValue, (*std_core.QRect).DestroyQRect) + return tmpValue + } + return nil +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_ControlTypes +func callbackQRoomVBoxLayoutWithTriggerSlot_ControlTypes(ptr unsafe.Pointer) C.longlong { + if signal := qt.GetSignal(ptr, "controlTypes"); signal != nil { + return C.longlong(signal.(func() std_widgets.QSizePolicy__ControlType)()) + } + + return C.longlong(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).ControlTypesDefault()) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) ControlTypesDefault() std_widgets.QSizePolicy__ControlType { + if ptr.Pointer() != nil { + return std_widgets.QSizePolicy__ControlType(C.QRoomVBoxLayoutWithTriggerSlot_ControlTypesDefault(ptr.Pointer())) + } + return 0 +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_IsEmpty +func callbackQRoomVBoxLayoutWithTriggerSlot_IsEmpty(ptr unsafe.Pointer) C.char { + if signal := qt.GetSignal(ptr, "isEmpty"); signal != nil { + return C.char(int8(qt.GoBoolToInt(signal.(func() bool)()))) + } + + return C.char(int8(qt.GoBoolToInt(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).IsEmptyDefault()))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) IsEmptyDefault() bool { + if ptr.Pointer() != nil { + return C.QRoomVBoxLayoutWithTriggerSlot_IsEmptyDefault(ptr.Pointer()) != 0 + } + return false +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_IndexOf +func callbackQRoomVBoxLayoutWithTriggerSlot_IndexOf(ptr unsafe.Pointer, widget unsafe.Pointer) C.int { + if signal := qt.GetSignal(ptr, "indexOf"); signal != nil { + return C.int(int32(signal.(func(*std_widgets.QWidget) int)(std_widgets.NewQWidgetFromPointer(widget)))) + } + + return C.int(int32(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).IndexOfDefault(std_widgets.NewQWidgetFromPointer(widget)))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) IndexOfDefault(widget std_widgets.QWidget_ITF) int { + if ptr.Pointer() != nil { + return int(int32(C.QRoomVBoxLayoutWithTriggerSlot_IndexOfDefault(ptr.Pointer(), std_widgets.PointerFromQWidget(widget)))) + } + return 0 +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_Event +func callbackQRoomVBoxLayoutWithTriggerSlot_Event(ptr unsafe.Pointer, e unsafe.Pointer) C.char { + if signal := qt.GetSignal(ptr, "event"); signal != nil { + return C.char(int8(qt.GoBoolToInt(signal.(func(*std_core.QEvent) bool)(std_core.NewQEventFromPointer(e))))) + } + + return C.char(int8(qt.GoBoolToInt(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).EventDefault(std_core.NewQEventFromPointer(e))))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) EventDefault(e std_core.QEvent_ITF) bool { + if ptr.Pointer() != nil { + return C.QRoomVBoxLayoutWithTriggerSlot_EventDefault(ptr.Pointer(), std_core.PointerFromQEvent(e)) != 0 + } + return false +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_EventFilter +func callbackQRoomVBoxLayoutWithTriggerSlot_EventFilter(ptr unsafe.Pointer, watched unsafe.Pointer, event unsafe.Pointer) C.char { + if signal := qt.GetSignal(ptr, "eventFilter"); signal != nil { + return C.char(int8(qt.GoBoolToInt(signal.(func(*std_core.QObject, *std_core.QEvent) bool)(std_core.NewQObjectFromPointer(watched), std_core.NewQEventFromPointer(event))))) + } + + return C.char(int8(qt.GoBoolToInt(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).EventFilterDefault(std_core.NewQObjectFromPointer(watched), std_core.NewQEventFromPointer(event))))) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) EventFilterDefault(watched std_core.QObject_ITF, event std_core.QEvent_ITF) bool { + if ptr.Pointer() != nil { + return C.QRoomVBoxLayoutWithTriggerSlot_EventFilterDefault(ptr.Pointer(), std_core.PointerFromQObject(watched), std_core.PointerFromQEvent(event)) != 0 + } + return false +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_ConnectNotify +func callbackQRoomVBoxLayoutWithTriggerSlot_ConnectNotify(ptr unsafe.Pointer, sign unsafe.Pointer) { + if signal := qt.GetSignal(ptr, "connectNotify"); signal != nil { + signal.(func(*std_core.QMetaMethod))(std_core.NewQMetaMethodFromPointer(sign)) + } else { + NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).ConnectNotifyDefault(std_core.NewQMetaMethodFromPointer(sign)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) ConnectNotifyDefault(sign std_core.QMetaMethod_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot_ConnectNotifyDefault(ptr.Pointer(), std_core.PointerFromQMetaMethod(sign)) + } +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_CustomEvent +func callbackQRoomVBoxLayoutWithTriggerSlot_CustomEvent(ptr unsafe.Pointer, event unsafe.Pointer) { + if signal := qt.GetSignal(ptr, "customEvent"); signal != nil { + signal.(func(*std_core.QEvent))(std_core.NewQEventFromPointer(event)) + } else { + NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).CustomEventDefault(std_core.NewQEventFromPointer(event)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) CustomEventDefault(event std_core.QEvent_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot_CustomEventDefault(ptr.Pointer(), std_core.PointerFromQEvent(event)) + } +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_DeleteLater +func callbackQRoomVBoxLayoutWithTriggerSlot_DeleteLater(ptr unsafe.Pointer) { + if signal := qt.GetSignal(ptr, "deleteLater"); signal != nil { + signal.(func())() + } else { + NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).DeleteLaterDefault() + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) DeleteLaterDefault() { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot_DeleteLaterDefault(ptr.Pointer()) + ptr.SetPointer(nil) + runtime.SetFinalizer(ptr, nil) + } +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_Destroyed +func callbackQRoomVBoxLayoutWithTriggerSlot_Destroyed(ptr unsafe.Pointer, obj unsafe.Pointer) { + if signal := qt.GetSignal(ptr, "destroyed"); signal != nil { + signal.(func(*std_core.QObject))(std_core.NewQObjectFromPointer(obj)) + } + +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_DisconnectNotify +func callbackQRoomVBoxLayoutWithTriggerSlot_DisconnectNotify(ptr unsafe.Pointer, sign unsafe.Pointer) { + if signal := qt.GetSignal(ptr, "disconnectNotify"); signal != nil { + signal.(func(*std_core.QMetaMethod))(std_core.NewQMetaMethodFromPointer(sign)) + } else { + NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).DisconnectNotifyDefault(std_core.NewQMetaMethodFromPointer(sign)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) DisconnectNotifyDefault(sign std_core.QMetaMethod_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot_DisconnectNotifyDefault(ptr.Pointer(), std_core.PointerFromQMetaMethod(sign)) + } +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_ObjectNameChanged +func callbackQRoomVBoxLayoutWithTriggerSlot_ObjectNameChanged(ptr unsafe.Pointer, objectName C.struct_Moc_PackedString) { + if signal := qt.GetSignal(ptr, "objectNameChanged"); signal != nil { + signal.(func(string))(cGoUnpackString(objectName)) + } + +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_TimerEvent +func callbackQRoomVBoxLayoutWithTriggerSlot_TimerEvent(ptr unsafe.Pointer, event unsafe.Pointer) { + if signal := qt.GetSignal(ptr, "timerEvent"); signal != nil { + signal.(func(*std_core.QTimerEvent))(std_core.NewQTimerEventFromPointer(event)) + } else { + NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).TimerEventDefault(std_core.NewQTimerEventFromPointer(event)) + } +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) TimerEventDefault(event std_core.QTimerEvent_ITF) { + if ptr.Pointer() != nil { + C.QRoomVBoxLayoutWithTriggerSlot_TimerEventDefault(ptr.Pointer(), std_core.PointerFromQTimerEvent(event)) + } +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_SpacerItem +func callbackQRoomVBoxLayoutWithTriggerSlot_SpacerItem(ptr unsafe.Pointer) unsafe.Pointer { + if signal := qt.GetSignal(ptr, "spacerItem"); signal != nil { + return std_widgets.PointerFromQSpacerItem(signal.(func() *std_widgets.QSpacerItem)()) + } + + return std_widgets.PointerFromQSpacerItem(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).SpacerItemDefault()) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) SpacerItemDefault() *std_widgets.QSpacerItem { + if ptr.Pointer() != nil { + return std_widgets.NewQSpacerItemFromPointer(C.QRoomVBoxLayoutWithTriggerSlot_SpacerItemDefault(ptr.Pointer())) + } + return nil +} + +//export callbackQRoomVBoxLayoutWithTriggerSlot_Widget +func callbackQRoomVBoxLayoutWithTriggerSlot_Widget(ptr unsafe.Pointer) unsafe.Pointer { + if signal := qt.GetSignal(ptr, "widget"); signal != nil { + return std_widgets.PointerFromQWidget(signal.(func() *std_widgets.QWidget)()) + } + + return std_widgets.PointerFromQWidget(NewQRoomVBoxLayoutWithTriggerSlotFromPointer(ptr).WidgetDefault()) +} + +func (ptr *QRoomVBoxLayoutWithTriggerSlot) WidgetDefault() *std_widgets.QWidget { + if ptr.Pointer() != nil { + var tmpValue = std_widgets.NewQWidgetFromPointer(C.QRoomVBoxLayoutWithTriggerSlot_WidgetDefault(ptr.Pointer())) + if !qt.ExistsSignal(tmpValue.Pointer(), "destroyed") { + tmpValue.ConnectDestroyed(func(*std_core.QObject) { tmpValue.SetPointer(nil) }) + } + return tmpValue + } + return nil +} + type QVBoxLayoutWithTriggerSlot_ITF interface { std_widgets.QVBoxLayout_ITF QVBoxLayoutWithTriggerSlot_PTR() *QVBoxLayoutWithTriggerSlot diff --git a/elements/moc.h b/elements/moc.h @@ -8,6 +8,8 @@ #include <stdint.h> #ifdef __cplusplus +class QRoomVBoxLayoutWithTriggerSlot; +void QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaTypes(); class QVBoxLayoutWithTriggerSlot; void QVBoxLayoutWithTriggerSlot_QVBoxLayoutWithTriggerSlot_QRegisterMetaTypes(); extern "C" { @@ -15,6 +17,58 @@ extern "C" { struct Moc_PackedString { char* data; long long len; }; struct Moc_PackedList { void* data; long long len; }; +void QRoomVBoxLayoutWithTriggerSlot_TriggerMessage(void* ptr, struct Moc_PackedString messageBody, struct Moc_PackedString sender); +int QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType(); +int QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QRegisterMetaType2(char* typeName); +int QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QmlRegisterType(); +int QRoomVBoxLayoutWithTriggerSlot_QRoomVBoxLayoutWithTriggerSlot_QmlRegisterType2(char* uri, int versionMajor, int versionMinor, char* qmlName); +void* QRoomVBoxLayoutWithTriggerSlot___dynamicPropertyNames_atList(void* ptr, int i); +void QRoomVBoxLayoutWithTriggerSlot___dynamicPropertyNames_setList(void* ptr, void* i); +void* QRoomVBoxLayoutWithTriggerSlot___dynamicPropertyNames_newList(void* ptr); +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_atList2(void* ptr, int i); +void QRoomVBoxLayoutWithTriggerSlot___findChildren_setList2(void* ptr, void* i); +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_newList2(void* ptr); +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_atList3(void* ptr, int i); +void QRoomVBoxLayoutWithTriggerSlot___findChildren_setList3(void* ptr, void* i); +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_newList3(void* ptr); +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_atList(void* ptr, int i); +void QRoomVBoxLayoutWithTriggerSlot___findChildren_setList(void* ptr, void* i); +void* QRoomVBoxLayoutWithTriggerSlot___findChildren_newList(void* ptr); +void* QRoomVBoxLayoutWithTriggerSlot___children_atList(void* ptr, int i); +void QRoomVBoxLayoutWithTriggerSlot___children_setList(void* ptr, void* i); +void* QRoomVBoxLayoutWithTriggerSlot___children_newList(void* ptr); +void* QRoomVBoxLayoutWithTriggerSlot_NewQRoomVBoxLayoutWithTriggerSlot(); +void* QRoomVBoxLayoutWithTriggerSlot_NewQRoomVBoxLayoutWithTriggerSlot2(void* parent); +void QRoomVBoxLayoutWithTriggerSlot_DestroyQRoomVBoxLayoutWithTriggerSlot(void* ptr); +void* QRoomVBoxLayoutWithTriggerSlot_TakeAtDefault(void* ptr, int index); +void QRoomVBoxLayoutWithTriggerSlot_AddItemDefault(void* ptr, void* item); +void QRoomVBoxLayoutWithTriggerSlot_InvalidateDefault(void* ptr); +void QRoomVBoxLayoutWithTriggerSlot_SetGeometryDefault(void* ptr, void* r); +void* QRoomVBoxLayoutWithTriggerSlot_ItemAtDefault(void* ptr, int index); +void* QRoomVBoxLayoutWithTriggerSlot_MaximumSizeDefault(void* ptr); +void* QRoomVBoxLayoutWithTriggerSlot_MinimumSizeDefault(void* ptr); +void* QRoomVBoxLayoutWithTriggerSlot_SizeHintDefault(void* ptr); +long long QRoomVBoxLayoutWithTriggerSlot_ExpandingDirectionsDefault(void* ptr); +char QRoomVBoxLayoutWithTriggerSlot_HasHeightForWidthDefault(void* ptr); +int QRoomVBoxLayoutWithTriggerSlot_CountDefault(void* ptr); +int QRoomVBoxLayoutWithTriggerSlot_HeightForWidthDefault(void* ptr, int w); +int QRoomVBoxLayoutWithTriggerSlot_MinimumHeightForWidthDefault(void* ptr, int w); +void* QRoomVBoxLayoutWithTriggerSlot_LayoutDefault(void* ptr); +void QRoomVBoxLayoutWithTriggerSlot_ChildEventDefault(void* ptr, void* e); +void* QRoomVBoxLayoutWithTriggerSlot_GeometryDefault(void* ptr); +long long QRoomVBoxLayoutWithTriggerSlot_ControlTypesDefault(void* ptr); +char QRoomVBoxLayoutWithTriggerSlot_IsEmptyDefault(void* ptr); +int QRoomVBoxLayoutWithTriggerSlot_IndexOfDefault(void* ptr, void* widget); +char QRoomVBoxLayoutWithTriggerSlot_EventDefault(void* ptr, void* e); +char QRoomVBoxLayoutWithTriggerSlot_EventFilterDefault(void* ptr, void* watched, void* event); +void QRoomVBoxLayoutWithTriggerSlot_ConnectNotifyDefault(void* ptr, void* sign); +void QRoomVBoxLayoutWithTriggerSlot_CustomEventDefault(void* ptr, void* event); +void QRoomVBoxLayoutWithTriggerSlot_DeleteLaterDefault(void* ptr); +void QRoomVBoxLayoutWithTriggerSlot_DisconnectNotifyDefault(void* ptr, void* sign); +void QRoomVBoxLayoutWithTriggerSlot_TimerEventDefault(void* ptr, void* event); +; +void* QRoomVBoxLayoutWithTriggerSlot_SpacerItemDefault(void* ptr); +void* QRoomVBoxLayoutWithTriggerSlot_WidgetDefault(void* ptr); void QVBoxLayoutWithTriggerSlot_TriggerMessage(void* ptr, struct Moc_PackedString messageBody, struct Moc_PackedString sender); int QVBoxLayoutWithTriggerSlot_QVBoxLayoutWithTriggerSlot_QRegisterMetaType(); int QVBoxLayoutWithTriggerSlot_QVBoxLayoutWithTriggerSlot_QRegisterMetaType2(char* typeName); diff --git a/elements/moc_moc.h b/elements/moc_moc.h @@ -19,6 +19,98 @@ QT_BEGIN_MOC_NAMESPACE QT_WARNING_PUSH QT_WARNING_DISABLE_DEPRECATED +struct qt_meta_stringdata_QRoomVBoxLayoutWithTriggerSlot_t { + QByteArrayData data[5]; + char stringdata0[66]; +}; +#define QT_MOC_LITERAL(idx, ofs, len) \ + Q_STATIC_BYTE_ARRAY_DATA_HEADER_INITIALIZER_WITH_OFFSET(len, \ + qptrdiff(offsetof(qt_meta_stringdata_QRoomVBoxLayoutWithTriggerSlot_t, stringdata0) + ofs \ + - idx * sizeof(QByteArrayData)) \ + ) +static const qt_meta_stringdata_QRoomVBoxLayoutWithTriggerSlot_t qt_meta_stringdata_QRoomVBoxLayoutWithTriggerSlot = { + { +QT_MOC_LITERAL(0, 0, 30), // "QRoomVBoxLayoutWithTriggerSlot" +QT_MOC_LITERAL(1, 31, 14), // "TriggerMessage" +QT_MOC_LITERAL(2, 46, 0), // "" +QT_MOC_LITERAL(3, 47, 11), // "messageBody" +QT_MOC_LITERAL(4, 59, 6) // "sender" + + }, + "QRoomVBoxLayoutWithTriggerSlot\0" + "TriggerMessage\0\0messageBody\0sender" +}; +#undef QT_MOC_LITERAL + +static const uint qt_meta_data_QRoomVBoxLayoutWithTriggerSlot[] = { + + // content: + 7, // revision + 0, // classname + 0, 0, // classinfo + 1, 14, // methods + 0, 0, // properties + 0, 0, // enums/sets + 0, 0, // constructors + 0, // flags + 0, // signalCount + + // slots: name, argc, parameters, tag, flags + 1, 2, 19, 2, 0x0a /* Public */, + + // slots: parameters + QMetaType::Void, QMetaType::QString, QMetaType::QString, 3, 4, + + 0 // eod +}; + +void QRoomVBoxLayoutWithTriggerSlot::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a) +{ + if (_c == QMetaObject::InvokeMetaMethod) { + QRoomVBoxLayoutWithTriggerSlot *_t = static_cast<QRoomVBoxLayoutWithTriggerSlot *>(_o); + Q_UNUSED(_t) + switch (_id) { + case 0: _t->TriggerMessage((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break; + default: ; + } + } +} + +const QMetaObject QRoomVBoxLayoutWithTriggerSlot::staticMetaObject = { + { &QVBoxLayout::staticMetaObject, qt_meta_stringdata_QRoomVBoxLayoutWithTriggerSlot.data, + qt_meta_data_QRoomVBoxLayoutWithTriggerSlot, qt_static_metacall, nullptr, nullptr} +}; + + +const QMetaObject *QRoomVBoxLayoutWithTriggerSlot::metaObject() const +{ + return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : &staticMetaObject; +} + +void *QRoomVBoxLayoutWithTriggerSlot::qt_metacast(const char *_clname) +{ + if (!_clname) return nullptr; + if (!strcmp(_clname, qt_meta_stringdata_QRoomVBoxLayoutWithTriggerSlot.stringdata0)) + return static_cast<void*>(const_cast< QRoomVBoxLayoutWithTriggerSlot*>(this)); + return QVBoxLayout::qt_metacast(_clname); +} + +int QRoomVBoxLayoutWithTriggerSlot::qt_metacall(QMetaObject::Call _c, int _id, void **_a) +{ + _id = QVBoxLayout::qt_metacall(_c, _id, _a); + if (_id < 0) + return _id; + if (_c == QMetaObject::InvokeMetaMethod) { + if (_id < 1) + qt_static_metacall(this, _c, _id, _a); + _id -= 1; + } else if (_c == QMetaObject::RegisterMethodArgumentMetaType) { + if (_id < 1) + *reinterpret_cast<int*>(_a[0]) = -1; + _id -= 1; + } + return _id; +} struct qt_meta_stringdata_QVBoxLayoutWithTriggerSlot_t { QByteArrayData data[5]; char stringdata0[62]; diff --git a/elements/roomlist.go b/elements/roomlist.go @@ -1,32 +1,86 @@ package elements import ( + "github.com/Nordgedanken/Morpheus/matrix" + "github.com/matrix-org/gomatrix" + "github.com/rhinoman/go-commonmark" "github.com/therecipe/qt/core" + "github.com/therecipe/qt/uitools" "github.com/therecipe/qt/widgets" ) -func NewRoomList() (roomListView *widgets.QWidget, roomListViewLayout *widgets.QGridLayout) { - roomListView = widgets.NewQWidget(nil, 0) +//////////////////////////////////////////////////// +// // +// // +// // +// // +// DON'T TOUCH I HAVE NO IDEA WHY THIS EVEN WORKS // +// // +// // +// // +//////////////////////////////////////////////////// - roomListScroll := widgets.NewQScrollArea(nil) - roomListScroll.SetObjectName("roomListScroll") - roomListScroll.SetStyleSheet("QAbstractScrollArea#roomListScroll { border: 0px; };") +// QRoomVBoxLayoutWithTriggerSlot defines the QVBoxLayout with TriggerMessage slot to add messages to the View +type QRoomVBoxLayoutWithTriggerSlot struct { + widgets.QVBoxLayout - roomListViewLayout = widgets.NewQGridLayout(roomListView) - roomListViewLayout.SetSpacing(0) - roomListViewLayout.SetContentsMargins(0, 0, 0, 0) + _ func(messageBody, sender string) `slot:"TriggerMessage"` +} + +// NewRoomList generates a new QRoomVBoxLayoutWithTriggerSlot and adds it to the room scrollArea +func NewRoomList(scrollArea *widgets.QScrollArea, roomView *widgets.QWidget) (roomViewLayout *QRoomVBoxLayoutWithTriggerSlot) { + roomViewLayout = NewQRoomVBoxLayoutWithTriggerSlot2(roomView) - roomListScroll.SetWidget(roomListView) - roomListScroll.SetWidgetResizable(true) + roomViewLayout.SetSpacing(0) + roomViewLayout.SetContentsMargins(0, 0, 0, 0) + roomView.SetContentsMargins(0, 0, 0, 0) + scrollArea.SetWidget(roomView) + scrollArea.Widget().SetLayout(roomViewLayout) return } -func NewRoom(name string, roomListViewLayout *widgets.QGridLayout) { - roomWidget := widgets.NewQWidget(nil, 0) - roomLayout := widgets.NewQVBoxLayout2(roomWidget) - room := widgets.NewQLabel2(name, nil, 0) - roomLayout.AddWidget(room, 0, core.Qt__AlignTop) - roomListViewLayout.AddWidget(room, 0, 0, core.Qt__AlignTop) +// NewRoom adds a new room object to the view +func (roomViewLayout *QRoomVBoxLayoutWithTriggerSlot) NewRoom(body string, cli *gomatrix.Client, sender string, scrollArea *widgets.QScrollArea) (err error) { + avatar, AvatarErr := matrix.GetUserAvatar(cli, sender, 84) + if err != nil { + err = AvatarErr + return + } + + var widget = widgets.NewQWidget(nil, 0) + + var loader = uitools.NewQUiLoader(nil) + var file = core.NewQFile2(":/qml/ui/message.ui") + + file.Open(core.QIODevice__ReadOnly) + var wrapperWidget = loader.Load(file, widget) + file.Close() + + messageWidget := widgets.NewQWidgetFromPointer(widget.FindChild("message", core.Qt__FindChildrenRecursively).Pointer()) + avatarLogo := widgets.NewQLabelFromPointer(widget.FindChild("avatar", core.Qt__FindChildrenRecursively).Pointer()) + messageContent := widgets.NewQLabelFromPointer(widget.FindChild("messageContent", core.Qt__FindChildrenRecursively).Pointer()) + senderContent := widgets.NewQLabelFromPointer(widget.FindChild("sender", core.Qt__FindChildrenRecursively).Pointer()) + + markdownMessage := commonmark.Md2Html(body, 0) + messageContent.SetText(markdownMessage) + + senderDisplayNameResp, _ := cli.GetDisplayName(sender) + senderDisplayName := senderDisplayNameResp.DisplayName + senderContent.SetText(senderDisplayName) + avatarLogo.SetPixmap(avatar) + + messageContent.SetMinimumWidth(messageContent.LineWidth()) + + messageWidget.SetMinimumWidth(messageContent.LineWidth() + 100) + messageWidget.Resize(wrapperWidget.Size()) + + roomViewLayout.SetSpacing(1) + roomViewLayout.SetContentsMargins(0, 0, 0, 0) + + roomViewLayout.AddWidget(messageWidget, 0, core.Qt__AlignBottom) + scrollArea.Widget().SetLayout(roomViewLayout) + + return } diff --git a/linter.json b/linter.json @@ -16,6 +16,7 @@ "errcheck", "vet", "megacheck", - "goconst" + "goconst", + "maligned" ] } \ No newline at end of file diff --git a/matrix/user.go b/matrix/user.go @@ -7,6 +7,7 @@ import ( "bytes" "github.com/Nordgedanken/Morpheus/util" + "github.com/disintegration/letteravatar" "github.com/matrix-org/gomatrix" "github.com/therecipe/qt/gui" "github.com/tidwall/buntdb" @@ -16,7 +17,9 @@ import ( // image/jpeg needed to load jpeg images _ "image/jpeg" "image/png" - "math/rand" + "strconv" + "unicode" + "unicode/utf8" ) var localLog *log.Logger @@ -54,13 +57,21 @@ func (c *circle) At(x, y int) color.Color { return color.Alpha{0} } -func generateGenericImages(displayname string) (imgData string, err error) { - // Create an 100 x 100 image - img := image.NewRGBA(image.Rect(0, 0, 100, 100)) +func generateGenericImages(displayname string, size int) (imgData string, err error) { + identifier := displayname + if (identifier[0] == '#' || identifier[0] == '!' || identifier[0] == '@') && len(identifier) > 1 { + identifier = identifier[1:] + } - // Draw a red dot at (2, 3) - img.Set(50, 50, color.RGBA{uint8(rand.Intn(200)), uint8(rand.Intn(255)), uint8(rand.Intn(255)), 255}) + avatarChar, _ := utf8.DecodeRuneInString(identifier) + img, LetterAvatarErr := letteravatar.Draw(size, unicode.ToUpper(avatarChar), nil) + if LetterAvatarErr != nil { + err = LetterAvatarErr + return + } + + localLog.Println("generatedIMGBounds: ", img.Bounds()) buf := new(bytes.Buffer) EncodeErr := png.Encode(buf, img) if EncodeErr != nil { @@ -73,12 +84,12 @@ func generateGenericImages(displayname string) (imgData string, err error) { // GetOwnUserAvatar returns a *gui.QPixmap of an UserAvatar func GetOwnUserAvatar(cli *gomatrix.Client) (avatar *gui.QPixmap, err error) { - avatar, err = GetUserAvatar(cli, cli.UserID) + avatar, err = GetUserAvatar(cli, cli.UserID, 61) return } // GetUserAvatar returns a *gui.QPixmap of an UserAvatar -func GetUserAvatar(cli *gomatrix.Client, mxid string) (avatarResp *gui.QPixmap, err error) { +func GetUserAvatar(cli *gomatrix.Client, mxid string, size int) (avatarResp *gui.QPixmap, err error) { db, DBOpenErr := OpenDB() if DBOpenErr != nil { localLog.Fatalln(DBOpenErr) @@ -91,7 +102,7 @@ func GetUserAvatar(cli *gomatrix.Client, mxid string) (avatarResp *gui.QPixmap, // Get cache DBErr := db.View(func(tx *buntdb.Tx) error { - QueryErr := tx.AscendKeys("user:"+mxid+":avatarData100x100", + QueryErr := tx.AscendKeys("user:"+mxid+":avatarData"+strconv.Itoa(size)+"x"+strconv.Itoa(size), func(key, value string) bool { avatarData = value return true @@ -123,7 +134,7 @@ func GetUserAvatar(cli *gomatrix.Client, mxid string) (avatarResp *gui.QPixmap, hsURL := cli.HomeserverURL.String() avatarURLSplits := strings.Split(strings.Replace(avatarURL, "mxc://", "", -1), "/") - urlPath := hsURL + "/_matrix/media/r0/thumbnail/" + avatarURLSplits[0] + "/" + avatarURLSplits[1] + "?width=100&height=100" + urlPath := hsURL + "/_matrix/media/r0/thumbnail/" + avatarURLSplits[0] + "/" + avatarURLSplits[1] + "?width=" + strconv.Itoa(size) + "&height=" + strconv.Itoa(size) + "&method=crop" data, ReqErr := cli.MakeRequest("GET", urlPath, nil, nil) if ReqErr != nil { @@ -132,11 +143,11 @@ func GetUserAvatar(cli *gomatrix.Client, mxid string) (avatarResp *gui.QPixmap, } IMGdata = string(data[:]) } else { - //TODO Generate default image (Step: AfterUI) - DisplayNameResp, _ := cli.GetOwnDisplayName() + localLog.Println("Generating Avatar") + DisplayNameResp, _ := cli.GetDisplayName(mxid) DisplayName := DisplayNameResp.DisplayName var GenerateImgErr error - IMGdata, GenerateImgErr = generateGenericImages(DisplayName) + IMGdata, GenerateImgErr = generateGenericImages(DisplayName, size) if GenerateImgErr != nil { err = GenerateImgErr return @@ -145,7 +156,7 @@ func GetUserAvatar(cli *gomatrix.Client, mxid string) (avatarResp *gui.QPixmap, // Update cache DBerr := db.Update(func(tx *buntdb.Tx) error { - _, _, DBSetErr := tx.Set("user:"+mxid+":avatarData100x100", IMGdata, nil) + _, _, DBSetErr := tx.Set("user:"+mxid+":avatarData"+strconv.Itoa(size)+"x"+strconv.Itoa(size), IMGdata, nil) return DBSetErr }) if DBerr != nil { @@ -166,7 +177,13 @@ func GetUserAvatar(cli *gomatrix.Client, mxid string) (avatarResp *gui.QPixmap, canvas := image.NewRGBA(srcIMG.Bounds()) cx := srcIMG.Bounds().Min.X + srcIMG.Bounds().Dx()/2 cy := srcIMG.Bounds().Min.Y + srcIMG.Bounds().Dy()/2 - draw.DrawMask(canvas, canvas.Bounds(), srcIMG, image.ZP, &circle{image.Point{cx, cy}, 110}, image.ZP, draw.Over) + localLog.Println("srcIMGBounds: ", srcIMG.Bounds()) + localLog.Println("srcIMGCx: ", cx) + localLog.Println("srcIMGCy: ", cy) + //outerRadius := math.Sqrt(math.Pow(float64(size), 2)+math.Pow(float64(size), 2)) / 2 + draw.DrawMask(canvas, canvas.Bounds(), srcIMG, image.ZP, &circle{image.Point{cx, cy}, cx}, image.ZP, draw.Over) + + localLog.Println("modIMGBounds: ", canvas.Bounds()) avatar := gui.NewQPixmap() buf := new(bytes.Buffer) ConvErr := png.Encode(buf, canvas) diff --git a/qml/ui/message.ui b/qml/ui/message.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>560</width> - <height>83</height> + <width>210</width> + <height>97</height> </rect> </property> <property name="windowTitle"> @@ -17,60 +17,27 @@ <string notr="true">background-color:transparent;</string> </property> <layout class="QFormLayout" name="formLayout"> - <property name="horizontalSpacing"> - <number>0</number> - </property> - <property name="verticalSpacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> <item row="0" column="0"> <widget class="QWidget" name="widget_2" native="true"> <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <layout class="QGridLayout" name="gridLayout"> - <property name="leftMargin"> - <number>0</number> - </property> - <property name="topMargin"> - <number>0</number> - </property> - <property name="rightMargin"> - <number>0</number> - </property> - <property name="bottomMargin"> - <number>0</number> - </property> - <property name="spacing"> - <number>0</number> - </property> <item row="0" column="0"> <widget class="QWidget" name="widget_3" native="true"> <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Minimum"> + <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> </property> <property name="minimumSize"> <size> - <width>84</width> - <height>84</height> + <width>61</width> + <height>61</height> </size> </property> <widget class="QLabel" name="avatar"> @@ -78,12 +45,12 @@ <rect> <x>0</x> <y>0</y> - <width>84</width> - <height>84</height> + <width>61</width> + <height>61</height> </rect> </property> <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> + <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <horstretch>0</horstretch> <verstretch>0</verstretch> </sizepolicy> @@ -143,9 +110,12 @@ </font> </property> <property name="styleSheet"> - <string notr="true">background-color: rgb(242, 244, 248); + <string notr="true">/*OLD COLOR +background-color: rgb(242, 244, 248); */ +background-color: rgb(239, 239, 250); border: 0; -border-radius:5px;</string> +border-radius:5px; +</string> </property> <property name="text"> <string>Test</string> diff --git a/ui/MainUI.go b/ui/MainUI.go @@ -13,7 +13,6 @@ import ( "github.com/tidwall/buntdb" "log" "sync" - "time" ) // NewMainUIStruct gives you a MainUI struct with prefilled data @@ -114,74 +113,13 @@ func (m *MainUI) NewUI() (err error) { //Handle LogoutButton logoutButton := widgets.NewQPushButtonFromPointer(widget.FindChild("LogoutButton", core.Qt__FindChildrenRecursively).Pointer()) logoutButton.ConnectClicked(func(_ bool) { - //TODO register enter and show loader or so - m.localLog.Println("Starting Logout Sequenze in background") - var wg sync.WaitGroup - results := make(chan bool) - - wg.Add(1) - go func(cli *gomatrix.Client, localLog *log.Logger, results chan<- bool) { - defer wg.Done() - _, LogoutErr := cli.Logout() - if LogoutErr != nil { - localLog.Println(LogoutErr) - results <- false - } - cli.ClearCredentials() - - db, DBOpenErr := matrix.OpenDB() - if DBOpenErr != nil { - localLog.Fatalln(DBOpenErr) - } - defer db.Close() - - //Flush complete DB - DBErr := db.Update(func(tx *buntdb.Tx) error { - QueryErr := tx.DeleteAll() - return QueryErr - }) - if DBErr != nil { - localLog.Panicln(DBErr) - results <- false - } else { - results <- true - } - }(m.cli, m.localLog, results) - - go func() { - wg.Wait() // wait for each execTask to return - close(results) // then close the results channel - }() - - //Show LoginUI - for result := range results { - if result { - m.window.DisconnectKeyPressEvent() - m.window.DisconnectResizeEvent() - widget.DisconnectResizeEvent() - messageScrollArea.DisconnectResizeEvent() - - LoginUIStruct := NewLoginUIStructWithExistingConfig(m.config, m.window) - LoginUIStructInitErr := LoginUIStruct.InitLogger() - if LoginUIStructInitErr != nil { - err = LoginUIStructInitErr - return - } - loginUIErr := LoginUIStruct.NewUI() - if loginUIErr != nil { - m.localLog.Panicln(loginUIErr) - } - m.window.SetCentralWidget(LoginUIStruct.GetWidget()) - } + LogoutErr := m.logout(widget, messageScrollArea) + if LogoutErr != nil { + err = LogoutErr + return } }) - //Start Syncer! - m.syncer = m.cli.Syncer.(*gomatrix.DefaultSyncer) - customStore := gomatrix.NewInMemoryStore() - m.cli.Store = customStore - m.syncer.Store = customStore - // Init Message View messageListLayout := elements.NewMessageList(messageScrollArea, messagesScrollAreaContent) @@ -196,17 +134,129 @@ func (m *MainUI) NewUI() (err error) { messageScrollArea.SetHorizontalScrollBarPolicy(core.Qt__ScrollBarAlwaysOff) messageScrollArea.SetContentsMargins(0, 0, 0, 0) + m.startSync(messageListLayout) + + var message string + messageInput := widgets.NewQLineEditFromPointer(widget.FindChild("MessageInput", core.Qt__FindChildrenRecursively).Pointer()) + messageInput.ConnectTextChanged(func(value string) { + message = value + }) + + m.window.ConnectKeyPressEvent(func(ev *gui.QKeyEvent) { + if int(ev.Key()) == int(core.Qt__Key_Enter) || int(ev.Key()) == int(core.Qt__Key_Return) { + MessageErr := m.sendMessage(message) + if MessageErr != nil { + err = MessageErr + return + } + + messageInput.Clear() + } else { + messageInput.KeyPressEventDefault(ev) + } + }) + + m.widget = widget + return +} + +func (m *MainUI) sendMessage(message string) (err error) { + mardownMessage := commonmark.Md2Html(message, 0) + if mardownMessage == message { + _, SendErr := m.cli.SendText("!zTIXGmDjyRcAqbrWab:matrix.ffslfl.net", message) + if SendErr != nil { + err = SendErr + return + } + } else { + _, SendErr := m.cli.SendMessageEvent("!zTIXGmDjyRcAqbrWab:matrix.ffslfl.net", "m.room.message", matrix.HTMLMessage{MsgType: "m.text", Body: message, FormattedBody: mardownMessage, Format: "org.matrix.custom.html"}) + if SendErr != nil { + err = SendErr + return + } + } + return +} + +func (m *MainUI) logout(widget *widgets.QWidget, messageScrollArea *widgets.QScrollArea) (err error) { + //TODO register enter and show loader or so + m.localLog.Println("Starting Logout Sequenze in background") + var wg sync.WaitGroup + results := make(chan bool) + + wg.Add(1) + go func(cli *gomatrix.Client, localLog *log.Logger, results chan<- bool) { + defer wg.Done() + _, LogoutErr := cli.Logout() + if LogoutErr != nil { + localLog.Println(LogoutErr) + results <- false + } + cli.ClearCredentials() + + db, DBOpenErr := matrix.OpenDB() + if DBOpenErr != nil { + localLog.Fatalln(DBOpenErr) + } + defer db.Close() + + //Flush complete DB + DBErr := db.Update(func(tx *buntdb.Tx) error { + QueryErr := tx.DeleteAll() + return QueryErr + }) + if DBErr != nil { + localLog.Panicln(DBErr) + results <- false + } else { + results <- true + } + }(m.cli, m.localLog, results) + + go func() { + wg.Wait() // wait for each execTask to return + close(results) // then close the results channel + }() + + //Show LoginUI + for result := range results { + if result { + m.window.DisconnectKeyPressEvent() + m.window.DisconnectResizeEvent() + widget.DisconnectResizeEvent() + messageScrollArea.DisconnectResizeEvent() + + LoginUIStruct := NewLoginUIStructWithExistingConfig(m.config, m.window) + LoginUIStructInitErr := LoginUIStruct.InitLogger() + if LoginUIStructInitErr != nil { + err = LoginUIStructInitErr + return + } + loginUIErr := LoginUIStruct.NewUI() + if loginUIErr != nil { + err = loginUIErr + return + } + m.window.SetCentralWidget(LoginUIStruct.GetWidget()) + } + } + return +} + +func (m *MainUI) startSync(messageListLayout *elements.QVBoxLayoutWithTriggerSlot) (err error) { + //Start Syncer! + m.syncer = m.cli.Syncer.(*gomatrix.DefaultSyncer) + customStore := gomatrix.NewInMemoryStore() + m.cli.Store = customStore + m.syncer.Store = customStore + m.syncer.OnEventType("m.room.message", func(ev *gomatrix.Event) { msg, _ := ev.Body() room := ev.RoomID sender := ev.Sender id := ev.ID timestamp := ev.Timestamp - CacheErr := matrix.CacheMessageEvents(id, sender, room, msg, timestamp) - if CacheErr != nil { - err = CacheErr - return - } + go matrix.CacheMessageEvents(id, sender, room, msg, timestamp) messageListLayout.TriggerMessage(msg, sender) }) @@ -216,40 +266,9 @@ func (m *MainUI) NewUI() (err error) { for { if e := m.cli.Sync(); e != nil { - m.localLog.Println("Fatal Sync() error") - time.Sleep(5 * time.Second) + err = e } - time.Sleep(10 * time.Second) } }() - - messageInput := widgets.NewQLineEditFromPointer(widget.FindChild("MessageInput", core.Qt__FindChildrenRecursively).Pointer()) - var message string - m.window.ConnectKeyPressEvent(func(ev *gui.QKeyEvent) { - if int(ev.Key()) == int(core.Qt__Key_Enter) || int(ev.Key()) == int(core.Qt__Key_Return) { - mardownMessage := commonmark.Md2Html(message, 0) - if mardownMessage == message { - _, SendErr := m.cli.SendText("!zTIXGmDjyRcAqbrWab:matrix.ffslfl.net", message) - if SendErr != nil { - err = SendErr - return - } - } else { - _, SendErr := m.cli.SendMessageEvent("!zTIXGmDjyRcAqbrWab:matrix.ffslfl.net", "m.room.message", matrix.HTMLMessage{"m.text", message, mardownMessage, "org.matrix.custom.html"}) - if SendErr != nil { - err = SendErr - return - } - } - messageInput.Clear() - } else { - messageInput.KeyPressEventDefault(ev) - } - }) - messageInput.ConnectTextChanged(func(value string) { - message = value - }) - - m.widget = widget return }