changeset 1851:aceb472cce6c trunk

[svn] - add audacious_pixmap_resize() for resizing a skin pixmap on demand.
author nenolod
date Mon, 09 Oct 2006 03:44:50 -0700
parents 1014e22133e2
children 01103f911aa5
files ChangeLog audacious/mainwin.c audacious/util.c audacious/util.h
diffstat 4 files changed, 39 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Mon Oct 09 03:20:36 2006 -0700
+++ b/ChangeLog	Mon Oct 09 03:44:50 2006 -0700
@@ -1,3 +1,11 @@
+2006-10-09 10:20:36 +0000  William Pitcock <nenolod@nenolod.net>
+  revision [2657]
+  - the default for mainwinTextVisible() should be FALSE.
+  
+  trunk/audacious/widgets/skin.c |    2 +-
+  1 file changed, 1 insertion(+), 1 deletion(-)
+
+
 2006-10-09 10:04:44 +0000  William Pitcock <nenolod@nenolod.net>
   revision [2655]
   - change skin_mask_info[] if the player sizes change.
--- a/audacious/mainwin.c	Mon Oct 09 03:20:36 2006 -0700
+++ b/audacious/mainwin.c	Mon Oct 09 03:44:50 2006 -0700
@@ -968,6 +968,10 @@
                                 bmp_active_skin->properties.mainwin_width,
                                 cfg.player_shaded ? MAINWIN_SHADED_HEIGHT : bmp_active_skin->properties.mainwin_height,
                                 GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
+        mainwin_bg = audacious_pixmap_resize(mainwin->window, mainwin_gc, mainwin_bg,
+                                bmp_active_skin->properties.mainwin_width,
+				bmp_active_skin->properties.mainwin_height);
+        mainwin_set_back_pixmap();
 	gdk_flush();
     }
 
--- a/audacious/util.c	Mon Oct 09 03:20:36 2006 -0700
+++ b/audacious/util.c	Mon Oct 09 03:44:50 2006 -0700
@@ -1542,3 +1542,28 @@
 	
 	return NULL;	/* if I have no idea, return NULL. */
 }
+
+/*
+ * Resizes a GDK pixmap.
+ */
+GdkPixmap *audacious_pixmap_resize(GdkWindow *src, GdkGC *src_gc, GdkPixmap *in, gint width, gint height)
+{
+	GdkPixmap *out;
+	gint owidth, oheight;
+
+	g_return_if_fail(src != NULL);
+	g_return_if_fail(src_gc != NULL);
+	g_return_if_fail(in != NULL);
+	g_return_if_fail(width > 0 && height > 0);
+
+	gdk_drawable_get_size(in, &owidth, &oheight);
+
+	out = gdk_pixmap_new(src, width, height, -1);
+
+	gdk_draw_rectangle(out, src_gc, TRUE, 0, 0, width, height);
+
+	gdk_window_copy_area(out, src_gc, 0, 0, in, 0, 0, owidth, oheight);
+	g_object_unref(src);
+
+	return out;
+}
--- a/audacious/util.h	Mon Oct 09 03:20:36 2006 -0700
+++ b/audacious/util.h	Mon Oct 09 03:44:50 2006 -0700
@@ -131,6 +131,8 @@
 gchar *chardet_to_utf8(const gchar *str, gssize len,
 		       gsize *arg_bytes_read, gsize *arg_bytes_write, GError **arg_error);
 
+GdkPixmap *audacious_pixmap_resize(GdkWindow *src, GdkGC *src_gc, GdkPixmap *in, gint width, gint height);
+
 /* XMMS names */
 
 #define bmp_info_dialog(title, text, button_text, model, button_action, action_data) \