Example #1
0
/*
Looks up @key in the list of options that may have been attached to the
@pixbuf when it was loaded, or that may have been attached by another
function using gdk_pixbuf_set_option().

For instance, the ANI loader provides "Title" and "Artist" options.
The ICO, XBM, and XPM loaders provide "x_hot" and "y_hot" hot-spot
options for cursor definitions. The PNG loader provides the tEXt ancillary
chunk key/value pairs as options. Since 2.12, the TIFF and JPEG loaders
return an "orientation" option string that corresponds to the embedded
TIFF/Exif orientation tag (if present).
*/
func (self *TraitPixbuf) GetOption(key string) (return__ string) {
	__cgo__key := (*C.gchar)(unsafe.Pointer(C.CString(key)))
	var __cgo__return__ *C.gchar
	__cgo__return__ = C.gdk_pixbuf_get_option(self.CPointer, __cgo__key)
	C.free(unsafe.Pointer(__cgo__key))
	return__ = C.GoString((*C.char)(unsafe.Pointer(__cgo__return__)))
	return
}
Example #2
0
// GetOption is a wrapper around gdk_pixbuf_get_option().  ok is true if
// the key has an associated value.
func (v *Pixbuf) GetOption(key string) (value string, ok bool) {
	cstr := C.CString(key)
	defer C.free(unsafe.Pointer(cstr))
	c := C.gdk_pixbuf_get_option(v.native(), (*C.gchar)(cstr))
	if c == nil {
		return "", false
	}
	return C.GoString((*C.char)(c)), true
}