miqt/qt6/gen_qgenericplugin.go
2024-10-21 19:10:31 +13:00

112 lines
2.9 KiB
Go

package qt6
/*
#include "gen_qgenericplugin.h"
#include <stdlib.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
type QGenericPlugin struct {
h *C.QGenericPlugin
*QObject
}
func (this *QGenericPlugin) cPointer() *C.QGenericPlugin {
if this == nil {
return nil
}
return this.h
}
func (this *QGenericPlugin) UnsafePointer() unsafe.Pointer {
if this == nil {
return nil
}
return unsafe.Pointer(this.h)
}
func newQGenericPlugin(h *C.QGenericPlugin) *QGenericPlugin {
if h == nil {
return nil
}
return &QGenericPlugin{h: h, QObject: UnsafeNewQObject(unsafe.Pointer(h))}
}
func UnsafeNewQGenericPlugin(h unsafe.Pointer) *QGenericPlugin {
return newQGenericPlugin((*C.QGenericPlugin)(h))
}
func (this *QGenericPlugin) MetaObject() *QMetaObject {
return UnsafeNewQMetaObject(unsafe.Pointer(C.QGenericPlugin_MetaObject(this.h)))
}
func (this *QGenericPlugin) Metacast(param1 string) unsafe.Pointer {
param1_Cstring := C.CString(param1)
defer C.free(unsafe.Pointer(param1_Cstring))
return (unsafe.Pointer)(C.QGenericPlugin_Metacast(this.h, param1_Cstring))
}
func QGenericPlugin_Tr(s string) string {
s_Cstring := C.CString(s)
defer C.free(unsafe.Pointer(s_Cstring))
var _ms C.struct_miqt_string = C.QGenericPlugin_Tr(s_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func (this *QGenericPlugin) Create(name string, spec string) *QObject {
name_ms := C.struct_miqt_string{}
name_ms.data = C.CString(name)
name_ms.len = C.size_t(len(name))
defer C.free(unsafe.Pointer(name_ms.data))
spec_ms := C.struct_miqt_string{}
spec_ms.data = C.CString(spec)
spec_ms.len = C.size_t(len(spec))
defer C.free(unsafe.Pointer(spec_ms.data))
return UnsafeNewQObject(unsafe.Pointer(C.QGenericPlugin_Create(this.h, name_ms, spec_ms)))
}
func QGenericPlugin_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.QGenericPlugin_Tr2(s_Cstring, c_Cstring)
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
C.free(unsafe.Pointer(_ms.data))
return _ret
}
func QGenericPlugin_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.QGenericPlugin_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
}
// Delete this object from C++ memory.
func (this *QGenericPlugin) Delete() {
C.QGenericPlugin_Delete(this.h)
}
// 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 *QGenericPlugin) GoGC() {
runtime.SetFinalizer(this, func(this *QGenericPlugin) {
this.Delete()
runtime.KeepAlive(this.h)
})
}