. nouveaux plugins - ne fonctionnent pas encore tous
[vlc.git] / plugins / gnome / intf_gnome_interface.c
1 /*
2  * DO NOT EDIT THIS FILE - it is generated by Glade.
3  */
4
5 #ifdef HAVE_CONFIG_H
6 #  include <config.h>
7 #endif
8
9 #include <sys/types.h>
10 #include <sys/stat.h>
11 #include <unistd.h>
12 #include <string.h>
13
14 #include <gnome.h>
15
16 #include "intf_gnome_callbacks.h"
17 #include "intf_gnome_interface.h"
18 #include "intf_gnome_support.h"
19
20 static GnomeUIInfo file_menu_menu_uiinfo[] =
21 {
22   GNOMEUIINFO_MENU_OPEN_ITEM (on_open_activate, NULL),
23   GNOMEUIINFO_SEPARATOR,
24   GNOMEUIINFO_MENU_EXIT_ITEM (on_exit_activate, NULL),
25   GNOMEUIINFO_END
26 };
27
28 static GnomeUIInfo channel_menu_uiinfo[] =
29 {
30   {
31     GNOME_APP_UI_ITEM, N_("None"),
32     NULL,
33     on_channel0_activate, NULL, NULL,
34     GNOME_APP_PIXMAP_NONE, NULL,
35     0, 0, NULL
36   },
37   {
38     GNOME_APP_UI_ITEM, N_("1"),
39     NULL,
40     on_channel1_activate, NULL, NULL,
41     GNOME_APP_PIXMAP_NONE, NULL,
42     0, 0, NULL
43   },
44   {
45     GNOME_APP_UI_ITEM, N_("2"),
46     NULL,
47     on_channel2_activate, NULL, NULL,
48     GNOME_APP_PIXMAP_NONE, NULL,
49     0, 0, NULL
50   },
51   {
52     GNOME_APP_UI_ITEM, N_("3"),
53     NULL,
54     on_channel3_activate, NULL, NULL,
55     GNOME_APP_PIXMAP_NONE, NULL,
56     0, 0, NULL
57   },
58   {
59     GNOME_APP_UI_ITEM, N_("4"),
60     NULL,
61     on_channel4_activate, NULL, NULL,
62     GNOME_APP_PIXMAP_NONE, NULL,
63     0, 0, NULL
64   },
65   {
66     GNOME_APP_UI_ITEM, N_("5"),
67     NULL,
68     on_channel5_activate, NULL, NULL,
69     GNOME_APP_PIXMAP_NONE, NULL,
70     0, 0, NULL
71   },
72   {
73     GNOME_APP_UI_ITEM, N_("Configure..."),
74     NULL,
75     on_config_channels_activate, NULL, NULL,
76     GNOME_APP_PIXMAP_NONE, NULL,
77     0, 0, NULL
78   },
79   GNOMEUIINFO_END
80 };
81
82 static GnomeUIInfo view_menu_menu_uiinfo[] =
83 {
84   {
85     GNOME_APP_UI_ITEM, N_("Control window"),
86     NULL,
87     on_control_activate, NULL, NULL,
88     GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXEC,
89     0, 0, NULL
90   },
91   {
92     GNOME_APP_UI_ITEM, N_("Playlist"),
93     NULL,
94     on_playlist_activate, NULL, NULL,
95     GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_INDEX,
96     0, 0, NULL
97   },
98   {
99     GNOME_APP_UI_SUBTREE, N_("Channel"),
100     NULL,
101     channel_menu_uiinfo, NULL, NULL,
102     GNOME_APP_PIXMAP_NONE, NULL,
103     0, 0, NULL
104   },
105   GNOMEUIINFO_END
106 };
107
108 static GnomeUIInfo settings_menu_menu_uiinfo[] =
109 {
110   GNOMEUIINFO_MENU_PREFERENCES_ITEM (on_preferences_activate, NULL),
111   {
112     GNOME_APP_UI_ITEM, N_("Plugins..."),
113     NULL,
114     on_plugins_activate, NULL, NULL,
115     GNOME_APP_PIXMAP_NONE, NULL,
116     0, 0, NULL
117   },
118   GNOMEUIINFO_END
119 };
120
121 static GnomeUIInfo help_menu_menu_uiinfo[] =
122 {
123   {
124     GNOME_APP_UI_ITEM, N_("User guide"),
125     NULL,
126     on_user_guide_activate, NULL, NULL,
127     GNOME_APP_PIXMAP_NONE, NULL,
128     0, 0, NULL
129   },
130   GNOMEUIINFO_MENU_ABOUT_ITEM (on_about_activate, NULL),
131   GNOMEUIINFO_END
132 };
133
134 static GnomeUIInfo menubar_uiinfo[] =
135 {
136   GNOMEUIINFO_MENU_FILE_TREE (file_menu_menu_uiinfo),
137   GNOMEUIINFO_MENU_VIEW_TREE (view_menu_menu_uiinfo),
138   GNOMEUIINFO_MENU_SETTINGS_TREE (settings_menu_menu_uiinfo),
139   GNOMEUIINFO_MENU_HELP_TREE (help_menu_menu_uiinfo),
140   GNOMEUIINFO_END
141 };
142
143 GtkWidget*
144 create_intf_window (void)
145 {
146   GtkWidget *intf_window;
147   GtkWidget *dock;
148   GtkWidget *toolbar;
149   GtkWidget *tmp_toolbar_icon;
150   GtkWidget *open;
151   GtkWidget *jump;
152   GtkWidget *vseparator1;
153   GtkWidget *prev;
154   GtkWidget *rewind;
155   GtkWidget *stop;
156   GtkWidget *play;
157   GtkWidget *next;
158   GtkWidget *vseparator2;
159   GtkWidget *pause;
160   GtkWidget *mute;
161   GtkWidget *table1;
162   GtkWidget *hscale1;
163   GtkWidget *appbar;
164
165   intf_window = gnome_app_new ("Vlc", _("VideoLAN Client"));
166   gtk_object_set_data (GTK_OBJECT (intf_window), "intf_window", intf_window);
167
168   dock = GNOME_APP (intf_window)->dock;
169   gtk_widget_ref (dock);
170   gtk_object_set_data_full (GTK_OBJECT (intf_window), "dock", dock,
171                             (GtkDestroyNotify) gtk_widget_unref);
172   gtk_widget_show (dock);
173
174   gnome_app_create_menus (GNOME_APP (intf_window), menubar_uiinfo);
175
176   gtk_widget_ref (menubar_uiinfo[0].widget);
177   gtk_object_set_data_full (GTK_OBJECT (intf_window), "file_menu",
178                             menubar_uiinfo[0].widget,
179                             (GtkDestroyNotify) gtk_widget_unref);
180
181   gtk_widget_ref (file_menu_menu_uiinfo[0].widget);
182   gtk_object_set_data_full (GTK_OBJECT (intf_window), "open",
183                             file_menu_menu_uiinfo[0].widget,
184                             (GtkDestroyNotify) gtk_widget_unref);
185
186   gtk_widget_ref (file_menu_menu_uiinfo[1].widget);
187   gtk_object_set_data_full (GTK_OBJECT (intf_window), "separator1",
188                             file_menu_menu_uiinfo[1].widget,
189                             (GtkDestroyNotify) gtk_widget_unref);
190
191   gtk_widget_ref (file_menu_menu_uiinfo[2].widget);
192   gtk_object_set_data_full (GTK_OBJECT (intf_window), "exit",
193                             file_menu_menu_uiinfo[2].widget,
194                             (GtkDestroyNotify) gtk_widget_unref);
195
196   gtk_widget_ref (menubar_uiinfo[1].widget);
197   gtk_object_set_data_full (GTK_OBJECT (intf_window), "view_menu",
198                             menubar_uiinfo[1].widget,
199                             (GtkDestroyNotify) gtk_widget_unref);
200
201   gtk_widget_ref (view_menu_menu_uiinfo[0].widget);
202   gtk_object_set_data_full (GTK_OBJECT (intf_window), "control",
203                             view_menu_menu_uiinfo[0].widget,
204                             (GtkDestroyNotify) gtk_widget_unref);
205
206   gtk_widget_ref (view_menu_menu_uiinfo[1].widget);
207   gtk_object_set_data_full (GTK_OBJECT (intf_window), "playlist",
208                             view_menu_menu_uiinfo[1].widget,
209                             (GtkDestroyNotify) gtk_widget_unref);
210
211   gtk_widget_ref (view_menu_menu_uiinfo[2].widget);
212   gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel",
213                             view_menu_menu_uiinfo[2].widget,
214                             (GtkDestroyNotify) gtk_widget_unref);
215
216   gtk_widget_ref (channel_menu_uiinfo[0].widget);
217   gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel0",
218                             channel_menu_uiinfo[0].widget,
219                             (GtkDestroyNotify) gtk_widget_unref);
220
221   gtk_widget_ref (channel_menu_uiinfo[1].widget);
222   gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel1",
223                             channel_menu_uiinfo[1].widget,
224                             (GtkDestroyNotify) gtk_widget_unref);
225
226   gtk_widget_ref (channel_menu_uiinfo[2].widget);
227   gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel2",
228                             channel_menu_uiinfo[2].widget,
229                             (GtkDestroyNotify) gtk_widget_unref);
230
231   gtk_widget_ref (channel_menu_uiinfo[3].widget);
232   gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel3",
233                             channel_menu_uiinfo[3].widget,
234                             (GtkDestroyNotify) gtk_widget_unref);
235
236   gtk_widget_ref (channel_menu_uiinfo[4].widget);
237   gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel4",
238                             channel_menu_uiinfo[4].widget,
239                             (GtkDestroyNotify) gtk_widget_unref);
240
241   gtk_widget_ref (channel_menu_uiinfo[5].widget);
242   gtk_object_set_data_full (GTK_OBJECT (intf_window), "channel5",
243                             channel_menu_uiinfo[5].widget,
244                             (GtkDestroyNotify) gtk_widget_unref);
245
246   gtk_widget_ref (channel_menu_uiinfo[6].widget);
247   gtk_object_set_data_full (GTK_OBJECT (intf_window), "config_channels",
248                             channel_menu_uiinfo[6].widget,
249                             (GtkDestroyNotify) gtk_widget_unref);
250
251   gtk_widget_ref (menubar_uiinfo[2].widget);
252   gtk_object_set_data_full (GTK_OBJECT (intf_window), "settings_menu",
253                             menubar_uiinfo[2].widget,
254                             (GtkDestroyNotify) gtk_widget_unref);
255
256   gtk_widget_ref (settings_menu_menu_uiinfo[0].widget);
257   gtk_object_set_data_full (GTK_OBJECT (intf_window), "preferences",
258                             settings_menu_menu_uiinfo[0].widget,
259                             (GtkDestroyNotify) gtk_widget_unref);
260
261   gtk_widget_ref (settings_menu_menu_uiinfo[1].widget);
262   gtk_object_set_data_full (GTK_OBJECT (intf_window), "plugins",
263                             settings_menu_menu_uiinfo[1].widget,
264                             (GtkDestroyNotify) gtk_widget_unref);
265
266   gtk_widget_ref (menubar_uiinfo[3].widget);
267   gtk_object_set_data_full (GTK_OBJECT (intf_window), "help_menu",
268                             menubar_uiinfo[3].widget,
269                             (GtkDestroyNotify) gtk_widget_unref);
270
271   gtk_widget_ref (help_menu_menu_uiinfo[0].widget);
272   gtk_object_set_data_full (GTK_OBJECT (intf_window), "user_guide",
273                             help_menu_menu_uiinfo[0].widget,
274                             (GtkDestroyNotify) gtk_widget_unref);
275
276   gtk_widget_ref (help_menu_menu_uiinfo[1].widget);
277   gtk_object_set_data_full (GTK_OBJECT (intf_window), "about",
278                             help_menu_menu_uiinfo[1].widget,
279                             (GtkDestroyNotify) gtk_widget_unref);
280
281   toolbar = gtk_toolbar_new (GTK_ORIENTATION_HORIZONTAL, GTK_TOOLBAR_BOTH);
282   gtk_widget_ref (toolbar);
283   gtk_object_set_data_full (GTK_OBJECT (intf_window), "toolbar", toolbar,
284                             (GtkDestroyNotify) gtk_widget_unref);
285   gtk_widget_show (toolbar);
286   gnome_app_add_toolbar (GNOME_APP (intf_window), GTK_TOOLBAR (toolbar), "toolbar",
287                                 GNOME_DOCK_ITEM_BEH_EXCLUSIVE,
288                                 GNOME_DOCK_TOP, 1, 0, 0);
289   gtk_toolbar_set_button_relief (GTK_TOOLBAR (toolbar), GTK_RELIEF_NONE);
290
291   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_OPEN);
292   open = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
293                                 GTK_TOOLBAR_CHILD_BUTTON,
294                                 NULL,
295                                 _("Open"),
296                                 NULL, NULL,
297                                 tmp_toolbar_icon, NULL, NULL);
298   gtk_widget_ref (open);
299   gtk_object_set_data_full (GTK_OBJECT (intf_window), "open", open,
300                             (GtkDestroyNotify) gtk_widget_unref);
301   gtk_widget_show (open);
302
303   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_JUMP_TO);
304   jump = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
305                                 GTK_TOOLBAR_CHILD_BUTTON,
306                                 NULL,
307                                 _("Jump"),
308                                 NULL, NULL,
309                                 tmp_toolbar_icon, NULL, NULL);
310   gtk_widget_ref (jump);
311   gtk_object_set_data_full (GTK_OBJECT (intf_window), "jump", jump,
312                             (GtkDestroyNotify) gtk_widget_unref);
313   gtk_widget_show (jump);
314
315   vseparator1 = gtk_vseparator_new ();
316   gtk_widget_ref (vseparator1);
317   gtk_object_set_data_full (GTK_OBJECT (intf_window), "vseparator1", vseparator1,
318                             (GtkDestroyNotify) gtk_widget_unref);
319   gtk_widget_show (vseparator1);
320   gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), vseparator1, NULL, NULL);
321   gtk_widget_set_usize (vseparator1, 16, 32);
322
323   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FIRST);
324   prev = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
325                                 GTK_TOOLBAR_CHILD_BUTTON,
326                                 NULL,
327                                 _("Prev"),
328                                 NULL, NULL,
329                                 tmp_toolbar_icon, NULL, NULL);
330   gtk_widget_ref (prev);
331   gtk_object_set_data_full (GTK_OBJECT (intf_window), "prev", prev,
332                             (GtkDestroyNotify) gtk_widget_unref);
333   gtk_widget_show (prev);
334
335   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_BACK);
336   rewind = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
337                                 GTK_TOOLBAR_CHILD_BUTTON,
338                                 NULL,
339                                 _("Back"),
340                                 NULL, NULL,
341                                 tmp_toolbar_icon, NULL, NULL);
342   gtk_widget_ref (rewind);
343   gtk_object_set_data_full (GTK_OBJECT (intf_window), "rewind", rewind,
344                             (GtkDestroyNotify) gtk_widget_unref);
345   gtk_widget_show (rewind);
346
347   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_STOP);
348   stop = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
349                                 GTK_TOOLBAR_CHILD_BUTTON,
350                                 NULL,
351                                 _("Stop"),
352                                 NULL, NULL,
353                                 tmp_toolbar_icon, NULL, NULL);
354   gtk_widget_ref (stop);
355   gtk_object_set_data_full (GTK_OBJECT (intf_window), "stop", stop,
356                             (GtkDestroyNotify) gtk_widget_unref);
357   gtk_widget_show (stop);
358
359   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_FORWARD);
360   play = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
361                                 GTK_TOOLBAR_CHILD_BUTTON,
362                                 NULL,
363                                 _("Play"),
364                                 NULL, NULL,
365                                 tmp_toolbar_icon, NULL, NULL);
366   gtk_widget_ref (play);
367   gtk_object_set_data_full (GTK_OBJECT (intf_window), "play", play,
368                             (GtkDestroyNotify) gtk_widget_unref);
369   gtk_widget_show (play);
370
371   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_LAST);
372   next = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
373                                 GTK_TOOLBAR_CHILD_BUTTON,
374                                 NULL,
375                                 _("Next"),
376                                 NULL, NULL,
377                                 tmp_toolbar_icon, NULL, NULL);
378   gtk_widget_ref (next);
379   gtk_object_set_data_full (GTK_OBJECT (intf_window), "next", next,
380                             (GtkDestroyNotify) gtk_widget_unref);
381   gtk_widget_show (next);
382
383   vseparator2 = gtk_vseparator_new ();
384   gtk_widget_ref (vseparator2);
385   gtk_object_set_data_full (GTK_OBJECT (intf_window), "vseparator2", vseparator2,
386                             (GtkDestroyNotify) gtk_widget_unref);
387   gtk_widget_show (vseparator2);
388   gtk_toolbar_append_widget (GTK_TOOLBAR (toolbar), vseparator2, NULL, NULL);
389   gtk_widget_set_usize (vseparator2, 16, 32);
390
391   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_TIMER_STOP);
392   pause = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
393                                 GTK_TOOLBAR_CHILD_BUTTON,
394                                 NULL,
395                                 _("Pause"),
396                                 NULL, NULL,
397                                 tmp_toolbar_icon, NULL, NULL);
398   gtk_widget_ref (pause);
399   gtk_object_set_data_full (GTK_OBJECT (intf_window), "pause", pause,
400                             (GtkDestroyNotify) gtk_widget_unref);
401   gtk_widget_show (pause);
402
403   tmp_toolbar_icon = gnome_stock_pixmap_widget (intf_window, GNOME_STOCK_PIXMAP_VOLUME);
404   mute = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
405                                 GTK_TOOLBAR_CHILD_BUTTON,
406                                 NULL,
407                                 _("Mute"),
408                                 NULL, NULL,
409                                 tmp_toolbar_icon, NULL, NULL);
410   gtk_widget_ref (mute);
411   gtk_object_set_data_full (GTK_OBJECT (intf_window), "mute", mute,
412                             (GtkDestroyNotify) gtk_widget_unref);
413   gtk_widget_show (mute);
414
415   table1 = gtk_table_new (4, 3, FALSE);
416   gtk_widget_ref (table1);
417   gtk_object_set_data_full (GTK_OBJECT (intf_window), "table1", table1,
418                             (GtkDestroyNotify) gtk_widget_unref);
419   gtk_widget_show (table1);
420   gnome_app_set_contents (GNOME_APP (intf_window), table1);
421
422   hscale1 = gtk_hscale_new (GTK_ADJUSTMENT (gtk_adjustment_new (0, 0, 12, 0.1, 1, 1)));
423   gtk_widget_ref (hscale1);
424   gtk_object_set_data_full (GTK_OBJECT (intf_window), "hscale1", hscale1,
425                             (GtkDestroyNotify) gtk_widget_unref);
426   gtk_widget_show (hscale1);
427   gtk_table_attach (GTK_TABLE (table1), hscale1, 1, 2, 1, 2,
428                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
429                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
430
431   appbar = gnome_appbar_new (TRUE, TRUE, GNOME_PREFERENCES_NEVER);
432   gtk_widget_ref (appbar);
433   gtk_object_set_data_full (GTK_OBJECT (intf_window), "appbar", appbar,
434                             (GtkDestroyNotify) gtk_widget_unref);
435   gtk_widget_show (appbar);
436   gnome_app_set_statusbar (GNOME_APP (intf_window), appbar);
437
438   gtk_signal_connect (GTK_OBJECT (intf_window), "destroy",
439                       GTK_SIGNAL_FUNC (on_intf_window_destroy),
440                       NULL);
441   gtk_signal_connect (GTK_OBJECT (open), "clicked",
442                       GTK_SIGNAL_FUNC (on_open_clicked),
443                       NULL);
444   gtk_signal_connect (GTK_OBJECT (stop), "clicked",
445                       GTK_SIGNAL_FUNC (on_stop_clicked),
446                       NULL);
447   gtk_signal_connect (GTK_OBJECT (play), "clicked",
448                       GTK_SIGNAL_FUNC (on_play_clicked),
449                       NULL);
450   gtk_signal_connect (GTK_OBJECT (pause), "clicked",
451                       GTK_SIGNAL_FUNC (on_pause_clicked),
452                       NULL);
453   gtk_signal_connect (GTK_OBJECT (mute), "clicked",
454                       GTK_SIGNAL_FUNC (on_mute_clicked),
455                       NULL);
456
457   return intf_window;
458 }
459
460 GtkWidget*
461 create_intf_about (void)
462 {
463   const gchar *authors[] = {
464     "too many to list here ...",
465     "see http://www.videolan.org/ for more details",
466     NULL
467   };
468   GtkWidget *intf_about;
469
470   intf_about = gnome_about_new ("Vlc", VERSION,
471                         _("(C) 1996-2000 the VideoLAN Team"),
472                         authors,
473                         _("This is the VideoLAN client.\nIt plays MPEG streams from a file or a network source."),
474                         NULL);
475   gtk_object_set_data (GTK_OBJECT (intf_about), "intf_about", intf_about);
476
477   return intf_about;
478 }
479
480 static GnomeUIInfo popup_channel_menu_uiinfo[] =
481 {
482   {
483     GNOME_APP_UI_ITEM, N_("None"),
484     NULL,
485     on_popup_channel0_activate, NULL, NULL,
486     GNOME_APP_PIXMAP_NONE, NULL,
487     0, 0, NULL
488   },
489   {
490     GNOME_APP_UI_ITEM, N_("1"),
491     NULL,
492     on_popup_channel1_activate, NULL, NULL,
493     GNOME_APP_PIXMAP_NONE, NULL,
494     0, 0, NULL
495   },
496   {
497     GNOME_APP_UI_ITEM, N_("2"),
498     NULL,
499     on_popup_channel2_activate, NULL, NULL,
500     GNOME_APP_PIXMAP_NONE, NULL,
501     0, 0, NULL
502   },
503   {
504     GNOME_APP_UI_ITEM, N_("3"),
505     NULL,
506     on_popup_channel3_activate, NULL, NULL,
507     GNOME_APP_PIXMAP_NONE, NULL,
508     0, 0, NULL
509   },
510   {
511     GNOME_APP_UI_ITEM, N_("4"),
512     NULL,
513     on_popup_channel4_activate, NULL, NULL,
514     GNOME_APP_PIXMAP_NONE, NULL,
515     0, 0, NULL
516   },
517   {
518     GNOME_APP_UI_ITEM, N_("5"),
519     NULL,
520     on_popup_channel5_activate, NULL, NULL,
521     GNOME_APP_PIXMAP_NONE, NULL,
522     0, 0, NULL
523   },
524   {
525     GNOME_APP_UI_ITEM, N_("Configure..."),
526     NULL,
527     on_popup_config_channels_activate, NULL, NULL,
528     GNOME_APP_PIXMAP_NONE, NULL,
529     0, 0, NULL
530   },
531   GNOMEUIINFO_END
532 };
533
534 static GnomeUIInfo intf_popup_uiinfo[] =
535 {
536   {
537     GNOME_APP_UI_ITEM, N_("Play"),
538     NULL,
539     on_popup_play_activate, NULL, NULL,
540     GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_FORWARD,
541     0, 0, NULL
542   },
543   {
544     GNOME_APP_UI_ITEM, N_("Stop"),
545     NULL,
546     on_popup_stop_activate, NULL, NULL,
547     GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_STOP,
548     0, 0, NULL
549   },
550   GNOMEUIINFO_SEPARATOR,
551   {
552     GNOME_APP_UI_ITEM, N_("Pause"),
553     NULL,
554     on_popup_pause_activate, NULL, NULL,
555     GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_TIMER_STOP,
556     0, 0, NULL
557   },
558   {
559     GNOME_APP_UI_ITEM, N_("Mute"),
560     NULL,
561     on_popup_mute_activate, NULL, NULL,
562     GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_VOLUME,
563     0, 0, NULL
564   },
565   {
566     GNOME_APP_UI_SUBTREE, N_("Channel"),
567     NULL,
568     popup_channel_menu_uiinfo, NULL, NULL,
569     GNOME_APP_PIXMAP_NONE, NULL,
570     0, 0, NULL
571   },
572   GNOMEUIINFO_SEPARATOR,
573   {
574     GNOME_APP_UI_ITEM, N_("Control window"),
575     NULL,
576     on_popup_control_activate, NULL, NULL,
577     GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_EXEC,
578     0, 0, NULL
579   },
580   {
581     GNOME_APP_UI_ITEM, N_("Playlist"),
582     NULL,
583     on_popup_playlist_activate, NULL, NULL,
584     GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_MENU_INDEX,
585     0, 0, NULL
586   },
587   GNOMEUIINFO_SEPARATOR,
588   GNOMEUIINFO_MENU_ABOUT_ITEM (on_popup_about_activate, NULL),
589   GNOMEUIINFO_MENU_EXIT_ITEM (on_popup_exit_activate, NULL),
590   GNOMEUIINFO_END
591 };
592
593 GtkWidget*
594 create_intf_popup (void)
595 {
596   GtkWidget *intf_popup;
597
598   intf_popup = gtk_menu_new ();
599   gtk_object_set_data (GTK_OBJECT (intf_popup), "intf_popup", intf_popup);
600   gnome_app_fill_menu (GTK_MENU_SHELL (intf_popup), intf_popup_uiinfo,
601                        NULL, FALSE, 0);
602
603   gtk_widget_ref (intf_popup_uiinfo[0].widget);
604   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_play",
605                             intf_popup_uiinfo[0].widget,
606                             (GtkDestroyNotify) gtk_widget_unref);
607
608   gtk_widget_ref (intf_popup_uiinfo[1].widget);
609   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_stop",
610                             intf_popup_uiinfo[1].widget,
611                             (GtkDestroyNotify) gtk_widget_unref);
612
613   gtk_widget_ref (intf_popup_uiinfo[2].widget);
614   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator2",
615                             intf_popup_uiinfo[2].widget,
616                             (GtkDestroyNotify) gtk_widget_unref);
617
618   gtk_widget_ref (intf_popup_uiinfo[3].widget);
619   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_pause",
620                             intf_popup_uiinfo[3].widget,
621                             (GtkDestroyNotify) gtk_widget_unref);
622
623   gtk_widget_ref (intf_popup_uiinfo[4].widget);
624   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_mute",
625                             intf_popup_uiinfo[4].widget,
626                             (GtkDestroyNotify) gtk_widget_unref);
627
628   gtk_widget_ref (intf_popup_uiinfo[5].widget);
629   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel",
630                             intf_popup_uiinfo[5].widget,
631                             (GtkDestroyNotify) gtk_widget_unref);
632
633   gtk_widget_ref (popup_channel_menu_uiinfo[0].widget);
634   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel0",
635                             popup_channel_menu_uiinfo[0].widget,
636                             (GtkDestroyNotify) gtk_widget_unref);
637
638   gtk_widget_ref (popup_channel_menu_uiinfo[1].widget);
639   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel1",
640                             popup_channel_menu_uiinfo[1].widget,
641                             (GtkDestroyNotify) gtk_widget_unref);
642
643   gtk_widget_ref (popup_channel_menu_uiinfo[2].widget);
644   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel2",
645                             popup_channel_menu_uiinfo[2].widget,
646                             (GtkDestroyNotify) gtk_widget_unref);
647
648   gtk_widget_ref (popup_channel_menu_uiinfo[3].widget);
649   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel3",
650                             popup_channel_menu_uiinfo[3].widget,
651                             (GtkDestroyNotify) gtk_widget_unref);
652
653   gtk_widget_ref (popup_channel_menu_uiinfo[4].widget);
654   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel4",
655                             popup_channel_menu_uiinfo[4].widget,
656                             (GtkDestroyNotify) gtk_widget_unref);
657
658   gtk_widget_ref (popup_channel_menu_uiinfo[5].widget);
659   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_channel5",
660                             popup_channel_menu_uiinfo[5].widget,
661                             (GtkDestroyNotify) gtk_widget_unref);
662
663   gtk_widget_ref (popup_channel_menu_uiinfo[6].widget);
664   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_config_channels",
665                             popup_channel_menu_uiinfo[6].widget,
666                             (GtkDestroyNotify) gtk_widget_unref);
667
668   gtk_widget_ref (intf_popup_uiinfo[6].widget);
669   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator3",
670                             intf_popup_uiinfo[6].widget,
671                             (GtkDestroyNotify) gtk_widget_unref);
672
673   gtk_widget_ref (intf_popup_uiinfo[7].widget);
674   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_control",
675                             intf_popup_uiinfo[7].widget,
676                             (GtkDestroyNotify) gtk_widget_unref);
677
678   gtk_widget_ref (intf_popup_uiinfo[8].widget);
679   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_playlist",
680                             intf_popup_uiinfo[8].widget,
681                             (GtkDestroyNotify) gtk_widget_unref);
682
683   gtk_widget_ref (intf_popup_uiinfo[9].widget);
684   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "separator2",
685                             intf_popup_uiinfo[9].widget,
686                             (GtkDestroyNotify) gtk_widget_unref);
687
688   gtk_widget_ref (intf_popup_uiinfo[10].widget);
689   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_about",
690                             intf_popup_uiinfo[10].widget,
691                             (GtkDestroyNotify) gtk_widget_unref);
692
693   gtk_widget_ref (intf_popup_uiinfo[11].widget);
694   gtk_object_set_data_full (GTK_OBJECT (intf_popup), "popup_exit",
695                             intf_popup_uiinfo[11].widget,
696                             (GtkDestroyNotify) gtk_widget_unref);
697
698   return intf_popup;
699 }
700
701 GtkWidget*
702 create_intf_playlist (void)
703 {
704   GtkWidget *intf_playlist;
705   GtkWidget *vbox1;
706   GtkWidget *scrolledwindow;
707   GtkWidget *clist;
708   GtkWidget *label_name;
709   GtkWidget *label_type;
710   GtkWidget *label_length;
711   GtkWidget *hbuttonbox;
712   GtkWidget *playlist_load;
713   GtkWidget *playlist_close;
714   GtkWidget *playlist_help;
715
716   intf_playlist = gtk_window_new (GTK_WINDOW_TOPLEVEL);
717   gtk_object_set_data (GTK_OBJECT (intf_playlist), "intf_playlist", intf_playlist);
718   gtk_window_set_title (GTK_WINDOW (intf_playlist), _("Playlist"));
719   gtk_window_set_default_size (GTK_WINDOW (intf_playlist), -1, 400);
720   gtk_window_set_policy (GTK_WINDOW (intf_playlist), TRUE, TRUE, FALSE);
721
722   vbox1 = gtk_vbox_new (FALSE, 0);
723   gtk_widget_ref (vbox1);
724   gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "vbox1", vbox1,
725                             (GtkDestroyNotify) gtk_widget_unref);
726   gtk_widget_show (vbox1);
727   gtk_container_add (GTK_CONTAINER (intf_playlist), vbox1);
728
729   scrolledwindow = gtk_scrolled_window_new (NULL, NULL);
730   gtk_widget_ref (scrolledwindow);
731   gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "scrolledwindow", scrolledwindow,
732                             (GtkDestroyNotify) gtk_widget_unref);
733   gtk_widget_show (scrolledwindow);
734   gtk_box_pack_start (GTK_BOX (vbox1), scrolledwindow, TRUE, TRUE, 0);
735   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
736
737   clist = gtk_clist_new (3);
738   gtk_widget_ref (clist);
739   gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "clist", clist,
740                             (GtkDestroyNotify) gtk_widget_unref);
741   gtk_widget_show (clist);
742   gtk_container_add (GTK_CONTAINER (scrolledwindow), clist);
743   gtk_clist_set_column_width (GTK_CLIST (clist), 0, 147);
744   gtk_clist_set_column_width (GTK_CLIST (clist), 1, 76);
745   gtk_clist_set_column_width (GTK_CLIST (clist), 2, 98);
746   gtk_clist_set_selection_mode (GTK_CLIST (clist), GTK_SELECTION_MULTIPLE);
747   gtk_clist_column_titles_show (GTK_CLIST (clist));
748
749   label_name = gtk_label_new (_("Name"));
750   gtk_widget_ref (label_name);
751   gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "label_name", label_name,
752                             (GtkDestroyNotify) gtk_widget_unref);
753   gtk_widget_show (label_name);
754   gtk_clist_set_column_widget (GTK_CLIST (clist), 0, label_name);
755
756   label_type = gtk_label_new (_("Type"));
757   gtk_widget_ref (label_type);
758   gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "label_type", label_type,
759                             (GtkDestroyNotify) gtk_widget_unref);
760   gtk_widget_show (label_type);
761   gtk_clist_set_column_widget (GTK_CLIST (clist), 1, label_type);
762
763   label_length = gtk_label_new (_("Length"));
764   gtk_widget_ref (label_length);
765   gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "label_length", label_length,
766                             (GtkDestroyNotify) gtk_widget_unref);
767   gtk_widget_show (label_length);
768   gtk_clist_set_column_widget (GTK_CLIST (clist), 2, label_length);
769
770   hbuttonbox = gtk_hbutton_box_new ();
771   gtk_widget_ref (hbuttonbox);
772   gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "hbuttonbox", hbuttonbox,
773                             (GtkDestroyNotify) gtk_widget_unref);
774   gtk_widget_show (hbuttonbox);
775   gtk_box_pack_start (GTK_BOX (vbox1), hbuttonbox, FALSE, FALSE, 0);
776   gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox), 5);
777
778   playlist_load = gtk_button_new_with_label (_("Load"));
779   gtk_widget_ref (playlist_load);
780   gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "playlist_load", playlist_load,
781                             (GtkDestroyNotify) gtk_widget_unref);
782   gtk_widget_show (playlist_load);
783   gtk_container_add (GTK_CONTAINER (hbuttonbox), playlist_load);
784   GTK_WIDGET_SET_FLAGS (playlist_load, GTK_CAN_DEFAULT);
785
786   playlist_close = gnome_stock_button (GNOME_STOCK_BUTTON_CLOSE);
787   gtk_widget_ref (playlist_close);
788   gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "playlist_close", playlist_close,
789                             (GtkDestroyNotify) gtk_widget_unref);
790   gtk_widget_show (playlist_close);
791   gtk_container_add (GTK_CONTAINER (hbuttonbox), playlist_close);
792   GTK_WIDGET_SET_FLAGS (playlist_close, GTK_CAN_DEFAULT);
793
794   playlist_help = gnome_stock_button (GNOME_STOCK_BUTTON_HELP);
795   gtk_widget_ref (playlist_help);
796   gtk_object_set_data_full (GTK_OBJECT (intf_playlist), "playlist_help", playlist_help,
797                             (GtkDestroyNotify) gtk_widget_unref);
798   gtk_widget_show (playlist_help);
799   gtk_container_add (GTK_CONTAINER (hbuttonbox), playlist_help);
800   GTK_WIDGET_SET_FLAGS (playlist_help, GTK_CAN_DEFAULT);
801
802   gtk_signal_connect (GTK_OBJECT (intf_playlist), "destroy",
803                       GTK_SIGNAL_FUNC (on_intf_playlist_destroy),
804                       NULL);
805   gtk_signal_connect (GTK_OBJECT (playlist_close), "clicked",
806                       GTK_SIGNAL_FUNC (on_playlist_close_clicked),
807                       NULL);
808
809   return intf_playlist;
810 }
811