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 \
......
This diff is collapsed.
...@@ -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 ) {
{ /* FIXME: temporary hack */
case DROP_ACCEPT_TEXT_PLAIN: /* FIXME: handle multiple files */ p_intf->p_input->b_eof = 1;
}
if( i_len < 1 )
{ intf_PlstJumpto( p_main->p_playlist, -1 );
return;
}
/* get rid of ' ' at the end */
*( psz_text + i_len - 1 ) = 0;
intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'", psz_text );
intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_text );
break;
case DROP_ACCEPT_TEXT_URI_LIST: /* FIXME: handle multiple files */
if( i_len < 2 )
{
return;
}
/* get rid of \r\n at the end */
*( psz_text + i_len - 2 ) = 0;
intf_WarnMsg( 1, "intf: dropped text/uri-list data `%s'", psz_text );
intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, psz_text );
break;
default:
intf_ErrMsg( "intf error: unknown dropped type");
break;
}
} }
...@@ -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);
This diff is collapsed.
...@@ -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);
This diff is collapsed.
...@@ -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,12 +197,17 @@ int intf_PlstDelete( playlist_t * p_playlist, int i_pos ) ...@@ -197,12 +197,17 @@ 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,
p_playlist->i_size * sizeof( playlist_item_t ) ); p_playlist->i_size * sizeof( playlist_item_t ) );
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