#50213 - No accessor for GObject::property_specs



Can I commit the following?

Thanks,
                                        Owen

Index: docs/reference/gobject/gobject-sections.txt
===================================================================
RCS file: /cvs/gnome/glib/docs/reference/gobject/gobject-sections.txt,v
retrieving revision 1.9
diff -u -r1.9 gobject-sections.txt
--- docs/reference/gobject/gobject-sections.txt	2001/03/07 20:11:09	1.9
+++ docs/reference/gobject/gobject-sections.txt	2001/03/26 21:52:58
@@ -154,6 +154,7 @@
 G_VALUE_HOLDS_OBJECT
 g_object_class_install_property
 g_object_class_find_property
+g_object_class_list_properties
 g_object_new
 g_object_ref
 g_object_unref
Index: docs/reference/gobject/tmpl/objects.sgml
===================================================================
RCS file: /cvs/gnome/glib/docs/reference/gobject/tmpl/objects.sgml,v
retrieving revision 1.5
diff -u -r1.5 objects.sgml
--- docs/reference/gobject/tmpl/objects.sgml	2001/03/07 14:46:44	1.5
+++ docs/reference/gobject/tmpl/objects.sgml	2001/03/26 21:52:58
@@ -177,6 +177,17 @@
 @Returns: 
 
 
+<!-- ##### FUNCTION g_object_class_list_properties ##### -->
+<para>
+Lists the properties installed on an object class.
+</para>
+
+ oclass: a #GObjectClass
+ n_properties: location to store the length of the result array
+ Returns: A newly allocated array of #GParamSpec * for the properties
+          of @oclass. Free this array with g_free() when you are
+          finished with it.
+
 <!-- ##### FUNCTION g_object_new ##### -->
 <para>
 
Index: gobject/gobject.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/gobject.c,v
retrieving revision 1.29
diff -u -r1.29 gobject.c
--- gobject/gobject.c	2001/03/18 04:44:37	1.29
+++ gobject/gobject.c	2001/03/26 21:52:58
@@ -357,6 +357,23 @@
 				   TRUE);
 }
 
+GParamSpec **
+g_object_class_list_properties (GObjectClass *oclass,
+				guint        *n_properties)
+{
+  GParamSpec **result;
+  
+  g_return_val_if_fail (G_IS_OBJECT_CLASS (oclass), NULL);
+  g_return_val_if_fail (n_properties != NULL, NULL);
+  
+  result = g_new (GParamSpec *, oclass->n_property_specs);
+  memcpy (result, oclass->property_specs, oclass->n_property_specs * sizeof(GParamSpec *));
+  
+  *n_properties = oclass->n_property_specs;
+
+  return result;
+}
+
 static void
 free_notify_queue (gpointer data)
 {
Index: gobject/gobject.h
===================================================================
RCS file: /cvs/gnome/glib/gobject/gobject.h,v
retrieving revision 1.11
diff -u -r1.11 gobject.h
--- gobject/gobject.h	2001/03/09 21:39:50	1.11
+++ gobject/gobject.h	2001/03/26 21:52:58
@@ -110,6 +110,8 @@
 					       GParamSpec     *pspec);
 GParamSpec* g_object_class_find_property      (GObjectClass   *oclass,
 					       const gchar    *property_name);
+GParamSpec **g_object_class_list_properties   (GObjectClass   *oclass,
+					       guint          *n_properties);
 gpointer    g_object_new                      (GType           object_type,
 					       const gchar    *first_property_name,
 					       ...);




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]