diff src/audacious/ui_skinned_playstatus.c @ 4195:2281da647da9

beggining of GdkPixbuf transition
author Tomasz Mon <desowin@gmail.com>
date Sat, 19 Jan 2008 06:03:03 +0100
parents 9d4b5cdae3ba
children 47352b34dbdf
line wrap: on
line diff
--- a/src/audacious/ui_skinned_playstatus.c	Wed Jan 16 11:37:25 2008 +0100
+++ b/src/audacious/ui_skinned_playstatus.c	Sat Jan 19 06:03:03 2008 +0100
@@ -181,46 +181,41 @@
     UiSkinnedPlaystatus *playstatus = UI_SKINNED_PLAYSTATUS (widget);
     g_return_val_if_fail (playstatus->width > 0 && playstatus->height > 0, FALSE);
 
-    GdkPixmap *obj = NULL;
-    GdkGC *gc;
-
-    obj = gdk_pixmap_new(NULL, playstatus->width, playstatus->height, gdk_rgb_get_visual()->depth);
-    gc = gdk_gc_new(obj);
+    GdkPixbuf *obj = NULL;
+    obj = gdk_pixbuf_new(GDK_COLORSPACE_RGB, TRUE, 8, playstatus->width, playstatus->height);
 
     if (playstatus->status == STATUS_STOP && playstatus->buffering == TRUE)
         playstatus->buffering = FALSE;
     if (playstatus->status == STATUS_PLAY && playstatus->buffering == TRUE)
-        skin_draw_pixmap(widget, bmp_active_skin, obj, gc, SKIN_PLAYPAUSE, 39, 0, 0, 0, 3, playstatus->height);
+        skin_draw_pixbuf(widget, bmp_active_skin, obj, SKIN_PLAYPAUSE, 39, 0, 0, 0, 3, playstatus->height);
     else if (playstatus->status == STATUS_PLAY)
-        skin_draw_pixmap(widget, bmp_active_skin, obj, gc, SKIN_PLAYPAUSE, 36, 0, 0, 0, 3, playstatus->height);
+        skin_draw_pixbuf(widget, bmp_active_skin, obj, SKIN_PLAYPAUSE, 36, 0, 0, 0, 3, playstatus->height);
     else
-        skin_draw_pixmap(widget, bmp_active_skin, obj, gc, SKIN_PLAYPAUSE, 27, 0, 0, 0, 2, playstatus->height);
+        skin_draw_pixbuf(widget, bmp_active_skin, obj, SKIN_PLAYPAUSE, 27, 0, 0, 0, 2, playstatus->height);
     switch (playstatus->status) {
     case STATUS_STOP:
-        skin_draw_pixmap(widget, bmp_active_skin, obj, gc, SKIN_PLAYPAUSE, 18, 0, 2, 0, 9, playstatus->height);
+        skin_draw_pixbuf(widget, bmp_active_skin, obj, SKIN_PLAYPAUSE, 18, 0, 2, 0, 9, playstatus->height);
         break;
     case STATUS_PAUSE:
-        skin_draw_pixmap(widget, bmp_active_skin, obj, gc, SKIN_PLAYPAUSE, 9, 0, 2, 0, 9, playstatus->height);
+        skin_draw_pixbuf(widget, bmp_active_skin, obj, SKIN_PLAYPAUSE, 9, 0, 2, 0, 9, playstatus->height);
         break;
     case STATUS_PLAY:
-        skin_draw_pixmap(widget, bmp_active_skin, obj, gc, SKIN_PLAYPAUSE, 1, 0, 3, 0, 8, playstatus->height);
+        skin_draw_pixbuf(widget, bmp_active_skin, obj, SKIN_PLAYPAUSE, 1, 0, 3, 0, 8, playstatus->height);
         break;
     }
 
-    GdkPixmap *image = NULL;
-
+    GdkPixbuf *image = NULL;
     if (playstatus->double_size) {
-        image = create_dblsize_pixmap(obj);
+        image = gdk_pixbuf_scale_simple(obj, playstatus->width*2, playstatus->height*2, GDK_INTERP_NEAREST);
     } else {
-        image = gdk_pixmap_new(NULL, playstatus->width, playstatus->height, gdk_rgb_get_visual()->depth);
-        gdk_draw_drawable (image, gc, obj, 0, 0, 0, 0, playstatus->width, playstatus->height);
+        image = gdk_pixbuf_copy(obj);
     }
 
-    g_object_unref(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);
 
-    gdk_draw_drawable (widget->window, gc, image, 0, 0, 0, 0,
-                       playstatus->width*(1+playstatus->double_size), playstatus->height*(1+playstatus->double_size));
-    g_object_unref(gc);
+    g_object_unref(obj);
     g_object_unref(image);
 
     return FALSE;