Ejemplo n.º 1
0
Archivo: dump.go Proyecto: 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)
	}
}
Ejemplo n.º 2
0
// 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)))
}
Ejemplo n.º 3
0
Archivo: info.go Proyecto: 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))))
}