Mercurial > mplayer.hg
changeset 1694:0def229bd8bc
GUI support (--enable-gui)
author | arpi |
---|---|
date | Sat, 25 Aug 2001 21:05:23 +0000 |
parents | d237c5d4b216 |
children | bdd63cf7f00f |
files | Makefile configure mplayer.c |
diffstat | 3 files changed, 107 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Sat Aug 25 21:04:29 2001 +0000 +++ b/Makefile Sat Aug 25 21:05:23 2001 +0000 @@ -80,7 +80,7 @@ @for a in $(PARTS); do $(MAKE) -C $$a all ; done $(PRG): $(MPLAYER_DEP) - $(CC) $(CFLAGS) -o $(PRG) mplayer.o $(OBJS) $(XMM_LIBS) $(LIRC_LIBS) $(A_LIBS) -lm $(TERMCAP_LIB) $(LIB_LOADER) $(AV_LIB) -Llibmpeg2 -lmpeg2 -Llibao2 -lao2 $(VO_LIBS) $(CSS_LIB) -Lencore -lencore $(DECORE_LIBS) $(ARCH_LIBS) + $(CC) $(CFLAGS) -o $(PRG) mplayer.o $(OBJS) $(XMM_LIBS) $(LIRC_LIBS) $(A_LIBS) -lm $(TERMCAP_LIB) $(LIB_LOADER) $(AV_LIB) -Llibmpeg2 -lmpeg2 -Llibao2 -lao2 $(VO_LIBS) $(CSS_LIB) -Lencore -lencore $(DECORE_LIBS) $(GUI_LIBS) $(ARCH_LIBS) $(PRG_FIBMAP): fibmap_mplayer.o $(CC) -o $(PRG_FIBMAP) fibmap_mplayer.o
--- a/configure Sat Aug 25 21:04:29 2001 +0000 +++ b/configure Sat Aug 25 21:05:23 2001 +0000 @@ -877,6 +877,34 @@ _dga2=no $_cc $_x11incdir $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext -lXxf86dga -lXxf86vm $_socklib > /dev/null 2>&1 && _dga2=yes +# --- checkin X11 XShape extension + +# echo -en 'Checking XShape extension ... ' + +cat > $TMPC << EOF +#include <X11/Xlib.h> +#include <X11/Xproto.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +#include <stdlib.h> +int main( void ) +{ + char * name = ":0.0"; + Display * wsDisplay; + int exitvar = 0; + int eventbase,errorbase; + + if ( getenv( "DISPLAY" ) ) name=getenv( "DISPLAY" ); + wsDisplay=XOpenDisplay( name ); + if ( !XShapeQueryExtension( wsDisplay,&eventbase,&errorbase ) ) exitvar=1; + XCloseDisplay( wsDisplay ); + return exitvar; +} +EOF + +_xshape=no +$_cc $_x11incdir $TMPC -o $TMPO -L/usr/X11R6/lib -L/usr/X11/lib -lX11 -lXext $_socklib > /dev/null 2>&1 && _xshape=yes + fi cat > $TMPC << EOF @@ -1476,6 +1504,53 @@ echo "Extra headers : $_extraincdir" # write conf files. +if [ $_gui = yes ]; then +# --------------- GUI begin ------------------- + +echo -en "\nChecking for gtk version ... " +_gtk=`gtk-config --version 2>&1` +[ -z "$_gtk" ] && { echo 'gtk not found.'; exit 1; } +echo "$_gtk" + +echo -n "Checking for gtk includes ... " +_gtkinc=`gtk-config --cflags 2>&1` +[ -z "$_gtkinc" ] && { echo 'gtk not found.'; exit 1; } +echo "done" + +echo -n "Checking for gtk libs ... " +_gtklib=`gtk-config --libs 2>&1` +[ -z "$_gtklib" ] && { echo 'gtk not found.'; exit 1; } +echo "done" + +echo -en "\nChecking for glib version ... " +_glib=`glib-config --version 2>&1` +[ -z "$_glib" ] && { echo 'glib not found.'; exit 1; } +echo "$_glib" + +echo -n "Checking for glib includes ... " +_glibinc=`glib-config --cflags 2>&1` +[ -z "$_glibinc" ] && { echo 'glib not found.'; exit 1; } +echo "done" + +echo -n "Checking for glib libs ... " +_gliblib=`glib-config --libs 2>&1` +[ -z "$_gliblib" ] && { echo 'glib not found.'; exit 1; } +echo "done" + +cat > Gui/config.mak << EOF + +# -------- Generated by ./configure ----------- + +GTKINC=$_gtkinc +GTKLIBS=$_gtklib +GLIBINC=$_glibinc +GLIBLIBS=$_gliblib + +EOF + +# --------------- GUI end ------------------- +fi + _streamingdef='#undef STREAMING' if [ $_streaming = yes ]; then _streamingsrcs='asf_streaming.c network.c url.c http.c' @@ -1884,6 +1959,12 @@ _dga2='#undef HAVE_DGA2' fi +if [ "$_xshape" = "yes" ]; then + _xshape_def='#define HAVE_XSHAPE' +else + _xshape_def='#undef HAVE_XSHAPE' +fi + if [ $_fbdev = yes ]; then _fbdev='#define HAVE_FBDEV' _vosrc=$_vosrc' vo_fbdev.c' @@ -1892,9 +1973,12 @@ fi if [ $_gui = yes ]; then - _gui='#define HAVE_GUI' +# _gui_def='#define HAVE_GUI' + _gui_def='#define HAVE_NEW_GUI' + _gui_lib='-LGui -lgui $(GTKLIB) $(GLIBLIB)' else - _gui='#undef HAVE_GUI' + _gui_def='#undef HAVE_GUI' + _gui_lib='' fi if [ $_divx4linux = yes ]; then @@ -1961,6 +2045,13 @@ TARGET_SSE=$_cfg_sse BINUTILS=$_binutils + +# --- GUI stuff --- +GTKLIB=$_gtklib +GLIBLIB=$_gliblib +GUI_LIBS = $_gui_lib +DEBUG=-DDEBUG + EOF cat > $CCONF << EOF @@ -2067,7 +2158,7 @@ $_fastmemcpy /* gui support, please do not edit this option */ -$_gui +$_gui_def #define PREFIX "$_prefix" /* Audio lib drivers */ @@ -2155,6 +2246,9 @@ $_have_xdpms $_aa +/* used by GUI: */ +$_xshape_def + #if defined(HAVE_GL)||defined(HAVE_X11)||defined(HAVE_XV) #define X11_FULLSCREEN #endif
--- a/mplayer.c Sat Aug 25 21:04:29 2001 +0000 +++ b/mplayer.c Sat Aug 25 21:05:23 2001 +0000 @@ -462,6 +462,14 @@ mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s",banner_text); +#ifdef HAVE_NEW_GUI +// this one segfaults if running 'mplayer' (without path containing '/') +// if ( !strcmp( strrchr( argv[0],'/' ),"/gmplayer" ) ) appInit( argc,argv,envp ); + if ( strstr( argv[0],"gmplayer" ) ) appInit( argc,argv,envp ); + +#endif + + #ifdef HAVE_GUI if ( nogui ) { #endif @@ -560,6 +568,7 @@ load_termcap(NULL); // load key-codes #endif + //========= Catch terminate signals: ================ // terminate requests: signal(SIGTERM,exit_sighandler); // kill