예제 #1
0
파일: gi.go 프로젝트: bytbox/gogobject
// g_object_info_get_parent
func (oi *ObjectInfo) Parent() *ObjectInfo {
	cptr := (*C.GIBaseInfo)(C.g_object_info_get_parent((*C.GIObjectInfo)(oi.c)))
	if cptr == nil {
		return nil
	}

	ptr := &BaseInfo{cptr}
	return (*ObjectInfo)(unsafe.Pointer(_SetBaseInfoFinalizer(ptr)))
}
예제 #2
0
파일: dump.go 프로젝트: 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)
	}
}
예제 #3
0
파일: info.go 프로젝트: dradtke/gogi
func (info *GiInfo) GetParent() *GiInfo {
	return NewGiInfo((*C.GIBaseInfo)(C.g_object_info_get_parent((*C.GIObjectInfo)(info.ptr))))
}