2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qsocketnotifier.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-01 05:50:58 +00:00
|
|
|
"runtime"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
type QSocketNotifier__Type int
|
|
|
|
|
|
|
|
const (
|
2024-09-20 07:13:26 +00:00
|
|
|
QSocketNotifier__Read QSocketNotifier__Type = 0
|
|
|
|
QSocketNotifier__Write QSocketNotifier__Type = 1
|
|
|
|
QSocketNotifier__Exception QSocketNotifier__Type = 2
|
2024-09-04 06:54:22 +00:00
|
|
|
)
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QSocketNotifier struct {
|
|
|
|
h *C.QSocketNotifier
|
|
|
|
*QObject
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSocketNotifier) cPointer() *C.QSocketNotifier {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QSocketNotifier) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQSocketNotifier(h *C.QSocketNotifier) *QSocketNotifier {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-10-16 05:07:56 +00:00
|
|
|
return &QSocketNotifier{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQSocketNotifier(h unsafe.Pointer) *QSocketNotifier {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQSocketNotifier((*C.QSocketNotifier)(h))
|
|
|
|
}
|
|
|
|
|
2024-08-29 07:01:51 +00:00
|
|
|
// NewQSocketNotifier constructs a new QSocketNotifier object.
|
2024-09-07 03:31:00 +00:00
|
|
|
func NewQSocketNotifier(socket uintptr, param2 QSocketNotifier__Type) *QSocketNotifier {
|
2024-09-18 01:43:25 +00:00
|
|
|
ret := C.QSocketNotifier_new((C.intptr_t)(socket), (C.int)(param2))
|
2024-08-29 07:01:51 +00:00
|
|
|
return newQSocketNotifier(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSocketNotifier2 constructs a new QSocketNotifier object.
|
2024-09-07 03:31:00 +00:00
|
|
|
func NewQSocketNotifier2(socket uintptr, param2 QSocketNotifier__Type, parent *QObject) *QSocketNotifier {
|
2024-09-18 01:43:25 +00:00
|
|
|
ret := C.QSocketNotifier_new2((C.intptr_t)(socket), (C.int)(param2), parent.cPointer())
|
2024-08-29 07:01:51 +00:00
|
|
|
return newQSocketNotifier(ret)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QSocketNotifier) MetaObject() *QMetaObject {
|
2024-10-16 05:07:56 +00:00
|
|
|
return UnsafeNewQMetaObject(unsafe.Pointer(C.QSocketNotifier_MetaObject(this.h)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
func (this *QSocketNotifier) Metacast(param1 string) unsafe.Pointer {
|
|
|
|
param1_Cstring := C.CString(param1)
|
|
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
|
|
|
return C.QSocketNotifier_Metacast(this.h, param1_Cstring)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QSocketNotifier_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.QSocketNotifier_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 QSocketNotifier_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.QSocketNotifier_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
|
|
|
}
|
|
|
|
|
2024-09-18 00:12:02 +00:00
|
|
|
func (this *QSocketNotifier) Socket() uintptr {
|
|
|
|
return (uintptr)(C.QSocketNotifier_Socket(this.h))
|
2024-08-29 07:01:51 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 06:54:22 +00:00
|
|
|
func (this *QSocketNotifier) Type() QSocketNotifier__Type {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (QSocketNotifier__Type)(C.QSocketNotifier_Type(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSocketNotifier) IsEnabled() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QSocketNotifier_IsEnabled(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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))
|
2024-09-14 22:29:05 +00:00
|
|
|
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))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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))
|
2024-09-14 22:29:05 +00:00
|
|
|
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))
|
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QSocketNotifier_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.QSocketNotifier_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 QSocketNotifier_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.QSocketNotifier_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
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QSocketNotifier) Delete() {
|
|
|
|
C.QSocketNotifier_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 *QSocketNotifier) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QSocketNotifier) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
type QSocketDescriptor struct {
|
|
|
|
h *C.QSocketDescriptor
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSocketDescriptor) cPointer() *C.QSocketDescriptor {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QSocketDescriptor) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func newQSocketDescriptor(h *C.QSocketDescriptor) *QSocketDescriptor {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
return &QSocketDescriptor{h: h}
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func UnsafeNewQSocketDescriptor(h unsafe.Pointer) *QSocketDescriptor {
|
2024-08-25 04:08:24 +00:00
|
|
|
return newQSocketDescriptor((*C.QSocketDescriptor)(h))
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSocketDescriptor constructs a new QSocketDescriptor object.
|
2024-08-29 07:01:51 +00:00
|
|
|
func NewQSocketDescriptor() *QSocketDescriptor {
|
|
|
|
ret := C.QSocketDescriptor_new()
|
|
|
|
return newQSocketDescriptor(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSocketDescriptor2 constructs a new QSocketDescriptor object.
|
|
|
|
func NewQSocketDescriptor2(param1 *QSocketDescriptor) *QSocketDescriptor {
|
|
|
|
ret := C.QSocketDescriptor_new2(param1.cPointer())
|
|
|
|
return newQSocketDescriptor(ret)
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewQSocketDescriptor3 constructs a new QSocketDescriptor object.
|
2024-10-11 05:43:04 +00:00
|
|
|
func NewQSocketDescriptor3(descriptor int) *QSocketDescriptor {
|
2024-09-01 05:50:58 +00:00
|
|
|
if runtime.GOOS == "linux" {
|
2024-09-18 00:12:02 +00:00
|
|
|
ret := C.QSocketDescriptor_new3((C.int)(descriptor))
|
2024-09-01 05:50:58 +00:00
|
|
|
return newQSocketDescriptor(ret)
|
|
|
|
} else {
|
|
|
|
panic("Unsupported OS")
|
|
|
|
}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QSocketDescriptor) IsValid() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QSocketDescriptor_IsValid(this.h))
|
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 *QSocketDescriptor) Delete() {
|
|
|
|
C.QSocketDescriptor_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 *QSocketDescriptor) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QSocketDescriptor) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|