[MPlayer-users] [PATCH]

Chipzz chipzz at ULYSSIS.Org
Sun Jun 20 14:00:40 CEST 2004


Since mplayer was the only app on my system using GTK+ 1.2, I cooked up
a patch to use GTK+ 2.0.

I must say, the GUI was extremely portable and I only had to change
about 5 lines, and even that could probably have been avoided using
-DGTK_ENABLE_BROKEN, but since GtkText is deprecated, I thought I might
as well fix it.

I know the patch to configure is a hack, but it works ;)

Maybe it would be worthwhile to cook up a decent patch that supports
both versions, it should be possible with minimal effort to support both
versions in the source code and configure script, but I was kinda lazy.
;)

Patch is tested and works.

Please cc replies to me, as I'm not subscribed to this list.

kr,

Chipzz AKA
Jan Van Buggenhout
-- 

------------------------------------------------------------------------
                 UNIX isn't dead - It just smells funny
------------------------------------------------------------------------
"Baldric, you wouldn't recognize a subtle plan if it painted itself pur-
 ple and danced naked on a harpsicord singing 'subtle plans are here a-
 gain'."
-------------- next part --------------
diff -ur mplayer-1.0-pre4.orig/Gui/mplayer/gtk/about.c mplayer-1.0-pre4/Gui/mplayer/gtk/about.c
--- mplayer-1.0-pre4.orig/Gui/mplayer/gtk/about.c	2003-03-17 00:48:26.000000000 +0000
+++ mplayer-1.0-pre4/Gui/mplayer/gtk/about.c	2004-06-19 13:53:53.000000000 +0000
@@ -34,6 +34,8 @@
 
   GtkAccelGroup * accel_group;
 
+  GtkTextBuffer * AboutBuffer;
+
   accel_group=gtk_accel_group_new();
 
   About=gtk_window_new( GTK_WINDOW_TOPLEVEL );
@@ -67,11 +69,12 @@
   gtk_box_pack_start( GTK_BOX( vbox ),scrolledwindow1,TRUE,TRUE,0 );
   gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( scrolledwindow1 ),GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC );
 
-  AboutText=gtk_text_new( NULL,NULL );
+  AboutText=gtk_text_view_new();
   gtk_widget_set_name( AboutText,"AboutText" );
   gtk_widget_show( AboutText );
   gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),AboutText );
-  gtk_text_insert( GTK_TEXT( AboutText ),NULL,NULL,NULL,
+  AboutBuffer=gtk_text_view_get_buffer( GTK_TEXT_VIEW( AboutText ) );
+  gtk_text_buffer_set_text( AboutBuffer,
   	"\n" 
 	MSGTR_ABOUT_UHU 
 	"             (http://www.uhulinux.hu/)\n" 
diff -ur mplayer-1.0-pre4.orig/configure mplayer-1.0-pre4/configure
--- mplayer-1.0-pre4.orig/configure	2004-04-26 09:44:06.000000000 +0000
+++ mplayer-1.0-pre4/configure	2004-06-19 13:53:53.000000000 +0000
@@ -5673,35 +5673,43 @@
 
   # Check for GTK:
   echocheck "gtk version"
-  if test -z "$_gtkconfig" ; then
-    if ( gtk-config --version ) >/dev/null 2>&1 ; then
-      _gtkconfig="gtk-config"
-    elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
-      _gtkconfig="gtk12-config"
-    else
-      die "The GUI requires GTK devel packages (which were not found)."
-    fi
-  fi
-  _gtk=`$_gtkconfig --version 2>&1`
-  _inc_gtk=`$_gtkconfig --cflags 2>&1`
-  _ld_gtk=`$_gtkconfig --libs 2>&1`
-  echores "$_gtk (using $_gtkconfig)"
+#  if test -z "$_gtkconfig" ; then
+#    if ( gtk-config --version ) >/dev/null 2>&1 ; then
+#      _gtkconfig="gtk-config"
+#    elif ( gtk12-config --version ) >/dev/null 2>&1 ; then
+#      _gtkconfig="gtk12-config"
+#    else
+#      die "The GUI requires GTK devel packages (which were not found)."
+#    fi
+#  fi
+  _gtk=`pkg-config --modversion gtk+-2.0 2>&1`
+  _inc_gtk=`pkg-config --cflags gtk+-2.0 2>&1`
+  _ld_gtk=`pkg-config --libs gtk+-2.0 2>&1`
+  echores "$_gtk"
+#  _gtk=`$_gtkconfig --version 2>&1`
+#  _inc_gtk=`$_gtkconfig --cflags 2>&1`
+#  _ld_gtk=`$_gtkconfig --libs 2>&1`
+#  echores "$_gtk (using $_gtkconfig)"
 
   # Check for GLIB
   echocheck "glib version"
-  if test -z "$_glibconfig" ; then
-    if ( glib-config --version ) >/dev/null 2>&1 ; then
-      _glibconfig="glib-config"
-    elif ( glib12-config --version ) >/dev/null 2>&1 ; then
-      _glibconfig="glib12-config"
-    else
-      die "The GUI requires GLib devel packages (which were not found)"
-    fi
-  fi
-  _glib=`$_glibconfig --version 2>&1`
-  _inc_glib=`$_glibconfig --cflags 2>&1`
-  _ld_glib=`$_glibconfig --libs 2>&1`
-  echores "$_glib (using $_glibconfig)"
+#  if test -z "$_glibconfig" ; then
+#    if ( glib-config --version ) >/dev/null 2>&1 ; then
+#      _glibconfig="glib-config"
+#    elif ( glib12-config --version ) >/dev/null 2>&1 ; then
+#      _glibconfig="glib12-config"
+#    else
+#      die "The GUI requires GLib devel packages (which were not found)"
+#    fi
+#  fi
+  _glib=`pkg-config --modversion glib-2.0 2>&1`
+  _inc_glib=`pkg-config --cflags glib-2.0 2>&1`
+  _ld_glib=`pkg-config --libs glib-2.0 2>&1`
+  echores "$_glib"
+#  _glib=`$_glibconfig --version 2>&1`
+#  _inc_glib=`$_glibconfig --cflags 2>&1`
+#  _ld_glib=`$_glibconfig --libs 2>&1`
+#  echores "$_glib (using $_glibconfig)"
 
   _def_gui='#define HAVE_NEW_GUI 1'
   _ld_gui='$(GTKLIB) $(GLIBLIB)'


More information about the MPlayer-users mailing list