src/interface/intf_ctrl.o \
src/interface/intf_plst.o \
src/interface/intf_channels.o \
- src/interface/intf_console.o
+ src/interface/intf_console.o \
+ src/interface/intf_urldecode.o \
INPUT = src/input/input_ext-dec.o \
src/input/input_ext-intf.o \
plugins/gtk/intf_gtk.o \
plugins/gtk/gtk_callbacks.o \
plugins/gtk/gtk_interface.o \
- plugins/gtk/gtk_support.o
+ plugins/gtk/gtk_support.o \
+ plugins/gtk/gtk_playlist.o
PLUGIN_GNOME = plugins/gnome/gnome.o \
plugins/gnome/intf_gnome.o \
int main() {
/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
+typedef int charset[2]; const charset x = {0,0};
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
#include <sys/types.h>
#include <fcntl.h>
#include <sys/mman.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
/* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE
-# ifdef HAVE_UNISTD_H
-# include <unistd.h>
-# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
/*
* First, make a file with some known garbage in it.
*/
- data = malloc(pagesize);
+ data = (char*)malloc(pagesize);
if (!data)
exit(1);
for (i = 0; i < pagesize; ++i)
fd = open("conftestmmap", O_RDWR);
if (fd < 0)
exit(1);
- data2 = malloc(2 * pagesize);
+ data2 = (char*)malloc(2 * pagesize);
if (!data2)
exit(1);
data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
*/
for (i = 0; i < pagesize; ++i)
*(data2 + i) = *(data2 + i) + 1;
- data3 = malloc(pagesize);
+ data3 = (char*)malloc(pagesize);
if (!data3)
exit(1);
if (read(fd, data3, pagesize) != pagesize)
}
EOF
-if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2103: \"$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
fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6
-echo "configure:2123: checking return type of signal handlers" >&5
+echo "configure:2126: 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 <<EOF
-#line 2128 "configure"
+#line 2131 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <signal.h>
int i;
; return 0; }
EOF
-if { (eval echo configure:2145: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2148: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_signal=void
else
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:2164: checking for dlopen in -ldl" >&5
+echo "configure:2167: 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
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2172 "configure"
+#line 2175 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
dlopen()
; return 0; }
EOF
-if { (eval echo configure:2183: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2186: \"$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
fi
echo $ac_n "checking for optarg in -lgnugetopt""... $ac_c" 1>&6
-echo "configure:2211: checking for optarg in -lgnugetopt" >&5
+echo "configure:2214: 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
ac_save_LIBS="$LIBS"
LIBS="-lgnugetopt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2219 "configure"
+#line 2222 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
optarg()
; return 0; }
EOF
-if { (eval echo configure:2230: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2233: \"$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
fi
echo $ac_n "checking for _ in -lbe""... $ac_c" 1>&6
-echo "configure:2258: checking for _ in -lbe" >&5
+echo "configure:2261: 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
ac_save_LIBS="$LIBS"
LIBS="-lbe $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2266 "configure"
+#line 2269 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
_()
; return 0; }
EOF
-if { (eval echo configure:2277: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2280: \"$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
fi
echo $ac_n "checking for _ in -lgame""... $ac_c" 1>&6
-echo "configure:2305: checking for _ in -lgame" >&5
+echo "configure:2308: 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
ac_save_LIBS="$LIBS"
LIBS="-lgame $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2313 "configure"
+#line 2316 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
_()
; return 0; }
EOF
-if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2327: \"$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
fi
echo $ac_n "checking for _ in -lroot""... $ac_c" 1>&6
-echo "configure:2352: checking for _ in -lroot" >&5
+echo "configure:2355: 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
ac_save_LIBS="$LIBS"
LIBS="-lroot $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2360 "configure"
+#line 2363 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
_()
; return 0; }
EOF
-if { (eval echo configure:2371: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2374: \"$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
fi
echo $ac_n "checking for powl in -lm""... $ac_c" 1>&6
-echo "configure:2399: checking for powl in -lm" >&5
+echo "configure:2402: 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
ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2407 "configure"
+#line 2410 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
powl()
; return 0; }
EOF
-if { (eval echo configure:2418: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2421: \"$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
fi
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6
-echo "configure:2446: checking for pthread_create in -lpthread" >&5
+echo "configure:2449: 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
ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2454 "configure"
+#line 2457 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
pthread_create()
; return 0; }
EOF
-if { (eval echo configure:2465: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2468: \"$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
fi
echo $ac_n "checking for thread_create in -lthreads""... $ac_c" 1>&6
-echo "configure:2493: checking for thread_create in -lthreads" >&5
+echo "configure:2496: 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
ac_save_LIBS="$LIBS"
LIBS="-lthreads $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 2501 "configure"
+#line 2504 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2
thread_create()
; return 0; }
EOF
-if { (eval echo configure:2512: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2515: \"$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
echo $ac_n "checking for getopt_long""... $ac_c" 1>&6
-echo "configure:2541: checking for getopt_long" >&5
+echo "configure:2544: 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 <<EOF
-#line 2546 "configure"
+#line 2549 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char getopt_long(); below. */
; return 0; }
EOF
-if { (eval echo configure:2569: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2572: \"$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
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2596: checking for $ac_hdr" >&5
+echo "configure:2599: 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
-#line 2601 "configure"
+#line 2604 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2606: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2609: \"$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*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2636: checking for $ac_hdr" >&5
+echo "configure:2639: 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
-#line 2641 "configure"
+#line 2644 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2649: \"$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*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2676: checking for $ac_hdr" >&5
+echo "configure:2679: 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
-#line 2681 "configure"
+#line 2684 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2686: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2689: \"$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*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2716: checking for $ac_hdr" >&5
+echo "configure:2719: 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
-#line 2721 "configure"
+#line 2724 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2726: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2729: \"$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*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2756: checking for $ac_hdr" >&5
+echo "configure:2759: 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
-#line 2761 "configure"
+#line 2764 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2766: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2769: \"$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*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2796: checking for $ac_hdr" >&5
+echo "configure:2799: 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
-#line 2801 "configure"
+#line 2804 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2806: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2809: \"$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*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2836: checking for $ac_hdr" >&5
+echo "configure:2839: 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
-#line 2841 "configure"
+#line 2844 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2846: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2849: \"$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*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2876: checking for $ac_hdr" >&5
+echo "configure:2879: 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
-#line 2881 "configure"
+#line 2884 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2886: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2889: \"$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*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:2917: checking for $ac_hdr" >&5
+echo "configure:2920: 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
-#line 2922 "configure"
+#line 2925 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2927: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2930: \"$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*
CFLAGS="${CFLAGS} -Wall -Werror"
echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6
-echo "configure:2958: checking for ntohl in sys/param.h" >&5
+echo "configure:2961: checking for ntohl in sys/param.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 2960 "configure"
+#line 2963 "configure"
#include "confdefs.h"
#include <sys/param.h>
void foo() { int meuh; ntohl(meuh); }
; return 0; }
EOF
-if { (eval echo configure:2968: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2971: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define NTOHL_IN_SYS_PARAM_H 1
CFLAGS="${CFLAGS} -rdynamic"
echo $ac_n "checking if \$CC accepts -rdynamic""... $ac_c" 1>&6
-echo "configure:2985: checking if \$CC accepts -rdynamic" >&5
+echo "configure:2988: checking if \$CC accepts -rdynamic" >&5
cat > conftest.$ac_ext <<EOF
-#line 2987 "configure"
+#line 2990 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2994: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2997: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
DYNAMIC_FLAG="-rdynamic"
echo "$ac_t""yes" 1>&6
CFLAGS=$save_CFLAGS
echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6
-echo "configure:3009: checking for boolean_t in sys/types.h" >&5
+echo "configure:3012: checking for boolean_t in sys/types.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 3011 "configure"
+#line 3014 "configure"
#include "confdefs.h"
#include <sys/types.h>
void quux() { boolean_t foo; }
; return 0; }
EOF
-if { (eval echo configure:3019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3022: \"$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
rm -f conftest*
echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:3035: checking for working const" >&5
+echo "configure:3038: 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 <<EOF
-#line 3040 "configure"
+#line 3043 "configure"
#include "confdefs.h"
int main() {
/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
+typedef int charset[2]; const charset x = {0,0};
/* SunOS 4.1.1 cc rejects this. */
char const *const *ccp;
char **p;
; return 0; }
EOF
-if { (eval echo configure:3089: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3092: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_const=yes
else
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:3110: checking for ANSI C header files" >&5
+echo "configure:3113: 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 <<EOF
-#line 3115 "configure"
+#line 3118 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3123: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3126: \"$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*
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
-#line 3140 "configure"
+#line 3143 "configure"
#include "confdefs.h"
#include <string.h>
EOF
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
-#line 3158 "configure"
+#line 3161 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
:
else
cat > conftest.$ac_ext <<EOF
-#line 3179 "configure"
+#line 3182 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
exit (0); }
EOF
-if { (eval echo configure:3190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3193: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6
-echo "configure:3214: checking for size_t" >&5
+echo "configure:3217: 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 <<EOF
-#line 3219 "configure"
+#line 3222 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:3247: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:3250: 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 <<EOF
-#line 3252 "configure"
+#line 3255 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:3261: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3264: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3293: checking for $ac_hdr" >&5
+echo "configure:3296: 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
-#line 3298 "configure"
+#line 3301 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3303: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3306: \"$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*
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3328: checking for $ac_hdr" >&5
+echo "configure:3331: 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
-#line 3333 "configure"
+#line 3336 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3338: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3341: \"$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*
done
cat > conftest.$ac_ext <<EOF
-#line 3365 "configure"
+#line 3368 "configure"
#include "confdefs.h"
#include <linux/cdrom.h>
EOF
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:3567: checking for sys/asoundlib.h" >&5
+echo "configure:3570: 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
-#line 3572 "configure"
+#line 3575 "configure"
#include "confdefs.h"
#include <sys/asoundlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3577: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3580: \"$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*
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:3594: checking for main in -lasound" >&5
+echo "configure:3597: 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
ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3602 "configure"
+#line 3605 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:3609: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3612: \"$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
void intf_PlstInit ( playlist_t * p_playlist );
int intf_PlstAdd ( playlist_t * p_playlist,
int i_pos, char * psz_item );
+int intf_PlstDelete ( playlist_t * p_playlist,
+ int i_pos );
void intf_PlstNext ( playlist_t * p_playlist );
void intf_PlstPrev ( playlist_t * p_playlist );
void intf_PlstDestroy ( playlist_t * p_playlist );
-
+void intf_PlstJumpto ( playlist_t * p_playlist , int i_pos);
--- /dev/null
+/*
+ * Copyright (C) 1999, 2000 VideoLAN
+ * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public Licensse 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-1307, USA.
+ */
+
+void urldecode_path(char *);
#include <gtk/gtk.h>
+#include <string.h>
+
#include "config.h"
#include "common.h"
#include "threads.h"
#include "main.h"
+/****************************************************************************
+ * External function
+ */
+void on_generic_drop_data_received( intf_thread_t * p_intf,
+ GtkSelectionData *data, guint info, int position);
+
+
+
/*****************************************************************************
* Inline function to retrieve the interface structure
*****************************************************************************/
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_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)
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)
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)
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)
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_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
+ on_generic_drop_data_received( p_intf, data, info, 0);
+ if( p_intf->p_input != NULL )
+ {
+ /* FIXME: temporary hack */
+ p_intf->p_input->b_eof = 1;
+ }
+
+ intf_PlstJumpto( p_main->p_playlist, -1 );
- intf_ErrMsg( "intf error: unknown dropped type");
- break;
- }
}
gdk_window_raise( p_intf->p_sys->p_disc->window );
}
-
void
on_popup_audio_activate (GtkMenuItem *menuitem,
gpointer user_data)
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area );
input_SetStatus( p_intf->p_input, INPUT_STATUS_PLAY );
}
+
+gboolean
+on_intf_window_destroy (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ intf_thread_t *p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
+ /* is there an output thread ? */
+ if(p_main->b_video == 1)
+ {
+ gtk_widget_hide(widget);
+ } else {
+ p_intf->b_die = 1;
+ gtk_widget_destroy(widget);
+ }
+ return TRUE;
+}
+
+
+void
+on_main_window_toggle (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" );
+
+ if( GTK_WIDGET_VISIBLE(p_intf->p_sys->p_window) ) {
+ gtk_widget_hide( p_intf->p_sys->p_window);
+
+ } else {
+ gtk_widget_show( p_intf->p_sys->p_window );
+ }
+}
+
#include <gtk/gtk.h>
-
-void
-on_intf_window_destroy (GtkObject *object,
- gpointer user_data);
+/* General glade callbacks */
void
on_intf_window_drag_data_received (GtkWidget *widget,
void
on_menubar_chapter_activate (GtkMenuItem *menuitem,
gpointer user_data);
+
+gboolean
+on_clist1_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data);
+
+gboolean
+on_intf_window_delete (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data);
+
+gboolean
+on_intf_playlist_destroy_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data);
+
+gboolean
+on_intf_playlist_destroy_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data);
+
+void
+on_intf_playlist_drag_data_received (GtkWidget *widget,
+ GdkDragContext *drag_context,
+ gint x,
+ gint y,
+ GtkSelectionData *data,
+ guint info,
+ guint time,
+ gpointer user_data);
+
+gboolean
+on_clist1_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data);
+
+gboolean
+on_intf_playlist_destroy_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data);
+
+gboolean
+on_intf_window_destroy (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data);
+
+gboolean
+on_intf_window_destroy (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data);
+
+void
+on_main_window_toggle (GtkMenuItem *menuitem,
+ gpointer user_data);
+
+void
+on_delete_clicked (GtkMenuItem *menuitem,
+ gpointer user_data);
(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 ("");
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,
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 (intf_window), "delete_event",
+ GTK_SIGNAL_FUNC (on_intf_window_destroy),
+ NULL);
gtk_signal_connect (GTK_OBJECT (menubar_open), "activate",
GTK_SIGNAL_FUNC (on_menubar_open_activate),
NULL);
GtkWidget *popup_audio;
GtkWidget *popup_subpictures;
GtkWidget *separator9;
+ GtkWidget *main_window_toggle;
GtkWidget *popup_about;
GtkWidget *popup_exit;
GtkTooltips *tooltips;
gtk_container_add (GTK_CONTAINER (intf_popup), separator9);
gtk_widget_set_sensitive (separator9, FALSE);
+ main_window_toggle = gtk_menu_item_new_with_label ("");
+ tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (main_window_toggle)->child),
+ _("show/hide main _window"));
+ gtk_widget_add_accelerator (main_window_toggle, "activate_item", intf_popup_accels,
+ tmp_key, 0, 0);
+ gtk_widget_ref (main_window_toggle);
+ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "main_window_toggle", main_window_toggle,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (main_window_toggle);
+ gtk_container_add (GTK_CONTAINER (intf_popup), main_window_toggle);
+
popup_about = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_about)->child),
_("_About..."));
gtk_signal_connect (GTK_OBJECT (popup_disc), "activate",
GTK_SIGNAL_FUNC (on_popup_disc_activate),
NULL);
+ gtk_signal_connect (GTK_OBJECT (main_window_toggle), "activate",
+ GTK_SIGNAL_FUNC (on_main_window_toggle),
+ NULL);
gtk_signal_connect (GTK_OBJECT (popup_about), "activate",
GTK_SIGNAL_FUNC (on_popup_about_activate),
NULL);
gtk_widget_show (frame1);
gtk_box_pack_start (GTK_BOX (vbox3), frame1, FALSE, FALSE, 0);
- label16 = gtk_label_new (_("Régis Duchesne <regis@via.ecp.fr>\nMichel Lespinasse <walken@zoy.org>\nOlivier Pomel <pomel@via.ecp.fr>\nPierre Baillet <oct@zoy.org>\nJean-Philippe Grimaldi <jeanphi@via.ecp.fr>\nAndres Krapf <dae@via.ecp.fr>\nChristophe Massiot <massiot@via.ecp.fr>\nVincent Seguin <seguin@via.ecp.fr>\nBenoit Steiner <benny@via.ecp.fr>\nArnaud de Bossoreille de Ribou <bozo@via.ecp.fr>\nJean-Marc Dressler <polux@via.ecp.fr>\nGaël Hendryckx <jimmy@via.ecp.fr>\nSamuel Hocevar <sam@zoy.org>\nBrieuc Jeunhomme <bbp@via.ecp.fr>\nMichel Kaempf <maxx@via.ecp.fr>\nStéphane Borel <stef@via.ecp.fr>\nRenaud Dartus <reno@via.ecp.fr>\nHenri Fallon <henri@via.ecp.fr>"));
+ label16 = gtk_label_new (_("R\351gis Duchesne <regis@via.ecp.fr>\nMichel Lespinasse <walken@zoy.org>\nOlivier Pomel <pomel@via.ecp.fr>\nPierre Baillet <oct@zoy.org>\nJean-Philippe Grimaldi <jeanphi@via.ecp.fr>\nAndres Krapf <dae@via.ecp.fr>\nChristophe Massiot <massiot@via.ecp.fr>\nVincent Seguin <seguin@via.ecp.fr>\nBenoit Steiner <benny@via.ecp.fr>\nArnaud de Bossoreille de Ribou <bozo@via.ecp.fr>\nJean-Marc Dressler <polux@via.ecp.fr>\nGa\353l Hendryckx <jimmy@via.ecp.fr>\nSamuel Hocevar <sam@zoy.org>\nBrieuc Jeunhomme <bbp@via.ecp.fr>\nMichel Kaempf <maxx@via.ecp.fr>\nSt\351phane Borel <stef@via.ecp.fr>\nRenaud Dartus <reno@via.ecp.fr>\nHenri Fallon <henri@via.ecp.fr>"));
gtk_widget_ref (label16);
gtk_object_set_data_full (GTK_OBJECT (intf_about), "label16", label16,
(GtkDestroyNotify) gtk_widget_unref);
return intf_disc;
}
+GtkWidget*
+create_intf_playlist (void)
+{
+ GtkWidget *intf_playlist;
+ GtkWidget *vbox6;
+ GtkWidget *menubar2;
+ GtkWidget *add1;
+ GtkWidget *delete1;
+ GtkWidget *delete1_menu;
+ GtkAccelGroup *delete1_menu_accels;
+ guint tmp_key;
+ GtkWidget *selection;
+ GtkWidget *selection1;
+ GtkWidget *scrolledwindow1;
+ GtkWidget *clist1;
+ GtkWidget *label22;
+ GtkWidget *label23;
+
+ intf_playlist = gtk_window_new (GTK_WINDOW_DIALOG);
+ gtk_object_set_data (GTK_OBJECT (intf_playlist), "intf_playlist", intf_playlist);
+ gtk_window_set_title (GTK_WINDOW (intf_playlist), _("Playlist"));
+ gtk_window_set_default_size (GTK_WINDOW (intf_playlist), 386, 200);
+
+ vbox6 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_ref (vbox6);
+ gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "vbox6", vbox6,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (vbox6);
+ gtk_container_add (GTK_CONTAINER (intf_playlist), vbox6);
+
+ menubar2 = gtk_menu_bar_new ();
+ gtk_widget_ref (menubar2);
+ gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "menubar2", menubar2,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (menubar2);
+ gtk_box_pack_start (GTK_BOX (vbox6), menubar2, FALSE, FALSE, 0);
+
+ add1 = gtk_menu_item_new_with_label (_("Add"));
+ gtk_widget_ref (add1);
+ gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "add1", add1,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (add1);
+ gtk_container_add (GTK_CONTAINER (menubar2), add1);
+
+ delete1 = gtk_menu_item_new_with_label (_("Delete"));
+ gtk_widget_ref (delete1);
+ gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "delete1", delete1,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (delete1);
+ gtk_container_add (GTK_CONTAINER (menubar2), delete1);
+
+ delete1_menu = gtk_menu_new ();
+ gtk_widget_ref (delete1_menu);
+ gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "delete1_menu", delete1_menu,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_menu_item_set_submenu (GTK_MENU_ITEM (delete1), delete1_menu);
+ delete1_menu_accels = gtk_menu_ensure_uline_accel_group (GTK_MENU (delete1_menu));
+
+ selection = gtk_menu_item_new_with_label ("");
+ tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (selection)->child),
+ _("_selection"));
+ gtk_widget_add_accelerator (selection, "activate_item", delete1_menu_accels,
+ tmp_key, 0, 0);
+ gtk_widget_ref (selection);
+ gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "selection", selection,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (selection);
+ gtk_container_add (GTK_CONTAINER (delete1_menu), selection);
+
+ selection1 = gtk_menu_item_new_with_label (_("Selection"));
+ gtk_widget_ref (selection1);
+ gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "selection1", selection1,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (selection1);
+ gtk_container_add (GTK_CONTAINER (menubar2), selection1);
+
+ scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL);
+ gtk_widget_ref (scrolledwindow1);
+ gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "scrolledwindow1", scrolledwindow1,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (scrolledwindow1);
+ gtk_box_pack_start (GTK_BOX (vbox6), scrolledwindow1, TRUE, TRUE, 0);
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+
+ clist1 = gtk_clist_new (2);
+ gtk_widget_ref (clist1);
+ gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "clist1", clist1,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (clist1);
+ gtk_container_add (GTK_CONTAINER (scrolledwindow1), clist1);
+ gtk_clist_set_column_width (GTK_CLIST (clist1), 0, 257);
+ gtk_clist_set_column_width (GTK_CLIST (clist1), 1, 80);
+ gtk_clist_set_selection_mode (GTK_CLIST (clist1), GTK_SELECTION_EXTENDED);
+ gtk_clist_column_titles_hide (GTK_CLIST (clist1));
+
+ label22 = gtk_label_new (_("File"));
+ gtk_widget_ref (label22);
+ gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "label22", label22,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label22);
+ gtk_clist_set_column_widget (GTK_CLIST (clist1), 0, label22);
+
+ label23 = gtk_label_new (_("Duration"));
+ gtk_widget_ref (label23);
+ gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "label23", label23,
+ (GtkDestroyNotify) gtk_widget_unref);
+ gtk_widget_show (label23);
+ gtk_clist_set_column_widget (GTK_CLIST (clist1), 1, label23);
+
+ gtk_signal_connect (GTK_OBJECT (intf_playlist), "delete_event",
+ GTK_SIGNAL_FUNC (on_intf_playlist_destroy_event),
+ NULL);
+ gtk_signal_connect (GTK_OBJECT (selection), "activate",
+ GTK_SIGNAL_FUNC (on_delete_clicked),
+ NULL);
+ gtk_signal_connect (GTK_OBJECT (clist1), "event",
+ GTK_SIGNAL_FUNC (on_clist1_event),
+ NULL);
+ gtk_signal_connect (GTK_OBJECT (clist1), "drag_data_received",
+ GTK_SIGNAL_FUNC (on_intf_playlist_drag_data_received),
+ NULL);
+
+ return intf_playlist;
+}
+
GtkWidget* create_intf_about (void);
GtkWidget* create_intf_fileopen (void);
GtkWidget* create_intf_disc (void);
+GtkWidget* create_intf_playlist (void);
--- /dev/null
+/*****************************************************************************
+ * playlist_interface.c : Interface for the playlist dialog
+ *****************************************************************************
+ * Copyright (C) 2000, 2001 VideoLAN
+ *
+ * Authors: .Pierre Baillet <oct@zoy.org>
+ *
+ * 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 <stdlib.h>
+
+#include <gtk/gtk.h>
+
+#include <string.h>
+
+#include <sys/types.h> /* for readdir and stat stuff */
+#include <dirent.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#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 "intf_urldecode.h"
+
+#include "gtk_sys.h"
+#include "gtk_callbacks.h"
+#include "gtk_interface.h"
+#include "gtk_support.h"
+
+#include "main.h"
+
+/* Playlist specific functions */
+void rebuildCList(GtkCList * clist, playlist_t * playlist_p);
+gint compareItems(gconstpointer a, gconstpointer b);
+int hasValidExtension(gchar * filename);
+GList * intf_readFiles(gchar * fsname );
+int intf_AppendList( playlist_t * p_playlist, int i_pos, GList * list );
+void GtkPlayListManage( gpointer p_data );
+void on_generic_drop_data_received( intf_thread_t * p_intf,
+ GtkSelectionData *data, guint info, int position);
+
+
+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" ) );
+}
+
+
+
+void
+on_menubar_playlist_activate (GtkMenuItem *menuitem,
+ gpointer user_data)
+{
+ intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" );
+ playlist_t * p_playlist ;
+ GtkCList * list;
+
+ 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 );
+ }
+
+
+ vlc_mutex_lock( &p_main->p_playlist->change_lock );
+ if(p_main->p_playlist->i_size > 0 )
+ {
+ p_playlist = p_main->p_playlist;
+
+ list = GTK_CLIST(lookup_widget( p_intf->p_sys->p_playlist, "clist1" )) ;
+ rebuildCList( list, p_playlist );
+
+
+ }
+ vlc_mutex_unlock( &p_main->p_playlist->change_lock );
+
+ gtk_widget_show( p_intf->p_sys->p_playlist );
+ gdk_window_raise( p_intf->p_sys->p_playlist->window );
+}
+
+
+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 );
+ }
+ if( GTK_WIDGET_VISIBLE(p_intf->p_sys->p_playlist) ) {
+ gtk_widget_hide( p_intf->p_sys->p_playlist);
+ } else {
+ gtk_widget_show( p_intf->p_sys->p_playlist );
+ gdk_window_raise( p_intf->p_sys->p_playlist->window );
+ }
+}
+
+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 deleteGListItem(gpointer data, gpointer param)
+{
+ int curRow = ( int )data;
+ intf_thread_t * p_intf = param;
+
+ intf_PlstDelete( p_main->p_playlist, curRow );
+
+ /* are we deleting the current played stream */
+ if( p_intf->p_sys->i_playing == curRow )
+ {
+ /* next ! */
+ p_intf->p_input->b_eof = 1;
+ /* this has to set the slider to 0 */
+
+ /* step minus one */
+ p_intf->p_sys->i_playing-- ;
+ p_main->p_playlist->i_index-- ;
+ }
+}
+gint compareItems(gconstpointer a, gconstpointer b)
+{
+ return b - a;
+}
+
+void
+rebuildCList(GtkCList * clist, playlist_t * playlist_p)
+{
+ int dummy;
+ gchar * text[2];
+ GdkColor red;
+ red.red = 65535;
+ red.green = 0;
+ red.blue = 0;
+
+
+ gtk_clist_freeze( clist );
+ gtk_clist_clear( clist );
+
+ for( dummy=0; dummy < playlist_p->i_size; dummy++ )
+ {
+ text[0] = g_strdup( rindex( (char *)(playlist_p->p_item[playlist_p->i_size -1 - dummy].psz_name ), '/' ) + 1 );
+ text[1] = g_strdup( "no info");
+
+ gtk_clist_insert( clist, 0, text );
+
+ free(text[0]);
+ free(text[1]);
+ }
+ gtk_clist_set_background (
+ clist,
+ playlist_p->i_index,
+ &red);
+ gtk_clist_thaw( clist );
+}
+
+void
+on_delete_clicked (GtkMenuItem *item,
+ gpointer user_data)
+{
+ /* user wants to delete a file in the queue */
+ GList * selection;
+ GtkCList * clist;
+ playlist_t * playlist_p;
+
+ /* catch the thread back */
+ intf_thread_t *p_intf = GetIntf( GTK_WIDGET(item), "intf_playlist" );
+ playlist_p = p_main->p_playlist;
+
+ /* lock the struct */
+ vlc_mutex_lock( &p_intf->p_sys->change_lock );
+ clist = GTK_CLIST( lookup_widget(p_intf->p_sys->p_playlist,"clist1") );
+
+ /* I use UNDOCUMENTED features to retrieve the selection... */
+ selection = clist->selection;
+
+ if( g_list_length(selection)>0 )
+ {
+ selection = g_list_sort( selection, compareItems );
+ g_list_foreach( selection,
+ deleteGListItem,
+ p_intf );
+
+ rebuildCList( clist, playlist_p );
+ }
+
+ vlc_mutex_unlock( &p_intf->p_sys->change_lock );
+}
+
+gboolean
+on_intf_playlist_destroy_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ gtk_widget_hide(widget);
+
+ return TRUE;
+}
+
+void
+on_intf_playlist_drag_data_received (GtkWidget *widget,
+ GdkDragContext *drag_context,
+ gint x,
+ gint y,
+ GtkSelectionData *data,
+ guint info,
+ guint time,
+ gpointer user_data)
+{
+ /* catch the interface back */
+ intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), "intf_playlist" );
+ GtkCList * clist;
+ gint row, col;
+
+ clist = GTK_CLIST(lookup_widget( p_intf->p_sys->p_playlist,"clist1" ));
+
+ if( gtk_clist_get_selection_info( clist,
+ x,
+ y,
+ &row,
+ &col )== 1)
+ {
+ on_generic_drop_data_received( p_intf, data, info, row);
+ } else {
+ on_generic_drop_data_received( p_intf, data, info, 0);
+ }
+}
+
+void on_generic_drop_data_received( intf_thread_t * p_intf,
+ GtkSelectionData *data, guint info, int position)
+{
+ /* first we'll have to split against all the '\n' we have */
+ gchar * protocol;
+ gchar * temp;
+ gchar * string = data->data ;
+ GList * files = NULL;
+ GtkCList * clist;
+
+
+ /* catch the playlist back */
+ playlist_t * p_playlist = p_main->p_playlist ;
+
+
+ /* if this has been URLencoded, decode it
+ *
+ * Is it a good thing to do it in place ?
+ * probably not...
+ */
+ if(info == DROP_ACCEPT_TEXT_URI_LIST)
+ {
+ urldecode_path( string );
+ }
+
+ /* this cuts string into single file drops */
+ while(*string)
+ {
+ temp = strchr(string, '\n');
+ if(temp)
+ {
+ if (*(temp - 1) == '\r')
+ *(temp - 1) = '\0';
+ *temp = '\0';
+ }
+
+
+ /* do we have a protocol or something ? */
+ protocol = strstr( string, ":/" );
+ if( protocol != NULL )
+ {
+ protocol = calloc( protocol - string + 2 ,
+ sizeof(char));
+ protocol = strncpy( protocol, string, strstr( string, ":/") + 1 - string );
+
+ intf_WarnMsg(1,"Protocol dropped is %s",protocol);
+ string += strlen(protocol) ;
+
+ /* Allowed things are proto: or proto:// */
+ if(string[0]=='/' && string[1]=='/')
+ {
+ /* eat one '/' */
+ string++;
+ }
+ intf_WarnMsg(1,"Dropped %s",string);
+
+ } else {
+ protocol = strdup("");
+ }
+
+ /* if it uses the file protocol we can do something, else, sorry :(
+ * I think this is a good choice for now, as we don't have any
+ * ability to read http:// or ftp:// files
+ * what about adding dvd:// to the list of authorized proto ? */
+
+ if( strcmp(protocol,"file:")==0 )
+ {
+ files = g_list_concat( files, intf_readFiles( string ) );
+ }
+
+ /* free the malloc and go on... */
+ free( protocol );
+ if (!temp)
+ break;
+ string = temp + 1;
+ }
+
+ /* At this point, we have a nice big list maybe NULL */
+ if(files != NULL)
+ {
+ /* lock the interface */
+ vlc_mutex_lock( &p_intf->p_sys->change_lock );
+ intf_WarnMsg(1, "List has %d elements",g_list_length(files));
+ intf_AppendList( p_playlist, position, files );
+ /* get the CList and rebuild it. */
+ clist = GTK_CLIST(lookup_widget( p_intf->p_sys->p_playlist,"clist1" ));
+ rebuildCList( clist , p_playlist );
+
+ /* unlock the interface */
+ vlc_mutex_unlock( &p_intf->p_sys->change_lock );
+ }
+}
+
+/* check a file (string) against supposed valid extension */
+int
+hasValidExtension(gchar * filename)
+{
+ char * ext[6] = {"mpg","mpeg","vob","mp2","ts","ps"};
+ int i_ext = 6;
+ int dummy;
+ gchar * p_filename = strrchr( filename, '.') + sizeof( char );
+ for(dummy=0; dummy<i_ext;dummy++)
+ {
+ if(strcmp(p_filename,ext[dummy])==0)
+ return 1;
+ }
+ return 0;
+}
+
+/* recursive function: descend into folders and build a list of valid filenames */
+GList *
+intf_readFiles(gchar * fsname )
+{
+ struct stat statbuf;
+ GList * current = NULL;
+
+ stat(fsname, &statbuf);
+
+ /* is it a regular file ? */
+ if( S_ISREG( statbuf.st_mode ) )
+ {
+ if( hasValidExtension(fsname) )
+ {
+ intf_WarnMsg( 3, "%s is a valid file. Stacking on the playlist", fsname );
+ return g_list_append( NULL, g_strdup(fsname) );
+ } else
+ return NULL;
+ }
+ /* is it a directory (should we check for symlinks ?) */
+ else if( S_ISDIR( statbuf.st_mode ) )
+ {
+ /* have to cd into this dir */
+ DIR * currentDir = opendir( fsname );
+ struct dirent * dirContent;
+
+ intf_WarnMsg( 3, "%s is a folder.", fsname );
+
+ if( currentDir == NULL )
+ {
+ /* something went bad, get out of here ! */
+ return current;
+ }
+ dirContent = readdir( currentDir );
+
+ /* while we still have entries in the directory */
+ while( dirContent != NULL )
+ {
+ /* if it is "." or "..", forget it */
+ if(strcmp(dirContent->d_name,".") != 0
+ && strcmp(dirContent->d_name,"..") != 0)
+ {
+ /* else build the new directory by adding
+ fsname "/" and the current entry name
+ (kludgy :()
+ */
+ char * newfs = malloc ( 2 +
+ strlen( fsname ) +
+ strlen( dirContent->d_name ) * sizeof( char ) );
+ strcpy( newfs, fsname );
+ strcpy( newfs + strlen( fsname )+1, dirContent->d_name);
+ newfs[strlen(fsname)] = '/';
+
+ current = g_list_concat( current, intf_readFiles( newfs ) );
+
+ g_free( newfs );
+ }
+ dirContent = readdir( currentDir );
+ }
+ return current;
+ }
+ return NULL;
+}
+
+/* add items in a playlist */
+int intf_AppendList( playlist_t * p_playlist, int i_pos, GList * list )
+{
+ guint length, dummy;
+ length = g_list_length( list );
+ for(dummy=0; dummy<length; dummy++)
+ {
+ intf_WarnMsg(1,"Adding: %s@%d",g_list_nth_data(list, dummy), i_pos + dummy);
+ intf_PlstAdd( p_playlist, i_pos + dummy, g_list_nth_data(list, dummy));
+ }
+ return 0;
+}
+gboolean
+on_clist1_event (GtkWidget *widget,
+ GdkEvent *event,
+ gpointer user_data)
+{
+ intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), "intf_playlist" );
+
+ if( (event->button).type == GDK_2BUTTON_PRESS )
+ {
+ GtkCList * clist;
+ gint row, col;
+
+ clist = GTK_CLIST(lookup_widget( p_intf->p_sys->p_playlist,"clist1" ));
+ if( gtk_clist_get_selection_info( clist,
+ (event->button).x,
+ (event->button).y,
+ &row,
+ &col )== 1)
+ {
+
+ /* clicked is in range. */
+ if( p_intf->p_input != NULL )
+ {
+ /* FIXME: temporary hack */
+ p_intf->p_input->b_eof = 1;
+ }
+ intf_PlstJumpto( p_main->p_playlist, row-1 );
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/* statis timeouted function */
+void GtkPlayListManage( gpointer p_data )
+{
+
+ /* this thing really sucks for now :( */
+
+ /* TODO speak more with interface/intf_plst.c */
+
+ intf_thread_t *p_intf = (void *)p_data;
+ playlist_t * p_playlist = p_main->p_playlist ;
+
+ vlc_mutex_lock( &p_intf->p_sys->change_lock );
+
+ if(p_intf->p_sys->i_playing != p_playlist->i_index)
+ {
+ GdkColor color;
+
+ color.red = 65535;
+ color.green = 0;
+ color.blue = 0;
+
+ gtk_clist_set_background (
+ GTK_CLIST(lookup_widget( p_intf->p_sys->p_playlist, "clist1" ) ),
+ p_playlist->i_index,
+ &color);
+ if( p_intf->p_sys->i_playing != -1 )
+ {
+ color.red = 65535;
+ color.green = 65535;
+ color.blue = 65535;
+ gtk_clist_set_background (
+ GTK_CLIST(lookup_widget( p_intf->p_sys->p_playlist, "clist1" ) ),
+ p_intf->p_sys->i_playing,
+ &color);
+ }
+ p_intf->p_sys->i_playing = p_playlist->i_index;
+ }
+ vlc_mutex_unlock( &p_intf->p_sys->change_lock );
+}
+
* gtk_sys.h: private Gtk+ interface description
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: gtk_sys.h,v 1.3 2001/03/07 10:31:10 stef Exp $
+ * $Id: gtk_sys.h,v 1.4 2001/03/08 13:32:55 octplane Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
/* intf_Manage callback timeout */
int i_timeout;
+ int i_list_timeout;
+
+ /* Playlist selected item */
+ int i_playing;
/* windows and widgets */
GtkWidget * p_window; /* main window */
* intf_gtk.c: Gtk+ interface
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
- * $Id: intf_gtk.c,v 1.5 2001/03/07 11:56:33 stef Exp $
+ * $Id: intf_gtk.c,v 1.6 2001/03/08 13:32:55 octplane Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Stéphane Borel <stef@via.ecp.fr>
void (*pf_activate)(GtkMenuItem *, gpointer) );
static gint GtkTitleMenu ( gpointer, GtkWidget *,
void (*pf_activate)(GtkMenuItem *, gpointer) );
+void GtkPlayListManage( gpointer p_data );
/*****************************************************************************
p_intf->p_sys->b_menus_update = 1;
p_intf->p_sys->b_scale_isfree = 1;
+
+ p_intf->p_sys->i_playing = -1;
+
p_intf->p_sys->pf_gtk_callback = NULL;
p_intf->p_sys->pf_gdk_callback = NULL;
char *p_args[] = { "" };
char **pp_args = p_args;
int i_args = 1;
+ GtkWidget * temp;
/* The data types we are allowed to receive */
static GtkTargetEntry target_table[] =
/* 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( );
+ p_intf->p_sys->p_playlist = create_intf_playlist( );
/* Set the title of the main window */
gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
GTK_DEST_DEFAULT_ALL, target_table,
1, GDK_ACTION_COPY );
+ /* Accept file drops on the playlist window */
+ temp = lookup_widget(p_intf->p_sys->p_playlist, "clist1");
+ gtk_drag_dest_set( GTK_WIDGET( temp ),
+ 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;
p_intf->p_sys->p_disc = NULL;
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_popup),
"p_intf", p_intf );
+ gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_playlist),
+ "p_intf", p_intf );
+
+
+
/* Show the control window */
gtk_widget_show( p_intf->p_sys->p_window );
* 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;
+ GtkPlayListManage( p_data );
+
vlc_mutex_lock( &p_intf->p_sys->change_lock );
+
/* If the "display popup" flag has changed */
if( p_intf->b_menu_change )
{
gtk_range_draw_background ( GTK_RANGE( p_scale ) );
}
+
/* Manage core vlc functions through the callback */
p_intf->pf_manage( p_intf );
<widget>
<class>GtkWindow</class>
<name>intf_window</name>
- <signal>
- <name>destroy</name>
- <handler>on_intf_window_destroy</handler>
- <last_modification_time>Sun, 11 Feb 2001 17:41:57 GMT</last_modification_time>
- </signal>
<signal>
<name>drag_data_received</name>
<handler>on_intf_window_drag_data_received</handler>
<last_modification_time>Fri, 16 Feb 2001 01:59:35 GMT</last_modification_time>
</signal>
+ <signal>
+ <name>delete_event</name>
+ <handler>on_intf_window_destroy</handler>
+ <last_modification_time>Thu, 08 Mar 2001 10:33:41 GMT</last_modification_time>
+ </signal>
<title>VideoLAN Client</title>
<type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position>
<widget>
<class>GtkMenuItem</class>
<name>menubar_playlist</name>
- <sensitive>False</sensitive>
<tooltip>Open the playlist window</tooltip>
<signal>
<name>activate</name>
<class>GtkButton</class>
<child_name>Toolbar:button</child_name>
<name>toolbar_playlist</name>
- <sensitive>False</sensitive>
<tooltip>Open Playlist</tooltip>
<signal>
<name>clicked</name>
<right_justify>False</right_justify>
</widget>
+ <widget>
+ <class>GtkMenuItem</class>
+ <name>main_window_toggle</name>
+ <signal>
+ <name>activate</name>
+ <handler>on_main_window_toggle</handler>
+ <last_modification_time>Thu, 08 Mar 2001 10:37:08 GMT</last_modification_time>
+ </signal>
+ <label>show/hide main _window</label>
+ <right_justify>False</right_justify>
+ </widget>
+
<widget>
<class>GtkMenuItem</class>
<name>popup_about</name>
</widget>
</widget>
+<widget>
+ <class>GtkWindow</class>
+ <name>intf_playlist</name>
+ <signal>
+ <name>delete_event</name>
+ <handler>on_intf_playlist_destroy_event</handler>
+ <last_modification_time>Thu, 08 Mar 2001 10:16:44 GMT</last_modification_time>
+ </signal>
+ <title>Playlist</title>
+ <type>GTK_WINDOW_DIALOG</type>
+ <position>GTK_WIN_POS_NONE</position>
+ <modal>False</modal>
+ <default_width>386</default_width>
+ <default_height>200</default_height>
+ <allow_shrink>False</allow_shrink>
+ <allow_grow>True</allow_grow>
+ <auto_shrink>False</auto_shrink>
+
+ <widget>
+ <class>GtkVBox</class>
+ <name>vbox6</name>
+ <homogeneous>False</homogeneous>
+ <spacing>0</spacing>
+
+ <widget>
+ <class>GtkMenuBar</class>
+ <name>menubar2</name>
+ <shadow_type>GTK_SHADOW_OUT</shadow_type>
+ <child>
+ <padding>0</padding>
+ <expand>False</expand>
+ <fill>False</fill>
+ </child>
+
+ <widget>
+ <class>GtkMenuItem</class>
+ <name>add1</name>
+ <label>Add</label>
+ <right_justify>False</right_justify>
+ </widget>
+
+ <widget>
+ <class>GtkMenuItem</class>
+ <name>delete1</name>
+ <label>Delete</label>
+ <right_justify>False</right_justify>
+
+ <widget>
+ <class>GtkMenu</class>
+ <name>delete1_menu</name>
+
+ <widget>
+ <class>GtkMenuItem</class>
+ <name>selection</name>
+ <signal>
+ <name>activate</name>
+ <handler>on_delete_clicked</handler>
+ <last_modification_time>Thu, 08 Mar 2001 11:12:03 GMT</last_modification_time>
+ </signal>
+ <label>_selection</label>
+ <right_justify>False</right_justify>
+ </widget>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkMenuItem</class>
+ <name>selection1</name>
+ <label>Selection</label>
+ <right_justify>False</right_justify>
+ </widget>
+ </widget>
+
+ <widget>
+ <class>GtkScrolledWindow</class>
+ <name>scrolledwindow1</name>
+ <hscrollbar_policy>GTK_POLICY_AUTOMATIC</hscrollbar_policy>
+ <vscrollbar_policy>GTK_POLICY_AUTOMATIC</vscrollbar_policy>
+ <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+ <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
+ <child>
+ <padding>0</padding>
+ <expand>True</expand>
+ <fill>True</fill>
+ </child>
+
+ <widget>
+ <class>GtkCList</class>
+ <name>clist1</name>
+ <can_focus>True</can_focus>
+ <signal>
+ <name>event</name>
+ <handler>on_clist1_event</handler>
+ <last_modification_time>Thu, 08 Mar 2001 10:14:05 GMT</last_modification_time>
+ </signal>
+ <signal>
+ <name>drag_data_received</name>
+ <handler>on_intf_playlist_drag_data_received</handler>
+ <last_modification_time>Thu, 08 Mar 2001 12:00:13 GMT</last_modification_time>
+ </signal>
+ <columns>2</columns>
+ <column_widths>257,80</column_widths>
+ <selection_mode>GTK_SELECTION_EXTENDED</selection_mode>
+ <show_titles>False</show_titles>
+ <shadow_type>GTK_SHADOW_IN</shadow_type>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>CList:title</child_name>
+ <name>label22</name>
+ <label>File</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+
+ <widget>
+ <class>GtkLabel</class>
+ <child_name>CList:title</child_name>
+ <name>label23</name>
+ <label>Duration</label>
+ <justify>GTK_JUSTIFY_CENTER</justify>
+ <wrap>False</wrap>
+ <xalign>0.5</xalign>
+ <yalign>0.5</yalign>
+ <xpad>0</xpad>
+ <ypad>0</ypad>
+ </widget>
+ </widget>
+ </widget>
+ </widget>
+</widget>
+
</GTK-Interface>
p_playlist->p_item[ i_index ] = p_playlist->p_item[ i_index + 1 ];
}
+ if( i_pos < p_playlist->i_index )
+ p_playlist->i_index--;
+
+
/* Decrement playlist size */
p_playlist->i_size--;
p_playlist->p_item = realloc( p_playlist->p_item,
p_playlist->i_size * sizeof( playlist_item_t ) );
intf_WarnMsg( 1, "intf: removed %s from playlist", psz_name );
+
/* Delete the item */
free( psz_name );
intf_WarnMsg( 1, "intf: playlist destroyed" );
}
+void intf_PlstJumpto( playlist_t * p_playlist , int i_pos)
+{
+ vlc_mutex_lock( &p_playlist->change_lock );
+
+ p_playlist->i_index = i_pos;
+
+ if( p_playlist->i_index != -1 )
+ {
+ if( p_playlist->current.psz_name != NULL )
+ {
+ free( p_playlist->current.psz_name );
+ }
+ p_playlist->current = p_playlist->p_item[ p_playlist->i_index ];
+ p_playlist->current.psz_name
+ = strdup( p_playlist->current.psz_name );
+ }
+
+ vlc_mutex_unlock( &p_playlist->change_lock );
+}
+
/*****************************************************************************
* Following functions are local
--- /dev/null
+/* Copyright (C) 1999, 2000 VideoLAN
+ * Copyright (C) 1998-2000 Peter Alm, Mikael Alm, Olle Hallnas, Thomas Nilsson and 4Front Technologies
+ *
+ * Code borrowed from xmms 1.2.4
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public Licensse 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-1307, USA.
+ */
+
+#include "intf_urldecode.h"
+#include <malloc.h>
+#include <string.h>
+#include <stdio.h>
+
+/* URL-decode a file: URL path, return NULL if it's not what we expect */
+void urldecode_path(char *encoded_path)
+{
+ char *tmp = NULL, *cur = NULL, *ext = NULL;
+ int realchar;
+
+
+ if (!encoded_path || *encoded_path == '\0' )
+ return;
+
+ cur = encoded_path ;
+
+ tmp = calloc(strlen(encoded_path) + 1, sizeof(char) );
+
+
+ while ( ( ext = strchr(cur, '%') ) != NULL)
+ {
+ strncat(tmp, cur, (ext - cur) / sizeof(char));
+ ext++;
+
+ if (!sscanf(ext, "%2x", &realchar))
+ {
+ free(tmp);
+ return;
+ }
+
+ tmp[strlen(tmp)] = (char)realchar;
+
+ cur = ext + 2;
+ }
+ strcat(tmp, cur);
+ strcpy(encoded_path,tmp);
+}