From 93e9e860d75ac0e4e449716cfb65518e14409d4f Mon Sep 17 00:00:00 2001 From: diego Date: Sun, 14 Feb 2010 12:55:02 +0000 Subject: Rename gui/mplayer/gtk/menu.[ch] --> gui/mplayer/gtk/gtkmenu.[ch]. This avoids confusion with headers of the same name in other places. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30573 b3059339-0415-0410-9bf9-f77b7e298cf2 --- gui/mplayer/gtk/gtk_menu.c | 645 +++++++++++++++++++++++++++++++++++++++++++++ gui/mplayer/gtk/gtk_menu.h | 31 +++ gui/mplayer/gtk/menu.c | 645 --------------------------------------------- gui/mplayer/gtk/menu.h | 31 --- gui/mplayer/menu.c | 4 +- gui/mplayer/widgets.c | 3 +- 6 files changed, 679 insertions(+), 680 deletions(-) create mode 100644 gui/mplayer/gtk/gtk_menu.c create mode 100644 gui/mplayer/gtk/gtk_menu.h delete mode 100644 gui/mplayer/gtk/menu.c delete mode 100644 gui/mplayer/gtk/menu.h (limited to 'gui/mplayer') diff --git a/gui/mplayer/gtk/gtk_menu.c b/gui/mplayer/gtk/gtk_menu.c new file mode 100644 index 0000000000..14387f84ca --- /dev/null +++ b/gui/mplayer/gtk/gtk_menu.c @@ -0,0 +1,645 @@ +/* + * This file is part of MPlayer. + * + * MPlayer 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. + * + * MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include +#include +#include + +#include "config.h" +#include "help_mp.h" +#include "access_mpcontext.h" +#include "mixer.h" + +#include "gtk_menu.h" +#include "gui/mplayer/widgets.h" +#include "gui/mplayer/gmplayer.h" +#include "gui/app.h" + +#include "stream/stream.h" +#include "libmpdemux/demuxer.h" +#include "libmpdemux/stheader.h" + +#include "gui/mplayer/pixmaps/ab.xpm" +#include "gui/mplayer/pixmaps/half.xpm" +#include "gui/mplayer/pixmaps/normal.xpm" +#include "gui/mplayer/pixmaps/double.xpm" +#include "gui/mplayer/pixmaps/fs.xpm" +#include "gui/mplayer/pixmaps/exit.xpm" +#include "gui/mplayer/pixmaps/prefs.xpm" +#include "gui/mplayer/pixmaps/eq.xpm" +#include "gui/mplayer/pixmaps/pl.xpm" +#include "gui/mplayer/pixmaps/skin.xpm" +#include "gui/mplayer/pixmaps/sound.xpm" +#include "gui/mplayer/pixmaps/open.xpm" +#include "gui/mplayer/pixmaps/play.xpm" +#include "gui/mplayer/pixmaps/stop2.xpm" +#include "gui/mplayer/pixmaps/pause.xpm" +#include "gui/mplayer/pixmaps/prev.xpm" +#include "gui/mplayer/pixmaps/next.xpm" +#include "gui/mplayer/pixmaps/aspect.xpm" +#include "gui/mplayer/pixmaps/a11.xpm" +#include "gui/mplayer/pixmaps/a169.xpm" +#include "gui/mplayer/pixmaps/a235.xpm" +#include "gui/mplayer/pixmaps/a43.xpm" +#include "gui/mplayer/pixmaps/file2.xpm" +#include "gui/mplayer/pixmaps/url.xpm" +#include "gui/mplayer/pixmaps/sub.xpm" +#include "gui/mplayer/pixmaps/delsub.xpm" +#include "gui/mplayer/pixmaps/empty.xpm" +#include "gui/mplayer/pixmaps/loadeaf.xpm" +#include "gui/mplayer/pixmaps/title.xpm" +#ifdef CONFIG_DVDREAD +#include "gui/mplayer/pixmaps/dvd.xpm" +#include "gui/mplayer/pixmaps/playdvd.xpm" +#include "gui/mplayer/pixmaps/chapter.xpm" +#include "gui/mplayer/pixmaps/dolby.xpm" +#include "gui/mplayer/pixmaps/tongue.xpm" +#include "gui/mplayer/pixmaps/tonguebla.xpm" +#include "gui/mplayer/pixmaps/empty1px.xpm" +#endif +#ifdef CONFIG_VCD +#include "gui/mplayer/pixmaps/vcd.xpm" +#include "gui/mplayer/pixmaps/playvcd.xpm" +#endif + +void ActivateMenuItem( int Item ) +{ +// fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 ); + gtkPopupMenu=Item & 0x0000ffff; + gtkPopupMenuParam=Item >> 16; + mplEventHandling( Item & 0x0000ffff,Item >> 16 ); +} + +static GtkWidget * AddMenuCheckItem(GtkWidget *window1, const char * immagine_xpm, GtkWidget* Menu,const char* label, gboolean state, int Number) +{ + GtkWidget * Label = NULL; + GtkWidget * Pixmap = NULL; + GtkWidget * hbox = NULL; + GtkWidget * Item = NULL; + + GdkPixmap *PixmapIcon = NULL; + GdkColor transparent; + GdkBitmap *MaskIcon = NULL; + + PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); + Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); + gdk_pixmap_unref (PixmapIcon); + + Item=gtk_check_menu_item_new(); + Label = gtk_label_new (label); + + hbox = gtk_hbox_new (FALSE, 8); + gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); + gtk_container_add (GTK_CONTAINER (Item), hbox); + + gtk_menu_append( GTK_MENU( Menu ),Item ); + + gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state); + gtk_signal_connect_object( GTK_OBJECT(Item),"activate", + GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); + gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); + gtk_widget_show_all(Item); + + return Item; +} +GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm, GtkWidget * SubMenu,const char * label,int Number ) +{ + GtkWidget * Label = NULL; + GtkWidget * Pixmap = NULL; + GtkWidget * hbox = NULL; + GtkWidget * Item = NULL; + GdkPixmap * PixmapIcon = NULL; + GdkColor transparent; + GdkBitmap * MaskIcon = NULL; + + PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); + Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); + gdk_pixmap_unref (PixmapIcon); + + Item=gtk_menu_item_new(); + Label = gtk_label_new (label); + + hbox = gtk_hbox_new (FALSE, 8); + gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); + gtk_container_add (GTK_CONTAINER (Item), hbox); + + + gtk_menu_append( GTK_MENU( SubMenu ),Item ); + gtk_signal_connect_object( GTK_OBJECT(Item),"activate", + GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); + + gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); + gtk_widget_show_all(Item); + return Item; +} + + +GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu,const char * label ) +{ + GtkWidget * Label = NULL; + GtkWidget * Pixmap = NULL; + GtkWidget * hbox = NULL; + GtkWidget * Item = NULL; + GtkWidget * SubItem = NULL; + GdkPixmap * PixmapIcon = NULL; + GdkColor transparent; + GdkBitmap * MaskIcon = NULL; + + PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm); + Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); + gdk_pixmap_unref (PixmapIcon); + + SubItem=gtk_menu_item_new(); + Item=gtk_menu_new(); + Label = gtk_label_new (label); + + hbox = gtk_hbox_new (FALSE, 8); + gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); + gtk_container_add (GTK_CONTAINER (SubItem), hbox); + + gtk_menu_append( GTK_MENU( Menu ),SubItem ); + gtk_menu_item_set_submenu( GTK_MENU_ITEM( SubItem ),Item ); + + gtk_widget_show_all( SubItem ); + return Item; +} + +GtkWidget * AddSeparator( GtkWidget * Menu ) +{ + GtkWidget * Item = NULL; + + Item=gtk_menu_item_new (); + gtk_widget_show( Item ); + gtk_container_add( GTK_CONTAINER( Menu ),Item ); + gtk_widget_set_sensitive( Item,FALSE ); + + return Item; +} + +typedef struct +{ + int id; + const char * name; +} Languages_t; + +#define lng( a,b ) ( (int)(a) * 256 + b ) +static Languages_t Languages[] = + { + { lng( 'a','b' ), "Abkhazian" }, + { lng( 'a','a' ), "Afar" }, + { lng( 'a','f' ), "Afrikaans" }, + { lng( 's','q' ), "Albanian" }, + { lng( 'a','m' ), "Amharic" }, + { lng( 'a','r' ), "Arabic" }, + { lng( 'h','y' ), "Armenian" }, + { lng( 'a','s' ), "Assamese" }, + { lng( 'a','e' ), "Avestan" }, + { lng( 'a','y' ), "Aymara" }, + { lng( 'a','z' ), "Azerbaijani" }, + { lng( 'b','a' ), "Bashkir" }, + { lng( 'e','u' ), "Basque" }, + { lng( 'b','e' ), "Belarusian" }, + { lng( 'b','n' ), "Bengali" }, + { lng( 'b','h' ), "Bihari" }, + { lng( 'b','i' ), "Bislama" }, + { lng( 'b','s' ), "Bosnian" }, + { lng( 'b','r' ), "Breton" }, + { lng( 'b','g' ), "Bulgarian" }, + { lng( 'm','y' ), "Burmese" }, + { lng( 'c','a' ), "Catalan" }, + { lng( 'c','h' ), "Chamorro" }, + { lng( 'c','e' ), "Chechen" }, + { lng( 'n','y' ), "Chichewa;Nyanja" }, + { lng( 'z','h' ), "Chinese" }, + { lng( 'c','u' ), "ChurchSlavic" }, + { lng( 'c','v' ), "Chuvash" }, + { lng( 'k','w' ), "Cornish" }, + { lng( 'c','o' ), "Corsican" }, + { lng( 'h','r' ), "Croatian" }, + { lng( 'c','s' ), "Czech" }, + { lng( 'd','a' ), "Danish" }, + { lng( 'n','l' ), "Dutch" }, + { lng( 'd','z' ), "Dzongkha" }, + { lng( 'e','n' ), "English" }, + { lng( 'e','o' ), "Esperanto" }, + { lng( 'e','t' ), "Estonian" }, + { lng( 'f','o' ), "Faroese" }, + { lng( 'f','j' ), "Fijian" }, + { lng( 'f','i' ), "Finnish" }, + { lng( 'f','r' ), "French" }, + { lng( 'f','y' ), "Frisian" }, + { lng( 'g','d' ), "Gaelic(Scots" }, + { lng( 'g','l' ), "Gallegan" }, + { lng( 'k','a' ), "Georgian" }, + { lng( 'd','e' ), "German" }, + { lng( 'e','l' ), "Greek" }, + { lng( 'g','n' ), "Guarani" }, + { lng( 'g','u' ), "Gujarati" }, + { lng( 'h','a' ), "Hausa" }, + { lng( 'h','e' ), "Hebrew" }, + { lng( 'i','w' ), "Hebrew" }, + { lng( 'h','z' ), "Herero" }, + { lng( 'h','i' ), "Hindi" }, + { lng( 'h','o' ), "HiriMotu" }, + { lng( 'h','u' ), "Hungarian" }, + { lng( 'i','s' ), "Icelandic" }, + { lng( 'i','d' ), "Indonesian" }, + { lng( 'i','n' ), "Indonesian" }, + { lng( 'i','a' ), "Interlingua" }, + { lng( 'i','e' ), "Interlingue" }, + { lng( 'i','u' ), "Inuktitut" }, + { lng( 'i','k' ), "Inupiaq" }, + { lng( 'g','a' ), "Irish" }, + { lng( 'i','t' ), "Italian" }, + { lng( 'j','a' ), "Japanese" }, + { lng( 'j','v' ), "Javanese" }, + { lng( 'j','w' ), "Javanese" }, + { lng( 'k','l' ), "Kalaallisut" }, + { lng( 'k','n' ), "Kannada" }, + { lng( 'k','s' ), "Kashmiri" }, + { lng( 'k','k' ), "Kazakh" }, + { lng( 'k','m' ), "Khmer" }, + { lng( 'k','i' ), "Kikuyu" }, + { lng( 'r','w' ), "Kinyarwanda" }, + { lng( 'k','y' ), "Kirghiz" }, + { lng( 'k','v' ), "Komi" }, + { lng( 'k','o' ), "Korean" }, + { lng( 'k','j' ), "Kuanyama" }, + { lng( 'k','u' ), "Kurdish" }, + { lng( 'l','o' ), "Lao" }, + { lng( 'l','a' ), "Latin" }, + { lng( 'l','v' ), "Latvian" }, + { lng( 'l','b' ), "Letzeburgesch" }, + { lng( 'l','n' ), "Lingala" }, + { lng( 'l','t' ), "Lithuanian" }, + { lng( 'm','k' ), "Macedonian" }, + { lng( 'm','g' ), "Malagasy" }, + { lng( 'm','s' ), "Malay" }, + { lng( 'm','l' ), "Malayalam" }, + { lng( 'm','t' ), "Maltese" }, + { lng( 'g','v' ), "Manx" }, + { lng( 'm','i' ), "Maori" }, + { lng( 'm','r' ), "Marathi" }, + { lng( 'm','h' ), "Marshall" }, + { lng( 'm','o' ), "Moldavian" }, + { lng( 'm','n' ), "Mongolian" }, + { lng( 'n','a' ), "Nauru" }, + { lng( 'n','v' ), "Navajo" }, + { lng( 'n','d' ), "North Ndebele" }, + { lng( 'n','r' ), "South Ndebele" }, + { lng( 'n','g' ), "Ndonga" }, + { lng( 'n','e' ), "Nepali" }, + { lng( 's','e' ), "NorthernSami" }, + { lng( 'n','o' ), "Norwegian" }, + { lng( 'n','b' ), "NorwegianBokmål" }, + { lng( 'n','n' ), "NorwegianNynorsk" }, + { lng( 'n','y' ), "Nyanja;Chichewa" }, + { lng( 'o','c' ), "Occitan(post1500;Provençal" }, + { lng( 'o','r' ), "Oriya" }, + { lng( 'o','m' ), "Oromo" }, + { lng( 'o','s' ), "Ossetian;Ossetic" }, + { lng( 'p','i' ), "Pali" }, + { lng( 'p','a' ), "Panjabi" }, + { lng( 'f','a' ), "Persian" }, + { lng( 'p','l' ), "Polish" }, + { lng( 'p','t' ), "Portuguese" }, + { lng( 'o','c' ), "Provençal;Occitan(post1500" }, + { lng( 'p','s' ), "Pushto" }, + { lng( 'q','u' ), "Quechua" }, + { lng( 'r','m' ), "Raeto-Romance" }, + { lng( 'r','o' ), "Romanian" }, + { lng( 'r','n' ), "Rundi" }, + { lng( 'r','u' ), "Russian" }, + { lng( 's','m' ), "Samoan" }, + { lng( 's','g' ), "Sango" }, + { lng( 's','a' ), "Sanskrit" }, + { lng( 's','c' ), "Sardinian" }, + { lng( 's','r' ), "Serbian" }, + { lng( 's','n' ), "Shona" }, + { lng( 's','d' ), "Sindhi" }, + { lng( 's','i' ), "Sinhalese" }, + { lng( 's','k' ), "Slovak" }, + { lng( 's','l' ), "Slovenian" }, + { lng( 's','o' ), "Somali" }, + { lng( 's','t' ), "Sotho" }, + { lng( 'e','s' ), "Spanish" }, + { lng( 's','u' ), "Sundanese" }, + { lng( 's','w' ), "Swahili" }, + { lng( 's','s' ), "Swati" }, + { lng( 's','v' ), "Swedish" }, + { lng( 't','l' ), "Tagalog" }, + { lng( 't','y' ), "Tahitian" }, + { lng( 't','g' ), "Tajik" }, + { lng( 't','a' ), "Tamil" }, + { lng( 't','t' ), "Tatar" }, + { lng( 't','e' ), "Telugu" }, + { lng( 't','h' ), "Thai" }, + { lng( 'b','o' ), "Tibetan" }, + { lng( 't','i' ), "Tigrinya" }, + { lng( 't','o' ), "Tonga" }, + { lng( 't','s' ), "Tsonga" }, + { lng( 't','n' ), "Tswana" }, + { lng( 't','r' ), "Turkish" }, + { lng( 't','k' ), "Turkmen" }, + { lng( 't','w' ), "Twi" }, + { lng( 'u','g' ), "Uighur" }, + { lng( 'u','k' ), "Ukrainian" }, + { lng( 'u','r' ), "Urdu" }, + { lng( 'u','z' ), "Uzbek" }, + { lng( 'v','i' ), "Vietnamese" }, + { lng( 'v','o' ), "Volapük" }, + { lng( 'c','y' ), "Welsh" }, + { lng( 'w','o' ), "Wolof" }, + { lng( 'x','h' ), "Xhosa" }, + { lng( 'y','i' ), "Yiddish" }, + { lng( 'j','i' ), "Yiddish" }, + { lng( 'y','o' ), "Yoruba" }, + { lng( 'z','a' ), "Zhuang" }, + { lng( 'z','u' ), "Zulu" }, + }; +#undef lng + +#ifdef CONFIG_DVDREAD +static char * ChannelTypes[] = + { "Dolby Digital","","Mpeg1","Mpeg2","PCM","","Digital Theatre System" }; +static char * ChannelNumbers[] = + { "","Stereo","","","","5.1" }; +#endif + +const char * GetLanguage( int language ) +{ + unsigned int i; + for ( i=0;iaudio->id : audio_id; + for ( i=0;i < guiIntfStruct.DVD.nr_of_audio_channels;i++ ) + { + snprintf( tmp,64,"%s - %s %s",GetLanguage( guiIntfStruct.DVD.audio_streams[i].language ), + ChannelTypes[ guiIntfStruct.DVD.audio_streams[i].type ], + ChannelNumbers[ guiIntfStruct.DVD.audio_streams[i].channels ] ); +// if ( id == -1 ) id=audio_id; //guiIntfStruct.DVD.audio_streams[i].id; + AddMenuCheckItem( window1, (const char*)dolby_xpm, DVDAudioLanguageMenu,tmp, + id == guiIntfStruct.DVD.audio_streams[i].id, + ( guiIntfStruct.DVD.audio_streams[i].id << 16 ) + evSetDVDAudio ); + } + } + else + { + MenuItem=AddMenuItem( window1, (const char*)empty_xpm, DVDAudioLanguageMenu,MSGTR_MENU_None,evNone ); + gtk_widget_set_sensitive( MenuItem,FALSE ); + } + DVDSubtitleLanguageMenu=AddSubMenu( window1, (const char*)tonguebla_xpm, DVDSubMenu,MSGTR_MENU_SubtitleLanguages ); + if ( guiIntfStruct.DVD.nr_of_subtitles ) + { + char tmp[64]; int i; + AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,( (unsigned short)-1 << 16 ) + evSetDVDSubtitle ); + for ( i=0;i < guiIntfStruct.DVD.nr_of_subtitles;i++ ) + { + snprintf( tmp,64,"%s",GetLanguage( guiIntfStruct.DVD.subtitles[i].language ) ); + AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,tmp, + dvdsub_id == guiIntfStruct.DVD.subtitles[i].id, + ( guiIntfStruct.DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle ); + } + } + else + { + MenuItem=AddMenuItem( window1, (const char*)empty_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,evNone ); + gtk_widget_set_sensitive( MenuItem,FALSE ); + } +#endif + +// if ( guiIntfStruct.Playing ) + { + AspectMenu=AddSubMenu( window1, (const char*)aspect_xpm, Menu,MSGTR_MENU_AspectRatio ); + AddMenuItem( window1, (const char*)a11_xpm, AspectMenu,MSGTR_MENU_Original,( 1 << 16 ) + evSetAspect ); + AddMenuItem( window1, (const char*)a169_xpm, AspectMenu,"16:9",( 2 << 16 ) + evSetAspect ); + AddMenuItem( window1, (const char*)a43_xpm, AspectMenu,"4:3",( 3 << 16 ) + evSetAspect ); + AddMenuItem( window1, (const char*)a235_xpm, AspectMenu,"2.35",( 4 << 16 ) + evSetAspect ); + } + + if ( guiIntfStruct.Playing && guiIntfStruct.demuxer && guiIntfStruct.StreamType != STREAMTYPE_DVD ) + { + int i,c = 0; + + for ( i=0;i < MAX_A_STREAMS;i++ ) + if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) c++; + + if ( c > 1 ) + { + SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_AudioTrack ); + for ( i=0;i < MAX_A_STREAMS;i++ ) + if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) + { + int aid = ((sh_audio_t *)((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i])->aid; + char tmp[32]; + snprintf( tmp,32,MSGTR_MENU_Track,aid ); + AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( aid << 16 ) + evSetAudio ); + } + } + + for ( c=0,i=0;i < MAX_V_STREAMS;i++ ) + if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) c++; + + if ( c > 1 ) + { + SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_VideoTrack ); + for ( i=0;i < MAX_V_STREAMS;i++ ) + if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) + { + int vid = ((sh_video_t *)((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i])->vid; + char tmp[32]; + snprintf( tmp,32,MSGTR_MENU_Track,vid ); + AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( vid << 16 ) + evSetVideo ); + } + } + } + + /* cheap subtitle switching for non-DVD streams */ + if ( global_sub_size && guiIntfStruct.StreamType != STREAMTYPE_DVD ) + { + int i; + SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu, MSGTR_MENU_Subtitles ); + AddMenuItem( window1, (const char*)empty_xpm, SubMenu, MSGTR_MENU_None, (-1 << 16) + evSetSubtitle ); + for ( i=0;i < global_sub_size;i++ ) + { + char tmp[32]; + snprintf( tmp, 32, MSGTR_MENU_Track, i ); + AddMenuItem( window1,(const char*)empty_xpm,SubMenu,tmp,( i << 16 ) + evSetSubtitle ); + } + } + + AddSeparator( Menu ); + MenuItem=AddMenuCheckItem( window1, (const char*)sound_xpm, Menu,MSGTR_MENU_Mute,mixer->muted,evMute ); + if ( !guiIntfStruct.AudioType ) gtk_widget_set_sensitive( MenuItem,FALSE ); + AddMenuItem( window1, (const char*)pl_xpm, Menu,MSGTR_MENU_PlayList, evPlayList ); + AddMenuItem( window1, (const char*)skin_xpm, Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser ); + AddMenuItem( window1, (const char*)prefs_xpm, Menu,MSGTR_MENU_Preferences, evPreferences ); + AddMenuItem( window1, (const char*)eq_xpm, Menu,MSGTR_Equalizer, evEqualizer ); + + if ( guiIntfStruct.NoWindow == False ) + { + int b1 = 0, b2 = 0, b_half = 0; + AddSeparator( Menu ); + if ( !appMPlayer.subWindow.isFullScreen && guiIntfStruct.Playing ) + { + if ( ( appMPlayer.subWindow.Width == guiIntfStruct.MovieWidth * 2 )&& + ( appMPlayer.subWindow.Height == guiIntfStruct.MovieHeight * 2 ) ) b2=1; + else if ( ( appMPlayer.subWindow.Width == guiIntfStruct.MovieWidth / 2 ) && + ( appMPlayer.subWindow.Height == guiIntfStruct.MovieHeight / 2 ) ) b_half=1; + else b1=1; + } else b1=!appMPlayer.subWindow.isFullScreen; + H=AddMenuCheckItem( window1, (const char*)half_xpm, Menu,MSGTR_MENU_HalfSize,b_half,evHalfSize ); + N=AddMenuCheckItem( window1, (const char*)normal_xpm, Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize ); + D=AddMenuCheckItem( window1, (const char*)double_xpm, Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize ); + F=AddMenuCheckItem( window1, (const char*)fs_xpm, Menu,MSGTR_MENU_FullScreen,appMPlayer.subWindow.isFullScreen,evFullScreen ); + if ( !gtkShowVideoWindow && !guiIntfStruct.Playing ) + { + gtk_widget_set_sensitive( H,FALSE ); + gtk_widget_set_sensitive( N,FALSE ); + gtk_widget_set_sensitive( D,FALSE ); + gtk_widget_set_sensitive( F,FALSE ); + } + } + + AddSeparator( Menu ); + AddMenuItem( window1, (const char*)exit_xpm, Menu,MSGTR_MENU_Exit, evExit ); + + return Menu; +} diff --git a/gui/mplayer/gtk/gtk_menu.h b/gui/mplayer/gtk/gtk_menu.h new file mode 100644 index 0000000000..a5e86d70ee --- /dev/null +++ b/gui/mplayer/gtk/gtk_menu.h @@ -0,0 +1,31 @@ +/* + * This file is part of MPlayer. + * + * MPlayer 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. + * + * MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#ifndef MPLAYER_GUI_MENU_H +#define MPLAYER_GUI_MENU_H + +#include + +extern GtkWidget * DVDSubMenu; + +GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm, GtkWidget * SubMenu, const char * label, int Number ); +GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu, const char * label ); +GtkWidget * AddSeparator( GtkWidget * Menu ); +GtkWidget * create_PopUpMenu( void ); + +#endif /* MPLAYER_GUI_MENU_H */ diff --git a/gui/mplayer/gtk/menu.c b/gui/mplayer/gtk/menu.c deleted file mode 100644 index 48736ce81b..0000000000 --- a/gui/mplayer/gtk/menu.c +++ /dev/null @@ -1,645 +0,0 @@ -/* - * This file is part of MPlayer. - * - * MPlayer 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. - * - * MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include -#include -#include - -#include "config.h" -#include "help_mp.h" -#include "access_mpcontext.h" -#include "mixer.h" - -#include "menu.h" -#include "gui/mplayer/widgets.h" -#include "gui/mplayer/gmplayer.h" -#include "gui/app.h" - -#include "stream/stream.h" -#include "libmpdemux/demuxer.h" -#include "libmpdemux/stheader.h" - -#include "gui/mplayer/pixmaps/ab.xpm" -#include "gui/mplayer/pixmaps/half.xpm" -#include "gui/mplayer/pixmaps/normal.xpm" -#include "gui/mplayer/pixmaps/double.xpm" -#include "gui/mplayer/pixmaps/fs.xpm" -#include "gui/mplayer/pixmaps/exit.xpm" -#include "gui/mplayer/pixmaps/prefs.xpm" -#include "gui/mplayer/pixmaps/eq.xpm" -#include "gui/mplayer/pixmaps/pl.xpm" -#include "gui/mplayer/pixmaps/skin.xpm" -#include "gui/mplayer/pixmaps/sound.xpm" -#include "gui/mplayer/pixmaps/open.xpm" -#include "gui/mplayer/pixmaps/play.xpm" -#include "gui/mplayer/pixmaps/stop2.xpm" -#include "gui/mplayer/pixmaps/pause.xpm" -#include "gui/mplayer/pixmaps/prev.xpm" -#include "gui/mplayer/pixmaps/next.xpm" -#include "gui/mplayer/pixmaps/aspect.xpm" -#include "gui/mplayer/pixmaps/a11.xpm" -#include "gui/mplayer/pixmaps/a169.xpm" -#include "gui/mplayer/pixmaps/a235.xpm" -#include "gui/mplayer/pixmaps/a43.xpm" -#include "gui/mplayer/pixmaps/file2.xpm" -#include "gui/mplayer/pixmaps/url.xpm" -#include "gui/mplayer/pixmaps/sub.xpm" -#include "gui/mplayer/pixmaps/delsub.xpm" -#include "gui/mplayer/pixmaps/empty.xpm" -#include "gui/mplayer/pixmaps/loadeaf.xpm" -#include "gui/mplayer/pixmaps/title.xpm" -#ifdef CONFIG_DVDREAD -#include "gui/mplayer/pixmaps/dvd.xpm" -#include "gui/mplayer/pixmaps/playdvd.xpm" -#include "gui/mplayer/pixmaps/chapter.xpm" -#include "gui/mplayer/pixmaps/dolby.xpm" -#include "gui/mplayer/pixmaps/tongue.xpm" -#include "gui/mplayer/pixmaps/tonguebla.xpm" -#include "gui/mplayer/pixmaps/empty1px.xpm" -#endif -#ifdef CONFIG_VCD -#include "gui/mplayer/pixmaps/vcd.xpm" -#include "gui/mplayer/pixmaps/playvcd.xpm" -#endif - -void ActivateMenuItem( int Item ) -{ -// fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 ); - gtkPopupMenu=Item & 0x0000ffff; - gtkPopupMenuParam=Item >> 16; - mplEventHandling( Item & 0x0000ffff,Item >> 16 ); -} - -static GtkWidget * AddMenuCheckItem(GtkWidget *window1, const char * immagine_xpm, GtkWidget* Menu,const char* label, gboolean state, int Number) -{ - GtkWidget * Label = NULL; - GtkWidget * Pixmap = NULL; - GtkWidget * hbox = NULL; - GtkWidget * Item = NULL; - - GdkPixmap *PixmapIcon = NULL; - GdkColor transparent; - GdkBitmap *MaskIcon = NULL; - - PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); - Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); - gdk_pixmap_unref (PixmapIcon); - - Item=gtk_check_menu_item_new(); - Label = gtk_label_new (label); - - hbox = gtk_hbox_new (FALSE, 8); - gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); - gtk_container_add (GTK_CONTAINER (Item), hbox); - - gtk_menu_append( GTK_MENU( Menu ),Item ); - - gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state); - gtk_signal_connect_object( GTK_OBJECT(Item),"activate", - GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); - gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); - gtk_widget_show_all(Item); - - return Item; -} -GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm, GtkWidget * SubMenu,const char * label,int Number ) -{ - GtkWidget * Label = NULL; - GtkWidget * Pixmap = NULL; - GtkWidget * hbox = NULL; - GtkWidget * Item = NULL; - GdkPixmap * PixmapIcon = NULL; - GdkColor transparent; - GdkBitmap * MaskIcon = NULL; - - PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm ); - Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); - gdk_pixmap_unref (PixmapIcon); - - Item=gtk_menu_item_new(); - Label = gtk_label_new (label); - - hbox = gtk_hbox_new (FALSE, 8); - gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); - gtk_container_add (GTK_CONTAINER (Item), hbox); - - - gtk_menu_append( GTK_MENU( SubMenu ),Item ); - gtk_signal_connect_object( GTK_OBJECT(Item),"activate", - GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number ); - - gtk_menu_item_right_justify (GTK_MENU_ITEM (Item)); - gtk_widget_show_all(Item); - return Item; -} - - -GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu,const char * label ) -{ - GtkWidget * Label = NULL; - GtkWidget * Pixmap = NULL; - GtkWidget * hbox = NULL; - GtkWidget * Item = NULL; - GtkWidget * SubItem = NULL; - GdkPixmap * PixmapIcon = NULL; - GdkColor transparent; - GdkBitmap * MaskIcon = NULL; - - PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm); - Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon); - gdk_pixmap_unref (PixmapIcon); - - SubItem=gtk_menu_item_new(); - Item=gtk_menu_new(); - Label = gtk_label_new (label); - - hbox = gtk_hbox_new (FALSE, 8); - gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0); - gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0); - gtk_container_add (GTK_CONTAINER (SubItem), hbox); - - gtk_menu_append( GTK_MENU( Menu ),SubItem ); - gtk_menu_item_set_submenu( GTK_MENU_ITEM( SubItem ),Item ); - - gtk_widget_show_all( SubItem ); - return Item; -} - -GtkWidget * AddSeparator( GtkWidget * Menu ) -{ - GtkWidget * Item = NULL; - - Item=gtk_menu_item_new (); - gtk_widget_show( Item ); - gtk_container_add( GTK_CONTAINER( Menu ),Item ); - gtk_widget_set_sensitive( Item,FALSE ); - - return Item; -} - -typedef struct -{ - int id; - const char * name; -} Languages_t; - -#define lng( a,b ) ( (int)(a) * 256 + b ) -static Languages_t Languages[] = - { - { lng( 'a','b' ), "Abkhazian" }, - { lng( 'a','a' ), "Afar" }, - { lng( 'a','f' ), "Afrikaans" }, - { lng( 's','q' ), "Albanian" }, - { lng( 'a','m' ), "Amharic" }, - { lng( 'a','r' ), "Arabic" }, - { lng( 'h','y' ), "Armenian" }, - { lng( 'a','s' ), "Assamese" }, - { lng( 'a','e' ), "Avestan" }, - { lng( 'a','y' ), "Aymara" }, - { lng( 'a','z' ), "Azerbaijani" }, - { lng( 'b','a' ), "Bashkir" }, - { lng( 'e','u' ), "Basque" }, - { lng( 'b','e' ), "Belarusian" }, - { lng( 'b','n' ), "Bengali" }, - { lng( 'b','h' ), "Bihari" }, - { lng( 'b','i' ), "Bislama" }, - { lng( 'b','s' ), "Bosnian" }, - { lng( 'b','r' ), "Breton" }, - { lng( 'b','g' ), "Bulgarian" }, - { lng( 'm','y' ), "Burmese" }, - { lng( 'c','a' ), "Catalan" }, - { lng( 'c','h' ), "Chamorro" }, - { lng( 'c','e' ), "Chechen" }, - { lng( 'n','y' ), "Chichewa;Nyanja" }, - { lng( 'z','h' ), "Chinese" }, - { lng( 'c','u' ), "ChurchSlavic" }, - { lng( 'c','v' ), "Chuvash" }, - { lng( 'k','w' ), "Cornish" }, - { lng( 'c','o' ), "Corsican" }, - { lng( 'h','r' ), "Croatian" }, - { lng( 'c','s' ), "Czech" }, - { lng( 'd','a' ), "Danish" }, - { lng( 'n','l' ), "Dutch" }, - { lng( 'd','z' ), "Dzongkha" }, - { lng( 'e','n' ), "English" }, - { lng( 'e','o' ), "Esperanto" }, - { lng( 'e','t' ), "Estonian" }, - { lng( 'f','o' ), "Faroese" }, - { lng( 'f','j' ), "Fijian" }, - { lng( 'f','i' ), "Finnish" }, - { lng( 'f','r' ), "French" }, - { lng( 'f','y' ), "Frisian" }, - { lng( 'g','d' ), "Gaelic(Scots" }, - { lng( 'g','l' ), "Gallegan" }, - { lng( 'k','a' ), "Georgian" }, - { lng( 'd','e' ), "German" }, - { lng( 'e','l' ), "Greek" }, - { lng( 'g','n' ), "Guarani" }, - { lng( 'g','u' ), "Gujarati" }, - { lng( 'h','a' ), "Hausa" }, - { lng( 'h','e' ), "Hebrew" }, - { lng( 'i','w' ), "Hebrew" }, - { lng( 'h','z' ), "Herero" }, - { lng( 'h','i' ), "Hindi" }, - { lng( 'h','o' ), "HiriMotu" }, - { lng( 'h','u' ), "Hungarian" }, - { lng( 'i','s' ), "Icelandic" }, - { lng( 'i','d' ), "Indonesian" }, - { lng( 'i','n' ), "Indonesian" }, - { lng( 'i','a' ), "Interlingua" }, - { lng( 'i','e' ), "Interlingue" }, - { lng( 'i','u' ), "Inuktitut" }, - { lng( 'i','k' ), "Inupiaq" }, - { lng( 'g','a' ), "Irish" }, - { lng( 'i','t' ), "Italian" }, - { lng( 'j','a' ), "Japanese" }, - { lng( 'j','v' ), "Javanese" }, - { lng( 'j','w' ), "Javanese" }, - { lng( 'k','l' ), "Kalaallisut" }, - { lng( 'k','n' ), "Kannada" }, - { lng( 'k','s' ), "Kashmiri" }, - { lng( 'k','k' ), "Kazakh" }, - { lng( 'k','m' ), "Khmer" }, - { lng( 'k','i' ), "Kikuyu" }, - { lng( 'r','w' ), "Kinyarwanda" }, - { lng( 'k','y' ), "Kirghiz" }, - { lng( 'k','v' ), "Komi" }, - { lng( 'k','o' ), "Korean" }, - { lng( 'k','j' ), "Kuanyama" }, - { lng( 'k','u' ), "Kurdish" }, - { lng( 'l','o' ), "Lao" }, - { lng( 'l','a' ), "Latin" }, - { lng( 'l','v' ), "Latvian" }, - { lng( 'l','b' ), "Letzeburgesch" }, - { lng( 'l','n' ), "Lingala" }, - { lng( 'l','t' ), "Lithuanian" }, - { lng( 'm','k' ), "Macedonian" }, - { lng( 'm','g' ), "Malagasy" }, - { lng( 'm','s' ), "Malay" }, - { lng( 'm','l' ), "Malayalam" }, - { lng( 'm','t' ), "Maltese" }, - { lng( 'g','v' ), "Manx" }, - { lng( 'm','i' ), "Maori" }, - { lng( 'm','r' ), "Marathi" }, - { lng( 'm','h' ), "Marshall" }, - { lng( 'm','o' ), "Moldavian" }, - { lng( 'm','n' ), "Mongolian" }, - { lng( 'n','a' ), "Nauru" }, - { lng( 'n','v' ), "Navajo" }, - { lng( 'n','d' ), "North Ndebele" }, - { lng( 'n','r' ), "South Ndebele" }, - { lng( 'n','g' ), "Ndonga" }, - { lng( 'n','e' ), "Nepali" }, - { lng( 's','e' ), "NorthernSami" }, - { lng( 'n','o' ), "Norwegian" }, - { lng( 'n','b' ), "NorwegianBokmål" }, - { lng( 'n','n' ), "NorwegianNynorsk" }, - { lng( 'n','y' ), "Nyanja;Chichewa" }, - { lng( 'o','c' ), "Occitan(post1500;Provençal" }, - { lng( 'o','r' ), "Oriya" }, - { lng( 'o','m' ), "Oromo" }, - { lng( 'o','s' ), "Ossetian;Ossetic" }, - { lng( 'p','i' ), "Pali" }, - { lng( 'p','a' ), "Panjabi" }, - { lng( 'f','a' ), "Persian" }, - { lng( 'p','l' ), "Polish" }, - { lng( 'p','t' ), "Portuguese" }, - { lng( 'o','c' ), "Provençal;Occitan(post1500" }, - { lng( 'p','s' ), "Pushto" }, - { lng( 'q','u' ), "Quechua" }, - { lng( 'r','m' ), "Raeto-Romance" }, - { lng( 'r','o' ), "Romanian" }, - { lng( 'r','n' ), "Rundi" }, - { lng( 'r','u' ), "Russian" }, - { lng( 's','m' ), "Samoan" }, - { lng( 's','g' ), "Sango" }, - { lng( 's','a' ), "Sanskrit" }, - { lng( 's','c' ), "Sardinian" }, - { lng( 's','r' ), "Serbian" }, - { lng( 's','n' ), "Shona" }, - { lng( 's','d' ), "Sindhi" }, - { lng( 's','i' ), "Sinhalese" }, - { lng( 's','k' ), "Slovak" }, - { lng( 's','l' ), "Slovenian" }, - { lng( 's','o' ), "Somali" }, - { lng( 's','t' ), "Sotho" }, - { lng( 'e','s' ), "Spanish" }, - { lng( 's','u' ), "Sundanese" }, - { lng( 's','w' ), "Swahili" }, - { lng( 's','s' ), "Swati" }, - { lng( 's','v' ), "Swedish" }, - { lng( 't','l' ), "Tagalog" }, - { lng( 't','y' ), "Tahitian" }, - { lng( 't','g' ), "Tajik" }, - { lng( 't','a' ), "Tamil" }, - { lng( 't','t' ), "Tatar" }, - { lng( 't','e' ), "Telugu" }, - { lng( 't','h' ), "Thai" }, - { lng( 'b','o' ), "Tibetan" }, - { lng( 't','i' ), "Tigrinya" }, - { lng( 't','o' ), "Tonga" }, - { lng( 't','s' ), "Tsonga" }, - { lng( 't','n' ), "Tswana" }, - { lng( 't','r' ), "Turkish" }, - { lng( 't','k' ), "Turkmen" }, - { lng( 't','w' ), "Twi" }, - { lng( 'u','g' ), "Uighur" }, - { lng( 'u','k' ), "Ukrainian" }, - { lng( 'u','r' ), "Urdu" }, - { lng( 'u','z' ), "Uzbek" }, - { lng( 'v','i' ), "Vietnamese" }, - { lng( 'v','o' ), "Volapük" }, - { lng( 'c','y' ), "Welsh" }, - { lng( 'w','o' ), "Wolof" }, - { lng( 'x','h' ), "Xhosa" }, - { lng( 'y','i' ), "Yiddish" }, - { lng( 'j','i' ), "Yiddish" }, - { lng( 'y','o' ), "Yoruba" }, - { lng( 'z','a' ), "Zhuang" }, - { lng( 'z','u' ), "Zulu" }, - }; -#undef lng - -#ifdef CONFIG_DVDREAD -static char * ChannelTypes[] = - { "Dolby Digital","","Mpeg1","Mpeg2","PCM","","Digital Theatre System" }; -static char * ChannelNumbers[] = - { "","Stereo","","","","5.1" }; -#endif - -const char * GetLanguage( int language ) -{ - unsigned int i; - for ( i=0;iaudio->id : audio_id; - for ( i=0;i < guiIntfStruct.DVD.nr_of_audio_channels;i++ ) - { - snprintf( tmp,64,"%s - %s %s",GetLanguage( guiIntfStruct.DVD.audio_streams[i].language ), - ChannelTypes[ guiIntfStruct.DVD.audio_streams[i].type ], - ChannelNumbers[ guiIntfStruct.DVD.audio_streams[i].channels ] ); -// if ( id == -1 ) id=audio_id; //guiIntfStruct.DVD.audio_streams[i].id; - AddMenuCheckItem( window1, (const char*)dolby_xpm, DVDAudioLanguageMenu,tmp, - id == guiIntfStruct.DVD.audio_streams[i].id, - ( guiIntfStruct.DVD.audio_streams[i].id << 16 ) + evSetDVDAudio ); - } - } - else - { - MenuItem=AddMenuItem( window1, (const char*)empty_xpm, DVDAudioLanguageMenu,MSGTR_MENU_None,evNone ); - gtk_widget_set_sensitive( MenuItem,FALSE ); - } - DVDSubtitleLanguageMenu=AddSubMenu( window1, (const char*)tonguebla_xpm, DVDSubMenu,MSGTR_MENU_SubtitleLanguages ); - if ( guiIntfStruct.DVD.nr_of_subtitles ) - { - char tmp[64]; int i; - AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,( (unsigned short)-1 << 16 ) + evSetDVDSubtitle ); - for ( i=0;i < guiIntfStruct.DVD.nr_of_subtitles;i++ ) - { - snprintf( tmp,64,"%s",GetLanguage( guiIntfStruct.DVD.subtitles[i].language ) ); - AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,tmp, - dvdsub_id == guiIntfStruct.DVD.subtitles[i].id, - ( guiIntfStruct.DVD.subtitles[i].id << 16 ) + evSetDVDSubtitle ); - } - } - else - { - MenuItem=AddMenuItem( window1, (const char*)empty_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,evNone ); - gtk_widget_set_sensitive( MenuItem,FALSE ); - } -#endif - -// if ( guiIntfStruct.Playing ) - { - AspectMenu=AddSubMenu( window1, (const char*)aspect_xpm, Menu,MSGTR_MENU_AspectRatio ); - AddMenuItem( window1, (const char*)a11_xpm, AspectMenu,MSGTR_MENU_Original,( 1 << 16 ) + evSetAspect ); - AddMenuItem( window1, (const char*)a169_xpm, AspectMenu,"16:9",( 2 << 16 ) + evSetAspect ); - AddMenuItem( window1, (const char*)a43_xpm, AspectMenu,"4:3",( 3 << 16 ) + evSetAspect ); - AddMenuItem( window1, (const char*)a235_xpm, AspectMenu,"2.35",( 4 << 16 ) + evSetAspect ); - } - - if ( guiIntfStruct.Playing && guiIntfStruct.demuxer && guiIntfStruct.StreamType != STREAMTYPE_DVD ) - { - int i,c = 0; - - for ( i=0;i < MAX_A_STREAMS;i++ ) - if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) c++; - - if ( c > 1 ) - { - SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_AudioTrack ); - for ( i=0;i < MAX_A_STREAMS;i++ ) - if ( ((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i] ) - { - int aid = ((sh_audio_t *)((demuxer_t *)guiIntfStruct.demuxer)->a_streams[i])->aid; - char tmp[32]; - snprintf( tmp,32,MSGTR_MENU_Track,aid ); - AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( aid << 16 ) + evSetAudio ); - } - } - - for ( c=0,i=0;i < MAX_V_STREAMS;i++ ) - if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) c++; - - if ( c > 1 ) - { - SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_VideoTrack ); - for ( i=0;i < MAX_V_STREAMS;i++ ) - if ( ((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i] ) - { - int vid = ((sh_video_t *)((demuxer_t *)guiIntfStruct.demuxer)->v_streams[i])->vid; - char tmp[32]; - snprintf( tmp,32,MSGTR_MENU_Track,vid ); - AddMenuItem( window1, (const char*)empty_xpm, SubMenu,tmp,( vid << 16 ) + evSetVideo ); - } - } - } - - /* cheap subtitle switching for non-DVD streams */ - if ( global_sub_size && guiIntfStruct.StreamType != STREAMTYPE_DVD ) - { - int i; - SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu, MSGTR_MENU_Subtitles ); - AddMenuItem( window1, (const char*)empty_xpm, SubMenu, MSGTR_MENU_None, (-1 << 16) + evSetSubtitle ); - for ( i=0;i < global_sub_size;i++ ) - { - char tmp[32]; - snprintf( tmp, 32, MSGTR_MENU_Track, i ); - AddMenuItem( window1,(const char*)empty_xpm,SubMenu,tmp,( i << 16 ) + evSetSubtitle ); - } - } - - AddSeparator( Menu ); - MenuItem=AddMenuCheckItem( window1, (const char*)sound_xpm, Menu,MSGTR_MENU_Mute,mixer->muted,evMute ); - if ( !guiIntfStruct.AudioType ) gtk_widget_set_sensitive( MenuItem,FALSE ); - AddMenuItem( window1, (const char*)pl_xpm, Menu,MSGTR_MENU_PlayList, evPlayList ); - AddMenuItem( window1, (const char*)skin_xpm, Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser ); - AddMenuItem( window1, (const char*)prefs_xpm, Menu,MSGTR_MENU_Preferences, evPreferences ); - AddMenuItem( window1, (const char*)eq_xpm, Menu,MSGTR_Equalizer, evEqualizer ); - - if ( guiIntfStruct.NoWindow == False ) - { - int b1 = 0, b2 = 0, b_half = 0; - AddSeparator( Menu ); - if ( !appMPlayer.subWindow.isFullScreen && guiIntfStruct.Playing ) - { - if ( ( appMPlayer.subWindow.Width == guiIntfStruct.MovieWidth * 2 )&& - ( appMPlayer.subWindow.Height == guiIntfStruct.MovieHeight * 2 ) ) b2=1; - else if ( ( appMPlayer.subWindow.Width == guiIntfStruct.MovieWidth / 2 ) && - ( appMPlayer.subWindow.Height == guiIntfStruct.MovieHeight / 2 ) ) b_half=1; - else b1=1; - } else b1=!appMPlayer.subWindow.isFullScreen; - H=AddMenuCheckItem( window1, (const char*)half_xpm, Menu,MSGTR_MENU_HalfSize,b_half,evHalfSize ); - N=AddMenuCheckItem( window1, (const char*)normal_xpm, Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize ); - D=AddMenuCheckItem( window1, (const char*)double_xpm, Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize ); - F=AddMenuCheckItem( window1, (const char*)fs_xpm, Menu,MSGTR_MENU_FullScreen,appMPlayer.subWindow.isFullScreen,evFullScreen ); - if ( !gtkShowVideoWindow && !guiIntfStruct.Playing ) - { - gtk_widget_set_sensitive( H,FALSE ); - gtk_widget_set_sensitive( N,FALSE ); - gtk_widget_set_sensitive( D,FALSE ); - gtk_widget_set_sensitive( F,FALSE ); - } - } - - AddSeparator( Menu ); - AddMenuItem( window1, (const char*)exit_xpm, Menu,MSGTR_MENU_Exit, evExit ); - - return Menu; -} diff --git a/gui/mplayer/gtk/menu.h b/gui/mplayer/gtk/menu.h deleted file mode 100644 index a5e86d70ee..0000000000 --- a/gui/mplayer/gtk/menu.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * This file is part of MPlayer. - * - * MPlayer 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. - * - * MPlayer 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 MPlayer; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef MPLAYER_GUI_MENU_H -#define MPLAYER_GUI_MENU_H - -#include - -extern GtkWidget * DVDSubMenu; - -GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm, GtkWidget * SubMenu, const char * label, int Number ); -GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu, const char * label ); -GtkWidget * AddSeparator( GtkWidget * Menu ); -GtkWidget * create_PopUpMenu( void ); - -#endif /* MPLAYER_GUI_MENU_H */ diff --git a/gui/mplayer/menu.c b/gui/mplayer/menu.c index 2c541cc733..9d63cc2ecc 100644 --- a/gui/mplayer/menu.c +++ b/gui/mplayer/menu.c @@ -151,7 +151,7 @@ void mplMenuInit( void ) if ( ( mplMenuDrawBuffer = calloc( 1,appMPlayer.menuBase.Bitmap.ImageSize ) ) == NULL ) { #ifdef DEBUG - mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[menu.h] %s",MSGTR_NEMFMR ); + mp_msg( MSGT_GPLAYER,MSGL_DBG2,MSGTR_NEMFMR ); #endif gtkMessageBox( GTK_MB_FATAL,MSGTR_NEMFMR ); return; @@ -164,7 +164,7 @@ void mplMenuInit( void ) wsSetShape( &appMPlayer.menuWindow,appMPlayer.menuBase.Mask.Image ); #ifdef DEBUG - mp_msg( MSGT_GPLAYER,MSGL_DBG2,"[menu.h] menu: 0x%x\n",(int)appMPlayer.menuWindow.WindowID ); + mp_msg( MSGT_GPLAYER,MSGL_DBG2,"menu: 0x%x\n",(int)appMPlayer.menuWindow.WindowID ); #endif mplMenuIsInitialized=1; diff --git a/gui/mplayer/widgets.c b/gui/mplayer/widgets.c index d6b0442303..0acc1f325c 100644 --- a/gui/mplayer/widgets.c +++ b/gui/mplayer/widgets.c @@ -41,7 +41,6 @@ #include "gui/wm/ws.h" -#include "gtk/menu.h" #include "play.h" #include "gtk/fs.h" @@ -60,7 +59,7 @@ int gtkInitialized = 0; #include "gtk/mb.h" #include "gtk/about.h" #include "gtk/opts.h" -#include "gtk/menu.h" +#include "gtk/gtk_menu.h" #include "gtk/gtk_url.h" #include "gtk/eq.h" -- cgit v1.2.3