[MPlayer-dev-eng] GTK2
Torinthiel
torinthiel at megapolis.pl
Tue Aug 16 11:04:42 CEST 2005
On Tue, Aug 16, 2005 at 01:16:31AM +0200, Alexander Strasser wrote:
> Why do you use a subshell here and is &> really portable? AFAIK not.
> Maybe I am just to tired but i think would rather like to see it done
> this way:
> if pkg-config gtk+-2.0 --modversion >/dev/null 2>&1 ; then
Probably because subshell is already in the GTK code (and number of other
places possibly). Anyway here is the patch with &> replaced, works for
me.
Torinthiel
--
Waclaw "Torinthiel" Schiller GG#: 542916, 3073512
torinthiel(at)megapolis(dot)pl
gpg: 0906A2CE fpr: EE3E DFB4 C4D6 E22E 8999 D714 7CEB CDDC 0906 A2CE
"No classmates may be used during this examination"
-------------- next part --------------
diff -Nur MPlayer-1.0pre7/configure MPlayer-1.0pre7-gtk2/configure
--- MPlayer-1.0pre7/configure 2005-04-13 14:46:35.000000000 +0300
+++ MPlayer-1.0pre7-gtk2/configure 2005-08-15 20:42:42.259703204 +0300
@@ -150,7 +150,8 @@
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]
@@ -1373,6 +1374,7 @@
_lirc=auto
_lircc=auto
_gui=no
+_gtk1=no
_termcap=auto
_termios=auto
_3dfx=no
@@ -1614,6 +1616,7 @@
--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 ;;
@@ -6412,8 +6415,40 @@
fi
echores "$_xshape"
+#Check for GTK
+if test "$_gtk1" = no ; then
+ #Check for GTK2 :
+ echocheck "GTK+ version"
+
+ if ( pkg-config gtk+-2.0 --modversion ) > /dev/null 2>&1 ; then
+ _gtk=`pkg-config gtk+-2.0 --modversion 2>&1`
+ _inc_gtk=`pkg-config gtk+-2.0 --cflags 2>&1`
+ _ld_gtk=`pkg-config gtk+-2.0 --libs 2>&1`
+ echores "$_gtk"
+
+ # Check for GLIB2
+ if ( pkg-config glib-2.0 --modversion ) > /dev/null 2>&1 ; then
+ echocheck "glib version"
+ _glib=`pkg-config glib-2.0 --modversion 2>&1`
+ _inc_glib=`pkg-config glib-2.0 --cflags 2>&1`
+ _ld_glib=`pkg-config glib-2.0 --libs 2>&1`
+ 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
@@ -6446,7 +6481,9 @@
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
@@ -6461,6 +6498,7 @@
else
_def_gui='#undef HAVE_NEW_GUI'
+ _def_gtk2_gui='#undef HAVE_GTK2_GUI'
fi
# --------------- GUI specific tests end -------------------
@@ -7206,6 +7244,7 @@
/* gui support, please do not edit this option */
$_def_gui
+$_def_gtk2_gui
/* Audio output drivers */
$_def_ossaudio
diff -Nur MPlayer-1.0pre7/Gui/mplayer/gtk/about.c MPlayer-1.0pre7-gtk2/Gui/mplayer/gtk/about.c
--- MPlayer-1.0pre7/Gui/mplayer/gtk/about.c 2004-06-15 13:52:36.000000000 +0300
+++ MPlayer-1.0pre7-gtk2/Gui/mplayer/gtk/about.c 2005-08-15 20:42:36.602296069 +0300
@@ -28,6 +28,11 @@
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 @@
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 -Nur MPlayer-1.0pre7/Gui/mplayer/widgets.c MPlayer-1.0pre7-gtk2/Gui/mplayer/widgets.c
--- MPlayer-1.0pre7/Gui/mplayer/widgets.c 2004-12-15 03:22:24.000000000 +0200
+++ MPlayer-1.0pre7-gtk2/Gui/mplayer/widgets.c 2005-08-15 20:42:36.603453476 +0300
@@ -217,7 +217,15 @@
gtk_widget_destroy( PopUpMenu );
}
PopUpMenu=create_PopUpMenu();
+#ifdef HAVE_GTK2_GUI
+ // Ugly hack, but we don't wanna 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 )
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20050816/55e58366/attachment.pgp>
More information about the MPlayer-dev-eng
mailing list