2024-08-25 04:08:24 +00:00
|
|
|
package qt
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
#include "gen_qtranslator.h"
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import (
|
2024-09-14 22:29:05 +00:00
|
|
|
"runtime"
|
2024-11-19 06:29:06 +00:00
|
|
|
"runtime/cgo"
|
2024-08-25 04:08:24 +00:00
|
|
|
"unsafe"
|
|
|
|
)
|
|
|
|
|
|
|
|
type QTranslator struct {
|
2024-11-19 06:29:06 +00:00
|
|
|
h *C.QTranslator
|
|
|
|
isSubclass bool
|
2024-08-25 04:08:24 +00:00
|
|
|
*QObject
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) cPointer() *C.QTranslator {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return this.h
|
|
|
|
}
|
|
|
|
|
2024-10-16 05:07:56 +00:00
|
|
|
func (this *QTranslator) UnsafePointer() unsafe.Pointer {
|
|
|
|
if this == nil {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
return unsafe.Pointer(this.h)
|
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// newQTranslator constructs the type using only CGO pointers.
|
2024-12-07 04:15:57 +00:00
|
|
|
func newQTranslator(h *C.QTranslator) *QTranslator {
|
2024-09-01 02:23:55 +00:00
|
|
|
if h == nil {
|
|
|
|
return nil
|
|
|
|
}
|
2024-12-07 04:15:57 +00:00
|
|
|
var outptr_QObject *C.QObject = nil
|
|
|
|
C.QTranslator_virtbase(h, &outptr_QObject)
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
return &QTranslator{h: h,
|
2024-12-07 04:15:57 +00:00
|
|
|
QObject: newQObject(outptr_QObject)}
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
// UnsafeNewQTranslator constructs the type using only unsafe pointers.
|
2024-12-07 04:15:57 +00:00
|
|
|
func UnsafeNewQTranslator(h unsafe.Pointer) *QTranslator {
|
|
|
|
return newQTranslator((*C.QTranslator)(h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTranslator constructs a new QTranslator object.
|
|
|
|
func NewQTranslator() *QTranslator {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQTranslator(C.QTranslator_new())
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// NewQTranslator2 constructs a new QTranslator object.
|
|
|
|
func NewQTranslator2(parent *QObject) *QTranslator {
|
2024-11-19 06:29:06 +00:00
|
|
|
|
2024-12-07 04:15:57 +00:00
|
|
|
ret := newQTranslator(C.QTranslator_new2(parent.cPointer()))
|
2024-11-19 06:29:06 +00:00
|
|
|
ret.isSubclass = true
|
|
|
|
return ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) MetaObject() *QMetaObject {
|
2024-12-07 02:02:06 +00:00
|
|
|
return newQMetaObject(C.QTranslator_MetaObject(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-09-20 22:32:57 +00:00
|
|
|
func (this *QTranslator) Metacast(param1 string) unsafe.Pointer {
|
|
|
|
param1_Cstring := C.CString(param1)
|
|
|
|
defer C.free(unsafe.Pointer(param1_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
return (unsafe.Pointer)(C.QTranslator_Metacast(this.h, param1_Cstring))
|
2024-09-20 22:32:57 +00:00
|
|
|
}
|
|
|
|
|
2024-08-25 04:08:24 +00:00
|
|
|
func QTranslator_Tr(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTranslator_Tr(s_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QTranslator_TrUtf8(s string) string {
|
|
|
|
s_Cstring := C.CString(s)
|
|
|
|
defer C.free(unsafe.Pointer(s_Cstring))
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTranslator_TrUtf8(s_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
func (this *QTranslator) Translate(context string, sourceText string, disambiguation string, n int) string {
|
2024-08-25 04:08:24 +00:00
|
|
|
context_Cstring := C.CString(context)
|
|
|
|
defer C.free(unsafe.Pointer(context_Cstring))
|
|
|
|
sourceText_Cstring := C.CString(sourceText)
|
|
|
|
defer C.free(unsafe.Pointer(sourceText_Cstring))
|
2024-11-19 06:29:06 +00:00
|
|
|
disambiguation_Cstring := C.CString(disambiguation)
|
|
|
|
defer C.free(unsafe.Pointer(disambiguation_Cstring))
|
|
|
|
var _ms C.struct_miqt_string = C.QTranslator_Translate(this.h, context_Cstring, sourceText_Cstring, disambiguation_Cstring, (C.int)(n))
|
2024-10-18 23:53:33 +00:00
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) IsEmpty() bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTranslator_IsEmpty(this.h))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) Language() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTranslator_Language(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) FilePath() string {
|
2024-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTranslator_FilePath(this.h)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) Load(filename string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
filename_ms := C.struct_miqt_string{}
|
|
|
|
filename_ms.data = C.CString(filename)
|
|
|
|
filename_ms.len = C.size_t(len(filename))
|
|
|
|
defer C.free(unsafe.Pointer(filename_ms.data))
|
|
|
|
return (bool)(C.QTranslator_Load(this.h, filename_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) Load2(locale *QLocale, filename string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
filename_ms := C.struct_miqt_string{}
|
|
|
|
filename_ms.data = C.CString(filename)
|
|
|
|
filename_ms.len = C.size_t(len(filename))
|
|
|
|
defer C.free(unsafe.Pointer(filename_ms.data))
|
|
|
|
return (bool)(C.QTranslator_Load2(this.h, locale.cPointer(), filename_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) Load3(data *byte, lenVal int) bool {
|
2024-09-17 07:30:27 +00:00
|
|
|
return (bool)(C.QTranslator_Load3(this.h, (*C.uchar)(unsafe.Pointer(data)), (C.int)(lenVal)))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QTranslator_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTranslator_Tr2(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QTranslator_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTranslator_Tr3(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QTranslator_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTranslator_TrUtf82(s_Cstring, c_Cstring)
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func QTranslator_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-10-18 23:53:33 +00:00
|
|
|
var _ms C.struct_miqt_string = C.QTranslator_TrUtf83(s_Cstring, c_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
2024-09-14 22:29:05 +00:00
|
|
|
return _ret
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) Load22(filename string, directory string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
filename_ms := C.struct_miqt_string{}
|
|
|
|
filename_ms.data = C.CString(filename)
|
|
|
|
filename_ms.len = C.size_t(len(filename))
|
|
|
|
defer C.free(unsafe.Pointer(filename_ms.data))
|
|
|
|
directory_ms := C.struct_miqt_string{}
|
|
|
|
directory_ms.data = C.CString(directory)
|
|
|
|
directory_ms.len = C.size_t(len(directory))
|
|
|
|
defer C.free(unsafe.Pointer(directory_ms.data))
|
|
|
|
return (bool)(C.QTranslator_Load22(this.h, filename_ms, directory_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) Load32(filename string, directory string, search_delimiters string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
filename_ms := C.struct_miqt_string{}
|
|
|
|
filename_ms.data = C.CString(filename)
|
|
|
|
filename_ms.len = C.size_t(len(filename))
|
|
|
|
defer C.free(unsafe.Pointer(filename_ms.data))
|
|
|
|
directory_ms := C.struct_miqt_string{}
|
|
|
|
directory_ms.data = C.CString(directory)
|
|
|
|
directory_ms.len = C.size_t(len(directory))
|
|
|
|
defer C.free(unsafe.Pointer(directory_ms.data))
|
|
|
|
search_delimiters_ms := C.struct_miqt_string{}
|
|
|
|
search_delimiters_ms.data = C.CString(search_delimiters)
|
|
|
|
search_delimiters_ms.len = C.size_t(len(search_delimiters))
|
|
|
|
defer C.free(unsafe.Pointer(search_delimiters_ms.data))
|
|
|
|
return (bool)(C.QTranslator_Load32(this.h, filename_ms, directory_ms, search_delimiters_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) Load4(filename string, directory string, search_delimiters string, suffix string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
filename_ms := C.struct_miqt_string{}
|
|
|
|
filename_ms.data = C.CString(filename)
|
|
|
|
filename_ms.len = C.size_t(len(filename))
|
|
|
|
defer C.free(unsafe.Pointer(filename_ms.data))
|
|
|
|
directory_ms := C.struct_miqt_string{}
|
|
|
|
directory_ms.data = C.CString(directory)
|
|
|
|
directory_ms.len = C.size_t(len(directory))
|
|
|
|
defer C.free(unsafe.Pointer(directory_ms.data))
|
|
|
|
search_delimiters_ms := C.struct_miqt_string{}
|
|
|
|
search_delimiters_ms.data = C.CString(search_delimiters)
|
|
|
|
search_delimiters_ms.len = C.size_t(len(search_delimiters))
|
|
|
|
defer C.free(unsafe.Pointer(search_delimiters_ms.data))
|
|
|
|
suffix_ms := C.struct_miqt_string{}
|
|
|
|
suffix_ms.data = C.CString(suffix)
|
|
|
|
suffix_ms.len = C.size_t(len(suffix))
|
|
|
|
defer C.free(unsafe.Pointer(suffix_ms.data))
|
|
|
|
return (bool)(C.QTranslator_Load4(this.h, filename_ms, directory_ms, search_delimiters_ms, suffix_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) Load33(locale *QLocale, filename string, prefix string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
filename_ms := C.struct_miqt_string{}
|
|
|
|
filename_ms.data = C.CString(filename)
|
|
|
|
filename_ms.len = C.size_t(len(filename))
|
|
|
|
defer C.free(unsafe.Pointer(filename_ms.data))
|
|
|
|
prefix_ms := C.struct_miqt_string{}
|
|
|
|
prefix_ms.data = C.CString(prefix)
|
|
|
|
prefix_ms.len = C.size_t(len(prefix))
|
|
|
|
defer C.free(unsafe.Pointer(prefix_ms.data))
|
|
|
|
return (bool)(C.QTranslator_Load33(this.h, locale.cPointer(), filename_ms, prefix_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) Load42(locale *QLocale, filename string, prefix string, directory string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
filename_ms := C.struct_miqt_string{}
|
|
|
|
filename_ms.data = C.CString(filename)
|
|
|
|
filename_ms.len = C.size_t(len(filename))
|
|
|
|
defer C.free(unsafe.Pointer(filename_ms.data))
|
|
|
|
prefix_ms := C.struct_miqt_string{}
|
|
|
|
prefix_ms.data = C.CString(prefix)
|
|
|
|
prefix_ms.len = C.size_t(len(prefix))
|
|
|
|
defer C.free(unsafe.Pointer(prefix_ms.data))
|
|
|
|
directory_ms := C.struct_miqt_string{}
|
|
|
|
directory_ms.data = C.CString(directory)
|
|
|
|
directory_ms.len = C.size_t(len(directory))
|
|
|
|
defer C.free(unsafe.Pointer(directory_ms.data))
|
|
|
|
return (bool)(C.QTranslator_Load42(this.h, locale.cPointer(), filename_ms, prefix_ms, directory_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) Load5(locale *QLocale, filename string, prefix string, directory string, suffix string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
filename_ms := C.struct_miqt_string{}
|
|
|
|
filename_ms.data = C.CString(filename)
|
|
|
|
filename_ms.len = C.size_t(len(filename))
|
|
|
|
defer C.free(unsafe.Pointer(filename_ms.data))
|
|
|
|
prefix_ms := C.struct_miqt_string{}
|
|
|
|
prefix_ms.data = C.CString(prefix)
|
|
|
|
prefix_ms.len = C.size_t(len(prefix))
|
|
|
|
defer C.free(unsafe.Pointer(prefix_ms.data))
|
|
|
|
directory_ms := C.struct_miqt_string{}
|
|
|
|
directory_ms.data = C.CString(directory)
|
|
|
|
directory_ms.len = C.size_t(len(directory))
|
|
|
|
defer C.free(unsafe.Pointer(directory_ms.data))
|
|
|
|
suffix_ms := C.struct_miqt_string{}
|
|
|
|
suffix_ms.data = C.CString(suffix)
|
|
|
|
suffix_ms.len = C.size_t(len(suffix))
|
|
|
|
defer C.free(unsafe.Pointer(suffix_ms.data))
|
|
|
|
return (bool)(C.QTranslator_Load5(this.h, locale.cPointer(), filename_ms, prefix_ms, directory_ms, suffix_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) Load34(data *byte, lenVal int, directory string) bool {
|
2024-10-18 23:53:33 +00:00
|
|
|
directory_ms := C.struct_miqt_string{}
|
|
|
|
directory_ms.data = C.CString(directory)
|
|
|
|
directory_ms.len = C.size_t(len(directory))
|
|
|
|
defer C.free(unsafe.Pointer(directory_ms.data))
|
|
|
|
return (bool)(C.QTranslator_Load34(this.h, (*C.uchar)(unsafe.Pointer(data)), (C.int)(lenVal), directory_ms))
|
2024-08-25 04:08:24 +00:00
|
|
|
}
|
|
|
|
|
2024-11-19 06:29:06 +00:00
|
|
|
func (this *QTranslator) callVirtualBase_Translate(context string, sourceText string, disambiguation string, n int) string {
|
|
|
|
context_Cstring := C.CString(context)
|
|
|
|
defer C.free(unsafe.Pointer(context_Cstring))
|
|
|
|
sourceText_Cstring := C.CString(sourceText)
|
|
|
|
defer C.free(unsafe.Pointer(sourceText_Cstring))
|
|
|
|
disambiguation_Cstring := C.CString(disambiguation)
|
|
|
|
defer C.free(unsafe.Pointer(disambiguation_Cstring))
|
|
|
|
|
|
|
|
var _ms C.struct_miqt_string = C.QTranslator_virtualbase_Translate(unsafe.Pointer(this.h), context_Cstring, sourceText_Cstring, disambiguation_Cstring, (C.int)(n))
|
|
|
|
_ret := C.GoStringN(_ms.data, C.int(int64(_ms.len)))
|
|
|
|
C.free(unsafe.Pointer(_ms.data))
|
|
|
|
return _ret
|
|
|
|
}
|
|
|
|
func (this *QTranslator) OnTranslate(slot func(super func(context string, sourceText string, disambiguation string, n int) string, context string, sourceText string, disambiguation string, n int) string) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTranslator_override_virtual_Translate(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QTranslator_Translate
|
|
|
|
func miqt_exec_callback_QTranslator_Translate(self *C.QTranslator, cb C.intptr_t, context *C.const_char, sourceText *C.const_char, disambiguation *C.const_char, n C.int) C.struct_miqt_string {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(context string, sourceText string, disambiguation string, n int) string, context string, sourceText string, disambiguation string, n int) string)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
|
|
|
context_ret := context
|
|
|
|
slotval1 := C.GoString(context_ret)
|
|
|
|
|
|
|
|
sourceText_ret := sourceText
|
|
|
|
slotval2 := C.GoString(sourceText_ret)
|
|
|
|
|
|
|
|
disambiguation_ret := disambiguation
|
|
|
|
slotval3 := C.GoString(disambiguation_ret)
|
|
|
|
|
|
|
|
slotval4 := (int)(n)
|
|
|
|
|
|
|
|
virtualReturn := gofunc((&QTranslator{h: self}).callVirtualBase_Translate, slotval1, slotval2, slotval3, slotval4)
|
|
|
|
virtualReturn_ms := C.struct_miqt_string{}
|
|
|
|
virtualReturn_ms.data = C.CString(virtualReturn)
|
|
|
|
virtualReturn_ms.len = C.size_t(len(virtualReturn))
|
|
|
|
defer C.free(unsafe.Pointer(virtualReturn_ms.data))
|
|
|
|
|
|
|
|
return virtualReturn_ms
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) callVirtualBase_IsEmpty() bool {
|
|
|
|
|
|
|
|
return (bool)(C.QTranslator_virtualbase_IsEmpty(unsafe.Pointer(this.h)))
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QTranslator) OnIsEmpty(slot func(super func() bool) bool) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTranslator_override_virtual_IsEmpty(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QTranslator_IsEmpty
|
|
|
|
func miqt_exec_callback_QTranslator_IsEmpty(self *C.QTranslator, cb C.intptr_t) C.bool {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func() bool) bool)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
virtualReturn := gofunc((&QTranslator{h: self}).callVirtualBase_IsEmpty)
|
|
|
|
|
|
|
|
return (C.bool)(virtualReturn)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) callVirtualBase_Event(event *QEvent) bool {
|
|
|
|
|
|
|
|
return (bool)(C.QTranslator_virtualbase_Event(unsafe.Pointer(this.h), event.cPointer()))
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QTranslator) OnEvent(slot func(super func(event *QEvent) bool, event *QEvent) bool) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTranslator_override_virtual_Event(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QTranslator_Event
|
|
|
|
func miqt_exec_callback_QTranslator_Event(self *C.QTranslator, cb C.intptr_t, event *C.QEvent) C.bool {
|
|
|
|
gofunc, ok := cgo.Handle(cb).Value().(func(super func(event *QEvent) bool, event *QEvent) bool)
|
|
|
|
if !ok {
|
|
|
|
panic("miqt: callback of non-callback type (heap corruption?)")
|
|
|
|
}
|
|
|
|
|
|
|
|
// Convert all CABI parameters to Go parameters
|
2024-12-07 02:02:06 +00:00
|
|
|
slotval1 := newQEvent(event)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
virtualReturn := gofunc((&QTranslator{h: self}).callVirtualBase_Event, slotval1)
|
|
|
|
|
|
|
|
return (C.bool)(virtualReturn)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) callVirtualBase_EventFilter(watched *QObject, event *QEvent) bool {
|
|
|
|
|
|
|
|
return (bool)(C.QTranslator_virtualbase_EventFilter(unsafe.Pointer(this.h), watched.cPointer(), event.cPointer()))
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QTranslator) OnEventFilter(slot func(super func(watched *QObject, event *QEvent) bool, watched *QObject, event *QEvent) bool) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTranslator_override_virtual_EventFilter(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QTranslator_EventFilter
|
|
|
|
func miqt_exec_callback_QTranslator_EventFilter(self *C.QTranslator, 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
|
2024-12-07 02:02:06 +00:00
|
|
|
slotval1 := newQObject(watched)
|
|
|
|
|
|
|
|
slotval2 := newQEvent(event)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
virtualReturn := gofunc((&QTranslator{h: self}).callVirtualBase_EventFilter, slotval1, slotval2)
|
|
|
|
|
|
|
|
return (C.bool)(virtualReturn)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) callVirtualBase_TimerEvent(event *QTimerEvent) {
|
|
|
|
|
|
|
|
C.QTranslator_virtualbase_TimerEvent(unsafe.Pointer(this.h), event.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QTranslator) OnTimerEvent(slot func(super func(event *QTimerEvent), event *QTimerEvent)) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTranslator_override_virtual_TimerEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QTranslator_TimerEvent
|
|
|
|
func miqt_exec_callback_QTranslator_TimerEvent(self *C.QTranslator, 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((&QTranslator{h: self}).callVirtualBase_TimerEvent, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) callVirtualBase_ChildEvent(event *QChildEvent) {
|
|
|
|
|
|
|
|
C.QTranslator_virtualbase_ChildEvent(unsafe.Pointer(this.h), event.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QTranslator) OnChildEvent(slot func(super func(event *QChildEvent), event *QChildEvent)) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTranslator_override_virtual_ChildEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QTranslator_ChildEvent
|
|
|
|
func miqt_exec_callback_QTranslator_ChildEvent(self *C.QTranslator, 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((&QTranslator{h: self}).callVirtualBase_ChildEvent, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) callVirtualBase_CustomEvent(event *QEvent) {
|
|
|
|
|
|
|
|
C.QTranslator_virtualbase_CustomEvent(unsafe.Pointer(this.h), event.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QTranslator) OnCustomEvent(slot func(super func(event *QEvent), event *QEvent)) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTranslator_override_virtual_CustomEvent(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QTranslator_CustomEvent
|
|
|
|
func miqt_exec_callback_QTranslator_CustomEvent(self *C.QTranslator, 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
|
2024-12-07 02:02:06 +00:00
|
|
|
slotval1 := newQEvent(event)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
gofunc((&QTranslator{h: self}).callVirtualBase_CustomEvent, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) callVirtualBase_ConnectNotify(signal *QMetaMethod) {
|
|
|
|
|
|
|
|
C.QTranslator_virtualbase_ConnectNotify(unsafe.Pointer(this.h), signal.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QTranslator) OnConnectNotify(slot func(super func(signal *QMetaMethod), signal *QMetaMethod)) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTranslator_override_virtual_ConnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QTranslator_ConnectNotify
|
|
|
|
func miqt_exec_callback_QTranslator_ConnectNotify(self *C.QTranslator, 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
|
2024-12-07 02:02:06 +00:00
|
|
|
slotval1 := newQMetaMethod(signal)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
gofunc((&QTranslator{h: self}).callVirtualBase_ConnectNotify, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *QTranslator) callVirtualBase_DisconnectNotify(signal *QMetaMethod) {
|
|
|
|
|
|
|
|
C.QTranslator_virtualbase_DisconnectNotify(unsafe.Pointer(this.h), signal.cPointer())
|
|
|
|
|
|
|
|
}
|
|
|
|
func (this *QTranslator) OnDisconnectNotify(slot func(super func(signal *QMetaMethod), signal *QMetaMethod)) {
|
2024-12-07 01:43:28 +00:00
|
|
|
if !this.isSubclass {
|
|
|
|
panic("miqt: can only override virtual methods for directly constructed types")
|
|
|
|
}
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTranslator_override_virtual_DisconnectNotify(unsafe.Pointer(this.h), C.intptr_t(cgo.NewHandle(slot)))
|
|
|
|
}
|
|
|
|
|
|
|
|
//export miqt_exec_callback_QTranslator_DisconnectNotify
|
|
|
|
func miqt_exec_callback_QTranslator_DisconnectNotify(self *C.QTranslator, 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
|
2024-12-07 02:02:06 +00:00
|
|
|
slotval1 := newQMetaMethod(signal)
|
2024-11-19 06:29:06 +00:00
|
|
|
|
|
|
|
gofunc((&QTranslator{h: self}).callVirtualBase_DisconnectNotify, slotval1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2024-09-14 22:29:05 +00:00
|
|
|
// Delete this object from C++ memory.
|
2024-08-25 04:08:24 +00:00
|
|
|
func (this *QTranslator) Delete() {
|
2024-11-19 06:29:06 +00:00
|
|
|
C.QTranslator_Delete(this.h, C.bool(this.isSubclass))
|
2024-08-25 04:08:24 +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 *QTranslator) GoGC() {
|
|
|
|
runtime.SetFinalizer(this, func(this *QTranslator) {
|
|
|
|
this.Delete()
|
|
|
|
runtime.KeepAlive(this.h)
|
|
|
|
})
|
|
|
|
}
|