[glade/internal-children] Finished GtkInfoBar support and removed debug messages



commit 206aef7d0481b5a7be013f0223e0db1d364e72f6
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Sat Mar 5 20:24:06 2011 -0300

    Finished GtkInfoBar support and removed debug messages

 gladeui/glade-widget-adaptor.c          |    9 +----
 plugins/gtk+/glade-gtk-action-widgets.c |    4 +--
 plugins/gtk+/glade-gtk-action-widgets.h |   46 ++++++++++++++++++++++++++
 plugins/gtk+/glade-gtk-info-bar.c       |   53 +++++++++++++++++++++++++++++++
 plugins/gtk+/glade-gtk.c                |    1 -
 plugins/gtk+/gtk+.xml.in                |    4 +-
 6 files changed, 104 insertions(+), 13 deletions(-)
---
diff --git a/gladeui/glade-widget-adaptor.c b/gladeui/glade-widget-adaptor.c
index 2d22789..12195e2 100644
--- a/gladeui/glade-widget-adaptor.c
+++ b/gladeui/glade-widget-adaptor.c
@@ -882,8 +882,6 @@ glade_widget_adaptor_get_internal_child_impl (GladeWidgetAdaptor *adaptor,
 {
   static GtkBuilder *builder = NULL;
   
-  g_message ("%s %d %p, %s", __func__, GTK_IS_BUILDABLE (object), object, name);
-  
   g_return_val_if_fail (GTK_IS_BUILDABLE (object), NULL);
 
   /* Dummy object just in case the interface use it for something */
@@ -3060,8 +3058,6 @@ gwa_internal_children_create (GladeWidgetAdaptor *adaptor,
   GladeWidget *gobject = glade_widget_get_from_gobject (object);
   GList *l;
 
-  g_message ("%s", __func__);
-
   for (l = children; l; l = g_list_next (l))
     {
       GladeInternalChild *internal = l->data;
@@ -3070,7 +3066,7 @@ gwa_internal_children_create (GladeWidgetAdaptor *adaptor,
       child = glade_widget_adaptor_get_internal_child (adaptor,
                                                        parent_object,
                                                        internal->name);
-      g_message ("%s child %s=%p", __func__, internal->name, child);
+
       if (child)
         {
           glade_widget_adaptor_create_internal (gobject,
@@ -3101,7 +3097,7 @@ glade_widget_adaptor_post_create (GladeWidgetAdaptor *adaptor,
   g_return_if_fail (GLADE_IS_WIDGET_ADAPTOR (adaptor));
   g_return_if_fail (G_IS_OBJECT (object));
   g_return_if_fail (g_type_is_a (G_OBJECT_TYPE (object), adaptor->priv->type));
-g_message ("%s start", __func__);
+
   /* Create internal widgets */
   if (adaptor->priv->internal_children)
       gwa_internal_children_create (adaptor, object, object, adaptor->priv->internal_children, reason);
@@ -3118,7 +3114,6 @@ g_message ("%s start", __func__);
     GLADE_WIDGET_ADAPTOR_GET_CLASS (adaptor)->post_create (adaptor, object,
                                                            reason);
   /* XXX Dont complain here if no implementation is found */
-g_message ("%s end", __func__);
 }
 
 /**
diff --git a/plugins/gtk+/glade-gtk-action-widgets.c b/plugins/gtk+/glade-gtk-action-widgets.c
index 2a9b3c6..053428b 100644
--- a/plugins/gtk+/glade-gtk-action-widgets.c
+++ b/plugins/gtk+/glade-gtk-action-widgets.c
@@ -105,7 +105,7 @@ glade_gtk_action_widgets_write_responses (GladeWidget *widget,
       if ((property =
            glade_widget_get_property (action_widget, "response-id")) == NULL)
         continue;
-  g_message ("%s:%d", __func__, __LINE__);
+
       widget_node = glade_xml_node_new (context, GLADE_TAG_ACTION_WIDGET);
       glade_xml_node_append_child (node, widget_node);
 
@@ -142,8 +142,6 @@ glade_gtk_action_widgets_write_child (GladeWidget *widget,
 {
   GladeXmlNode *widgets_node;
 
-  g_message ("%s:%d", __func__, __LINE__);
-
   widgets_node = glade_xml_node_new (context, GLADE_TAG_ACTION_WIDGETS);
 
   glade_gtk_action_widgets_write_responses (widget, context, widgets_node, action_container);
diff --git a/plugins/gtk+/glade-gtk-action-widgets.h b/plugins/gtk+/glade-gtk-action-widgets.h
new file mode 100644
index 0000000..283786f
--- /dev/null
+++ b/plugins/gtk+/glade-gtk-action-widgets.h
@@ -0,0 +1,46 @@
+/*
+ * glade-gtk-action-widgets.h
+ *
+ * Copyright (C) 2011 Juan Pablo Ugarte.
+ *
+ * Author:
+ *   Juan Pablo Ugarte <juanpablougarte gmail com>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public 
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef __GLADE_GTK_ACTION_WIDGETS_H__
+#define __GLADE_GTK_ACTION_WIDGETS_H__
+
+#include <gladeui/glade.h>
+
+G_BEGIN_DECLS
+
+#define GLADE_TAG_ACTION_WIDGETS "action-widgets"
+#define GLADE_TAG_ACTION_WIDGET  "action-widget"
+#define GLADE_TAG_RESPONSE       "response"
+
+void glade_gtk_action_widgets_read_child  (GladeWidget *widget,
+                                           GladeXmlNode *node,
+                                           gchar *action_container);
+
+void glade_gtk_action_widgets_write_child (GladeWidget *widget,
+                                           GladeXmlContext *context,
+                                           GladeXmlNode *node,
+                                           gchar *action_container);
+G_END_DECLS
+
+#endif /* __GLADE_GTK_ACTION_WIDGETS_H__ */
diff --git a/plugins/gtk+/glade-gtk-info-bar.c b/plugins/gtk+/glade-gtk-info-bar.c
new file mode 100644
index 0000000..ba45dc9
--- /dev/null
+++ b/plugins/gtk+/glade-gtk-info-bar.c
@@ -0,0 +1,53 @@
+/*
+ * glade-gtk-info-bar.c
+ *
+ * Copyright (C) 2011 Juan Pablo Ugarte.
+ *
+ * Author:
+ *   Juan Pablo Ugarte <juanpablougarte gmail com>
+ *
+ * This library is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public 
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include <config.h>
+#include <gladeui/glade.h>
+#include "glade-gtk-action-widgets.h"
+
+void
+glade_gtk_info_bar_read_child (GladeWidgetAdaptor *adaptor,
+                               GladeWidget *widget,
+                               GladeXmlNode *node)
+{
+  GWA_GET_CLASS (GTK_TYPE_CONTAINER)->read_child (adaptor, widget, node);
+
+  node = glade_xml_node_get_parent (node);
+  
+  glade_gtk_action_widgets_read_child (widget, node, "action_area");
+}
+
+void
+glade_gtk_info_bar_write_child (GladeWidgetAdaptor *adaptor,
+                                GladeWidget *widget,
+                                GladeXmlContext *context,
+                                GladeXmlNode *node)
+{
+  GladeWidget *parent = glade_widget_get_parent (widget);
+
+  GWA_GET_CLASS (GTK_TYPE_BOX)->write_child (adaptor, widget, context, node);
+
+  if (parent && GTK_IS_INFO_BAR (glade_widget_get_object (parent)))
+    glade_gtk_action_widgets_write_child (parent, context, node, "action_area");
+}
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index 8e6993c..1413ea3 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -3919,7 +3919,6 @@ glade_gtk_dialog_post_create (GladeWidgetAdaptor *adaptor,
       vbox_widget = glade_widget_get_from_gobject (gtk_dialog_get_content_area (dialog));
       actionarea_widget = glade_widget_get_from_gobject (gtk_dialog_get_action_area (dialog));
 
-      g_message ("%s %p %p", __func__, actionarea_widget, gtk_dialog_get_action_area (dialog));
       /* We need to stop default emissions of "hierarchy-changed" and 
        * "screen-changed" of GtkFileChooserDefault to avoid an abort()
        * when doing a reparent.
diff --git a/plugins/gtk+/gtk+.xml.in b/plugins/gtk+/gtk+.xml.in
index 36e2ac7..3d4f52b 100644
--- a/plugins/gtk+/gtk+.xml.in
+++ b/plugins/gtk+/gtk+.xml.in
@@ -1769,8 +1769,8 @@ embedded in another object</_tooltip>
     <glade-widget-class name="GtkDrawingArea" generic-name="drawingarea" _title="Drawing Area"/>
     
     <glade-widget-class name="GtkInfoBar" generic-name="infobar" _title="Info Bar">
-      <read-widget-function>glade_gtk_info_bar_read_child</read-widget-function>
-      <write-widget-function>glade_gtk_info_bar_write_child</write-widget-function>
+      <read-child-function>glade_gtk_info_bar_read_child</read-child-function>
+      <write-child-function>glade_gtk_info_bar_write_child</write-child-function>
       <internal-children>
         <object name="action_area"/>
         <object name="content_area"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]