annotate gui/ui/gtk/menu.c @ 34903:6a6b32a9b6b1

Add an icon for the subtitles menu. There was no icon so far.
author ib
date Mon, 11 Jun 2012 11:19:44 +0000
parents 528cbb0076d0
children a78e2453e188
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
1 /*
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
2 * This file is part of MPlayer.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
3 *
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
5 * it under the terms of the GNU General Public License as published by
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
7 * (at your option) any later version.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
8 *
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
12 * GNU General Public License for more details.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
13 *
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
14 * You should have received a copy of the GNU General Public License along
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
17 */
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
18
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
19 #include <stdio.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
20 #include <stdlib.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
21 #include <string.h>
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
22
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
23 #include "config.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
24 #include "help_mp.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
25 #include "access_mpcontext.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
26 #include "mixer.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
27 #include "mpcommon.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
28
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
29 #include "menu.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
30 #include "gui/ui/widgets.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
31 #include "gui/ui/gmplayer.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
32 #include "gui/app.h"
33738
998f94e62a61 Remove unnecessary #include "gui/interface.h".
ib
parents: 33657
diff changeset
33 #include "gui/interface.h"
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
34
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
35 #include "stream/stream.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
36 #include "libmpdemux/demuxer.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
37 #include "libmpdemux/stheader.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
38 #include "libavutil/avstring.h"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
39
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
40 #include "gui/ui/pixmaps/about.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
41 #include "gui/ui/pixmaps/half.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
42 #include "gui/ui/pixmaps/normal.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
43 #include "gui/ui/pixmaps/double.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
44 #include "gui/ui/pixmaps/full.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
45 #include "gui/ui/pixmaps/exit.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
46 #include "gui/ui/pixmaps/prefs.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
47 #include "gui/ui/pixmaps/equalizer.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
48 #include "gui/ui/pixmaps/playlist.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
49 #include "gui/ui/pixmaps/skin.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
50 #include "gui/ui/pixmaps/sound.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
51 #include "gui/ui/pixmaps/open.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
52 #include "gui/ui/pixmaps/play.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
53 #include "gui/ui/pixmaps/stop.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
54 #include "gui/ui/pixmaps/pause.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
55 #include "gui/ui/pixmaps/prev.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
56 #include "gui/ui/pixmaps/next.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
57 #include "gui/ui/pixmaps/aspect.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
58 #include "gui/ui/pixmaps/aspect11.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
59 #include "gui/ui/pixmaps/aspect169.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
60 #include "gui/ui/pixmaps/aspect235.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
61 #include "gui/ui/pixmaps/aspect43.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
62 #include "gui/ui/pixmaps/file2.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
63 #include "gui/ui/pixmaps/url.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
64 #include "gui/ui/pixmaps/sub.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
65 #include "gui/ui/pixmaps/nosub.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
66 #include "gui/ui/pixmaps/empty.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
67 #include "gui/ui/pixmaps/loadeaf.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
68 #include "gui/ui/pixmaps/title.xpm"
34903
6a6b32a9b6b1 Add an icon for the subtitles menu.
ib
parents: 34902
diff changeset
69 #include "gui/ui/pixmaps/subtitle.xpm"
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
70 #ifdef CONFIG_CDDA
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
71 #include "gui/ui/pixmaps/cd.xpm"
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
72 #include "gui/ui/pixmaps/playcd.xpm"
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
73 #endif
34077
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 33951
diff changeset
74 #ifdef CONFIG_VCD
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 33951
diff changeset
75 #include "gui/ui/pixmaps/vcd.xpm"
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 33951
diff changeset
76 #include "gui/ui/pixmaps/playvcd.xpm"
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 33951
diff changeset
77 #endif
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
78 #ifdef CONFIG_DVDREAD
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
79 #include "gui/ui/pixmaps/dvd.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
80 #include "gui/ui/pixmaps/playdvd.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
81 #include "gui/ui/pixmaps/chapter.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
82 #include "gui/ui/pixmaps/dolby.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
83 #include "gui/ui/pixmaps/audiolang.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
84 #include "gui/ui/pixmaps/sublang.xpm"
34422
b1f2949ca18d Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents: 34421
diff changeset
85 #endif
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
86 #include "gui/ui/pixmaps/empty1px.xpm"
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
87
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
88 static void ActivateMenuItem( int Item )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
89 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
90 // fprintf( stderr,"[menu] item: %d.%d\n",Item&0xffff,Item>>16 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
91 gtkPopupMenu=Item & 0x0000ffff;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
92 gtkPopupMenuParam=Item >> 16;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
93 uiEventHandling( Item & 0x0000ffff,Item >> 16 );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
94 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
95
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
96 static GtkWidget * AddMenuCheckItem(GtkWidget *window1, const char * immagine_xpm, GtkWidget* Menu,const char* label, gboolean state, int Number)
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
97 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
98 GtkWidget * Label = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
99 GtkWidget * Pixmap = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
100 GtkWidget * hbox = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
101 GtkWidget * Item = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
102
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
103 GdkPixmap *PixmapIcon = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
104 GdkColor transparent;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
105 GdkBitmap *MaskIcon = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
106
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
107 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
108 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
109 gdk_pixmap_unref (PixmapIcon);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
110
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
111 Item=gtk_check_menu_item_new();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
112 Label = gtk_label_new (label);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
113
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
114 hbox = gtk_hbox_new (FALSE, 8);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
115 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
116 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
117 gtk_container_add (GTK_CONTAINER (Item), hbox);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
118
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
119 gtk_menu_append( GTK_MENU( Menu ),Item );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
120
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
121 gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(Item),state);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
122 gtk_signal_connect_object( GTK_OBJECT(Item),"activate",
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
123 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
124 gtk_menu_item_right_justify (GTK_MENU_ITEM (Item));
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
125 gtk_widget_show_all(Item);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
126
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
127 return Item;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
128 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
129 GtkWidget * AddMenuItem( GtkWidget *window1, const char * immagine_xpm, GtkWidget * SubMenu,const char * label,int Number )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
130 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
131 GtkWidget * Label = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
132 GtkWidget * Pixmap = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
133 GtkWidget * hbox = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
134 GtkWidget * Item = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
135 GdkPixmap * PixmapIcon = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
136 GdkColor transparent;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
137 GdkBitmap * MaskIcon = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
138
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
139 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
140 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
141 gdk_pixmap_unref (PixmapIcon);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
142
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
143 Item=gtk_menu_item_new();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
144 Label = gtk_label_new (label);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
145
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
146 hbox = gtk_hbox_new (FALSE, 8);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
147 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
148 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
149 gtk_container_add (GTK_CONTAINER (Item), hbox);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
150
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
151
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
152 gtk_menu_append( GTK_MENU( SubMenu ),Item );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
153 gtk_signal_connect_object( GTK_OBJECT(Item),"activate",
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
154 GTK_SIGNAL_FUNC(ActivateMenuItem),(gpointer)Number );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
155
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
156 gtk_menu_item_right_justify (GTK_MENU_ITEM (Item));
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
157 gtk_widget_show_all(Item);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
158 return Item;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
159 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
160
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
161
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
162 GtkWidget * AddSubMenu( GtkWidget *window1, const char * immagine_xpm, GtkWidget * Menu,const char * label )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
163 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
164 GtkWidget * Label = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
165 GtkWidget * Pixmap = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
166 GtkWidget * hbox = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
167 GtkWidget * Item = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
168 GtkWidget * SubItem = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
169 GdkPixmap * PixmapIcon = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
170 GdkColor transparent;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
171 GdkBitmap * MaskIcon = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
172
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
173 PixmapIcon = gdk_pixmap_create_from_xpm_d (window1->window, &MaskIcon, &transparent,(gchar **)immagine_xpm);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
174 Pixmap = gtk_pixmap_new (PixmapIcon, MaskIcon);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
175 gdk_pixmap_unref (PixmapIcon);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
176
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
177 SubItem=gtk_menu_item_new();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
178 Item=gtk_menu_new();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
179 Label = gtk_label_new (label);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
180
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
181 hbox = gtk_hbox_new (FALSE, 8);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
182 gtk_box_pack_start (GTK_BOX (hbox), Pixmap, FALSE, FALSE, 0);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
183 gtk_box_pack_start (GTK_BOX (hbox), Label, FALSE, FALSE, 0);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
184 gtk_container_add (GTK_CONTAINER (SubItem), hbox);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
185
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
186 gtk_menu_append( GTK_MENU( Menu ),SubItem );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
187 gtk_menu_item_set_submenu( GTK_MENU_ITEM( SubItem ),Item );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
188
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
189 gtk_widget_show_all( SubItem );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
190 return Item;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
191 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
192
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
193 GtkWidget * AddSeparator( GtkWidget * Menu )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
194 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
195 GtkWidget * Item = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
196
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
197 Item=gtk_menu_item_new ();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
198 gtk_widget_show( Item );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
199 gtk_container_add( GTK_CONTAINER( Menu ),Item );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
200 gtk_widget_set_sensitive( Item,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
201
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
202 return Item;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
203 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
204
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
205 typedef struct
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
206 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
207 int id;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
208 const char * name;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
209 } Languages_t;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
210
34454
5a45efc630b8 Remove all unnecessary #ifdefs from GUI code.
ib
parents: 34423
diff changeset
211 #ifdef CONFIG_DVDREAD
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
212 #define lng( a,b ) ( (int)(a) * 256 + b )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
213 static Languages_t Languages[] =
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
214 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
215 { lng( 'a','b' ), "Abkhazian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
216 { lng( 'a','a' ), "Afar" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
217 { lng( 'a','f' ), "Afrikaans" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
218 { lng( 's','q' ), "Albanian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
219 { lng( 'a','m' ), "Amharic" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
220 { lng( 'a','r' ), "Arabic" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
221 { lng( 'h','y' ), "Armenian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
222 { lng( 'a','s' ), "Assamese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
223 { lng( 'a','e' ), "Avestan" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
224 { lng( 'a','y' ), "Aymara" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
225 { lng( 'a','z' ), "Azerbaijani" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
226 { lng( 'b','a' ), "Bashkir" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
227 { lng( 'e','u' ), "Basque" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
228 { lng( 'b','e' ), "Belarusian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
229 { lng( 'b','n' ), "Bengali" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
230 { lng( 'b','h' ), "Bihari" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
231 { lng( 'b','i' ), "Bislama" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
232 { lng( 'b','s' ), "Bosnian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
233 { lng( 'b','r' ), "Breton" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
234 { lng( 'b','g' ), "Bulgarian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
235 { lng( 'm','y' ), "Burmese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
236 { lng( 'c','a' ), "Catalan" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
237 { lng( 'c','h' ), "Chamorro" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
238 { lng( 'c','e' ), "Chechen" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
239 { lng( 'n','y' ), "Chichewa;Nyanja" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
240 { lng( 'z','h' ), "Chinese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
241 { lng( 'c','u' ), "ChurchSlavic" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
242 { lng( 'c','v' ), "Chuvash" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
243 { lng( 'k','w' ), "Cornish" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
244 { lng( 'c','o' ), "Corsican" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
245 { lng( 'h','r' ), "Croatian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
246 { lng( 'c','s' ), "Czech" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
247 { lng( 'd','a' ), "Danish" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
248 { lng( 'n','l' ), "Dutch" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
249 { lng( 'd','z' ), "Dzongkha" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
250 { lng( 'e','n' ), "English" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
251 { lng( 'e','o' ), "Esperanto" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
252 { lng( 'e','t' ), "Estonian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
253 { lng( 'f','o' ), "Faroese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
254 { lng( 'f','j' ), "Fijian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
255 { lng( 'f','i' ), "Finnish" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
256 { lng( 'f','r' ), "French" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
257 { lng( 'f','y' ), "Frisian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
258 { lng( 'g','d' ), "Gaelic(Scots" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
259 { lng( 'g','l' ), "Gallegan" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
260 { lng( 'k','a' ), "Georgian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
261 { lng( 'd','e' ), "German" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
262 { lng( 'e','l' ), "Greek" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
263 { lng( 'g','n' ), "Guarani" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
264 { lng( 'g','u' ), "Gujarati" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
265 { lng( 'h','a' ), "Hausa" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
266 { lng( 'h','e' ), "Hebrew" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
267 { lng( 'i','w' ), "Hebrew" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
268 { lng( 'h','z' ), "Herero" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
269 { lng( 'h','i' ), "Hindi" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
270 { lng( 'h','o' ), "HiriMotu" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
271 { lng( 'h','u' ), "Hungarian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
272 { lng( 'i','s' ), "Icelandic" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
273 { lng( 'i','d' ), "Indonesian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
274 { lng( 'i','n' ), "Indonesian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
275 { lng( 'i','a' ), "Interlingua" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
276 { lng( 'i','e' ), "Interlingue" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
277 { lng( 'i','u' ), "Inuktitut" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
278 { lng( 'i','k' ), "Inupiaq" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
279 { lng( 'g','a' ), "Irish" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
280 { lng( 'i','t' ), "Italian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
281 { lng( 'j','a' ), "Japanese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
282 { lng( 'j','v' ), "Javanese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
283 { lng( 'j','w' ), "Javanese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
284 { lng( 'k','l' ), "Kalaallisut" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
285 { lng( 'k','n' ), "Kannada" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
286 { lng( 'k','s' ), "Kashmiri" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
287 { lng( 'k','k' ), "Kazakh" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
288 { lng( 'k','m' ), "Khmer" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
289 { lng( 'k','i' ), "Kikuyu" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
290 { lng( 'r','w' ), "Kinyarwanda" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
291 { lng( 'k','y' ), "Kirghiz" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
292 { lng( 'k','v' ), "Komi" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
293 { lng( 'k','o' ), "Korean" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
294 { lng( 'k','j' ), "Kuanyama" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
295 { lng( 'k','u' ), "Kurdish" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
296 { lng( 'l','o' ), "Lao" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
297 { lng( 'l','a' ), "Latin" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
298 { lng( 'l','v' ), "Latvian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
299 { lng( 'l','b' ), "Letzeburgesch" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
300 { lng( 'l','n' ), "Lingala" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
301 { lng( 'l','t' ), "Lithuanian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
302 { lng( 'm','k' ), "Macedonian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
303 { lng( 'm','g' ), "Malagasy" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
304 { lng( 'm','s' ), "Malay" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
305 { lng( 'm','l' ), "Malayalam" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
306 { lng( 'm','t' ), "Maltese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
307 { lng( 'g','v' ), "Manx" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
308 { lng( 'm','i' ), "Maori" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
309 { lng( 'm','r' ), "Marathi" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
310 { lng( 'm','h' ), "Marshall" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
311 { lng( 'm','o' ), "Moldavian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
312 { lng( 'm','n' ), "Mongolian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
313 { lng( 'n','a' ), "Nauru" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
314 { lng( 'n','v' ), "Navajo" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
315 { lng( 'n','d' ), "North Ndebele" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
316 { lng( 'n','r' ), "South Ndebele" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
317 { lng( 'n','g' ), "Ndonga" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
318 { lng( 'n','e' ), "Nepali" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
319 { lng( 's','e' ), "NorthernSami" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
320 { lng( 'n','o' ), "Norwegian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
321 { lng( 'n','b' ), "NorwegianBokmål" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
322 { lng( 'n','n' ), "NorwegianNynorsk" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
323 { lng( 'n','y' ), "Nyanja;Chichewa" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
324 { lng( 'o','c' ), "Occitan(post1500;Provençal" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
325 { lng( 'o','r' ), "Oriya" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
326 { lng( 'o','m' ), "Oromo" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
327 { lng( 'o','s' ), "Ossetian;Ossetic" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
328 { lng( 'p','i' ), "Pali" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
329 { lng( 'p','a' ), "Panjabi" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
330 { lng( 'f','a' ), "Persian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
331 { lng( 'p','l' ), "Polish" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
332 { lng( 'p','t' ), "Portuguese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
333 { lng( 'o','c' ), "Provençal;Occitan(post1500" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
334 { lng( 'p','s' ), "Pushto" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
335 { lng( 'q','u' ), "Quechua" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
336 { lng( 'r','m' ), "Raeto-Romance" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
337 { lng( 'r','o' ), "Romanian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
338 { lng( 'r','n' ), "Rundi" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
339 { lng( 'r','u' ), "Russian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
340 { lng( 's','m' ), "Samoan" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
341 { lng( 's','g' ), "Sango" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
342 { lng( 's','a' ), "Sanskrit" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
343 { lng( 's','c' ), "Sardinian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
344 { lng( 's','r' ), "Serbian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
345 { lng( 's','n' ), "Shona" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
346 { lng( 's','d' ), "Sindhi" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
347 { lng( 's','i' ), "Sinhalese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
348 { lng( 's','k' ), "Slovak" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
349 { lng( 's','l' ), "Slovenian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
350 { lng( 's','o' ), "Somali" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
351 { lng( 's','t' ), "Sotho" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
352 { lng( 'e','s' ), "Spanish" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
353 { lng( 's','u' ), "Sundanese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
354 { lng( 's','w' ), "Swahili" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
355 { lng( 's','s' ), "Swati" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
356 { lng( 's','v' ), "Swedish" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
357 { lng( 't','l' ), "Tagalog" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
358 { lng( 't','y' ), "Tahitian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
359 { lng( 't','g' ), "Tajik" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
360 { lng( 't','a' ), "Tamil" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
361 { lng( 't','t' ), "Tatar" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
362 { lng( 't','e' ), "Telugu" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
363 { lng( 't','h' ), "Thai" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
364 { lng( 'b','o' ), "Tibetan" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
365 { lng( 't','i' ), "Tigrinya" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
366 { lng( 't','o' ), "Tonga" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
367 { lng( 't','s' ), "Tsonga" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
368 { lng( 't','n' ), "Tswana" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
369 { lng( 't','r' ), "Turkish" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
370 { lng( 't','k' ), "Turkmen" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
371 { lng( 't','w' ), "Twi" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
372 { lng( 'u','g' ), "Uighur" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
373 { lng( 'u','k' ), "Ukrainian" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
374 { lng( 'u','r' ), "Urdu" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
375 { lng( 'u','z' ), "Uzbek" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
376 { lng( 'v','i' ), "Vietnamese" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
377 { lng( 'v','o' ), "Volapük" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
378 { lng( 'c','y' ), "Welsh" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
379 { lng( 'w','o' ), "Wolof" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
380 { lng( 'x','h' ), "Xhosa" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
381 { lng( 'y','i' ), "Yiddish" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
382 { lng( 'j','i' ), "Yiddish" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
383 { lng( 'y','o' ), "Yoruba" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
384 { lng( 'z','a' ), "Zhuang" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
385 { lng( 'z','u' ), "Zulu" },
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
386 };
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
387 #undef lng
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
388
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
389 static char * ChannelTypes[] =
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
390 { "Dolby Digital","","Mpeg1","Mpeg2","PCM","","Digital Theatre System" };
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
391 static char * ChannelNumbers[] =
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
392 { "","Stereo","","","","5.1" };
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
393
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
394 static const char * GetLanguage( int language )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
395 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
396 unsigned int i;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
397 for ( i=0;i<sizeof( Languages ) / sizeof( Languages_t );i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
398 if ( Languages[i].id == language ) return Languages[i].name;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
399 return NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
400 }
34454
5a45efc630b8 Remove all unnecessary #ifdefs from GUI code.
ib
parents: 34423
diff changeset
401 #endif
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
402
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
403
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
404 GtkWidget * DVDSubMenu;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
405 GtkWidget * DVDTitleMenu;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
406 GtkWidget * DVDChapterMenu;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
407 GtkWidget * DVDAudioLanguageMenu;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
408 GtkWidget * DVDSubtitleLanguageMenu;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
409 GtkWidget * AspectMenu;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
410 GtkWidget * VCDSubMenu;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
411 GtkWidget * VCDTitleMenu;
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
412 GtkWidget * CDSubMenu;
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
413 GtkWidget * CDTitleMenu;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
414
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
415 GtkWidget * create_PopUpMenu( void )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
416 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
417 GtkWidget * window1;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
418 GtkWidget * Menu = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
419 GtkWidget * SubMenu = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
420 GtkWidget * MenuItem = NULL;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
421 GtkWidget * H, * N, * D, * F;
33657
c92f23eac7a4 Remove guiGetEvent type guiSetDemuxer.
ib
parents: 33655
diff changeset
422 demuxer_t *demuxer = mpctx_get_demuxer(guiInfo.mpcontext);
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
423 mixer_t *mixer = mpctx_get_mixer(guiInfo.mpcontext);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
424 int global_sub_size = mpctx_get_global_sub_size(guiInfo.mpcontext);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
425
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
426 Menu=gtk_menu_new();
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
427 gtk_widget_realize (Menu);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
428 window1 = gtk_widget_get_toplevel(Menu);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
429
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
430
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
431 AddMenuItem( window1, (const char*)about_xpm, Menu,MSGTR_MENU_AboutMPlayer" ", evAbout );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
432 AddSeparator( Menu );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
433 SubMenu=AddSubMenu( window1, (const char*)open_xpm, Menu,MSGTR_MENU_Open );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
434 AddMenuItem( window1, (const char*)file2_xpm, SubMenu,MSGTR_MENU_PlayFile" ", evLoadPlay );
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
435 #ifdef CONFIG_CDDA
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
436 AddMenuItem( window1, (const char*)playcd_xpm, SubMenu,MSGTR_MENU_PlayCD, evPlayCD );
34419
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
437 CDSubMenu=AddSubMenu( window1, (const char*)cd_xpm, Menu,MSGTR_MENU_CD );
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
438 AddMenuItem( window1, (const char*)playcd_xpm, CDSubMenu,MSGTR_MENU_PlayDisc,evPlayCD );
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
439 AddSeparator( CDSubMenu );
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
440 CDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, CDSubMenu,MSGTR_MENU_Titles );
34420
0b31cf6cec25 Fix bug in CD / VCD / DVD related menus.
ib
parents: 34419
diff changeset
441 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_CDDA ) )
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
442 {
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
443 char tmp[32]; int i;
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
444 for ( i=1;i <= guiInfo.Tracks;i++ )
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
445 {
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
446 snprintf( tmp,32,MSGTR_MENU_Title,i );
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
447 //AddMenuItem( CDTitleMenu,tmp,( i << 16 ) + ivSetCDTrack );
34422
b1f2949ca18d Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents: 34421
diff changeset
448 AddMenuCheckItem(window1, (const char*)empty1px_xpm, CDTitleMenu,tmp, guiInfo.Track == i, ( i << 16 ) + ivSetCDTrack );
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
449 }
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
450 }
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
451 else
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
452 {
34422
b1f2949ca18d Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents: 34421
diff changeset
453 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, CDTitleMenu,MSGTR_MENU_None,evNone );
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
454 gtk_widget_set_sensitive( MenuItem,FALSE );
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
455 }
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34333
diff changeset
456 #endif
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
457 #ifdef CONFIG_VCD
34419
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
458 AddMenuItem( window1, (const char*)playvcd_xpm, SubMenu,MSGTR_MENU_PlayVCD, evPlayVCD );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
459 VCDSubMenu=AddSubMenu( window1, (const char*)vcd_xpm, Menu,MSGTR_MENU_VCD );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
460 AddMenuItem( window1, (const char*)playvcd_xpm, VCDSubMenu,MSGTR_MENU_PlayDisc,evPlayVCD );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
461 AddSeparator( VCDSubMenu );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
462 VCDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, VCDSubMenu,MSGTR_MENU_Titles );
34420
0b31cf6cec25 Fix bug in CD / VCD / DVD related menus.
ib
parents: 34419
diff changeset
463 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_VCD ) )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
464 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
465 char tmp[32]; int i;
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
466 for ( i=1;i < guiInfo.Tracks;i++ )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
467 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
468 snprintf( tmp,32,MSGTR_MENU_Title,i );
34333
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34324
diff changeset
469 //AddMenuItem( VCDTitleMenu,tmp,( i << 16 ) + ivSetVCDTrack );
34422
b1f2949ca18d Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents: 34421
diff changeset
470 AddMenuCheckItem(window1, (const char*)empty1px_xpm, VCDTitleMenu,tmp, guiInfo.Track == i + 1, ( ( i + 1 ) << 16 ) + ivSetVCDTrack );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
471 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
472 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
473 else
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
474 {
34422
b1f2949ca18d Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents: 34421
diff changeset
475 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, VCDTitleMenu,MSGTR_MENU_None,evNone );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
476 gtk_widget_set_sensitive( MenuItem,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
477 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
478 #endif
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
479 #ifdef CONFIG_DVDREAD
34419
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
480 AddMenuItem( window1, (const char*)playdvd_xpm, SubMenu,MSGTR_MENU_PlayDVD, evPlayDVD );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
481 DVDSubMenu=AddSubMenu( window1, (const char*)dvd_xpm, Menu,MSGTR_MENU_DVD );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
482 AddMenuItem( window1, (const char*)playdvd_xpm, DVDSubMenu,MSGTR_MENU_PlayDisc" ", evPlayDVD );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
483 // AddMenuItem( DVDSubMenu,MSGTR_MENU_ShowDVDMenu, evNone );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
484 AddSeparator( DVDSubMenu );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
485 DVDTitleMenu=AddSubMenu( window1, (const char*)title_xpm, DVDSubMenu,MSGTR_MENU_Titles );
34420
0b31cf6cec25 Fix bug in CD / VCD / DVD related menus.
ib
parents: 34419
diff changeset
486 if ( guiInfo.Tracks && ( guiInfo.StreamType == STREAMTYPE_DVD ) )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
487 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
488 char tmp[32]; int i;
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
489 for ( i=1 ; i<= guiInfo.Tracks;i++ )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
490 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
491 snprintf( tmp,32,MSGTR_MENU_Title,i);
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
492 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDTitleMenu,tmp,
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
493 guiInfo.Track == i,
34333
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34324
diff changeset
494 (i << 16) + ivSetDVDTitle );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
495 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
496 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
497 else
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
498 {
34422
b1f2949ca18d Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents: 34421
diff changeset
499 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDTitleMenu,MSGTR_MENU_None,evNone );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
500 gtk_widget_set_sensitive( MenuItem,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
501 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
502 DVDChapterMenu=AddSubMenu( window1, (const char*)chapter_xpm, DVDSubMenu,MSGTR_MENU_Chapters );
34420
0b31cf6cec25 Fix bug in CD / VCD / DVD related menus.
ib
parents: 34419
diff changeset
503 if ( guiInfo.Chapters && ( guiInfo.StreamType == STREAMTYPE_DVD ) )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
504 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
505 char tmp[32]; int i;
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
506 for ( i=1;i <= guiInfo.Chapters;i++ )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
507 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
508 snprintf( tmp,32,MSGTR_MENU_Chapter,i );
33876
4789b8eed97e Get rid of a bunch of needless or redundant guiInfo members.
ib
parents: 33874
diff changeset
509 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDChapterMenu,tmp,guiInfo.Chapter == i,
34333
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34324
diff changeset
510 ( i << 16 ) + ivSetDVDChapter );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
511 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
512 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
513 else
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
514 {
34422
b1f2949ca18d Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents: 34421
diff changeset
515 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDChapterMenu,MSGTR_MENU_None,evNone );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
516 gtk_widget_set_sensitive( MenuItem,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
517 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
518 DVDAudioLanguageMenu=AddSubMenu( window1, (const char*)audiolang_xpm, DVDSubMenu,MSGTR_MENU_AudioLanguages );
34420
0b31cf6cec25 Fix bug in CD / VCD / DVD related menus.
ib
parents: 34419
diff changeset
519 if ( guiInfo.AudioStreams && ( guiInfo.StreamType == STREAMTYPE_DVD ) )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
520 {
33657
c92f23eac7a4 Remove guiGetEvent type guiSetDemuxer.
ib
parents: 33655
diff changeset
521 char tmp[64]; int i, id = demuxer ? demuxer->audio->id : audio_id;
33902
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
522 for ( i=0;i < guiInfo.AudioStreams;i++ )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
523 {
33902
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
524 snprintf( tmp,64,"%s - %s %s",GetLanguage( guiInfo.AudioStream[i].language ),
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
525 ChannelTypes[ guiInfo.AudioStream[i].type ],
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
526 ChannelNumbers[ guiInfo.AudioStream[i].channels ] );
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
527 // if ( id == -1 ) id=audio_id; //guiInfo.AudioStream[i].id;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
528 AddMenuCheckItem( window1, (const char*)dolby_xpm, DVDAudioLanguageMenu,tmp,
33902
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
529 id == guiInfo.AudioStream[i].id,
34333
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34324
diff changeset
530 ( guiInfo.AudioStream[i].id << 16 ) + ivSetDVDAudio );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
531 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
532 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
533 else
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
534 {
34422
b1f2949ca18d Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents: 34421
diff changeset
535 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDAudioLanguageMenu,MSGTR_MENU_None,evNone );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
536 gtk_widget_set_sensitive( MenuItem,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
537 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
538 DVDSubtitleLanguageMenu=AddSubMenu( window1, (const char*)sublang_xpm, DVDSubMenu,MSGTR_MENU_SubtitleLanguages );
34420
0b31cf6cec25 Fix bug in CD / VCD / DVD related menus.
ib
parents: 34419
diff changeset
539 if ( guiInfo.Subtitles && ( guiInfo.StreamType == STREAMTYPE_DVD ) )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
540 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
541 char tmp[64]; int i;
34333
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34324
diff changeset
542 AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,( (unsigned short)-1 << 16 ) + ivSetDVDSubtitle );
33902
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
543 for ( i=0;i < guiInfo.Subtitles;i++ )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
544 {
33902
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
545 av_strlcpy( tmp,GetLanguage( guiInfo.Subtitle[i].language ),sizeof(tmp) );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
546 AddMenuCheckItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,tmp,
33902
dd0e5dc6ebbf Add guiDVDStruct members to guiInfo.
ib
parents: 33901
diff changeset
547 dvdsub_id == guiInfo.Subtitle[i].id,
34333
e8e4e6f9b7ac Change prefix for internal events from ev to iv.
ib
parents: 34324
diff changeset
548 ( guiInfo.Subtitle[i].id << 16 ) + ivSetDVDSubtitle );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
549 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
550 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
551 else
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
552 {
34422
b1f2949ca18d Use empty1px.xpm instead of empty.xpm for check item (and similar) menus.
ib
parents: 34421
diff changeset
553 MenuItem=AddMenuItem( window1, (const char*)empty1px_xpm, DVDSubtitleLanguageMenu,MSGTR_MENU_None,evNone );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
554 gtk_widget_set_sensitive( MenuItem,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
555 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
556 #endif
34419
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
557 AddMenuItem( window1, (const char*)url_xpm, SubMenu,MSGTR_MENU_PlayURL, evLoadURL );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
558 AddMenuItem( window1, (const char*)sub_xpm, SubMenu,MSGTR_MENU_LoadSubtitle" ", evLoadSubtitle );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
559 AddMenuItem( window1, (const char*)nosub_xpm, SubMenu,MSGTR_MENU_DropSubtitle,evDropSubtitle );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
560 AddMenuItem( window1, (const char*)loadeaf_xpm, SubMenu,MSGTR_MENU_LoadExternAudioFile, evLoadAudioFile );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
561 SubMenu=AddSubMenu(window1, (const char*)play_xpm, Menu,MSGTR_MENU_Playing );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
562 AddMenuItem( window1, (const char*)play_xpm, SubMenu,MSGTR_MENU_Play" ", evPlay );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
563 AddMenuItem( window1, (const char*)pause_xpm, SubMenu,MSGTR_MENU_Pause, evPause );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
564 AddMenuItem( window1, (const char*)stop_xpm, SubMenu,MSGTR_MENU_Stop, evStop );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
565 AddMenuItem( window1, (const char*)next_xpm, SubMenu,MSGTR_MENU_NextStream, evNext );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
566 AddMenuItem( window1, (const char*)prev_xpm, SubMenu,MSGTR_MENU_PrevStream, evPrev );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
567 // AddSeparator( SubMenu );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
568 // AddMenuItem( SubMenu,"Back 10 sec", evBackward10sec );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
569 // AddMenuItem( SubMenu,"Fwd 10 sec", evForward10sec );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
570 // AddMenuItem( SubMenu,"Back 1 min", evBackward1min );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
571 // AddMenuItem( SubMenu,"Fwd 1 min", evForward1min );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
572 // SubMenu=AddSubMenu( Menu,MSGTR_MENU_Size );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
573 // AddMenuItem( SubMenu,MSGTR_MENU_NormalSize" ", evNormalSize );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
574 // AddMenuItem( SubMenu,MSGTR_MENU_DoubleSize, evDoubleSize );
a56707da37cd Move CD / VCD / DVD related menu code.
ib
parents: 34387
diff changeset
575 // AddMenuItem( SubMenu,MSGTR_MENU_FullScreen, evFullScreen );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
576
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
577 // if ( guiInfo.Playing )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
578 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
579 AspectMenu=AddSubMenu( window1, (const char*)aspect_xpm, Menu,MSGTR_MENU_AspectRatio );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
580 AddMenuItem( window1, (const char*)aspect11_xpm, AspectMenu,MSGTR_MENU_Original,( 1 << 16 ) + evSetAspect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
581 AddMenuItem( window1, (const char*)aspect169_xpm, AspectMenu,"16:9",( 2 << 16 ) + evSetAspect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
582 AddMenuItem( window1, (const char*)aspect43_xpm, AspectMenu,"4:3",( 3 << 16 ) + evSetAspect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
583 AddMenuItem( window1, (const char*)aspect235_xpm, AspectMenu,"2.35",( 4 << 16 ) + evSetAspect );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
584 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
585
33657
c92f23eac7a4 Remove guiGetEvent type guiSetDemuxer.
ib
parents: 33655
diff changeset
586 if ( guiInfo.Playing && demuxer && guiInfo.StreamType != STREAMTYPE_DVD )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
587 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
588 int i,c = 0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
589
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
590 for ( i=0;i < MAX_A_STREAMS;i++ )
33657
c92f23eac7a4 Remove guiGetEvent type guiSetDemuxer.
ib
parents: 33655
diff changeset
591 if ( demuxer->a_streams[i] ) c++;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
592
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
593 if ( c > 1 )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
594 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
595 SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_AudioTrack );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
596 for ( i=0;i < MAX_A_STREAMS;i++ )
33657
c92f23eac7a4 Remove guiGetEvent type guiSetDemuxer.
ib
parents: 33655
diff changeset
597 if ( demuxer->a_streams[i] )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
598 {
33657
c92f23eac7a4 Remove guiGetEvent type guiSetDemuxer.
ib
parents: 33655
diff changeset
599 int aid = ((sh_audio_t *)demuxer->a_streams[i])->aid;
34555
da67e2df97be Emphasize the default audio track in the selection list.
ib
parents: 34479
diff changeset
600 int selected_id = (audio_id == aid || (audio_id == -1 && aid == demuxer_default_audio_track(mpctx_get_demuxer(guiInfo.mpcontext))));
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
601 char tmp[32];
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
602 snprintf( tmp,32,MSGTR_MENU_Track,aid );
34555
da67e2df97be Emphasize the default audio track in the selection list.
ib
parents: 34479
diff changeset
603 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu,tmp,selected_id,( aid << 16 ) + ivSetAudio );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
604 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
605 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
606
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
607 for ( c=0,i=0;i < MAX_V_STREAMS;i++ )
33657
c92f23eac7a4 Remove guiGetEvent type guiSetDemuxer.
ib
parents: 33655
diff changeset
608 if ( demuxer->v_streams[i] ) c++;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
609
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
610 if ( c > 1 )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
611 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
612 SubMenu=AddSubMenu( window1, (const char*)empty_xpm, Menu,MSGTR_MENU_VideoTrack );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
613 for ( i=0;i < MAX_V_STREAMS;i++ )
33657
c92f23eac7a4 Remove guiGetEvent type guiSetDemuxer.
ib
parents: 33655
diff changeset
614 if ( demuxer->v_streams[i] )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
615 {
33657
c92f23eac7a4 Remove guiGetEvent type guiSetDemuxer.
ib
parents: 33655
diff changeset
616 int vid = ((sh_video_t *)demuxer->v_streams[i])->vid;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
617 char tmp[32];
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
618 snprintf( tmp,32,MSGTR_MENU_Track,vid );
34479
70c63fd20b4b Use check items for audio, video and subtitle tracks.
ib
parents: 34454
diff changeset
619 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu,tmp,video_id == vid,( vid << 16 ) + ivSetVideo );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
620 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
621 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
622 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
623
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
624 /* cheap subtitle switching for non-DVD streams */
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
625 if ( global_sub_size && guiInfo.StreamType != STREAMTYPE_DVD )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
626 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
627 int i;
34903
6a6b32a9b6b1 Add an icon for the subtitles menu.
ib
parents: 34902
diff changeset
628 SubMenu=AddSubMenu( window1, (const char*)subtitle_xpm, Menu, MSGTR_MENU_Subtitles );
34902
528cbb0076d0 Revert r34511.
ib
parents: 34697
diff changeset
629 AddMenuCheckItem( window1, (const char*)empty1px_xpm, SubMenu, MSGTR_MENU_None, guiInfo.mpcontext->global_sub_pos == -1, (-1 << 16) + ivSetSubtitle );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
630 for ( i=0;i < global_sub_size;i++ )
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
631 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
632 char tmp[32];
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
633 snprintf( tmp, 32, MSGTR_MENU_Track, i );
34479
70c63fd20b4b Use check items for audio, video and subtitle tracks.
ib
parents: 34454
diff changeset
634 AddMenuCheckItem( window1,(const char*)empty1px_xpm,SubMenu,tmp,guiInfo.mpcontext->global_sub_pos == i,( i << 16 ) + ivSetSubtitle );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
635 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
636 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
637
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
638 AddSeparator( Menu );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
639 MenuItem=AddMenuCheckItem( window1, (const char*)sound_xpm, Menu,MSGTR_MENU_Mute,mixer->muted,evMute );
33646
f3300b0c38a9 Rename guiInterface_t member AudioType AudioChannels.
ib
parents: 33572
diff changeset
640 if ( !guiInfo.AudioChannels ) gtk_widget_set_sensitive( MenuItem,FALSE );
34321
daebf766dea6 Cosmetic: Synchronize evPlaylist event and message names.
ib
parents: 34077
diff changeset
641 AddMenuItem( window1, (const char*)playlist_xpm, Menu,MSGTR_MENU_PlayList, evPlaylist );
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
642 AddMenuItem( window1, (const char*)skin_xpm, Menu,MSGTR_MENU_SkinBrowser, evSkinBrowser );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
643 AddMenuItem( window1, (const char*)prefs_xpm, Menu,MSGTR_MENU_Preferences, evPreferences );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
644 AddMenuItem( window1, (const char*)equalizer_xpm, Menu,MSGTR_Equalizer, evEqualizer );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
645
33901
d4f80f889106 Cosmetic: Rename guiInfo members.
ib
parents: 33876
diff changeset
646 if ( guiInfo.VideoWindow )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
647 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
648 int b1 = 0, b2 = 0, b_half = 0;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
649 AddSeparator( Menu );
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34555
diff changeset
650 if ( !guiApp.videoWindow.isFullScreen && guiInfo.Playing )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
651 {
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34555
diff changeset
652 if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth * 2 )&&
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34555
diff changeset
653 ( guiApp.videoWindow.Height == guiInfo.VideoHeight * 2 ) ) b2=1;
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34555
diff changeset
654 else if ( ( guiApp.videoWindow.Width == guiInfo.VideoWidth / 2 ) &&
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34555
diff changeset
655 ( guiApp.videoWindow.Height == guiInfo.VideoHeight / 2 ) ) b_half=1;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
656 else b1=1;
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34555
diff changeset
657 } else b1=!guiApp.videoWindow.isFullScreen;
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
658 H=AddMenuCheckItem( window1, (const char*)half_xpm, Menu,MSGTR_MENU_HalfSize,b_half,evHalfSize );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
659 N=AddMenuCheckItem( window1, (const char*)normal_xpm, Menu,MSGTR_MENU_NormalSize" ",b1,evNormalSize );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
660 D=AddMenuCheckItem( window1, (const char*)double_xpm, Menu,MSGTR_MENU_DoubleSize,b2,evDoubleSize );
34697
ac6b38cd0d45 Rename sub window video window.
ib
parents: 34555
diff changeset
661 F=AddMenuCheckItem( window1, (const char*)full_xpm, Menu,MSGTR_MENU_FullScreen,guiApp.videoWindow.isFullScreen,evFullScreen );
33951
2c26c2f2136e Remove pointless condition.
ib
parents: 33902
diff changeset
662 if ( !guiInfo.Playing )
33572
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
663 {
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
664 gtk_widget_set_sensitive( H,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
665 gtk_widget_set_sensitive( N,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
666 gtk_widget_set_sensitive( D,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
667 gtk_widget_set_sensitive( F,FALSE );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
668 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
669 }
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
670
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
671 AddSeparator( Menu );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
672 AddMenuItem( window1, (const char*)exit_xpm, Menu,MSGTR_MENU_Exit, evExit );
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
673
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
674 return Menu;
d9b805602aa1 Rename some gtk files.
ib
parents:
diff changeset
675 }