# HG changeset patch # User nenolod # Date 1160390690 25200 # Node ID aceb472cce6c0f52fa0526e7e6894086f3a8f600 # Parent 1014e22133e2d558d6681e47f10d145547680d65 [svn] - add audacious_pixmap_resize() for resizing a skin pixmap on demand. diff -r 1014e22133e2 -r aceb472cce6c ChangeLog --- 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 + 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 revision [2655] - change skin_mask_info[] if the player sizes change. diff -r 1014e22133e2 -r aceb472cce6c audacious/mainwin.c --- 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(); } diff -r 1014e22133e2 -r aceb472cce6c audacious/util.c --- 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; +} diff -r 1014e22133e2 -r aceb472cce6c audacious/util.h --- 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) \