mirror of https://github.com/mpv-player/mpv
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
This commit is contained in:
parent
912582e464
commit
c375528575
|
@ -28,6 +28,11 @@ GtkWidget * create_About( void )
|
||||||
GtkWidget * AboutText;
|
GtkWidget * AboutText;
|
||||||
GtkWidget * Ok;
|
GtkWidget * Ok;
|
||||||
|
|
||||||
|
#ifdef HAVE_GTK2_GUI
|
||||||
|
GtkTextBuffer * AboutTextBuffer;
|
||||||
|
GtkTextIter iter;
|
||||||
|
#endif //HAVE_GTK2_GUI
|
||||||
|
|
||||||
GtkStyle * pixmapstyle;
|
GtkStyle * pixmapstyle;
|
||||||
GdkPixmap * pixmapwid;
|
GdkPixmap * pixmapwid;
|
||||||
GdkBitmap * mask;
|
GdkBitmap * mask;
|
||||||
|
@ -67,11 +72,21 @@ GtkWidget * create_About( void )
|
||||||
gtk_box_pack_start( GTK_BOX( vbox ),scrolledwindow1,TRUE,TRUE,0 );
|
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 );
|
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 );
|
AboutText=gtk_text_new( NULL,NULL );
|
||||||
|
#endif
|
||||||
gtk_widget_set_name( AboutText,"AboutText" );
|
gtk_widget_set_name( AboutText,"AboutText" );
|
||||||
gtk_widget_show( AboutText );
|
gtk_widget_show( AboutText );
|
||||||
gtk_container_add( GTK_CONTAINER( scrolledwindow1 ),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,
|
gtk_text_insert( GTK_TEXT( AboutText ),NULL,NULL,NULL,
|
||||||
|
#endif
|
||||||
"\n"
|
"\n"
|
||||||
MSGTR_ABOUT_UHU
|
MSGTR_ABOUT_UHU
|
||||||
" (http://www.uhulinux.hu/)\n"
|
" (http://www.uhulinux.hu/)\n"
|
||||||
|
|
|
@ -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],"esd",3 ) ||
|
||||||
!strncmp( ao_driver[0],"sdl",3 ) )
|
!strncmp( ao_driver[0],"sdl",3 ) )
|
||||||
gtk_widget_set_sensitive( AConfig,TRUE );
|
gtk_widget_set_sensitive( AConfig,TRUE );
|
||||||
|
#ifndef HAVE_GTK2_GUI
|
||||||
if ( !strncmp( ao_driver[0],"arts",4 ) )
|
if ( !strncmp( ao_driver[0],"arts",4 ) )
|
||||||
gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, MSGTR_PREFERENCES_ArtsBroken);
|
gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, MSGTR_PREFERENCES_ArtsBroken);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
case 1: // video driver
|
case 1: // video driver
|
||||||
gtk_clist_get_text( GTK_CLIST( CLVDrivers ),row,0,(char **)&vo_driver );
|
gtk_clist_get_text( GTK_CLIST( CLVDrivers ),row,0,(char **)&vo_driver );
|
||||||
|
|
|
@ -217,7 +217,15 @@ void gtkShow( int type,char * param )
|
||||||
gtk_widget_destroy( PopUpMenu );
|
gtk_widget_destroy( PopUpMenu );
|
||||||
}
|
}
|
||||||
PopUpMenu=create_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 );
|
gtk_menu_popup( GTK_MENU( PopUpMenu ),NULL,NULL,NULL,NULL,0,0 );
|
||||||
|
#endif //HAVE_GTK2_GUI
|
||||||
break;
|
break;
|
||||||
case evHidePopUpMenu:
|
case evHidePopUpMenu:
|
||||||
if ( PopUpMenu )
|
if ( PopUpMenu )
|
||||||
|
|
|
@ -155,7 +155,8 @@ Installation directories:
|
||||||
|
|
||||||
Optional features:
|
Optional features:
|
||||||
--disable-mencoder disable mencoder (a/v encoder) compilation [enable]
|
--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-largefiles enable support for files > 2 GBytes [disable]
|
||||||
--enable-linux-devfs set default devices to devfs ones [disable]
|
--enable-linux-devfs set default devices to devfs ones [disable]
|
||||||
--enable-termcap use termcap database for key codes [autodetect]
|
--enable-termcap use termcap database for key codes [autodetect]
|
||||||
|
@ -1441,6 +1442,7 @@ _opendivx=no
|
||||||
_lirc=auto
|
_lirc=auto
|
||||||
_lircc=auto
|
_lircc=auto
|
||||||
_gui=no
|
_gui=no
|
||||||
|
_gtk1=no
|
||||||
_termcap=auto
|
_termcap=auto
|
||||||
_termios=auto
|
_termios=auto
|
||||||
_3dfx=no
|
_3dfx=no
|
||||||
|
@ -1693,6 +1695,7 @@ for ac_option do
|
||||||
--disable-lircc) _lircc=no ;;
|
--disable-lircc) _lircc=no ;;
|
||||||
--enable-gui) _gui=yes ;;
|
--enable-gui) _gui=yes ;;
|
||||||
--disable-gui) _gui=no ;;
|
--disable-gui) _gui=no ;;
|
||||||
|
--enable-old-gtk) _gtk1=yes ;;
|
||||||
--enable-termcap) _termcap=yes ;;
|
--enable-termcap) _termcap=yes ;;
|
||||||
--disable-termcap) _termcap=no ;;
|
--disable-termcap) _termcap=no ;;
|
||||||
--enable-termios) _termios=yes ;;
|
--enable-termios) _termios=yes ;;
|
||||||
|
@ -6629,8 +6632,40 @@ EOF
|
||||||
fi
|
fi
|
||||||
echores "$_xshape"
|
echores "$_xshape"
|
||||||
|
|
||||||
|
#Check for GTK
|
||||||
|
if test "$_gtk1" = no ; then
|
||||||
|
#Check for GTK2 :
|
||||||
|
echocheck "GTK+ version"
|
||||||
|
|
||||||
# Check for GTK:
|
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
|
||||||
|
|
||||||
|
if test "$_gtk1" = yes ; then
|
||||||
|
# Check for old GTK (1.2.x)
|
||||||
echocheck "GTK version"
|
echocheck "GTK version"
|
||||||
if test -z "$_gtkconfig" ; then
|
if test -z "$_gtkconfig" ; then
|
||||||
if ( gtk-config --version ) >/dev/null 2>&1 ; then
|
if ( gtk-config --version ) >/dev/null 2>&1 ; then
|
||||||
|
@ -6663,7 +6698,9 @@ EOF
|
||||||
echores "$_glib (using $_glibconfig)"
|
echores "$_glib (using $_glibconfig)"
|
||||||
|
|
||||||
_def_gui='#define HAVE_NEW_GUI 1'
|
_def_gui='#define HAVE_NEW_GUI 1'
|
||||||
|
_def_gtk2_gui='#undef HAVE_GTK2_GUI'
|
||||||
_ld_gui='$(GTKLIB) $(GLIBLIB)'
|
_ld_gui='$(GTKLIB) $(GLIBLIB)'
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Creating Gui/config.mak"
|
echo "Creating Gui/config.mak"
|
||||||
cat > Gui/config.mak << EOF
|
cat > Gui/config.mak << EOF
|
||||||
|
@ -6678,6 +6715,7 @@ EOF
|
||||||
|
|
||||||
else
|
else
|
||||||
_def_gui='#undef HAVE_NEW_GUI'
|
_def_gui='#undef HAVE_NEW_GUI'
|
||||||
|
_def_gtk2_gui='#undef HAVE_GTK2_GUI'
|
||||||
fi
|
fi
|
||||||
# --------------- GUI specific tests end -------------------
|
# --------------- GUI specific tests end -------------------
|
||||||
|
|
||||||
|
@ -7440,6 +7478,7 @@ $_def_unrarlib
|
||||||
|
|
||||||
/* gui support, please do not edit this option */
|
/* gui support, please do not edit this option */
|
||||||
$_def_gui
|
$_def_gui
|
||||||
|
$_def_gtk2_gui
|
||||||
|
|
||||||
/* Audio output drivers */
|
/* Audio output drivers */
|
||||||
$_def_ossaudio
|
$_def_ossaudio
|
||||||
|
|
Loading…
Reference in New Issue