Beispiel #1
0
// g_irepository_find_by_name
func (r *Repository) FindByName(namespace, name string) *BaseInfo {
	gnamespace := _GoStringToGString(namespace)
	gname := _GoStringToGString(name)
	ret := C.g_irepository_find_by_name(r.c, gnamespace, gname)
	C.free_gstring(gname)
	C.free_gstring(gnamespace)
	return _SetBaseInfoFinalizer(&BaseInfo{ret})
}
Beispiel #2
0
// g_irepository_is_registered
func (r *Repository) IsRegistered(namespace, version string) bool {
	gnamespace := _GoStringToGString(namespace)
	gversion := _GoStringToGString(version)
	ret := C.g_irepository_is_registered(r.c, gnamespace, gversion)
	C.free_gstring(gversion)
	C.free_gstring(gnamespace)
	return ret != 0
}
Beispiel #3
0
// g_irepository_require
func (r *Repository) Require(namespace, version string, flags RepositoryLoadFlags) (*Typelib, error) {
	var err *C.GError
	gnamespace := _GoStringToGString(namespace)
	gversion := _GoStringToGString(version)
	tl := C.g_irepository_require(r.c, gnamespace, gversion, C.GIRepositoryLoadFlags(flags), &err)
	C.free_gstring(gversion)
	C.free_gstring(gnamespace)

	if err != nil {
		return nil, _GErrorToOSError(err)
	}

	var tlwrap *Typelib
	if tl != nil {
		tlwrap = &Typelib{tl}
	}

	return tlwrap, nil
}
Beispiel #4
0
// g_union_info_find_method
func (ui *UnionInfo) FindMethod(name string) *FunctionInfo {
	gname := _GoStringToGString(name)
	cptr := (*C.GIBaseInfo)(C.g_union_info_find_method((*C.GIUnionInfo)(ui.c), gname))
	C.free_gstring(gname)

	if cptr == nil {
		return nil
	}
	ptr := &BaseInfo{cptr}
	return (*FunctionInfo)(unsafe.Pointer(_SetBaseInfoFinalizer(ptr)))
}
Beispiel #5
0
// g_object_info_find_vfunc
func (oi *ObjectInfo) FindVFunc(name string) *VFuncInfo {
	gname := _GoStringToGString(name)
	cptr := (*C.GIBaseInfo)(C.g_object_info_find_vfunc((*C.GIObjectInfo)(oi.c), gname))
	C.free_gstring(gname)

	if cptr == nil {
		return nil
	}
	ptr := &BaseInfo{cptr}
	return (*VFuncInfo)(unsafe.Pointer(_SetBaseInfoFinalizer(ptr)))
}
Beispiel #6
0
// g_callable_info_get_return_attribute
func (ci *CallableInfo) ReturnAttribute(name string) string {
	gname := _GoStringToGString(name)
	ret := C.g_callable_info_get_return_attribute((*C.GICallableInfo)(ci.c), gname)
	C.free_gstring(gname)
	return _GStringToGoString(ret)
}
Beispiel #7
0
// g_base_info_get_attribute
func (bi *BaseInfo) Attribute(name string) string {
	gname := _GoStringToGString(name)
	ret := _GStringToGoString(C.g_base_info_get_attribute(bi.c, gname))
	C.free_gstring(gname)
	return ret
}
Beispiel #8
0
// g_irepository_get_c_prefix
func (r *Repository) CPrefix(namespace string) string {
	gnamespace := _GoStringToGString(namespace)
	prefix := C.g_irepository_get_c_prefix(r.c, gnamespace)
	C.free_gstring(gnamespace)
	return _GStringToGoString(prefix)
}
Beispiel #9
0
// g_irepository_get_version
func (r *Repository) Version(namespace string) string {
	gnamespace := _GoStringToGString(namespace)
	ver := C.g_irepository_get_version(r.c, gnamespace)
	C.free_gstring(gnamespace)
	return _GStringToGoString(ver)
}
Beispiel #10
0
// g_irepository_get_shared_library
func (r *Repository) SharedLibrary(namespace string) string {
	gnamespace := _GoStringToGString(namespace)
	shlib := C.g_irepository_get_shared_library(r.c, gnamespace)
	C.free_gstring(gnamespace)
	return _GStringToGoString(shlib)
}
Beispiel #11
0
// g_irepository_get_typelib_path
func (r *Repository) TypelibPath(namespace string) string {
	gnamespace := _GoStringToGString(namespace)
	path := C.g_irepository_get_typelib_path(r.c, gnamespace)
	C.free_gstring(gnamespace)
	return _GStringToGoString(path)
}
Beispiel #12
0
// g_irepository_get_info
func (r *Repository) Info(namespace string, index int) *BaseInfo {
	gnamespace := _GoStringToGString(namespace)
	info := C.g_irepository_get_info(r.c, gnamespace, C.gint(index))
	C.free_gstring(gnamespace)
	return _SetBaseInfoFinalizer(&BaseInfo{info})
}
Beispiel #13
0
// g_irepository_get_n_infos
func (r *Repository) NumInfo(namespace string) int {
	gnamespace := _GoStringToGString(namespace)
	num := C.g_irepository_get_n_infos(r.c, gnamespace)
	C.free_gstring(gnamespace)
	return int(num)
}
Beispiel #14
0
// g_irepository_get_dependencies
func (r *Repository) Dependencies(namespace string) []string {
	gnamespace := _GoStringToGString(namespace)
	arr := C.g_irepository_get_dependencies(r.c, gnamespace)
	C.free_gstring(gnamespace)
	return _GStringArrayToGoStringSlice(arr)
}