changeset 4213:56e189ecb477

branch merge
author Tomasz Mon <desowin@gmail.com>
date Tue, 22 Jan 2008 22:41:42 +0100
parents 47352b34dbdf (diff) 408b520f39fd (current diff)
children 41655c090c53
files
diffstat 12 files changed, 26 insertions(+), 98 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/ui_skinned_button.c	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/ui_skinned_button.c	Tue Jan 22 22:41:42 2008 +0100
@@ -329,17 +329,8 @@
             break;
     }
 
-    GdkPixbuf *image = NULL;
-    if (priv->double_size) {
-        image = gdk_pixbuf_scale_simple(obj, priv->w*2, priv->h*2, GDK_INTERP_NEAREST);
-    } else {
-        image = gdk_pixbuf_copy(obj);
-    }
-
-    gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0, priv->w*(1+priv->double_size), priv->h*(1+priv->double_size), GDK_RGB_DITHER_NONE, 0, 0);
-
+    ui_skinned_widget_draw(widget, obj, priv->w, priv->h, priv->double_size);
     g_object_unref(obj);
-    g_object_unref(image);
 
     return FALSE;
 }
--- a/src/audacious/ui_skinned_equalizer_slider.c	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/ui_skinned_equalizer_slider.c	Tue Jan 22 22:41:42 2008 +0100
@@ -221,19 +221,9 @@
     else
         skin_draw_pixbuf(widget, bmp_active_skin, obj, priv->skin_index, 0, 164, 1, priv->position, 11, 11);
 
-    GdkPixbuf *image = NULL;
-    if (priv->double_size) {
-        image = gdk_pixbuf_scale_simple(obj, priv->width*2, priv->height*2, GDK_INTERP_NEAREST);
-    } else {
-        image = gdk_pixbuf_copy(obj);
-    }
-
-    gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0,
-                    priv->width*(1+priv->double_size), priv->height*(1+priv->double_size),
-                    GDK_RGB_DITHER_NONE, 0, 0);
+    ui_skinned_widget_draw(widget, obj, priv->width, priv->height, priv->double_size);
 
     g_object_unref(obj);
-    g_object_unref(image);
 
     return FALSE;
 }
--- a/src/audacious/ui_skinned_horizontal_slider.c	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/ui_skinned_horizontal_slider.c	Tue Jan 22 22:41:42 2008 +0100
@@ -263,19 +263,9 @@
                          ((priv->height - priv->knob_height) / 2),
                          priv->knob_width, priv->knob_height);
 
-    GdkPixbuf *image = NULL;
-    if (priv->double_size) {
-        image = gdk_pixbuf_scale_simple(obj, priv->width*2, priv->height*2, GDK_INTERP_NEAREST);
-    } else {
-        image = gdk_pixbuf_copy(obj);
-    }
-
-    gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0,
-                    priv->width*(1+priv->double_size), priv->height*(1+priv->double_size),
-                    GDK_RGB_DITHER_NONE, 0, 0);
+    ui_skinned_widget_draw(widget, obj, priv->width, priv->height, priv->double_size);
 
     g_object_unref(obj);
-    g_object_unref(image);
 
     return FALSE;
 }
--- a/src/audacious/ui_skinned_menurow.c	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/ui_skinned_menurow.c	Tue Jan 22 22:41:42 2008 +0100
@@ -236,19 +236,9 @@
                              menurow->sx + 24, menurow->sy + 26, 0, 26, 8, 8);
     }
 
-    GdkPixbuf *image = NULL;
-    if (menurow->double_size) {
-        image = gdk_pixbuf_scale_simple(obj, menurow->width*2, menurow->height*2, GDK_INTERP_NEAREST);
-    } else {
-        image = gdk_pixbuf_copy(obj);
-    }
-
-    gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0,
-                    menurow->width*(1+menurow->double_size), menurow->height*(1+menurow->double_size),
-                    GDK_RGB_DITHER_NONE, 0, 0);
+    ui_skinned_widget_draw(widget, obj, menurow->width, menurow->height, menurow->double_size);
 
     g_object_unref(obj);
-    g_object_unref(image);
 
     return FALSE;
 }
--- a/src/audacious/ui_skinned_monostereo.c	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/ui_skinned_monostereo.c	Tue Jan 22 22:41:42 2008 +0100
@@ -198,19 +198,9 @@
         break;
     }
 
-    GdkPixbuf *image = NULL;
-    if (monostereo->double_size) {
-        image = gdk_pixbuf_scale_simple(obj, monostereo->width*2, monostereo->height*2, GDK_INTERP_NEAREST);
-    } else {
-        image = gdk_pixbuf_copy(obj);
-    }
-
-    gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0,
-                    monostereo->width*(1+monostereo->double_size), monostereo->height*(1+monostereo->double_size),
-                    GDK_RGB_DITHER_NONE, 0, 0);
+    ui_skinned_widget_draw(widget, obj, monostereo->width, monostereo->height, monostereo->double_size);
 
     g_object_unref(obj);
-    g_object_unref(image);
 
     return FALSE;
 }
--- a/src/audacious/ui_skinned_number.c	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/ui_skinned_number.c	Tue Jan 22 22:41:42 2008 +0100
@@ -195,19 +195,9 @@
                      number->skin_index, number->num * 9, 0,
                      0, 0, number->width, number->height);
 
