From 02d21f72faf6bfb54119e2e28ac03d81682ec332 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 12 Feb 2001 00:20:37 +0000 Subject: [PATCH] * The pure Gnome part of the Gnome interface has been rewritten from scratch, and the .glade file included as well. You can edit it by installing glade-gnome and doing `glade plugins/gnome/intf_gnome.glade', or directly by hand if you grok XML. * Files can now be loaded into vlc using the `Open' buttons. But for the moment you still have to launch vlc with at least one file, because it quits when the end of the playlist is reached. * Idle screen was disabled because it eats a lot of CPU and is mostly useless for the moment. And it gets activated when pause lasts for too long. --- AUTHORS | 4 +- plugins/gnome/.cvsignore | 1 + plugins/gnome/gnome_callbacks.c | 444 ++++++------------ plugins/gnome/gnome_callbacks.h | 192 ++------ plugins/gnome/gnome_interface.c | 786 +++++++++----------------------- plugins/gnome/gnome_interface.h | 4 +- plugins/gnome/gnome_support.c | 3 + plugins/gnome/gnome_sys.h | 3 +- plugins/gnome/intf_gnome.c | 3 +- plugins/gnome/intf_gnome.glade | 527 +++++++++++++++++++++ plugins/sdl/vout_sdl.c | 59 ++- src/interface/interface.c | 8 +- src/video_output/video_output.c | 7 +- 13 files changed, 989 insertions(+), 1052 deletions(-) create mode 100644 plugins/gnome/.cvsignore create mode 100644 plugins/gnome/intf_gnome.glade diff --git a/AUTHORS b/AUTHORS index 17f3bfa2b6..24bda33fd5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,6 +1,6 @@ Régis Duchesne - Michel Lespinasse + Michel Lespinasse Olivier Pomel @@ -12,7 +12,7 @@ Jean-Marc Dressler Gaël Hendryckx - Samuel Hocevar + Samuel Hocevar Michel Kaempf diff --git a/plugins/gnome/.cvsignore b/plugins/gnome/.cvsignore new file mode 100644 index 0000000000..751553b3ac --- /dev/null +++ b/plugins/gnome/.cvsignore @@ -0,0 +1 @@ +*.bak diff --git a/plugins/gnome/gnome_callbacks.c b/plugins/gnome/gnome_callbacks.c index 36c299cf79..2475e1dcd4 100644 --- a/plugins/gnome/gnome_callbacks.c +++ b/plugins/gnome/gnome_callbacks.c @@ -1,65 +1,93 @@ +/***************************************************************************** + * gnome_callbacks.c : Callbacks for the Gnome plugin. + ***************************************************************************** + * Copyright (C) 2000, 2001 VideoLAN + * + * Authors: Samuel Hocevar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +/***************************************************************************** + * Preamble + *****************************************************************************/ #include "defs.h" +#include + #include "config.h" #include "common.h" #include "threads.h" #include "mtime.h" -#include - #include "stream_control.h" #include "input_ext-intf.h" #include "interface.h" +#include "intf_plst.h" #include "gnome_sys.h" #include "gnome_callbacks.h" #include "gnome_interface.h" #include "gnome_support.h" -#define GET_GNOME_STRUCT( item, parent ) \ -gtk_object_get_data( \ - GTK_OBJECT( lookup_widget(GTK_WIDGET(item), parent) ), \ - "p_intf" ); +#include "main.h" -void -on_modules_activate (GtkMenuItem *menuitem, - gpointer user_data) +/***************************************************************************** + * Inline function to retrieve the interface structure + *****************************************************************************/ +static __inline__ intf_thread_t * GetIntf( GtkWidget *item, char * psz_parent ) { - + return( gtk_object_get_data( GTK_OBJECT( lookup_widget(item, psz_parent) ), + "p_intf" ) ); } - +/***************************************************************************** + * Callbacks + ******************************************************************************/ void -on_exit_activate (GtkMenuItem *menuitem, +on_menubar_open_activate (GtkMenuItem *menuitem, gpointer user_data) { - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( menuitem, "intf_window" ); - - p_intf->b_die = 1; -} + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + /* If we have never used the file selector, open it */ + if( p_intf->p_sys->p_fileopen == NULL) + { + p_intf->p_sys->p_fileopen = create_intf_fileopen(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ), + "p_intf", p_intf ); + } -void -on_open_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - + gtk_widget_show( p_intf->p_sys->p_fileopen ); + gdk_window_raise( p_intf->p_sys->p_fileopen->window ); } void -on_preferences_activate (GtkMenuItem *menuitem, +on_menubar_exit_activate (GtkMenuItem *menuitem, gpointer user_data) { + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); + p_intf->b_die = 1; } void -on_plugins_activate (GtkMenuItem *menuitem, +on_menubar_playlist_activate (GtkMenuItem *menuitem, gpointer user_data) { @@ -67,258 +95,98 @@ on_plugins_activate (GtkMenuItem *menuitem, void -on_about_activate (GtkMenuItem *menuitem, +on_menubar_plugins_activate (GtkMenuItem *menuitem, gpointer user_data) { - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( menuitem, "intf_window" ); - if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) ) - { - p_intf->p_sys->p_about = create_intf_about (); - } - gtk_widget_show( p_intf->p_sys->p_about ); } void -on_stop_clicked (GtkButton *button, +on_menubar_preferences_activate (GtkMenuItem *menuitem, gpointer user_data) { - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( button, "intf_window" ); } void -on_control_activate (GtkMenuItem *menuitem, +on_menubar_about_activate (GtkMenuItem *menuitem, gpointer user_data) { - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( menuitem, "intf_window" ); + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_window" ); - /* lock the change structure */ - vlc_mutex_lock( &p_intf->p_sys->change_lock ); - - if( p_intf->p_sys->b_window ) - { - gtk_widget_hide( p_intf->p_sys->p_window ); - p_intf->p_sys->b_window = 0; - } - else + if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) ) { - if( !GTK_IS_WIDGET( p_intf->p_sys->p_window ) ) - { - p_intf->p_sys->p_window = create_intf_window (); - } - gtk_widget_show( p_intf->p_sys->p_window ); - gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window), - "p_intf", p_intf ); - p_intf->p_sys->b_window = 1; + p_intf->p_sys->p_about = create_intf_about(); } - - /* unlock the change structure */ - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + gtk_widget_show( p_intf->p_sys->p_about ); } void -on_playlist_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( menuitem, "intf_window" ); - - /* lock the change structure */ - vlc_mutex_lock( &p_intf->p_sys->change_lock ); - - if( p_intf->p_sys->b_playlist ) - { - gtk_widget_hide( p_intf->p_sys->p_playlist ); - p_intf->p_sys->b_playlist = 0; - } - else - { - if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) ) - { - p_intf->p_sys->p_playlist = create_intf_playlist (); - } - gtk_widget_show( p_intf->p_sys->p_playlist ); - gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_playlist), - "p_intf", p_intf ); - p_intf->p_sys->b_playlist = 1; - } - - /* unlock the change structure */ - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); -} - -void -on_popup_control_activate (GtkMenuItem *menuitem, +on_toolbar_open_clicked (GtkButton *button, gpointer user_data) { - intf_thread_t *p_intf; + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); - p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" ); - - /* lock the change structure */ - vlc_mutex_lock( &p_intf->p_sys->change_lock ); - - if( p_intf->p_sys->b_window ) - { - gtk_widget_hide( p_intf->p_sys->p_window ); - p_intf->p_sys->b_window = 0; - } - else + /* If we have never used the file selector, open it */ + if( p_intf->p_sys->p_fileopen == NULL) { - if( !GTK_IS_WIDGET( p_intf->p_sys->p_window ) ) - { - p_intf->p_sys->p_window = create_intf_window (); - } - gtk_widget_show( p_intf->p_sys->p_window ); - gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window), + p_intf->p_sys->p_fileopen = create_intf_fileopen(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ), "p_intf", p_intf ); - p_intf->p_sys->b_window = 1; } - /* unlock the change structure */ - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); + gtk_widget_show( p_intf->p_sys->p_fileopen ); + gdk_window_raise( p_intf->p_sys->p_fileopen->window ); } void -on_popup_playlist_activate (GtkMenuItem *menuitem, +on_toolbar_back_clicked (GtkButton *button, gpointer user_data) { - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" ); - - /* lock the change structure */ - vlc_mutex_lock( &p_intf->p_sys->change_lock ); - - if( p_intf->p_sys->b_playlist ) - { - gtk_widget_hide( p_intf->p_sys->p_playlist ); - p_intf->p_sys->b_playlist = 0; - } - else - { - if( !GTK_IS_WIDGET( p_intf->p_sys->p_playlist ) ) - { - p_intf->p_sys->p_playlist = create_intf_playlist (); - } - gtk_widget_show( p_intf->p_sys->p_playlist ); - gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_playlist), - "p_intf", p_intf ); - p_intf->p_sys->b_playlist = 1; - } - /* unlock the change structure */ - vlc_mutex_unlock( &p_intf->p_sys->change_lock ); } - void -on_popup_exit_activate (GtkMenuItem *menuitem, +on_toolbar_stop_clicked (GtkButton *button, gpointer user_data) { - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" ); - p_intf->b_die = 1; } void -on_popup_about_activate (GtkMenuItem *menuitem, +on_toolbar_play_clicked (GtkButton *button, gpointer user_data) { - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" ); + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); - if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) ) + if( p_intf->p_input != NULL ) { - p_intf->p_sys->p_about = create_intf_about (); + input_Play( p_intf->p_input ); } - gtk_widget_show( p_intf->p_sys->p_about ); -} - - -void -on_intf_window_destroy (GtkObject *object, - gpointer user_data) -{ - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( object, "intf_window" ); - - /* FIXME don't destroy the window, just hide it */ - p_intf->p_sys->p_window = NULL; - - p_intf->b_die = 1; -} - - -void -on_intf_playlist_destroy (GtkObject *object, - gpointer user_data) -{ - ; -} - - - -void -on_channel1_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - } void -on_channel2_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_channel3_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_channel4_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_channel5_activate (GtkMenuItem *menuitem, +on_toolbar_pause_clicked (GtkButton *button, gpointer user_data) { + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(button), "intf_window" ); + if( p_intf->p_input != NULL ) + { + input_Pause( p_intf->p_input ); + } } void -on_popup_channel1_activate (GtkMenuItem *menuitem, +on_toolbar_playlist_clicked (GtkButton *button, gpointer user_data) { @@ -326,7 +194,7 @@ on_popup_channel1_activate (GtkMenuItem *menuitem, void -on_popup_channel2_activate (GtkMenuItem *menuitem, +on_toolbar_prev_clicked (GtkButton *button, gpointer user_data) { @@ -334,7 +202,7 @@ on_popup_channel2_activate (GtkMenuItem *menuitem, void -on_popup_channel3_activate (GtkMenuItem *menuitem, +on_toolbar_next_clicked (GtkButton *button, gpointer user_data) { @@ -342,163 +210,115 @@ on_popup_channel3_activate (GtkMenuItem *menuitem, void -on_popup_channel4_activate (GtkMenuItem *menuitem, +on_popup_play_activate (GtkMenuItem *menuitem, gpointer user_data) { + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + if( p_intf->p_input != NULL ) + { + input_Play( p_intf->p_input ); + } } void -on_popup_channel5_activate (GtkMenuItem *menuitem, +on_popup_pause_activate (GtkMenuItem *menuitem, gpointer user_data) { + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + if( p_intf->p_input != NULL ) + { + input_Pause( p_intf->p_input ); + } } void -on_popup_config_channels_activate (GtkMenuItem *menuitem, +on_popup_exit_activate (GtkMenuItem *menuitem, gpointer user_data) { + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + p_intf->b_die = 1; } void -on_config_channels_activate (GtkMenuItem *menuitem, +on_intf_window_destroy (GtkObject *object, gpointer user_data) { + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_window" ); + /* FIXME don't destroy the window, just hide it */ + p_intf->b_die = 1; + p_intf->p_sys->p_window = NULL; } void -on_user_guide_activate (GtkMenuItem *menuitem, +on_fileopen_ok_clicked (GtkButton *button, gpointer user_data) { + GtkWidget *filesel; + gchar *filename; -} - - -void -on_popup_stop_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ + filesel = gtk_widget_get_toplevel (GTK_WIDGET (button)); + gtk_widget_hide (filesel); + filename = gtk_file_selection_get_filename (GTK_FILE_SELECTION (filesel)); + intf_PlstAdd( p_main->p_playlist, PLAYLIST_END, (char*)filename ); } void -on_popup_play_activate (GtkMenuItem *menuitem, +on_fileopen_cancel_clicked (GtkButton *button, gpointer user_data) { - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" ); - - input_Play( p_intf->p_input ); + gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); } void -on_playlist_close_clicked (GtkButton *button, +on_intf_fileopen_destroy (GtkObject *object, gpointer user_data) { + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(object), "intf_fileopen" ); + p_intf->p_sys->p_fileopen = NULL; } void -on_play_clicked (GtkButton *button, +on_popup_open_activate (GtkMenuItem *menuitem, gpointer user_data) { - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( button, "intf_window" ); - - input_Play( p_intf->p_input ); -} - + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); -void -on_channel0_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_popup_channel0_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - -} - - -void -on_open_clicked (GtkButton *button, - gpointer user_data) -{ - GnomeUIInfo test_uiinfo[] = + /* If we have never used the file selector, open it */ + if( p_intf->p_sys->p_fileopen == NULL) { - { - GNOME_APP_UI_ITEM, N_( "Barf" ), - NULL, - on_exit_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - } - }; - - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( button, "intf_window" ); - - gnome_app_insert_menus (GNOME_APP (p_intf->p_sys->p_window), - "_View/Channel/None", - test_uiinfo); -} - - -void -on_pause_clicked (GtkButton *button, - gpointer user_data) -{ - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( button, "intf_window" ); - - input_Pause( p_intf->p_input ); -} - - -void -on_popup_pause_activate (GtkMenuItem *menuitem, - gpointer user_data) -{ - intf_thread_t *p_intf; - - p_intf = GET_GNOME_STRUCT( menuitem, "intf_popup" ); - - input_Pause( p_intf->p_input ); -} - - - -void -on_mute_clicked (GtkButton *button, - gpointer user_data) -{ + p_intf->p_sys->p_fileopen = create_intf_fileopen(); + gtk_object_set_data( GTK_OBJECT( p_intf->p_sys->p_fileopen ), + "p_intf", p_intf ); + } + gtk_widget_show( p_intf->p_sys->p_fileopen ); + gdk_window_raise( p_intf->p_sys->p_fileopen->window ); } void -on_popup_mute_activate (GtkMenuItem *menuitem, +on_popup_about_activate (GtkMenuItem *menuitem, gpointer user_data) { + intf_thread_t *p_intf = GetIntf( GTK_WIDGET(menuitem), "intf_popup" ); + if( !GTK_IS_WIDGET( p_intf->p_sys->p_about ) ) + { + p_intf->p_sys->p_about = create_intf_about(); + } + gtk_widget_show( p_intf->p_sys->p_about ); } diff --git a/plugins/gnome/gnome_callbacks.h b/plugins/gnome/gnome_callbacks.h index f0d450a03f..94b5ed3675 100644 --- a/plugins/gnome/gnome_callbacks.h +++ b/plugins/gnome/gnome_callbacks.h @@ -1,216 +1,122 @@ -/* make VERSION visible to all Gnome components */ +/***************************************************************************** + * gnome_callbacks.h : Callbacks for the Gnome plugin. + ***************************************************************************** + * Copyright (C) 2000, 2001 VideoLAN + * + * Authors: Samuel Hocevar + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. + *****************************************************************************/ + +/***************************************************************************** + * Preamble + *****************************************************************************/ #include "config.h" #include - -void -on_open_activate (GtkMenuItem *menuitem, - gpointer user_data); - +/***************************************************************************** + * Callback prototypes + *****************************************************************************/ void -on_preferences_activate (GtkMenuItem *menuitem, +on_menubar_open_activate (GtkMenuItem *menuitem, gpointer user_data); void -on_modules_activate (GtkMenuItem *menuitem, +on_menubar_exit_activate (GtkMenuItem *menuitem, gpointer user_data); void -on_about_activate (GtkMenuItem *menuitem, +on_menubar_playlist_activate (GtkMenuItem *menuitem, gpointer user_data); void -on_exit_activate (GtkMenuItem *menuitem, +on_menubar_plugins_activate (GtkMenuItem *menuitem, gpointer user_data); void -on_open_activate (GtkMenuItem *menuitem, +on_menubar_preferences_activate (GtkMenuItem *menuitem, gpointer user_data); void -on_hide_activate (GtkMenuItem *menuitem, +on_menubar_about_activate (GtkMenuItem *menuitem, gpointer user_data); void -on_exit_activate (GtkMenuItem *menuitem, +on_toolbar_open_clicked (GtkButton *button, gpointer user_data); void -on_preferences_activate (GtkMenuItem *menuitem, +on_toolbar_back_clicked (GtkButton *button, gpointer user_data); void -on_plugins_activate (GtkMenuItem *menuitem, +on_toolbar_stop_clicked (GtkButton *button, gpointer user_data); void -on_about_activate (GtkMenuItem *menuitem, +on_toolbar_play_clicked (GtkButton *button, gpointer user_data); void -on_show_activate (GtkMenuItem *menuitem, +on_toolbar_pause_clicked (GtkButton *button, gpointer user_data); void -on_stop_clicked (GtkButton *button, +on_toolbar_playlist_clicked (GtkButton *button, gpointer user_data); void -on_popup_control_activate (GtkMenuItem *menuitem, +on_toolbar_prev_clicked (GtkButton *button, gpointer user_data); void -on_popup_playlist_activate (GtkMenuItem *menuitem, +on_toolbar_next_clicked (GtkButton *button, gpointer user_data); void -on_control_activate (GtkMenuItem *menuitem, +on_popup_play_activate (GtkMenuItem *menuitem, gpointer user_data); void -on_playlist_activate (GtkMenuItem *menuitem, +on_popup_pause_activate (GtkMenuItem *menuitem, gpointer user_data); void on_popup_exit_activate (GtkMenuItem *menuitem, gpointer user_data); -void -on_popup_about_activate (GtkMenuItem *menuitem, - gpointer user_data); - void on_intf_window_destroy (GtkObject *object, gpointer user_data); void -on_intf_playlist_destroy (GtkObject *object, - gpointer user_data); - -void -on_control_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_playlist_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_channel1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_channel2_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_channel3_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_channel4_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_channel5_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_popup_channel1_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_popup_channel2_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_popup_channel3_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_popup_channel4_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_popup_channel5_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_popup_config_channels_activate (GtkMenuItem *menuitem, +on_fileopen_ok_clicked (GtkButton *button, gpointer user_data); void -on_channel1_activate (GtkMenuItem *menuitem, +on_fileopen_cancel_clicked (GtkButton *button, gpointer user_data); void -on_channel2_activate (GtkMenuItem *menuitem, +on_intf_fileopen_destroy (GtkObject *object, gpointer user_data); void -on_channel3_activate (GtkMenuItem *menuitem, +on_popup_open_activate (GtkMenuItem *menuitem, gpointer user_data); void -on_channel4_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_channel5_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_config_channels_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_user_guide_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_popup_stop_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_popup_play_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_playlist_close_clicked (GtkButton *button, - gpointer user_data); - -void -on_play_clicked (GtkButton *button, - gpointer user_data); - -void -on_channel0_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_popup_channel0_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_open_clicked (GtkButton *button, - gpointer user_data); - -void -on_pause_clicked (GtkButton *button, - gpointer user_data); - -void -on_popup_pause_activate (GtkMenuItem *menuitem, - gpointer user_data); - -void -on_stop_clicked (GtkButton *button, - gpointer user_data); - -void -on_mute_clicked (GtkButton *button, - gpointer user_data); - -void -on_popup_mute_activate (GtkMenuItem *menuitem, +on_popup_about_activate (GtkMenuItem *menuitem, gpointer user_data); diff --git a/plugins/gnome/gnome_interface.c b/plugins/gnome/gnome_interface.c index 0b3e2db0a6..1f146f9ea6 100644 --- a/plugins/gnome/gnome_interface.c +++ b/plugins/gnome/gnome_interface.c @@ -17,126 +17,51 @@ #include "gnome_interface.h" #include "gnome_support.h" -static GnomeUIInfo file_menu_menu_uiinfo[] = +static GnomeUIInfo menubar_file_menu_uiinfo[] = { - GNOMEUIINFO_MENU_OPEN_ITEM (on_open_activate, NULL), + GNOMEUIINFO_MENU_OPEN_ITEM (on_menubar_open_activate, NULL), GNOMEUIINFO_SEPARATOR, - GNOMEUIINFO_MENU_EXIT_ITEM (on_exit_activate, NULL), + GNOMEUIINFO_MENU_EXIT_ITEM (on_menubar_exit_activate, NULL), GNOMEUIINFO_END }; -static GnomeUIInfo channel_menu_uiinfo[] = +static GnomeUIInfo menubar_view_menu_uiinfo[] = { { - GNOME_APP_UI_ITEM, N_("None"), + GNOME_APP_UI_ITEM, N_("P_laylist"), NULL, - on_channel0_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("1"), - NULL, - on_channel1_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("2"), - NULL, - on_channel2_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("3"), - NULL, - on_channel3_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("4"), - NULL, - on_channel4_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("5"), - NULL, - on_channel5_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("Configure..."), - NULL, - on_config_channels_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - GNOMEUIINFO_END -}; - -static GnomeUIInfo view_menu_menu_uiinfo[] = -{ - { - GNOME_APP_UI_ITEM, N_("Control window"), - NULL, - on_control_activate, NULL, NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXEC, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("Playlist"), - NULL, - on_playlist_activate, NULL, NULL, + (gpointer) on_menubar_playlist_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_INDEX, - 0, 0, NULL + 0, (GdkModifierType) 0, NULL }, { - GNOME_APP_UI_SUBTREE, N_("Channel"), + GNOME_APP_UI_ITEM, N_("_Plugins"), NULL, - channel_menu_uiinfo, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL + (gpointer) on_menubar_plugins_activate, NULL, NULL, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ATTACH, + 0, (GdkModifierType) 0, NULL }, GNOMEUIINFO_END }; -static GnomeUIInfo settings_menu_menu_uiinfo[] = +static GnomeUIInfo menubar_settings_menu_uiinfo[] = { - GNOMEUIINFO_MENU_PREFERENCES_ITEM (on_preferences_activate, NULL), - { - GNOME_APP_UI_ITEM, N_("Plugins..."), - NULL, - on_plugins_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, + GNOMEUIINFO_MENU_PREFERENCES_ITEM (on_menubar_preferences_activate, NULL), GNOMEUIINFO_END }; -static GnomeUIInfo help_menu_menu_uiinfo[] = +static GnomeUIInfo menubar_help_menu_uiinfo[] = { - { - GNOME_APP_UI_ITEM, N_("User guide"), - NULL, - on_user_guide_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - GNOMEUIINFO_MENU_ABOUT_ITEM (on_about_activate, NULL), + GNOMEUIINFO_MENU_ABOUT_ITEM (on_menubar_about_activate, NULL), GNOMEUIINFO_END }; static GnomeUIInfo menubar_uiinfo[] = { - GNOMEUIINFO_MENU_FILE_TREE (file_menu_menu_uiinfo), - GNOMEUIINFO_MENU_VIEW_TREE (view_menu_menu_uiinfo), - GNOMEUIINFO_MENU_SETTINGS_TREE (settings_menu_menu_uiinfo), - GNOMEUIINFO_MENU_HELP_TREE (help_menu_menu_uiinfo), + GNOMEUIINFO_MENU_FILE_TREE (menubar_file_menu_uiinfo), + GNOMEUIINFO_MENU_VIEW_TREE (menubar_view_menu_uiinfo), + GNOMEUIINFO_MENU_SETTINGS_TREE (menubar_settings_menu_uiinfo), + GNOMEUIINFO_MENU_HELP_TREE (menubar_help_menu_uiinfo), GNOMEUIINFO_END }; @@ -144,138 +69,86 @@ GtkWidget* create_intf_window (void) { GtkWidget *intf_window; - GtkWidget *dock; + GtkWidget *dock1; GtkWidget *toolbar; GtkWidget *tmp_toolbar_icon; - GtkWidget *open; - GtkWidget *jump; - GtkWidget *vseparator1; - GtkWidget *prev; - GtkWidget *rewind; - GtkWidget *stop; - GtkWidget *play; - GtkWidget *next; + GtkWidget *toolbar_open; + GtkWidget *toolbar_back; + GtkWidget *toolbar_stop; + GtkWidget *toolbar_play; + GtkWidget *toolbar_pause; GtkWidget *vseparator2; - GtkWidget *pause; - GtkWidget *mute; - GtkWidget *table1; - GtkWidget *hscale1; + GtkWidget *toolbar_playlist; + GtkWidget *toolbar_prev; + GtkWidget *toolbar_next; + GtkWidget *scrolledwindow1; + GtkWidget *text1; GtkWidget *appbar; - intf_window = gnome_app_new ("Vlc", _("VideoLAN Client")); + intf_window = gnome_app_new ("VideoLAN Client", _("VideoLAN Client")); gtk_object_set_data (GTK_OBJECT (intf_window), "intf_window", intf_window); - dock = GNOME_APP (intf_window)->dock; - gtk_widget_ref (dock); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "dock", dock, + dock1 = GNOME_APP (intf_window)->dock; + gtk_widget_ref (dock1); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "dock1", dock1, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (dock); + gtk_widget_show (dock1); gnome_app_create_menus (GNOME_APP (intf_window), menubar_uiinfo); gtk_widget_ref (menubar_uiinfo[0].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "file_menu", + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_file", menubar_uiinfo[0].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (file_menu_menu_uiinfo[0].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "open", - file_menu_menu_uiinfo[0].widget, + gtk_widget_ref (menubar_file_menu_uiinfo[0].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_open", + menubar_file_menu_uiinfo[0].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (file_menu_menu_uiinfo[1].widget); + gtk_widget_ref (menubar_file_menu_uiinfo[1].widget); gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator1", - file_menu_menu_uiinfo[1].widget, + menubar_file_menu_uiinfo[1].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (file_menu_menu_uiinfo[2].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "exit", - file_menu_menu_uiinfo[2].widget, + gtk_widget_ref (menubar_file_menu_uiinfo[2].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_exit", + menubar_file_menu_uiinfo[2].widget, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_ref (menubar_uiinfo[1].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "view_menu", + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_view", menubar_uiinfo[1].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (view_menu_menu_uiinfo[0].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "control", - view_menu_menu_uiinfo[0].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (view_menu_menu_uiinfo[1].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "playlist", - view_menu_menu_uiinfo[1].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (view_menu_menu_uiinfo[2].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel", - view_menu_menu_uiinfo[2].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (channel_menu_uiinfo[0].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel0", - channel_menu_uiinfo[0].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (channel_menu_uiinfo[1].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel1", - channel_menu_uiinfo[1].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (channel_menu_uiinfo[2].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel2", - channel_menu_uiinfo[2].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (channel_menu_uiinfo[3].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel3", - channel_menu_uiinfo[3].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (channel_menu_uiinfo[4].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel4", - channel_menu_uiinfo[4].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (channel_menu_uiinfo[5].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel5", - channel_menu_uiinfo[5].widget, + gtk_widget_ref (menubar_view_menu_uiinfo[0].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_playlist", + menubar_view_menu_uiinfo[0].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (channel_menu_uiinfo[6].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "config_channels", - channel_menu_uiinfo[6].widget, + gtk_widget_ref (menubar_view_menu_uiinfo[1].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_plugins", + menubar_view_menu_uiinfo[1].widget, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_ref (menubar_uiinfo[2].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "settings_menu", + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_settings", menubar_uiinfo[2].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (settings_menu_menu_uiinfo[0].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "preferences", - settings_menu_menu_uiinfo[0].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (settings_menu_menu_uiinfo[1].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "plugins", - settings_menu_menu_uiinfo[1].widget, + gtk_widget_ref (menubar_settings_menu_uiinfo[0].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_preferences", + menubar_settings_menu_uiinfo[0].widget, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_ref (menubar_uiinfo[3].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "help_menu", + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_help", menubar_uiinfo[3].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (help_menu_menu_uiinfo[0].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "user_guide", - help_menu_menu_uiinfo[0].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (help_menu_menu_uiinfo[1].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "about", - help_menu_menu_uiinfo[1].widget, + gtk_widget_ref (menubar_help_menu_uiinfo[0].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "menubar_about", + menubar_help_menu_uiinfo[0].widget, (GtkDestroyNotify) gtk_widget_unref); toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH); @@ -285,100 +158,73 @@ create_intf_window (void) gtk_widget_show (toolbar); gnome_app_add_toolbar (GNOME_APP (intf_window), GTK_TOOLBAR (toolbar), "toolbar", GNOME_DOCK_ITEM_BEH_EXCLUSIVE, - GNOME_DOCK_TOP, 1, 0, 0); + GNOME_DOCK_TOP, 1, 0, 2); + gtk_container_set_border_width (GTK_CONTAINER (toolbar), 1); + gtk_toolbar_set_space_size (GTK_TOOLBAR (toolbar), 16); + gtk_toolbar_set_space_style (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_SPACE_LINE); gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar), GTK_RELIEF_NONE); tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_OPEN); - open = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + toolbar_open = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_BUTTON, NULL, _("Open"), - NULL, NULL, - tmp_toolbar_icon, NULL, NULL); - gtk_widget_ref (open); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "open", open, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (open); - - tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_JUMP_TO); - jump = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), - GTK_TOOLBAR_CHILD_BUTTON, - NULL, - _("Jump"), - NULL, NULL, + _("Open File"), NULL, tmp_toolbar_icon, NULL, NULL); - gtk_widget_ref (jump); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "jump", jump, + gtk_widget_ref (toolbar_open); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_open", toolbar_open, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (jump); + gtk_widget_show (toolbar_open); - vseparator1 = gtk_vseparator_new (); - gtk_widget_ref (vseparator1); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "vseparator1", vseparator1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vseparator1); - gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), vseparator1, NULL, NULL); - gtk_widget_set_usize (vseparator1, 16, 32); - - tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FIRST); - prev = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), - GTK_TOOLBAR_CHILD_BUTTON, - NULL, - _("Prev"), - NULL, NULL, - tmp_toolbar_icon, NULL, NULL); - gtk_widget_ref (prev); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "prev", prev, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (prev); + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_BACK); - rewind = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + toolbar_back = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_BUTTON, NULL, _("Back"), - NULL, NULL, + _("Go Backwards"), NULL, tmp_toolbar_icon, NULL, NULL); - gtk_widget_ref (rewind); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "rewind", rewind, + gtk_widget_ref (toolbar_back); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_back", toolbar_back, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (rewind); + gtk_widget_show (toolbar_back); tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_STOP); - stop = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + toolbar_stop = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_BUTTON, NULL, _("Stop"), - NULL, NULL, + _("Stop Stream"), NULL, tmp_toolbar_icon, NULL, NULL); - gtk_widget_ref (stop); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "stop", stop, + gtk_widget_ref (toolbar_stop); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_stop", toolbar_stop, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (stop); + gtk_widget_show (toolbar_stop); tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FORWARD); - play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + toolbar_play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_BUTTON, NULL, _("Play"), - NULL, NULL, + _("Play Stream"), NULL, tmp_toolbar_icon, NULL, NULL); - gtk_widget_ref (play); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "play", play, + gtk_widget_ref (toolbar_play); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_play", toolbar_play, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (play); + gtk_widget_show (toolbar_play); - tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_LAST); - next = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_TIMER_STOP); + toolbar_pause = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_BUTTON, NULL, - _("Next"), - NULL, NULL, + _("Pause"), + _("Pause Stream"), NULL, tmp_toolbar_icon, NULL, NULL); - gtk_widget_ref (next); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "next", next, + gtk_widget_ref (toolbar_pause); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_pause", toolbar_pause, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (next); + gtk_widget_show (toolbar_pause); vseparator2 = gtk_vseparator_new (); gtk_widget_ref (vseparator2); @@ -386,47 +232,61 @@ create_intf_window (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_show (vseparator2); gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), vseparator2, NULL, NULL); - gtk_widget_set_usize (vseparator2, 16, 32); - tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_TIMER_STOP); - pause = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + gtk_toolbar_append_space (GTK_TOOLBAR (toolbar)); + + tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_INDEX); + toolbar_playlist = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_BUTTON, NULL, - _("Pause"), - NULL, NULL, + _("Playlist"), + _("Open Playlist"), NULL, + tmp_toolbar_icon, NULL, NULL); + gtk_widget_ref (toolbar_playlist); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_playlist", toolbar_playlist, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (toolbar_playlist); + + tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FIRST); + toolbar_prev = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + GTK_TOOLBAR_CHILD_BUTTON, + NULL, + _("Prev"), + _("Previous File"), NULL, tmp_toolbar_icon, NULL, NULL); - gtk_widget_ref (pause); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "pause", pause, + gtk_widget_ref (toolbar_prev); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_prev", toolbar_prev, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (pause); + gtk_widget_show (toolbar_prev); - tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_VOLUME); - mute = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), + tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_LAST); + toolbar_next = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar), GTK_TOOLBAR_CHILD_BUTTON, NULL, - _("Mute"), - NULL, NULL, + _("Next"), + _("Next File"), NULL, tmp_toolbar_icon, NULL, NULL); - gtk_widget_ref (mute); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "mute", mute, + gtk_widget_ref (toolbar_next); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar_next", toolbar_next, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (mute); + gtk_widget_show (toolbar_next); - table1 = gtk_table_new (4, 3, FALSE); - gtk_widget_ref (table1); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "table1", table1, + scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_ref (scrolledwindow1); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "scrolledwindow1", scrolledwindow1, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (table1); - gnome_app_set_contents (GNOME_APP (intf_window), table1); + gtk_widget_show (scrolledwindow1); + gnome_app_set_contents (GNOME_APP (intf_window), scrolledwindow1); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); - hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 12, 0.1, 1, 1))); - gtk_widget_ref (hscale1); - gtk_object_set_data_full (GTK_OBJECT (intf_window), "hscale1", hscale1, + text1 = gtk_text_new (NULL, NULL); + gtk_widget_ref (text1); + gtk_object_set_data_full (GTK_OBJECT (intf_window), "text1", text1, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hscale1); - gtk_table_attach (GTK_TABLE (table1), hscale1, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0); + gtk_widget_show (text1); + gtk_container_add (GTK_CONTAINER (scrolledwindow1), text1); + gtk_text_insert (GTK_TEXT (text1), NULL, NULL, NULL, + _("This is some random text. Nah."), 30); appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER); gtk_widget_ref (appbar); @@ -438,152 +298,53 @@ create_intf_window (void) gtk_signal_connect (GTK_OBJECT (intf_window), "destroy", GTK_SIGNAL_FUNC (on_intf_window_destroy), NULL); - gtk_signal_connect (GTK_OBJECT (open), "clicked", - GTK_SIGNAL_FUNC (on_open_clicked), + gnome_app_install_menu_hints (GNOME_APP (intf_window), menubar_uiinfo); + gtk_signal_connect (GTK_OBJECT (toolbar_open), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_open_clicked), NULL); - gtk_signal_connect (GTK_OBJECT (stop), "clicked", - GTK_SIGNAL_FUNC (on_stop_clicked), + gtk_signal_connect (GTK_OBJECT (toolbar_back), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_back_clicked), NULL); - gtk_signal_connect (GTK_OBJECT (play), "clicked", - GTK_SIGNAL_FUNC (on_play_clicked), + gtk_signal_connect (GTK_OBJECT (toolbar_stop), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_stop_clicked), NULL); - gtk_signal_connect (GTK_OBJECT (pause), "clicked", - GTK_SIGNAL_FUNC (on_pause_clicked), + gtk_signal_connect (GTK_OBJECT (toolbar_play), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_play_clicked), NULL); - gtk_signal_connect (GTK_OBJECT (mute), "clicked", - GTK_SIGNAL_FUNC (on_mute_clicked), + gtk_signal_connect (GTK_OBJECT (toolbar_pause), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_pause_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_playlist), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_playlist_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_prev), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_prev_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (toolbar_next), "clicked", + GTK_SIGNAL_FUNC (on_toolbar_next_clicked), NULL); return intf_window; } -GtkWidget* -create_intf_about (void) -{ - const gchar *authors[] = { - "too many to list here ...", - "see http://www.videolan.org/ for more details", - NULL - }; - GtkWidget *intf_about; - - intf_about = gnome_about_new ("Vlc", VERSION, - _("(C) 1996-2000 the VideoLAN Team"), - authors, - _("This is the VideoLAN client.\nIt plays MPEG streams from a file or a network source."), - NULL); - gtk_object_set_data (GTK_OBJECT (intf_about), "intf_about", intf_about); - - return intf_about; -} - -static GnomeUIInfo popup_channel_menu_uiinfo[] = -{ - { - GNOME_APP_UI_ITEM, N_("None"), - NULL, - on_popup_channel0_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("1"), - NULL, - on_popup_channel1_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("2"), - NULL, - on_popup_channel2_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("3"), - NULL, - on_popup_channel3_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("4"), - NULL, - on_popup_channel4_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("5"), - NULL, - on_popup_channel5_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("Configure..."), - NULL, - on_popup_config_channels_activate, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL - }, - GNOMEUIINFO_END -}; - static GnomeUIInfo intf_popup_uiinfo[] = { { - GNOME_APP_UI_ITEM, N_("Play"), + GNOME_APP_UI_ITEM, N_("_Play"), NULL, - on_popup_play_activate, NULL, NULL, + (gpointer) on_popup_play_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_FORWARD, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("Stop"), - NULL, - on_popup_stop_activate, NULL, NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_STOP, - 0, 0, NULL + 0, (GdkModifierType) 0, NULL }, - GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, N_("Pause"), NULL, - on_popup_pause_activate, NULL, NULL, + (gpointer) on_popup_pause_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_TIMER_STOP, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("Mute"), - NULL, - on_popup_mute_activate, NULL, NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_VOLUME, - 0, 0, NULL - }, - { - GNOME_APP_UI_SUBTREE, N_("Channel"), - NULL, - popup_channel_menu_uiinfo, NULL, NULL, - GNOME_APP_PIXMAP_NONE, NULL, - 0, 0, NULL + 0, (GdkModifierType) 0, NULL }, GNOMEUIINFO_SEPARATOR, - { - GNOME_APP_UI_ITEM, N_("Control window"), - NULL, - on_popup_control_activate, NULL, NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXEC, - 0, 0, NULL - }, - { - GNOME_APP_UI_ITEM, N_("Playlist"), - NULL, - on_popup_playlist_activate, NULL, NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_INDEX, - 0, 0, NULL - }, + GNOMEUIINFO_MENU_OPEN_ITEM (on_popup_open_activate, NULL), GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_MENU_ABOUT_ITEM (on_popup_about_activate, NULL), GNOMEUIINFO_MENU_EXIT_ITEM (on_popup_exit_activate, NULL), @@ -606,7 +367,7 @@ create_intf_popup (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_ref (intf_popup_uiinfo[1].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_stop", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_pause", intf_popup_uiinfo[1].widget, (GtkDestroyNotify) gtk_widget_unref); @@ -616,196 +377,93 @@ create_intf_popup (void) (GtkDestroyNotify) gtk_widget_unref); gtk_widget_ref (intf_popup_uiinfo[3].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_pause", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_open", intf_popup_uiinfo[3].widget, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_ref (intf_popup_uiinfo[4].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_mute", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator3", intf_popup_uiinfo[4].widget, (GtkDestroyNotify) gtk_widget_unref); gtk_widget_ref (intf_popup_uiinfo[5].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_about", intf_popup_uiinfo[5].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (popup_channel_menu_uiinfo[0].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel0", - popup_channel_menu_uiinfo[0].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (popup_channel_menu_uiinfo[1].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel1", - popup_channel_menu_uiinfo[1].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (popup_channel_menu_uiinfo[2].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel2", - popup_channel_menu_uiinfo[2].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (popup_channel_menu_uiinfo[3].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel3", - popup_channel_menu_uiinfo[3].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (popup_channel_menu_uiinfo[4].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel4", - popup_channel_menu_uiinfo[4].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (popup_channel_menu_uiinfo[5].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel5", - popup_channel_menu_uiinfo[5].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (popup_channel_menu_uiinfo[6].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_config_channels", - popup_channel_menu_uiinfo[6].widget, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (intf_popup_uiinfo[6].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator3", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_exit", intf_popup_uiinfo[6].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (intf_popup_uiinfo[7].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_control", - intf_popup_uiinfo[7].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (intf_popup_uiinfo[8].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_playlist", - intf_popup_uiinfo[8].widget, - (GtkDestroyNotify) gtk_widget_unref); - - gtk_widget_ref (intf_popup_uiinfo[9].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator2", - intf_popup_uiinfo[9].widget, - (GtkDestroyNotify) gtk_widget_unref); + return intf_popup; +} - gtk_widget_ref (intf_popup_uiinfo[10].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_about", - intf_popup_uiinfo[10].widget, - (GtkDestroyNotify) gtk_widget_unref); +GtkWidget* +create_intf_about (void) +{ + const gchar *authors[] = { + "Régis Duchesne ", + "Michel Lespinasse ", + "Olivier Pomel ", + "Jean-Philippe Grimaldi ", + "Andres Krapf ", + "Christophe Massiot ", + "Vincent Seguin ", + "Benoit Steiner ", + "Jean-Marc Dressler ", + "Gaël Hendryckx ", + "Samuel Hocevar ", + "Brieuc Jeunhomme ", + "Michel Kaempf ", + "Stéphane Borel ", + "Renaud Dartus ", + "Henri Fallon ", + NULL + }; + GtkWidget *intf_about; - gtk_widget_ref (intf_popup_uiinfo[11].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_exit", - intf_popup_uiinfo[11].widget, - (GtkDestroyNotify) gtk_widget_unref); + intf_about = gnome_about_new ("VideoLAN Client", VERSION, + _("(C) 1996, 1997, 1998, 1999, 2000, 2001 - the VideoLAN Team"), + authors, + _("This is the VideoLAN client, a DVD and MPEG player. It can play MPEG and MPEG 2 files from a file or from a network source."), + NULL); + gtk_object_set_data (GTK_OBJECT (intf_about), "intf_about", intf_about); - return intf_popup; + return intf_about; } GtkWidget* -create_intf_playlist (void) +create_intf_fileopen (void) { - GtkWidget *intf_playlist; - GtkWidget *vbox1; - GtkWidget *scrolledwindow; - GtkWidget *clist; - GtkWidget *label_name; - GtkWidget *label_type; - GtkWidget *label_length; - GtkWidget *hbuttonbox; - GtkWidget *playlist_load; - GtkWidget *playlist_close; - GtkWidget *playlist_help; - - intf_playlist = gtk_window_new (GTK_WINDOW_TOPLEVEL); - 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), -1, 400); - gtk_window_set_policy (GTK_WINDOW (intf_playlist), TRUE, TRUE, FALSE); - - vbox1 = gtk_vbox_new (FALSE, 0); - gtk_widget_ref (vbox1); - gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "vbox1", vbox1, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (vbox1); - gtk_container_add (GTK_CONTAINER (intf_playlist), vbox1); - - scrolledwindow = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_ref (scrolledwindow); - gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "scrolledwindow", scrolledwindow, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (scrolledwindow); - gtk_box_pack_start (GTK_BOX (vbox1), scrolledwindow, TRUE, TRUE, 0); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - - clist = gtk_clist_new (3); - gtk_widget_ref (clist); - gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "clist", clist, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (clist); - gtk_container_add (GTK_CONTAINER (scrolledwindow), clist); - gtk_clist_set_column_width (GTK_CLIST (clist), 0, 147); - gtk_clist_set_column_width (GTK_CLIST (clist), 1, 76); - gtk_clist_set_column_width (GTK_CLIST (clist), 2, 98); - gtk_clist_set_selection_mode (GTK_CLIST (clist), GTK_SELECTION_MULTIPLE); - gtk_clist_column_titles_show (GTK_CLIST (clist)); - - label_name = gtk_label_new (_("Name")); - gtk_widget_ref (label_name); - gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "label_name", label_name, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label_name); - gtk_clist_set_column_widget (GTK_CLIST (clist), 0, label_name); - - label_type = gtk_label_new (_("Type")); - gtk_widget_ref (label_type); - gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "label_type", label_type, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label_type); - gtk_clist_set_column_widget (GTK_CLIST (clist), 1, label_type); - - label_length = gtk_label_new (_("Length")); - gtk_widget_ref (label_length); - gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "label_length", label_length, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (label_length); - gtk_clist_set_column_widget (GTK_CLIST (clist), 2, label_length); - - hbuttonbox = gtk_hbutton_box_new (); - gtk_widget_ref (hbuttonbox); - gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "hbuttonbox", hbuttonbox, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (hbuttonbox); - gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox, FALSE, FALSE, 0); - gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox), 5); - - playlist_load = gtk_button_new_with_label (_("Load")); - gtk_widget_ref (playlist_load); - gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "playlist_load", playlist_load, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (playlist_load); - gtk_container_add (GTK_CONTAINER (hbuttonbox), playlist_load); - GTK_WIDGET_SET_FLAGS (playlist_load, GTK_CAN_DEFAULT); - - playlist_close = gnome_stock_button (GNOME_STOCK_BUTTON_CLOSE); - gtk_widget_ref (playlist_close); - gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "playlist_close", playlist_close, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (playlist_close); - gtk_container_add (GTK_CONTAINER (hbuttonbox), playlist_close); - GTK_WIDGET_SET_FLAGS (playlist_close, GTK_CAN_DEFAULT); - - playlist_help = gnome_stock_button (GNOME_STOCK_BUTTON_HELP); - gtk_widget_ref (playlist_help); - gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "playlist_help", playlist_help, - (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_show (playlist_help); - gtk_container_add (GTK_CONTAINER (hbuttonbox), playlist_help); - GTK_WIDGET_SET_FLAGS (playlist_help, GTK_CAN_DEFAULT); - - gtk_signal_connect (GTK_OBJECT (intf_playlist), "destroy", - GTK_SIGNAL_FUNC (on_intf_playlist_destroy), + GtkWidget *intf_fileopen; + GtkWidget *fileopen_ok; + GtkWidget *fileopen_cancel; + + intf_fileopen = gtk_file_selection_new (_("Open File")); + gtk_object_set_data (GTK_OBJECT (intf_fileopen), "intf_fileopen", intf_fileopen); + gtk_container_set_border_width (GTK_CONTAINER (intf_fileopen), 10); + + fileopen_ok = GTK_FILE_SELECTION (intf_fileopen)->ok_button; + gtk_object_set_data (GTK_OBJECT (intf_fileopen), "fileopen_ok", fileopen_ok); + gtk_widget_show (fileopen_ok); + GTK_WIDGET_SET_FLAGS (fileopen_ok, GTK_CAN_DEFAULT); + + fileopen_cancel = GTK_FILE_SELECTION (intf_fileopen)->cancel_button; + gtk_object_set_data (GTK_OBJECT (intf_fileopen), "fileopen_cancel", fileopen_cancel); + gtk_widget_show (fileopen_cancel); + GTK_WIDGET_SET_FLAGS (fileopen_cancel, GTK_CAN_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (intf_fileopen), "destroy", + GTK_SIGNAL_FUNC (on_intf_fileopen_destroy), + NULL); + gtk_signal_connect (GTK_OBJECT (fileopen_ok), "clicked", + GTK_SIGNAL_FUNC (on_fileopen_ok_clicked), NULL); - gtk_signal_connect (GTK_OBJECT (playlist_close), "clicked", - GTK_SIGNAL_FUNC (on_playlist_close_clicked), + gtk_signal_connect (GTK_OBJECT (fileopen_cancel), "clicked", + GTK_SIGNAL_FUNC (on_fileopen_cancel_clicked), NULL); - return intf_playlist; + return intf_fileopen; } diff --git a/plugins/gnome/gnome_interface.h b/plugins/gnome/gnome_interface.h index cf7ba410d6..17900a679d 100644 --- a/plugins/gnome/gnome_interface.h +++ b/plugins/gnome/gnome_interface.h @@ -3,6 +3,6 @@ */ GtkWidget* create_intf_window (void); -GtkWidget* create_intf_about (void); GtkWidget* create_intf_popup (void); -GtkWidget* create_intf_playlist (void); +GtkWidget* create_intf_about (void); +GtkWidget* create_intf_fileopen (void); diff --git a/plugins/gnome/gnome_support.c b/plugins/gnome/gnome_support.c index f65d7698bf..d59198cd7b 100644 --- a/plugins/gnome/gnome_support.c +++ b/plugins/gnome/gnome_support.c @@ -91,6 +91,9 @@ create_pixmap (GtkWidget *widget, GdkBitmap *mask; gchar *pathname; + if (!filename || !filename[0]) + return create_dummy_pixmap (widget, gnome_pixmap); + pathname = gnome_pixmap_file (filename); if (!pathname) { diff --git a/plugins/gnome/gnome_sys.h b/plugins/gnome/gnome_sys.h index de74cc1974..4282d0c8d4 100644 --- a/plugins/gnome/gnome_sys.h +++ b/plugins/gnome/gnome_sys.h @@ -2,7 +2,7 @@ * gnome_sys.h: private Gnome interface description ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: gnome_sys.h,v 1.1 2001/02/11 01:15:10 sam Exp $ + * $Id: gnome_sys.h,v 1.2 2001/02/12 00:20:37 sam Exp $ * * Authors: * @@ -48,6 +48,7 @@ typedef struct intf_sys_s GtkWidget * p_popup; /* popup menu */ GtkWidget * p_playlist; /* playlist */ GtkWidget * p_about; /* about window */ + GtkWidget * p_fileopen; /* file open window */ /* XXX: ugly kludge */ void ( *pf_gtk_callback ) ( void ); diff --git a/plugins/gnome/intf_gnome.c b/plugins/gnome/intf_gnome.c index a4c8bb43d2..e4448a94ad 100644 --- a/plugins/gnome/intf_gnome.c +++ b/plugins/gnome/intf_gnome.c @@ -2,7 +2,7 @@ * intf_gnome.c: Gnome interface ***************************************************************************** * Copyright (C) 1999, 2000 VideoLAN - * $Id: intf_gnome.c,v 1.8 2001/02/11 01:15:10 sam Exp $ + * $Id: intf_gnome.c,v 1.9 2001/02/12 00:20:37 sam Exp $ * * Authors: * @@ -180,6 +180,7 @@ static void intf_Run( intf_thread_t *p_intf ) /* we don't create these ones yet because we perhaps won't need them */ p_intf->p_sys->p_about = NULL; p_intf->p_sys->p_playlist = NULL; + p_intf->p_sys->p_fileopen = NULL; /* store p_sys to keep an eye on it */ gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_window), diff --git a/plugins/gnome/intf_gnome.glade b/plugins/gnome/intf_gnome.glade new file mode 100644 index 0000000000..2b43f89b38 --- /dev/null +++ b/plugins/gnome/intf_gnome.glade @@ -0,0 +1,527 @@ + + + + + VideoLAN Client + vlc + + + pixmaps + C + True + True + False + False + gnome_interface.c + gnome_interface.h + gnome_callbacks.c + gnome_callbacks.h + gnome_support.c + gnome_support.h + + + + GnomeApp + intf_window + + destroy + on_intf_window_destroy + Sun, 11 Feb 2001 17:41:57 GMT + + VideoLAN Client + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + True + + + GnomeDock + GnomeApp:dock + dock1 + True + + 0 + True + True + + + + GnomeDockItem + dockitem_menubar + 2 + GNOME_DOCK_TOP + 0 + 0 + 0 + False + True + False + True + False + GTK_SHADOW_OUT + + + GtkMenuBar + menubar + GTK_SHADOW_NONE + + + GtkMenuItem + menubar_file + GNOMEUIINFO_MENU_FILE_TREE + + + GtkMenu + menubar_file_menu + + + GtkPixmapMenuItem + menubar_open + + activate + on_menubar_open_activate + Sun, 11 Feb 2001 16:55:04 GMT + + GNOMEUIINFO_MENU_OPEN_ITEM + + + + GtkMenuItem + separator1 + False + + + + GtkPixmapMenuItem + menubar_exit + + activate + on_menubar_exit_activate + Sun, 11 Feb 2001 16:55:04 GMT + + GNOMEUIINFO_MENU_EXIT_ITEM + + + + + + GtkMenuItem + menubar_view + GNOMEUIINFO_MENU_VIEW_TREE + + + GtkMenu + menubar_view_menu + + + GtkPixmapMenuItem + menubar_playlist + + activate + on_menubar_playlist_activate + Sun, 11 Feb 2001 16:55:04 GMT + + + False + GNOME_STOCK_MENU_INDEX + + + + GtkPixmapMenuItem + menubar_plugins + + activate + on_menubar_plugins_activate + Sun, 11 Feb 2001 16:55:04 GMT + + + False + GNOME_STOCK_MENU_ATTACH + + + + + + GtkMenuItem + menubar_settings + GNOMEUIINFO_MENU_SETTINGS_TREE + + + GtkMenu + menubar_settings_menu + + + GtkPixmapMenuItem + menubar_preferences + + activate + on_menubar_preferences_activate + Sun, 11 Feb 2001 16:55:04 GMT + + GNOMEUIINFO_MENU_PREFERENCES_ITEM + + + + + + GtkMenuItem + menubar_help + GNOMEUIINFO_MENU_HELP_TREE + + + GtkMenu + menubar_help_menu + + + GtkPixmapMenuItem + menubar_about + + activate + on_menubar_about_activate + Sun, 11 Feb 2001 16:55:04 GMT + + GNOMEUIINFO_MENU_ABOUT_ITEM + + + + + + + + GnomeDockItem + dockitem_toolbar + 1 + GNOME_DOCK_TOP + 1 + 0 + 2 + False + True + False + False + False + GTK_SHADOW_OUT + + + GtkToolbar + toolbar + 1 + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH + 16 + GTK_TOOLBAR_SPACE_LINE + GTK_RELIEF_NONE + True + + + GtkButton + Toolbar:button + toolbar_open + Open File + + clicked + on_toolbar_open_clicked + Sun, 11 Feb 2001 17:06:24 GMT + + + GNOME_STOCK_PIXMAP_OPEN + + + + GtkButton + Toolbar:button + toolbar_back + Go Backwards + + clicked + on_toolbar_back_clicked + Sun, 11 Feb 2001 17:06:28 GMT + + + GNOME_STOCK_PIXMAP_BACK + + True + + + + + GtkButton + Toolbar:button + toolbar_stop + Stop Stream + + clicked + on_toolbar_stop_clicked + Sun, 11 Feb 2001 17:06:33 GMT + + + GNOME_STOCK_PIXMAP_STOP + + + + GtkButton + Toolbar:button + toolbar_play + Play Stream + + clicked + on_toolbar_play_clicked + Sun, 11 Feb 2001 17:06:39 GMT + + + GNOME_STOCK_PIXMAP_FORWARD + + + + GtkButton + Toolbar:button + toolbar_pause + Pause Stream + + clicked + on_toolbar_pause_clicked + Sun, 11 Feb 2001 17:06:43 GMT + + + GNOME_STOCK_PIXMAP_TIMER_STOP + + + + GtkVSeparator + vseparator2 + + + + GtkButton + Toolbar:button + toolbar_playlist + Open Playlist + + clicked + on_toolbar_playlist_clicked + Sun, 11 Feb 2001 17:06:48 GMT + + + GNOME_STOCK_PIXMAP_INDEX + + True + + + + + GtkButton + Toolbar:button + toolbar_prev + Previous File + + clicked + on_toolbar_prev_clicked + Sun, 11 Feb 2001 17:06:52 GMT + + + GNOME_STOCK_PIXMAP_FIRST + + + + GtkButton + Toolbar:button + toolbar_next + Next File + + clicked + on_toolbar_next_clicked + Sun, 11 Feb 2001 17:06:56 GMT + + + GNOME_STOCK_PIXMAP_LAST + + + + + + GtkScrolledWindow + GnomeDock:contents + scrolledwindow1 + GTK_POLICY_NEVER + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + + GtkText + text1 + True + False + This is some random text. Nah. + + + + + + GnomeAppBar + GnomeApp:appbar + appbar + True + True + + 0 + True + True + + + + + + GtkMenu + intf_popup + + + GtkPixmapMenuItem + popup_play + + activate + on_popup_play_activate + Sun, 11 Feb 2001 16:52:11 GMT + + + False + GNOME_STOCK_MENU_FORWARD + + + + GtkPixmapMenuItem + popup_pause + + activate + on_popup_pause_activate + Sun, 11 Feb 2001 16:52:11 GMT + + + False + GNOME_STOCK_MENU_TIMER_STOP + + + + GtkMenuItem + separator2 + False + + + + GtkPixmapMenuItem + popup_open + + activate + on_popup_open_activate + Sun, 11 Feb 2001 23:49:08 GMT + + GNOMEUIINFO_MENU_OPEN_ITEM + + + + GtkMenuItem + separator3 + False + + + + GtkPixmapMenuItem + popup_about + + activate + on_popup_about_activate + Mon, 12 Feb 2001 00:00:08 GMT + + GNOMEUIINFO_MENU_ABOUT_ITEM + + + + GtkPixmapMenuItem + popup_exit + + activate + on_popup_exit_activate + Sun, 11 Feb 2001 16:49:30 GMT + + GNOMEUIINFO_MENU_EXIT_ITEM + + + + + GnomeAbout + intf_about + False + (C) 1996, 1997, 1998, 1999, 2000, 2001 - the VideoLAN Team + Régis Duchesne <regis@via.ecp.fr> +Michel Lespinasse <walken@zoy.org> +Olivier Pomel <pomel@via.ecp.fr> +Jean-Philippe Grimaldi <jeanphi@via.ecp.fr> +Andres Krapf <dae@via.ecp.fr> +Christophe Massiot <massiot@via.ecp.fr> +Vincent Seguin <seguin@via.ecp.fr> +Benoit Steiner <benny@via.ecp.fr> +Jean-Marc Dressler <polux@via.ecp.fr> +Gaël Hendryckx <jimmy@via.ecp.fr> +Samuel Hocevar <sam@zoy.org> +Brieuc Jeunhomme <bbp@via.ecp.fr> +Michel Kaempf <maxx@via.ecp.fr> +Stéphane Borel <stef@via.ecp.fr> +Renaud Dartus <reno@via.ecp.fr> +Henri Fallon <henri@via.ecp.fr> + + This is the VideoLAN client, a DVD and MPEG player. It can play MPEG and MPEG 2 files from a file or from a network source. + + + + GtkFileSelection + intf_fileopen + 10 + + destroy + on_intf_fileopen_destroy + Sun, 11 Feb 2001 18:36:13 GMT + + Open File + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + True + + + GtkButton + FileSel:ok_button + fileopen_ok + True + True + + clicked + on_fileopen_ok_clicked + Sun, 11 Feb 2001 18:22:44 GMT + + + GTK_RELIEF_NORMAL + + + + GtkButton + FileSel:cancel_button + fileopen_cancel + True + True + + clicked + on_fileopen_cancel_clicked + Sun, 11 Feb 2001 18:22:50 GMT + + + GTK_RELIEF_NORMAL + + + + diff --git a/plugins/sdl/vout_sdl.c b/plugins/sdl/vout_sdl.c index c4e360d8bf..48b2692a10 100644 --- a/plugins/sdl/vout_sdl.c +++ b/plugins/sdl/vout_sdl.c @@ -320,46 +320,61 @@ int vout_Manage( vout_thread_t *p_vout ) /* FIXME : this is temporary */ case SDLK_p: - if( p_input->stream.control.i_status == PLAYING_S ) + if( p_input != NULL ) { - input_Pause( p_input ); - } - else - { - input_Play( p_input ); + if( p_input->stream.control.i_status == PLAYING_S ) + { + input_Pause( p_input ); + } + else + { + input_Play( p_input ); + } } break; case SDLK_a: - i_rate = p_input->stream.control.i_rate/2; - if ( i_rate >= MINIMAL_RATE ) + if( p_input != NULL ) { - input_Forward( p_input, i_rate ); + i_rate = p_input->stream.control.i_rate/2; + if ( i_rate >= MINIMAL_RATE ) + { + input_Forward( p_input, i_rate ); + } } break; case SDLK_z: - i_rate = p_input->stream.control.i_rate*2; - if ( i_rate <= MAXIMAL_RATE ) + if( p_input != NULL ) { - /* Compensation of int truncature */ - if ( i_rate > 500 && i_rate < 1000 ) - i_rate = 1000; - input_Forward( p_input, i_rate ); + i_rate = p_input->stream.control.i_rate*2; + if ( i_rate <= MAXIMAL_RATE ) + { + /* Compensation of int truncature */ + if ( i_rate > 500 && i_rate < 1000 ) + i_rate = 1000; + input_Forward( p_input, i_rate ); + } } break; case SDLK_j: - /* Jump forwards */ - input_Seek( p_input, p_input->stream.i_tell - + p_input->stream.i_size / 20 ); - /* gabuzomeu */ + if( p_input != NULL ) + { + /* Jump forwards */ + input_Seek( p_input, p_input->stream.i_tell + + p_input->stream.i_size / 20 ); + /* gabuzomeu */ + } break; case SDLK_b: - /* Jump backwards */ - input_Seek( p_input, p_input->stream.i_tell - - p_input->stream.i_size / 20 ); + if( p_input != NULL ) + { + /* Jump backwards */ + input_Seek( p_input, p_input->stream.i_tell + - p_input->stream.i_size / 20 ); + } break; default: diff --git a/src/interface/interface.c b/src/interface/interface.c index f7a35bedd6..a7dff1eb28 100644 --- a/src/interface/interface.c +++ b/src/interface/interface.c @@ -100,11 +100,11 @@ intf_thread_t* intf_Create( void ) p_intf->pf_manage = intf_Manage; /* Initialize structure */ - p_intf->b_die = 0; + p_intf->b_die = 0; - p_intf->p_input = NULL; - p_intf->p_keys = NULL; - p_intf->b_menu = 0; + p_intf->p_input = NULL; + p_intf->p_keys = NULL; + p_intf->b_menu = 0; p_intf->b_menu_change = 0; if( p_intf->pf_open( p_intf ) ) diff --git a/src/video_output/video_output.c b/src/video_output/video_output.c index 2ddf26675f..dd03d6f80a 100644 --- a/src/video_output/video_output.c +++ b/src/video_output/video_output.c @@ -1833,12 +1833,14 @@ int RenderSplash( vout_thread_t *p_vout ) *****************************************************************************/ int RenderIdle( vout_thread_t *p_vout ) { +#if 0 int i_x = 0, i_y = 0; /* text position */ int i_width, i_height; /* text size */ - mtime_t current_date; /* current date */ int i_amount = 0; /* amount to draw */ char *psz_text = "Waiting for stream"; /* text to display */ char *psz_wtext = "[................]"; +#endif + mtime_t current_date; /* current date */ memset( p_vout->p_buffer[ p_vout->i_buffer_index ].p_data, @@ -1850,6 +1852,8 @@ int RenderIdle( vout_thread_t *p_vout ) // && (current_date - p_vout->last_idle_date) > VOUT_IDLE_DELAY ) { + /* FIXME: idle screen disabled */ +#if 0 SetBufferPicture( p_vout, NULL ); vout_TextSize( p_vout->p_large_font, WIDE_TEXT | OUTLINED_TEXT, psz_text, &i_width, &i_height ); @@ -1873,6 +1877,7 @@ int RenderIdle( vout_thread_t *p_vout ) SetBufferArea( p_vout, i_x, i_y, i_width, i_height * 2 ); } +#endif return( 1 ); } return( 0 ); -- 2.39.2