summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-08-17 18:41:15 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2005-08-17 18:41:15 +0000
commitc375528575124f64b5515809a8041cd4d05f7f44 (patch)
tree2bb9dc04a077d3dfa68c0c2888987610a9557424
parent912582e464d4afb5abcffd64a46f05735a66e3f8 (diff)
downloadmpv-c375528575124f64b5515809a8041cd4d05f7f44.tar.bz2
mpv-c375528575124f64b5515809a8041cd4d05f7f44.tar.xz
Support for GTK 2.x.
Patch by Onur Kucuk (onur . delipenguen net). git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@16247 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--Gui/mplayer/gtk/about.c15
-rw-r--r--Gui/mplayer/gtk/opts.c2
-rw-r--r--Gui/mplayer/widgets.c8
-rwxr-xr-xconfigure43
4 files changed, 66 insertions, 2 deletions
diff --git a/Gui/mplayer/gtk/about.c b/Gui/mplayer/gtk/about.c
index fcf60e9b16..859050d6e8 100644
--- a/Gui/mplayer/gtk/about.c
+++ b/Gui/mplayer/gtk/about.c
@@ -28,6 +28,11 @@ GtkWidget * create_About( void )
GtkWidget * AboutText;
GtkWidget * Ok;
+#ifdef HAVE_GTK2_GUI
+ GtkTextBuffer * AboutTextBuffer;
+ GtkTextIter iter;
+#endif //HAVE_GTK2_GUI
+
GtkStyle * pixmapstyle;
GdkPixmap * pixmapwid;
GdkBitmap * mask;
@@ -67,11 +72,21 @@ GtkWidget * create_About( void )
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 );
+#ifdef HAVE_GTK2_GUI
+ AboutText = gtk_text_view_new();
+ AboutTextBuffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (AboutText));
+ gtk_text_buffer_get_iter_at_offset (AboutTextBuffer, &iter, 0);
+#else
AboutText=gtk_text_new( NULL,NULL );
+#endif
gtk_widget_set_name( AboutText,"AboutText" );
gtk_widget_show( AboutText );
gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),AboutText );
+#ifdef HAVE_GTK2_GUI
+ gtk_text_buffer_insert (AboutTextBuffer, &iter,
+#else
gtk_text_insert( GTK_TEXT( AboutText ),NULL,NULL,NULL,
+#endif
"\n"
MSGTR_ABOUT_UHU
" (http://www.uhulinux.hu/)\n"
diff --git a/Gui/mplayer/gtk/opts.c b/Gui/mplayer/gtk/opts.c
index cd1897c253..f940f65862 100644
--- a/Gui/mplayer/gtk/opts.c
+++ b/Gui/mplayer/gtk/opts.c
@@ -736,8 +736,10 @@ static void prCListRow( GtkCList * clist,gint row,gint column,GdkEvent * event,g
!strncmp( ao_driver[0],"esd",3 ) ||
!strncmp( ao_driver[0],"sdl",3 ) )
gtk_widget_set_sensitive( AConfig,TRUE );
+#ifndef HAVE_GTK2_GUI
if ( !strncmp( ao_driver[0],"arts",4 ) )
gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, MSGTR_PREFERENCES_ArtsBroken);
+#endif
break;
case 1: // video driver
gtk_clist_get_text( GTK_CLIST( CLVDrivers ),row,0,(char **)&vo_driver );
diff --git a/Gui/mplayer/widgets.c b/Gui/mplayer/widgets.c
index 907e7c990c..281db06726 100644
--- a/Gui/mplayer/widgets.c
+++ b/Gui/mplayer/widgets.c
@@ -217,7 +217,15 @@ void gtkShow( int type,char * param )
gtk_widget_destroy( PopUpMenu );
}
PopUpMenu=create_PopUpMenu();
+#ifdef HAVE_GTK2_GUI
+ // Ugly hack, but we don't want to loose events
+ while(!GTK_WIDGET_VISIBLE(PopUpMenu)) {
+ gtk_menu_popup(GTK_MENU(PopUpMenu), NULL, NULL, NULL, NULL, 0, gtk_get_current_event_time());
+ gtk_main_iteration();
+ }
+#else
gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 );
+#endif //HAVE_GTK2_GUI
break;
case evHidePopUpMenu:
if ( PopUpMenu )
diff --git a/configure b/configure
index f6459f1548..72aeaf0d5f 100755
--- a/configure
+++ b/configure
@@ -155,7 +155,8 @@ Installation directories:
Optional features:
--disable-mencoder disable mencoder (a/v encoder) compilation [enable]
- --enable-gui enable gmplayer compilation (GTK 1.2 GUI) [disable]
+ --enable-gui enable gmplayer compilation (GTK+ GUI) [disable]
+ --enable-old-gtk force using GTK 1.2 for GUI [disable]
--enable-largefiles enable support for files > 2 GBytes [disable]
--enable-linux-devfs set default devices to devfs ones [disable]
--enable-termcap use termcap database for key codes [autodetect]
@@ -1441,6 +1442,7 @@ _opendivx=no
_lirc=auto
_lircc=auto
_gui=no
+_gtk1=no
_termcap=auto
_termios=auto
_3dfx=no
@@ -1693,6 +1695,7 @@ for ac_option do
--disable-lircc) _lircc=no ;;
--enable-gui) _gui=yes ;;
--disable-gui) _gui=no ;;
+ --enable-old-gtk) _gtk1=yes ;;
--enable-termcap) _termcap=yes ;;
--disable-termcap) _termcap=no ;;
--enable-termios) _termios=yes ;;
@@ -6629,8 +6632,40 @@ EOF
fi
echores "$_xshape"
+#Check for GTK
+if test "$_gtk1" = no ; then
+ #Check for GTK2 :
+ echocheck "GTK+ version"
+
+ if pkg-config gtk+-2.0 --exists ; then
+ _gtk=`pkg-config gtk+-2.0 --modversion 2>/dev/null`
+ _inc_gtk=`pkg-config gtk+-2.0 --cflags 2>/dev/null`
+ _ld_gtk=`pkg-config gtk+-2.0 --libs 2>/dev/null`
+ echores "$_gtk"
+
+ # Check for GLIB2
+ if pkg-config glib-2.0 --exists ; then
+ echocheck "glib version"
+ _glib=`pkg-config glib-2.0 --modversion 2>/dev/null`
+ _inc_glib=`pkg-config glib-2.0 --cflags 2>/dev/null`
+ _ld_glib=`pkg-config glib-2.0 --libs 2>/dev/null`
+ echores "$_glib"
+
+ _def_gui='#define HAVE_NEW_GUI 1'
+ _def_gtk2_gui='#define HAVE_GTK2_GUI 1'
+ _ld_gui='$(GTKLIB) $(GLIBLIB)'
+ else
+ _gtk1=yes
+ echo "GLIB-2 devel packages were not found, trying GTK 1.2"
+ fi
+ else
+ echo "GTK-2 devel packages were not found, trying GTK 1.2"
+ _gtk1=yes
+ fi
+fi
- # Check for GTK:
+if test "$_gtk1" = yes ; then
+ # Check for old GTK (1.2.x)
echocheck "GTK version"
if test -z "$_gtkconfig" ; then
if ( gtk-config --version ) >/dev/null 2>&1 ; then
@@ -6663,7 +6698,9 @@ EOF
echores "$_glib (using $_glibconfig)"
_def_gui='#define HAVE_NEW_GUI 1'
+ _def_gtk2_gui='#undef HAVE_GTK2_GUI'
_ld_gui='$(GTKLIB) $(GLIBLIB)'
+fi
echo "Creating Gui/config.mak"
cat > Gui/config.mak << EOF
@@ -6678,6 +6715,7 @@ EOF
else
_def_gui='#undef HAVE_NEW_GUI'
+ _def_gtk2_gui='#undef HAVE_GTK2_GUI'
fi
# --------------- GUI specific tests end -------------------
@@ -7440,6 +7478,7 @@ $_def_unrarlib
/* gui support, please do not edit this option */
$_def_gui
+$_def_gtk2_gui
/* Audio output drivers */
$_def_ossaudio