diff options
author | Owen Taylor <otaylor@redhat.com> | 2003-10-23 04:22:32 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2003-10-23 04:22:32 +0000 |
commit | b3bae3b40ab92ad5a5dab65da3c3440efae975d4 (patch) | |
tree | 9301956750d991c3fe99e7862c44fbc104aa44a8 /tests/prop-editor.c | |
parent | 3724a591d822c3bc53ce829407a142e19d418acf (diff) | |
download | gtk+-b3bae3b40ab92ad5a5dab65da3c3440efae975d4.tar.gz |
gtk/gtkfilechooserutils.c gtk/gtkfilechooserprivate.[ch]: Basic framework
Wed Oct 22 23:20:04 2003 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilechooser.[ch] gtk/gtkfilefilter.[ch]
gtk/gtkfilechooserwidget.[ch] gtk/gtkfilechooserdialog.[ch]:
gtk/gtkfilechooserutils.c gtk/gtkfilechooserprivate.[ch]:
Basic framework for the new file selector widget.
* gtk/gtkfilechooserdefault.[ch] gtk/gtkcellrenderersep.[ch]
gtk/gtkfilechooserentry.[ch] gtk/gtkfilesystemmodel.[ch]:
Initial implementation of the GtkFileChooser user interface.
* gtk/gtkfilesystemunix.[ch]: GtkFileSystem implementation
for Unix files.
* configure.in gtk/Makefile.am gtk/xdgmime: Build code
for freedesktop.org MIME system on Unix.
* tests/testfilechooser.c: Test program for GtkFileChooser
* tests/prop-editor.c: Add support for properties on interfaces.
Diffstat (limited to 'tests/prop-editor.c')
-rw-r--r-- | tests/prop-editor.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/tests/prop-editor.c b/tests/prop-editor.c index 851f700a6b..c9fe9d6d3b 100644 --- a/tests/prop-editor.c +++ b/tests/prop-editor.c @@ -686,13 +686,20 @@ properties_from_type (GObject *object, GtkWidget *sw; GtkWidget *vbox; GtkWidget *table; - GObjectClass *class; GParamSpec **specs; gint n_specs; int i; - class = G_OBJECT_CLASS (g_type_class_peek (type)); - specs = g_object_class_list_properties (class, &n_specs); + if (G_TYPE_IS_INTERFACE (type)) + { + gpointer vtable = g_type_default_interface_peek (type); + specs = g_object_interface_list_properties (vtable, &n_specs); + } + else + { + GObjectClass *class = G_OBJECT_CLASS (g_type_class_peek (type)); + specs = g_object_class_list_properties (class, &n_specs); + } if (n_specs == 0) return NULL; @@ -775,7 +782,9 @@ create_prop_editor (GObject *object, GtkWidget *properties; GtkWidget *label; gchar *title; - + GType *ifaces; + guint n_ifaces; + if ((win = g_object_get_data (G_OBJECT (object), "prop-editor-win"))) { gtk_window_present (GTK_WINDOW (win)); @@ -820,6 +829,20 @@ create_prop_editor (GObject *object, type = g_type_parent (type); } + + ifaces = g_type_interfaces (G_TYPE_FROM_INSTANCE (object), &n_ifaces); + while (n_ifaces--) + { + properties = properties_from_type (object, ifaces[n_ifaces], tips); + if (properties) + { + label = gtk_label_new (g_type_name (ifaces[n_ifaces])); + gtk_notebook_append_page (GTK_NOTEBOOK (notebook), + properties, label); + } + } + + g_free (ifaces); } else { |