Mercurial > audlegacy
comparison src/audacious/ui_skin.c @ 4551:d09dd0960a6a
kill skin_load_cursor
author | Tomasz Mon <desowin@gmail.com> |
---|---|
date | Sun, 18 May 2008 08:59:01 +0200 |
parents | d8920be7275a |
children | 1fe29814b90c |
comparison
equal
deleted
inserted
replaced
4550:8445515efab1 | 4551:d09dd0960a6a |
---|---|
484 GdkPixmap *text = gdk_pixmap_new(NULL, gdk_pixbuf_get_width(pix), gdk_pixbuf_get_height(pix), gdk_rgb_get_visual()->depth); | 484 GdkPixmap *text = gdk_pixmap_new(NULL, gdk_pixbuf_get_width(pix), gdk_pixbuf_get_height(pix), gdk_rgb_get_visual()->depth); |
485 gdk_draw_pixbuf(text, NULL, pix, 0, 0, 0, 0, gdk_pixbuf_get_width(pix), gdk_pixbuf_get_height(pix), | 485 gdk_draw_pixbuf(text, NULL, pix, 0, 0, 0, 0, gdk_pixbuf_get_width(pix), gdk_pixbuf_get_height(pix), |
486 GDK_RGB_DITHER_NONE, 0, 0); | 486 GDK_RGB_DITHER_NONE, 0, 0); |
487 /* Get the first line of text */ | 487 /* Get the first line of text */ |
488 gi = gdk_drawable_get_image(text, 0, 0, 152, 6); | 488 gi = gdk_drawable_get_image(text, 0, 0, 152, 6); |
489 cm = gdk_drawable_get_colormap(playlistwin->window); | 489 cm = gdk_colormap_get_system(); |
490 | 490 |
491 for (i = 0; i < 6; i++) { | 491 for (i = 0; i < 6; i++) { |
492 GdkColor c; | 492 GdkColor c; |
493 gint x; | 493 gint x; |
494 glong d, max_d; | 494 glong d, max_d; |
1225 ptr += 2; | 1225 ptr += 2; |
1226 } | 1226 } |
1227 if (len >= 2) | 1227 if (len >= 2) |
1228 color->blue = hex_chars_to_int(*ptr, *(ptr + 1)); | 1228 color->blue = hex_chars_to_int(*ptr, *(ptr + 1)); |
1229 | 1229 |
1230 gdk_colormap_alloc_color(gdk_drawable_get_colormap(playlistwin->window), | |
1231 color, TRUE, TRUE); | |
1232 g_free(value); | 1230 g_free(value); |
1233 } | 1231 } |
1234 } | 1232 } |
1235 return color; | 1233 return color; |
1236 } | 1234 } |
1385 numbers->pixbuf = pixbuf; | 1383 numbers->pixbuf = pixbuf; |
1386 numbers->current_width = 108; | 1384 numbers->current_width = 108; |
1387 numbers->width = 108; | 1385 numbers->width = 108; |
1388 } | 1386 } |
1389 | 1387 |
1390 static void | |
1391 skin_load_cursor(Skin * skin, const gchar * dirname) | |
1392 { | |
1393 const gchar * basename = "normal.cur"; | |
1394 gchar * filename = NULL; | |
1395 GdkPixbuf * cursor_pixbuf = NULL; | |
1396 GdkPixbufAnimation * cursor_animated = NULL; | |
1397 GdkCursor * cursor_gdk = NULL; | |
1398 GError * error = NULL; | |
1399 | |
1400 filename = find_file_recursively(dirname, basename); | |
1401 | |
1402 if (filename && cfg.custom_cursors) | |
1403 cursor_animated = gdk_pixbuf_animation_new_from_file(filename, &error); | |
1404 | |
1405 if (cursor_animated) { | |
1406 cursor_pixbuf = gdk_pixbuf_animation_get_static_image(cursor_animated); | |
1407 cursor_gdk = gdk_cursor_new_from_pixbuf(gdk_display_get_default(), | |
1408 cursor_pixbuf, 0, 0); | |
1409 } | |
1410 else | |
1411 cursor_gdk = gdk_cursor_new(GDK_LEFT_PTR); | |
1412 | |
1413 if (mainwin && playlistwin && equalizerwin) | |
1414 { | |
1415 gdk_window_set_cursor(mainwin->window, cursor_gdk); | |
1416 gdk_window_set_cursor(playlistwin->window, cursor_gdk); | |
1417 gdk_window_set_cursor(equalizerwin->window, cursor_gdk); | |
1418 } | |
1419 | |
1420 gdk_cursor_unref(cursor_gdk); | |
1421 } | |
1422 | |
1423 static gboolean | 1388 static gboolean |
1424 skin_load_pixmaps(Skin * skin, const gchar * path) | 1389 skin_load_pixmaps(Skin * skin, const gchar * path) |
1425 { | 1390 { |
1426 GdkPixbuf *text_pb; | 1391 GdkPixbuf *text_pb; |
1427 guint i; | 1392 guint i; |
1574 if(archive) del_directory(skin_path); | 1539 if(archive) del_directory(skin_path); |
1575 g_free(skin_path); | 1540 g_free(skin_path); |
1576 AUDDBG("Skin loading failed\n"); | 1541 AUDDBG("Skin loading failed\n"); |
1577 return FALSE; | 1542 return FALSE; |
1578 } | 1543 } |
1579 | |
1580 skin_load_cursor(skin, skin_path); | |
1581 | 1544 |
1582 /* restore gtk theme if changed by previous skin */ | 1545 /* restore gtk theme if changed by previous skin */ |
1583 settings = gtk_settings_get_default(); | 1546 settings = gtk_settings_get_default(); |
1584 | 1547 |
1585 if (original_gtk_theme != NULL) { | 1548 if (original_gtk_theme != NULL) { |