summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Henstridge <james@daa.com.au>2002-03-16 15:16:07 +0000
committerJames Henstridge <jamesh@src.gnome.org>2002-03-16 15:16:07 +0000
commitbb4d0da566cf3f6c1f3189cf31b59309f6720220 (patch)
tree0b26b41de4d1b6264e585b32e34990d03ac4dfb2
parent751ea167812fd730f6f79f55cfd02efe3a55aaf7 (diff)
downloadpygobject-PYGTK_1_99_8.tar.gz
pygobject-PYGTK_1_99_8.tar.xz
pygobject-PYGTK_1_99_8.zip
fix up property listing.PYGTK_1_99_8
2002-03-16 James Henstridge <james@daa.com.au> * pygtype.c (add_property_docs): fix up property listing. * gtk/libglade.override: add modulename directive. * gtk/gdk.override: add modulename directive. * gtk/gtk.override: add modulename directive. * atk.override: add modulename directive. * pango.override: add modulename directive. * codegen/codegen.py (write_class): if override.modulename is set, put it into the classname. (write_interface): same here. (write_boxed): same here. (write_pointer): same here. * codegen/override.py (Overrides.__parse_override): add support for a "modulename" directive for overrides files.
-rw-r--r--gobject/pygtype.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/gobject/pygtype.c b/gobject/pygtype.c
index df8530f..84a0781 100644
--- a/gobject/pygtype.c
+++ b/gobject/pygtype.c
@@ -818,25 +818,31 @@ add_property_docs(GType gtype, GString *string)
GObjectClass *class;
GParamSpec **props;
guint n_props = 0, i;
+ gboolean has_prop = FALSE;
class = g_type_class_ref(gtype);
props = g_object_class_list_properties(class, &n_props);
- if (n_props > 0) {
- g_string_append_printf(string, "Properties from %s:\n",
- g_type_name(gtype));
-
- for (i = 0; i < n_props; i++) {
- g_string_append_printf(string, " %s -> %s: %s\n",
- g_param_spec_get_name(props[i]),
- g_type_name(props[i]->value_type),
- g_param_spec_get_nick(props[i]));
- g_string_append_printf(string, " %s\n",
- g_param_spec_get_blurb(props[i]));
- }
- g_free(props);
- g_string_append(string, "\n");
+ for (i = 0; i < n_props; i++) {
+ if (props[i]->owner_type != gtype)
+ continue; /* these are from a parent type */
+
+ /* print out the heading first */
+ if (!has_prop) {
+ g_string_append_printf(string, "Properties from %s:\n",
+ g_type_name(gtype));
+ has_prop = TRUE;
+ }
+ g_string_append_printf(string, " %s -> %s: %s\n",
+ g_param_spec_get_name(props[i]),
+ g_type_name(props[i]->value_type),
+ g_param_spec_get_nick(props[i]));
+ g_string_append_printf(string, " %s\n",
+ g_param_spec_get_blurb(props[i]));
}
+ g_free(props);
+ if (has_prop)
+ g_string_append(string, "\n");
g_type_class_unref(class);
}