From: Sam Hocevar Date: Wed, 21 Feb 2001 11:49:18 +0000 (+0000) Subject: (note: empty CVS mails mean that a new directory has been created, X-Git-Tag: 0.2.70~112 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=bec589af3d0359470566d1013d119dd079d81374;p=vlc (note: empty CVS mails mean that a new directory has been created, don't forget to use the -p option if you cvs update) * Added a plain Gtk+ port of the Gnome interface, for the gnome-impaired people. Gtk+ is now compiled by default, while Gnome isn't (you will have to add --enable-gnome when running configure) * Replaced -lcurses with -lncurses in configure.in. --- diff --git a/INSTALL b/INSTALL index ba999911cc..a6adae3f29 100644 --- a/INSTALL +++ b/INSTALL @@ -32,7 +32,7 @@ Here's a shortcut to copy-paste to do a clean build : make distclean 2>/dev/null ; ./configure --prefix=/usr --enable-gnome \ --enable-fb --with-glide --with-ggi --with-sdl --enable-esd \ - --enable-alsa --enable-mga && make + --enable-alsa --enable-mga --enable-gtk && make Installing and running VideoLAN diff --git a/Makefile.in b/Makefile.in index ea65455102..855f40f11f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -317,6 +317,12 @@ PLUGIN_GGI = plugins/ggi/ggi.o \ PLUGIN_GLIDE = plugins/glide/glide.o \ plugins/glide/vout_glide.o +PLUGIN_GTK = plugins/gtk/gtk.o \ + plugins/gtk/intf_gtk.o \ + plugins/gtk/gtk_callbacks.o \ + plugins/gtk/gtk_interface.o \ + plugins/gtk/gtk_support.o + PLUGIN_GNOME = plugins/gnome/gnome.o \ plugins/gnome/intf_gnome.o \ plugins/gnome/gnome_callbacks.o \ @@ -415,6 +421,7 @@ STD_PLUGIN_OBJ := $(filter-out $(STD_PLUGIN_COMMON), \ NONSTD_PLUGIN_OBJ = \ $(PLUGIN_GLIDE) \ + $(PLUGIN_GTK) \ $(PLUGIN_GNOME) NONSTD_CPP_PLUGIN_OBJ = \ @@ -542,10 +549,10 @@ plugins: $(PLUGINS:%=lib/%.so) FORCE: # -# Gnome and Framebuffer aliases - don't add new aliases which could bloat +# GTK/Gnome and Framebuffer aliases - don't add new aliases which could bloat # the namespace # -gvlc fbvlc: vlc +gvlc kvlc: vlc rm -f $@ && ln -s vlc $@ @@ -577,6 +584,11 @@ $(STD_PLUGIN_OBJ): %.o: .dep/%.d $(STD_PLUGIN_OBJ): %.o: %.c $(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $< +$(PLUGIN_GTK): %.o: Makefile.dep +$(PLUGIN_GTK): %.o: .dep/%.d +$(PLUGIN_GTK): %.o: %.c + $(CC) $(CFLAGS) $(PCFLAGS) `gtk-config --cflags gtk` -c -o $@ $< + $(PLUGIN_GNOME): %.o: Makefile.dep $(PLUGIN_GNOME): %.o: .dep/%.d $(PLUGIN_GNOME): %.o: %.c @@ -642,6 +654,9 @@ lib/x11.so: $(PLUGIN_X11) lib/mga.so: $(PLUGIN_MGA) $(CC) $(PCFLAGS) -shared -o $@ $^ -L/usr/X11R6/lib -lX11 -lXext +lib/gtk.so: $(PLUGIN_GTK) + $(CC) $(PCFLAGS) -shared -o $@ $^ `gtk-config --libs gtk | sed 's,-rdynamic,,'` + lib/gnome.so: $(PLUGIN_GNOME) $(CC) $(PCFLAGS) -shared -o $@ $^ `gnome-config --libs gnomeui | sed 's,-rdynamic,,'` @@ -655,7 +670,7 @@ lib/sdl.so: $(PLUGIN_SDL) $(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL) lib/ncurses.so: $(PLUGIN_NCURSES) - $(CC) $(PCFLAGS) -shared -o $@ $^ -lcurses + $(CC) $(PCFLAGS) -shared -o $@ $^ -lncurses ifeq ($(SYS),beos) lib/null.so: $(PLUGIN_NULL) diff --git a/configure b/configure index 6cd566d4de..dc122a87ce 100755 --- a/configure +++ b/configure @@ -42,7 +42,9 @@ ac_help="$ac_help ac_help="$ac_help --enable-kde KDE interface support (default disabled)" ac_help="$ac_help - --disable-gnome Gnome support (default enabled)" + --enable-gnome Gnome interface support (default disabled)" +ac_help="$ac_help + --disable-gtk Gtk+ support (default enabled)" ac_help="$ac_help --disable-x11 X11 support (default enabled)" ac_help="$ac_help @@ -585,7 +587,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } fi echo $ac_n "checking host system type""... $ac_c" 1>&6 -echo "configure:589: checking host system type" >&5 +echo "configure:591: checking host system type" >&5 host_alias=$host case "$host_alias" in @@ -612,7 +614,7 @@ VLC_CODENAME=Urumov echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:616: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:618: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -642,7 +644,7 @@ if test -z "$CC"; then # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:646: checking for $ac_word" >&5 +echo "configure:648: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -672,7 +674,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:676: checking for $ac_word" >&5 +echo "configure:678: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -723,7 +725,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:727: checking for $ac_word" >&5 +echo "configure:729: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -755,7 +757,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:759: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:761: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -766,12 +768,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 770 "configure" +#line 772 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:775: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:777: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -797,12 +799,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:801: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:803: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:806: checking whether we are using GNU C" >&5 +echo "configure:808: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -811,7 +813,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:815: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:817: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -830,7 +832,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:834: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:836: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -864,7 +866,7 @@ fi fi if test -z "$CPP"; then echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:868: checking how to run the C preprocessor" >&5 +echo "configure:870: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -879,13 +881,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:889: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:891: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -896,13 +898,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:906: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:908: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -913,13 +915,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -957,7 +959,7 @@ fi # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:961: checking for a BSD compatible install" >&5 +echo "configure:963: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1011,12 +1013,12 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:1015: checking for working const" >&5 +echo "configure:1017: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1071: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -1086,14 +1088,14 @@ EOF fi echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:1090: checking whether byte ordering is bigendian" >&5 +echo "configure:1092: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -1104,11 +1106,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1110: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -1119,7 +1121,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:1123: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1125: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -1139,7 +1141,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1158: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -1177,9 +1179,9 @@ fi echo $ac_n "checking whether compiler accepts bswap x86 instruction""... $ac_c" 1>&6 -echo "configure:1181: checking whether compiler accepts bswap x86 instruction" >&5 +echo "configure:1183: checking whether compiler accepts bswap x86 instruction" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_X86_BSWAP 1 @@ -1204,12 +1206,12 @@ rm -f conftest* for ac_func in gettimeofday select strerror strtod strtol do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1208: checking for $ac_func" >&5 +echo "configure:1210: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1238: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1259,12 +1261,12 @@ done for ac_func in setenv putenv do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1263: checking for $ac_func" >&5 +echo "configure:1265: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1312,12 +1314,12 @@ fi done echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:1316: checking for connect" >&5 +echo "configure:1318: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1346: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -1358,7 +1360,7 @@ if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:1362: checking for connect in -lsocket" >&5 +echo "configure:1364: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1366,7 +1368,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1383: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1407,12 +1409,12 @@ fi fi echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1411: checking for gethostbyname" >&5 +echo "configure:1413: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -1453,7 +1455,7 @@ if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1457: checking for gethostbyname in -lnsl" >&5 +echo "configure:1459: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1461,7 +1463,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1502,12 +1504,12 @@ fi fi echo $ac_n "checking for nanosleep""... $ac_c" 1>&6 -echo "configure:1506: checking for nanosleep" >&5 +echo "configure:1508: checking for nanosleep" >&5 if eval "test \"`echo '$''{'ac_cv_func_nanosleep'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_nanosleep=yes" else @@ -1548,7 +1550,7 @@ if eval "test \"`echo '$ac_cv_func_'nanosleep`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for nanosleep in -lrt""... $ac_c" 1>&6 -echo "configure:1552: checking for nanosleep in -lrt" >&5 +echo "configure:1554: checking for nanosleep in -lrt" >&5 ac_lib_var=`echo rt'_'nanosleep | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1556,7 +1558,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lrt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1573: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1593,7 +1595,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for nanosleep in -lposix4""... $ac_c" 1>&6 -echo "configure:1597: checking for nanosleep in -lposix4" >&5 +echo "configure:1599: checking for nanosleep in -lposix4" >&5 ac_lib_var=`echo posix4'_'nanosleep | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1601,7 +1603,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix4 $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1646,12 +1648,12 @@ fi for ac_func in usleep do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1650: checking for $ac_func" >&5 +echo "configure:1652: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1699,12 +1701,12 @@ fi done echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 -echo "configure:1703: checking for inet_aton" >&5 +echo "configure:1705: checking for inet_aton" >&5 if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1733: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_inet_aton=yes" else @@ -1745,7 +1747,7 @@ if eval "test \"`echo '$ac_cv_func_'inet_aton`\" = yes"; then else echo "$ac_t""no" 1>&6 echo $ac_n "checking for inet_aton in -lresolv""... $ac_c" 1>&6 -echo "configure:1749: checking for inet_aton in -lresolv" >&5 +echo "configure:1751: checking for inet_aton in -lresolv" >&5 ac_lib_var=`echo resolv'_'inet_aton | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1753,7 +1755,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lresolv $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1770: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -1796,12 +1798,12 @@ fi for ac_func in vasprintf do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1800: checking for $ac_func" >&5 +echo "configure:1802: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1830: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1852,17 +1854,17 @@ for ac_hdr in unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:1856: checking for $ac_hdr" >&5 +echo "configure:1858: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1866: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1868: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -1891,12 +1893,12 @@ done for ac_func in getpagesize do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:1895: checking for $ac_func" >&5 +echo "configure:1897: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1925: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -1944,7 +1946,7 @@ fi done echo $ac_n "checking for working mmap""... $ac_c" 1>&6 -echo "configure:1948: checking for working mmap" >&5 +echo "configure:1950: checking for working mmap" >&5 if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1952,7 +1954,7 @@ else ac_cv_func_mmap_fixed_mapped=no else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_func_mmap_fixed_mapped=yes else @@ -2115,12 +2117,12 @@ EOF fi echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 -echo "configure:2119: checking return type of signal handlers" >&5 +echo "configure:2121: checking return type of signal handlers" >&5 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2137,7 +2139,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2141: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2143: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_type_signal=void else @@ -2156,7 +2158,7 @@ EOF echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 -echo "configure:2160: checking for dlopen in -ldl" >&5 +echo "configure:2162: checking for dlopen in -ldl" >&5 ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2164,7 +2166,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2203,7 +2205,7 @@ else fi echo $ac_n "checking for optarg in -lgnugetopt""... $ac_c" 1>&6 -echo "configure:2207: checking for optarg in -lgnugetopt" >&5 +echo "configure:2209: checking for optarg in -lgnugetopt" >&5 ac_lib_var=`echo gnugetopt'_'optarg | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2211,7 +2213,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgnugetopt $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2250,7 +2252,7 @@ else fi echo $ac_n "checking for _ in -lbe""... $ac_c" 1>&6 -echo "configure:2254: checking for _ in -lbe" >&5 +echo "configure:2256: checking for _ in -lbe" >&5 ac_lib_var=`echo be'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2258,7 +2260,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lbe $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2275: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2297,7 +2299,7 @@ else fi echo $ac_n "checking for _ in -lgame""... $ac_c" 1>&6 -echo "configure:2301: checking for _ in -lgame" >&5 +echo "configure:2303: checking for _ in -lgame" >&5 ac_lib_var=`echo game'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2305,7 +2307,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lgame $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2344,7 +2346,7 @@ else fi echo $ac_n "checking for _ in -lroot""... $ac_c" 1>&6 -echo "configure:2348: checking for _ in -lroot" >&5 +echo "configure:2350: checking for _ in -lroot" >&5 ac_lib_var=`echo root'_'_ | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2352,7 +2354,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lroot $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2369: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2391,7 +2393,7 @@ else fi echo $ac_n "checking for powl in -lm""... $ac_c" 1>&6 -echo "configure:2395: checking for powl in -lm" >&5 +echo "configure:2397: checking for powl in -lm" >&5 ac_lib_var=`echo m'_'powl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2399,7 +2401,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2438,7 +2440,7 @@ else fi echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:2442: checking for pthread_create in -lpthread" >&5 +echo "configure:2444: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2446,7 +2448,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2463: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2485,7 +2487,7 @@ else fi echo $ac_n "checking for thread_create in -lthreads""... $ac_c" 1>&6 -echo "configure:2489: checking for thread_create in -lthreads" >&5 +echo "configure:2491: checking for thread_create in -lthreads" >&5 ac_lib_var=`echo threads'_'thread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2493,7 +2495,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lthreads $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2510: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -2533,12 +2535,12 @@ fi echo $ac_n "checking for getopt_long""... $ac_c" 1>&6 -echo "configure:2537: checking for getopt_long" >&5 +echo "configure:2539: checking for getopt_long" >&5 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_getopt_long=yes" else @@ -2588,17 +2590,17 @@ for ac_hdr in stddef.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2592: checking for $ac_hdr" >&5 +echo "configure:2594: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2602: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2628,17 +2630,17 @@ for ac_hdr in getopt.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2632: checking for $ac_hdr" >&5 +echo "configure:2634: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2644: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2668,17 +2670,17 @@ for ac_hdr in sys/sockio.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2672: checking for $ac_hdr" >&5 +echo "configure:2674: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2682: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2684: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2708,17 +2710,17 @@ for ac_hdr in fcntl.h sys/time.h unistd.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2712: checking for $ac_hdr" >&5 +echo "configure:2714: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2748,17 +2750,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2752: checking for $ac_hdr" >&5 +echo "configure:2754: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2762: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2764: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2788,17 +2790,17 @@ for ac_hdr in dlfcn.h image.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2792: checking for $ac_hdr" >&5 +echo "configure:2794: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2802: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2804: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2828,17 +2830,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2832: checking for $ac_hdr" >&5 +echo "configure:2834: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2844: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2868,17 +2870,17 @@ for ac_hdr in machine/param.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2872: checking for $ac_hdr" >&5 +echo "configure:2874: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2882: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2909,17 +2911,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2913: checking for $ac_hdr" >&5 +echo "configure:2915: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2925: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2950,9 +2952,9 @@ save_CFLAGS=$CFLAGS CFLAGS="${CFLAGS} -Wall -Werror" echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6 -echo "configure:2954: checking for ntohl in sys/param.h" >&5 +echo "configure:2956: checking for ntohl in sys/param.h" >&5 cat > conftest.$ac_ext < void foo() { int meuh; ntohl(meuh); } @@ -2960,7 +2962,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:2964: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2966: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define NTOHL_IN_SYS_PARAM_H 1 @@ -2977,16 +2979,16 @@ rm -f conftest* CFLAGS="${CFLAGS} -rdynamic" echo $ac_n "checking if \$CC accepts -rdynamic""... $ac_c" 1>&6 -echo "configure:2981: checking if \$CC accepts -rdynamic" >&5 +echo "configure:2983: checking if \$CC accepts -rdynamic" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2992: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* DYNAMIC_FLAG="-rdynamic" echo "$ac_t""yes" 1>&6 @@ -3001,9 +3003,9 @@ rm -f conftest* CFLAGS=$save_CFLAGS echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6 -echo "configure:3005: checking for boolean_t in sys/types.h" >&5 +echo "configure:3007: checking for boolean_t in sys/types.h" >&5 cat > conftest.$ac_ext < void quux() { boolean_t foo; } @@ -3011,7 +3013,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3015: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3017: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define BOOLEAN_T_IN_SYS_TYPES_H 1 @@ -3027,12 +3029,12 @@ fi rm -f conftest* echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:3031: checking for working const" >&5 +echo "configure:3033: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -3102,12 +3104,12 @@ EOF fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:3106: checking for ANSI C header files" >&5 +echo "configure:3108: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3115,7 +3117,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3121: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3132,7 +3134,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3150,7 +3152,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -3171,7 +3173,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -3182,7 +3184,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:3186: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3188: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -3206,12 +3208,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3210: checking for size_t" >&5 +echo "configure:3212: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3239,12 +3241,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3243: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3245: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3253,7 +3255,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3257: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3285,17 +3287,17 @@ for ac_hdr in sys/ioctl.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3289: checking for $ac_hdr" >&5 +echo "configure:3291: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3299: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3301: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3320,17 +3322,17 @@ EOF do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:3324: checking for $ac_hdr" >&5 +echo "configure:3326: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3336: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3357,7 +3359,7 @@ fi done cat > conftest.$ac_ext < EOF @@ -3423,6 +3425,9 @@ if test x$host_os = xbeos; then else +GVLC=0 +KVLC=0 + # Check whether --enable-dummy or --disable-dummy was given. if test "${enable_dummy+set}" = set; then enableval="$enable_dummy" @@ -3506,16 +3511,22 @@ fi # Check whether --enable-kde or --disable-kde was given. if test "${enable_kde+set}" = set; then enableval="$enable_kde" - if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; ALIASE=${ALIASES}"kvlc"; fi + if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; KVLC=1; fi fi # Check whether --enable-gnome or --disable-gnome was given. if test "${enable_gnome+set}" = set; then enableval="$enable_gnome" + if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; GVLC=1; fi +fi + +# Check whether --enable-gtk or --disable-gtk was given. +if test "${enable_gtk+set}" = set; then + enableval="$enable_gtk" : fi -if test x$enable_gnome != xno; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi +if test x$enable_gtk != xno; then PLUGINS=${PLUGINS}"gtk "; GVLC=1; fi # Check whether --enable-x11 or --disable-x11 was given. if test "${enable_x11+set}" = set; then enableval="$enable_x11" @@ -3529,17 +3540,17 @@ if test "${enable_alsa+set}" = set; then enableval="$enable_alsa" if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6 -echo "configure:3533: checking for sys/asoundlib.h" >&5 +echo "configure:3544: checking for sys/asoundlib.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3543: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3554: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3556,7 +3567,7 @@ fi if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then echo "$ac_t""yes" 1>&6 echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6 -echo "configure:3560: checking for main in -lasound" >&5 +echo "configure:3571: checking for main in -lasound" >&5 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3564,14 +3575,14 @@ else ac_save_LIBS="$LIBS" LIBS="-lasound $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3586: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3599,6 +3610,10 @@ fi if test $have_alsa = true; then PLUGINS=${PLUGINS}"alsa "; fi; fi fi + +if test x$GVLC = x1 ; then ALIASES=${ALIASES}"gvlc "; fi +if test x$KVLC = x1 ; then ALIASES=${ALIASES}"kvlc "; fi + fi diff --git a/configure.in b/configure.in index 20c262ee60..f0a6e59920 100644 --- a/configure.in +++ b/configure.in @@ -143,6 +143,9 @@ if test x$host_os = xbeos; then dnl default case else +GVLC=0 +KVLC=0 + AC_ARG_ENABLE(dummy, [ --disable-dummy dummy module (default enabled)]) if test x$enable_dummy != xno; then PLUGINS=${PLUGINS}"dummy "; fi @@ -195,10 +198,13 @@ AC_ARG_ENABLE(ncurses, [if test x$enable_ncurses = xyes; then PLUGINS=${PLUGINS}"ncurses "; fi]) AC_ARG_ENABLE(kde, [ --enable-kde KDE interface support (default disabled)], - [if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; ALIASE=${ALIASES}"kvlc"; fi]) + [if test x$enable_kde = xyes; then PLUGINS=${PLUGINS}"kde "; KVLC=1; fi]) AC_ARG_ENABLE(gnome, - [ --disable-gnome Gnome support (default enabled)]) -if test x$enable_gnome != xno; then PLUGINS=${PLUGINS}"gnome "; ALIASES=${ALIASES}"gvlc "; fi + [ --enable-gnome Gnome interface support (default disabled)], + [if test x$enable_gnome = xyes; then PLUGINS=${PLUGINS}"gnome "; GVLC=1; fi]) +AC_ARG_ENABLE(gtk, + [ --disable-gtk Gtk+ support (default enabled)]) +if test x$enable_gtk != xno; then PLUGINS=${PLUGINS}"gtk "; GVLC=1; fi AC_ARG_ENABLE(x11, [ --disable-x11 X11 support (default enabled)]) if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi @@ -206,6 +212,10 @@ if test x$enable_x11 != xno; then PLUGINS=${PLUGINS}"x11 "; fi AC_ARG_ENABLE(alsa, [ --enable-alsa Alsa sound drivers support (Only for linux) (default disabled)], [if test x$enable_alsa = xyes; then AC_CHECK_HEADER(sys/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false") if test $have_alsa = true; then PLUGINS=${PLUGINS}"alsa "; fi; fi]) + +if test x$GVLC = x1 ; then ALIASES=${ALIASES}"gvlc "; fi +if test x$KVLC = x1 ; then ALIASES=${ALIASES}"kvlc "; fi + fi AC_SUBST(SYS) diff --git a/plugins/gnome/gnome_interface.c b/plugins/gnome/gnome_interface.c index 221047fce8..8896d44107 100644 --- a/plugins/gnome/gnome_interface.c +++ b/plugins/gnome/gnome_interface.c @@ -28,14 +28,14 @@ static GnomeUIInfo menubar_file_menu_uiinfo[] = static GnomeUIInfo menubar_view_menu_uiinfo[] = { { - GNOME_APP_UI_ITEM, N_("P_laylist"), + GNOME_APP_UI_ITEM, N_("_Playlist..."), N_("Open the playlist window"), (gpointer) on_menubar_playlist_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_INDEX, 0, (GdkModifierType) 0, NULL }, { - GNOME_APP_UI_ITEM, N_("_Modules"), + GNOME_APP_UI_ITEM, N_("_Modules..."), N_("Open the plugin manager"), (gpointer) on_menubar_modules_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ATTACH, diff --git a/plugins/gnome/intf_gnome.glade b/plugins/gnome/intf_gnome.glade index 587bd797e9..663b8f4e36 100644 --- a/plugins/gnome/intf_gnome.glade +++ b/plugins/gnome/intf_gnome.glade @@ -131,7 +131,7 @@ on_menubar_playlist_activate Sun, 11 Feb 2001 16:55:04 GMT - + False GNOME_STOCK_MENU_INDEX @@ -146,7 +146,7 @@ on_menubar_modules_activate Tue, 13 Feb 2001 17:19:41 GMT - + False GNOME_STOCK_MENU_ATTACH @@ -596,6 +596,7 @@ Andres Krapf <dae@via.ecp.fr> Christophe Massiot <massiot@via.ecp.fr> Vincent Seguin <seguin@via.ecp.fr> Benoit Steiner <benny@via.ecp.fr> +Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr> Jean-Marc Dressler <polux@via.ecp.fr> Gaël Hendryckx <jimmy@via.ecp.fr> Samuel Hocevar <sam@zoy.org> diff --git a/plugins/gtk/.cvsignore b/plugins/gtk/.cvsignore new file mode 100644 index 0000000000..751553b3ac --- /dev/null +++ b/plugins/gtk/.cvsignore @@ -0,0 +1 @@ +*.bak diff --git a/plugins/gtk/gtk.c b/plugins/gtk/gtk.c new file mode 100644 index 0000000000..4459cc2dc8 --- /dev/null +++ b/plugins/gtk/gtk.c @@ -0,0 +1,109 @@ +/***************************************************************************** + * gtk.c : Gtk+ plugin for vlc + ***************************************************************************** + * Copyright (C) 2000 VideoLAN + * + * Authors: Samuel Hocevar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +#define MODULE_NAME gtk +#include "modules_inner.h" + +/***************************************************************************** + * Preamble + *****************************************************************************/ +#include "defs.h" + +#include /* malloc(), free() */ + +#include "config.h" +#include "common.h" /* boolean_t, byte_t */ +#include "threads.h" +#include "mtime.h" + +#include "modules.h" + +/***************************************************************************** + * Building configuration tree + *****************************************************************************/ +MODULE_CONFIG_START +ADD_WINDOW( "Configuration for Gtk+ module" ) + ADD_COMMENT( "For now, the Gtk+ module cannot be configured" ) +MODULE_CONFIG_END + +/***************************************************************************** + * Capabilities defined in the other files. + ******************************************************************************/ +void _M( intf_getfunctions )( function_list_t * p_function_list ); + +/***************************************************************************** + * InitModule: get the module structure and configuration. + ***************************************************************************** + * We have to fill psz_name, psz_longname and psz_version. These variables + * will be strdup()ed later by the main application because the module can + * be unloaded later to save memory, and we want to be able to access this + * data even after the module has been unloaded. + *****************************************************************************/ +MODULE_INIT +{ + p_module->psz_name = MODULE_STRING; + p_module->psz_longname = "Gtk+ interface module"; + p_module->psz_version = VERSION; + + p_module->i_capabilities = MODULE_CAPABILITY_NULL + | MODULE_CAPABILITY_INTF; + + return( 0 ); +} + +/***************************************************************************** + * ActivateModule: set the module to an usable state. + ***************************************************************************** + * This function fills the capability functions and the configuration + * structure. Once ActivateModule() has been called, the i_usage can + * be set to 0 and calls to NeedModule() be made to increment it. To unload + * the module, one has to wait until i_usage == 0 and call DeactivateModule(). + *****************************************************************************/ +MODULE_ACTIVATE +{ + p_module->p_functions = malloc( sizeof( module_functions_t ) ); + if( p_module->p_functions == NULL ) + { + return( -1 ); + } + + _M( intf_getfunctions )( &p_module->p_functions->intf ); + + p_module->p_config = p_config; + + return( 0 ); +} + +/***************************************************************************** + * DeactivateModule: make sure the module can be unloaded. + ***************************************************************************** + * This function must only be called when i_usage == 0. If it successfully + * returns, i_usage can be set to -1 and the module unloaded. Be careful to + * lock usage_lock during the whole process. + *****************************************************************************/ +MODULE_DEACTIVATE +{ + free( p_module->p_functions ); + + return( 0 ); +} + diff --git a/plugins/gtk/gtk.o b/plugins/gtk/gtk.o new file mode 100644 index 0000000000..5582e1fae0 Binary files /dev/null and b/plugins/gtk/gtk.o differ diff --git a/plugins/gtk/gtk_callbacks.c b/plugins/gtk/gtk_callbacks.c new file mode 100644 index 0000000000..93491832f4 --- /dev/null +++ b/plugins/gtk/gtk_callbacks.c @@ -0,0 +1,596 @@ +/***************************************************************************** + * gtk_callbacks.c : Callbacks for the Gtk+ plugin. + ***************************************************************************** + * Copyright (C) 2000, 2001 VideoLAN + * + * Authors: Samuel Hocevar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +#define MODULE_NAME gtk +#include "modules_inner.h" + +/***************************************************************************** + * Preamble + *****************************************************************************/ +#include "defs.h" + +#include + +#include "config.h" +#include "common.h" +#include "threads.h" +#include "mtime.h" + +#include "stream_control.h" +#include "input_ext-intf.h" + +#include "interface.h" +#include "intf_plst.h" +#include "intf_msg.h" + +#include "gtk_sys.h" +#include "gtk_callbacks.h" +#include "gtk_interface.h" +#include "gtk_support.h" + +#include "main.h" + +/***************************************************************************** + * Inline function to retrieve the interface structure + *****************************************************************************/ +static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent ) +{ + return( gtk_object_get_data( GTK_OBJECT( lookup_widget(item, psz_parent) ), + "p_intf" ) ); +} + +/***************************************************************************** + * Callbacks + ******************************************************************************/ +void +on_menubar_open_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + + /* If we have never used the file selector, open it */ + if( p_intf->p_sys->p_fileopen == NULL) + { + p_intf->p_sys->p_fileopen = create_intf_fileopen(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ), + "p_intf", p_intf ); + } + + gtk_widget_show( p_intf->p_sys->p_fileopen ); + gdk_window_raise( p_intf->p_sys->p_fileopen->window ); +} + + +void +on_menubar_exit_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + + p_intf->b_die = 1; +} + + +void +on_menubar_playlist_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + + if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) ) + { +// p_intf->p_sys->p_playlist = create_intf_playlist(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ), + "p_intf", p_intf ); + } + gtk_widget_show( p_intf->p_sys->p_playlist ); + gdk_window_raise( p_intf->p_sys->p_playlist->window ); +} + + +void +on_menubar_preferences_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + +} + + +void +on_menubar_about_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + + if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) ) + { + p_intf->p_sys->p_about = create_intf_about(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_about ), + "p_intf", p_intf ); + } + gtk_widget_show( p_intf->p_sys->p_about ); + gdk_window_raise( p_intf->p_sys->p_about->window ); +} + + +void +on_toolbar_open_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + /* If we have never used the file selector, open it */ + if( p_intf->p_sys->p_fileopen == NULL) + { + p_intf->p_sys->p_fileopen = create_intf_fileopen(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ), + "p_intf", p_intf ); + } + + gtk_widget_show( p_intf->p_sys->p_fileopen ); + gdk_window_raise( p_intf->p_sys->p_fileopen->window ); +} + + +void +on_toolbar_back_clicked (GtkButton *button, + gpointer user_data) +{ + +} + + +void +on_toolbar_stop_clicked (GtkButton *button, + gpointer user_data) +{ + +} + + +void +on_toolbar_play_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); + } +} + + +void +on_toolbar_pause_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE ); + } +} + + +void +on_toolbar_playlist_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) ) + { +// p_intf->p_sys->p_playlist = create_intf_playlist(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_playlist ), + "p_intf", p_intf ); + } + gtk_widget_show( p_intf->p_sys->p_playlist ); + gdk_window_raise( p_intf->p_sys->p_playlist->window ); +} + + +void +on_toolbar_prev_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + if( p_intf->p_input != NULL ) + { + /* FIXME: temporary hack */ + intf_PlstPrev( p_main->p_playlist ); + intf_PlstPrev( p_main->p_playlist ); + p_intf->p_input->b_eof = 1; + } +} + + +void +on_toolbar_next_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + if( p_intf->p_input != NULL ) + { + /* FIXME: temporary hack */ + p_intf->p_input->b_eof = 1; + } +} + + +void +on_popup_play_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY ); + } +} + + +void +on_popup_pause_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_PAUSE ); + } +} + + +void +on_popup_exit_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + + p_intf->b_die = 1; +} + + +void +on_intf_window_destroy (GtkObject *object, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_window" ); + + /* FIXME don't destroy the window, just hide it */ + p_intf->b_die = 1; + p_intf->p_sys->p_window = NULL; +} + + +void +on_fileopen_ok_clicked (GtkButton *button, + gpointer user_data) +{ + GtkWidget *filesel; + gchar *filename; + + filesel = gtk_widget_get_toplevel (GTK_WIDGET (button)); + gtk_widget_hide (filesel); + filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel)); + + intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename ); +} + + +void +on_fileopen_cancel_clicked (GtkButton *button, + gpointer user_data) +{ + gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); +} + + +void +on_intf_fileopen_destroy (GtkObject *object, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_fileopen" ); + + p_intf->p_sys->p_fileopen = NULL; +} + + +void +on_popup_open_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + + /* If we have never used the file selector, open it */ + if( p_intf->p_sys->p_fileopen == NULL) + { + p_intf->p_sys->p_fileopen = create_intf_fileopen(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ), + "p_intf", p_intf ); + } + + gtk_widget_show( p_intf->p_sys->p_fileopen ); + gdk_window_raise( p_intf->p_sys->p_fileopen->window ); +} + + +void +on_popup_about_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + + if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) ) + { + p_intf->p_sys->p_about = create_intf_about(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_about ), + "p_intf", p_intf ); + } + gtk_widget_show( p_intf->p_sys->p_about ); + gdk_window_raise( p_intf->p_sys->p_about->window ); +} + + +void +on_intf_playlist_destroy (GtkObject *object, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_playlist" ); + + p_intf->p_sys->p_playlist = NULL; +} + + +void +on_playlist_close_clicked (GtkButton *button, + gpointer user_data) +{ + gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); +} + + +void +on_popup_slow_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER ); + } +} + + +void +on_popup_fast_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER ); + } +} + + +void +on_toolbar_slow_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_SLOWER ); + } +} + + +void +on_toolbar_fast_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + + if( p_intf->p_input != NULL ) + { + input_SetStatus( p_intf->p_input, INPUT_STATUS_FASTER ); + } +} + + +gboolean +on_hscale_button_release_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); + + GtkAdjustment *p_adj = gtk_range_get_adjustment( GTK_RANGE(widget) ); + off_t i_seek; + + vlc_mutex_lock( &p_intf->p_sys->change_lock ); + + if( p_intf->p_input != NULL ) + { + i_seek = (p_adj->value * + p_intf->p_input->stream.p_selected_area->i_size) / 100; + input_Seek( p_intf->p_input, i_seek ); + } + p_intf->p_sys->b_scale_isfree = 1; + + vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + + return FALSE; +} + + +gboolean +on_hscale_button_press_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" ); + + vlc_mutex_lock( &p_intf->p_sys->change_lock ); + p_intf->p_sys->b_scale_isfree = 0; + vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + + return FALSE; +} + + + +void +on_intf_modules_destroy (GtkObject *object, + gpointer user_data) +{ + +} + + +void +on_modules_ok_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" ); + + gtk_widget_hide( p_intf->p_sys->p_modules ); + +} + + +void +on_modules_apply_clicked (GtkButton *button, + gpointer user_data) +{ + +} + + +void +on_modules_cancel_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_modules" ); + + gtk_widget_hide( p_intf->p_sys->p_modules ); +} + + +void +on_playlist_ok_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_playlist" ); + + gtk_widget_hide( p_intf->p_sys->p_playlist ); +} + + +void +on_menubar_modules_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + + if( !GTK_IS_WIDGET( p_intf->p_sys->p_modules ) ) + { +// p_intf->p_sys->p_modules = create_intf_modules(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_modules ), + "p_intf", p_intf ); + } + gtk_widget_show( p_intf->p_sys->p_modules ); + gdk_window_raise( p_intf->p_sys->p_modules->window ); +} + + +void +on_intf_window_drag_data_received (GtkWidget *widget, + GdkDragContext *drag_context, + gint x, + gint y, + GtkSelectionData *data, + guint info, + guint time, + gpointer user_data) +{ + char *psz_text = data->data; + int i_len = strlen( psz_text ); + + switch( info ) + { + case DROP_ACCEPT_TEXT_PLAIN: /* FIXME: handle multiple files */ + + if( i_len < 1 ) + { + return; + } + + /* get rid of ' ' at the end */ + *( psz_text + i_len - 1 ) = 0; + + intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'", psz_text ); + intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_text ); + + break; + + case DROP_ACCEPT_TEXT_URI_LIST: /* FIXME: handle multiple files */ + + if( i_len < 2 ) + { + return; + } + + /* get rid of \r\n at the end */ + *( psz_text + i_len - 2 ) = 0; + + intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'", psz_text ); + intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_text ); + break; + + default: + + intf_ErrMsg( "intf error: unknown dropped type"); + break; + } +} + + +void +on_about_ok_clicked (GtkButton *button, + gpointer user_data) +{ + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_about" ); + + gtk_widget_hide( p_intf->p_sys->p_about ); +} + diff --git a/plugins/gtk/gtk_callbacks.h b/plugins/gtk/gtk_callbacks.h new file mode 100644 index 0000000000..d2ac4d56c4 --- /dev/null +++ b/plugins/gtk/gtk_callbacks.h @@ -0,0 +1,159 @@ +#include + + +void +on_intf_window_destroy (GtkObject *object, + gpointer user_data); + +void +on_intf_window_drag_data_received (GtkWidget *widget, + GdkDragContext *drag_context, + gint x, + gint y, + GtkSelectionData *data, + guint info, + guint time, + gpointer user_data); + +void +on_toolbar_open_clicked (GtkButton *button, + gpointer user_data); + +void +on_toolbar_back_clicked (GtkButton *button, + gpointer user_data); + +void +on_toolbar_stop_clicked (GtkButton *button, + gpointer user_data); + +void +on_toolbar_play_clicked (GtkButton *button, + gpointer user_data); + +void +on_toolbar_pause_clicked (GtkButton *button, + gpointer user_data); + +void +on_toolbar_slow_clicked (GtkButton *button, + gpointer user_data); + +void +on_toolbar_fast_clicked (GtkButton *button, + gpointer user_data); + +void +on_toolbar_playlist_clicked (GtkButton *button, + gpointer user_data); + +void +on_toolbar_prev_clicked (GtkButton *button, + gpointer user_data); + +void +on_toolbar_next_clicked (GtkButton *button, + gpointer user_data); + +gboolean +on_hscale_button_release_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data); + +gboolean +on_hscale_button_press_event (GtkWidget *widget, + GdkEventButton *event, + gpointer user_data); + +void +on_intf_fileopen_destroy (GtkObject *object, + gpointer user_data); + +void +on_fileopen_ok_clicked (GtkButton *button, + gpointer user_data); + +void +on_fileopen_cancel_clicked (GtkButton *button, + gpointer user_data); + +void +on_intf_modules_destroy (GtkObject *object, + gpointer user_data); + +void +on_modules_ok_clicked (GtkButton *button, + gpointer user_data); + +void +on_modules_apply_clicked (GtkButton *button, + gpointer user_data); + +void +on_modules_cancel_clicked (GtkButton *button, + gpointer user_data); + +void +on_intf_playlist_destroy (GtkObject *object, + gpointer user_data); + +void +on_playlist_ok_clicked (GtkButton *button, + gpointer user_data); + +void +on_popup_fast_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_menubar_open_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_menubar_exit_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_popup_play_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_popup_exit_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_menubar_playlist_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_menubar_modules_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_menubar_preferences_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_menubar_about_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_popup_pause_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_popup_slow_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_popup_open_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_popup_about_activate (GtkMenuItem *menuitem, + gpointer user_data); + +void +on_about_ok_clicked (GtkButton *button, + gpointer user_data); + diff --git a/plugins/gtk/gtk_callbacks.o b/plugins/gtk/gtk_callbacks.o new file mode 100644 index 0000000000..eb3483eca8 Binary files /dev/null and b/plugins/gtk/gtk_callbacks.o differ diff --git a/plugins/gtk/gtk_interface.c b/plugins/gtk/gtk_interface.c new file mode 100644 index 0000000000..5dd7196d6d --- /dev/null +++ b/plugins/gtk/gtk_interface.c @@ -0,0 +1,768 @@ +/* + * DO NOT EDIT THIS FILE - it is generated by Glade. + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include + +#include +#include + +#include "gtk_callbacks.h" +#include "gtk_interface.h" +#include "gtk_support.h" + +GtkWidget* +create_intf_window (void) +{ + GtkWidget *intf_window; + GtkWidget *vbox2; + GtkWidget *handlebox2; + GtkWidget *menubar1; + guint tmp_key; + GtkWidget *menubar_file; + GtkWidget *menubar_file_menu; + GtkAccelGroup *menubar_file_menu_accels; + GtkWidget *menubar_open; + GtkWidget *separator4; + GtkWidget *menubar_exit; + GtkWidget *menubar_view; + GtkWidget *menubar_view_menu; + GtkAccelGroup *menubar_view_menu_accels; + GtkWidget *menubar_playlist; + GtkWidget *menubar_modules; + GtkWidget *menubar_settings; + GtkWidget *menubar_settings_menu; + GtkAccelGroup *menubar_settings_menu_accels; + GtkWidget *menubar_preferences; + GtkWidget *menubar_help; + GtkWidget *menubar_help_menu; + GtkAccelGroup *menubar_help_menu_accels; + GtkWidget *menubar_about; + GtkWidget *handlebox1; + GtkWidget *toolbar; + GtkWidget *toolbar_open; + GtkWidget *toolbar_back; + GtkWidget *toolbar_stop; + GtkWidget *toolbar_play; + GtkWidget *toolbar_pause; + GtkWidget *toolbar_slow; + GtkWidget *toolbar_fast; + GtkWidget *toolbar_playlist; + GtkWidget *toolbar_prev; + GtkWidget *toolbar_next; + GtkWidget *entry1; + GtkWidget *label6; + GtkWidget *hscale; + GtkWidget *label13; + GtkWidget *statusbar1; + GtkAccelGroup *accel_group; + GtkTooltips *tooltips; + + tooltips = gtk_tooltips_new (); + + accel_group = gtk_accel_group_new (); + + intf_window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_object_set_data (GTK_OBJECT (intf_window), "intf_window", intf_window); + gtk_window_set_title (GTK_WINDOW (intf_window), _("VideoLAN Client")); + + vbox2 = gtk_vbox_new (FALSE, 0); + gtk_widget_ref (vbox2); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "vbox2", vbox2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox2); + gtk_container_add (GTK_CONTAINER (intf_window), vbox2); + + handlebox2 = gtk_handle_box_new (); + gtk_widget_ref (handlebox2); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "handlebox2", handlebox2, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (handlebox2); + gtk_box_pack_start (GTK_BOX (vbox2), handlebox2, FALSE, TRUE, 0); + + menubar1 = gtk_menu_bar_new (); + gtk_widget_ref (menubar1); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar1", menubar1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar1); + gtk_container_add (GTK_CONTAINER (handlebox2), menubar1); + + menubar_file = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_file)->child), + _("_File")); + gtk_widget_add_accelerator (menubar_file, "activate_item", accel_group, + tmp_key, GDK_MOD1_MASK, 0); + gtk_widget_ref (menubar_file); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_file", menubar_file, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar_file); + gtk_container_add (GTK_CONTAINER (menubar1), menubar_file); + + menubar_file_menu = gtk_menu_new (); + gtk_widget_ref (menubar_file_menu); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_file_menu", menubar_file_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (menubar_file), menubar_file_menu); + menubar_file_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (menubar_file_menu)); + + menubar_open = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_open)->child), + _("_Open...")); + gtk_widget_add_accelerator (menubar_open, "activate_item", menubar_file_menu_accels, + tmp_key, 0, 0); + gtk_widget_ref (menubar_open); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_open", menubar_open, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar_open); + gtk_container_add (GTK_CONTAINER (menubar_file_menu), menubar_open); + gtk_tooltips_set_tip (tooltips, menubar_open, _("Open a file"), NULL); + gtk_widget_add_accelerator (menubar_open, "activate", accel_group, + GDK_F3, 0, + GTK_ACCEL_VISIBLE); + + separator4 = gtk_menu_item_new (); + gtk_widget_ref (separator4); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator4", separator4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (separator4); + gtk_container_add (GTK_CONTAINER (menubar_file_menu), separator4); + gtk_widget_set_sensitive (separator4, FALSE); + + menubar_exit = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_exit)->child), + _("E_xit")); + gtk_widget_add_accelerator (menubar_exit, "activate_item", menubar_file_menu_accels, + tmp_key, 0, 0); + gtk_widget_ref (menubar_exit); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_exit", menubar_exit, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar_exit); + gtk_container_add (GTK_CONTAINER (menubar_file_menu), menubar_exit); + gtk_tooltips_set_tip (tooltips, menubar_exit, _("Exit the program"), NULL); + gtk_widget_add_accelerator (menubar_exit, "activate", accel_group, + GDK_Q, GDK_CONTROL_MASK, + GTK_ACCEL_VISIBLE); + + menubar_view = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_view)->child), + _("_View")); + gtk_widget_add_accelerator (menubar_view, "activate_item", accel_group, + tmp_key, GDK_MOD1_MASK, 0); + gtk_widget_ref (menubar_view); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_view", menubar_view, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar_view); + gtk_container_add (GTK_CONTAINER (menubar1), menubar_view); + + menubar_view_menu = gtk_menu_new (); + gtk_widget_ref (menubar_view_menu); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_view_menu", menubar_view_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (menubar_view), menubar_view_menu); + menubar_view_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (menubar_view_menu)); + + menubar_playlist = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_playlist)->child), + _("_Playlist...")); + gtk_widget_add_accelerator (menubar_playlist, "activate_item", menubar_view_menu_accels, + tmp_key, 0, 0); + gtk_widget_ref (menubar_playlist); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist", menubar_playlist, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar_playlist); + gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_playlist); + gtk_widget_set_sensitive (menubar_playlist, FALSE); + gtk_tooltips_set_tip (tooltips, menubar_playlist, _("Open the playlist window"), NULL); + + menubar_modules = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_modules)->child), + _("_Modules...")); + gtk_widget_add_accelerator (menubar_modules, "activate_item", menubar_view_menu_accels, + tmp_key, 0, 0); + gtk_widget_ref (menubar_modules); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_modules", menubar_modules, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar_modules); + gtk_container_add (GTK_CONTAINER (menubar_view_menu), menubar_modules); + gtk_widget_set_sensitive (menubar_modules, FALSE); + gtk_tooltips_set_tip (tooltips, menubar_modules, _("Open the plugin manager"), NULL); + + menubar_settings = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_settings)->child), + _("_Settings")); + gtk_widget_add_accelerator (menubar_settings, "activate_item", accel_group, + tmp_key, GDK_MOD1_MASK, 0); + gtk_widget_ref (menubar_settings); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_settings", menubar_settings, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar_settings); + gtk_container_add (GTK_CONTAINER (menubar1), menubar_settings); + + menubar_settings_menu = gtk_menu_new (); + gtk_widget_ref (menubar_settings_menu); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_settings_menu", menubar_settings_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (menubar_settings), menubar_settings_menu); + menubar_settings_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (menubar_settings_menu)); + + menubar_preferences = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_preferences)->child), + _("_Preferences...")); + gtk_widget_add_accelerator (menubar_preferences, "activate_item", menubar_settings_menu_accels, + tmp_key, 0, 0); + gtk_widget_ref (menubar_preferences); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_preferences", menubar_preferences, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar_preferences); + gtk_container_add (GTK_CONTAINER (menubar_settings_menu), menubar_preferences); + gtk_widget_set_sensitive (menubar_preferences, FALSE); + gtk_tooltips_set_tip (tooltips, menubar_preferences, _("Configure the application"), NULL); + + menubar_help = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_help)->child), + _("_Help")); + gtk_widget_add_accelerator (menubar_help, "activate_item", accel_group, + tmp_key, GDK_MOD1_MASK, 0); + gtk_widget_ref (menubar_help); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_help", menubar_help, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar_help); + gtk_container_add (GTK_CONTAINER (menubar1), menubar_help); + + menubar_help_menu = gtk_menu_new (); + gtk_widget_ref (menubar_help_menu); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_help_menu", menubar_help_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (menubar_help), menubar_help_menu); + menubar_help_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (menubar_help_menu)); + + menubar_about = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (menubar_about)->child), + _("_About...")); + gtk_widget_add_accelerator (menubar_about, "activate_item", menubar_help_menu_accels, + tmp_key, 0, 0); + gtk_widget_ref (menubar_about); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_about", menubar_about, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (menubar_about); + gtk_container_add (GTK_CONTAINER (menubar_help_menu), menubar_about); + gtk_tooltips_set_tip (tooltips, menubar_about, _("About this application"), NULL); + + handlebox1 = gtk_handle_box_new (); + gtk_widget_ref (handlebox1); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "handlebox1", handlebox1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (handlebox1); + gtk_box_pack_start (GTK_BOX (vbox2), handlebox1, FALSE, TRUE, 0); + + toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH); + gtk_widget_ref (toolbar); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar", toolbar, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar); + gtk_container_add (GTK_CONTAINER (handlebox1), toolbar); + gtk_container_set_border_width (GTK_CONTAINER (toolbar), 1); + gtk_toolbar_set_space_size (GTK_TOOLBAR (toolbar), 16); + gtk_toolbar_set_space_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_SPACE_LINE); + gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar), GTK_RELIEF_NONE); + + toolbar_open = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Open"), + _("Open File"), NULL, + NULL, NULL, NULL); + gtk_widget_ref (toolbar_open); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_open", toolbar_open, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_open); + + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + + toolbar_back = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Back"), + _("Go Backwards"), NULL, + NULL, NULL, NULL); + gtk_widget_ref (toolbar_back); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_back", toolbar_back, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_back); + gtk_widget_set_sensitive (toolbar_back, FALSE); + + toolbar_stop = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Stop"), + _("Stop Stream"), NULL, + NULL, NULL, NULL); + gtk_widget_ref (toolbar_stop); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_stop", toolbar_stop, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_stop); + gtk_widget_set_sensitive (toolbar_stop, FALSE); + + toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Play"), + _("Play Stream"), NULL, + NULL, NULL, NULL); + gtk_widget_ref (toolbar_play); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_play", toolbar_play, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_play); + + toolbar_pause = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Pause"), + _("Pause Stream"), NULL, + NULL, NULL, NULL); + gtk_widget_ref (toolbar_pause); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_pause", toolbar_pause, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_pause); + + toolbar_slow = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Slow"), + _("Play Slower"), NULL, + NULL, NULL, NULL); + gtk_widget_ref (toolbar_slow); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_slow", toolbar_slow, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_slow); + + toolbar_fast = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Fast"), + _("Play Faster"), NULL, + NULL, NULL, NULL); + gtk_widget_ref (toolbar_fast); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_fast", toolbar_fast, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_fast); + + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + + toolbar_playlist = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Playlist"), + _("Open Playlist"), NULL, + NULL, NULL, NULL); + gtk_widget_ref (toolbar_playlist); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_playlist", toolbar_playlist, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_playlist); + gtk_widget_set_sensitive (toolbar_playlist, FALSE); + + toolbar_prev = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Prev"), + _("Previous File"), NULL, + NULL, NULL, NULL); + gtk_widget_ref (toolbar_prev); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_prev", toolbar_prev, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_prev); + + toolbar_next = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Next"), + _("Next File"), NULL, + NULL, NULL, NULL); + gtk_widget_ref (toolbar_next); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_next", toolbar_next, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_next); + + entry1 = gtk_entry_new (); + gtk_widget_ref (entry1); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "entry1", entry1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (entry1); + gtk_box_pack_start (GTK_BOX (vbox2), entry1, FALSE, TRUE, 0); + gtk_entry_set_text (GTK_ENTRY (entry1), _("Tired of boring stub messages ? Write your own exciting message here !!")); + + label6 = gtk_label_new (_("This part of the interface doesn't work yet. You can drag the slider below, though:")); + gtk_widget_ref (label6); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "label6", label6, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label6); + gtk_box_pack_start (GTK_BOX (vbox2), label6, FALSE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (label6), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label6), 0, 0.5); + gtk_misc_set_padding (GTK_MISC (label6), 5, 0); + + hscale = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 100, 1, 6.25, 0))); + gtk_widget_ref (hscale); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "hscale", hscale, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hscale); + gtk_box_pack_start (GTK_BOX (vbox2), hscale, FALSE, TRUE, 0); + gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_BOTTOM); + gtk_range_set_update_policy (GTK_RANGE (hscale), GTK_UPDATE_DELAYED); + + label13 = gtk_label_new (_("HEY ! YOU CAN DROP A FILE ON VLC TOO :-)")); + gtk_widget_ref (label13); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "label13", label13, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label13); + gtk_box_pack_start (GTK_BOX (vbox2), label13, FALSE, TRUE, 0); + gtk_misc_set_padding (GTK_MISC (label13), 0, 5); + + statusbar1 = gtk_statusbar_new (); + gtk_widget_ref (statusbar1); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "statusbar1", statusbar1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (statusbar1); + gtk_box_pack_end (GTK_BOX (vbox2), statusbar1, FALSE, TRUE, 0); + + gtk_signal_connect (GTK_OBJECT (intf_window), "destroy", + GTK_SIGNAL_FUNC (on_intf_window_destroy), + NULL); + gtk_signal_connect (GTK_OBJECT (intf_window), "drag_data_received", + GTK_SIGNAL_FUNC (on_intf_window_drag_data_received), + NULL); + gtk_signal_connect (GTK_OBJECT (menubar_open), "activate", + GTK_SIGNAL_FUNC (on_menubar_open_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (menubar_exit), "activate", + GTK_SIGNAL_FUNC (on_menubar_exit_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (menubar_playlist), "activate", + GTK_SIGNAL_FUNC (on_menubar_playlist_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (menubar_modules), "activate", + GTK_SIGNAL_FUNC (on_menubar_modules_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (menubar_preferences), "activate", + GTK_SIGNAL_FUNC (on_menubar_preferences_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (menubar_about), "activate", + GTK_SIGNAL_FUNC (on_menubar_about_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_open), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_open_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_back), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_back_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_stop), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_stop_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_play), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_play_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_pause), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_pause_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_slow), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_slow_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_fast), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_fast_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_playlist), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_playlist_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_prev), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_prev_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_next), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_next_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (hscale), "button_release_event", + GTK_SIGNAL_FUNC (on_hscale_button_release_event), + NULL); + gtk_signal_connect (GTK_OBJECT (hscale), "button_press_event", + GTK_SIGNAL_FUNC (on_hscale_button_press_event), + NULL); + + gtk_object_set_data (GTK_OBJECT (intf_window), "tooltips", tooltips); + + gtk_window_add_accel_group (GTK_WINDOW (intf_window), accel_group); + + return intf_window; +} + +GtkWidget* +create_intf_popup (void) +{ + GtkWidget *intf_popup; + GtkAccelGroup *intf_popup_accels; + guint tmp_key; + GtkWidget *popup_play; + GtkWidget *popup_pause; + GtkWidget *popup_slow; + GtkWidget *popup_fast; + GtkWidget *separator6; + GtkWidget *popup_open; + GtkWidget *separator5; + GtkWidget *popup_about; + GtkWidget *popup_exit; + + intf_popup = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (intf_popup), "intf_popup", intf_popup); + intf_popup_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (intf_popup)); + + popup_play = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_play)->child), + _("_Play")); + gtk_widget_add_accelerator (popup_play, "activate_item", intf_popup_accels, + tmp_key, 0, 0); + gtk_widget_ref (popup_play); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_play", popup_play, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (popup_play); + gtk_container_add (GTK_CONTAINER (intf_popup), popup_play); + + popup_pause = gtk_menu_item_new_with_label (_("Pause")); + gtk_widget_ref (popup_pause); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_pause", popup_pause, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (popup_pause); + gtk_container_add (GTK_CONTAINER (intf_popup), popup_pause); + + popup_slow = gtk_menu_item_new_with_label (_("Slow")); + gtk_widget_ref (popup_slow); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_slow", popup_slow, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (popup_slow); + gtk_container_add (GTK_CONTAINER (intf_popup), popup_slow); + + popup_fast = gtk_menu_item_new_with_label (_("Fast")); + gtk_widget_ref (popup_fast); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_fast", popup_fast, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (popup_fast); + gtk_container_add (GTK_CONTAINER (intf_popup), popup_fast); + + separator6 = gtk_menu_item_new (); + gtk_widget_ref (separator6); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator6", separator6, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (separator6); + gtk_container_add (GTK_CONTAINER (intf_popup), separator6); + gtk_widget_set_sensitive (separator6, FALSE); + + popup_open = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_open)->child), + _("_Open...")); + gtk_widget_add_accelerator (popup_open, "activate_item", intf_popup_accels, + tmp_key, 0, 0); + gtk_widget_ref (popup_open); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_open", popup_open, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (popup_open); + gtk_container_add (GTK_CONTAINER (intf_popup), popup_open); + + separator5 = gtk_menu_item_new (); + gtk_widget_ref (separator5); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator5", separator5, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (separator5); + gtk_container_add (GTK_CONTAINER (intf_popup), separator5); + gtk_widget_set_sensitive (separator5, FALSE); + + popup_about = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_about)->child), + _("_About...")); + gtk_widget_add_accelerator (popup_about, "activate_item", intf_popup_accels, + tmp_key, 0, 0); + gtk_widget_ref (popup_about); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_about", popup_about, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (popup_about); + gtk_container_add (GTK_CONTAINER (intf_popup), popup_about); + + popup_exit = gtk_menu_item_new_with_label (""); + tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_exit)->child), + _("E_xit")); + gtk_widget_add_accelerator (popup_exit, "activate_item", intf_popup_accels, + tmp_key, 0, 0); + gtk_widget_ref (popup_exit); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_exit", popup_exit, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (popup_exit); + gtk_container_add (GTK_CONTAINER (intf_popup), popup_exit); + + gtk_signal_connect (GTK_OBJECT (popup_play), "activate", + GTK_SIGNAL_FUNC (on_popup_play_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (popup_pause), "activate", + GTK_SIGNAL_FUNC (on_popup_pause_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (popup_slow), "activate", + GTK_SIGNAL_FUNC (on_popup_slow_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (popup_fast), "activate", + GTK_SIGNAL_FUNC (on_popup_fast_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (popup_open), "activate", + GTK_SIGNAL_FUNC (on_popup_open_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (popup_about), "activate", + GTK_SIGNAL_FUNC (on_popup_about_activate), + NULL); + gtk_signal_connect (GTK_OBJECT (popup_exit), "activate", + GTK_SIGNAL_FUNC (on_popup_exit_activate), + NULL); + + return intf_popup; +} + +GtkWidget* +create_intf_about (void) +{ + GtkWidget *intf_about; + GtkWidget *dialog_vbox1; + GtkWidget *vbox3; + GtkWidget *label14; + GtkWidget *label18; + GtkWidget *hbox1; + GtkWidget *label15; + GtkWidget *label16; + GtkWidget *label17; + GtkWidget *dialog_action_area; + GtkWidget *about_ok; + + intf_about = gtk_dialog_new (); + gtk_object_set_data (GTK_OBJECT (intf_about), "intf_about", intf_about); + gtk_container_set_border_width (GTK_CONTAINER (intf_about), 10); + gtk_window_set_title (GTK_WINDOW (intf_about), _("About")); + gtk_window_set_position (GTK_WINDOW (intf_about), GTK_WIN_POS_CENTER); + gtk_window_set_policy (GTK_WINDOW (intf_about), FALSE, FALSE, FALSE); + + dialog_vbox1 = GTK_DIALOG (intf_about)->vbox; + gtk_object_set_data (GTK_OBJECT (intf_about), "dialog_vbox1", dialog_vbox1); + gtk_widget_show (dialog_vbox1); + + vbox3 = gtk_vbox_new (FALSE, 0); + gtk_widget_ref (vbox3); + gtk_object_set_data_full (GTK_OBJECT (intf_about), "vbox3", vbox3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (vbox3); + gtk_box_pack_start (GTK_BOX (dialog_vbox1), vbox3, TRUE, TRUE, 0); + + label14 = gtk_label_new (_("VideoLAN Client")); + gtk_widget_ref (label14); + gtk_object_set_data_full (GTK_OBJECT (intf_about), "label14", label14, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label14); + gtk_box_pack_start (GTK_BOX (vbox3), label14, TRUE, TRUE, 0); + gtk_misc_set_padding (GTK_MISC (label14), 0, 10); + + label18 = gtk_label_new (_("(C) 1996, 1997, 1998, 1999, 2000, 2001 - the VideoLAN Team")); + gtk_widget_ref (label18); + gtk_object_set_data_full (GTK_OBJECT (intf_about), "label18", label18, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label18); + gtk_box_pack_start (GTK_BOX (vbox3), label18, FALSE, FALSE, 0); + + hbox1 = gtk_hbox_new (FALSE, 0); + gtk_widget_ref (hbox1); + gtk_object_set_data_full (GTK_OBJECT (intf_about), "hbox1", hbox1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox1); + gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0); + + label15 = gtk_label_new (_("Authors:")); + gtk_widget_ref (label15); + gtk_object_set_data_full (GTK_OBJECT (intf_about), "label15", label15, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label15); + gtk_box_pack_start (GTK_BOX (hbox1), label15, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label15), GTK_JUSTIFY_RIGHT); + gtk_misc_set_alignment (GTK_MISC (label15), 0.5, 1.67638e-08); + gtk_misc_set_padding (GTK_MISC (label15), 0, 10); + + label16 = gtk_label_new (_("Régis Duchesne \nMichel Lespinasse \nOlivier Pomel \nPierre Baillet \nJean-Philippe Grimaldi \nAndres Krapf \nChristophe Massiot \nVincent Seguin \nBenoit Steiner \nArnaud de Bossoreille de Ribou \nJean-Marc Dressler \nGaël Hendryckx \nSamuel Hocevar \nBrieuc Jeunhomme \nMichel Kaempf \nStéphane Borel \nRenaud Dartus \nHenri Fallon ")); + gtk_widget_ref (label16); + gtk_object_set_data_full (GTK_OBJECT (intf_about), "label16", label16, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label16); + gtk_box_pack_start (GTK_BOX (hbox1), label16, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (label16), GTK_JUSTIFY_LEFT); + gtk_misc_set_alignment (GTK_MISC (label16), 0.5, 0); + gtk_misc_set_padding (GTK_MISC (label16), 10, 10); + + label17 = gtk_label_new (_("This is the VideoLAN client, a DVD and MPEG player. It can play MPEG and MPEG 2 files from a file or from a network source.")); + gtk_widget_ref (label17); + gtk_object_set_data_full (GTK_OBJECT (intf_about), "label17", label17, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label17); + gtk_box_pack_start (GTK_BOX (vbox3), label17, FALSE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (label17), GTK_JUSTIFY_LEFT); + gtk_label_set_line_wrap (GTK_LABEL (label17), TRUE); + gtk_misc_set_padding (GTK_MISC (label17), 0, 5); + + dialog_action_area = GTK_DIALOG (intf_about)->action_area; + gtk_object_set_data (GTK_OBJECT (intf_about), "dialog_action_area", dialog_action_area); + gtk_widget_show (dialog_action_area); + gtk_container_set_border_width (GTK_CONTAINER (dialog_action_area), 10); + + about_ok = gtk_button_new_with_label (_("OK")); + gtk_widget_ref (about_ok); + gtk_object_set_data_full (GTK_OBJECT (intf_about), "about_ok", about_ok, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (about_ok); + gtk_box_pack_start (GTK_BOX (dialog_action_area), about_ok, FALSE, TRUE, 0); + GTK_WIDGET_SET_FLAGS (about_ok, GTK_CAN_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (about_ok), "clicked", + GTK_SIGNAL_FUNC (on_about_ok_clicked), + NULL); + + gtk_widget_grab_default (about_ok); + return intf_about; +} + +GtkWidget* +create_intf_fileopen (void) +{ + GtkWidget *intf_fileopen; + GtkWidget *fileopen_ok; + GtkWidget *fileopen_cancel; + + intf_fileopen = gtk_file_selection_new (_("Select File")); + gtk_object_set_data (GTK_OBJECT (intf_fileopen), "intf_fileopen", intf_fileopen); + gtk_container_set_border_width (GTK_CONTAINER (intf_fileopen), 10); + + fileopen_ok = GTK_FILE_SELECTION (intf_fileopen)->ok_button; + gtk_object_set_data (GTK_OBJECT (intf_fileopen), "fileopen_ok", fileopen_ok); + gtk_widget_show (fileopen_ok); + GTK_WIDGET_SET_FLAGS (fileopen_ok, GTK_CAN_DEFAULT); + + fileopen_cancel = GTK_FILE_SELECTION (intf_fileopen)->cancel_button; + gtk_object_set_data (GTK_OBJECT (intf_fileopen), "fileopen_cancel", fileopen_cancel); + gtk_widget_show (fileopen_cancel); + GTK_WIDGET_SET_FLAGS (fileopen_cancel, GTK_CAN_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (intf_fileopen), "destroy", + GTK_SIGNAL_FUNC (on_intf_fileopen_destroy), + NULL); + gtk_signal_connect (GTK_OBJECT (fileopen_ok), "clicked", + GTK_SIGNAL_FUNC (on_fileopen_ok_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (fileopen_cancel), "clicked", + GTK_SIGNAL_FUNC (on_fileopen_cancel_clicked), + NULL); + + return intf_fileopen; +} + diff --git a/plugins/gtk/gtk_interface.h b/plugins/gtk/gtk_interface.h new file mode 100644 index 0000000000..17900a679d --- /dev/null +++ b/plugins/gtk/gtk_interface.h @@ -0,0 +1,8 @@ +/* + * DO NOT EDIT THIS FILE - it is generated by Glade. + */ + +GtkWidget* create_intf_window (void); +GtkWidget* create_intf_popup (void); +GtkWidget* create_intf_about (void); +GtkWidget* create_intf_fileopen (void); diff --git a/plugins/gtk/gtk_interface.o b/plugins/gtk/gtk_interface.o new file mode 100644 index 0000000000..9d7c5b642b Binary files /dev/null and b/plugins/gtk/gtk_interface.o differ diff --git a/plugins/gtk/gtk_support.c b/plugins/gtk/gtk_support.c new file mode 100644 index 0000000000..1b952190c9 --- /dev/null +++ b/plugins/gtk/gtk_support.c @@ -0,0 +1,162 @@ +/* + * DO NOT EDIT THIS FILE - it is generated by Glade. + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include +#include +#include + +#include + +#include "gtk_support.h" + +/* This is an internally used function to check if a pixmap file exists. */ +static gchar* check_file_exists (const gchar *directory, + const gchar *filename); + +/* This is an internally used function to create pixmaps. */ +static GtkWidget* create_dummy_pixmap (GtkWidget *widget); + +GtkWidget* +lookup_widget (GtkWidget *widget, + const gchar *widget_name) +{ + GtkWidget *parent, *found_widget; + + for (;;) + { + if (GTK_IS_MENU (widget)) + parent = gtk_menu_get_attach_widget (GTK_MENU (widget)); + else + parent = widget->parent; + if (parent == NULL) + break; + widget = parent; + } + + found_widget = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget), + widget_name); + if (!found_widget) + g_warning ("Widget not found: %s", widget_name); + return found_widget; +} + +/* This is a dummy pixmap we use when a pixmap can't be found. */ +static char *dummy_pixmap_xpm[] = { +/* columns rows colors chars-per-pixel */ +"1 1 1 1", +" c None", +/* pixels */ +" " +}; + +/* This is an internally used function to create pixmaps. */ +static GtkWidget* +create_dummy_pixmap (GtkWidget *widget) +{ + GdkColormap *colormap; + GdkPixmap *gdkpixmap; + GdkBitmap *mask; + GtkWidget *pixmap; + + colormap = gtk_widget_get_colormap (widget); + gdkpixmap = gdk_pixmap_colormap_create_from_xpm_d (NULL, colormap, &mask, + NULL, dummy_pixmap_xpm); + if (gdkpixmap == NULL) + g_error ("Couldn't create replacement pixmap."); + pixmap = gtk_pixmap_new (gdkpixmap, mask); + gdk_pixmap_unref (gdkpixmap); + gdk_bitmap_unref (mask); + return pixmap; +} + +static GList *pixmaps_directories = NULL; + +/* Use this function to set the directory containing installed pixmaps. */ +void +add_pixmap_directory (const gchar *directory) +{ + pixmaps_directories = g_list_prepend (pixmaps_directories, + g_strdup (directory)); +} + +/* This is an internally used function to create pixmaps. */ +GtkWidget* +create_pixmap (GtkWidget *widget, + const gchar *filename) +{ + gchar *found_filename = NULL; + GdkColormap *colormap; + GdkPixmap *gdkpixmap; + GdkBitmap *mask; + GtkWidget *pixmap; + GList *elem; + + if (!filename || !filename[0]) + return create_dummy_pixmap (widget); + + /* We first try any pixmaps directories set by the application. */ + elem = pixmaps_directories; + while (elem) + { + found_filename = check_file_exists ((gchar*)elem->data, filename); + if (found_filename) + break; + elem = elem->next; + } + + /* If we haven't found the pixmap, try the source directory. */ + if (!found_filename) + { + found_filename = check_file_exists ("pixmaps", filename); + } + + if (!found_filename) + { + g_warning (_("Couldn't find pixmap file: %s"), filename); + return create_dummy_pixmap (widget); + } + + colormap = gtk_widget_get_colormap (widget); + gdkpixmap = gdk_pixmap_colormap_create_from_xpm (NULL, colormap, &mask, + NULL, found_filename); + if (gdkpixmap == NULL) + { + g_warning (_("Error loading pixmap file: %s"), found_filename); + g_free (found_filename); + return create_dummy_pixmap (widget); + } + g_free (found_filename); + pixmap = gtk_pixmap_new (gdkpixmap, mask); + gdk_pixmap_unref (gdkpixmap); + gdk_bitmap_unref (mask); + return pixmap; +} + +/* This is an internally used function to check if a pixmap file exists. */ +gchar* +check_file_exists (const gchar *directory, + const gchar *filename) +{ + gchar *full_filename; + struct stat s; + gint status; + + full_filename = (gchar*) g_malloc (strlen (directory) + 1 + + strlen (filename) + 1); + strcpy (full_filename, directory); + strcat (full_filename, G_DIR_SEPARATOR_S); + strcat (full_filename, filename); + + status = stat (full_filename, &s); + if (status == 0 && S_ISREG (s.st_mode)) + return full_filename; + g_free (full_filename); + return NULL; +} + diff --git a/plugins/gtk/gtk_support.h b/plugins/gtk/gtk_support.h new file mode 100644 index 0000000000..931bc5ad04 --- /dev/null +++ b/plugins/gtk/gtk_support.h @@ -0,0 +1,61 @@ +/* + * DO NOT EDIT THIS FILE - it is generated by Glade. + */ + +#ifdef HAVE_CONFIG_H +# include +#endif + +#include + +/* + * Standard gettext macros. + */ +#ifdef ENABLE_NLS +# include +# undef _ +# define _(String) dgettext (PACKAGE, String) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define textdomain(String) (String) +# define gettext(String) (String) +# define dgettext(Domain,Message) (Message) +# define dcgettext(Domain,Message,Type) (Message) +# define bindtextdomain(Domain,Directory) (Domain) +# define _(String) (String) +# define N_(String) (String) +#endif + + +/* + * Public Functions. + */ + +/* + * This function returns a widget in a component created by Glade. + * Call it with the toplevel widget in the component (i.e. a window/dialog), + * or alternatively any widget in the component, and the name of the widget + * you want returned. + */ +GtkWidget* lookup_widget (GtkWidget *widget, + const gchar *widget_name); + +/* get_widget() is deprecated. Use lookup_widget instead. */ +#define get_widget lookup_widget + +/* Use this function to set the directory containing installed pixmaps. */ +void add_pixmap_directory (const gchar *directory); + + +/* + * Private Functions. + */ + +/* This is used to create the pixmaps in the interface. */ +GtkWidget* create_pixmap (GtkWidget *widget, + const gchar *filename); + diff --git a/plugins/gtk/gtk_support.o b/plugins/gtk/gtk_support.o new file mode 100644 index 0000000000..7803c243ec Binary files /dev/null and b/plugins/gtk/gtk_support.o differ diff --git a/plugins/gtk/gtk_sys.h b/plugins/gtk/gtk_sys.h new file mode 100644 index 0000000000..e26f33889b --- /dev/null +++ b/plugins/gtk/gtk_sys.h @@ -0,0 +1,59 @@ +/***************************************************************************** + * gtk_sys.h: private Gtk+ interface description + ***************************************************************************** + * Copyright (C) 1999, 2000 VideoLAN + * $Id: gtk_sys.h,v 1.1 2001/02/21 11:49:18 sam Exp $ + * + * Authors: Samuel Hocevar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +/***************************************************************************** + * drag'n'drop stuff + *****************************************************************************/ +#define DROP_ACCEPT_TEXT_URI_LIST 0 +#define DROP_ACCEPT_TEXT_PLAIN 1 + +/***************************************************************************** + * intf_sys_t: description and status of Gtk+ interface + *****************************************************************************/ +typedef struct intf_sys_s +{ + /* special actions */ + vlc_mutex_t change_lock; /* the change lock */ + + boolean_t b_popup_changed; /* display menu ? */ + boolean_t b_window_changed; /* window display toggled ? */ + boolean_t b_playlist_changed; /* playlist display toggled ? */ + boolean_t b_scale_isfree; /* user isn't dragging scale ? */ + + /* intf_Manage callback timeout */ + int i_timeout; + + /* windows and widgets */ + GtkWidget * p_window; /* main window */ + GtkWidget * p_popup; /* popup menu */ + GtkWidget * p_playlist; /* playlist */ + GtkWidget * p_modules; /* module manager */ + GtkWidget * p_about; /* about window */ + GtkWidget * p_fileopen; /* file open window */ + + /* XXX: ugly kludge */ + void ( *pf_gtk_callback ) ( void ); + void ( *pf_gdk_callback ) ( void ); + +} intf_sys_t; + diff --git a/plugins/gtk/intf_gtk.c b/plugins/gtk/intf_gtk.c new file mode 100644 index 0000000000..3d4b0266ed --- /dev/null +++ b/plugins/gtk/intf_gtk.c @@ -0,0 +1,308 @@ +/***************************************************************************** + * intf_gtk.c: Gtk+ interface + ***************************************************************************** + * Copyright (C) 1999, 2000 VideoLAN + * $Id: intf_gtk.c,v 1.1 2001/02/21 11:49:18 sam Exp $ + * + * Authors: Samuel Hocevar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +#define MODULE_NAME gtk +#include "modules_inner.h" + +/***************************************************************************** + * Preamble + *****************************************************************************/ +#include "defs.h" + +#include /* ENOMEM */ +#include /* free() */ +#include /* strerror() */ +#include + +#include + +#include "config.h" +#include "common.h" +#include "threads.h" +#include "mtime.h" +#include "tests.h" +#include "modules.h" + +#include "stream_control.h" +#include "input_ext-intf.h" + +#include "intf_msg.h" +#include "interface.h" + +#include "gtk_sys.h" +#include "gtk_interface.h" +#include "gtk_support.h" + +#include "main.h" + +/***************************************************************************** + * Local prototypes. + *****************************************************************************/ +static int intf_Probe ( probedata_t *p_data ); +static int intf_Open ( intf_thread_t *p_intf ); +static void intf_Close ( intf_thread_t *p_intf ); +static void intf_Run ( intf_thread_t *p_intf ); + +static gint GtkManage ( gpointer p_data ); + +/***************************************************************************** + * g_atexit: kludge to avoid the Gtk+ thread to segfault at exit + ***************************************************************************** + * gtk_init() makes several calls to g_atexit() which calls atexit() to + * register tidying callbacks to be called at program exit. Since the Gtk+ + * plugin is likely to be unloaded at program exit, we have to export this + * symbol to intercept the g_atexit() calls. Talk about crude hack. + *****************************************************************************/ +void g_atexit( GVoidFunc func ) +{ + intf_thread_t *p_intf = p_main->p_intf; + + if( p_intf->p_sys->pf_gdk_callback == NULL ) + { + p_intf->p_sys->pf_gdk_callback = func; + } + else if( p_intf->p_sys->pf_gtk_callback == NULL ) + { + p_intf->p_sys->pf_gtk_callback = func; + } + /* else nothing, but we could do something here */ + return; +} + +/***************************************************************************** + * Functions exported as capabilities. They are declared as static so that + * we don't pollute the namespace too much. + *****************************************************************************/ +void _M( intf_getfunctions )( function_list_t * p_function_list ) +{ + p_function_list->pf_probe = intf_Probe; + p_function_list->functions.intf.pf_open = intf_Open; + p_function_list->functions.intf.pf_close = intf_Close; + p_function_list->functions.intf.pf_run = intf_Run; +} + +/***************************************************************************** + * intf_Probe: probe the interface and return a score + ***************************************************************************** + * This function tries to initialize Gtk+ and returns a score to the + * plugin manager so that it can select the best plugin. + *****************************************************************************/ +static int intf_Probe( probedata_t *p_data ) +{ + if( TestMethod( INTF_METHOD_VAR, "gtk" ) ) + { + return( 999 ); + } + + return( 90 ); +} + +/***************************************************************************** + * intf_Open: initialize and create window + *****************************************************************************/ +static int intf_Open( intf_thread_t *p_intf ) +{ + /* Allocate instance and initialize some members */ + p_intf->p_sys = malloc( sizeof( intf_sys_t ) ); + if( p_intf->p_sys == NULL ) + { + intf_ErrMsg("error: %s", strerror(ENOMEM)); + return( 1 ); + } + + /* Initialize Gtk+ thread */ + p_intf->p_sys->b_popup_changed = 0; + p_intf->p_sys->b_window_changed = 0; + p_intf->p_sys->b_playlist_changed = 0; + + p_intf->p_sys->b_scale_isfree = 1; + + p_intf->p_sys->pf_gtk_callback = NULL; + p_intf->p_sys->pf_gdk_callback = NULL; + + /* Initialize lock */ + vlc_mutex_init( &p_intf->p_sys->change_lock ); + + return( 0 ); +} + +/***************************************************************************** + * intf_Close: destroy interface window + *****************************************************************************/ +static void intf_Close( intf_thread_t *p_intf ) +{ + /* Destroy lock */ + vlc_mutex_destroy( &p_intf->p_sys->change_lock ); + + /* Destroy structure */ + free( p_intf->p_sys ); +} + +/***************************************************************************** + * intf_Run: Gtk+ thread + ***************************************************************************** + * this part of the interface is in a separate thread so that we can call + * gtk_main() from within it without annoying the rest of the program. + * XXX: the approach may look kludgy, and probably is, but I could not find + * a better way to dynamically load a Gtk+ interface at runtime. + *****************************************************************************/ +static void intf_Run( intf_thread_t *p_intf ) +{ + /* gtk_init needs to know the command line. We don't care, so we + * give it an empty one */ + char *p_args[] = { "" }; + char **pp_args = p_args; + int i_args = 1; + + /* The data types we are allowed to receive */ + static GtkTargetEntry target_table[] = + { + { "text/uri-list", 0, DROP_ACCEPT_TEXT_URI_LIST }, + { "text/plain", 0, DROP_ACCEPT_TEXT_PLAIN } + }; + + /* Initialize Gtk+ */ + gtk_init( &i_args, &pp_args ); + + /* Create some useful widgets that will certainly be used */ + p_intf->p_sys->p_window = create_intf_window( ); + p_intf->p_sys->p_popup = create_intf_popup( ); + + /* Set the title of the main window */ + gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window), + VOUT_TITLE " (Gtk+ interface)"); + + /* Accept file drops on the main window */ + gtk_drag_dest_set( GTK_WIDGET( p_intf->p_sys->p_window ), + GTK_DEST_DEFAULT_ALL, target_table, + 1, GDK_ACTION_COPY ); + + /* We don't create these ones yet because we perhaps won't need them */ + p_intf->p_sys->p_about = NULL; + p_intf->p_sys->p_playlist = NULL; + p_intf->p_sys->p_modules = NULL; + p_intf->p_sys->p_fileopen = NULL; + + /* Store p_intf to keep an eye on it */ + gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window), + "p_intf", p_intf ); + + gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_popup), + "p_intf", p_intf ); + + /* Show the control window */ + gtk_widget_show( p_intf->p_sys->p_window ); + + /* Sleep to avoid using all CPU - since some interfaces needs to access + * keyboard events, a 100ms delay is a good compromise */ + p_intf->p_sys->i_timeout = gtk_timeout_add( INTF_IDLE_SLEEP / 1000, + GtkManage, p_intf ); + + + /* Enter Gtk mode */ + gtk_main(); + + /* launch stored callbacks */ + if( p_intf->p_sys->pf_gtk_callback != NULL ) + { + p_intf->p_sys->pf_gtk_callback(); + + if( p_intf->p_sys->pf_gdk_callback != NULL ) + { + p_intf->p_sys->pf_gdk_callback(); + } + } +} + +/* following functions are local */ + +/***************************************************************************** + * GtkManage: manage main thread messages + ***************************************************************************** + * In this function, called approx. 10 times a second, we check what the + * main program wanted to tell us. + *****************************************************************************/ +static gint GtkManage( gpointer p_data ) +{ + intf_thread_t *p_intf = (void *)p_data; + + vlc_mutex_lock( &p_intf->p_sys->change_lock ); + + /* If the "display popup" flag has changed */ + if( p_intf->b_menu_change ) + { + if( !GTK_IS_WIDGET( p_intf->p_sys->p_popup ) ) + { + p_intf->p_sys->p_popup = create_intf_popup(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_popup ), + "p_popup", p_intf ); + } +// gtk_widget_show( p_intf->p_sys->p_popup ); + gtk_menu_popup( GTK_MENU( p_intf->p_sys->p_popup ), + NULL, NULL, NULL, NULL, 0, GDK_CURRENT_TIME ); + p_intf->b_menu_change = 0; + } + + /* Manage the slider */ + if( p_intf->p_input != NULL && p_intf->p_sys->p_window != NULL + && p_intf->p_sys->b_scale_isfree ) + { + GtkWidget *p_scale; + GtkAdjustment *p_adj; + + p_scale = GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( + p_intf->p_sys->p_window ), "hscale" ) ); + p_adj = gtk_range_get_adjustment ( GTK_RANGE( p_scale ) ); + + /* Update the value */ + p_adj->value = ( 100. * + p_intf->p_input->stream.p_selected_area->i_tell ) / + p_intf->p_input->stream.p_selected_area->i_size; + + /* Gtv does it this way. Why not. */ + gtk_range_set_adjustment ( GTK_RANGE( p_scale ), p_adj ); + gtk_range_slider_update ( GTK_RANGE( p_scale ) ); + gtk_range_clear_background ( GTK_RANGE( p_scale ) ); + gtk_range_draw_background ( GTK_RANGE( p_scale ) ); + } + + /* Manage core vlc functions through the callback */ + p_intf->pf_manage( p_intf ); + + if( p_intf->b_die ) + { + /* Make sure we won't be called again */ + gtk_timeout_remove( p_intf->p_sys->i_timeout ); + + vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + + /* Prepare to die, young Skywalker */ + gtk_main_quit(); + return( FALSE ); + } + + vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + + return( TRUE ); +} + diff --git a/plugins/gtk/intf_gtk.glade b/plugins/gtk/intf_gtk.glade new file mode 100644 index 0000000000..476b38d295 --- /dev/null +++ b/plugins/gtk/intf_gtk.glade @@ -0,0 +1,804 @@ + + + + + VideoLAN Client + vlc + + + pixmaps + C + False + True + False + False + gtk_interface.c + gtk_interface.h + gtk_callbacks.c + gtk_callbacks.h + gtk_support.c + gtk_support.h + + + + GtkWindow + intf_window + + destroy + on_intf_window_destroy + Sun, 11 Feb 2001 17:41:57 GMT + + + drag_data_received + on_intf_window_drag_data_received + Fri, 16 Feb 2001 01:59:35 GMT + + VideoLAN Client + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + + + GtkVBox + GnomeDock:contents + vbox2 + False + 0 + + + GtkHandleBox + handlebox2 + GTK_SHADOW_OUT + GTK_POS_LEFT + GTK_POS_TOP + + 0 + False + True + + + + GtkMenuBar + menubar1 + GTK_SHADOW_OUT + + + GtkMenuItem + menubar_file + + False + + + GtkMenu + menubar_file_menu + + + GtkMenuItem + menubar_open + Open a file + + 0 + GDK_F3 + activate + + + activate + on_menubar_open_activate + Wed, 21 Feb 2001 08:29:47 GMT + + + False + + + + GtkMenuItem + separator4 + False + + + + GtkMenuItem + menubar_exit + Exit the program + + GDK_CONTROL_MASK + GDK_Q + activate + + + activate + on_menubar_exit_activate + Wed, 21 Feb 2001 08:29:47 GMT + + + False + + + + + + GtkMenuItem + menubar_view + + False + + + GtkMenu + menubar_view_menu + + + GtkMenuItem + menubar_playlist + False + Open the playlist window + + activate + on_menubar_playlist_activate + Wed, 21 Feb 2001 08:35:16 GMT + + + False + + + + GtkMenuItem + menubar_modules + False + Open the plugin manager + + activate + on_menubar_modules_activate + Wed, 21 Feb 2001 08:35:16 GMT + + + False + + + + + + GtkMenuItem + menubar_settings + + False + + + GtkMenu + menubar_settings_menu + + + GtkMenuItem + menubar_preferences + False + Configure the application + + activate + on_menubar_preferences_activate + Wed, 21 Feb 2001 08:39:39 GMT + + + False + + + + + + GtkMenuItem + menubar_help + + False + + + GtkMenu + menubar_help_menu + + + GtkMenuItem + menubar_about + About this application + + activate + on_menubar_about_activate + Wed, 21 Feb 2001 08:39:39 GMT + + + False + + + + + + + + GtkHandleBox + handlebox1 + GTK_SHADOW_OUT + GTK_POS_LEFT + GTK_POS_TOP + + 0 + False + True + + + + GtkToolbar + toolbar + 1 + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH + 16 + GTK_TOOLBAR_SPACE_LINE + GTK_RELIEF_NONE + True + + + GtkButton + Toolbar:button + toolbar_open + Open File + + clicked + on_toolbar_open_clicked + Sun, 11 Feb 2001 17:06:24 GMT + + + + + + GtkButton + Toolbar:button + toolbar_back + False + Go Backwards + + clicked + on_toolbar_back_clicked + Sun, 11 Feb 2001 17:06:28 GMT + + + + True + + + + + GtkButton + Toolbar:button + toolbar_stop + False + Stop Stream + + clicked + on_toolbar_stop_clicked + Sun, 11 Feb 2001 17:06:33 GMT + + + + + + GtkButton + Toolbar:button + toolbar_play + Play Stream + + clicked + on_toolbar_play_clicked + Sun, 11 Feb 2001 17:06:39 GMT + + + + + + GtkButton + Toolbar:button + toolbar_pause + Pause Stream + + clicked + on_toolbar_pause_clicked + Sun, 11 Feb 2001 17:06:43 GMT + + + + + + GtkButton + Toolbar:button + toolbar_slow + Play Slower + + clicked + on_toolbar_slow_clicked + Mon, 12 Feb 2001 07:20:42 GMT + + + + + + GtkButton + Toolbar:button + toolbar_fast + Play Faster + + clicked + on_toolbar_fast_clicked + Mon, 12 Feb 2001 07:20:48 GMT + + + + + + GtkButton + Toolbar:button + toolbar_playlist + False + Open Playlist + + clicked + on_toolbar_playlist_clicked + Sun, 11 Feb 2001 17:06:48 GMT + + + + True + + + + + GtkButton + Toolbar:button + toolbar_prev + Previous File + + clicked + on_toolbar_prev_clicked + Sun, 11 Feb 2001 17:06:52 GMT + + + + + + GtkButton + Toolbar:button + toolbar_next + Next File + + clicked + on_toolbar_next_clicked + Sun, 11 Feb 2001 17:06:56 GMT + + + + + + + + GtkEntry + entry1 + True + True + True + 0 + Tired of boring stub messages ? Write your own exciting message here !! + + 0 + False + True + + + + + GtkLabel + label6 + + GTK_JUSTIFY_LEFT + False + 0 + 0.5 + 5 + 0 + + 0 + False + True + + + + + GtkHScale + hscale + True + + button_release_event + on_hscale_button_release_event + Tue, 13 Feb 2001 01:15:41 GMT + + + button_press_event + on_hscale_button_press_event + Tue, 13 Feb 2001 02:55:04 GMT + + True + GTK_POS_BOTTOM + 1 + GTK_UPDATE_DELAYED + 0 + 0 + 100 + 1 + 6.25 + 0 + + 0 + False + True + + + + + GtkLabel + label13 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 5 + + 0 + False + True + + + + + GtkStatusbar + statusbar1 + + 0 + False + True + GTK_PACK_END + + + + + + + GtkMenu + intf_popup + + + GtkMenuItem + popup_play + + activate + on_popup_play_activate + Wed, 21 Feb 2001 08:31:57 GMT + + + False + + + + GtkMenuItem + popup_pause + + activate + on_popup_pause_activate + Wed, 21 Feb 2001 08:41:04 GMT + + + False + + + + GtkMenuItem + popup_slow + + activate + on_popup_slow_activate + Wed, 21 Feb 2001 08:41:04 GMT + + + False + + + + GtkMenuItem + popup_fast + + activate + on_popup_fast_activate + Wed, 21 Feb 2001 08:41:04 GMT + + + False + + + + GtkMenuItem + separator6 + False + + + + GtkMenuItem + popup_open + + activate + on_popup_open_activate + Wed, 21 Feb 2001 08:41:04 GMT + + + False + + + + GtkMenuItem + separator5 + False + + + + GtkMenuItem + popup_about + + activate + on_popup_about_activate + Wed, 21 Feb 2001 08:41:04 GMT + + + False + + + + GtkMenuItem + popup_exit + + activate + on_popup_exit_activate + Wed, 21 Feb 2001 08:31:57 GMT + + + False + + + + + GtkDialog + intf_about + 10 + About + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + False + False + False + + + GtkVBox + Dialog:vbox + dialog-vbox1 + False + 0 + + + GtkHBox + Dialog:action_area + dialog-action_area + 10 + True + 5 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + about_ok + True + True + True + + clicked + on_about_ok_clicked + Wed, 21 Feb 2001 08:51:07 GMT + + + GTK_RELIEF_NORMAL + + 0 + False + True + + + + + + GtkVBox + vbox3 + False + 0 + + 0 + True + True + + + + GtkLabel + label14 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 10 + + 0 + True + True + + + + + GtkLabel + label18 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkHBox + hbox1 + False + 0 + + 0 + False + False + + + + GtkLabel + label15 + + GTK_JUSTIFY_RIGHT + False + 0.5 + 1.67638e-08 + 0 + 10 + + 0 + False + False + + + + + GtkLabel + label16 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0 + 10 + 10 + + 0 + False + False + + + + + + GtkLabel + label17 + + GTK_JUSTIFY_LEFT + True + 0.5 + 0.5 + 0 + 5 + + 0 + False + True + + + + + + + + GtkFileSelection + intf_fileopen + 10 + + destroy + on_intf_fileopen_destroy + Wed, 21 Feb 2001 08:53:18 GMT + + Select File + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + True + + + GtkButton + FileSel:ok_button + fileopen_ok + True + True + + clicked + on_fileopen_ok_clicked + Wed, 21 Feb 2001 08:55:12 GMT + + + GTK_RELIEF_NORMAL + + + + GtkButton + FileSel:cancel_button + fileopen_cancel + True + True + + clicked + on_fileopen_cancel_clicked + Wed, 21 Feb 2001 08:55:06 GMT + + + GTK_RELIEF_NORMAL + + + + diff --git a/plugins/gtk/intf_gtk.o b/plugins/gtk/intf_gtk.o new file mode 100644 index 0000000000..b60915c9fb Binary files /dev/null and b/plugins/gtk/intf_gtk.o differ