2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qabstracteventdispatcher.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"runtime/cgo"
|
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QAbstractEventDispatcher struct {
|
|
|
|
h *C.QAbstractEventDispatcher
|
|
|
|
*QObject
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractEventDispatcher) cPointer() *C.QAbstractEventDispatcher {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQAbstractEventDispatcher(h *C.QAbstractEventDispatcher) *QAbstractEventDispatcher {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QAbstractEventDispatcher{h: h, QObject: newQObject_U(unsafe.Pointer(h))}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQAbstractEventDispatcher_U(h unsafe.Pointer) *QAbstractEventDispatcher {
|
|
|
|
return newQAbstractEventDispatcher((*C.QAbstractEventDispatcher)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractEventDispatcher) MetaObject() *QMetaObject {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQMetaObject_U(unsafe.Pointer(C.QAbstractEventDispatcher_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractEventDispatcher_Tr(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
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))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractEventDispatcher_TrUtf8(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QAbstractEventDispatcher_TrUtf8(s_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractEventDispatcher_Instance() *QAbstractEventDispatcher {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQAbstractEventDispatcher_U(unsafe.Pointer(C.QAbstractEventDispatcher_Instance()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 06:40:03 +00:00
|
|
|
func (this *QAbstractEventDispatcher) ProcessEvents(flags QEventLoop__ProcessEventsFlag) bool {
|
2024-09-18 01:33:50 +00:00
|
|
|
return (bool)(C.QAbstractEventDispatcher_ProcessEvents(this.h, (C.int)(flags)))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QAbstractEventDispatcher) HasPendingEvents() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QAbstractEventDispatcher_HasPendingEvents(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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())
|
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QAbstractEventDispatcher) RegisterTimer(interval int, timerType TimerType, object *QObject) int {
|
2024-09-18 00:12:02 +00:00
|
|
|
return (int)(C.QAbstractEventDispatcher_RegisterTimer(this.h, (C.int)(interval), (C.int)(timerType), object.cPointer()))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QAbstractEventDispatcher) RegisterTimer2(timerId int, interval int, timerType TimerType, object *QObject) {
|
2024-09-18 00:12:02 +00:00
|
|
|
C.QAbstractEventDispatcher_RegisterTimer2(this.h, (C.int)(timerId), (C.int)(interval), (C.int)(timerType), object.cPointer())
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QAbstractEventDispatcher) UnregisterTimer(timerId int) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QAbstractEventDispatcher_UnregisterTimer(this.h, (C.int)(timerId)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractEventDispatcher) UnregisterTimers(object *QObject) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QAbstractEventDispatcher_UnregisterTimers(this.h, object.cPointer()))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QAbstractEventDispatcher) RegisteredTimers(object *QObject) []QAbstractEventDispatcher__TimerInfo {
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ma *C.struct_miqt_array = C.QAbstractEventDispatcher_RegisteredTimers(this.h, object.cPointer())
|
|
|
|
_ret := make([]QAbstractEventDispatcher__TimerInfo, int(_ma.len))
|
2024-09-17 07:30:27 +00:00
|
|
|
_outCast := (*[0xffff]*C.QAbstractEventDispatcher__TimerInfo)(unsafe.Pointer(_ma.data)) // hey ya
|
2024-09-14 22:29:05 +00:00
|
|
|
for i := 0; i < int(_ma.len); i++ {
|
2024-09-17 07:30:27 +00:00
|
|
|
_lv_ret := _outCast[i]
|
|
|
|
_lv_goptr := newQAbstractEventDispatcher__TimerInfo(_lv_ret)
|
|
|
|
_lv_goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer
|
|
|
|
_ret[i] = *_lv_goptr
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
2024-09-14 22:29:05 +00:00
|
|
|
C.free(unsafe.Pointer(_ma))
|
|
|
|
return _ret
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QAbstractEventDispatcher) RemainingTime(timerId int) int {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (int)(C.QAbstractEventDispatcher_RemainingTime(this.h, (C.int)(timerId)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractEventDispatcher) WakeUp() {
|
|
|
|
C.QAbstractEventDispatcher_WakeUp(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractEventDispatcher) Interrupt() {
|
|
|
|
C.QAbstractEventDispatcher_Interrupt(this.h)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractEventDispatcher) Flush() {
|
|
|
|
C.QAbstractEventDispatcher_Flush(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) AboutToBlock() {
|
|
|
|
C.QAbstractEventDispatcher_AboutToBlock(this.h)
|
|
|
|
}
|
|
|
|
func (this *QAbstractEventDispatcher) OnAboutToBlock(slot func()) {
|
2024-09-14 22:29:05 +00:00
|
|
|
C.QAbstractEventDispatcher_connect_AboutToBlock(this.h, unsafe.Pointer(uintptr(cgo.NewHandle(slot))))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QAbstractEventDispatcher_AboutToBlock
|
|
|
|
func miqt_exec_callback_QAbstractEventDispatcher_AboutToBlock(cb *C.void) {
|
|
|
|
gofunc, ok := (cgo.Handle(uintptr(unsafe.Pointer(cb))).Value()).(func())
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
gofunc()
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractEventDispatcher) Awake() {
|
|
|
|
C.QAbstractEventDispatcher_Awake(this.h)
|
|
|
|
}
|
|
|
|
func (this *QAbstractEventDispatcher) OnAwake(slot func()) {
|
2024-09-14 22:29:05 +00:00
|
|
|
C.QAbstractEventDispatcher_connect_Awake(this.h, unsafe.Pointer(uintptr(cgo.NewHandle(slot))))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QAbstractEventDispatcher_Awake
|
|
|
|
func miqt_exec_callback_QAbstractEventDispatcher_Awake(cb *C.void) {
|
|
|
|
gofunc, ok := (cgo.Handle(uintptr(unsafe.Pointer(cb))).Value()).(func())
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
gofunc()
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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))
|
2024-09-14 22:29:05 +00:00
|
|
|
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))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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))
|
2024-09-14 22:29:05 +00:00
|
|
|
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))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractEventDispatcher_TrUtf82(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))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QAbstractEventDispatcher_TrUtf82(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractEventDispatcher_TrUtf83(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))
|
2024-09-14 22:29:05 +00:00
|
|
|
var _ms *C.struct_miqt_string = C.QAbstractEventDispatcher_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(&_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QAbstractEventDispatcher_Instance1(thread *QThread) *QAbstractEventDispatcher {
|
2024-09-17 07:30:27 +00:00
|
|
|
return newQAbstractEventDispatcher_U(unsafe.Pointer(C.QAbstractEventDispatcher_Instance1(thread.cPointer())))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QAbstractEventDispatcher) Delete() {
|
|
|
|
C.QAbstractEventDispatcher_Delete(this.h)
|
|
|
|
}
|
2024-08-29 07:01:51 +00:00
|
|
|
|
2024-09-14 22:29:05 +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)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
type QAbstractEventDispatcher__TimerInfo struct {
|
|
|
|
h *C.QAbstractEventDispatcher__TimerInfo
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QAbstractEventDispatcher__TimerInfo) cPointer() *C.QAbstractEventDispatcher__TimerInfo {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQAbstractEventDispatcher__TimerInfo(h *C.QAbstractEventDispatcher__TimerInfo) *QAbstractEventDispatcher__TimerInfo {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-29 07:01:51 +00:00
|
|
|
return &QAbstractEventDispatcher__TimerInfo{h: h}
|
|
|
|
}
|
|
|
|
|
|
|
|
func newQAbstractEventDispatcher__TimerInfo_U(h unsafe.Pointer) *QAbstractEventDispatcher__TimerInfo {
|
|
|
|
return newQAbstractEventDispatcher__TimerInfo((*C.QAbstractEventDispatcher__TimerInfo)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQAbstractEventDispatcher__TimerInfo constructs a new QAbstractEventDispatcher::TimerInfo object.
|
2024-09-04 06:54:22 +00:00
|
|
|
func NewQAbstractEventDispatcher__TimerInfo(id int, i int, t TimerType) *QAbstractEventDispatcher__TimerInfo {
|
2024-09-18 00:12:02 +00:00
|
|
|
ret := C.QAbstractEventDispatcher__TimerInfo_new((C.int)(id), (C.int)(i), (C.int)(t))
|
2024-08-29 07:01:51 +00:00
|
|
|
return newQAbstractEventDispatcher__TimerInfo(ret)
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-29 07:01:51 +00:00
|
|
|
func (this *QAbstractEventDispatcher__TimerInfo) Delete() {
|
|
|
|
C.QAbstractEventDispatcher__TimerInfo_Delete(this.h)
|
|
|
|
}
|
2024-09-14 22:29:05 +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)
|
|
|
|
})
|
|
|
|
}
|