2024-10-20 05:21:03 +00:00
|
|
|
package qt6
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qobject.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
|
|
|
"runtime"
|
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QObjectData__ int
|
|
|
|
|
|
|
|
const (
|
|
|
|
QObjectData__CheckForParentChildLoopsWarnDepth QObjectData__ = 4096
|
|
|
|
)
|
|
|
|
|
|
|
|
type QObjectData struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QObjectData
|
|
|
|
isSubclass bool
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObjectData) cPointer() *C.QObjectData {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObjectData) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQObjectData constructs the type using only CGO pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func newQObjectData(h *C.QObjectData) *QObjectData {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-10-20 05:21:03 +00:00
|
|
|
return &QObjectData{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQObjectData constructs the type using only unsafe pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func UnsafeNewQObjectData(h unsafe.Pointer) *QObjectData {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQObjectData((*C.QObjectData)(h))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObjectData) DynamicMetaObject() *QMetaObject {
|
2024-12-07 02:02:06 +00:00
|
|
|
return newQMetaObject(C.QObjectData_DynamicMetaObject(this.h))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QObjectData) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QObjectData_Delete(this.h, C.bool(this.isSubclass))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QObjectData) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QObjectData) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
type QObject struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QObject
|
|
|
|
isSubclass bool
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) cPointer() *C.QObject {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQObject constructs the type using only CGO pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func newQObject(h *C.QObject) *QObject {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-10-20 05:21:03 +00:00
|
|
|
return &QObject{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQObject constructs the type using only unsafe pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func UnsafeNewQObject(h unsafe.Pointer) *QObject {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQObject((*C.QObject)(h))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQObject constructs a new QObject object.
|
|
|
|
func NewQObject() *QObject {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQObject(C.QObject_new())
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQObject2 constructs a new QObject object.
|
|
|
|
func NewQObject2(parent *QObject) *QObject {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQObject(C.QObject_new2(parent.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) MetaObject() *QMetaObject {
|
2024-12-07 02:02:06 +00:00
|
|
|
return newQMetaObject(C.QObject_MetaObject(this.h))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Metacast(param1 string) unsafe.Pointer {
|
|
|
|
param1_Cstring := C.CString(param1)
|
|
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
|
|
|
return (unsafe.Pointer)(C.QObject_Metacast(this.h, param1_Cstring))
|
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_Tr(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
var _ms C.struct_miqt_string = C.QObject_Tr(s_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Event(event *QEvent) bool {
|
|
|
|
return (bool)(C.QObject_Event(this.h, event.cPointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) EventFilter(watched *QObject, event *QEvent) bool {
|
|
|
|
return (bool)(C.QObject_EventFilter(this.h, watched.cPointer(), event.cPointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) ObjectName() string {
|
|
|
|
var _ms C.struct_miqt_string = C.QObject_ObjectName(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) SetObjectName(name QAnyStringView) {
|
|
|
|
C.QObject_SetObjectName(this.h, name.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) IsWidgetType() bool {
|
|
|
|
return (bool)(C.QObject_IsWidgetType(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) IsWindowType() bool {
|
|
|
|
return (bool)(C.QObject_IsWindowType(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) IsQuickItemType() bool {
|
|
|
|
return (bool)(C.QObject_IsQuickItemType(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) SignalsBlocked() bool {
|
|
|
|
return (bool)(C.QObject_SignalsBlocked(this.h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) BlockSignals(b bool) bool {
|
|
|
|
return (bool)(C.QObject_BlockSignals(this.h, (C.bool)(b)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Thread() *QThread {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQThread(C.QObject_Thread(this.h))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) MoveToThread(thread *QThread) {
|
|
|
|
C.QObject_MoveToThread(this.h, thread.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) StartTimer(interval int) int {
|
|
|
|
return (int)(C.QObject_StartTimer(this.h, (C.int)(interval)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) KillTimer(id int) {
|
|
|
|
C.QObject_KillTimer(this.h, (C.int)(id))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Children() []*QObject {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QObject_Children(this.h)
|
2024-10-20 05:21:03 +00:00
|
|
|
_ret := make([]*QObject, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]*C.QObject)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-12-07 02:02:06 +00:00
|
|
|
_ret[i] = newQObject(_outCast[i])
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) SetParent(parent *QObject) {
|
|
|
|
C.QObject_SetParent(this.h, parent.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) InstallEventFilter(filterObj *QObject) {
|
|
|
|
C.QObject_InstallEventFilter(this.h, filterObj.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) RemoveEventFilter(obj *QObject) {
|
|
|
|
C.QObject_RemoveEventFilter(this.h, obj.cPointer())
|
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_Connect(sender *QObject, signal *QMetaMethod, receiver *QObject, method *QMetaMethod) *QMetaObject__Connection {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQMetaObject__Connection(C.QObject_Connect(sender.cPointer(), signal.cPointer(), receiver.cPointer(), method.cPointer()))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Connect2(sender *QObject, signal string, member string) *QMetaObject__Connection {
|
|
|
|
signal_Cstring := C.CString(signal)
|
|
|
|
defer C.free(unsafe.Pointer(signal_Cstring))
|
|
|
|
member_Cstring := C.CString(member)
|
|
|
|
defer C.free(unsafe.Pointer(member_Cstring))
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQMetaObject__Connection(C.QObject_Connect2(this.h, sender.cPointer(), signal_Cstring, member_Cstring))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_Disconnect(sender *QObject, signal *QMetaMethod, receiver *QObject, member *QMetaMethod) bool {
|
|
|
|
return (bool)(C.QObject_Disconnect(sender.cPointer(), signal.cPointer(), receiver.cPointer(), member.cPointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_DisconnectWithQMetaObjectConnection(param1 *QMetaObject__Connection) bool {
|
|
|
|
return (bool)(C.QObject_DisconnectWithQMetaObjectConnection(param1.cPointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) DumpObjectTree() {
|
|
|
|
C.QObject_DumpObjectTree(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) DumpObjectInfo() {
|
|
|
|
C.QObject_DumpObjectInfo(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) SetProperty(name string, value *QVariant) bool {
|
|
|
|
name_Cstring := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(name_Cstring))
|
|
|
|
return (bool)(C.QObject_SetProperty(this.h, name_Cstring, value.cPointer()))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Property(name string) *QVariant {
|
|
|
|
name_Cstring := C.CString(name)
|
|
|
|
defer C.free(unsafe.Pointer(name_Cstring))
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQVariant(C.QObject_Property(this.h, name_Cstring))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) DynamicPropertyNames() [][]byte {
|
2024-11-04 07:18:27 +00:00
|
|
|
var _ma C.struct_miqt_array = C.QObject_DynamicPropertyNames(this.h)
|
2024-10-20 05:21:03 +00:00
|
|
|
_ret := make([][]byte, int(_ma.len))
|
|
|
|
_outCast := (*[0xffff]C.struct_miqt_string)(unsafe.Pointer(_ma.data)) // hey ya
|
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
|
|
|
var _lv_bytearray C.struct_miqt_string = _outCast[i]
|
|
|
|
_lv_ret := C.GoBytes(unsafe.Pointer(_lv_bytearray.data), C.int(int64(_lv_bytearray.len)))
|
|
|
|
C.free(unsafe.Pointer(_lv_bytearray.data))
|
|
|
|
_ret[i] = _lv_ret
|
|
|
|
}
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) BindingStorage() *QBindingStorage {
|
2024-12-07 02:02:06 +00:00
|
|
|
return newQBindingStorage(C.QObject_BindingStorage(this.h))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) BindingStorage2() *QBindingStorage {
|
2024-12-07 02:02:06 +00:00
|
|
|
return newQBindingStorage(C.QObject_BindingStorage2(this.h))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Destroyed() {
|
|
|
|
C.QObject_Destroyed(this.h)
|
|
|
|
}
|
|
|
|
func (this *QObject) OnDestroyed(slot func()) {
|
|
|
|
C.QObject_connect_Destroyed(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QObject_Destroyed
|
|
|
|
func miqt_exec_callback_QObject_Destroyed(cb C.intptr_t) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func())
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
gofunc()
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Parent() *QObject {
|
2024-12-07 02:02:06 +00:00
|
|
|
return newQObject(C.QObject_Parent(this.h))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Inherits(classname string) bool {
|
|
|
|
classname_Cstring := C.CString(classname)
|
|
|
|
defer C.free(unsafe.Pointer(classname_Cstring))
|
|
|
|
return (bool)(C.QObject_Inherits(this.h, classname_Cstring))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) DeleteLater() {
|
|
|
|
C.QObject_DeleteLater(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_Tr2(s string, c string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
|
|
|
var _ms C.struct_miqt_string = C.QObject_Tr2(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_Tr3(s string, c string, n int) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
|
|
|
c_Cstring := C.CString(c)
|
|
|
|
defer C.free(unsafe.Pointer(c_Cstring))
|
|
|
|
var _ms C.struct_miqt_string = C.QObject_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) StartTimer2(interval int, timerType TimerType) int {
|
|
|
|
return (int)(C.QObject_StartTimer2(this.h, (C.int)(interval), (C.int)(timerType)))
|
|
|
|
}
|
|
|
|
|
|
|
|
func QObject_Connect5(sender *QObject, signal *QMetaMethod, receiver *QObject, method *QMetaMethod, typeVal ConnectionType) *QMetaObject__Connection {
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQMetaObject__Connection(C.QObject_Connect5(sender.cPointer(), signal.cPointer(), receiver.cPointer(), method.cPointer(), (C.int)(typeVal)))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Connect4(sender *QObject, signal string, member string, typeVal ConnectionType) *QMetaObject__Connection {
|
|
|
|
signal_Cstring := C.CString(signal)
|
|
|
|
defer C.free(unsafe.Pointer(signal_Cstring))
|
|
|
|
member_Cstring := C.CString(member)
|
|
|
|
defer C.free(unsafe.Pointer(member_Cstring))
|
2024-12-07 02:02:06 +00:00
|
|
|
_goptr := newQMetaObject__Connection(C.QObject_Connect4(this.h, sender.cPointer(), signal_Cstring, member_Cstring, (C.int)(typeVal)))
|
2024-10-20 05:21:03 +00:00
|
|
|
_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
return _goptr
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) Destroyed1(param1 *QObject) {
|
|
|
|
C.QObject_Destroyed1(this.h, param1.cPointer())
|
|
|
|
}
|
|
|
|
func (this *QObject) OnDestroyed1(slot func(param1 *QObject)) {
|
|
|
|
C.QObject_connect_Destroyed1(this.h, C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QObject_Destroyed1
|
|
|
|
func miqt_exec_callback_QObject_Destroyed1(cb C.intptr_t, param1 *C.QObject) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(param1 *QObject))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-12-07 02:02:06 +00:00
|
|
|
slotval1 := newQObject(param1)
|
2024-10-20 05:21:03 +00:00
|
|
|
|
|
|
|
gofunc(slotval1)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
func (this *QObject) callVirtualBase_Event(event *QEvent) bool {
|
|
|
|
|
|
|
|
return (bool)(C.QObject_virtualbase_Event(unsafe.Pointer(this.h), event.cPointer()))
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QObject) OnEvent(slot func(super func(event *QEvent) bool, event *QEvent) bool) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QObject_override_virtual_Event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QObject_Event
|
|
|
|
func miqt_exec_callback_QObject_Event(self *C.QObject, cb C.intptr_t, event *C.QEvent) C.bool {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *QEvent) bool, event *QEvent) bool)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-12-07 02:02:06 +00:00
|
|
|
slotval1 := newQEvent(event)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
virtualReturn := gofunc((&QObject{h: self}).callVirtualBase_Event, slotval1)
|
|
|
|
|
|
|
|
return (C.bool)(virtualReturn)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) callVirtualBase_EventFilter(watched *QObject, event *QEvent) bool {
|
|
|
|
|
|
|
|
return (bool)(C.QObject_virtualbase_EventFilter(unsafe.Pointer(this.h), watched.cPointer(), event.cPointer()))
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QObject) OnEventFilter(slot func(super func(watched *QObject, event *QEvent) bool, watched *QObject, event *QEvent) bool) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QObject_override_virtual_EventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QObject_EventFilter
|
|
|
|
func miqt_exec_callback_QObject_EventFilter(self *C.QObject, cb C.intptr_t, watched *C.QObject, event *C.QEvent) C.bool {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(watched *QObject, event *QEvent) bool, watched *QObject, event *QEvent) bool)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-12-07 02:02:06 +00:00
|
|
|
slotval1 := newQObject(watched)
|
|
|
|
|
|
|
|
slotval2 := newQEvent(event)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
virtualReturn := gofunc((&QObject{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
|
|
|
|
|
|
|
|
return (C.bool)(virtualReturn)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) callVirtualBase_TimerEvent(event *QTimerEvent) {
|
|
|
|
|
|
|
|
C.QObject_virtualbase_TimerEvent(unsafe.Pointer(this.h), event.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QObject) OnTimerEvent(slot func(super func(event *QTimerEvent), event *QTimerEvent)) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QObject_override_virtual_TimerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QObject_TimerEvent
|
|
|
|
func miqt_exec_callback_QObject_TimerEvent(self *C.QObject, cb C.intptr_t, event *C.QTimerEvent) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *QTimerEvent), event *QTimerEvent))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-12-07 04:15:57 +00:00
|
|
|
slotval1 := newQTimerEvent(event)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
gofunc((&QObject{h: self}).callVirtualBase_TimerEvent, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) callVirtualBase_ChildEvent(event *QChildEvent) {
|
|
|
|
|
|
|
|
C.QObject_virtualbase_ChildEvent(unsafe.Pointer(this.h), event.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QObject) OnChildEvent(slot func(super func(event *QChildEvent), event *QChildEvent)) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QObject_override_virtual_ChildEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QObject_ChildEvent
|
|
|
|
func miqt_exec_callback_QObject_ChildEvent(self *C.QObject, cb C.intptr_t, event *C.QChildEvent) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *QChildEvent), event *QChildEvent))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-12-07 04:15:57 +00:00
|
|
|
slotval1 := newQChildEvent(event)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
gofunc((&QObject{h: self}).callVirtualBase_ChildEvent, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) callVirtualBase_CustomEvent(event *QEvent) {
|
|
|
|
|
|
|
|
C.QObject_virtualbase_CustomEvent(unsafe.Pointer(this.h), event.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QObject) OnCustomEvent(slot func(super func(event *QEvent), event *QEvent)) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QObject_override_virtual_CustomEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QObject_CustomEvent
|
|
|
|
func miqt_exec_callback_QObject_CustomEvent(self *C.QObject, cb C.intptr_t, event *C.QEvent) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *QEvent), event *QEvent))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-12-07 02:02:06 +00:00
|
|
|
slotval1 := newQEvent(event)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
gofunc((&QObject{h: self}).callVirtualBase_CustomEvent, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) callVirtualBase_ConnectNotify(signal *QMetaMethod) {
|
|
|
|
|
|
|
|
C.QObject_virtualbase_ConnectNotify(unsafe.Pointer(this.h), signal.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QObject) OnConnectNotify(slot func(super func(signal *QMetaMethod), signal *QMetaMethod)) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QObject_override_virtual_ConnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QObject_ConnectNotify
|
|
|
|
func miqt_exec_callback_QObject_ConnectNotify(self *C.QObject, cb C.intptr_t, signal *C.QMetaMethod) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *QMetaMethod), signal *QMetaMethod))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-12-07 02:02:06 +00:00
|
|
|
slotval1 := newQMetaMethod(signal)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
gofunc((&QObject{h: self}).callVirtualBase_ConnectNotify, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QObject) callVirtualBase_DisconnectNotify(signal *QMetaMethod) {
|
|
|
|
|
|
|
|
C.QObject_virtualbase_DisconnectNotify(unsafe.Pointer(this.h), signal.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QObject) OnDisconnectNotify(slot func(super func(signal *QMetaMethod), signal *QMetaMethod)) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QObject_override_virtual_DisconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QObject_DisconnectNotify
|
|
|
|
func miqt_exec_callback_QObject_DisconnectNotify(self *C.QObject, cb C.intptr_t, signal *C.QMetaMethod) {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(signal *QMetaMethod), signal *QMetaMethod))
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-12-07 02:02:06 +00:00
|
|
|
slotval1 := newQMetaMethod(signal)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
gofunc((&QObject{h: self}).callVirtualBase_DisconnectNotify, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-10-20 05:21:03 +00:00
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QObject) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QObject_Delete(this.h, C.bool(this.isSubclass))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QObject) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QObject) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
type QSignalBlocker struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QSignalBlocker
|
|
|
|
isSubclass bool
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSignalBlocker) cPointer() *C.QSignalBlocker {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSignalBlocker) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQSignalBlocker constructs the type using only CGO pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func newQSignalBlocker(h *C.QSignalBlocker) *QSignalBlocker {
|
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
|
2024-10-20 05:21:03 +00:00
|
|
|
return &QSignalBlocker{h: h}
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQSignalBlocker constructs the type using only unsafe pointers.
|
2024-10-20 05:21:03 +00:00
|
|
|
func UnsafeNewQSignalBlocker(h unsafe.Pointer) *QSignalBlocker {
|
2024-12-07 04:15:57 +00:00
|
|
|
return newQSignalBlocker((*C.QSignalBlocker)(h))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSignalBlocker constructs a new QSignalBlocker object.
|
|
|
|
func NewQSignalBlocker(o *QObject) *QSignalBlocker {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQSignalBlocker(C.QSignalBlocker_new(o.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSignalBlocker2 constructs a new QSignalBlocker object.
|
|
|
|
func NewQSignalBlocker2(o *QObject) *QSignalBlocker {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQSignalBlocker(C.QSignalBlocker_new2(o.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSignalBlocker) Reblock() {
|
|
|
|
C.QSignalBlocker_Reblock(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSignalBlocker) Unblock() {
|
|
|
|
C.QSignalBlocker_Unblock(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
// Delete this object from C++ memory.
|
|
|
|
func (this *QSignalBlocker) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QSignalBlocker_Delete(this.h, C.bool(this.isSubclass))
|
2024-10-20 05:21:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// GoGC adds a Go Finalizer to this pointer, so that it will be deleted
|
|
|
|
// from C++ memory once it is unreachable from Go memory.
|
|
|
|
func (this *QSignalBlocker) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QSignalBlocker) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|