summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2011-04-05 01:22:34 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2011-04-05 01:24:32 -0300
commit335fac30af85ec94de94ef9dd38c0c7650141cf7 (patch)
treee7fc4d49d9473e8b7bd1eec0b5d753cc6092961b
parent5c9de1d805ee5d29057cba69322cd59f071e6688 (diff)
downloadglade-335fac30af85ec94de94ef9dd38c0c7650141cf7.tar.gz
* gladeui/glade-widget-adaptor.[ch]:
o removed GladeGetInternalChildrenFunc, replaced by making GladeGetChildrenFunc base implementation return internal children * plugins/gtk+/glade-gtk.c: glade_gtk_container_get_children() chain up to parent implementation
-rw-r--r--gladeui/glade-widget-adaptor.c28
-rw-r--r--gladeui/glade-widget-adaptor.h16
-rw-r--r--plugins/gtk+/glade-gtk.c23
3 files changed, 18 insertions, 49 deletions
diff --git a/gladeui/glade-widget-adaptor.c b/gladeui/glade-widget-adaptor.c
index 364b24ef..a2a1a2f9 100644
--- a/gladeui/glade-widget-adaptor.c
+++ b/gladeui/glade-widget-adaptor.c
@@ -1277,13 +1277,12 @@ glade_widget_adaptor_object_create_editable (GladeWidgetAdaptor * adaptor,
return (GladeEditable *) glade_editor_table_new (adaptor, type);
}
-static void
-gwa_get_internal_children (GladeWidgetAdaptor *adaptor,
- GObject *object,
- GList **children,
- GList *list)
+static GList *
+glade_widget_adaptor_object_get_children (GladeWidgetAdaptor *adaptor,
+ GObject *object)
{
- GList *l;
+ GList *list = adaptor->priv->internal_children;
+ GList *l, *children = NULL;
for (l = list; l; l = g_list_next (l))
{
@@ -1294,20 +1293,8 @@ gwa_get_internal_children (GladeWidgetAdaptor *adaptor,
object,
internal->name);
if (child)
- *children = g_list_prepend (*children, child);
-
- if (internal->children)
- gwa_get_internal_children (adaptor, object, children, internal->children);
+ children = g_list_prepend (children, child);
}
-}
-
-static GList *
-glade_widget_adaptor_object_get_internal_children (GladeWidgetAdaptor *adaptor,
- GObject *object)
-{
- GList *children = NULL;
-
- gwa_get_internal_children (adaptor, object, &children, adaptor->priv->internal_children);
return children;
}
@@ -1351,7 +1338,7 @@ glade_widget_adaptor_class_init (GladeWidgetAdaptorClass * adaptor_class)
adaptor_class->add = NULL;
adaptor_class->remove = NULL;
adaptor_class->replace_child = NULL;
- adaptor_class->get_children = NULL;
+ adaptor_class->get_children = glade_widget_adaptor_object_get_children;
adaptor_class->child_set_property = NULL;
adaptor_class->child_get_property = NULL;
adaptor_class->action_activate = glade_widget_adaptor_object_action_activate;
@@ -1365,7 +1352,6 @@ glade_widget_adaptor_class_init (GladeWidgetAdaptorClass * adaptor_class)
adaptor_class->create_eprop = glade_widget_adaptor_object_create_eprop;
adaptor_class->string_from_value = glade_widget_adaptor_object_string_from_value;
adaptor_class->create_editable = glade_widget_adaptor_object_create_editable;
- adaptor_class->get_internal_children = glade_widget_adaptor_object_get_internal_children;
/* Base defaults here */
adaptor_class->toplevel = FALSE;
diff --git a/gladeui/glade-widget-adaptor.h b/gladeui/glade-widget-adaptor.h
index 0559394a..ab33a531 100644
--- a/gladeui/glade-widget-adaptor.h
+++ b/gladeui/glade-widget-adaptor.h
@@ -329,18 +329,6 @@ typedef GList *(* GladeGetChildrenFunc) (GladeWidgetAdaptor *adaptor,
GObject *container);
/**
- * GladeGetInternalChildrenFunc:
- * @adaptor: A #GladeWidgetAdaptor
- * @object: A #GObject container
- *
- * A function called to get @object internal children.
- *
- * Returns: A #GList of #GObject internal children.
- */
-typedef GList *(* GladeGetInternalChildrenFunc) (GladeWidgetAdaptor *adaptor,
- GObject *container);
-
-/**
* GladeAddChildFunc:
* @adaptor: A #GladeWidgetAdaptor
* @parent: A #GObject container
@@ -671,9 +659,7 @@ struct _GladeWidgetAdaptorClass
GladeCreateEPropFunc create_eprop; /* Creates a GladeEditorProperty */
GladeStringFromValueFunc string_from_value; /* Creates a string for a value */
GladeCreateEditableFunc create_editable; /* Creates a page for the editor */
-
- GladeGetInternalChildrenFunc get_internal_children; /* Return the list of internal children */
-
+
void (* glade_reserved1) (void);
void (* glade_reserved2) (void);
void (* glade_reserved3) (void);
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index 876ea60f..b10521d0 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -1224,22 +1224,19 @@ glade_gtk_container_get_child_property (GladeWidgetAdaptor * adaptor,
GList *
glade_gtk_container_get_children (GladeWidgetAdaptor *adaptor,
- GtkContainer *container)
+ GObject *container)
{
- GList *children;
-
- children = glade_util_container_get_all_children (container);
+ GList *parent_children, *children;
- if (GWA_GET_CLASS (GTK_TYPE_CONTAINER)->get_internal_children)
- {
- GList *internal;
-
- internal = GWA_GET_CLASS (GTK_TYPE_CONTAINER)->get_internal_children (adaptor, G_OBJECT (container));
-
- return glade_util_purify_list (g_list_concat (children, internal));
- }
+ children = glade_util_container_get_all_children (GTK_CONTAINER (container));
+
+ /* Chain up */
+ if (GWA_GET_CLASS (GTK_TYPE_WIDGET)->get_children)
+ parent_children = GWA_GET_CLASS (GTK_TYPE_WIDGET)->get_children (adaptor, container);
else
- return children;
+ parent_children = NULL;
+
+ return glade_util_purify_list (g_list_concat (children, parent_children));
}
GladeEditable *