Exemplo n.º 1
0
Arquivo: dump.go Projeto: reusee/ggi
func DumpObjectInfo(info *C.GIObjectInfo) {
	isAbstract := C.g_object_info_get_abstract(info) == C.gboolean(1)
	p("is abstract %v\n", isAbstract)
	parent := C.g_object_info_get_parent(info)
	if parent != nil {
		parentName := fromGStr(C.g_base_info_get_name(asBaseInfo(parent)))
		p("parent %s\n", parentName)
	}
	typeName := fromGStr(C.g_object_info_get_type_name(info))
	p("type name %s\n", typeName)
	typeInit := fromGStr(C.g_object_info_get_type_init(info))
	p("type init %s\n", typeInit)
	nConsts := C.g_object_info_get_n_constants(info)
	p("%d consts\n", nConsts)
	for i := C.gint(0); i < nConsts; i++ {
		constInfo := C.g_object_info_get_constant(info, i)
		DumpConstantInfo(constInfo)
	}
	nFields := C.g_object_info_get_n_fields(info)
	p("%d fields\n", nFields)
	for i := C.gint(0); i < nFields; i++ {
		field := C.g_object_info_get_field(info, i)
		DumpFieldInfo(field)
	}
	nInterfaces := C.g_object_info_get_n_interfaces(info)
	p("%d interfaces\n", nInterfaces)
	for i := C.gint(0); i < nInterfaces; i++ {
		interf := C.g_object_info_get_interface(info, i)
		DumpInterfaceInfo(interf)
	}
	nMethods := C.g_object_info_get_n_methods(info)
	p("%d methods\n", nMethods)
	for i := C.gint(0); i < nMethods; i++ {
		f := C.g_object_info_get_method(info, i)
		DumpFunctionInfo(f)
	}
	nProperties := C.g_object_info_get_n_properties(info)
	p("%d properties\n", nProperties)
	for i := C.gint(0); i < nProperties; i++ {
		property := C.g_object_info_get_property(info, i)
		DumpPropertyInfo(property)
	}
	nSignals := C.g_object_info_get_n_signals(info)
	p("%d signals\n", nSignals)
	for i := C.gint(0); i < nSignals; i++ {
		signal := C.g_object_info_get_signal(info, i)
		DumpSignalInfo(signal)
	}
	nVFuncs := C.g_object_info_get_n_vfuncs(info)
	p("%d vfuncs\n", nVFuncs)
	for i := C.gint(0); i < nVFuncs; i++ {
		vfunc := C.g_object_info_get_vfunc(info, i)
		DumpVFuncInfo(vfunc)
	}
}
Exemplo n.º 2
0
// g_object_info_get_interface
func (oi *ObjectInfo) Interface(n int) *InterfaceInfo {
	ptr := &BaseInfo{(*C.GIBaseInfo)(C.g_object_info_get_interface((*C.GIObjectInfo)(oi.c), C.gint(n)))}
	return (*InterfaceInfo)(unsafe.Pointer(_SetBaseInfoFinalizer(ptr)))
}
Exemplo n.º 3
0
Arquivo: info.go Projeto: dradtke/gogi
func (info *GiInfo) GetObjectInterface(n int) *GiInfo {
	return NewGiInfo((*C.GIBaseInfo)(C.g_object_info_get_interface((*C.GIObjectInfo)(info.ptr), GlibInt(n))))
}