changeset 2461:d6315e592e40 trunk

[svn] - remove buggy playlist transparency patch
author nenolod
date Thu, 01 Feb 2007 09:22:56 -0800
parents 5e8526a4f554
children 473168ce2cf5
files ChangeLog src/audacious/glade/prefswin.glade src/audacious/main.c src/audacious/ui_playlist.c src/audacious/ui_preferences.c src/audacious/widgets/playlist_list.c src/audacious/widgets/skin.c
diffstat 7 files changed, 12 insertions(+), 242 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Feb 01 06:09:53 2007 -0800
+++ b/ChangeLog	Thu Feb 01 09:22:56 2007 -0800
@@ -1,3 +1,10 @@
+2007-02-01 14:09:53 +0000  Giacomo Lozito <james@develia.org>
+  revision [3930]
+  - added a new hook: playlist set info
+  trunk/src/audacious/playlist.c |    6 ++++++
+  1 file changed, 6 insertions(+)
+
+
 2007-02-01 11:34:37 +0000  Strahinja Kustudi <kustodian@gmail.com>
   revision [3928]
   Updated translations
--- a/src/audacious/glade/prefswin.glade	Thu Feb 01 06:09:53 2007 -0800
+++ b/src/audacious/glade/prefswin.glade	Thu Feb 01 09:22:56 2007 -0800
@@ -1336,42 +1336,6 @@
 			      <property name="fill">False</property>
 			    </packing>
 			  </child>
-
-			  <child>
-			    <widget class="GtkAlignment" id="alignment3">
-			      <property name="visible">True</property>
-			      <property name="xalign">0.5</property>
-			      <property name="yalign">0.5</property>
-			      <property name="xscale">1</property>
-			      <property name="yscale">1</property>
-			      <property name="top_padding">0</property>
-			      <property name="bottom_padding">0</property>
-			      <property name="left_padding">12</property>
-			      <property name="right_padding">0</property>
-
-			      <child>
-				<widget class="GtkCheckButton" id="playlist_transparent">
-				  <property name="visible">True</property>
-				  <property name="tooltip" translatable="yes">Enables playlist transparency. This is not recommended for slower machines as it requires some CPU time to create and cache the pixmaps used for the transparency.</property>
-				  <property name="can_focus">True</property>
-				  <property name="label" translatable="yes">Enable playlist transparency</property>
-				  <property name="use_underline">True</property>
-				  <property name="relief">GTK_RELIEF_NORMAL</property>
-				  <property name="focus_on_click">True</property>
-				  <property name="active">False</property>
-				  <property name="inconsistent">False</property>
-				  <property name="draw_indicator">True</property>
-				  <signal name="toggled" handler="on_playlist_transparent_toggled" last_modification_time="Thu, 23 Nov 2006 17:52:16 GMT"/>
-				  <signal name="realize" handler="on_playlist_transparent_realize" last_modification_time="Thu, 23 Nov 2006 17:52:24 GMT"/>
-				</widget>
-			      </child>
-			    </widget>
-			    <packing>
-			      <property name="padding">0</property>
-			      <property name="expand">False</property>
-			      <property name="fill">False</property>
-			    </packing>
-			  </child>
 			</widget>
 			<packing>
 			  <property name="padding">0</property>
--- a/src/audacious/main.c	Thu Feb 01 06:09:53 2007 -0800
+++ b/src/audacious/main.c	Thu Feb 01 09:22:56 2007 -0800
@@ -289,7 +289,6 @@
     {"stop_after_current_song", &cfg.stopaftersong, TRUE},
     {"playlist_shaded", &cfg.playlist_shaded, TRUE},
     {"playlist_visible", &cfg.playlist_visible, TRUE},
-    {"playlist_transparent", &cfg.playlist_transparent, TRUE},
     {"use_fontsets", &cfg.use_fontsets, TRUE},
     {"mainwin_use_xfont", &cfg.mainwin_use_xfont, FALSE},
     {"equalizer_visible", &cfg.equalizer_visible, TRUE},
--- a/src/audacious/ui_playlist.c	Thu Feb 01 06:09:53 2007 -0800
+++ b/src/audacious/ui_playlist.c	Thu Feb 01 09:22:56 2007 -0800
@@ -414,12 +414,7 @@
     gdk_flush();
  
     if (dock_is_moving(GTK_WINDOW(playlistwin)))
-    {
        dock_move_release(GTK_WINDOW(playlistwin));
-
-       if (cfg.playlist_transparent)
-           playlistwin_update_list(playlist_get_active());
-    }
     else
     {
        handle_release_cb(playlistwin_wlist, widget, event);
--- a/src/audacious/ui_preferences.c	Thu Feb 01 06:09:53 2007 -0800
+++ b/src/audacious/ui_preferences.c	Thu Feb 01 09:22:56 2007 -0800
@@ -961,22 +961,6 @@
 }
 
 static void
