Commit 585b6ad7 authored by Pierre Baillet's avatar Pierre Baillet

Hurg !

###code is dirty###
Please clean it for me :P
(or at least, tell me how to clean it)

. Slightly modified playlist base interface
  (Added a function to jump directly to an item, used for double clicking)

. Added manymanycallbacks
. Added the playlist dialog
. Added Dnd support for intf_window and the clist1
  . support URI and plain file(s)/folder(s)
. Added "show/hide main window" menuitem in intf_popup
. Added bugs :P

Enjoy and please bug report.
parent 022b6f08
...@@ -192,7 +192,8 @@ INTERFACE = src/interface/main.o \ ...@@ -192,7 +192,8 @@ INTERFACE = src/interface/main.o \
src/interface/intf_ctrl.o \ src/interface/intf_ctrl.o \
src/interface/intf_plst.o \ src/interface/intf_plst.o \
src/interface/intf_channels.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 \ INPUT = src/input/input_ext-dec.o \
src/input/input_ext-intf.o \ src/input/input_ext-intf.o \
...@@ -324,7 +325,8 @@ PLUGIN_GTK = plugins/gtk/gtk.o \ ...@@ -324,7 +325,8 @@ PLUGIN_GTK = plugins/gtk/gtk.o \
plugins/gtk/intf_gtk.o \ plugins/gtk/intf_gtk.o \
plugins/gtk/gtk_callbacks.o \ plugins/gtk/gtk_callbacks.o \
plugins/gtk/gtk_interface.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 \ PLUGIN_GNOME = plugins/gnome/gnome.o \
plugins/gnome/intf_gnome.o \ plugins/gnome/intf_gnome.o \
......
...@@ -1026,7 +1026,7 @@ else ...@@ -1026,7 +1026,7 @@ else
int main() { int main() {
/* Ultrix mips cc rejects this. */ /* 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. */ /* SunOS 4.1.1 cc rejects this. */
char const *const *ccp; char const *const *ccp;
char **p; char **p;
...@@ -1983,12 +1983,15 @@ else ...@@ -1983,12 +1983,15 @@ else
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.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. */ /* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE #ifndef HAVE_GETPAGESIZE
# ifdef HAVE_UNISTD_H
# include <unistd.h>
# endif
/* Assume that all systems that can run configure have sys/param.h. */ /* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H # ifndef HAVE_SYS_PARAM_H
...@@ -2043,7 +2046,7 @@ main() ...@@ -2043,7 +2046,7 @@ main()
/* /*
* First, make a file with some known garbage in it. * First, make a file with some known garbage in it.
*/ */
data = malloc(pagesize); data = (char*)malloc(pagesize);
if (!data) if (!data)
exit(1); exit(1);
for (i = 0; i < pagesize; ++i) for (i = 0; i < pagesize; ++i)
...@@ -2064,7 +2067,7 @@ main() ...@@ -2064,7 +2067,7 @@ main()
fd = open("conftestmmap", O_RDWR); fd = open("conftestmmap", O_RDWR);
if (fd < 0) if (fd < 0)
exit(1); exit(1);
data2 = malloc(2 * pagesize); data2 = (char*)malloc(2 * pagesize);
if (!data2) if (!data2)
exit(1); exit(1);
data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
...@@ -2082,7 +2085,7 @@ main() ...@@ -2082,7 +2085,7 @@ main()
*/ */
for (i = 0; i < pagesize; ++i) for (i = 0; i < pagesize; ++i)
*(data2 + i) = *(data2 + i) + 1; *(data2 + i) = *(data2 + i) + 1;
data3 = malloc(pagesize); data3 = (char*)malloc(pagesize);
if (!data3) if (!data3)
exit(1); exit(1);
if (read(fd, data3, pagesize) != pagesize) if (read(fd, data3, pagesize) != pagesize)
...@@ -2096,7 +2099,7 @@ main() ...@@ -2096,7 +2099,7 @@ main()
} }
EOF 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 then
ac_cv_func_mmap_fixed_mapped=yes ac_cv_func_mmap_fixed_mapped=yes
else else
...@@ -2119,12 +2122,12 @@ EOF ...@@ -2119,12 +2122,12 @@ EOF
fi fi
echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2128 "configure" #line 2131 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
...@@ -2141,7 +2144,7 @@ int main() { ...@@ -2141,7 +2144,7 @@ int main() {
int i; int i;
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
ac_cv_type_signal=void ac_cv_type_signal=void
else else
...@@ -2160,7 +2163,7 @@ EOF ...@@ -2160,7 +2163,7 @@ EOF
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2168,7 +2171,7 @@ else ...@@ -2168,7 +2171,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS" LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2172 "configure" #line 2175 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2179,7 +2182,7 @@ int main() { ...@@ -2179,7 +2182,7 @@ int main() {
dlopen() dlopen()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2207,7 +2210,7 @@ else ...@@ -2207,7 +2210,7 @@ else
fi fi
echo $ac_n "checking for optarg in -lgnugetopt""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo gnugetopt'_'optarg | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2215,7 +2218,7 @@ else ...@@ -2215,7 +2218,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lgnugetopt $LIBS" LIBS="-lgnugetopt $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2219 "configure" #line 2222 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2226,7 +2229,7 @@ int main() { ...@@ -2226,7 +2229,7 @@ int main() {
optarg() optarg()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2254,7 +2257,7 @@ else ...@@ -2254,7 +2257,7 @@ else
fi fi
echo $ac_n "checking for _ in -lbe""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo be'_'_ | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2262,7 +2265,7 @@ else ...@@ -2262,7 +2265,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lbe $LIBS" LIBS="-lbe $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2266 "configure" #line 2269 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2273,7 +2276,7 @@ int main() { ...@@ -2273,7 +2276,7 @@ int main() {
_() _()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2301,7 +2304,7 @@ else ...@@ -2301,7 +2304,7 @@ else
fi fi
echo $ac_n "checking for _ in -lgame""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo game'_'_ | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2309,7 +2312,7 @@ else ...@@ -2309,7 +2312,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lgame $LIBS" LIBS="-lgame $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2313 "configure" #line 2316 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2320,7 +2323,7 @@ int main() { ...@@ -2320,7 +2323,7 @@ int main() {
_() _()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2348,7 +2351,7 @@ else ...@@ -2348,7 +2351,7 @@ else
fi fi
echo $ac_n "checking for _ in -lroot""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo root'_'_ | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2356,7 +2359,7 @@ else ...@@ -2356,7 +2359,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lroot $LIBS" LIBS="-lroot $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2360 "configure" #line 2363 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2367,7 +2370,7 @@ int main() { ...@@ -2367,7 +2370,7 @@ int main() {
_() _()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2395,7 +2398,7 @@ else ...@@ -2395,7 +2398,7 @@ else
fi fi
echo $ac_n "checking for powl in -lm""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo m'_'powl | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2403,7 +2406,7 @@ else ...@@ -2403,7 +2406,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lm $LIBS" LIBS="-lm $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2407 "configure" #line 2410 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2414,7 +2417,7 @@ int main() { ...@@ -2414,7 +2417,7 @@ int main() {
powl() powl()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2442,7 +2445,7 @@ else ...@@ -2442,7 +2445,7 @@ else
fi fi
echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2450,7 +2453,7 @@ else ...@@ -2450,7 +2453,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lpthread $LIBS" LIBS="-lpthread $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2454 "configure" #line 2457 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2461,7 +2464,7 @@ int main() { ...@@ -2461,7 +2464,7 @@ int main() {
pthread_create() pthread_create()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2489,7 +2492,7 @@ else ...@@ -2489,7 +2492,7 @@ else
fi fi
echo $ac_n "checking for thread_create in -lthreads""... $ac_c" 1>&6 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_%'` ac_lib_var=`echo threads'_'thread_create | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -2497,7 +2500,7 @@ else ...@@ -2497,7 +2500,7 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lthreads $LIBS" LIBS="-lthreads $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2501 "configure" #line 2504 "configure"
#include "confdefs.h" #include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error. */ /* Override any gcc2 internal prototype to avoid an error. */
/* We use char because int might match the return type of a gcc2 /* We use char because int might match the return type of a gcc2
...@@ -2508,7 +2511,7 @@ int main() { ...@@ -2508,7 +2511,7 @@ int main() {
thread_create() thread_create()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
...@@ -2537,12 +2540,12 @@ fi ...@@ -2537,12 +2540,12 @@ fi
echo $ac_n "checking for getopt_long""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_func_getopt_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2546 "configure" #line 2549 "configure"
#include "confdefs.h" #include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes, /* System header to define __stub macros and hopefully few prototypes,
which can conflict with char getopt_long(); below. */ which can conflict with char getopt_long(); below. */
...@@ -2565,7 +2568,7 @@ getopt_long(); ...@@ -2565,7 +2568,7 @@ getopt_long();
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_func_getopt_long=yes" eval "ac_cv_func_getopt_long=yes"
else else
...@@ -2592,17 +2595,17 @@ for ac_hdr in stddef.h ...@@ -2592,17 +2595,17 @@ for ac_hdr in stddef.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2601 "configure" #line 2604 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2632,17 +2635,17 @@ for ac_hdr in getopt.h ...@@ -2632,17 +2635,17 @@ for ac_hdr in getopt.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2641 "configure" #line 2644 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2672,17 +2675,17 @@ for ac_hdr in sys/sockio.h ...@@ -2672,17 +2675,17 @@ for ac_hdr in sys/sockio.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2681 "configure" #line 2684 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2712,17 +2715,17 @@ for ac_hdr in fcntl.h sys/time.h unistd.h ...@@ -2712,17 +2715,17 @@ for ac_hdr in fcntl.h sys/time.h unistd.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2721 "configure" #line 2724 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2752,17 +2755,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h ...@@ -2752,17 +2755,17 @@ for ac_hdr in sys/soundcard.h machine/soundcard.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2761 "configure" #line 2764 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2792,17 +2795,17 @@ for ac_hdr in dlfcn.h image.h ...@@ -2792,17 +2795,17 @@ for ac_hdr in dlfcn.h image.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2801 "configure" #line 2804 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2832,17 +2835,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h ...@@ -2832,17 +2835,17 @@ for ac_hdr in arpa/inet.h net/if.h netinet/in.h sys/socket.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2841 "configure" #line 2844 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2872,17 +2875,17 @@ for ac_hdr in machine/param.h ...@@ -2872,17 +2875,17 @@ for ac_hdr in machine/param.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2881 "configure" #line 2884 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2913,17 +2916,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h ...@@ -2913,17 +2916,17 @@ for ac_hdr in cthreads.h pthread.h kernel/scheduler.h kernel/OS.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 2922 "configure" #line 2925 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -2954,9 +2957,9 @@ save_CFLAGS=$CFLAGS ...@@ -2954,9 +2957,9 @@ save_CFLAGS=$CFLAGS
CFLAGS="${CFLAGS} -Wall -Werror" CFLAGS="${CFLAGS} -Wall -Werror"
echo $ac_n "checking for ntohl in sys/param.h""... $ac_c" 1>&6 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 cat > conftest.$ac_ext <<EOF
#line 2960 "configure" #line 2963 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/param.h> #include <sys/param.h>
void foo() { int meuh; ntohl(meuh); } void foo() { int meuh; ntohl(meuh); }
...@@ -2964,7 +2967,7 @@ int main() { ...@@ -2964,7 +2967,7 @@ int main() {
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define NTOHL_IN_SYS_PARAM_H 1 #define NTOHL_IN_SYS_PARAM_H 1
...@@ -2981,16 +2984,16 @@ rm -f conftest* ...@@ -2981,16 +2984,16 @@ rm -f conftest*
CFLAGS="${CFLAGS} -rdynamic" CFLAGS="${CFLAGS} -rdynamic"
echo $ac_n "checking if \$CC accepts -rdynamic""... $ac_c" 1>&6 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 cat > conftest.$ac_ext <<EOF
#line 2987 "configure" #line 2990 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
DYNAMIC_FLAG="-rdynamic" DYNAMIC_FLAG="-rdynamic"
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
...@@ -3005,9 +3008,9 @@ rm -f conftest* ...@@ -3005,9 +3008,9 @@ rm -f conftest*
CFLAGS=$save_CFLAGS CFLAGS=$save_CFLAGS
echo $ac_n "checking for boolean_t in sys/types.h""... $ac_c" 1>&6 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 cat > conftest.$ac_ext <<EOF
#line 3011 "configure" #line 3014 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
void quux() { boolean_t foo; } void quux() { boolean_t foo; }
...@@ -3015,7 +3018,7 @@ int main() { ...@@ -3015,7 +3018,7 @@ int main() {
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
cat >> confdefs.h <<\EOF cat >> confdefs.h <<\EOF
#define BOOLEAN_T_IN_SYS_TYPES_H 1 #define BOOLEAN_T_IN_SYS_TYPES_H 1
...@@ -3031,18 +3034,18 @@ fi ...@@ -3031,18 +3034,18 @@ fi
rm -f conftest* rm -f conftest*
echo $ac_n "checking for working const""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3040 "configure" #line 3043 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
/* Ultrix mips cc rejects this. */ /* 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. */ /* SunOS 4.1.1 cc rejects this. */
char const *const *ccp; char const *const *ccp;
char **p; char **p;
...@@ -3085,7 +3088,7 @@ ccp = (char const *const *) p; ...@@ -3085,7 +3088,7 @@ ccp = (char const *const *) p;
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
ac_cv_c_const=yes ac_cv_c_const=yes
else else
...@@ -3106,12 +3109,12 @@ EOF ...@@ -3106,12 +3109,12 @@ EOF
fi fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3115 "configure" #line 3118 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
...@@ -3119,7 +3122,7 @@ else ...@@ -3119,7 +3122,7 @@ else
#include <float.h> #include <float.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3136,7 +3139,7 @@ rm -f conftest* ...@@ -3136,7 +3139,7 @@ rm -f conftest*
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI. # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3140 "configure" #line 3143 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <string.h> #include <string.h>
EOF EOF
...@@ -3154,7 +3157,7 @@ fi ...@@ -3154,7 +3157,7 @@ fi
if test $ac_cv_header_stdc = yes; then if test $ac_cv_header_stdc = yes; then
# ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3158 "configure" #line 3161 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <stdlib.h> #include <stdlib.h>
EOF EOF
...@@ -3175,7 +3178,7 @@ if test "$cross_compiling" = yes; then ...@@ -3175,7 +3178,7 @@ if test "$cross_compiling" = yes; then
: :
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3179 "configure" #line 3182 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <ctype.h> #include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') #define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
...@@ -3186,7 +3189,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); ...@@ -3186,7 +3189,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); } exit (0); }
EOF 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 then
: :
else else
...@@ -3210,12 +3213,12 @@ EOF ...@@ -3210,12 +3213,12 @@ EOF
fi fi
echo $ac_n "checking for size_t""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3219 "configure" #line 3222 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#if STDC_HEADERS #if STDC_HEADERS
...@@ -3243,12 +3246,12 @@ EOF ...@@ -3243,12 +3246,12 @@ EOF
fi fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3252 "configure" #line 3255 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/types.h> #include <sys/types.h>
#include <sys/time.h> #include <sys/time.h>
...@@ -3257,7 +3260,7 @@ int main() { ...@@ -3257,7 +3260,7 @@ int main() {
struct tm *tp; struct tm *tp;
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
ac_cv_header_time=yes ac_cv_header_time=yes
else else
...@@ -3289,17 +3292,17 @@ for ac_hdr in sys/ioctl.h ...@@ -3289,17 +3292,17 @@ for ac_hdr in sys/ioctl.h
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3298 "configure" #line 3301 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3324,17 +3327,17 @@ EOF ...@@ -3324,17 +3327,17 @@ EOF
do do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3333 "configure" #line 3336 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <$ac_hdr> #include <$ac_hdr>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3361,7 +3364,7 @@ fi ...@@ -3361,7 +3364,7 @@ fi
done done
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3365 "configure" #line 3368 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <linux/cdrom.h> #include <linux/cdrom.h>
EOF EOF
...@@ -3563,17 +3566,17 @@ if test "${enable_alsa+set}" = set; then ...@@ -3563,17 +3566,17 @@ if test "${enable_alsa+set}" = set; then
enableval="$enable_alsa" enableval="$enable_alsa"
if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'` 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 $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 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3572 "configure" #line 3575 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <sys/asoundlib.h> #include <sys/asoundlib.h>
EOF EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" 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}\$"` ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then if test -z "$ac_err"; then
rm -rf conftest* rm -rf conftest*
...@@ -3590,7 +3593,7 @@ fi ...@@ -3590,7 +3593,7 @@ fi
if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
echo "$ac_t""yes" 1>&6 echo "$ac_t""yes" 1>&6
echo $ac_n "checking for main in -lasound""... $ac_c" 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_%'` ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
...@@ -3598,14 +3601,14 @@ else ...@@ -3598,14 +3601,14 @@ else
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="-lasound $LIBS" LIBS="-lasound $LIBS"
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 3602 "configure" #line 3605 "configure"
#include "confdefs.h" #include "confdefs.h"
int main() { int main() {
main() main()
; return 0; } ; return 0; }
EOF 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* rm -rf conftest*
eval "ac_cv_lib_$ac_lib_var=yes" eval "ac_cv_lib_$ac_lib_var=yes"
else else
......
...@@ -71,7 +71,9 @@ playlist_t * intf_PlstCreate ( void ); ...@@ -71,7 +71,9 @@ playlist_t * intf_PlstCreate ( void );
void intf_PlstInit ( playlist_t * p_playlist ); void intf_PlstInit ( playlist_t * p_playlist );
int intf_PlstAdd ( playlist_t * p_playlist, int intf_PlstAdd ( playlist_t * p_playlist,
int i_pos, char * psz_item ); 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_PlstNext ( playlist_t * p_playlist );
void intf_PlstPrev ( playlist_t * p_playlist ); void intf_PlstPrev ( playlist_t * p_playlist );
void intf_PlstDestroy ( playlist_t * p_playlist ); void intf_PlstDestroy ( playlist_t * p_playlist );
void intf_PlstJumpto ( playlist_t * p_playlist , int i_pos);
/*
* 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 *);
...@@ -33,6 +33,8 @@ ...@@ -33,6 +33,8 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <string.h>
#include "config.h" #include "config.h"
#include "common.h" #include "common.h"
#include "threads.h" #include "threads.h"
...@@ -52,6 +54,14 @@ ...@@ -52,6 +54,14 @@
#include "main.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 * Inline function to retrieve the interface structure
*****************************************************************************/ *****************************************************************************/
...@@ -92,24 +102,6 @@ on_menubar_exit_activate (GtkMenuItem *menuitem, ...@@ -92,24 +102,6 @@ on_menubar_exit_activate (GtkMenuItem *menuitem,
p_intf->b_die = 1; 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 void
on_menubar_preferences_activate (GtkMenuItem *menuitem, on_menubar_preferences_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
...@@ -195,24 +187,6 @@ on_toolbar_pause_clicked (GtkButton *button, ...@@ -195,24 +187,6 @@ on_toolbar_pause_clicked (GtkButton *button,
} }
} }
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 void
on_toolbar_prev_clicked (GtkButton *button, on_toolbar_prev_clicked (GtkButton *button,
gpointer user_data) gpointer user_data)
...@@ -278,19 +252,6 @@ on_popup_exit_activate (GtkMenuItem *menuitem, ...@@ -278,19 +252,6 @@ on_popup_exit_activate (GtkMenuItem *menuitem,
p_intf->b_die = 1; 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 void
on_fileopen_ok_clicked (GtkButton *button, on_fileopen_ok_clicked (GtkButton *button,
gpointer user_data) gpointer user_data)
...@@ -358,26 +319,6 @@ on_popup_about_activate (GtkMenuItem *menuitem, ...@@ -358,26 +319,6 @@ on_popup_about_activate (GtkMenuItem *menuitem,
gtk_widget_show( p_intf->p_sys->p_about ); gtk_widget_show( p_intf->p_sys->p_about );
gdk_window_raise( p_intf->p_sys->p_about->window ); 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 void
on_popup_slow_activate (GtkMenuItem *menuitem, on_popup_slow_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
...@@ -508,17 +449,6 @@ on_modules_cancel_clicked (GtkButton *button, ...@@ -508,17 +449,6 @@ on_modules_cancel_clicked (GtkButton *button,
gtk_widget_hide( p_intf->p_sys->p_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 void
on_menubar_modules_activate (GtkMenuItem *menuitem, on_menubar_modules_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
...@@ -546,45 +476,16 @@ on_intf_window_drag_data_received (GtkWidget *widget, ...@@ -546,45 +476,16 @@ on_intf_window_drag_data_received (GtkWidget *widget,
guint time, guint time,
gpointer user_data) gpointer user_data)
{ {
char *psz_text = data->data; intf_thread_t * p_intf = GetIntf( GTK_WIDGET(widget), "intf_window" );
int i_len = strlen( psz_text ); on_generic_drop_data_received( p_intf, data, info, 0);
if( p_intf->p_input != NULL )
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; /* FIXME: temporary hack */
p_intf->p_input->b_eof = 1;
} }
/* get rid of \r\n at the end */ intf_PlstJumpto( p_main->p_playlist, -1 );
*( 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;
}
} }
...@@ -734,7 +635,6 @@ on_popup_disc_activate (GtkMenuItem *menuitem, ...@@ -734,7 +635,6 @@ on_popup_disc_activate (GtkMenuItem *menuitem,
gdk_window_raise( p_intf->p_sys->p_disc->window ); gdk_window_raise( p_intf->p_sys->p_disc->window );
} }
void void
on_popup_audio_activate (GtkMenuItem *menuitem, on_popup_audio_activate (GtkMenuItem *menuitem,
gpointer user_data) gpointer user_data)
...@@ -831,3 +731,36 @@ on_menubar_chapter_activate (GtkMenuItem *menuitem, ...@@ -831,3 +731,36 @@ on_menubar_chapter_activate (GtkMenuItem *menuitem,
p_intf->p_input->pf_set_area( p_intf->p_input, (input_area_t*)p_area ); 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 ); 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> #include <gtk/gtk.h>
/* General glade callbacks */
void
on_intf_window_destroy (GtkObject *object,
gpointer user_data);
void void
on_intf_window_drag_data_received (GtkWidget *widget, on_intf_window_drag_data_received (GtkWidget *widget,
...@@ -213,3 +210,61 @@ on_menubar_title_activate (GtkMenuItem *menuitem, ...@@ -213,3 +210,61 @@ on_menubar_title_activate (GtkMenuItem *menuitem,
void void
on_menubar_chapter_activate (GtkMenuItem *menuitem, on_menubar_chapter_activate (GtkMenuItem *menuitem,
gpointer user_data); 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);
...@@ -232,7 +232,6 @@ create_intf_window (void) ...@@ -232,7 +232,6 @@ create_intf_window (void)
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (menubar_playlist); gtk_widget_show (menubar_playlist);
gtk_container_add (GTK_CONTAINER (menubar_view_menu), 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); gtk_tooltips_set_tip (tooltips, menubar_playlist, _("Open the playlist window"), NULL);
menubar_modules = gtk_menu_item_new_with_label (""); menubar_modules = gtk_menu_item_new_with_label ("");
...@@ -473,7 +472,6 @@ create_intf_window (void) ...@@ -473,7 +472,6 @@ create_intf_window (void)
gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_playlist", toolbar_playlist, gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_playlist", toolbar_playlist,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
gtk_widget_show (toolbar_playlist); gtk_widget_show (toolbar_playlist);
gtk_widget_set_sensitive (toolbar_playlist, FALSE);
toolbar_prev = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), toolbar_prev = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
GTK_TOOLBAR_CHILD_BUTTON, GTK_TOOLBAR_CHILD_BUTTON,
...@@ -539,12 +537,12 @@ create_intf_window (void) ...@@ -539,12 +537,12 @@ create_intf_window (void)
gtk_widget_show (statusbar1); gtk_widget_show (statusbar1);
gtk_box_pack_end (GTK_BOX (vbox2), statusbar1, FALSE, TRUE, 0); 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_connect (GTK_OBJECT (intf_window), "drag_data_received",
GTK_SIGNAL_FUNC (on_intf_window_drag_data_received), GTK_SIGNAL_FUNC (on_intf_window_drag_data_received),
NULL); 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_connect (GTK_OBJECT (menubar_open), "activate",
GTK_SIGNAL_FUNC (on_menubar_open_activate), GTK_SIGNAL_FUNC (on_menubar_open_activate),
NULL); NULL);
...@@ -632,6 +630,7 @@ create_intf_popup (void) ...@@ -632,6 +630,7 @@ create_intf_popup (void)
GtkWidget *popup_audio; GtkWidget *popup_audio;
GtkWidget *popup_subpictures; GtkWidget *popup_subpictures;
GtkWidget *separator9; GtkWidget *separator9;
GtkWidget *main_window_toggle;
GtkWidget *popup_about; GtkWidget *popup_about;
GtkWidget *popup_exit; GtkWidget *popup_exit;
GtkTooltips *tooltips; GtkTooltips *tooltips;
...@@ -762,6 +761,17 @@ create_intf_popup (void) ...@@ -762,6 +761,17 @@ create_intf_popup (void)
gtk_container_add (GTK_CONTAINER (intf_popup), separator9); gtk_container_add (GTK_CONTAINER (intf_popup), separator9);
gtk_widget_set_sensitive (separator9, FALSE); 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 (""); popup_about = gtk_menu_item_new_with_label ("");
tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_about)->child), tmp_key = gtk_label_parse_uline (GTK_LABEL (GTK_BIN (popup_about)->child),
_("_About...")); _("_About..."));
...@@ -802,6 +812,9 @@ create_intf_popup (void) ...@@ -802,6 +812,9 @@ create_intf_popup (void)
gtk_signal_connect (GTK_OBJECT (popup_disc), "activate", gtk_signal_connect (GTK_OBJECT (popup_disc), "activate",
GTK_SIGNAL_FUNC (on_popup_disc_activate), GTK_SIGNAL_FUNC (on_popup_disc_activate),
NULL); 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_connect (GTK_OBJECT (popup_about), "activate",
GTK_SIGNAL_FUNC (on_popup_about_activate), GTK_SIGNAL_FUNC (on_popup_about_activate),
NULL); NULL);
...@@ -870,7 +883,7 @@ create_intf_about (void) ...@@ -870,7 +883,7 @@ create_intf_about (void)
gtk_widget_show (frame1); gtk_widget_show (frame1);
gtk_box_pack_start (GTK_BOX (vbox3), frame1, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox3), frame1, FALSE, FALSE, 0);
label16 = gtk_label_new (_("Rgis 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>\nGal Hendryckx <jimmy@via.ecp.fr>\nSamuel Hocevar <sam@zoy.org>\nBrieuc Jeunhomme <bbp@via.ecp.fr>\nMichel Kaempf <maxx@via.ecp.fr>\nStphane 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_widget_ref (label16);
gtk_object_set_data_full (GTK_OBJECT (intf_about), "label16", label16, gtk_object_set_data_full (GTK_OBJECT (intf_about), "label16", label16,
(GtkDestroyNotify) gtk_widget_unref); (GtkDestroyNotify) gtk_widget_unref);
...@@ -1150,3 +1163,128 @@ create_intf_disc (void) ...@@ -1150,3 +1163,128 @@ create_intf_disc (void)
return intf_disc; 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;
}
...@@ -7,3 +7,4 @@ GtkWidget* create_intf_popup (void); ...@@ -7,3 +7,4 @@ GtkWidget* create_intf_popup (void);
GtkWidget* create_intf_about (void); GtkWidget* create_intf_about (void);
GtkWidget* create_intf_fileopen (void); GtkWidget* create_intf_fileopen (void);
GtkWidget* create_intf_disc (void); GtkWidget* create_intf_disc (void);
GtkWidget* create_intf_playlist (void);
/*****************************************************************************
* 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 );
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* gtk_sys.h: private Gtk+ interface description * gtk_sys.h: private Gtk+ interface description
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Samuel Hocevar <sam@zoy.org>
* *
...@@ -43,6 +43,10 @@ typedef struct intf_sys_s ...@@ -43,6 +43,10 @@ typedef struct intf_sys_s
/* intf_Manage callback timeout */ /* intf_Manage callback timeout */
int i_timeout; int i_timeout;
int i_list_timeout;
/* Playlist selected item */
int i_playing;
/* windows and widgets */ /* windows and widgets */
GtkWidget * p_window; /* main window */ GtkWidget * p_window; /* main window */
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf_gtk.c: Gtk+ interface * intf_gtk.c: Gtk+ interface
***************************************************************************** *****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN * 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> * Authors: Samuel Hocevar <sam@zoy.org>
* Stphane Borel <stef@via.ecp.fr> * Stphane Borel <stef@via.ecp.fr>
...@@ -72,6 +72,7 @@ static gint GtkChapterMenu ( gpointer, GtkWidget *, ...@@ -72,6 +72,7 @@ static gint GtkChapterMenu ( gpointer, GtkWidget *,
void (*pf_activate)(GtkMenuItem *, gpointer) ); void (*pf_activate)(GtkMenuItem *, gpointer) );
static gint GtkTitleMenu ( gpointer, GtkWidget *, static gint GtkTitleMenu ( gpointer, GtkWidget *,
void (*pf_activate)(GtkMenuItem *, gpointer) ); void (*pf_activate)(GtkMenuItem *, gpointer) );
void GtkPlayListManage( gpointer p_data );
/***************************************************************************** /*****************************************************************************
...@@ -147,6 +148,9 @@ static int intf_Open( intf_thread_t *p_intf ) ...@@ -147,6 +148,9 @@ static int intf_Open( intf_thread_t *p_intf )
p_intf->p_sys->b_menus_update = 1; p_intf->p_sys->b_menus_update = 1;
p_intf->p_sys->b_scale_isfree = 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_gtk_callback = NULL;
p_intf->p_sys->pf_gdk_callback = NULL; p_intf->p_sys->pf_gdk_callback = NULL;
...@@ -183,6 +187,7 @@ static void intf_Run( intf_thread_t *p_intf ) ...@@ -183,6 +187,7 @@ static void intf_Run( intf_thread_t *p_intf )
char *p_args[] = { "" }; char *p_args[] = { "" };
char **pp_args = p_args; char **pp_args = p_args;
int i_args = 1; int i_args = 1;
GtkWidget * temp;
/* The data types we are allowed to receive */ /* The data types we are allowed to receive */
static GtkTargetEntry target_table[] = static GtkTargetEntry target_table[] =
...@@ -197,6 +202,7 @@ static void intf_Run( intf_thread_t *p_intf ) ...@@ -197,6 +202,7 @@ static void intf_Run( intf_thread_t *p_intf )
/* Create some useful widgets that will certainly be used */ /* Create some useful widgets that will certainly be used */
p_intf->p_sys->p_window = create_intf_window( ); p_intf->p_sys->p_window = create_intf_window( );
p_intf->p_sys->p_popup = create_intf_popup( ); 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 */ /* Set the title of the main window */
gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window), gtk_window_set_title( GTK_WINDOW(p_intf->p_sys->p_window),
...@@ -207,9 +213,14 @@ static void intf_Run( intf_thread_t *p_intf ) ...@@ -207,9 +213,14 @@ static void intf_Run( intf_thread_t *p_intf )
GTK_DEST_DEFAULT_ALL, target_table, GTK_DEST_DEFAULT_ALL, target_table,
1, GDK_ACTION_COPY ); 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 */ /* 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_about = NULL;
p_intf->p_sys->p_playlist = NULL;
p_intf->p_sys->p_modules = NULL; p_intf->p_sys->p_modules = NULL;
p_intf->p_sys->p_fileopen = NULL; p_intf->p_sys->p_fileopen = NULL;
p_intf->p_sys->p_disc = NULL; p_intf->p_sys->p_disc = NULL;
...@@ -221,6 +232,11 @@ static void intf_Run( intf_thread_t *p_intf ) ...@@ -221,6 +232,11 @@ static void intf_Run( intf_thread_t *p_intf )
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_popup), gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_popup),
"p_intf", p_intf ); "p_intf", p_intf );
gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_playlist),
"p_intf", p_intf );
/* Show the control window */ /* Show the control window */
gtk_widget_show( p_intf->p_sys->p_window ); gtk_widget_show( p_intf->p_sys->p_window );
...@@ -254,12 +270,16 @@ static void intf_Run( intf_thread_t *p_intf ) ...@@ -254,12 +270,16 @@ static void intf_Run( intf_thread_t *p_intf )
* In this function, called approx. 10 times a second, we check what the * In this function, called approx. 10 times a second, we check what the
* main program wanted to tell us. * main program wanted to tell us.
*****************************************************************************/ *****************************************************************************/
static gint GtkManage( gpointer p_data ) static gint GtkManage( gpointer p_data )
{ {
intf_thread_t *p_intf = (void *)p_data; intf_thread_t *p_intf = (void *)p_data;
GtkPlayListManage( p_data );
vlc_mutex_lock( &p_intf->p_sys->change_lock ); vlc_mutex_lock( &p_intf->p_sys->change_lock );
/* If the "display popup" flag has changed */ /* If the "display popup" flag has changed */
if( p_intf->b_menu_change ) if( p_intf->b_menu_change )
{ {
...@@ -371,6 +391,7 @@ static gint GtkManage( gpointer p_data ) ...@@ -371,6 +391,7 @@ static gint GtkManage( gpointer p_data )
gtk_range_draw_background ( GTK_RANGE( p_scale ) ); gtk_range_draw_background ( GTK_RANGE( p_scale ) );
} }
/* Manage core vlc functions through the callback */ /* Manage core vlc functions through the callback */
p_intf->pf_manage( p_intf ); p_intf->pf_manage( p_intf );
......
...@@ -23,16 +23,16 @@ ...@@ -23,16 +23,16 @@
<widget> <widget>
<class>GtkWindow</class> <class>GtkWindow</class>
<name>intf_window</name> <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> <signal>
<name>drag_data_received</name> <name>drag_data_received</name>
<handler>on_intf_window_drag_data_received</handler> <handler>on_intf_window_drag_data_received</handler>
<last_modification_time>Fri, 16 Feb 2001 01:59:35 GMT</last_modification_time> <last_modification_time>Fri, 16 Feb 2001 01:59:35 GMT</last_modification_time>
</signal> </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> <title>VideoLAN Client</title>
<type>GTK_WINDOW_TOPLEVEL</type> <type>GTK_WINDOW_TOPLEVEL</type>
<position>GTK_WIN_POS_NONE</position> <position>GTK_WIN_POS_NONE</position>
...@@ -168,7 +168,6 @@ ...@@ -168,7 +168,6 @@
<widget> <widget>
<class>GtkMenuItem</class> <class>GtkMenuItem</class>
<name>menubar_playlist</name> <name>menubar_playlist</name>
<sensitive>False</sensitive>
<tooltip>Open the playlist window</tooltip> <tooltip>Open the playlist window</tooltip>
<signal> <signal>
<name>activate</name> <name>activate</name>
...@@ -414,7 +413,6 @@ ...@@ -414,7 +413,6 @@
<class>GtkButton</class> <class>GtkButton</class>
<child_name>Toolbar:button</child_name> <child_name>Toolbar:button</child_name>
<name>toolbar_playlist</name> <name>toolbar_playlist</name>
<sensitive>False</sensitive>
<tooltip>Open Playlist</tooltip> <tooltip>Open Playlist</tooltip>
<signal> <signal>
<name>clicked</name> <name>clicked</name>
...@@ -674,6 +672,18 @@ ...@@ -674,6 +672,18 @@
<right_justify>False</right_justify> <right_justify>False</right_justify>
</widget> </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> <widget>
<class>GtkMenuItem</class> <class>GtkMenuItem</class>
<name>popup_about</name> <name>popup_about</name>
...@@ -1264,4 +1274,140 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label> ...@@ -1264,4 +1274,140 @@ Henri Fallon &lt;henri@via.ecp.fr&gt;</label>
</widget> </widget>
</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> </GTK-Interface>
...@@ -197,6 +197,10 @@ int intf_PlstDelete( playlist_t * p_playlist, int i_pos ) ...@@ -197,6 +197,10 @@ int intf_PlstDelete( playlist_t * p_playlist, int i_pos )
p_playlist->p_item[ i_index ] = p_playlist->p_item[ i_index + 1 ]; 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 */ /* Decrement playlist size */
p_playlist->i_size--; p_playlist->i_size--;
p_playlist->p_item = realloc( p_playlist->p_item, p_playlist->p_item = realloc( p_playlist->p_item,
...@@ -204,6 +208,7 @@ int intf_PlstDelete( playlist_t * p_playlist, int i_pos ) ...@@ -204,6 +208,7 @@ int intf_PlstDelete( playlist_t * p_playlist, int i_pos )
intf_WarnMsg( 1, "intf: removed %s from playlist", psz_name ); intf_WarnMsg( 1, "intf: removed %s from playlist", psz_name );
/* Delete the item */ /* Delete the item */
free( psz_name ); free( psz_name );
...@@ -237,6 +242,26 @@ void intf_PlstDestroy( playlist_t * p_playlist ) ...@@ -237,6 +242,26 @@ void intf_PlstDestroy( playlist_t * p_playlist )
intf_WarnMsg( 1, "intf: playlist destroyed" ); 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 * Following functions are local
......
/* 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);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment