Add katze_get_object
This commit is contained in:
parent
4e8236c95c
commit
d60166aa02
2 changed files with 26 additions and 0 deletions
|
@ -517,3 +517,25 @@ katze_pixbuf_new_from_buffer (const guchar* buffer,
|
|||
g_object_unref (loader);
|
||||
return pixbuf;
|
||||
}
|
||||
|
||||
/**
|
||||
* katze_object_get_object:
|
||||
* @object: a #GObject
|
||||
* @property_name: the name of the property to get
|
||||
*
|
||||
* Retrieve the object value of the specified property.
|
||||
*
|
||||
* Return value: Return value: an object
|
||||
**/
|
||||
gpointer
|
||||
katze_object_get_object (gpointer object,
|
||||
const gchar* property)
|
||||
{
|
||||
GObject* value = NULL;
|
||||
|
||||
g_return_val_if_fail (G_IS_OBJECT (object), NULL);
|
||||
/* FIXME: Check value type */
|
||||
|
||||
g_object_get (object, property, &value, NULL);
|
||||
return value;
|
||||
}
|
||||
|
|
|
@ -84,6 +84,10 @@ katze_pixbuf_new_from_buffer (const guchar* buffer,
|
|||
const gchar* mime_type,
|
||||
GError** error);
|
||||
|
||||
gpointer
|
||||
katze_object_get_object (gpointer object,
|
||||
const gchar* property);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __KATZE_UTILS_H__ */
|
||||
|
|
Loading…
Reference in a new issue