comparison audacious/playlist_list.c @ 1047:91f6db060a8b trunk

[svn] - initial playlist_transparent patch. (you will need to edit your audacious config manually, either by gconf or texteditor to enable)
author nenolod
date Sun, 14 May 2006 13:35:06 -0700
parents ff0cc786ebeb
children b10e09537428
comparison
equal deleted inserted replaced
1046:18ef6f3089d4 1047:91f6db060a8b
55 /* FIXME: the following globals should not be needed. */ 55 /* FIXME: the following globals should not be needed. */
56 static gint width_approx_letters; 56 static gint width_approx_letters;
57 static gint width_colon, width_colon_third; 57 static gint width_colon, width_colon_third;
58 static gint width_approx_digits, width_approx_digits_half; 58 static gint width_approx_digits, width_approx_digits_half;
59 59
60 #ifdef GDK_WINDOWING_X11
61
62 #include <gdk/gdkx.h>
63 #include <X11/Xlib.h>
64 #include <X11/Xatom.h>
65
66 static GdkPixmap *get_transparency_pixmap(void)
67 {
68 Atom prop, type;
69 int format;
70 unsigned long length, after;
71 unsigned char *data;
72 static GdkPixmap *retval = NULL;
73
74 if(retval)
75 return retval;
76
77 prop = XInternAtom(GDK_DISPLAY(), "_XROOTPMAP_ID", True);
78
79 if(prop == None)
80 return NULL;
81
82 XGetWindowProperty(GDK_DISPLAY(), GDK_ROOT_WINDOW(), prop, 0L, 1L, False, AnyPropertyType, &type, &format, &length, &after, &data);
83
84 if(type == XA_PIXMAP)
85 retval = gdk_pixmap_foreign_new(*((Pixmap *)data));
86
87 return retval;
88 }
89
90 #else
91
92 static GdkPixmap *get_transparency_pixmap(void)
93 {
94 return NULL;
95 }
96
97 #endif
98
60 static gboolean 99 static gboolean
61 playlist_list_auto_drag_down_func(gpointer data) 100 playlist_list_auto_drag_down_func(gpointer data)
62 { 101 {
63 PlayList_List *pl = data; 102 PlayList_List *pl = data;
64 103
389 playlist_rect->width = plw_w - 17; 428 playlist_rect->width = plw_w - 17;
390 playlist_rect->height = plw_h - 36; 429 playlist_rect->height = plw_h - 36;
391 430
392 gdk_gc_set_clip_origin(gc, 31, 58); 431 gdk_gc_set_clip_origin(gc, 31, 58);
393 gdk_gc_set_clip_rectangle(gc, playlist_rect); 432 gdk_gc_set_clip_rectangle(gc, playlist_rect);
394 gdk_gc_set_foreground(gc, 433
395 skin_get_color(bmp_active_skin, 434 if (cfg.playlist_transparent == FALSE)
396 SKIN_PLEDIT_NORMALBG)); 435 {
397 gdk_draw_rectangle(obj, gc, TRUE, pl->pl_widget.x, pl->pl_widget.y, 436 gdk_gc_set_foreground(gc,
398 width, height); 437 skin_get_color(bmp_active_skin,
438 SKIN_PLEDIT_NORMALBG));
439 gdk_draw_rectangle(obj, gc, TRUE, pl->pl_widget.x, pl->pl_widget.y,
440 width, height);
441 }
442 else
443 {
444 GdkPixmap *rootpix = get_transparency_pixmap();
445 gdk_draw_pixmap(obj, gc, rootpix, cfg.playlist_x + pl->pl_widget.x,
446 cfg.playlist_y + pl->pl_widget.y, pl->pl_widget.x, pl->pl_widget.y,
447 width, height);
448 }
399 449
400 if (!playlist_list_font) { 450 if (!playlist_list_font) {
401 g_critical("Couldn't open playlist font"); 451 g_critical("Couldn't open playlist font");
402 return; 452 return;
403 } 453 }