diff options
author | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-08-11 13:12:38 +0000 |
---|---|---|
committer | pontscho <pontscho@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2002-08-11 13:12:38 +0000 |
commit | 418dbef6efa7efd9ccd76bb1925f5eeaf5008b3e (patch) | |
tree | a0dd4ff3367cf1da204f5fb41029b790fdeec357 /Gui/mplayer/mw.h | |
parent | 0f7ec7d88544be01df6c6710f1ddb4a8df77c9d6 (diff) | |
download | mpv-418dbef6efa7efd9ccd76bb1925f5eeaf5008b3e.tar.bz2 mpv-418dbef6efa7efd9ccd76bb1925f5eeaf5008b3e.tar.xz |
add xdnd support (from Gregory Kovriga <gkovriga@techunix.technion.ac.il>) and fix -subdelay bug
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@6968 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'Gui/mplayer/mw.h')
-rw-r--r-- | Gui/mplayer/mw.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Gui/mplayer/mw.h b/Gui/mplayer/mw.h index 3bc29c01fd..bf86bd8edd 100644 --- a/Gui/mplayer/mw.h +++ b/Gui/mplayer/mw.h @@ -650,3 +650,45 @@ void mplMainKeyHandle( int KeyCode,int Type,int Key ) } if ( msg != evNone ) mplEventHandling( msg,0 ); } + +/* this will be used to handle Drag&Drop files */ +void mplDandDHandler(int num,const char** files) +{ + struct stat buf; + int f = 0; + + if (num <= 0) + return; + + /* clear playlist */ + gtkSet(gtkDelPl,0,NULL); + + /* now fill it with new items */ + for(f=0; f < num; f++){ + char* str = files[f]; + plItem* item; + if(stat(str,&buf) == 0 && S_ISDIR(buf.st_mode) == 0) { + /* this is not a directory so try to play it */ + printf("Received D&D %s\n",str); + item = calloc(1,sizeof(plItem)); + /* FIXME: decompose file name ? */ + /* yes -- Pontscho */ + if ( strrchr( str,'/' ) ) + { + char * t = strdup( str ); + char * s = strrchr( t,'/' ); *s=0; s++; + item->name = gstrdup( s ); + item->path = gstrdup( t ); + free( t ); + } else { item->name = strdup(str); item->path = strdup(""); } + gtkSet(gtkAddPlItem,0,(void*)item); + } else { + printf("Received not a file: %s !\n",str); + } + } + + mplSetFileName( NULL,files[0] ); + if ( guiIntfStruct.Playing == 1 ) mplEventHandling( evStop,0 ); + mplEventHandling( evPlay,0 ); + +} |