]> spindle.queued.net Git - midori/commitdiff
Add katze_get_object
authorChristian Dywan <christian@twotoasts.de>
Tue, 18 Nov 2008 00:57:33 +0000 (01:57 +0100)
committerChristian Dywan <christian@twotoasts.de>
Tue, 18 Nov 2008 00:57:33 +0000 (01:57 +0100)
katze/katze-utils.c
katze/katze-utils.h

index 048f24289fb723698f34f84614fde7ce07fea96a..fff0cf8a89e7c772f731f9a9cac25c0a572e4ebe 100644 (file)
@@ -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;
+}
index 97e5b8dc6ca3918c66f4a753eeede7b0268f0a0c..b86bc729037b03a6992f4074a1b86171b94fccff 100644 (file)
@@ -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__ */