예제 #1
0
파일: dump.go 프로젝트: reusee/ggi
func DumpStructInfo(info *C.GIStructInfo) {
	align := C.g_struct_info_get_alignment(info)
	p("alignment %d bytes\n", align)
	size := C.g_struct_info_get_size(info)
	p("size %d bytes\n", size)
	isGtypeStruct := C.g_struct_info_is_gtype_struct(info) == C.gboolean(1)
	p("is gtype struct %v\n", isGtypeStruct)
	isForeign := C.g_struct_info_is_foreign(info) == C.gboolean(1)
	p("is foreign %v\n", isForeign)
	nFields := C.g_struct_info_get_n_fields(info)
	p("%d fields\n", nFields)
	for i := C.gint(0); i < nFields; i++ {
		field := C.g_struct_info_get_field(info, i)
		DumpFieldInfo(field)
	}
	nMethods := C.g_struct_info_get_n_methods(info)
	p("%d methods\n", nMethods)
	for i := C.gint(0); i < nMethods; i++ {
		f := C.g_struct_info_get_method(info, i)
		DumpFunctionInfo(f)
	}
}
예제 #2
0
파일: gi.go 프로젝트: bytbox/gogobject
// g_struct_info_get_method
func (si *StructInfo) Method(n int) *FunctionInfo {
	ptr := &BaseInfo{(*C.GIBaseInfo)(C.g_struct_info_get_method((*C.GIStructInfo)(si.c), C.gint(n)))}
	return (*FunctionInfo)(unsafe.Pointer(_SetBaseInfoFinalizer(ptr)))
}
예제 #3
0
파일: info.go 프로젝트: dradtke/gogi
func (info *GiInfo) GetStructMethod(n int) *GiInfo {
	return NewGiInfo((*C.GIBaseInfo)(C.g_struct_info_get_method((*C.GIStructInfo)(info.ptr), GlibInt(n))))
}