[glade] Move GladeWidgetAdaptor code for GtkAdjustment into it's own C file



commit 7fa6949a33c8e6b53b1291efd1e2b234474d068d
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date:   Sat May 4 16:03:35 2013 +0900

    Move GladeWidgetAdaptor code for GtkAdjustment into it's own C file

 plugins/gtk+/Makefile.am            |    1 +
 plugins/gtk+/glade-gtk-adjustment.c |   51 +++++++++++++++++++++++++++++++++++
 plugins/gtk+/glade-gtk.c            |   26 ------------------
 po/POTFILES.in                      |    1 +
 4 files changed, 53 insertions(+), 26 deletions(-)
---
diff --git a/plugins/gtk+/Makefile.am b/plugins/gtk+/Makefile.am
index 1a25219..8778ef9 100644
--- a/plugins/gtk+/Makefile.am
+++ b/plugins/gtk+/Makefile.am
@@ -35,6 +35,7 @@ libgladegtk_la_SOURCES =              \
        glade-gtk.c                     \
        glade-gtk-about-dialog.c        \
        glade-gtk-action-widgets.c      \
+       glade-gtk-adjustment.c          \
        glade-gtk-assistant.c           \
        glade-gtk-box.c                 \
        glade-gtk-button.c              \
diff --git a/plugins/gtk+/glade-gtk-adjustment.c b/plugins/gtk+/glade-gtk-adjustment.c
new file mode 100644
index 0000000..0340c71
--- /dev/null
+++ b/plugins/gtk+/glade-gtk-adjustment.c
@@ -0,0 +1,51 @@
+/*
+ * glade-gtk-adjustment.c - GladeWidgetAdaptor for GtkAdjustment
+ *
+ * Copyright (C) 2013 Tristan Van Berkom
+ *
+ * Authors:
+ *      Tristan Van Berkom <tristan van berkom 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 <glib/gi18n-lib.h>
+#include <gladeui/glade.h>
+
+void
+glade_gtk_adjustment_write_widget (GladeWidgetAdaptor * adaptor,
+                                   GladeWidget * widget,
+                                   GladeXmlContext * context,
+                                   GladeXmlNode * node)
+{
+  GladeProperty *prop;
+
+  if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET) ||
+       glade_xml_node_verify_silent (node, GLADE_XML_TAG_TEMPLATE)))
+    return;
+
+  /* Ensure proper order of adjustment properties by writing them here. */
+  prop = glade_widget_get_property (widget, "lower");
+  glade_property_write (prop, context, node);
+
+  prop = glade_widget_get_property (widget, "upper");
+  glade_property_write (prop, context, node);
+
+  prop = glade_widget_get_property (widget, "value");
+  glade_property_write (prop, context, node);
+
+  GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget (adaptor, widget, context, node);
+}
diff --git a/plugins/gtk+/glade-gtk.c b/plugins/gtk+/glade-gtk.c
index 82b4016..9abbf93 100644
--- a/plugins/gtk+/glade-gtk.c
+++ b/plugins/gtk+/glade-gtk.c
@@ -78,32 +78,6 @@ glade_gtk_init (const gchar * name)
 {
 }
 
-/*--------------------------- GtkAdjustment ---------------------------------*/
-void
-glade_gtk_adjustment_write_widget (GladeWidgetAdaptor * adaptor,
-                                   GladeWidget * widget,
-                                   GladeXmlContext * context,
-                                   GladeXmlNode * node)
-{
-  GladeProperty *prop;
-
-  if (!(glade_xml_node_verify_silent (node, GLADE_XML_TAG_WIDGET) ||
-       glade_xml_node_verify_silent (node, GLADE_XML_TAG_TEMPLATE)))
-    return;
-
-  /* Ensure proper order of adjustment properties by writing them here. */
-  prop = glade_widget_get_property (widget, "lower");
-  glade_property_write (prop, context, node);
-
-  prop = glade_widget_get_property (widget, "upper");
-  glade_property_write (prop, context, node);
-
-  prop = glade_widget_get_property (widget, "value");
-  glade_property_write (prop, context, node);
-
-  GWA_GET_CLASS (G_TYPE_OBJECT)->write_widget (adaptor, widget, context, node);
-}
-
 
 /*--------------------------- GtkAction ---------------------------------*/
 #define ACTION_ACCEL_INSENSITIVE_MSG _("The accelerator can only be set when inside an Action Group.")
diff --git a/po/POTFILES.in b/po/POTFILES.in
index ed636a2..0fdc46f 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -64,6 +64,7 @@ plugins/gtk+/glade-fixed.c
 plugins/gtk+/glade-gtk.c
 plugins/gtk+/glade-gtk-about-dialog.c
 plugins/gtk+/glade-gtk-action-widgets.c
+plugins/gtk+/glade-gtk-adjustment.c
 plugins/gtk+/glade-gtk-assistant.c
 plugins/gtk+/glade-gtk-box.c
 plugins/gtk+/glade-gtk-button.c


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