Пример #1
0
func PixbufGetFormats() []*PixbufFormat {
	l := (*C.struct__GSList)(C.gdk_pixbuf_get_formats())
	formats := glib.WrapSList(uintptr(unsafe.Pointer(l)))
	if formats == nil {
		return nil // no error. A nil list is considered to be empty.
	}

	// "The structures themselves are owned by GdkPixbuf". Free the list only.
	defer formats.Free()

	ret := make([]*PixbufFormat, 0, formats.Length())
	formats.Foreach(func(ptr unsafe.Pointer) {
		ret = append(ret, &PixbufFormat{(*C.GdkPixbufFormat)(ptr)})
	})

	return ret
}
Пример #2
0
func PixbufGetFormats() (_return_ *C.GSList) {
	_return_ = C.gdk_pixbuf_get_formats()
	return
}