summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGustavo J. A. M. Carneiro <gjc@src.gnome.org>2006-01-11 15:39:43 +0000
committerGustavo J. A. M. Carneiro <gjc@src.gnome.org>2006-01-11 15:39:43 +0000
commita4834ddbe8dfe5b0f131ba3c1331de0b05f67a0f (patch)
tree318f725ab7d568ea84b363c92f80c55a69d34b0e
parentc3d7d3eb3353dee65828ae5f74c3408a37f18ac8 (diff)
downloadpygobject-a4834ddbe8dfe5b0f131ba3c1331de0b05f67a0f.tar.gz
pygobject-a4834ddbe8dfe5b0f131ba3c1331de0b05f67a0f.tar.xz
pygobject-a4834ddbe8dfe5b0f131ba3c1331de0b05f67a0f.zip
reorder more nicely information presented in docstring about signals and properties
-rw-r--r--ChangeLog5
-rw-r--r--gobject/pygtype.c26
2 files changed, 20 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index d0c7bab..64821e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2006-01-11 Gustavo J. A. M. Carneiro <gjc@inescporto.pt>
+ * gobject/pygtype.c (object_doc_descr_get): Reorder
+ properties/signals documentation more nicely: signals + properties
+ from each type are presented, with types ranging from the leaf
+ types to the base types.
+
* configure.ac: Branch, bump version to 2.9.1.
=== PyGObject 2.8.0 ===
diff --git a/gobject/pygtype.c b/gobject/pygtype.c
index ebb9dd8..a1400a0 100644
--- a/gobject/pygtype.c
+++ b/gobject/pygtype.c
@@ -1422,30 +1422,34 @@ object_doc_descr_get(PyObject *self, PyObject *obj, PyObject *type)
else
g_string_append_printf(string, "%s\n\n", g_type_name(gtype));
+ if (((PyTypeObject *) type)->tp_doc)
+ g_string_append_printf(string, "%s\n\n", ((PyTypeObject *) type)->tp_doc);
+
if (g_type_is_a(gtype, G_TYPE_OBJECT)) {
GType parent = G_TYPE_OBJECT;
-
- while (parent) {
+ GArray *parents = g_array_new(FALSE, FALSE, sizeof(GType));
+ int iparent;
+
+ while (parent) {
+ g_array_append_val(parents, parent);
+ parent = g_type_next_base(gtype, parent);
+ }
+
+ for (iparent = parents->len - 1; iparent >= 0; --iparent) {
GType *interfaces;
guint n_interfaces, i;
+ parent = g_array_index(parents, GType, iparent);
add_signal_docs(parent, string);
+ add_property_docs(parent, string);
/* add docs for implemented interfaces */
interfaces = g_type_interfaces(parent, &n_interfaces);
for (i = 0; i < n_interfaces; i++)
add_signal_docs(interfaces[i], string);
g_free(interfaces);
-
- parent = g_type_next_base(gtype, parent);
- }
- parent = G_TYPE_OBJECT;
- while (parent) {
- add_property_docs(parent, string);
- parent = g_type_next_base(gtype, parent);
}
- } else if (g_type_is_a(gtype, G_TYPE_OBJECT)) {
- add_signal_docs(gtype, string);
+ g_array_free(parents, TRUE);
}
pystring = PyString_FromStringAndSize(string->str, string->len);