From: Christian Dywan Date: Tue, 18 Nov 2008 00:57:33 +0000 (+0100) Subject: Add katze_get_object X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d60166aa02cb335d3f60094790d9d0250a6e9970;p=midori Add katze_get_object --- 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__ */