diff -urN vlc/.dep/plugins/common/languages.d vlc-changed/.dep/plugins/common/languages.d --- vlc/.dep/plugins/common/languages.d Thu Jan 1 10:00:00 1970 +++ vlc-changed/.dep/plugins/common/languages.d Fri Mar 30 00:17:35 2001 @@ -0,0 +1 @@ +plugins/common/languages.o .dep/plugins/common/languages.d : plugins/common/languages.c plugins/common/languages.h diff -urN vlc/.dep/plugins/dvd/input_dvd.d vlc-changed/.dep/plugins/dvd/input_dvd.d --- vlc/.dep/plugins/dvd/input_dvd.d Thu Mar 29 23:46:33 2001 +++ vlc-changed/.dep/plugins/dvd/input_dvd.d Fri Mar 30 00:17:26 2001 @@ -5,4 +5,4 @@ include/input_ext-intf.h include/input_ext-dec.h include/input.h \ plugins/dvd/dvd_netlist.h plugins/dvd/dvd_ifo.h plugins/dvd/dvd_css.h \ plugins/dvd/input_dvd.h include/mpeg_system.h include/debug.h \ - include/modules.h + include/modules.h plugins/dvd/../common/languages.h diff -urN vlc/.dep/plugins/gnome/gnome_callbacks.d vlc-changed/.dep/plugins/gnome/gnome_callbacks.d --- vlc/.dep/plugins/gnome/gnome_callbacks.d Thu Mar 29 23:47:08 2001 +++ vlc-changed/.dep/plugins/gnome/gnome_callbacks.d Fri Mar 30 00:17:59 2001 @@ -5,4 +5,4 @@ include/interface.h include/intf_playlist.h include/intf_msg.h \ plugins/gnome/gnome_callbacks.h plugins/gnome/gnome_interface.h \ plugins/gnome/gnome_support.h plugins/gnome/intf_gnome.h \ - include/main.h + plugins/gnome/../common/languages.h include/main.h diff -urN vlc/Makefile vlc-changed/Makefile --- vlc/Makefile Thu Mar 29 23:44:36 2001 +++ vlc-changed/Makefile Fri Mar 30 00:15:58 2001 @@ -346,7 +346,8 @@ plugins/dvd/dvd_ioctl.o \ plugins/dvd/dvd_ifo.o \ plugins/dvd/dvd_udf.o \ - plugins/dvd/dvd_css.o + plugins/dvd/dvd_css.o \ + plugins/common/languages.o PLUGIN_ESD = plugins/esd/esd.o \ plugins/esd/aout_esd.o @@ -364,7 +365,8 @@ plugins/gnome/intf_gnome.o \ plugins/gnome/gnome_callbacks.o \ plugins/gnome/gnome_interface.o \ - plugins/gnome/gnome_support.o + plugins/gnome/gnome_support.o \ + plugins/common/languages.o PLUGIN_GTK = plugins/gtk/gtk.o \ plugins/gtk/intf_gtk.o \ diff -urN vlc/Makefile.in vlc-changed/Makefile.in --- vlc/Makefile.in Thu Mar 29 20:02:09 2001 +++ vlc-changed/Makefile.in Fri Mar 30 00:37:29 2001 @@ -345,7 +345,8 @@ plugins/dvd/dvd_ioctl.o \ plugins/dvd/dvd_ifo.o \ plugins/dvd/dvd_udf.o \ - plugins/dvd/dvd_css.o + plugins/dvd/dvd_css.o \ + plugins/common/languages.o PLUGIN_ESD = plugins/esd/esd.o \ plugins/esd/aout_esd.o @@ -363,7 +364,8 @@ plugins/gnome/intf_gnome.o \ plugins/gnome/gnome_callbacks.o \ plugins/gnome/gnome_interface.o \ - plugins/gnome/gnome_support.o + plugins/gnome/gnome_support.o \ + plugins/common/languages.o PLUGIN_GTK = plugins/gtk/gtk.o \ plugins/gtk/intf_gtk.o \ diff -urN vlc/config.status vlc-changed/config.status --- vlc/config.status Thu Mar 29 23:44:35 2001 +++ vlc-changed/config.status Fri Mar 30 00:15:57 2001 @@ -4,7 +4,7 @@ # This directory was configured as follows, # on host shanes.cool_computer: # -# ./configure --enable-gnome --enable-esd +# ./configure -enable-esd -enable-gnome # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. @@ -14,8 +14,8 @@ do case "$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running ${CONFIG_SHELL-/bin/sh} ./configure --enable-gnome --enable-esd --no-create --no-recursion" - exec ${CONFIG_SHELL-/bin/sh} ./configure --enable-gnome --enable-esd --no-create --no-recursion ;; + echo "running ${CONFIG_SHELL-/bin/sh} ./configure -enable-esd -enable-gnome --no-create --no-recursion" + exec ${CONFIG_SHELL-/bin/sh} ./configure -enable-esd -enable-gnome --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "./config.status generated by autoconf version 2.13" exit 0 ;; diff -urN vlc/include/config.h vlc-changed/include/config.h --- vlc/include/config.h Thu Mar 29 23:44:36 2001 +++ vlc-changed/include/config.h Fri Mar 30 00:15:58 2001 @@ -219,6 +219,7 @@ #define INPUT_AUDIO_VAR "vlc_input_audio" #define INPUT_CHANNEL_VAR "vlc_input_channel" #define INPUT_SUBTITLE_VAR "vlc_input_subtitle" +#define INPUT_LANGUAGE "vlc_input_language" /***************************************************************************** * Audio configuration diff -urN vlc/include/config.h.in vlc-changed/include/config.h.in --- vlc/include/config.h.in Thu Mar 29 20:02:08 2001 +++ vlc-changed/include/config.h.in Fri Mar 30 00:01:08 2001 @@ -219,6 +219,7 @@ #define INPUT_AUDIO_VAR "vlc_input_audio" #define INPUT_CHANNEL_VAR "vlc_input_channel" #define INPUT_SUBTITLE_VAR "vlc_input_subtitle" +#define INPUT_LANGUAGE "vlc_input_language" /***************************************************************************** * Audio configuration diff -urN vlc/include/main.h vlc-changed/include/main.h --- vlc/include/main.h Thu Mar 29 20:02:08 2001 +++ vlc-changed/include/main.h Fri Mar 30 00:03:48 2001 @@ -74,3 +74,5 @@ void main_PutIntVariable( char *psz_name, int i_value ); void main_PutPszVariable( char *psz_name, char *psz_value ); +void WriteConfigFile( void ); +int GetConfigDirName( char *buff, int len ); diff -urN vlc/plugins/common/languages.c vlc-changed/plugins/common/languages.c --- vlc/plugins/common/languages.c Thu Jan 1 10:00:00 1970 +++ vlc-changed/plugins/common/languages.c Fri Mar 30 00:04:56 2001 @@ -0,0 +1,175 @@ +/***************************************************************************** + * --- + ***************************************************************************** + * Copyright (C) 1998-2001 VideoLAN + * $Id: languages.c,v 1.1 2001/03/25 04:27:25 shaneh Exp shaneh $ + * + * Author: Stéphane Borel + * + * 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. + *****************************************************************************/ + +#include "languages.h" + +struct lang_tbl_t lang_tbl[] = +{ + /* The ISO 639 language codes. + * Language names with * prefix are not spelled in their own language + */ + { " ", "Not Specified" }, + { "aa", "*Afar" }, + { "ab", "*Abkhazian" }, + { "af", "*Afrikaans" }, + { "am", "*Amharic" }, + { "ar", "*Arabic" }, + { "as", "*Assamese" }, + { "ay", "*Aymara" }, + { "az", "*Azerbaijani" }, + { "ba", "*Bashkir" }, + { "be", "*Byelorussian" }, + { "bg", "*Bulgarian" }, + { "bh", "*Bihari" }, + { "bi", "*Bislama" }, + { "bn", "*Bengali; Bangla" }, + { "bo", "*Tibetan" }, + { "br", "*Breton" }, + { "ca", "*Catalan" }, + { "co", "*Corsican" }, + { "cs", "*Czech(Ceske)" }, + { "cy", "*Welsh" }, + { "da", "Dansk" }, + { "de", "Deutsch" }, + { "dz", "*Bhutani" }, + { "el", "*Greek" }, + { "en", "English" }, + { "eo", "*Esperanto" }, + { "es", "Espanol" }, + { "et", "*Estonian" }, + { "eu", "*Basque" }, + { "fa", "*Persian" }, + { "fi", "Suomi" }, + { "fj", "*Fiji" }, + { "fo", "*Faroese" }, + { "fr", "Francais" }, + { "fy", "*Frisian" }, + { "ga", "*Irish" }, + { "gd", "*Scots Gaelic" }, + { "gl", "*Galician" }, + { "gn", "*Guarani" }, + { "gu", "*Gujarati" }, + { "ha", "*Hausa" }, + { "he", "*Hebrew" }, /* formerly iw */ + { "hi", "*Hindi" }, + { "hr", "Hrvatski" }, /* Croatian */ + { "hu", "Magyar" }, + { "hy", "*Armenian" }, + { "ia", "*Interlingua" }, + { "id", "*Indonesian" }, /* formerly in */ + { "ie", "*Interlingue" }, + { "ik", "*Inupiak" }, + { "in", "*Indonesian" }, /* replaced by id */ + { "is", "Islenska" }, + { "it", "Italiano" }, + { "iu", "*Inuktitut" }, + { "iw", "*Hebrew" }, /* replaced by he */ + { "ja", "*Japanese" }, + { "ji", "*Yiddish" }, /* replaced by yi */ + { "jw", "*Javanese" }, + { "ka", "*Georgian" }, + { "kk", "*Kazakh" }, + { "kl", "*Greenlandic" }, + { "km", "*Cambodian" }, + { "kn", "*Kannada" }, + { "ko", "*Korean" }, + { "ks", "*Kashmiri" }, + { "ku", "*Kurdish" }, + { "ky", "*Kirghiz" }, + { "la", "*Latin" }, + { "ln", "*Lingala" }, + { "lo", "*Laothian" }, + { "lt", "*Lithuanian" }, + { "lv", "*Latvian, Lettish" }, + { "mg", "*Malagasy" }, + { "mi", "*Maori" }, + { "mk", "*Macedonian" }, + { "ml", "*Malayalam" }, + { "mn", "*Mongolian" }, + { "mo", "*Moldavian" }, + { "mr", "*Marathi" }, + { "ms", "*Malay" }, + { "mt", "*Maltese" }, + { "my", "*Burmese" }, + { "na", "*Nauru" }, + { "ne", "*Nepali" }, + { "nl", "Nederlands" }, + { "no", "Norsk" }, + { "oc", "*Occitan" }, + { "om", "*(Afan) Oromo" }, + { "or", "*Oriya" }, + { "pa", "*Punjabi" }, + { "pl", "*Polish" }, + { "ps", "*Pashto, Pushto" }, + { "pt", "Portugues" }, + { "qu", "*Quechua" }, + { "rm", "*Rhaeto-Romance" }, + { "rn", "*Kirundi" }, + { "ro", "*Romanian" }, + { "ru", "*Russian" }, + { "rw", "*Kinyarwanda" }, + { "sa", "*Sanskrit" }, + { "sd", "*Sindhi" }, + { "sg", "*Sangho" }, + { "sh", "*Serbo-Croatian" }, + { "si", "*Sinhalese" }, + { "sk", "*Slovak" }, + { "sl", "*Slovenian" }, + { "sm", "*Samoan" }, + { "sn", "*Shona" }, + { "so", "*Somali" }, + { "sq", "*Albanian" }, + { "sr", "*Serbian" }, + { "ss", "*Siswati" }, + { "st", "*Sesotho" }, + { "su", "*Sundanese" }, + { "sv", "Svenska" }, + { "sw", "*Swahili" }, + { "ta", "*Tamil" }, + { "te", "*Telugu" }, + { "tg", "*Tajik" }, + { "th", "*Thai" }, + { "ti", "*Tigrinya" }, + { "tk", "*Turkmen" }, + { "tl", "*Tagalog" }, + { "tn", "*Setswana" }, + { "to", "*Tonga" }, + { "tr", "*Turkish" }, + { "ts", "*Tsonga" }, + { "tt", "*Tatar" }, + { "tw", "*Twi" }, + { "ug", "*Uighur" }, + { "uk", "*Ukrainian" }, + { "ur", "*Urdu" }, + { "uz", "*Uzbek" }, + { "vi", "*Vietnamese" }, + { "vo", "*Volapuk" }, + { "wo", "*Wolof" }, + { "xh", "*Xhosa" }, + { "yi", "*Yiddish" }, /* formerly ji */ + { "yo", "*Yoruba" }, + { "za", "*Zhuang" }, + { "zh", "*Chinese" }, + { "zu", "*Zulu" }, + { "\0", "" } +}; diff -urN vlc/plugins/common/languages.h vlc-changed/plugins/common/languages.h --- vlc/plugins/common/languages.h Thu Jan 1 10:00:00 1970 +++ vlc-changed/plugins/common/languages.h Fri Mar 30 00:04:56 2001 @@ -0,0 +1,30 @@ +/***************************************************************************** + * --- + ***************************************************************************** + * Copyright (C) 1998-2001 VideoLAN + * $Id: languages.h,v 1.2 2001/03/25 04:27:34 shaneh Exp shaneh $ + * + * Author: Stéphane Borel + * + * 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. + *****************************************************************************/ + +struct lang_tbl_t +{ + char p_code[3]; + char p_lang_long[20]; +}; + +extern struct lang_tbl_t lang_tbl[]; diff -urN vlc/plugins/dvd/input_dvd.c vlc-changed/plugins/dvd/input_dvd.c --- vlc/plugins/dvd/input_dvd.c Thu Mar 29 20:02:09 2001 +++ vlc-changed/plugins/dvd/input_dvd.c Fri Mar 30 00:14:32 2001 @@ -78,166 +78,7 @@ #include "debug.h" #include "modules.h" - -/***************************************************************************** - * Local tables - *****************************************************************************/ -static struct -{ - char p_code[3]; - char p_lang_long[20]; -} - -lang_tbl[] = -{ - /* The ISO 639 language codes. - * Language names with * prefix are not spelled in their own language - */ - { " ", "Not Specified" }, - { "aa", "*Afar" }, - { "ab", "*Abkhazian" }, - { "af", "*Afrikaans" }, - { "am", "*Amharic" }, - { "ar", "*Arabic" }, - { "as", "*Assamese" }, - { "ay", "*Aymara" }, - { "az", "*Azerbaijani" }, - { "ba", "*Bashkir" }, - { "be", "*Byelorussian" }, - { "bg", "*Bulgarian" }, - { "bh", "*Bihari" }, - { "bi", "*Bislama" }, - { "bn", "*Bengali; Bangla" }, - { "bo", "*Tibetan" }, - { "br", "*Breton" }, - { "ca", "*Catalan" }, - { "co", "*Corsican" }, - { "cs", "*Czech(Ceske)" }, - { "cy", "*Welsh" }, - { "da", "Dansk" }, - { "de", "Deutsch" }, - { "dz", "*Bhutani" }, - { "el", "*Greek" }, - { "en", "English" }, - { "eo", "*Esperanto" }, - { "es", "Espanol" }, - { "et", "*Estonian" }, - { "eu", "*Basque" }, - { "fa", "*Persian" }, - { "fi", "Suomi" }, - { "fj", "*Fiji" }, - { "fo", "*Faroese" }, - { "fr", "Francais" }, - { "fy", "*Frisian" }, - { "ga", "*Irish" }, - { "gd", "*Scots Gaelic" }, - { "gl", "*Galician" }, - { "gn", "*Guarani" }, - { "gu", "*Gujarati" }, - { "ha", "*Hausa" }, - { "he", "*Hebrew" }, /* formerly iw */ - { "hi", "*Hindi" }, - { "hr", "Hrvatski" }, /* Croatian */ - { "hu", "Magyar" }, - { "hy", "*Armenian" }, - { "ia", "*Interlingua" }, - { "id", "*Indonesian" }, /* formerly in */ - { "ie", "*Interlingue" }, - { "ik", "*Inupiak" }, - { "in", "*Indonesian" }, /* replaced by id */ - { "is", "Islenska" }, - { "it", "Italiano" }, - { "iu", "*Inuktitut" }, - { "iw", "*Hebrew" }, /* replaced by he */ - { "ja", "*Japanese" }, - { "ji", "*Yiddish" }, /* replaced by yi */ - { "jw", "*Javanese" }, - { "ka", "*Georgian" }, - { "kk", "*Kazakh" }, - { "kl", "*Greenlandic" }, - { "km", "*Cambodian" }, - { "kn", "*Kannada" }, - { "ko", "*Korean" }, - { "ks", "*Kashmiri" }, - { "ku", "*Kurdish" }, - { "ky", "*Kirghiz" }, - { "la", "*Latin" }, - { "ln", "*Lingala" }, - { "lo", "*Laothian" }, - { "lt", "*Lithuanian" }, - { "lv", "*Latvian, Lettish" }, - { "mg", "*Malagasy" }, - { "mi", "*Maori" }, - { "mk", "*Macedonian" }, - { "ml", "*Malayalam" }, - { "mn", "*Mongolian" }, - { "mo", "*Moldavian" }, - { "mr", "*Marathi" }, - { "ms", "*Malay" }, - { "mt", "*Maltese" }, - { "my", "*Burmese" }, - { "na", "*Nauru" }, - { "ne", "*Nepali" }, - { "nl", "Nederlands" }, - { "no", "Norsk" }, - { "oc", "*Occitan" }, - { "om", "*(Afan) Oromo" }, - { "or", "*Oriya" }, - { "pa", "*Punjabi" }, - { "pl", "*Polish" }, - { "ps", "*Pashto, Pushto" }, - { "pt", "Portugues" }, - { "qu", "*Quechua" }, - { "rm", "*Rhaeto-Romance" }, - { "rn", "*Kirundi" }, - { "ro", "*Romanian" }, - { "ru", "*Russian" }, - { "rw", "*Kinyarwanda" }, - { "sa", "*Sanskrit" }, - { "sd", "*Sindhi" }, - { "sg", "*Sangho" }, - { "sh", "*Serbo-Croatian" }, - { "si", "*Sinhalese" }, - { "sk", "*Slovak" }, - { "sl", "*Slovenian" }, - { "sm", "*Samoan" }, - { "sn", "*Shona" }, - { "so", "*Somali" }, - { "sq", "*Albanian" }, - { "sr", "*Serbian" }, - { "ss", "*Siswati" }, - { "st", "*Sesotho" }, - { "su", "*Sundanese" }, - { "sv", "Svenska" }, - { "sw", "*Swahili" }, - { "ta", "*Tamil" }, - { "te", "*Telugu" }, - { "tg", "*Tajik" }, - { "th", "*Thai" }, - { "ti", "*Tigrinya" }, - { "tk", "*Turkmen" }, - { "tl", "*Tagalog" }, - { "tn", "*Setswana" }, - { "to", "*Tonga" }, - { "tr", "*Turkish" }, - { "ts", "*Tsonga" }, - { "tt", "*Tatar" }, - { "tw", "*Twi" }, - { "ug", "*Uighur" }, - { "uk", "*Ukrainian" }, - { "ur", "*Urdu" }, - { "uz", "*Uzbek" }, - { "vi", "*Vietnamese" }, - { "vo", "*Volapuk" }, - { "wo", "*Wolof" }, - { "xh", "*Xhosa" }, - { "yi", "*Yiddish" }, /* formerly ji */ - { "yo", "*Yoruba" }, - { "za", "*Zhuang" }, - { "zh", "*Chinese" }, - { "zu", "*Zulu" }, - { "\0", "" } -}; +#include "../common/languages.h" /***************************************************************************** * Local prototypes @@ -818,6 +659,53 @@ p_input->stream.pp_areas[i_title]->i_part = i_chapter; DVDSetArea( p_input, p_input->stream.pp_areas[i_title] ); + /* For audio: Find an audio channel in the specified language if a specific + * audio channel wasn't requested. If neither a language or audio channel + * were specified then use audio channel 1. */ + i_audio = main_GetIntVariable( INPUT_CHANNEL_VAR, -1 ); + if( i_audio <= 0 ) + { + char *lang = NULL; + struct lang_tbl_t *p = lang_tbl; + + while(p->p_code[0]) + { + if( !strcmp( p->p_code, main_GetPszVariable(INPUT_LANGUAGE, "") ) ) + { + lang = p->p_lang_long; + break; + } + ++p; + } + + if( lang ) + { + int i, n = 0; + /* FIXME: there may be several audio channels which use the + * specified language... should check if a particular audio type + * was requested and use it if available in the requested language. + */ + for( i=0; i_audio <= 0 && i < p_input->stream.i_es_number; ++i ) + { + char *l = p_input->stream.pp_es[i]->psz_desc; + if( p_input->stream.pp_es[i]->b_audio ) + { + ++n; // ...is this right?!?! + if( strcmp( lang, l ) == 0 ) + { + i_audio = n; + main_PutIntVariable( INPUT_CHANNEL_VAR, i_audio ); + break; + } + } + } + } + if( i_audio <= 0 ) + { + main_PutIntVariable( INPUT_CHANNEL_VAR, 1 ); + i_audio = 1; + } + } /* For audio: first one if none or a not existing one specified */ i_audio = main_GetIntVariable( INPUT_CHANNEL_VAR, 1 ); if( i_audio <= 0 ) @@ -831,7 +719,7 @@ i_spu = main_GetIntVariable( INPUT_SUBTITLE_VAR, 0 ); if( i_spu < 0 ) { - main_PutIntVariable( INPUT_CHANNEL_VAR, 1 ); + main_PutIntVariable( INPUT_SUBTITLE_VAR, 1 ); i_spu = 0; } diff -urN vlc/plugins/gnome/gnome_callbacks.c vlc-changed/plugins/gnome/gnome_callbacks.c --- vlc/plugins/gnome/gnome_callbacks.c Thu Mar 29 20:02:09 2001 +++ vlc-changed/plugins/gnome/gnome_callbacks.c Fri Mar 30 00:07:38 2001 @@ -48,6 +48,8 @@ #include "gnome_support.h" #include "intf_gnome.h" +#include "../common/languages.h" + #include "main.h" /***************************************************************************** @@ -308,7 +310,38 @@ on_menubar_preferences_activate (GtkMenuItem *menuitem, gpointer user_data) { + /* XXX: There should only ever be one pref window visible at a time. */ + GtkWidget *p_language_menu; + GtkWidget *p_language_menu_menu; + GtkWidget *p_menu_item; + struct lang_tbl_t *p = lang_tbl; + unsigned i = 0; + unsigned n = 0; + char *lang_code = main_GetPszVariable( INPUT_LANGUAGE, " " ); + + GtkWidget *p_preferences = create_intf_preferences(); + p_language_menu = GTK_WIDGET( gtk_object_get_data( + GTK_OBJECT( p_preferences ), "language_menu" ) ); + p_language_menu_menu = gtk_menu_new (); + + while( p->p_code[0] ) + { + p_menu_item = gtk_menu_item_new_with_label(_(p->p_lang_long) ); + gtk_widget_show( p_menu_item ); + gtk_menu_append( GTK_MENU (p_language_menu_menu), p_menu_item ); + + if( strcmp(p->p_code, lang_code) == 0 ) + n = i; + + ++p; ++i; + } + + gtk_option_menu_set_menu( GTK_OPTION_MENU (p_language_menu), + p_language_menu_menu ); + gtk_option_menu_set_history( GTK_OPTION_MENU (p_language_menu), n ); + gtk_widget_show( p_preferences ); + gdk_window_raise( p_preferences->window ); } @@ -938,3 +971,61 @@ gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); } + +void +on_popup_add (GtkMenuItem *menuitem, + gpointer user_data) +{ + GtkWidget *p_add_bookmark = create_intf_add_bookmark(); + gtk_widget_show( p_add_bookmark ); + gdk_window_raise( p_add_bookmark->window ); +} + +void +on_add_bookmark_cancel_clicked (GtkButton *button, + gpointer user_data) +{ + gtk_widget_hide( gtk_widget_get_toplevel( GTK_WIDGET (button) ) ); +} + +void +on_add_bookmark_ok_clicked (GtkButton *button, + gpointer user_data) +{ + fprintf(stderr, "on_add_bookmark_ok_clicked: not implemented.\n"); +} + + +gint +on_intf_preferences_close (GnomeDialog *gnomedialog, + gpointer user_data) +{ + /* XXX: how do I know if "Ok" or "Close" was pressed? */ + GtkWidget *p_language_menu; + GtkWidget *child; + + p_language_menu = GTK_WIDGET( gtk_object_get_data( + GTK_OBJECT( gnomedialog ), "language_menu" ) ); + + child = GTK_BIN(p_language_menu)->child; + { + gchar *text; + struct lang_tbl_t *p = lang_tbl; + + gtk_label_get( GTK_LABEL (child), &text ); + + while( p->p_code[0] ) + { + if( !strcmp( text, p->p_lang_long ) ) + { + main_PutPszVariable( INPUT_LANGUAGE, p->p_code ); + break; + } + ++p; + } + } + + WriteConfigFile(); + + return 0; /* XXX: return value ??? */ +} diff -urN vlc/plugins/gnome/gnome_callbacks.h vlc-changed/plugins/gnome/gnome_callbacks.h --- vlc/plugins/gnome/gnome_callbacks.h Thu Mar 29 20:02:09 2001 +++ vlc-changed/plugins/gnome/gnome_callbacks.h Fri Mar 30 00:08:46 2001 @@ -1,8 +1,8 @@ /***************************************************************************** * gnome_callbacks.h : Callbacks for the Gnome plugin. ***************************************************************************** - * Copyright (C) 2000, 2001 VideoLAN * $Id: gnome_callbacks.h,v 1.12 2001/03/21 13:42:34 sam Exp $ + * Copyright (C) 2000, 2001 VideoLAN * * Authors: Samuel Hocevar * @@ -273,3 +273,24 @@ void on_menubar_chapter_toggle (GtkCheckMenuItem *menuitem, gpointer user_data); + + +void +on_popup_add (GtkMenuItem *menuitem, + gpointer user_data); + +gint +on_intf_preferences_close (GnomeDialog *gnomedialog, + gpointer user_data); + +void +on_add_bookmark_ok (GtkButton *button, + gpointer user_data); + +void +on_add_bookmark_ok_clicked (GtkButton *button, + gpointer user_data); + +void +on_add_bookmark_cancel_clicked (GtkButton *button, + gpointer user_data); diff -urN vlc/plugins/gnome/gnome_interface.c vlc-changed/plugins/gnome/gnome_interface.c --- vlc/plugins/gnome/gnome_interface.c Thu Mar 29 20:02:09 2001 +++ vlc-changed/plugins/gnome/gnome_interface.c Fri Mar 30 00:11:11 2001 @@ -22,23 +22,23 @@ { GNOME_APP_UI_ITEM, N_("_Open File..."), N_("Open a File"), - (gpointer) on_menubar_open_activate, NULL, NULL, + on_menubar_open_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("Open _Disc..."), N_("Open a DVD or VCD"), - (gpointer) on_menubar_disc_activate, NULL, NULL, + on_menubar_disc_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CDROM, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("_Network Stream..."), N_("Select a Network Stream"), - (gpointer) on_menubar_network_activate, NULL, NULL, + on_menubar_network_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_REFRESH, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_MENU_EXIT_ITEM (on_menubar_exit_activate, NULL), @@ -50,31 +50,31 @@ { GNOME_APP_UI_ITEM, N_("_Title"), NULL, - (gpointer) NULL, NULL, NULL, + NULL, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("_Chapter"), NULL, - (gpointer) NULL, NULL, NULL, + NULL, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, N_("_Playlist..."), N_("Open the playlist window"), - (gpointer) on_menubar_playlist_activate, NULL, NULL, + on_menubar_playlist_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_INDEX, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("_Modules..."), N_("Open the plugin manager"), - (gpointer) on_menubar_modules_activate, NULL, NULL, + on_menubar_modules_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_ATTACH, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, GNOMEUIINFO_END }; @@ -84,16 +84,16 @@ { GNOME_APP_UI_ITEM, N_("_Audio"), N_("Select audio channel"), - (gpointer) NULL, NULL, NULL, + NULL, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("_Subtitle"), N_("Select subtitle unit"), - (gpointer) NULL, NULL, NULL, + NULL, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_MENU_PREFERENCES_ITEM (on_menubar_preferences_activate, NULL), @@ -262,7 +262,7 @@ 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, 2); + GNOME_DOCK_TOP, 1, 0, 0); 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); @@ -522,28 +522,47 @@ return intf_window; } +static GnomeUIInfo popup_zoom_menu_uiinfo[] = +{ + { + GNOME_APP_UI_ITEM, N_("Enlarge"), + NULL, + NULL, NULL, NULL, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_UP, + 0, 0, NULL + }, + { + GNOME_APP_UI_ITEM, N_("Shrink"), + NULL, + NULL, NULL, NULL, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_DOWN, + 0, 0, NULL + }, + GNOMEUIINFO_END +}; + static GnomeUIInfo popup_file_menu_uiinfo[] = { { GNOME_APP_UI_ITEM, N_("_Open File..."), N_("Open a File"), - (gpointer) on_popup_open_activate, NULL, NULL, + on_popup_open_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_OPEN, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("Open _Disc..."), N_("Open a DVD or VCD"), - (gpointer) on_popup_disc_activate, NULL, NULL, + on_popup_disc_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_CDROM, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("_Network Stream..."), N_("Select a Network Stream"), - (gpointer) on_popup_network_activate, NULL, NULL, + on_popup_network_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_REFRESH, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, GNOMEUIINFO_SEPARATOR, GNOMEUIINFO_MENU_ABOUT_ITEM (on_popup_about_activate, NULL), @@ -555,52 +574,66 @@ { GNOME_APP_UI_ITEM, N_("_Play"), NULL, - (gpointer) on_popup_play_activate, NULL, NULL, + on_popup_play_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_FORWARD, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("Pause"), NULL, - (gpointer) on_popup_pause_activate, NULL, NULL, + on_popup_pause_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_BOTTOM, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("Slow"), NULL, - (gpointer) on_popup_slow_activate, NULL, NULL, + on_popup_slow_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_TIMER_STOP, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("Fast"), NULL, - (gpointer) on_popup_fast_activate, NULL, NULL, + on_popup_fast_activate, NULL, NULL, GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_TIMER, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, N_("_Navigation"), N_("Navigate through titles and chapters"), - (gpointer) NULL, NULL, NULL, + NULL, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL + }, + { + GNOME_APP_UI_ITEM, N_("_Bookmark"), + NULL, + NULL, NULL, NULL, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_INDEX, + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("_Audio"), N_("Select audio channel"), - (gpointer) NULL, NULL, NULL, + NULL, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL }, { GNOME_APP_UI_ITEM, N_("_Subtitle"), N_("Select subtitle channel"), - (gpointer) NULL, NULL, NULL, + NULL, NULL, NULL, GNOME_APP_PIXMAP_NONE, NULL, - 0, (GdkModifierType) 0, NULL + 0, 0, NULL + }, + { + GNOME_APP_UI_SUBTREE, N_("_Zoom"), + NULL, + popup_zoom_menu_uiinfo, NULL, NULL, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_BLANK, + 0, 0, NULL }, GNOMEUIINFO_MENU_FILE_TREE (popup_file_menu_uiinfo), GNOMEUIINFO_SEPARATOR, @@ -647,25 +680,42 @@ gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_navigation", intf_popup_uiinfo[5].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_set_sensitive (intf_popup_uiinfo[5].widget, FALSE); gtk_widget_ref (intf_popup_uiinfo[6].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_bookmark", intf_popup_uiinfo[6].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_set_sensitive (intf_popup_uiinfo[6].widget, FALSE); gtk_widget_ref (intf_popup_uiinfo[7].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_subtitle", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_audio", intf_popup_uiinfo[7].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_set_sensitive (intf_popup_uiinfo[7].widget, FALSE); gtk_widget_ref (intf_popup_uiinfo[8].widget); - gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_file", + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_subtitle", 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), "popup_zoom", + intf_popup_uiinfo[9].widget, + (GtkDestroyNotify) gtk_widget_unref); + + gtk_widget_ref (popup_zoom_menu_uiinfo[0].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_enlarge", + popup_zoom_menu_uiinfo[0].widget, + (GtkDestroyNotify) gtk_widget_unref); + + gtk_widget_ref (popup_zoom_menu_uiinfo[1].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_shrink", + popup_zoom_menu_uiinfo[1].widget, + (GtkDestroyNotify) gtk_widget_unref); + + gtk_widget_ref (intf_popup_uiinfo[10].widget); + gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_file", + intf_popup_uiinfo[10].widget, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_ref (popup_file_menu_uiinfo[0].widget); gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_open", popup_file_menu_uiinfo[0].widget, @@ -691,14 +741,14 @@ popup_file_menu_uiinfo[4].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (intf_popup_uiinfo[9].widget); + gtk_widget_ref (intf_popup_uiinfo[11].widget); gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator2", - intf_popup_uiinfo[9].widget, + intf_popup_uiinfo[11].widget, (GtkDestroyNotify) gtk_widget_unref); - gtk_widget_ref (intf_popup_uiinfo[10].widget); + gtk_widget_ref (intf_popup_uiinfo[12].widget); gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_exit", - intf_popup_uiinfo[10].widget, + intf_popup_uiinfo[12].widget, (GtkDestroyNotify) gtk_widget_unref); return intf_popup; @@ -808,7 +858,7 @@ gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog_action_area1), 8); gnome_dialog_append_button (GNOME_DIALOG (intf_modules), GNOME_STOCK_BUTTON_OK); - modules_ok = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_modules)->buttons)->data); + modules_ok = g_list_last (GNOME_DIALOG (intf_modules)->buttons)->data; gtk_widget_ref (modules_ok); gtk_object_set_data_full (GTK_OBJECT (intf_modules), "modules_ok", modules_ok, (GtkDestroyNotify) gtk_widget_unref); @@ -816,7 +866,7 @@ GTK_WIDGET_SET_FLAGS (modules_ok, GTK_CAN_DEFAULT); gnome_dialog_append_button (GNOME_DIALOG (intf_modules), GNOME_STOCK_BUTTON_APPLY); - modules_apply = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_modules)->buttons)->data); + modules_apply = g_list_last (GNOME_DIALOG (intf_modules)->buttons)->data; gtk_widget_ref (modules_apply); gtk_object_set_data_full (GTK_OBJECT (intf_modules), "modules_apply", modules_apply, (GtkDestroyNotify) gtk_widget_unref); @@ -824,7 +874,7 @@ GTK_WIDGET_SET_FLAGS (modules_apply, GTK_CAN_DEFAULT); gnome_dialog_append_button (GNOME_DIALOG (intf_modules), GNOME_STOCK_BUTTON_CANCEL); - modules_cancel = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_modules)->buttons)->data); + modules_cancel = g_list_last (GNOME_DIALOG (intf_modules)->buttons)->data; gtk_widget_ref (modules_cancel); gtk_object_set_data_full (GTK_OBJECT (intf_modules), "modules_cancel", modules_cancel, (GtkDestroyNotify) gtk_widget_unref); @@ -921,7 +971,7 @@ gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog_action_area2), 8); gnome_dialog_append_button (GNOME_DIALOG (intf_playlist), GNOME_STOCK_BUTTON_OK); - playlist_ok = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_playlist)->buttons)->data); + playlist_ok = g_list_last (GNOME_DIALOG (intf_playlist)->buttons)->data; gtk_widget_ref (playlist_ok); gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "playlist_ok", playlist_ok, (GtkDestroyNotify) gtk_widget_unref); @@ -1097,7 +1147,7 @@ gtk_button_box_set_spacing (GTK_BUTTON_BOX (dialog_action_area4), 8); gnome_dialog_append_button (GNOME_DIALOG (intf_disc), GNOME_STOCK_BUTTON_OK); - disc_ok = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_disc)->buttons)->data); + disc_ok = g_list_last (GNOME_DIALOG (intf_disc)->buttons)->data; gtk_widget_ref (disc_ok); gtk_object_set_data_full (GTK_OBJECT (intf_disc), "disc_ok", disc_ok, (GtkDestroyNotify) gtk_widget_unref); @@ -1105,7 +1155,7 @@ GTK_WIDGET_SET_FLAGS (disc_ok, GTK_CAN_DEFAULT); gnome_dialog_append_button (GNOME_DIALOG (intf_disc), GNOME_STOCK_BUTTON_CANCEL); - disc_cancel = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_disc)->buttons)->data); + disc_cancel = g_list_last (GNOME_DIALOG (intf_disc)->buttons)->data; gtk_widget_ref (disc_cancel); gtk_object_set_data_full (GTK_OBJECT (intf_disc), "disc_cancel", disc_cancel, (GtkDestroyNotify) gtk_widget_unref); @@ -1271,7 +1321,7 @@ gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox1), 8); gnome_dialog_append_button (GNOME_DIALOG (intf_network), GNOME_STOCK_BUTTON_OK); - network_ok = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_network)->buttons)->data); + network_ok = g_list_last (GNOME_DIALOG (intf_network)->buttons)->data; gtk_widget_ref (network_ok); gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_ok", network_ok, (GtkDestroyNotify) gtk_widget_unref); @@ -1279,7 +1329,7 @@ GTK_WIDGET_SET_FLAGS (network_ok, GTK_CAN_DEFAULT); gnome_dialog_append_button (GNOME_DIALOG (intf_network), GNOME_STOCK_BUTTON_CANCEL); - network_cancel = GTK_WIDGET (g_list_last (GNOME_DIALOG (intf_network)->buttons)->data); + network_cancel = g_list_last (GNOME_DIALOG (intf_network)->buttons)->data; gtk_widget_ref (network_cancel); gtk_object_set_data_full (GTK_OBJECT (intf_network), "network_cancel", network_cancel, (GtkDestroyNotify) gtk_widget_unref); @@ -1294,5 +1344,194 @@ NULL); return intf_network; +} + +GtkWidget* +create_intf_add_bookmark (void) +{ + GtkWidget *intf_add_bookmark; + GtkWidget *vbox8; + GtkWidget *hbox9; + GtkWidget *label23; + GtkWidget *entry1; + GtkWidget *hbuttonbox2; + GtkWidget *button4; + GtkWidget *button5; + + intf_add_bookmark = gnome_dialog_new (_("Add Bookmark"), NULL); + gtk_object_set_data (GTK_OBJECT (intf_add_bookmark), "intf_add_bookmark", intf_add_bookmark); + gtk_window_set_modal (GTK_WINDOW (intf_add_bookmark), TRUE); + gtk_window_set_policy (GTK_WINDOW (intf_add_bookmark), FALSE, FALSE, FALSE); + + vbox8 = GNOME_DIALOG (intf_add_bookmark)->vbox; + gtk_object_set_data (GTK_OBJECT (intf_add_bookmark), "vbox8", vbox8); + gtk_widget_show (vbox8); + + hbox9 = gtk_hbox_new (FALSE, 0); + gtk_widget_ref (hbox9); + gtk_object_set_data_full (GTK_OBJECT (intf_add_bookmark), "hbox9", hbox9, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (hbox9); + gtk_box_pack_start (GTK_BOX (vbox8), hbox9, TRUE, TRUE, 0); + + label23 = gtk_label_new (_("Name:")); + gtk_widget_ref (label23); + gtk_object_set_data_full (GTK_OBJECT (intf_add_bookmark), "label23", label23, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label23); + gtk_box_pack_start (GTK_BOX (hbox9), label23, FALSE, FALSE, 0); + + entry1 = gtk_entry_new (); + gtk_widget_ref (entry1); + gtk_object_set_data_full (GTK_OBJECT (intf_add_bookmark), "entry1", entry1, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (entry1); + gtk_box_pack_start (GTK_BOX (hbox9), entry1, TRUE, TRUE, 0); + + hbuttonbox2 = GNOME_DIALOG (intf_add_bookmark)->action_area; + gtk_object_set_data (GTK_OBJECT (intf_add_bookmark), "hbuttonbox2", hbuttonbox2); + gtk_widget_show (hbuttonbox2); + gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox2), GTK_BUTTONBOX_END); + gtk_button_box_set_spacing (GTK_BUTTON_BOX (hbuttonbox2), 8); + + gnome_dialog_append_button (GNOME_DIALOG (intf_add_bookmark), GNOME_STOCK_BUTTON_OK); + button4 = g_list_last (GNOME_DIALOG (intf_add_bookmark)->buttons)->data; + gtk_widget_ref (button4); + gtk_object_set_data_full (GTK_OBJECT (intf_add_bookmark), "button4", button4, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button4); + GTK_WIDGET_SET_FLAGS (button4, GTK_CAN_DEFAULT); + + gnome_dialog_append_button (GNOME_DIALOG (intf_add_bookmark), GNOME_STOCK_BUTTON_CANCEL); + button5 = g_list_last (GNOME_DIALOG (intf_add_bookmark)->buttons)->data; + gtk_widget_ref (button5); + gtk_object_set_data_full (GTK_OBJECT (intf_add_bookmark), "button5", button5, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (button5); + GTK_WIDGET_SET_FLAGS (button5, GTK_CAN_DEFAULT); + + gtk_signal_connect (GTK_OBJECT (button4), "clicked", + GTK_SIGNAL_FUNC (on_add_bookmark_ok_clicked), + NULL); + gtk_signal_connect (GTK_OBJECT (button5), "clicked", + GTK_SIGNAL_FUNC (on_add_bookmark_cancel_clicked), + NULL); + + return intf_add_bookmark; +} + +GtkWidget* +create_intf_preferences (void) +{ + GtkWidget *intf_preferences; + GtkWidget *notebook1; + GtkWidget *table3; + GtkWidget *label26; + GtkWidget *language_menu; + GtkWidget *language_menu_menu; + GtkWidget *glade_menuitem; + GtkWidget *label27; + GtkWidget *audio_type_menu; + GtkWidget *audio_type_menu_menu; + GtkWidget *label24; + GtkWidget *empty_notebook_page; + GtkWidget *label25; + + intf_preferences = gnome_property_box_new (); + gtk_object_set_data (GTK_OBJECT (intf_preferences), "intf_preferences", intf_preferences); + gtk_window_set_title (GTK_WINDOW (intf_preferences), _("VideoLAN Preferences")); + gtk_window_set_policy (GTK_WINDOW (intf_preferences), FALSE, FALSE, FALSE); + + notebook1 = GNOME_PROPERTY_BOX (intf_preferences)->notebook; + gtk_object_set_data (GTK_OBJECT (intf_preferences), "notebook1", notebook1); + gtk_widget_show (notebook1); + + table3 = gtk_table_new (2, 2, FALSE); + gtk_widget_ref (table3); + gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "table3", table3, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (table3); + gtk_container_add (GTK_CONTAINER (notebook1), table3); + + label26 = gtk_label_new (_("Preferred Language")); + gtk_widget_ref (label26); + gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "label26", label26, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label26); + gtk_table_attach (GTK_TABLE (table3), label26, 0, 1, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label26), GTK_JUSTIFY_LEFT); + + language_menu = gtk_option_menu_new (); + gtk_widget_ref (language_menu); + gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "language_menu", language_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (language_menu); + gtk_table_attach (GTK_TABLE (table3), language_menu, 1, 2, 0, 1, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + language_menu_menu = gtk_menu_new (); + glade_menuitem = gtk_menu_item_new_with_label (_("None")); + gtk_widget_show (glade_menuitem); + gtk_menu_append (GTK_MENU (language_menu_menu), glade_menuitem); + gtk_option_menu_set_menu (GTK_OPTION_MENU (language_menu), language_menu_menu); + + label27 = gtk_label_new (_("Preferred Audio Type")); + gtk_widget_ref (label27); + gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "label27", label27, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label27); + gtk_table_attach (GTK_TABLE (table3), label27, 0, 1, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + gtk_label_set_justify (GTK_LABEL (label27), GTK_JUSTIFY_LEFT); + + audio_type_menu = gtk_option_menu_new (); + gtk_widget_ref (audio_type_menu); + gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "audio_type_menu", audio_type_menu, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (audio_type_menu); + gtk_table_attach (GTK_TABLE (table3), audio_type_menu, 1, 2, 1, 2, + (GtkAttachOptions) (0), + (GtkAttachOptions) (0), 0, 0); + audio_type_menu_menu = gtk_menu_new (); + glade_menuitem = gtk_menu_item_new_with_label (_("AC3")); + gtk_widget_show (glade_menuitem); + gtk_menu_append (GTK_MENU (audio_type_menu_menu), glade_menuitem); + glade_menuitem = gtk_menu_item_new_with_label (_("lpcm")); + gtk_widget_show (glade_menuitem); + gtk_menu_append (GTK_MENU (audio_type_menu_menu), glade_menuitem); + glade_menuitem = gtk_menu_item_new_with_label (_("mpeg")); + gtk_widget_show (glade_menuitem); + gtk_menu_append (GTK_MENU (audio_type_menu_menu), glade_menuitem); + glade_menuitem = gtk_menu_item_new_with_label (_("off")); + gtk_widget_show (glade_menuitem); + gtk_menu_append (GTK_MENU (audio_type_menu_menu), glade_menuitem); + gtk_option_menu_set_menu (GTK_OPTION_MENU (audio_type_menu), audio_type_menu_menu); + + label24 = gtk_label_new (_("Audio")); + gtk_widget_ref (label24); + gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "label24", label24, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label24); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 0), label24); + + empty_notebook_page = gtk_vbox_new (FALSE, 0); + gtk_widget_show (empty_notebook_page); + gtk_container_add (GTK_CONTAINER (notebook1), empty_notebook_page); + + label25 = gtk_label_new (_("Subtitles")); + gtk_widget_ref (label25); + gtk_object_set_data_full (GTK_OBJECT (intf_preferences), "label25", label25, + (GtkDestroyNotify) gtk_widget_unref); + gtk_widget_show (label25); + gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook1), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook1), 1), label25); + + gtk_signal_connect (GTK_OBJECT (intf_preferences), "close", + GTK_SIGNAL_FUNC (on_intf_preferences_close), + NULL); + + return intf_preferences; } diff -urN vlc/plugins/gnome/gnome_interface.h vlc-changed/plugins/gnome/gnome_interface.h --- vlc/plugins/gnome/gnome_interface.h Thu Mar 29 20:02:09 2001 +++ vlc-changed/plugins/gnome/gnome_interface.h Fri Mar 30 00:11:16 2001 @@ -10,3 +10,5 @@ GtkWidget* create_intf_playlist (void); GtkWidget* create_intf_disc (void); GtkWidget* create_intf_network (void); +GtkWidget* create_intf_add_bookmark (void); +GtkWidget* create_intf_preferences (void); diff -urN vlc/plugins/gnome/intf_gnome.c vlc-changed/plugins/gnome/intf_gnome.c --- vlc/plugins/gnome/intf_gnome.c Thu Mar 29 20:02:09 2001 +++ vlc-changed/plugins/gnome/intf_gnome.c Fri Mar 30 00:12:26 2001 @@ -244,6 +244,12 @@ gtk_object_set_data( GTK_OBJECT(p_intf->p_sys->p_adj), "p_intf", p_intf ); + /* make preferences menu active... */ + gtk_widget_set_sensitive( + GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( + p_intf->p_sys->p_window ), "menubar_preferences" ) ), + TRUE); + /* Show the control window */ gtk_widget_show( p_intf->p_sys->p_window ); @@ -627,6 +633,27 @@ return TRUE; } +static void GnomeSetupBookmarksMenu( GtkWidget *p_root ) +{ + GtkWidget * p_menu; + GtkWidget * p_item_off; + GtkWidget * p_separator; + + p_menu = gtk_menu_new(); + p_item_off = gtk_menu_item_new_with_label( "Add..." ); + gtk_widget_show( p_item_off ); + gtk_menu_append( GTK_MENU( p_menu ), p_item_off ); + gtk_signal_connect( GTK_OBJECT( p_item_off ), "activate", + GTK_SIGNAL_FUNC( on_popup_add ), NULL ); + + p_separator = gtk_menu_item_new(); + gtk_widget_show( p_separator ); + gtk_menu_append( GTK_MENU( p_menu ), p_separator ); + gtk_widget_set_sensitive( p_separator, FALSE ); + + gtk_menu_item_set_submenu( GTK_MENU_ITEM( p_root ), p_menu ); +} + /***************************************************************************** * GnomeSetupMenu: function that generates title/chapter/audio/subpic * menus with help from preceding functions @@ -653,6 +680,9 @@ p_intf->p_sys->p_popup ), "popup_navigation" ) ); GnomeTitleMenu( p_intf, p_popup_menu, on_popup_navigation_toggle ); + + GnomeSetupBookmarksMenu( GTK_WIDGET( gtk_object_get_data( GTK_OBJECT( + p_intf->p_sys->p_popup ), "popup_bookmark" ) ) ); /* look for selected ES */ p_audio_es = NULL; diff -urN vlc/plugins/gnome/intf_gnome.glade vlc-changed/plugins/gnome/intf_gnome.glade --- vlc/plugins/gnome/intf_gnome.glade Thu Jan 1 10:00:00 1970 +++ vlc-changed/plugins/gnome/intf_gnome.glade Fri Mar 30 00:12:56 2001 @@ -0,0 +1,2037 @@ + + + + + VideoLAN Client + vlc + + + pixmaps + C + True + True + False + 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 + + + drag_data_received + on_intf_window_drag_data_received + Fri, 16 Feb 2001 01:59:35 GMT + + VideoLAN Client + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + True + + + GnomeDock + GnomeApp:dock + dockitem + 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 + Open a File + + activate + on_menubar_open_activate + Sun, 04 Mar 2001 21:01:45 GMT + + + False + GNOME_STOCK_MENU_OPEN + + + + GtkPixmapMenuItem + menubar_disc + Open a DVD or VCD + + activate + on_menubar_disc_activate + Sun, 04 Mar 2001 01:28:32 GMT + + + False + GNOME_STOCK_MENU_CDROM + + + + GtkPixmapMenuItem + menubar_network + Select a Network Stream + + activate + on_menubar_network_activate + Mon, 12 Mar 2001 14:33:42 GMT + + + False + GNOME_STOCK_MENU_REFRESH + + + + 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 + + + GtkMenuItem + menubar_title + False + + False + + + + GtkMenuItem + menubar_chapter + False + + False + + + + GtkMenuItem + separator7 + False + + + + GtkPixmapMenuItem + menubar_playlist + False + Open the playlist window + + activate + on_menubar_playlist_activate + Sun, 11 Feb 2001 16:55:04 GMT + + + False + GNOME_STOCK_MENU_INDEX + + + + GtkPixmapMenuItem + menubar_modules + False + Open the plugin manager + + activate + on_menubar_modules_activate + Tue, 13 Feb 2001 17:19:41 GMT + + + False + GNOME_STOCK_MENU_ATTACH + + + + + + GtkMenuItem + menubar_settings + GNOMEUIINFO_MENU_SETTINGS_TREE + + + GtkMenu + menubar_settings_menu + + + GtkMenuItem + menubar_audio + False + Select audio channel + + False + + + + GtkMenuItem + menubar_subtitle + False + Select subtitle unit + + False + + + + GtkMenuItem + separator5 + False + + + + GtkPixmapMenuItem + menubar_preferences + False + + 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 + GNOME_DOCK_TOP + 1 + 0 + 0 + False + True + False + False + False + GTK_SHADOW_OUT + + + GtkToolbar + toolbar + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_BOTH + 16 + GTK_TOOLBAR_SPACE_LINE + GTK_RELIEF_NONE + True + + + GtkButton + Toolbar:button + toolbar_file + Open a File + + clicked + on_toolbar_open_clicked + Sun, 04 Mar 2001 21:01:24 GMT + + + GNOME_STOCK_PIXMAP_OPEN + + + + GtkButton + Toolbar:button + toolbar_disc + Open a DVD or VCD + + clicked + on_toolbar_disc_clicked + Sun, 04 Mar 2001 01:27:51 GMT + + + GNOME_STOCK_PIXMAP_CDROM + + + + GtkButton + Toolbar:button + toolbar_network + Select a Network Stream + + clicked + on_toolbar_network_clicked + Mon, 12 Mar 2001 14:32:18 GMT + + + GNOME_STOCK_PIXMAP_REFRESH + + + + GtkButton + Toolbar:button + toolbar_back + False + 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 + False + 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_BOTTOM + + + + GtkButton + Toolbar:button + toolbar_slow + Play Slower + + clicked + on_toolbar_slow_clicked + Mon, 12 Feb 2001 07:20:42 GMT + + + GNOME_STOCK_PIXMAP_TIMER_STOP + + + + GtkButton + Toolbar:button + toolbar_fast + Play Faster + + clicked + on_toolbar_fast_clicked + Mon, 12 Feb 2001 07:20:48 GMT + + + GNOME_STOCK_PIXMAP_TIMER + + + + GtkButton + Toolbar:button + toolbar_playlist + False + 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 + + + + + + GtkVBox + GnomeDock:contents + vbox2 + False + 0 + + + GtkHBox + hbox4 + True + 0 + + 0 + True + True + + + + GtkLabel + label_date + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label_status + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkLabel + label_bar + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + GtkHScale + slider + True + + button_press_event + on_slider_button_press_event + Wed, 14 Mar 2001 13:46:55 GMT + + + button_release_event + on_slider_button_release_event + Wed, 14 Mar 2001 13:46:59 GMT + + False + GTK_POS_TOP + 3 + GTK_UPDATE_CONTINUOUS + 0 + 0 + 100 + 1 + 6.25 + 0 + + 0 + True + True + + + + + + + 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_BOTTOM + + + + GtkPixmapMenuItem + popup_slow + + activate + on_popup_slow_activate + Mon, 12 Feb 2001 07:19:57 GMT + + + False + GNOME_STOCK_MENU_TIMER_STOP + + + + GtkPixmapMenuItem + popup_fast + + activate + on_popup_fast_activate + Mon, 12 Feb 2001 07:19:57 GMT + + + False + GNOME_STOCK_MENU_TIMER + + + + GtkMenuItem + separator3 + False + + + + GtkMenuItem + popup_navigation + Navigate through titles and chapters + + False + + + + GtkPixmapMenuItem + popup_bookmark + + False + GNOME_STOCK_MENU_INDEX + + + + GtkMenuItem + popup_audio + Select audio channel + + False + + + + GtkMenuItem + popup_subtitle + Select subtitle channel + + False + + + + GtkPixmapMenuItem + popup_zoom + + False + GNOME_STOCK_MENU_BLANK + + + GtkMenu + popup_zoom_menu + + + GtkPixmapMenuItem + popup_enlarge + + False + GNOME_STOCK_MENU_UP + + + + GtkPixmapMenuItem + popup_shrink + + False + GNOME_STOCK_MENU_DOWN + + + + + + GtkMenuItem + popup_file + GNOMEUIINFO_MENU_FILE_TREE + + + GtkMenu + popup_file_menu + + + GtkPixmapMenuItem + popup_open + Open a File + + activate + on_popup_open_activate + Sun, 04 Mar 2001 21:01:58 GMT + + + False + GNOME_STOCK_MENU_OPEN + + + + GtkPixmapMenuItem + popup_disc + Open a DVD or VCD + + activate + on_popup_disc_activate + Sun, 04 Mar 2001 02:57:11 GMT + + + False + GNOME_STOCK_MENU_CDROM + + + + GtkPixmapMenuItem + popup_network + Select a Network Stream + + activate + on_popup_network_activate + Mon, 12 Mar 2001 14:57:25 GMT + + + False + GNOME_STOCK_MENU_REFRESH + + + + GtkMenuItem + separator4 + False + + + + GtkPixmapMenuItem + popup_about + + activate + on_popup_about_activate + Mon, 12 Feb 2001 00:00:08 GMT + + GNOMEUIINFO_MENU_ABOUT_ITEM + + + + + + GtkMenuItem + separator2 + False + + + + 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> +Pierre Baillet <oct@zoy.org> +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> +Arnaud de Bossoreille de Ribou <bozo@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 + True + 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 + + + + + + GtkButton + FileSel:cancel_button + fileopen_cancel + True + True + + clicked + on_fileopen_cancel_clicked + Sun, 11 Feb 2001 18:22:50 GMT + + + + + + + GnomeDialog + intf_modules + + destroy + on_intf_modules_destroy + Tue, 13 Feb 2001 09:19:08 GMT + + Modules + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox1 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area1 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + modules_ok + True + True + + clicked + on_modules_ok_clicked + Tue, 13 Feb 2001 09:21:29 GMT + + GNOME_STOCK_BUTTON_OK + + + + GtkButton + modules_apply + True + True + + clicked + on_modules_apply_clicked + Tue, 13 Feb 2001 09:21:25 GMT + + GNOME_STOCK_BUTTON_APPLY + + + + GtkButton + modules_cancel + True + True + + clicked + on_modules_cancel_clicked + Tue, 13 Feb 2001 09:21:34 GMT + + GNOME_STOCK_BUTTON_CANCEL + + + + + GtkLabel + label12 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + + + GnomeDialog + intf_playlist + + destroy + on_intf_playlist_destroy + Tue, 13 Feb 2001 09:18:45 GMT + + Playlist + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + True + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox2 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area2 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + playlist_ok + True + True + + clicked + on_playlist_ok_clicked + Tue, 13 Feb 2001 09:20:38 GMT + + GNOME_STOCK_BUTTON_OK + + + + + GtkLabel + label11 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkScrolledWindow + scrolledwindow3 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkCList + clist2 + True + 3 + 211,49,35 + GTK_SELECTION_SINGLE + False + GTK_SHADOW_IN + + + GtkLabel + CList:title + label8 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label9 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkLabel + CList:title + label10 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + + GnomeDialog + intf_disc + Open Disc + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox4 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area4 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + disc_ok + True + True + + clicked + on_disc_ok_clicked + Sun, 04 Mar 2001 01:33:55 GMT + + GNOME_STOCK_BUTTON_OK + + + + GtkButton + disc_cancel + True + True + + clicked + on_disc_cancel_clicked + Sun, 04 Mar 2001 01:33:50 GMT + + GNOME_STOCK_BUTTON_CANCEL + + + + + GtkHBox + hbox2 + False + 5 + + 0 + True + True + + + + GtkFrame + frame1 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkVBox + vbox4 + False + 0 + + + GtkRadioButton + disc_dvd + True + + toggled + on_disc_dvd_toggled + Sun, 04 Mar 2001 02:12:52 GMT + + + False + True + disc + + 0 + False + False + + + + + GtkRadioButton + disc_vcd + False + True + + toggled + on_disc_vcd_toggled + Sun, 04 Mar 2001 02:12:58 GMT + + + False + True + disc + + 0 + False + False + + + + + + + GtkFrame + frame2 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkTable + table1 + 5 + 2 + 2 + False + 5 + 5 + + + GtkLabel + label15 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label16 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkSpinButton + disc_title + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 + 1 + 65536 + 1 + 10 + 10 + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + GtkSpinButton + disc_chapter + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 + 1 + 65536 + 1 + 10 + 10 + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + + + + GtkHBox + hbox1 + False + 5 + + 0 + True + True + + + + GtkLabel + label14 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + disc_name + True + True + True + 0 + /dev/dvd + + 0 + True + True + + + + + + + + GnomeDialog + intf_network + Network Stream + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + vbox5 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + hbuttonbox1 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + network_ok + True + True + + clicked + on_network_ok_clicked + Mon, 12 Mar 2001 14:56:40 GMT + + GNOME_STOCK_BUTTON_OK + + + + GtkButton + network_cancel + True + True + + clicked + on_network_cancel_clicked + Mon, 12 Mar 2001 14:56:51 GMT + + GNOME_STOCK_BUTTON_CANCEL + + + + + GtkHBox + hbox3 + False + 5 + + 0 + True + True + + + + GtkFrame + frame3 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkVBox + vbox6 + False + 0 + + + GtkRadioButton + network_ts + True + + False + True + network + + 0 + False + False + + + + + GtkRadioButton + network_rtp + False + True + + False + True + network + + 0 + False + False + + + + + GtkRadioButton + network_http + False + True + + False + True + network + + 0 + False + False + + + + + + + GtkFrame + frame4 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkTable + table2 + 5 + 2 + 2 + False + 5 + 5 + + + GtkLabel + label17 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label18 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkSpinButton + network_port + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1234 + 0 + 65535 + 1 + 10 + 10 + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkEntry + network_server + True + True + True + 0 + vls + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + + + + + + GnomeDialog + intf_add_bookmark + Add Bookmark + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + True + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + vbox8 + False + 8 + + 4 + True + True + + + + GtkHButtonBox + GnomeDialog:action_area + hbuttonbox2 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button4 + True + True + + clicked + on_add_bookmark_ok_clicked + Sun, 25 Mar 2001 05:30:30 GMT + + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button5 + True + True + + clicked + on_add_bookmark_cancel_clicked + Sun, 25 Mar 2001 05:30:40 GMT + + GNOME_STOCK_BUTTON_CANCEL + + + + + GtkHBox + hbox9 + False + 0 + + 0 + True + True + + + + GtkLabel + label23 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + entry1 + True + True + True + 0 + + + 0 + True + True + + + + + + + + GnomePropertyBox + intf_preferences + + close + on_intf_preferences_close + Sat, 24 Mar 2001 12:54:35 GMT + + VideoLAN Preferences + GTK_WIN_POS_NONE + False + False + False + False + + + GtkNotebook + GnomePropertyBox:notebook + notebook1 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + 0 + True + True + + + + GtkTable + table3 + 2 + 2 + False + 0 + 0 + + + GtkLabel + label26 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + False + False + + + + + GtkOptionMenu + language_menu + True + None + + 0 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + False + False + + + + + GtkLabel + label27 + + GTK_JUSTIFY_LEFT + False + 0.5 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + False + False + + + + + GtkOptionMenu + audio_type_menu + True + AC3 +lpcm +mpeg +off + + 0 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + False + False + + + + + + GtkLabel + Notebook:tab + label24 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + Placeholder + + + + GtkLabel + Notebook:tab + label25 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + diff -urN vlc/src/interface/main.c vlc-changed/src/interface/main.c --- vlc/src/interface/main.c Thu Mar 29 20:02:09 2001 +++ vlc-changed/src/interface/main.c Fri Mar 30 00:15:25 2001 @@ -4,7 +4,7 @@ * and spawn threads. ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: main.c,v 1.80 2001/03/21 13:42:34 sam Exp $ + * $Id: main.c,v 1.10 2001/03/25 04:11:56 shaneh Exp shaneh $ * * Authors: Vincent Seguin * Samuel Hocevar @@ -31,6 +31,7 @@ #include /* SIGHUP, SIGINT, SIGKILL */ #include /* sprintf() */ +#include #ifdef HAVE_GETOPT_H #include /* getopt() */ @@ -47,6 +48,8 @@ #include /* ENOMEM */ #include /* getenv(), strtol(), */ #include /* strerror() */ +#include /* opendir() */ +#include /* mkdir() */ #include "config.h" #include "common.h" @@ -179,6 +182,8 @@ * Local prototypes *****************************************************************************/ static void SetDefaultConfiguration ( void ); +static void CreateConfigDirIfRequired( void ); +static void ReadConfigFile ( void ); static int GetConfiguration ( int i_argc, char *ppsz_argv[], char *ppsz_env[] ); static int GetFilenames ( int i_argc, char *ppsz_argv[] ); @@ -191,6 +196,7 @@ static int CPUCapabilities ( void ); + /***************************************************************************** * main: parse command line, start interface and spawn threads ***************************************************************************** @@ -253,6 +259,8 @@ /* * Read configuration */ + CreateConfigDirIfRequired(); + ReadConfigFile(); if( GetConfiguration( i_argc, ppsz_argv, ppsz_env ) ) /* parse cmd line */ { intf_MsgDestroy(); @@ -499,7 +507,6 @@ main_PutPszVariable( psz_name, psz_value ); } -/* following functions are local */ /***************************************************************************** * SetDefaultConfiguration: set default options @@ -519,6 +526,86 @@ p_main->b_vlans = 0; } + +int GetConfigDirName( char *buff, int len ) +{ + const char *configDir = ".vlc"; + struct passwd *pwent = getpwuid( getuid() ); + + if( pwent == NULL ) + return 1; + + if( strlen( pwent->pw_dir ) + strlen( configDir ) + 2 > len ) + return 1; + + sprintf( buff, "%s/%s", pwent->pw_dir, configDir ); + return 0; +} + +static char *GetConfigFilePathName( void ) +{ + const char *configFileName = "config"; + static char pathName[256] = ""; + + if( pathName[0] ) return pathName; + + GetConfigDirName( pathName, sizeof(pathName) ); + if( strlen( pathName ) + strlen( configFileName ) + 2 > sizeof( pathName ) ) + { + pathName[0] = 0; + return NULL; + } + if( strlen( pathName ) ) + strcat( pathName, "/" ); + strcat( pathName, configFileName ); + return pathName; +} + +static void CreateConfigDirIfRequired( void ) +{ + static char pathName[256] = ""; + + GetConfigDirName( pathName, sizeof(pathName) ); + (void)opendir( pathName ); + if( errno == ENOTDIR ) return; + if( errno == ENOENT ) + mkdir( pathName, 0775 ); +} + +/***************************************************************************** + * ReadConfigFile + ***************************************************************************** + * This is _very_ basic... no comments allowed in config file, etc. + *****************************************************************************/ +static void ReadConfigFile( void ) +{ + FILE *fp = fopen( GetConfigFilePathName(), "r" ); + if( !fp ) return; + while( !feof( fp ) ) + { + char option[256], value[256]; + if( fscanf(fp, "%s %s", option, value) == 2) + { + /* don't yet handle int option values... */ + main_PutPszVariable( option, value ); + } + } + fclose(fp); +} + +void WriteConfigFile( void ) +{ + FILE *fp = fopen( GetConfigFilePathName(), "w" ); + if( !fp ) return; + { + char *p = main_GetPszVariable( INPUT_LANGUAGE, "" ); + while( *p == ' ') ++p; + if( *p ) + fprintf( fp, INPUT_LANGUAGE" %s\n", p ); + } + fclose(fp); +} + /***************************************************************************** * GetConfiguration: parse command line ***************************************************************************** @@ -807,6 +894,7 @@ "\n " INPUT_CHAPTER_VAR "= \tchapter number" "\n " INPUT_AUDIO_VAR "={ac3|lpcm|mpeg|off} \taudio type" "\n " INPUT_CHANNEL_VAR "=[0-15] \taudio channel" + "\n " INPUT_LANGUAGE "= \tlanguage (only used if audio channel not specified.)" "\n " INPUT_SUBTITLE_VAR "=[0-31] \tsubtitle channel" ); /* Input parameters */