[banshee/gtk3] libbnpx11: Port to GTK+ 3.0



commit 88e901b89ceaff59a590c99e67146d5e3fa2cfa8
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Sun Dec 4 15:56:38 2011 +0100

    libbnpx11: Port to GTK+ 3.0
    
    Use the new macro to get the X display, and use the accessor function to
    get the widget's window.
    
    Port the build stuff to use GTK+ 3.0, in particular the new multiple
    backends.

 build/m4/banshee/bnpx11.m4                         |   47 ++++++++++---------
 .../libbnpx11/bacon-resize.c                       |    4 +-
 2 files changed, 27 insertions(+), 24 deletions(-)
---
diff --git a/build/m4/banshee/bnpx11.m4 b/build/m4/banshee/bnpx11.m4
index 5e74bdf..8d7a52c 100644
--- a/build/m4/banshee/bnpx11.m4
+++ b/build/m4/banshee/bnpx11.m4
@@ -4,34 +4,37 @@ AC_DEFUN([BANSHEE_CHECK_NOW_PLAYING_X11],
 [
 	have_x11=no
 	have_xvidmode=no
-	if test x$(pkg-config --variable=target gtk+-2.0) = xx11; then
-		PKG_CHECK_MODULES(BNPX_GTK, gtk+-2.0 >= 2.8 gdk-x11-2.0 >= 2.8)
+	GTK_TARGETS=$(pkg-config --variable=targets gtk+-3.0)
+	for GTK_TARGET in $GTK_TARGETS; do
+		if test x$GTK_TARGET = xx11; then
+			PKG_CHECK_MODULES(BNPX_GTK, gtk+-3.0 >= 3.0 gdk-3.0 >= 3.0)
 
-		AC_PATH_X
+			AC_PATH_X
 
-		have_x11=yes
+			have_x11=yes
 
-		if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
-			X_INCLUDES=-I`echo $x_includes | sed -e "s/:/ -I/g"`
-		fi
-		if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
-			X_LIBRARIES=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
-		fi
-		BNPX_CFLAGS="$X_INCLUDES $CFLAGS"
-		BNPX_LIBS="$X_LIBRARIES $LIBS"
+			if test x"$x_includes" != x"NONE" && test -n "$x_includes" ; then
+				X_INCLUDES=-I`echo $x_includes | sed -e "s/:/ -I/g"`
+			fi
+			if test x"$x_libraries" != x"NONE" && test -n "$x_libraries" ; then
+				X_LIBRARIES=-L`echo $x_libraries | sed -e "s/:/ -L/g"`
+			fi
+			BNPX_CFLAGS="$X_INCLUDES $CFLAGS"
+			BNPX_LIBS="$X_LIBRARIES $LIBS"
 	
-		PKG_CHECK_MODULES(XVIDMODE, xrandr >= 1.1.1 xxf86vm >= 1.0.1,
-			have_xvidmode=yes, have_xvidmode=no)
+			PKG_CHECK_MODULES(XVIDMODE, xrandr >= 1.1.1 xxf86vm >= 1.0.1,
+				have_xvidmode=yes, have_xvidmode=no)
 
-		if test x$have_xvidmode = xyes; then
-			AC_DEFINE(HAVE_XVIDMODE,, [Define this if you have the XVidMode and XRandR extension installed])
-		fi
+			if test x$have_xvidmode = xyes; then
+				AC_DEFINE(HAVE_XVIDMODE,, [Define this if you have the XVidMode and XRandR extension installed])
+			fi
 
-		dnl Explicit link against libX11 to avoid problems with crappy linkers
-		BNPX_LIBS="$X_LIBRARIES -lX11"
-		AC_SUBST(BNPX_LIBS)
-		AC_SUBST(BNPX_CFLAGS)
-	fi
+			dnl Explicit link against libX11 to avoid problems with crappy linkers
+			BNPX_LIBS="$X_LIBRARIES -lX11"
+			AC_SUBST(BNPX_LIBS)
+			AC_SUBST(BNPX_CFLAGS)
+		fi
+	done
 	AM_CONDITIONAL(HAVE_XVIDMODE, [test x$have_xvidmode = xyes])
 ])
 
diff --git a/src/Backends/Banshee.NowPlaying.X11/libbnpx11/bacon-resize.c b/src/Backends/Banshee.NowPlaying.X11/libbnpx11/bacon-resize.c
index 9278e32..607b56c 100644
--- a/src/Backends/Banshee.NowPlaying.X11/libbnpx11/bacon-resize.c
+++ b/src/Backends/Banshee.NowPlaying.X11/libbnpx11/bacon-resize.c
@@ -225,7 +225,7 @@ bacon_resize_resize (BaconResize *resize)
 	g_return_if_fail (GTK_IS_WIDGET (resize->priv->video_widget));
 	g_return_if_fail (GTK_WIDGET_REALIZED (resize->priv->video_widget));
 
-	Display = GDK_DRAWABLE_XDISPLAY (resize->priv->video_widget->window);
+	Display = GDK_WINDOW_XDISPLAY (gtk_widget_get_window (resize->priv->video_widget));
 	if (Display == NULL)
 		return;
 
@@ -306,7 +306,7 @@ bacon_resize_restore (BaconResize *resize)
 	if (resize->priv->xr_screen_conf == NULL)
 		return;
 
-	Display = GDK_DRAWABLE_XDISPLAY (resize->priv->video_widget->window);
+	Display = GDK_WINDOW_XDISPLAY (gtk_widget_get_window (resize->priv->video_widget));
 	if (Display == NULL)
 		return;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]