[metacity] theme: make meta_theme_load_image static



commit 1424fb8899c6cde5f628811f722d87bf682eb581
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Sun Jan 24 11:37:07 2016 +0200

    theme: make meta_theme_load_image static

 src/ui/theme-parser.c  |   51 ++++++++++++++++++++++++++++++++++++++++++++++++
 src/ui/theme-private.h |    5 ----
 src/ui/theme.c         |   51 ------------------------------------------------
 3 files changed, 51 insertions(+), 56 deletions(-)
---
diff --git a/src/ui/theme-parser.c b/src/ui/theme-parser.c
index 6e93b01..879a2ae 100644
--- a/src/ui/theme-parser.c
+++ b/src/ui/theme-parser.c
@@ -1661,6 +1661,57 @@ meta_image_fill_type_from_string (const char *str)
     return -1;
 }
 
+static GdkPixbuf *
+meta_theme_load_image (MetaTheme   *theme,
+                       const char  *filename,
+                       guint        size_of_theme_icons,
+                       GError     **error)
+{
+  GdkPixbuf *pixbuf;
+
+  pixbuf = g_hash_table_lookup (theme->images_by_filename,
+                                filename);
+
+  if (pixbuf == NULL)
+    {
+
+      if (g_str_has_prefix (filename, "theme:") &&
+          META_THEME_ALLOWS (theme, META_THEME_IMAGES_FROM_ICON_THEMES))
+        {
+          pixbuf = gtk_icon_theme_load_icon (
+              gtk_icon_theme_get_default (),
+              filename+6,
+              size_of_theme_icons,
+              0,
+              error);
+          if (pixbuf == NULL) return NULL;
+         }
+      else
+        {
+          char *full_path;
+          full_path = g_build_filename (theme->dirname, filename, NULL);
+
+          pixbuf = gdk_pixbuf_new_from_file (full_path, error);
+          if (pixbuf == NULL)
+            {
+              g_free (full_path);
+              return NULL;
+            }
+
+          g_free (full_path);
+        }
+      g_hash_table_replace (theme->images_by_filename,
+                            g_strdup (filename),
+                            pixbuf);
+    }
+
+  g_assert (pixbuf);
+
+  g_object_ref (G_OBJECT (pixbuf));
+
+  return pixbuf;
+}
+
 static void
 parse_draw_op_element (GMarkupParseContext  *context,
                        const gchar          *element_name,
diff --git a/src/ui/theme-private.h b/src/ui/theme-private.h
index 0e3b953..a349777 100644
--- a/src/ui/theme-private.h
+++ b/src/ui/theme-private.h
@@ -822,11 +822,6 @@ MetaFrameStyle        *meta_theme_get_frame_style              (MetaTheme
 gboolean               meta_theme_validate                     (MetaTheme                   *theme,
                                                                 GError                     **error);
 
-GdkPixbuf             *meta_theme_load_image                   (MetaTheme                   *theme,
-                                                                const char                  *filename,
-                                                                guint                        
size_of_theme_icons,
-                                                                GError                     **error);
-
 PangoFontDescription  *meta_style_info_create_font_desc        (MetaTheme                   *theme,
                                                                 MetaStyleInfo               *style_info);
 
diff --git a/src/ui/theme.c b/src/ui/theme.c
index 329ad80..3baa14e 100644
--- a/src/ui/theme.c
+++ b/src/ui/theme.c
@@ -5871,57 +5871,6 @@ meta_theme_validate (MetaTheme *theme,
   return TRUE;
 }
 
-GdkPixbuf*
-meta_theme_load_image (MetaTheme  *theme,
-                       const char *filename,
-                       guint size_of_theme_icons,
-                       GError    **error)
-{
-  GdkPixbuf *pixbuf;
-
-  pixbuf = g_hash_table_lookup (theme->images_by_filename,
-                                filename);
-
-  if (pixbuf == NULL)
-    {
-
-      if (g_str_has_prefix (filename, "theme:") &&
-          META_THEME_ALLOWS (theme, META_THEME_IMAGES_FROM_ICON_THEMES))
-        {
-          pixbuf = gtk_icon_theme_load_icon (
-              gtk_icon_theme_get_default (),
-              filename+6,
-              size_of_theme_icons,
-              0,
-              error);
-          if (pixbuf == NULL) return NULL;
-         }
-      else
-        {
-          char *full_path;
-          full_path = g_build_filename (theme->dirname, filename, NULL);
-
-          pixbuf = gdk_pixbuf_new_from_file (full_path, error);
-          if (pixbuf == NULL)
-            {
-              g_free (full_path);
-              return NULL;
-            }
-
-          g_free (full_path);
-        }
-      g_hash_table_replace (theme->images_by_filename,
-                            g_strdup (filename),
-                            pixbuf);
-    }
-
-  g_assert (pixbuf);
-
-  g_object_ref (G_OBJECT (pixbuf));
-
-  return pixbuf;
-}
-
 void
 meta_theme_set_composited (MetaTheme *theme,
                            gboolean   composited)


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