miqt/qt6/gen_qabstracteventdispatcher.go

280 lines
9.5 KiB
Go
Raw Permalink Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qabstracteventdispatcher.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"runtime/cgo"
"unsafe"
)
type QAbstractEventDispatcher struct {
2024-11-19 06:29:06 +00:00
h *C.QAbstractEventDispatcher
isSubclass bool
2024-10-20 05:21:03 +00:00
*QObject
}
func (this *QAbstractEventDispatcher) cPointer() *C.QAbstractEventDispatcher {
if this == nil {
return nil
}
return this.h
}
func (this *QAbstractEventDispatcher) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQAbstractEventDispatcher constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQAbstractEventDispatcher(h *C.QAbstractEventDispatcher) *QAbstractEventDispatcher {
2024-10-20 05:21:03 +00:00
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
var outptr_QObject *C.QObject = nil
C.QAbstractEventDispatcher_virtbase(h, &outptr_QObject)
2024-11-19 06:29:06 +00:00
return &QAbstractEventDispatcher{h: h,
2024-12-07 04:15:57 +00:00
QObject: newQObject(outptr_QObject)}
2024-10-20 05:21:03 +00:00
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQAbstractEventDispatcher constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQAbstractEventDispatcher(h unsafe.Pointer) *QAbstractEventDispatcher {
return newQAbstractEventDispatcher((*C.QAbstractEventDispatcher)(h))
2024-10-20 05:21:03 +00:00
}
func (this *QAbstractEventDispatcher) MetaObject() *QMetaObject {
return newQMetaObject(C.QAbstractEventDispatcher_MetaObject(this.h))
2024-10-20 05:21:03 +00:00
}
func (this *QAbstractEventDispatcher) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QAbstractEventDispatcher_Metacast(this.h, param1_Cstring))
}
func QAbstractEventDispatcher_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QAbstractEventDispatcher_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QAbstractEventDispatcher_Instance() *QAbstractEventDispatcher {
2024-12-07 04:15:57 +00:00
return newQAbstractEventDispatcher(C.QAbstractEventDispatcher_Instance())
2024-10-20 05:21:03 +00:00
}
func (this *QAbstractEventDispatcher) ProcessEvents(flags QEventLoop__ProcessEventsFlag) bool {
return (bool)(C.QAbstractEventDispatcher_ProcessEvents(this.h, (C.int)(flags)))
}
func (this *QAbstractEventDispatcher) RegisterSocketNotifier(notifier *QSocketNotifier) {
C.QAbstractEventDispatcher_RegisterSocketNotifier(this.h, notifier.cPointer())
}
func (this *QAbstractEventDispatcher) UnregisterSocketNotifier(notifier *QSocketNotifier) {
C.QAbstractEventDispatcher_UnregisterSocketNotifier(this.h, notifier.cPointer())
}
func (this *QAbstractEventDispatcher) RegisterTimer(interval int64, timerType TimerType, object *QObject) int {
return (int)(C.QAbstractEventDispatcher_RegisterTimer(this.h, (C.longlong)(interval), (C.int)(timerType), object.cPointer()))
}
func (this *QAbstractEventDispatcher) RegisterTimer2(timerId int, interval int64, timerType TimerType, object *QObject) {
C.QAbstractEventDispatcher_RegisterTimer2(this.h, (C.int)(timerId), (C.longlong)(interval), (C.int)(timerType), object.cPointer())
}
func (this *QAbstractEventDispatcher) UnregisterTimer(timerId int) bool {
return (bool)(C.QAbstractEventDispatcher_UnregisterTimer(this.h, (C.int)(timerId)))
}
func (this *QAbstractEventDispatcher) UnregisterTimers(object *QObject) bool {
return (bool)(C.QAbstractEventDispatcher_UnregisterTimers(this.h, object.cPointer()))
}
func (this *QAbstractEventDispatcher) RegisteredTimers(object *QObject) []QAbstractEventDispatcher__TimerInfo {
var _ma C.struct_miqt_array = C.QAbstractEventDispatcher_RegisteredTimers(this.h, object.cPointer())
2024-10-20 05:21:03 +00:00
_ret := make([]QAbstractEventDispatcher__TimerInfo, int(_ma.len))
_outCast := (*[0xffff]*C.QAbstractEventDispatcher__TimerInfo)(unsafe.Pointer(_ma.data)) // hey ya
for i := 0; i < int(_ma.len); i++ {
_lv_goptr := newQAbstractEventDispatcher__TimerInfo(_outCast[i])
2024-10-20 05:21:03 +00:00
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
_ret[i] = *_lv_goptr
}
return _ret
}
func (this *QAbstractEventDispatcher) RemainingTime(timerId int) int {
return (int)(C.QAbstractEventDispatcher_RemainingTime(this.h, (C.int)(timerId)))
}
func (this *QAbstractEventDispatcher) WakeUp() {
C.QAbstractEventDispatcher_WakeUp(this.h)
}
func (this *QAbstractEventDispatcher) Interrupt() {
C.QAbstractEventDispatcher_Interrupt(this.h)
}
func (this *QAbstractEventDispatcher) StartingUp() {
C.QAbstractEventDispatcher_StartingUp(this.h)
}
func (this *QAbstractEventDispatcher) ClosingDown() {
C.QAbstractEventDispatcher_ClosingDown(this.h)
}
func (this *QAbstractEventDispatcher) InstallNativeEventFilter(filterObj *QAbstractNativeEventFilter) {
C.QAbstractEventDispatcher_InstallNativeEventFilter(this.h, filterObj.cPointer())
}
func (this *QAbstractEventDispatcher) RemoveNativeEventFilter(filterObj *QAbstractNativeEventFilter) {
C.QAbstractEventDispatcher_RemoveNativeEventFilter(this.h, filterObj.cPointer())
}
func (this *QAbstractEventDispatcher) FilterNativeEvent(eventType []byte, message unsafe.Pointer, result *uintptr) bool {
eventType_alias := C.struct_miqt_string{}
eventType_alias.data = (*C.char)(unsafe.Pointer(&eventType[0]))
eventType_alias.len = C.size_t(len(eventType))
return (bool)(C.QAbstractEventDispatcher_FilterNativeEvent(this.h, eventType_alias, message, (*C.intptr_t)(unsafe.Pointer(result))))
}
func (this *QAbstractEventDispatcher) AboutToBlock() {
C.QAbstractEventDispatcher_AboutToBlock(this.h)
}
func (this *QAbstractEventDispatcher) OnAboutToBlock(slot func()) {
C.QAbstractEventDispatcher_connect_AboutToBlock(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QAbstractEventDispatcher_AboutToBlock
func miqt_exec_callback_QAbstractEventDispatcher_AboutToBlock(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 *QAbstractEventDispatcher) Awake() {
C.QAbstractEventDispatcher_Awake(this.h)
}
func (this *QAbstractEventDispatcher) OnAwake(slot func()) {
C.QAbstractEventDispatcher_connect_Awake(this.h, C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QAbstractEventDispatcher_Awake
func miqt_exec_callback_QAbstractEventDispatcher_Awake(cb C.intptr_t) {
gofunc, ok := cgo.Handle(cb).Value().(func())
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
gofunc()
}
func QAbstractEventDispatcher_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.QAbstractEventDispatcher_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QAbstractEventDispatcher_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.QAbstractEventDispatcher_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 QAbstractEventDispatcher_Instance1(thread *QThread) *QAbstractEventDispatcher {
2024-12-07 04:15:57 +00:00
return newQAbstractEventDispatcher(C.QAbstractEventDispatcher_Instance1(thread.cPointer()))
2024-10-20 05:21:03 +00:00
}
// Delete this object from C++ memory.
func (this *QAbstractEventDispatcher) Delete() {
2024-11-19 06:29:06 +00:00
C.QAbstractEventDispatcher_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 *QAbstractEventDispatcher) GoGC() {
runtime.SetFinalizer(this, func(this *QAbstractEventDispatcher) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
type QAbstractEventDispatcher__TimerInfo struct {
2024-11-19 06:29:06 +00:00
h *C.QAbstractEventDispatcher__TimerInfo
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QAbstractEventDispatcher__TimerInfo) cPointer() *C.QAbstractEventDispatcher__TimerInfo {
if this == nil {
return nil
}
return this.h
}
func (this *QAbstractEventDispatcher__TimerInfo) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQAbstractEventDispatcher__TimerInfo constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQAbstractEventDispatcher__TimerInfo(h *C.QAbstractEventDispatcher__TimerInfo) *QAbstractEventDispatcher__TimerInfo {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 05:21:03 +00:00
return &QAbstractEventDispatcher__TimerInfo{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQAbstractEventDispatcher__TimerInfo constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQAbstractEventDispatcher__TimerInfo(h unsafe.Pointer) *QAbstractEventDispatcher__TimerInfo {
2024-12-07 04:15:57 +00:00
return newQAbstractEventDispatcher__TimerInfo((*C.QAbstractEventDispatcher__TimerInfo)(h))
2024-10-20 05:21:03 +00:00
}
// NewQAbstractEventDispatcher__TimerInfo constructs a new QAbstractEventDispatcher::TimerInfo object.
func NewQAbstractEventDispatcher__TimerInfo(id int, i int, t TimerType) *QAbstractEventDispatcher__TimerInfo {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQAbstractEventDispatcher__TimerInfo(C.QAbstractEventDispatcher__TimerInfo_new((C.int)(id), (C.int)(i), (C.int)(t)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// Delete this object from C++ memory.
func (this *QAbstractEventDispatcher__TimerInfo) Delete() {
2024-11-19 06:29:06 +00:00
C.QAbstractEventDispatcher__TimerInfo_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 *QAbstractEventDispatcher__TimerInfo) GoGC() {
runtime.SetFinalizer(this, func(this *QAbstractEventDispatcher__TimerInfo) {
this.Delete()
runtime.KeepAlive(this.h)
})
}