diff --git a/katze/katze-utils.c b/katze/katze-utils.c index 048f2428..fff0cf8a 100644 --- a/katze/katze-utils.c +++ b/katze/katze-utils.c @@ -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; +} diff --git a/katze/katze-utils.h b/katze/katze-utils.h index 97e5b8dc..b86bc729 100644 --- a/katze/katze-utils.h +++ b/katze/katze-utils.h @@ -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__ */