miqt/qt6/gen_qsocketnotifier.go

439 lines
14 KiB
Go
Raw Permalink Normal View History

2024-10-20 05:21:03 +00:00
package qt6
/*
#include "gen_qsocketnotifier.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
2024-11-19 06:29:06 +00:00
"runtime/cgo"
2024-10-20 05:21:03 +00:00
"unsafe"
)
type QSocketNotifier__Type int
const (
QSocketNotifier__Read QSocketNotifier__Type = 0
QSocketNotifier__Write QSocketNotifier__Type = 1
QSocketNotifier__Exception QSocketNotifier__Type = 2
)
type QSocketNotifier struct {
2024-11-19 06:29:06 +00:00
h *C.QSocketNotifier
isSubclass bool
2024-10-20 05:21:03 +00:00
*QObject
}
func (this *QSocketNotifier) cPointer() *C.QSocketNotifier {
if this == nil {
return nil
}
return this.h
}
func (this *QSocketNotifier) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQSocketNotifier constructs the type using only CGO pointers.
2024-12-07 04:15:57 +00:00
func newQSocketNotifier(h *C.QSocketNotifier) *QSocketNotifier {
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.QSocketNotifier_virtbase(h, &outptr_QObject)
2024-11-19 06:29:06 +00:00
return &QSocketNotifier{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
// UnsafeNewQSocketNotifier constructs the type using only unsafe pointers.
2024-12-07 04:15:57 +00:00
func UnsafeNewQSocketNotifier(h unsafe.Pointer) *QSocketNotifier {
return newQSocketNotifier((*C.QSocketNotifier)(h))
2024-10-20 05:21:03 +00:00
}
// NewQSocketNotifier constructs a new QSocketNotifier object.
func NewQSocketNotifier(param1 QSocketNotifier__Type) *QSocketNotifier {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSocketNotifier(C.QSocketNotifier_new((C.int)(param1)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQSocketNotifier2 constructs a new QSocketNotifier object.
func NewQSocketNotifier2(socket uintptr, param2 QSocketNotifier__Type) *QSocketNotifier {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSocketNotifier(C.QSocketNotifier_new2((C.intptr_t)(socket), (C.int)(param2)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQSocketNotifier3 constructs a new QSocketNotifier object.
func NewQSocketNotifier3(param1 QSocketNotifier__Type, parent *QObject) *QSocketNotifier {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSocketNotifier(C.QSocketNotifier_new3((C.int)(param1), parent.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQSocketNotifier4 constructs a new QSocketNotifier object.
func NewQSocketNotifier4(socket uintptr, param2 QSocketNotifier__Type, parent *QObject) *QSocketNotifier {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSocketNotifier(C.QSocketNotifier_new4((C.intptr_t)(socket), (C.int)(param2), 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 *QSocketNotifier) MetaObject() *QMetaObject {
return newQMetaObject(C.QSocketNotifier_MetaObject(this.h))
2024-10-20 05:21:03 +00:00
}
func (this *QSocketNotifier) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QSocketNotifier_Metacast(this.h, param1_Cstring))
}
func QSocketNotifier_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QSocketNotifier_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QSocketNotifier) SetSocket(socket uintptr) {
C.QSocketNotifier_SetSocket(this.h, (C.intptr_t)(socket))
}
func (this *QSocketNotifier) Socket() uintptr {
return (uintptr)(C.QSocketNotifier_Socket(this.h))
}
func (this *QSocketNotifier) Type() QSocketNotifier__Type {
return (QSocketNotifier__Type)(C.QSocketNotifier_Type(this.h))
}
func (this *QSocketNotifier) IsValid() bool {
return (bool)(C.QSocketNotifier_IsValid(this.h))
}
func (this *QSocketNotifier) IsEnabled() bool {
return (bool)(C.QSocketNotifier_IsEnabled(this.h))
}
func (this *QSocketNotifier) SetEnabled(enabled bool) {
C.QSocketNotifier_SetEnabled(this.h, (C.bool)(enabled))
}
func QSocketNotifier_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.QSocketNotifier_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QSocketNotifier_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.QSocketNotifier_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
}
2024-11-19 06:29:06 +00:00
func (this *QSocketNotifier) callVirtualBase_Event(param1 *QEvent) bool {
return (bool)(C.QSocketNotifier_virtualbase_Event(unsafe.Pointer(this.h), param1.cPointer()))
}
func (this *QSocketNotifier) OnEvent(slot func(super func(param1 *QEvent) bool, param1 *QEvent) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSocketNotifier_override_virtual_Event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSocketNotifier_Event
func miqt_exec_callback_QSocketNotifier_Event(self *C.QSocketNotifier, cb C.intptr_t, param1 *C.QEvent) C.bool {
gofunc, ok := cgo.Handle(cb).Value().(func(super func(param1 *QEvent) bool, param1 *QEvent) bool)
if !ok {
panic("miqt: callback of non-callback type (heap corruption?)")
}
// Convert all CABI parameters to Go parameters
slotval1 := newQEvent(param1)
2024-11-19 06:29:06 +00:00
virtualReturn := gofunc((&QSocketNotifier{h: self}).callVirtualBase_Event, slotval1)
return (C.bool)(virtualReturn)
}
func (this *QSocketNotifier) callVirtualBase_EventFilter(watched *QObject, event *QEvent) bool {
return (bool)(C.QSocketNotifier_virtualbase_EventFilter(unsafe.Pointer(this.h), watched.cPointer(), event.cPointer()))
}
func (this *QSocketNotifier) OnEventFilter(slot func(super func(watched *QObject, event *QEvent) bool, watched *QObject, event *QEvent) bool) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSocketNotifier_override_virtual_EventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSocketNotifier_EventFilter
func miqt_exec_callback_QSocketNotifier_EventFilter(self *C.QSocketNotifier, 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
slotval1 := newQObject(watched)
slotval2 := newQEvent(event)
2024-11-19 06:29:06 +00:00
virtualReturn := gofunc((&QSocketNotifier{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
return (C.bool)(virtualReturn)
}
func (this *QSocketNotifier) callVirtualBase_TimerEvent(event *QTimerEvent) {
C.QSocketNotifier_virtualbase_TimerEvent(unsafe.Pointer(this.h), event.cPointer())
}
func (this *QSocketNotifier) OnTimerEvent(slot func(super func(event *QTimerEvent), event *QTimerEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSocketNotifier_override_virtual_TimerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSocketNotifier_TimerEvent
func miqt_exec_callback_QSocketNotifier_TimerEvent(self *C.QSocketNotifier, 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((&QSocketNotifier{h: self}).callVirtualBase_TimerEvent, slotval1)
}
func (this *QSocketNotifier) callVirtualBase_ChildEvent(event *QChildEvent) {
C.QSocketNotifier_virtualbase_ChildEvent(unsafe.Pointer(this.h), event.cPointer())
}
func (this *QSocketNotifier) OnChildEvent(slot func(super func(event *QChildEvent), event *QChildEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSocketNotifier_override_virtual_ChildEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSocketNotifier_ChildEvent
func miqt_exec_callback_QSocketNotifier_ChildEvent(self *C.QSocketNotifier, 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((&QSocketNotifier{h: self}).callVirtualBase_ChildEvent, slotval1)
}
func (this *QSocketNotifier) callVirtualBase_CustomEvent(event *QEvent) {
C.QSocketNotifier_virtualbase_CustomEvent(unsafe.Pointer(this.h), event.cPointer())
}
func (this *QSocketNotifier) OnCustomEvent(slot func(super func(event *QEvent), event *QEvent)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSocketNotifier_override_virtual_CustomEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSocketNotifier_CustomEvent
func miqt_exec_callback_QSocketNotifier_CustomEvent(self *C.QSocketNotifier, 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
slotval1 := newQEvent(event)
2024-11-19 06:29:06 +00:00
gofunc((&QSocketNotifier{h: self}).callVirtualBase_CustomEvent, slotval1)
}
func (this *QSocketNotifier) callVirtualBase_ConnectNotify(signal *QMetaMethod) {
C.QSocketNotifier_virtualbase_ConnectNotify(unsafe.Pointer(this.h), signal.cPointer())
}
func (this *QSocketNotifier) OnConnectNotify(slot func(super func(signal *QMetaMethod), signal *QMetaMethod)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSocketNotifier_override_virtual_ConnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSocketNotifier_ConnectNotify
func miqt_exec_callback_QSocketNotifier_ConnectNotify(self *C.QSocketNotifier, 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
slotval1 := newQMetaMethod(signal)
2024-11-19 06:29:06 +00:00
gofunc((&QSocketNotifier{h: self}).callVirtualBase_ConnectNotify, slotval1)
}
func (this *QSocketNotifier) callVirtualBase_DisconnectNotify(signal *QMetaMethod) {
C.QSocketNotifier_virtualbase_DisconnectNotify(unsafe.Pointer(this.h), signal.cPointer())
}
func (this *QSocketNotifier) OnDisconnectNotify(slot func(super func(signal *QMetaMethod), signal *QMetaMethod)) {
if !this.isSubclass {
panic("miqt: can only override virtual methods for directly constructed types")
}
2024-11-19 06:29:06 +00:00
C.QSocketNotifier_override_virtual_DisconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
}
//export miqt_exec_callback_QSocketNotifier_DisconnectNotify
func miqt_exec_callback_QSocketNotifier_DisconnectNotify(self *C.QSocketNotifier, 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
slotval1 := newQMetaMethod(signal)
2024-11-19 06:29:06 +00:00
gofunc((&QSocketNotifier{h: self}).callVirtualBase_DisconnectNotify, slotval1)
}
2024-10-20 05:21:03 +00:00
// Delete this object from C++ memory.
func (this *QSocketNotifier) Delete() {
2024-11-19 06:29:06 +00:00
C.QSocketNotifier_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 *QSocketNotifier) GoGC() {
runtime.SetFinalizer(this, func(this *QSocketNotifier) {
this.Delete()
runtime.KeepAlive(this.h)
})
}
type QSocketDescriptor struct {
2024-11-19 06:29:06 +00:00
h *C.QSocketDescriptor
isSubclass bool
2024-10-20 05:21:03 +00:00
}
func (this *QSocketDescriptor) cPointer() *C.QSocketDescriptor {
if this == nil {
return nil
}
return this.h
}
func (this *QSocketDescriptor) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
2024-11-19 06:29:06 +00:00
// newQSocketDescriptor constructs the type using only CGO pointers.
2024-10-20 05:21:03 +00:00
func newQSocketDescriptor(h *C.QSocketDescriptor) *QSocketDescriptor {
if h == nil {
return nil
}
2024-12-07 04:15:57 +00:00
2024-10-20 05:21:03 +00:00
return &QSocketDescriptor{h: h}
}
2024-11-19 06:29:06 +00:00
// UnsafeNewQSocketDescriptor constructs the type using only unsafe pointers.
2024-10-20 05:21:03 +00:00
func UnsafeNewQSocketDescriptor(h unsafe.Pointer) *QSocketDescriptor {
2024-12-07 04:15:57 +00:00
return newQSocketDescriptor((*C.QSocketDescriptor)(h))
2024-10-20 05:21:03 +00:00
}
// NewQSocketDescriptor constructs a new QSocketDescriptor object.
func NewQSocketDescriptor() *QSocketDescriptor {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSocketDescriptor(C.QSocketDescriptor_new())
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQSocketDescriptor2 constructs a new QSocketDescriptor object.
func NewQSocketDescriptor2(param1 *QSocketDescriptor) *QSocketDescriptor {
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSocketDescriptor(C.QSocketDescriptor_new2(param1.cPointer()))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
// NewQSocketDescriptor3 constructs a new QSocketDescriptor object.
func NewQSocketDescriptor3(descriptor int) *QSocketDescriptor {
2024-11-19 06:29:06 +00:00
if runtime.GOOS != "linux" {
2024-10-20 05:21:03 +00:00
panic("Unsupported OS")
}
2024-11-19 06:29:06 +00:00
2024-12-07 04:15:57 +00:00
ret := newQSocketDescriptor(C.QSocketDescriptor_new3((C.int)(descriptor)))
2024-11-19 06:29:06 +00:00
ret.isSubclass = true
return ret
2024-10-20 05:21:03 +00:00
}
func (this *QSocketDescriptor) IsValid() bool {
return (bool)(C.QSocketDescriptor_IsValid(this.h))
}
// Delete this object from C++ memory.
func (this *QSocketDescriptor) Delete() {
2024-11-19 06:29:06 +00:00
C.QSocketDescriptor_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 *QSocketDescriptor) GoGC() {
runtime.SetFinalizer(this, func(this *QSocketDescriptor) {
this.Delete()
runtime.KeepAlive(this.h)
})
}