Documentation ¶
Index ¶
- Constants
- Variables
- func BoolTy(pointer bool) reflect.Type
- func Byte2Charp(a0 interface{}) *C.uchar
- func ByteTy(pointer bool) reflect.Type
- func CBool2Go(b int) bool
- func CCharPPToStringSlice(charpp unsafe.Pointer) []string
- func CFree(p unsafe.Pointer)
- func CString(s string) unsafe.Pointer
- func CallbackAllInherits(cbobj unsafe.Pointer, name string, args ...interface{}) interface{}
- func Calloc(n int, sz int) unsafe.Pointer
- func Cmemcmp(p1, p2 unsafe.Pointer, sz int) int
- func Cmemset(p unsafe.Pointer, c int, n int)
- func Connect(cobj CObjectITF, signame string, f interface{})
- func ConnectDestroyed(senderCobj CObjectITF, className string)
- func ConnectRaw(sender unsafe.Pointer, signal string, receiver unsafe.Pointer, member string)
- func ConnectSignal(sender CObjectITF, signal string, receiver CObjectITF, member string)
- func ConnectSlot(sender CObjectITF, signal string, receiver CObjectITF, member string)
- func ConnectSwitch(src unsafe.Pointer, signame string, on bool, cobj CObjectITF)
- func Cpretval2go(ty string, rv uint64) interface{}
- func Cretval2go(ty string, rv uint64) interface{}
- func DeleteQDynSlotObject(o *QDynSlotObject)
- func DerefPtr2(ptr2 unsafe.Pointer) unsafe.Pointer
- func Disconnect(cobj CObjectITF, signame string)
- func DisconnectAll(cobj CObjectITF)
- func Double2Double(a0 interface{}) **C.double
- func DoubleTy(pointer bool) reflect.Type
- func ErrorResolve(class, method string, args []interface{})
- func FillDefaultValues(args []interface{}, dvals []interface{}) []interface{}
- func Float2Float(a0 interface{}) **C.float
- func Float32AsInt(n float32) (rv uint64)
- func Float64AsInt(n float64) (rv uint64)
- func FloatTy(pointer bool) reflect.Type
- func FreeMem(p unsafe.Pointer)
- func FreeMemI(p uint64)
- func GetClassEnumItemName(this interface{}, val int) string
- func GetClassStaticMetaObjectByName(clsname string) unsafe.Pointer
- func GetCthis(obj interface{}) unsafe.Pointer
- func GetCtorAllocStack(clsname string) []uintptr
- func GetQtSymAddr(symname string) unsafe.Pointer
- func GetQtSymAddrRaw(symname string) unsafe.Pointer
- func GetQtclassName(tystr string) string
- func GoBool2C(b bool) int
- func GoString(p unsafe.Pointer) string
- func GoStringI(p uint64) string
- func GoStringIN(p uint64, n int) string
- func GoStringN(p unsafe.Pointer, n int) string
- func HandyConvert2c(fv interface{}, to reflect.Type) (retv interface{}, free bool)
- func HandyConvert2go(fvi interface{}, to reflect.Type) (reti interface{})
- func Int16Ty(pointer bool) reflect.Type
- func Int32Ty(pointer bool) reflect.Type
- func Int64Ty(pointer bool) reflect.Type
- func IntAsFloat32(v uint64) (n float32)
- func IntAsFloat64(v uint64) (n float64)
- func InvokeQtFuncByName(symname string, args []uint64, types []int) uint64
- func IsQtclass(tystr string) bool
- func KeepMe()
- func Malloc(sz int) unsafe.Pointer
- func PrimConv(fvi interface{}, to reflect.Type) (reti interface{})
- func QMETHOD(mthName string) string
- func QObjectGetSignatureByName(qobj CObjectITF, name string) (string, error)
- func QSIGNAL(sigName string) string
- func QSLOT(slotName string) string
- func ReleaseOwnerToQt(obj interface{})
- func Rune2WCharp(a0 interface{}) *C.wchar_t
- func RuneTy(pointer bool) reflect.Type
- func SetAllInheritCallback(cbobj CObjectITF, name string, f interface{})
- func SetDebugAllinheritsFilterFunc(f func(name string) bool)
- func SetDebugDynSlot(on bool)
- func SetDebugFFICall(on bool)
- func SetFinalizer(obj interface{}, finalizer interface{})
- func SetFinalizerObjectFilter(f func(reflect.Value) bool)
- func SetInheritCallback2c(name string, fnptr unsafe.Pointer)
- func StringSliceToCCharPP(ss []string) unsafe.Pointer
- func StringTy(pointer bool) reflect.Type
- func SymbolResolve(args []interface{}, vtys map[uint8]map[uint8]reflect.Type) int32
- func UInt16Ty(pointer bool) reflect.Type
- func UInt32Ty(pointer bool) reflect.Type
- func UInt64Ty(pointer bool) reflect.Type
- func UNQMETHOD(mthName string) string
- func UNQSIGNAL(sigName string) string
- func UNQSLOT(slotName string) string
- func UniverseFree(this interface{})
- func UnsetAllInheritCallback(cbobj CObjectITF, name string)
- func UnsetAllInheritCallbackAll(cbobj CObjectITF)
- func UnsetFinalizer(obj interface{})
- func VoidpTy() reflect.Type
- type CObject
- type CObjectITF
- type FFILibrary
- type GetCthiser
- type QDynSlotObject
- type VRetype
- func ForwardFFIFunc(pxysymname string, symname string, args ...interface{}) (VRetype, error)
- func InvokeQtFunc(symname string, retype byte, types []byte, args ...interface{}) (VRetype, error)
- func InvokeQtFunc5(symname string, retype byte, argc int, types []byte, args []uint64) (VRetype, error)
- func InvokeQtFunc6(symname string, retype byte, args ...interface{}) (VRetype, error)
- func InvokeQtFunc6Var(symname string, retype byte, fixedargc int, args ...interface{}) (VRetype, error)
- func InvokeQtFunc7(symname string, args ...interface{}) (VRetype, error)
Constants ¶
const ( FFI_TYPE_VOID = byte(C.FFI_TYPE_VOID) FFI_TYPE_INT = byte(C.FFI_TYPE_INT) FFI_TYPE_FLOAT = byte(C.FFI_TYPE_FLOAT) FFI_TYPE_DOUBLE = byte(C.FFI_TYPE_DOUBLE) FFI_TYPE_LONGDOUBLE = byte(C.FFI_TYPE_LONGDOUBLE) FFI_TYPE_UINT8 = byte(C.FFI_TYPE_UINT8) FFI_TYPE_SINT8 = byte(C.FFI_TYPE_SINT8) FFI_TYPE_UINT16 = byte(C.FFI_TYPE_UINT16) FFI_TYPE_SINT16 = byte(C.FFI_TYPE_SINT16) FFI_TYPE_UINT32 = byte(C.FFI_TYPE_UINT32) FFI_TYPE_SINT32 = byte(C.FFI_TYPE_SINT32) FFI_TYPE_UINT64 = byte(C.FFI_TYPE_UINT64) FFI_TYPE_SINT64 = byte(C.FFI_TYPE_SINT64) FFI_TYPE_STRUCT = byte(C.FFI_TYPE_STRUCT) FFI_TYPE_POINTER = byte(C.FFI_TYPE_POINTER) )
const DtorCthisName = "DtorCthis"
const GetCthisName = "GetCthis"
some fixed internal names
const NewCthisName = "NewCthis"
const SetCthisName = "SetCthis"
const SetInitStObjName = "C_%s_init_staticMetaObject"
Variables ¶
var Assert = miscutil.Assert
var DebugFinalize bool = false
/////////
var ErrPrint = miscutil.ErrPrint
var FileExist = miscutil.FileExist
var FinalizeProxyFn = func(f func()) { f() } //
var Float32Ty = reflect.TypeOf(float32(0))
var Float64Ty = reflect.TypeOf(float64(0))
var IfElse = miscutil.IfElse
var IfElseInt = miscutil.IfElseInt
var IfElseStr = miscutil.IfElseStr
var IntTy = reflect.TypeOf(int(0))
var NilPrint = miscutil.NilPrint
var Uint64Ty = reflect.TypeOf(uint64(0))
var Uint8Ty = reflect.TypeOf(uint8(0))
var UseCppSymbols bool = false
直接使用C++ symbols
var UseWrapSymbols bool = true // see also qtrt.UseCppSymbols TODO merge
直接使用封装的C++ symbols。好像在这设置没有用啊,符号不同,因为参数表的处理也不同,还是要改生成的调用代码。
Functions ¶
func Byte2Charp ¶
func CCharPPToStringSlice ¶
func CallbackAllInherits ¶
depcreated 在go中的projected继承代理方法调用
func ConnectDestroyed ¶
func ConnectDestroyed(senderCobj CObjectITF, className string)
func ConnectRaw ¶
func ConnectSignal ¶
func ConnectSignal(sender CObjectITF, signal string, receiver CObjectITF, member string)
or direct use qtcore.QObject_Connect only for support signal to signal
func ConnectSlot ¶
func ConnectSlot(sender CObjectITF, signal string, receiver CObjectITF, member string)
quickly connect an object's signal to another object's slot
func ConnectSwitch ¶
func ConnectSwitch(src unsafe.Pointer, signame string, on bool, cobj CObjectITF)
可以是signal的完整函数原型,也可以是名字
func Cpretval2go ¶
func Cretval2go ¶
func DeleteQDynSlotObject ¶
func DeleteQDynSlotObject(o *QDynSlotObject)
func Double2Double ¶
func ErrorResolve ¶
func ErrorResolve(class, method string, args []interface{})
func FillDefaultValues ¶
func FillDefaultValues(args []interface{}, dvals []interface{}) []interface{}
func Float2Float ¶
func Float32AsInt ¶
func GetClassEnumItemName ¶
must call in func (this *XObject) XEnumItemName() 1. QObject subclass 2. non-QObject class
func GetCtorAllocStack ¶
func GetQtSymAddr ¶
func GetQtSymAddrRaw ¶
func GetQtclassName ¶
func GoStringIN ¶
func HandyConvert2c ¶
func HandyConvert2go ¶
func IntAsFloat32 ¶
func IntAsFloat64 ¶
func InvokeQtFuncByName ¶
func QObjectGetSignatureByName ¶
func QObjectGetSignatureByName(qobj CObjectITF, name string) (string, error)
这个可以简化connect时的书写。仅在只有一个同名的情况下适用。
func ReleaseOwnerToQt ¶
func ReleaseOwnerToQt(obj interface{})
func Rune2WCharp ¶
func SetAllInheritCallback ¶
func SetAllInheritCallback(cbobj CObjectITF, name string, f interface{})
func SetDebugDynSlot ¶
func SetDebugDynSlot(on bool)
func SetDebugFFICall ¶
func SetDebugFFICall(on bool)
func SetFinalizer ¶
func SetFinalizer(obj interface{}, finalizer interface{})
func StringSliceToCCharPP ¶
func SymbolResolve ¶
类似C++的overload name resolve
func UniverseFree ¶
func UniverseFree(this interface{})
/////// runtime.SetFinalizer(x, UniverseFree)
func UnsetAllInheritCallback ¶
func UnsetAllInheritCallback(cbobj CObjectITF, name string)
func UnsetAllInheritCallbackAll ¶
func UnsetAllInheritCallbackAll(cbobj CObjectITF)
func UnsetFinalizer ¶
func UnsetFinalizer(obj interface{})
Types ¶
type FFILibrary ¶
type FFILibrary struct {
// contains filtered or unexported fields
}
Library is a dl-opened library holding the corresponding dl.Handle
func NewFFILibrary ¶
func NewFFILibrary(libname string) (lib FFILibrary, err error)
NewFFILibrary takes the library filename and returns a handle towards it.
func (FFILibrary) Close ¶
func (lib FFILibrary) Close() error
func (FFILibrary) Name ¶
func (lib FFILibrary) Name() string
type GetCthiser ¶
type QDynSlotObject ¶
type QDynSlotObject struct {
// contains filtered or unexported fields
}
usage: ffiqt.Connect() 也许放在qtrt包中更好,但在测试时放在了ffiqt包中,暂时放在这
func NewQDynSlotObject ¶
func NewQDynSlotObject(signalName string, argc int) *QDynSlotObject
func (*QDynSlotObject) Connect_test ¶
func (this *QDynSlotObject) Connect_test(to *QDynSlotObject)
test
func (*QDynSlotObject) GetCthis ¶
func (this *QDynSlotObject) GetCthis() unsafe.Pointer
func (*QDynSlotObject) Trigger_test ¶
func (this *QDynSlotObject) Trigger_test()
type VRetype ¶
type VRetype = uint64 // interface{}
//////
func ForwardFFIFunc ¶
TODO resolve ffi parameters and then forward to C scope execute C scope receiver func: void(void*fnptr, uint64_t*retval, void* argtys, void* argvals)
func InvokeQtFunc ¶
func InvokeQtFunc5 ¶
func InvokeQtFunc6 ¶
func InvokeQtFunc6Var ¶
func InvokeQtFunc6Var(symname string, retype byte, fixedargc int, args ...interface{}) (VRetype, error)
for variadic function call
func InvokeQtFunc7 ¶
fix return QSize like pure record, RVO