[gnome-control-center] background: Make a few functions private



commit 1416e68b92bc2e7063c6de303c385e28312f52cb
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Feb 10 11:35:29 2011 +0000

    background: Make a few functions private
    
    They were only used within gnome-wp-xml.c, and nowhere else
    so hide them there.

 panels/background/gnome-wp-item.c |   70 --------------------------------
 panels/background/gnome-wp-item.h |    5 --
 panels/background/gnome-wp-xml.c  |   81 +++++++++++++++++++++++++++++++++++++
 3 files changed, 81 insertions(+), 75 deletions(-)
---
diff --git a/panels/background/gnome-wp-item.c b/panels/background/gnome-wp-item.c
index 21f8c84..56ddefa 100644
--- a/panels/background/gnome-wp-item.c
+++ b/panels/background/gnome-wp-item.c
@@ -24,76 +24,6 @@
 #include <string.h>
 #include "gnome-wp-item.h"
 
-static struct {
-  GDesktopBackgroundStyle value;
-  gchar *string;
-} options_lookup[] = {
-  { G_DESKTOP_BACKGROUND_STYLE_CENTERED, "centered" },
-  { G_DESKTOP_BACKGROUND_STYLE_STRETCHED, "stretched" },
-  { G_DESKTOP_BACKGROUND_STYLE_SCALED, "scaled" },
-  { G_DESKTOP_BACKGROUND_STYLE_ZOOM, "zoom" },
-  { G_DESKTOP_BACKGROUND_STYLE_WALLPAPER, "wallpaper" },
-  { G_DESKTOP_BACKGROUND_STYLE_SPANNED, "spanned" },
-  { 0, NULL }
-};
-
-static struct {
-  GDesktopBackgroundShading value;
-  gchar *string;
-} shade_lookup[] = {
-  { G_DESKTOP_BACKGROUND_SHADING_SOLID, "solid" },
-  { G_DESKTOP_BACKGROUND_SHADING_HORIZONTAL, "horizontal-gradient" },
-  { G_DESKTOP_BACKGROUND_SHADING_VERTICAL, "vertical-gradient" },
-  { 0, NULL }
-};
-
-const gchar *wp_item_option_to_string (GDesktopBackgroundStyle type)
-{
-  int i;
-
-  for (i = 0; options_lookup[i].value != 0; i++) {
-    if (options_lookup[i].value == type)
-      return (const gchar *) options_lookup[i].string;
-  }
-
-  return "scaled";
-}
-
-const gchar *wp_item_shading_to_string (GDesktopBackgroundShading type)
-{
-  int i;
-
-  for (i = 0; shade_lookup[i].value != 0; i++) {
-    if (shade_lookup[i].value == type)
-      return (const gchar *) shade_lookup[i].string;
-  }
-
-  return "solid";
-}
-
-GDesktopBackgroundStyle wp_item_string_to_option (const gchar *option)
-{
-  gint i;
-
-  for (i = 0; options_lookup[i].value != 0; i++) {
-    if (g_str_equal (options_lookup[i].string, option))
-      return options_lookup[i].value;
-  }
-
-  return G_DESKTOP_BACKGROUND_STYLE_SCALED;
-}
-
-GDesktopBackgroundShading wp_item_string_to_shading (const gchar *shade_type)
-{
-  int i;
-
-  for (i = 0; shade_lookup[i].value != 0; i++) {
-    if (g_str_equal (shade_lookup[i].string, shade_type))
-      return options_lookup[i].value;
-  }
-  return G_DESKTOP_BACKGROUND_SHADING_SOLID;
-}
-
 static void set_bg_properties (GnomeWPItem *item)
 {
   if (!item->bg)
diff --git a/panels/background/gnome-wp-item.h b/panels/background/gnome-wp-item.h
index 01e40d5..c820269 100644
--- a/panels/background/gnome-wp-item.h
+++ b/panels/background/gnome-wp-item.h
@@ -86,9 +86,4 @@ void gnome_wp_item_update (GnomeWPItem *item);
 void gnome_wp_item_update_size (GnomeWPItem *item, GnomeDesktopThumbnailFactory *thumbs);
 void gnome_wp_item_ensure_gnome_bg (GnomeWPItem *item);
 
-const gchar *wp_item_option_to_string (GDesktopBackgroundStyle type);
-const gchar *wp_item_shading_to_string (GDesktopBackgroundShading type);
-GDesktopBackgroundStyle wp_item_string_to_option (const gchar *option);
-GDesktopBackgroundShading wp_item_string_to_shading (const gchar *shade_type);
-
 #endif
diff --git a/panels/background/gnome-wp-xml.c b/panels/background/gnome-wp-xml.c
index 4672ec3..46bddc2 100644
--- a/panels/background/gnome-wp-xml.c
+++ b/panels/background/gnome-wp-xml.c
@@ -23,6 +23,13 @@
 #include <gio/gio.h>
 #include <string.h>
 #include <libxml/parser.h>
+#include <libgnome-desktop/gnome-bg.h>
+#include <gsettings-desktop-schemas/gdesktop-enums.h>
+
+static const gchar *wp_item_option_to_string (GDesktopBackgroundStyle type);
+static const gchar *wp_item_shading_to_string (GDesktopBackgroundShading type);
+static GDesktopBackgroundStyle wp_item_string_to_option (const gchar *option);
+static GDesktopBackgroundShading wp_item_string_to_shading (const gchar *shade_type);
 
 static gboolean gnome_wp_xml_get_bool (const xmlNode * parent,
 				       const gchar * prop_name) {
@@ -380,3 +387,77 @@ void gnome_wp_xml_save_list (GnomeWpXml *data) {
   xmlFreeDoc (wplist);
   g_free (wpfile);
 }
+
+static struct {
+  GDesktopBackgroundStyle value;
+  gchar *string;
+} options_lookup[] = {
+  { G_DESKTOP_BACKGROUND_STYLE_CENTERED, "centered" },
+  { G_DESKTOP_BACKGROUND_STYLE_STRETCHED, "stretched" },
+  { G_DESKTOP_BACKGROUND_STYLE_SCALED, "scaled" },
+  { G_DESKTOP_BACKGROUND_STYLE_ZOOM, "zoom" },
+  { G_DESKTOP_BACKGROUND_STYLE_WALLPAPER, "wallpaper" },
+  { G_DESKTOP_BACKGROUND_STYLE_SPANNED, "spanned" },
+  { 0, NULL }
+};
+
+static struct {
+  GDesktopBackgroundShading value;
+  gchar *string;
+} shade_lookup[] = {
+  { G_DESKTOP_BACKGROUND_SHADING_SOLID, "solid" },
+  { G_DESKTOP_BACKGROUND_SHADING_HORIZONTAL, "horizontal-gradient" },
+  { G_DESKTOP_BACKGROUND_SHADING_VERTICAL, "vertical-gradient" },
+  { 0, NULL }
+};
+
+static const
+gchar *wp_item_option_to_string (GDesktopBackgroundStyle type)
+{
+  int i;
+
+  for (i = 0; options_lookup[i].value != 0; i++) {
+    if (options_lookup[i].value == type)
+      return (const gchar *) options_lookup[i].string;
+  }
+
+  return "scaled";
+}
+
+static const
+gchar *wp_item_shading_to_string (GDesktopBackgroundShading type)
+{
+  int i;
+
+  for (i = 0; shade_lookup[i].value != 0; i++) {
+    if (shade_lookup[i].value == type)
+      return (const gchar *) shade_lookup[i].string;
+  }
+
+  return "solid";
+}
+
+static GDesktopBackgroundStyle
+wp_item_string_to_option (const gchar *option)
+{
+  gint i;
+
+  for (i = 0; options_lookup[i].value != 0; i++) {
+    if (g_str_equal (options_lookup[i].string, option))
+      return options_lookup[i].value;
+  }
+
+  return G_DESKTOP_BACKGROUND_STYLE_SCALED;
+}
+
+static GDesktopBackgroundShading
+wp_item_string_to_shading (const gchar *shade_type)
+{
+  int i;
+
+  for (i = 0; shade_lookup[i].value != 0; i++) {
+    if (g_str_equal (shade_lookup[i].string, shade_type))
+      return options_lookup[i].value;
+  }
+  return G_DESKTOP_BACKGROUND_SHADING_SOLID;
+}



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