diff options
author | James Henstridge <james@daa.com.au> | 2002-03-16 15:16:07 +0000 |
---|---|---|
committer | James Henstridge <jamesh@src.gnome.org> | 2002-03-16 15:16:07 +0000 |
commit | bb4d0da566cf3f6c1f3189cf31b59309f6720220 (patch) | |
tree | 0b26b41de4d1b6264e585b32e34990d03ac4dfb2 | |
parent | 751ea167812fd730f6f79f55cfd02efe3a55aaf7 (diff) | |
download | pygobject-bb4d0da566cf3f6c1f3189cf31b59309f6720220.tar.gz |
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.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/gobject/pygtype.c b/gobject/pygtype.c index df8530f4..84a07817 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); } |