-    GdkPixbuf *image = NULL;
-    if (number->double_size) {
-        image = gdk_pixbuf_scale_simple(obj, number->width*2, number->height*2, GDK_INTERP_NEAREST);
-    } else {
-        image = gdk_pixbuf_copy(obj);
-    }
-
-    gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0,
-                    number->width*(1+number->double_size), number->height*(1+number->double_size),
-                    GDK_RGB_DITHER_NONE, 0, 0);
+    ui_skinned_widget_draw(widget, obj, number->width, number->height, number->double_size);
 
     g_object_unref(obj);
-    g_object_unref(image);
 
     return FALSE;
 }
--- a/src/audacious/ui_skinned_playlist_slider.c	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/ui_skinned_playlist_slider.c	Tue Jan 22 22:41:42 2008 +0100
@@ -249,7 +249,8 @@
     /* drawing knob */
     skin_draw_pixbuf(widget, bmp_active_skin, obj, priv->skin_index, ps->pressed ? 61 : 52, 53, 0, y, priv->width, 18);
 
-    gdk_draw_pixbuf(widget->window, NULL, obj, 0, 0, 0, 0, priv->width, priv->height, GDK_RGB_DITHER_NONE, 0, 0);
+    ui_skinned_widget_draw(widget, obj, priv->width, priv->height, FALSE);
+
     g_object_unref(obj);
 
     return FALSE;
--- a/src/audacious/ui_skinned_playstatus.c	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/ui_skinned_playstatus.c	Tue Jan 22 22:41:42 2008 +0100
@@ -204,19 +204,9 @@
         break;
     }
 
-    GdkPixbuf *image = NULL;
-    if (playstatus->double_size) {
-        image = gdk_pixbuf_scale_simple(obj, playstatus->width*2, playstatus->height*2, GDK_INTERP_NEAREST);
-    } else {
-        image = gdk_pixbuf_copy(obj);
-    }
-
-    gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0,
-                    playstatus->width*(1+playstatus->double_size), playstatus->height*(1+playstatus->double_size),
-                    GDK_RGB_DITHER_NONE, 0, 0);
+    ui_skinned_widget_draw(widget, obj, playstatus->width, playstatus->height, playstatus->double_size);
 
     g_object_unref(obj);
-    g_object_unref(image);
 
     return FALSE;
 }
--- a/src/audacious/ui_skinned_textbox.c	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/ui_skinned_textbox.c	Tue Jan 22 22:41:42 2008 +0100
@@ -317,20 +317,9 @@
             }
         }
 
-        GdkPixbuf *image = NULL;
-        if (priv->double_size) {
-            image = gdk_pixbuf_scale_simple(obj, textbox->width*2, textbox->height*2, GDK_INTERP_NEAREST);
-        } else {
-            image = gdk_pixbuf_copy(obj);
-        }
-
-        gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0,
-                        textbox->width*(1+priv->double_size), textbox->height*(1+priv->double_size),
-                        GDK_RGB_DITHER_NONE, 0, 0);
+        ui_skinned_widget_draw(widget, obj, textbox->width, textbox->height, priv->double_size);
 
         g_object_unref(obj);
-        g_object_unref(image);
-
     }
 
     return FALSE;
--- a/src/audacious/ui_skinned_window.c	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/ui_skinned_window.c	Tue Jan 22 22:41:42 2008 +0100
@@ -203,15 +203,8 @@
             break;
     }
 
-    if (window->type != WINDOW_PLAYLIST && cfg.doublesize) {
-        GdkPixbuf *image = gdk_pixbuf_scale_simple(obj, width*2, height*2, GDK_INTERP_NEAREST);
-        gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0, width*2, height*2,
-                        GDK_RGB_DITHER_NONE, 0, 0);
-        g_object_unref(image);
-    } else {
-        gdk_draw_pixbuf(widget->window, NULL, obj, 0, 0, 0, 0, width, height,
-                        GDK_RGB_DITHER_NONE, 0, 0);
-    }
+    ui_skinned_widget_draw(GTK_WIDGET(window), obj, width, height,
+                           window->type != WINDOW_PLAYLIST && cfg.doublesize);
 
     g_object_unref(obj);
 
--- a/src/audacious/util.c	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/util.c	Tue Jan 22 22:41:42 2008 +0100
@@ -908,6 +908,19 @@
     return image;
 }
 
+void ui_skinned_widget_draw(GtkWidget *widget, GdkPixbuf *obj, gint width, gint height, gboolean scale) {
+    g_return_if_fail(widget != NULL);
+    g_return_if_fail(obj != NULL);
+
+    if (scale) {
+        GdkPixbuf *image = gdk_pixbuf_scale_simple(obj, width*2, height*2, GDK_INTERP_NEAREST);
+        gdk_draw_pixbuf(widget->window, NULL, image, 0, 0, 0, 0, width*2, height*2, GDK_RGB_DITHER_NONE, 0, 0);
+        g_object_unref(image);
+    } else {
+        gdk_draw_pixbuf(widget->window, NULL, obj, 0, 0, 0, 0, width, height, GDK_RGB_DITHER_NONE, 0, 0);
+    }
+}
+
 /**
  * xmms_show_message:
  * @title: The title of the message to show.
--- a/src/audacious/util.h	Mon Jan 21 22:15:39 2008 -0600
+++ b/src/audacious/util.h	Tue Jan 22 22:41:42 2008 +0100
@@ -97,6 +97,7 @@
                             gpointer action_data);
 
 GdkPixmap *create_dblsize_pixmap(GdkPixmap *pix);
+void ui_skinned_widget_draw(GtkWidget *widget, GdkPixbuf *obj, gint width, gint height, gboolean scale);
 
 GdkPixbuf *audacious_create_colorized_pixbuf(GdkPixbuf *src, gint red, gint green, gint blue);