[rhythmbox] remove rb_image_new_from_stock



commit df57c71a25f57c3a25944f91508839d7190071be
Author: Jonathan Matthew <jonathan d14n org>
Date:   Mon Feb 23 23:19:03 2015 +1000

    remove rb_image_new_from_stock

 lib/rb-util.c |   84 ---------------------------------------------------------
 lib/rb-util.h |    2 -
 2 files changed, 0 insertions(+), 86 deletions(-)
---
diff --git a/lib/rb-util.c b/lib/rb-util.c
index 745a31d..2cbd5e4 100644
--- a/lib/rb-util.c
+++ b/lib/rb-util.c
@@ -292,90 +292,6 @@ rb_safe_strcmp (const char *a,
        return (!a && !b) ? 0 : (a && !b) || (!a && b) ? 1 : strcmp (a, b);
 }
 
-/* Taken from totem/video-utils.c CVS HEAD 2004-04-22 */
-static void
-totem_pixbuf_mirror (GdkPixbuf *pixbuf)
-{
-       int i, j, rowstride, offset, right;
-       guchar *pixels;
-       int width, height, size;
-       guint32 tmp;
-
-       pixels = gdk_pixbuf_get_pixels (pixbuf);
-       g_return_if_fail (pixels != NULL);
-
-       width = gdk_pixbuf_get_width (pixbuf);
-       height = gdk_pixbuf_get_height (pixbuf);
-       rowstride = gdk_pixbuf_get_rowstride (pixbuf);
-       size = height * width * sizeof (guint32);
-
-       for (i = 0; i < size; i += rowstride)
-       {
-               for (j = 0; j < rowstride; j += sizeof(guint32))
-               {
-                       offset = i + j;
-                       right = i + (((width - 1) * sizeof(guint32)) - j);
-
-                       if (right <= offset)
-                               break;
-
-                       memcpy (&tmp, pixels + offset, sizeof(guint32));
-                       memcpy (pixels + offset, pixels + right,
-                                       sizeof(guint32));
-                       memcpy (pixels + right, &tmp, sizeof(guint32));
-               }
-       }
-}
-
-
-
-/**
- * rb_image_new_from_stock:
- * @stock_id: stock image id
- * @size: requested icon size
- *
- * Same as @gtk_image_new_from_stock except that it mirrors the icons for RTL
- * languages.
- *
- * Return value: (transfer full): a #GtkImage of the requested stock item
- */
-GtkWidget *
-rb_image_new_from_stock (const gchar *stock_id, GtkIconSize size)
-{
-       if (gtk_widget_get_default_direction () == GTK_TEXT_DIR_LTR) {
-               return gtk_image_new_from_stock (stock_id, size);
-       } else {
-
-               GtkWidget *image;
-               GdkPixbuf *pixbuf;
-               GdkPixbuf *mirror;
-               
-               image = gtk_image_new ();
-               
-               if (image == NULL) {
-                       return NULL;
-               }
-               
-               pixbuf = gtk_widget_render_icon_pixbuf (image, stock_id, size);
-               g_assert (pixbuf != NULL);
-               
-               
-               mirror = gdk_pixbuf_copy (pixbuf);
-               g_object_unref (pixbuf);
-
-               if (!mirror)
-                       return NULL;
-
-               totem_pixbuf_mirror (mirror);
-               gtk_image_set_from_pixbuf (GTK_IMAGE (image), mirror);
-               g_object_unref (mirror);
-
-               return image;
-       }
-
-       return NULL;
-}
-
 /**
  * rb_is_main_thread:
  *
diff --git a/lib/rb-util.h b/lib/rb-util.h
index 0c767f3..68d3dd4 100644
--- a/lib/rb-util.h
+++ b/lib/rb-util.h
@@ -56,8 +56,6 @@ char *rb_make_time_string (guint seconds);
 char *rb_make_duration_string (guint duration);
 char *rb_make_elapsed_time_string (guint elapsed, guint duration, gboolean show_remaining);
 
-GtkWidget *rb_image_new_from_stock (const gchar *stock_id, GtkIconSize size);
-
 void rb_threads_init (void);
 gboolean rb_is_main_thread (void);
 


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