1
mirror of https://github.com/mpv-player/mpv synced 2024-10-30 04:46:41 +01:00

GUI support (--enable-gui)

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1695 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
arpi 2001-08-25 21:05:23 +00:00
parent 9f6529b3d3
commit 8d100d9fdc
3 changed files with 107 additions and 4 deletions

View File

@ -80,7 +80,7 @@ mplayerwithoutlink: $(MPLAYER_DEP)
@for a in $(PARTS); do $(MAKE) -C $$a all ; done @for a in $(PARTS); do $(MAKE) -C $$a all ; done
$(PRG): $(MPLAYER_DEP) $(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 $(PRG_FIBMAP): fibmap_mplayer.o
$(CC) -o $(PRG_FIBMAP) fibmap_mplayer.o $(CC) -o $(PRG_FIBMAP) fibmap_mplayer.o

100
configure vendored
View File

@ -877,6 +877,34 @@ EOF
_dga2=no _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 $_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 fi
cat > $TMPC << EOF cat > $TMPC << EOF
@ -1476,6 +1504,53 @@ echo "Extra libs : $_extralibdir"
echo "Extra headers : $_extraincdir" echo "Extra headers : $_extraincdir"
# write conf files. # 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' _streamingdef='#undef STREAMING'
if [ $_streaming = yes ]; then if [ $_streaming = yes ]; then
_streamingsrcs='asf_streaming.c network.c url.c http.c' _streamingsrcs='asf_streaming.c network.c url.c http.c'
@ -1884,6 +1959,12 @@ else
_dga2='#undef HAVE_DGA2' _dga2='#undef HAVE_DGA2'
fi fi
if [ "$_xshape" = "yes" ]; then
_xshape_def='#define HAVE_XSHAPE'
else
_xshape_def='#undef HAVE_XSHAPE'
fi
if [ $_fbdev = yes ]; then if [ $_fbdev = yes ]; then
_fbdev='#define HAVE_FBDEV' _fbdev='#define HAVE_FBDEV'
_vosrc=$_vosrc' vo_fbdev.c' _vosrc=$_vosrc' vo_fbdev.c'
@ -1892,9 +1973,12 @@ else
fi fi
if [ $_gui = yes ]; then 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 else
_gui='#undef HAVE_GUI' _gui_def='#undef HAVE_GUI'
_gui_lib=''
fi fi
if [ $_divx4linux = yes ]; then if [ $_divx4linux = yes ]; then
@ -1961,6 +2045,13 @@ TARGET_3DNOWEX=$_cfg_3dnowex
TARGET_SSE=$_cfg_sse TARGET_SSE=$_cfg_sse
BINUTILS=$_binutils BINUTILS=$_binutils
# --- GUI stuff ---
GTKLIB=$_gtklib
GLIBLIB=$_gliblib
GUI_LIBS = $_gui_lib
DEBUG=-DDEBUG
EOF EOF
cat > $CCONF << EOF cat > $CCONF << EOF
@ -2067,7 +2158,7 @@ $_libavcodec
$_fastmemcpy $_fastmemcpy
/* gui support, please do not edit this option */ /* gui support, please do not edit this option */
$_gui $_gui_def
#define PREFIX "$_prefix" #define PREFIX "$_prefix"
/* Audio lib drivers */ /* Audio lib drivers */
@ -2155,6 +2246,9 @@ $_svga
$_have_xdpms $_have_xdpms
$_aa $_aa
/* used by GUI: */
$_xshape_def
#if defined(HAVE_GL)||defined(HAVE_X11)||defined(HAVE_XV) #if defined(HAVE_GL)||defined(HAVE_X11)||defined(HAVE_XV)
#define X11_FULLSCREEN #define X11_FULLSCREEN
#endif #endif

View File

@ -462,6 +462,14 @@ int use_stdin=0; //int f; // filedes
mp_msg(MSGT_CPLAYER,MSGL_INFO,"%s",banner_text); 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 #ifdef HAVE_GUI
if ( nogui ) { if ( nogui ) {
#endif #endif
@ -560,6 +568,7 @@ if(!parse_codec_cfg(get_path("codecs.conf"))){
load_termcap(NULL); // load key-codes load_termcap(NULL); // load key-codes
#endif #endif
//========= Catch terminate signals: ================ //========= Catch terminate signals: ================
// terminate requests: // terminate requests:
signal(SIGTERM,exit_sighandler); // kill signal(SIGTERM,exit_sighandler); // kill