-on_playlist_transparent_realize(GtkToggleButton * button,
-                                    gpointer data)
-{
-    gtk_toggle_button_set_active(button, cfg.playlist_transparent);
-}
-
-static void
-on_playlist_transparent_toggled(GtkToggleButton * button,
-                                    gpointer data)
-{
-    cfg.playlist_transparent = gtk_toggle_button_get_active(button);
-    playlistwin_update_list(playlist_get_active());
-    draw_playlist_window(TRUE);
-}
-
-static void
 on_playlist_show_pl_separator_realize(GtkToggleButton * button,
                                     gpointer data)
 {
@@ -2277,8 +2261,6 @@
     FUNC_MAP_ENTRY(on_playlist_show_pl_numbers_toggled)
     FUNC_MAP_ENTRY(on_playlist_show_pl_separator_realize)
     FUNC_MAP_ENTRY(on_playlist_show_pl_separator_toggled)
-    FUNC_MAP_ENTRY(on_playlist_transparent_realize)
-    FUNC_MAP_ENTRY(on_playlist_transparent_toggled)
     FUNC_MAP_ENTRY(on_playlist_convert_twenty_realize)
     FUNC_MAP_ENTRY(on_playlist_convert_twenty_toggled)
     FUNC_MAP_ENTRY(on_playlist_convert_underscore_realize)
--- a/src/audacious/widgets/playlist_list.c	Thu Feb 01 06:09:53 2007 -0800
+++ b/src/audacious/widgets/playlist_list.c	Thu Feb 01 09:22:56 2007 -0800
@@ -61,159 +61,8 @@
 static gint width_colon, width_colon_third;
 static gint width_approx_digits, width_approx_digits_half;
 
-GdkPixmap *rootpix;
-
 void playlist_list_draw(Widget * w);
 
-/* Sort of stolen from XChat, but not really, as theres uses Xlib */
-static void
-shade_gdkimage_generic (GdkVisual *visual, GdkImage *ximg, int bpl, int w, int h, int rm, int gm, int bm, int bg)
-{
-	int x, y;
-	int bgr = (256 - rm) * (bg & visual->red_mask);
-	int bgg = (256 - gm) * (bg & visual->green_mask);
-	int bgb = (256 - bm) * (bg & visual->blue_mask);
-
-	for (x = 0; x < w; x++)
-	{
-		for (y = 0; y < h; y++)
-		{
-			unsigned long pixel = gdk_image_get_pixel (ximg, x, y);
-			int r, g, b;
-
-			r = rm * (pixel & visual->red_mask) + bgr;
-			g = gm * (pixel & visual->green_mask) + bgg;
-			b = bm * (pixel & visual->blue_mask) + bgb;
-
-			gdk_image_put_pixel (ximg, x, y,
-				((r >> 8) & visual->red_mask) |
-				((g >> 8) & visual->green_mask) |
-				((b >> 8) & visual->blue_mask));
-		}
-	}
-}
-
-/* and this is definately mine... -nenolod */
-GdkPixmap *
-shade_pixmap(GdkPixmap *in, gint x, gint y, gint x_offset, gint y_offset, gint w, gint h, GdkColor *shade_color)
-{
-	GdkImage *ximg;
-	GdkPixmap *p;
-	GdkGC *gc;
-
-	g_return_val_if_fail(in != NULL, NULL);
-
-	p = gdk_pixmap_new(in, w, h, -1);
-	gc = gdk_gc_new(p);
-
-        gdk_draw_drawable(p, gc, in, x, y, 0, 0, w, h);
-
-	gdk_error_trap_push();
-
-	ximg = gdk_drawable_copy_to_image(in, NULL, x, y, 0, 0, w, h);	/* copy */
-
-	gdk_error_trap_pop();
-
-	if (GDK_IS_IMAGE(ximg))
-	{
-		shade_gdkimage_generic(gdk_drawable_get_visual(GDK_WINDOW(playlistwin->window)),
-			ximg, ximg->bpl, w, h, 60, 60, 60, shade_color->pixel);
-
-		gdk_draw_image(p, gc, ximg, 0, 0, x, y, w, h);
-
-		g_object_unref(ximg);
-	}
-	else {
-		cfg.playlist_transparent = FALSE;
-	}
-
-	g_object_unref(in);
-	g_object_unref(gc);
-
-	return p;
-}
-
-#ifdef GDK_WINDOWING_X11
-
-#include <gdk/gdkx.h>
-
-GdkDrawable *get_transparency_pixmap(void)
-{
-	GdkDrawable *root;
-	guchar *pm = NULL;
-	GdkAtom prop_type;
-	gint prop_size;
-	GdkPixmap *pixmap;
-	gboolean ret;
-	XID *pixmaps;
-
-	root = gdk_get_default_root_window();
-
-	pixmap = NULL;
-	pixmaps = NULL;
-
-	gdk_error_trap_push();
-
-	ret = gdk_property_get(root, gdk_atom_intern("_XROOTPMAP_ID", TRUE),
-			0, 0, INT_MAX - 3,
-			FALSE,
-			&prop_type, NULL, &prop_size,
-			&pm);
-
-	gdk_error_trap_pop();
-
-	if (pm != NULL)
-		pixmaps = (XID *) pm;
-
-	if ((ret == TRUE) && (prop_type == GDK_TARGET_PIXMAP) && (prop_size >= sizeof(XID)) && (pixmaps != NULL))
-	{
-		pixmap = gdk_pixmap_foreign_new_for_display(gdk_drawable_get_display(root),
-			pixmaps[0]);
-
-		if (pixmaps != NULL)
-			g_free(pixmaps);
-	}
-
-	return GDK_DRAWABLE(pixmap);
-}
-
-static GdkFilterReturn
-root_event_cb (GdkXEvent *xev, GdkEventProperty *event, gpointer data)
-{
-        XEvent *xevent = (XEvent *)xev;
-
-        if (xevent->type == PropertyNotify)
-        {
-	        Atom at = XInternAtom (xevent->xproperty.display, "_XROOTPMAP_ID", True);
-
-                if (at == xevent->xproperty.atom)
-		{
-			if (rootpix != NULL)
-			    g_object_unref(rootpix);
-
-                        rootpix = shade_pixmap(get_transparency_pixmap(), 0, 0, 0, 0, gdk_screen_width(), gdk_screen_height(),
-                            skin_get_color(bmp_active_skin, SKIN_PLEDIT_NORMALBG));
-
-			if (cfg.playlist_transparent)
-			{
-				playlistwin_update_list(playlist_get_active());
-				draw_playlist_window(TRUE);
-			}
-		}
-        }
-
-        return GDK_FILTER_CONTINUE;
-}
-
-#else
-
-GdkPixmap *get_transparency_pixmap(void)
-{
-    return NULL;
-}
-
-#endif
-
 static gboolean
 playlist_list_auto_drag_down_func(gpointer data)
 {
@@ -578,23 +427,11 @@
     gdk_gc_set_clip_origin(gc, 31, 58);
     gdk_gc_set_clip_rectangle(gc, playlist_rect);
 
-    if (cfg.playlist_transparent == FALSE)
-    {
-        gdk_gc_set_foreground(gc,
-                              skin_get_color(bmp_active_skin,
-                                             SKIN_PLEDIT_NORMALBG));
-        gdk_draw_rectangle(obj, gc, TRUE, pl->pl_widget.x, pl->pl_widget.y,
-                              width, height);
-    }
-    else
-    {
-	if (!rootpix)
-           rootpix = shade_pixmap(get_transparency_pixmap(), 0, 0, 0, 0, gdk_screen_width(), gdk_screen_height(), 
-    			    skin_get_color(bmp_active_skin, SKIN_PLEDIT_NORMALBG));
-        gdk_draw_drawable(obj, gc, rootpix, cfg.playlist_x + pl->pl_widget.x,
-                    cfg.playlist_y + pl->pl_widget.y, pl->pl_widget.x, pl->pl_widget.y,
-                    width, height);
-    }
+    gdk_gc_set_foreground(gc,
+                          skin_get_color(bmp_active_skin,
+                                         SKIN_PLEDIT_NORMALBG));
+    gdk_draw_rectangle(obj, gc, TRUE, pl->pl_widget.x, pl->pl_widget.y,
+                       width, height);
 
     if (!playlist_list_font) {
         g_critical("Couldn't open playlist font");
@@ -939,11 +776,6 @@
 
     widget_list_add(wlist, WIDGET(pl));
 
-#ifdef GDK_WINDOWING_X11
-    gdk_window_set_events (gdk_get_default_root_window(), GDK_PROPERTY_CHANGE_MASK);
-    gdk_window_add_filter (gdk_get_default_root_window(), (GdkFilterFunc)root_event_cb, pl);
-#endif
-
     return pl;
 }
 
--- a/src/audacious/widgets/skin.c	Thu Feb 01 06:09:53 2007 -0800
+++ b/src/audacious/widgets/skin.c	Thu Feb 01 09:22:56 2007 -0800
@@ -162,15 +162,6 @@
 
     skin_setup_masks(bmp_active_skin);
 
-    if (cfg.playlist_transparent)
-    {
-        if (rootpix != NULL)
-            g_object_unref(rootpix);
-
-        rootpix = shade_pixmap(get_transparency_pixmap(), 0, 0, 0, 0, gdk_screen_width(), gdk_screen_height(),
-                               skin_get_color(bmp_active_skin, SKIN_PLEDIT_NORMALBG));
-    }
-
     draw_main_window(TRUE);
     draw_playlist_window(TRUE);
     draw_equalizer_window(TRUE);