]> git.sesse.net Git - vlc/blob - modules/gui/wxwidgets/interface.cpp
* modules/gui/wxwidgets: wxwidgets 2.4.2 compilation fixes as suggested by Charlie...
[vlc] / modules / gui / wxwidgets / interface.cpp
1 /*****************************************************************************
2  * interface.cpp : wxWidgets plugin for vlc
3  *****************************************************************************
4  * Copyright (C) 2000-2005 the VideoLAN team
5  * $Id$
6  *
7  * Authors: Gildas Bazin <gbazin@videolan.org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
22  *****************************************************************************/
23
24 /*****************************************************************************
25  * Preamble
26  *****************************************************************************/
27 #include "interface.hpp"
28 #include "playlist_manager.hpp"
29 #include "extrapanel.hpp"
30 #include "timer.hpp"
31 #include "video.hpp"
32 #include <vlc_keys.h>
33
34 #include "charset.h"
35
36 #include <vlc/aout.h>
37 #include "charset.h"
38
39 /* include the toolbar graphics */
40 #include "bitmaps/play.xpm"
41 #include "bitmaps/pause.xpm"
42 #include "bitmaps/stop.xpm"
43 #include "bitmaps/prev.xpm"
44 #include "bitmaps/next.xpm"
45 #include "bitmaps/eject.xpm"
46 #include "bitmaps/slow.xpm"
47 #include "bitmaps/fast.xpm"
48 #include "bitmaps/playlist.xpm"
49 #include "bitmaps/playlist_small.xpm"
50 #include "bitmaps/speaker.xpm"
51 #include "bitmaps/speaker_mute.xpm"
52
53 #define TOOLBAR_BMP_WIDTH 16
54 #define TOOLBAR_BMP_HEIGHT 16
55
56 /* include the icon graphic */
57 #include "../../../share/vlc32x32.xpm"
58 /* include a small icon graphic for the systray icon */
59 #ifdef wxHAS_TASK_BAR_ICON
60 #include "../../../share/vlc16x16.xpm"
61 #endif
62
63 /*****************************************************************************
64  * Local class declarations.
65  *****************************************************************************/
66 class wxMenuExt: public wxMenu
67 {
68 public:
69     /* Constructor */
70     wxMenuExt( wxMenu* parentMenu, int id, const wxString& text,
71                    const wxString& helpString, wxItemKind kind,
72                    char *_psz_var, int _i_object_id, vlc_value_t _val,
73                    int _i_val_type );
74
75     virtual ~wxMenuExt() {};
76
77     char *psz_var;
78     int  i_val_type;
79     int  i_object_id;
80     vlc_value_t val;
81
82 private:
83
84 };
85
86 class wxVolCtrl;
87 class VLCVolCtrl : public wxControl
88 {
89 public:
90     VLCVolCtrl( intf_thread_t *p_intf, wxWindow *p_parent );
91     virtual ~VLCVolCtrl() {};
92
93     virtual void OnPaint( wxPaintEvent &event );
94     void OnChange( wxMouseEvent& event );
95     void UpdateVolume();
96
97   private:
98     DECLARE_EVENT_TABLE()
99
100     wxVolCtrl *gauge;
101     int i_y_offset;
102     vlc_bool_t b_mute;
103     intf_thread_t *p_intf;
104 };
105
106 BEGIN_EVENT_TABLE(VLCVolCtrl, wxControl)
107     EVT_PAINT(VLCVolCtrl::OnPaint)
108
109     /* Mouse events */
110     EVT_LEFT_UP(VLCVolCtrl::OnChange)
111 END_EVENT_TABLE()
112
113 /*****************************************************************************
114  * Event Table.
115  *****************************************************************************/
116
117 DEFINE_LOCAL_EVENT_TYPE( wxEVT_INTF );
118
119 /* IDs for the controls and the menu commands */
120 enum
121 {
122     /* menu items */
123     MenuDummy_Event = wxID_HIGHEST + 1000,
124     Exit_Event = wxID_HIGHEST,
125     OpenFileSimple_Event,
126     OpenAdv_Event,
127     OpenFile_Event,
128     OpenDir_Event,
129     OpenDisc_Event,
130     OpenNet_Event,
131     OpenCapture_Event,
132     OpenSat_Event,
133     OpenOther_Event,
134     EjectDisc_Event,
135
136     Wizard_Event,
137
138     Playlist_Event,
139     PlaylistSmall_Event,
140     Logs_Event,
141     FileInfo_Event,
142
143     Prefs_Event,
144     Extended_Event,
145     Bookmarks_Event,
146     Skins_Event,
147
148     StopStream_Event,
149     PlayStream_Event,
150     PrevStream_Event,
151     NextStream_Event,
152     SlowStream_Event,
153     FastStream_Event,
154
155     /* it is important for the id corresponding to the "About" command to have
156      * this standard value as otherwise it won't be handled properly under Mac
157      * (where it is special and put into the "Apple" menu) */
158     About_Event = wxID_ABOUT,
159     UpdateVLC_Event,
160     VLM_Event,
161
162     Iconize_Event
163 };
164
165 BEGIN_EVENT_TABLE(Interface, wxFrame)
166     /* Menu events */
167     EVT_MENU(Exit_Event, Interface::OnExit)
168     EVT_MENU(About_Event, Interface::OnAbout)
169     EVT_MENU(UpdateVLC_Event, Interface::OnShowDialog)
170     EVT_MENU(VLM_Event, Interface::OnShowDialog)
171
172     EVT_MENU(Playlist_Event, Interface::OnShowDialog)
173     EVT_MENU(PlaylistSmall_Event, Interface::OnSmallPlaylist)
174     EVT_MENU(Logs_Event, Interface::OnShowDialog)
175     EVT_MENU(FileInfo_Event, Interface::OnShowDialog)
176     EVT_MENU(Prefs_Event, Interface::OnShowDialog)
177
178     EVT_MENU_OPEN(Interface::OnMenuOpen)
179
180     EVT_MENU( Extended_Event, Interface::OnExtended )
181
182     EVT_MENU( Bookmarks_Event, Interface::OnShowDialog)
183
184 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
185     EVT_CONTEXT_MENU(Interface::OnContextMenu2)
186 #endif
187     EVT_RIGHT_UP(Interface::OnContextMenu)
188
189     /* Toolbar events */
190     EVT_MENU(OpenFileSimple_Event, Interface::OnShowDialog)
191     EVT_MENU(OpenAdv_Event, Interface::OnShowDialog)
192     EVT_MENU(OpenFile_Event, Interface::OnShowDialog)
193     EVT_MENU(OpenDir_Event, Interface::OnShowDialog)
194     EVT_MENU(OpenDisc_Event, Interface::OnShowDialog)
195     EVT_MENU(OpenNet_Event, Interface::OnShowDialog)
196     EVT_MENU(OpenCapture_Event, Interface::OnShowDialog)
197     EVT_MENU(OpenSat_Event, Interface::OnShowDialog)
198     EVT_MENU(Wizard_Event, Interface::OnShowDialog)
199     EVT_MENU(StopStream_Event, Interface::OnStopStream)
200     EVT_MENU(PlayStream_Event, Interface::OnPlayStream)
201     EVT_MENU(PrevStream_Event, Interface::OnPrevStream)
202     EVT_MENU(NextStream_Event, Interface::OnNextStream)
203     EVT_MENU(SlowStream_Event, Interface::OnSlowStream)
204     EVT_MENU(FastStream_Event, Interface::OnFastStream)
205
206     /* Custom events */
207     EVT_COMMAND(0, wxEVT_INTF, Interface::OnControlEvent)
208     EVT_COMMAND(1, wxEVT_INTF, Interface::OnControlEvent)
209 END_EVENT_TABLE()
210
211 /*****************************************************************************
212  * Constructor.
213  *****************************************************************************/
214 Interface::Interface( intf_thread_t *_p_intf, long style ):
215     wxFrame( NULL, -1, wxT("VLC media player"),
216              wxDefaultPosition, wxSize(700,100), style )
217 {
218     /* Initializations */
219     p_intf = _p_intf;
220     b_extra = VLC_FALSE;
221     extra_frame = 0;
222     b_playlist_manager = VLC_FALSE;
223     playlist_manager = 0;
224
225     /* Give our interface a nice little icon */
226     SetIcon( wxIcon( vlc_xpm ) );
227
228     /* Create a splitter window that will fill in the interface window.
229      * We need a splitter bar in order to make the embedded playlist
230      * resizable. */
231     splitter = new wxSplitterWindow( this, -1, wxDefaultPosition, wxSize(0,0),
232                                      wxCLIP_CHILDREN|wxSP_3DSASH );
233     main_sizer = new wxBoxSizer( wxVERTICAL );
234     main_sizer->Add( splitter, 1, wxEXPAND );
235     SetSizer( main_sizer );
236
237     /* Create a main panel that will fill in the interface window */
238     main_panel = new wxPanel( splitter, -1, wxPoint(0,0), wxSize(0,0),
239                               wxCLIP_CHILDREN );
240     main_panel->SetFocus();
241
242 #if defined(__WXGTK20__) && wxCHECK_VERSION(2,5,6)
243     /* As ugly as your butt! Please remove when wxWidgets 2.6 fixed their
244      * Accelerators bug. */
245     main_panel->m_imData = 0;
246     m_imData = 0;
247 #endif
248
249     /* Create a sizer for the main frame */
250     panel_sizer = new wxBoxSizer( wxVERTICAL );
251     main_panel->SetSizer( panel_sizer );
252
253     /* Put this in the splitter */
254     splitter->Initialize( main_panel );
255 #if wxCHECK_VERSION(2,6,0)
256     splitter->SetSashGravity( 1.0 );
257 #endif
258
259 #ifdef wxHAS_TASK_BAR_ICON
260     /* Systray integration */
261     p_systray = NULL;
262     if( config_GetInt( p_intf, "wx-systray" ) )
263     {
264         p_systray = new Systray( this, p_intf );
265     }
266 #endif
267
268     /* Creation of the menu bar */
269     CreateOurMenuBar();
270
271     /* Creation of the tool bar */
272     CreateOurToolBar();
273
274     /* Creation of the status bar
275      * Helptext for menu items and toolbar tools will automatically get
276      * displayed here. */
277     int i_status_width[3] = {100, 40, -1};
278     statusbar = CreateStatusBar( 3 );                            /* 2 fields */
279     statusbar->SetStatusWidths( 3, i_status_width );
280     statusbar->SetStatusText( wxString::Format(wxT("x%.2f"), 1.0), 1 );
281
282     /* Get minimum window size to prevent user from glitching it */
283     splitter->SetSizeHints( -1, 0 );
284     panel_sizer->Layout(); panel_sizer->Fit( main_panel );
285     main_sizer->Layout(); main_sizer->Fit( this );
286     main_min_size = GetSize();
287     splitter->SetSizeHints( -1, -1 );
288
289     /* Video window */
290     video_window = 0;
291     if( config_GetInt( p_intf, "wx-embed" ) )
292     {
293         video_window = CreateVideoWindow( p_intf, main_panel );
294         panel_sizer->Add( p_intf->p_sys->p_video_sizer, 1, wxEXPAND, 0 );
295     }
296
297     /* Creation of the input manager panel */
298     input_manager = new InputManager( p_intf, this, main_panel );
299     panel_sizer->Add( input_manager, 0, wxEXPAND , 0 );
300
301     /* Layout everything */
302     splitter->SetSizeHints( -1, 0 );
303     panel_sizer->Layout(); panel_sizer->Fit( main_panel );
304     main_sizer->Layout(); main_sizer->Fit( this );
305     splitter->SetSizeHints( -1, -1 );
306
307 #if wxUSE_DRAG_AND_DROP
308     /* Associate drop targets with the main interface */
309     SetDropTarget( new DragAndDrop( p_intf ) );
310 #endif
311
312     SetupHotkeys();
313
314     /* Start timer */
315     timer = new Timer( p_intf, this );
316
317     /* Restore previous position / settings */
318     WindowSettings *ws = p_intf->p_sys->p_window_settings;
319     wxPoint p;
320     wxSize s;
321     bool b_shown;
322
323     ws->SetScreen( wxSystemSettings::GetMetric( wxSYS_SCREEN_X ),
324                    wxSystemSettings::GetMetric( wxSYS_SCREEN_Y ) );
325
326     if( ws->GetSettings( WindowSettings::ID_MAIN, b_shown, p, s ) ) Move( p );
327
328     /* Show extended GUI if requested */
329     wxCommandEvent dummy;
330     if( config_GetInt( p_intf, "wx-extended" ) ) OnExtended( dummy );
331
332     SetIntfMinSize();
333 }
334
335 Interface::~Interface()
336 {
337     WindowSettings *ws = p_intf->p_sys->p_window_settings;
338
339     if( !IsIconized() )
340     {
341         ws->SetSettings( WindowSettings::ID_MAIN, true,
342                          GetPosition(), GetSize() );
343     }
344
345     PopEventHandler(true);
346
347     if( video_window ) delete video_window;
348
349 #ifdef wxHAS_TASK_BAR_ICON
350     if( p_systray ) delete p_systray;
351 #endif
352
353     if( p_intf->p_sys->p_wxwindow ) delete p_intf->p_sys->p_wxwindow;
354
355     /* Clean up */
356     delete timer;
357 }
358
359 void Interface::Init()
360 {
361     /* Misc init */
362     SetupHotkeys();
363 }
364
365 void Interface::Update()
366 {
367     /* Misc updates */
368     ((VLCVolCtrl *)volctrl)->UpdateVolume();
369
370     if( playlist_manager ) playlist_manager->Update();
371 }
372
373 void Interface::OnControlEvent( wxCommandEvent& event )
374 {
375     switch( event.GetId() )
376     {
377     case 0:
378         main_sizer->Layout();
379         main_sizer->Fit( this );
380         break;
381
382     case 1:
383         long i_style = GetWindowStyle();
384         if( event.GetInt() ) i_style |= wxSTAY_ON_TOP;
385         else i_style &= ~wxSTAY_ON_TOP;
386         SetWindowStyle( i_style );
387         break;
388     }
389 }
390
391 /*****************************************************************************
392  * Private methods.
393  *****************************************************************************/
394 void Interface::CreateOurMenuBar()
395 {
396     int minimal = config_GetInt( p_intf, "wx-minimal" );
397
398     /* Create the "File" menu */
399     wxMenu *file_menu = new wxMenu;
400
401     if (!minimal)
402     {
403     file_menu->Append( OpenFileSimple_Event,
404                        wxU(_("Quick &Open File...\tCtrl-O")) );
405
406     file_menu->AppendSeparator();
407     file_menu->Append( OpenFile_Event, wxU(_("Open &File...\tCtrl-F")) );
408     file_menu->Append( OpenDir_Event, wxU(_("Open Dir&ectory...\tCtrl-E")) );
409     file_menu->Append( OpenDisc_Event, wxU(_("Open &Disc...\tCtrl-D")) );
410     file_menu->Append( OpenNet_Event,
411                        wxU(_("Open &Network Stream...\tCtrl-N")) );
412     file_menu->Append( OpenCapture_Event,
413                        wxU(_("Open C&apture Device...\tCtrl-A")) );
414
415     file_menu->AppendSeparator();
416     file_menu->Append( Wizard_Event, wxU(_("&Wizard...\tCtrl-W")) );
417     file_menu->AppendSeparator();
418     }
419     file_menu->Append( Exit_Event, wxU(_("E&xit\tCtrl-X")) );
420
421     /* Create the "View" menu */
422     wxMenu *view_menu = new wxMenu;
423     if (!minimal)
424     {
425     view_menu->Append( Playlist_Event, wxU(_("&Playlist...\tCtrl-P")) );
426     }
427     view_menu->Append( Logs_Event, wxU(_("&Messages...\tCtrl-M")) );
428     view_menu->Append( FileInfo_Event,
429                        wxU(_("Stream and Media &info...\tCtrl-I")) );
430     view_menu->Append( VLM_Event,
431                        wxU(_("VLM Control...\tCtrl-V")) );
432
433     /* Create the "Auto-generated" menus */
434     p_settings_menu = SettingsMenu( p_intf, this );
435     p_audio_menu = AudioMenu( p_intf, this );
436     p_video_menu = VideoMenu( p_intf, this );
437     p_navig_menu = NavigMenu( p_intf, this );
438
439     /* Create the "Help" menu */
440     wxMenu *help_menu = new wxMenu;
441     help_menu->Append( About_Event, wxU(_("About VLC media player")) );
442     help_menu->AppendSeparator();
443     help_menu->Append( UpdateVLC_Event, wxU(_("Check for updates ...")) );
444
445     /* Append the freshly created menus to the menu bar... */
446     wxMenuBar *menubar = new wxMenuBar();
447     menubar->Append( file_menu, wxU(_("&File")) );
448     menubar->Append( view_menu, wxU(_("&View")) );
449     menubar->Append( p_settings_menu, wxU(_("&Settings")) );
450     menubar->Append( p_audio_menu, wxU(_("&Audio")) );
451     menubar->Append( p_video_menu, wxU(_("&Video")) );
452     menubar->Append( p_navig_menu, wxU(_("&Navigation")) );
453     menubar->Append( help_menu, wxU(_("&Help")) );
454
455     /* Attach the menu bar to the frame */
456     SetMenuBar( menubar );
457
458     /* Find out size of menu bar */
459     int i_size = 0;
460     for( unsigned int i = 0; i < menubar->GetMenuCount(); i++ )
461     {
462         int i_width, i_height;
463         menubar->GetTextExtent( menubar->GetLabelTop(i), &i_width, &i_height );
464         i_size += i_width +
465 #if defined(__WXGTK__)
466             22 /* approximate margin */;
467 #else
468 #if (wxMAJOR_VERSION <= 2) && (wxMINOR_VERSION <= 5) && (wxRELEASE_NUMBER < 3)
469             4 /* approximate margin */;
470 #else
471             18 /* approximate margin */;
472 #endif
473 #endif
474     }
475
476 /* Patch by zcot for menu wrapping */
477 #if defined(WIN32)
478     /* Find out size of msw menu bar */
479     i_size = 0;
480     SIZE sizing;
481     HDC hdc = GetDC( NULL );
482     for( unsigned int i = 0; i < menubar->GetMenuCount(); i++ )
483     {
484         GetTextExtentPoint32( hdc, menubar->GetLabelTop(i).c_str(),
485                                 menubar->GetLabelTop(i).Length(), &sizing );
486
487         // [ SM_CXDLGFRAME + pixels + textextent + pixels + SM_CXDLGFRAME ]
488         i_size += sizing.cx + 2 + GetSystemMetrics( SM_CXDLGFRAME ) * 2;
489     }
490     ReleaseDC( NULL, hdc );
491     i_size += GetSystemMetrics( SM_CXSIZEFRAME ) * 2 + 4;
492 #endif
493 /* End patch by zcot */
494
495     panel_sizer->SetMinSize( i_size, -1 );
496
497     /* Intercept all menu events in our custom event handler */
498     PushEventHandler( new MenuEvtHandler( p_intf, this ) );
499
500 #if wxUSE_DRAG_AND_DROP
501     /* Associate drop targets with the menubar */
502     menubar->SetDropTarget( new DragAndDrop( p_intf ) );
503 #endif
504 }
505
506 void Interface::CreateOurToolBar()
507 {
508 #define HELP_OPEN N_("Open")
509 #define HELP_STOP N_("Stop")
510 #define HELP_PLAY N_("Play")
511 #define HELP_PAUSE N_("Pause")
512 #define HELP_PLO N_("Playlist")
513 #define HELP_SPLO N_("Small playlist")
514 #define HELP_PLP N_("Previous playlist item")
515 #define HELP_PLN N_("Next playlist item")
516 #define HELP_SLOW N_("Play slower")
517 #define HELP_FAST N_("Play faster")
518
519     int minimal = config_GetInt( p_intf, "wx-minimal" );
520
521     wxLogNull LogDummy; /* Hack to suppress annoying log message on the win32
522                          * version because we don't include wx.rc */
523
524     wxToolBar *toolbar =
525         CreateToolBar( wxTB_HORIZONTAL | wxTB_FLAT );
526
527     toolbar->SetToolBitmapSize( wxSize(TOOLBAR_BMP_WIDTH,TOOLBAR_BMP_HEIGHT) );
528
529     if (!minimal)
530     {
531     toolbar->AddTool( OpenFile_Event, wxT(""),
532                       wxBitmap( eject_xpm ), wxU(_(HELP_OPEN)) );
533     toolbar->AddSeparator();
534     }
535
536     wxToolBarToolBase *p_tool = toolbar->AddTool( PlayStream_Event, wxT(""),
537                       wxBitmap( play_xpm ), wxU(_(HELP_PLAY)), wxITEM_CHECK );
538     p_tool->SetClientData( p_tool );
539
540     if (!minimal)
541     {
542     toolbar->AddTool( StopStream_Event, wxT(""), wxBitmap( stop_xpm ),
543                       wxU(_(HELP_STOP)) );
544     toolbar->AddSeparator();
545
546     toolbar->AddTool( PrevStream_Event, wxT(""),
547                       wxBitmap( prev_xpm ), wxU(_(HELP_PLP)) );
548     toolbar->AddTool( SlowStream_Event, wxT(""),
549                       wxBitmap( slow_xpm ), wxU(_(HELP_SLOW)) );
550     toolbar->AddTool( FastStream_Event, wxT(""),
551                       wxBitmap( fast_xpm ), wxU(_(HELP_FAST)) );
552     toolbar->AddTool( NextStream_Event, wxT(""), wxBitmap( next_xpm ),
553                       wxU(_(HELP_PLN)) );
554     toolbar->AddSeparator();
555     toolbar->AddTool( Playlist_Event, wxT(""), wxBitmap( playlist_xpm ),
556                       wxU(_(HELP_PLO)) );
557     toolbar->AddTool( PlaylistSmall_Event, wxT(""),
558                       wxBitmap( playlist_small_xpm ), wxU(_(HELP_SPLO)) );
559     }
560
561     wxControl *p_dummy_ctrl =
562         new wxControl( toolbar, -1, wxDefaultPosition,
563                        wxSize(16, 16 ), wxBORDER_NONE );
564
565     toolbar->AddControl( p_dummy_ctrl );
566
567     volctrl = new VLCVolCtrl( p_intf, toolbar );
568     toolbar->AddControl( volctrl );
569
570     toolbar->Realize();
571
572 #if wxUSE_DRAG_AND_DROP
573     /* Associate drop targets with the toolbar */
574     toolbar->SetDropTarget( new DragAndDrop( p_intf ) );
575 #endif
576 }
577
578 static int ConvertHotkeyModifiers( int i_hotkey )
579 {
580     int i_accel_flags = 0;
581     if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
582     if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
583     if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
584     if( !i_accel_flags ) i_accel_flags = wxACCEL_NORMAL;
585     return i_accel_flags;
586 }
587
588 static int ConvertHotkey( int i_hotkey )
589 {
590     int i_key = i_hotkey & ~KEY_MODIFIER;
591     if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
592     else if( i_key & KEY_SPECIAL )
593     {
594         switch ( i_key )
595         {
596         case KEY_LEFT: return WXK_LEFT;
597         case KEY_RIGHT: return WXK_RIGHT;
598         case KEY_UP: return WXK_UP;
599         case KEY_DOWN: return WXK_DOWN;
600         case KEY_SPACE: return WXK_SPACE;
601         case KEY_ENTER: return WXK_RETURN;
602         case KEY_F1: return WXK_F1;
603         case KEY_F2: return WXK_F2;
604         case KEY_F3: return WXK_F3;
605         case KEY_F4: return WXK_F4;
606         case KEY_F5: return WXK_F5;
607         case KEY_F6: return WXK_F6;
608         case KEY_F7: return WXK_F7;
609         case KEY_F8: return WXK_F8;
610         case KEY_F9: return WXK_F9;
611         case KEY_F10: return WXK_F10;
612         case KEY_F11: return WXK_F11;
613         case KEY_F12: return WXK_F12;
614         case KEY_HOME: return WXK_HOME;
615         case KEY_END: return WXK_END;
616         case KEY_INSERT: return WXK_INSERT;
617         case KEY_DELETE: return WXK_DELETE;
618         case KEY_MENU: return WXK_MENU;
619         case KEY_ESC: return WXK_ESCAPE;
620         case KEY_PAGEUP: return WXK_PRIOR;
621         case KEY_PAGEDOWN: return WXK_NEXT;
622         case KEY_TAB: return WXK_TAB;
623         case KEY_BACKSPACE: return WXK_BACK;
624         }
625     }
626     return WXK_F24;
627 }
628
629 void Interface::SetupHotkeys()
630 {
631     struct vlc_t::hotkey *p_hotkeys = p_intf->p_vlc->p_hotkeys;
632     int i_hotkeys;
633
634     /* Count number of hoteys */
635     for( i_hotkeys = 0; p_hotkeys[i_hotkeys].psz_action != NULL; i_hotkeys++ );
636
637     p_intf->p_sys->i_first_hotkey_event = wxID_HIGHEST + 7000;
638     p_intf->p_sys->i_hotkeys = i_hotkeys;
639
640     wxAcceleratorEntry *p_entries = new wxAcceleratorEntry[i_hotkeys];
641
642     /* Setup the hotkeys as accelerators */
643     for( int i = 0; i < i_hotkeys; i++ )
644     {
645         int i_mod = ConvertHotkeyModifiers( p_hotkeys[i].i_key );
646         int i_key = ConvertHotkey( p_hotkeys[i].i_key );
647
648 #ifdef WIN32
649         if( !(p_hotkeys[i].i_key & KEY_SPECIAL) && i_mod )
650             i_key = toupper(i_key);
651 #endif
652
653         p_entries[i].Set( i_mod, i_key,
654                           p_intf->p_sys->i_first_hotkey_event + i );
655     }
656
657     wxAcceleratorTable accel( i_hotkeys, p_entries );
658
659     if( !accel.Ok() )
660     {
661         msg_Err( p_intf, "invalid accelerator table" );
662     }
663     else
664     {
665         SetAcceleratorTable( accel );
666     }
667
668     delete [] p_entries;
669 }
670
671 void Interface::SetIntfMinSize()
672 {
673     wxSize ms = main_min_size;
674
675     if( extra_frame && extra_frame->IsShown() )
676     {
677         ms.SetHeight( ms.GetHeight() + ext_min_size.GetHeight() );
678         if( ext_min_size.GetWidth() > ms.GetWidth() )
679             ms.SetWidth( ext_min_size.GetWidth() );
680     }
681
682     if( playlist_manager && playlist_manager->IsShown() )
683     {
684         ms.SetHeight( ms.GetHeight() + playlist_min_size.GetHeight() );
685         if( playlist_min_size.GetWidth() > ms.GetWidth() )
686             ms.SetWidth( playlist_min_size.GetWidth() );
687     }
688
689     SetSizeHints( ms.GetWidth(), ms.GetHeight() );
690 }
691
692 /*****************************************************************************
693  * Event Handlers.
694  *****************************************************************************/
695 void Interface::OnMenuOpen( wxMenuEvent& event )
696 {
697 #if defined( __WXMSW__ )
698 #   define GetEventObject GetMenu
699 #endif
700
701     if( event.GetEventObject() == p_settings_menu )
702     {
703         p_settings_menu = SettingsMenu( p_intf, this, p_settings_menu );
704
705         /* Add static items */
706         p_settings_menu->AppendCheckItem( Extended_Event,
707             wxU(_("Extended &GUI\tCtrl-G") ) );
708         if( b_extra ) p_settings_menu->Check( Extended_Event, TRUE );
709         p_settings_menu->Append( Bookmarks_Event,
710                                  wxU(_("&Bookmarks...\tCtrl-B") ) );
711         p_settings_menu->Append( Prefs_Event,
712                                  wxU(_("Preference&s...\tCtrl-S")) );
713     }
714
715     else if( event.GetEventObject() == p_audio_menu )
716     {
717         p_audio_menu = AudioMenu( p_intf, this, p_audio_menu );
718     }
719
720     else if( event.GetEventObject() == p_video_menu )
721     {
722         p_video_menu = VideoMenu( p_intf, this, p_video_menu );
723     }
724
725     else if( event.GetEventObject() == p_navig_menu )
726     {
727         p_navig_menu = NavigMenu( p_intf, this, p_navig_menu );
728     }
729
730 #if defined( __WXMSW__ )
731 #   undef GetEventObject
732 #endif
733 }
734
735 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
736 void Interface::OnContextMenu2(wxContextMenuEvent& event)
737 {
738     /* Only show the context menu for the main interface */
739     if( GetId() != event.GetId() )
740     {
741         event.Skip();
742         return;
743     }
744
745     if( p_intf->p_sys->pf_show_dialog )
746         p_intf->p_sys->pf_show_dialog( p_intf, INTF_DIALOG_POPUPMENU, 1, 0 );
747 }
748 #endif
749 void Interface::OnContextMenu(wxMouseEvent& event)
750 {
751     if( p_intf->p_sys->pf_show_dialog )
752         p_intf->p_sys->pf_show_dialog( p_intf, INTF_DIALOG_POPUPMENU, 1, 0 );
753 }
754
755 void Interface::OnExit( wxCommandEvent& WXUNUSED(event) )
756 {
757     /* TRUE is to force the frame to close. */
758     Close(TRUE);
759 }
760
761 void Interface::OnAbout( wxCommandEvent& WXUNUSED(event) )
762 {
763     wxString msg;
764     msg.Printf( wxString(wxT("VLC media player " PACKAGE_VERSION)) +
765         wxU(_(" (wxWidgets interface)\n\n")) +
766         wxU(_("(c) 1996-2005 - the VideoLAN Team\n\n")) +
767        wxU(_("Compiled by "))+ wxU(VLC_CompileBy())+ wxU("@") +
768        wxU(VLC_CompileHost())+ wxT(".")+ wxU(VLC_CompileDomain())+ wxT(".\n") +
769        wxU(_("Compiler: "))+ wxU(VLC_Compiler())+wxT( ".\n") +
770        wxU(_("Based on SVN revision: "))+wxU(VLC_Changeset())+wxT(".\n\n") +
771 #ifdef __WXMSW__
772         wxU( vlc_wraptext(LICENSE_MSG,WRAPCOUNT,VLC_TRUE) ) + wxT("\n\n") +
773 #else
774         wxU( LICENSE_MSG ) + wxT("\n\n") +
775 #endif
776         wxU(_("The VideoLAN team <videolan@videolan.org>\n"
777               "http://www.videolan.org/\n\n")) );
778
779     wxMessageBox( msg, wxString::Format(wxU(_("About %s")),
780                   wxT("VLC media player")), wxOK | wxICON_INFORMATION, this );
781 }
782
783 void Interface::OnShowDialog( wxCommandEvent& event )
784 {
785     if( p_intf->p_sys->pf_show_dialog )
786     {
787         int i_id;
788
789         switch( event.GetId() )
790         {
791         case OpenFileSimple_Event:
792             i_id = INTF_DIALOG_FILE_SIMPLE;
793             break;
794         case OpenAdv_Event:
795             i_id = INTF_DIALOG_FILE;
796             break;
797         case OpenFile_Event:
798             i_id = INTF_DIALOG_FILE;
799             break;
800         case OpenDir_Event:
801             i_id = INTF_DIALOG_DIRECTORY;
802             break;
803         case OpenDisc_Event:
804             i_id = INTF_DIALOG_DISC;
805             break;
806         case OpenNet_Event:
807             i_id = INTF_DIALOG_NET;
808             break;
809         case OpenCapture_Event:
810             i_id = INTF_DIALOG_CAPTURE;
811             break;
812         case OpenSat_Event:
813             i_id = INTF_DIALOG_SAT;
814             break;
815         case Playlist_Event:
816             i_id = INTF_DIALOG_PLAYLIST;
817             break;
818         case Logs_Event:
819             i_id = INTF_DIALOG_MESSAGES;
820             break;
821         case FileInfo_Event:
822             i_id = INTF_DIALOG_FILEINFO;
823             break;
824         case Prefs_Event:
825             i_id = INTF_DIALOG_PREFS;
826             break;
827         case Wizard_Event:
828             i_id = INTF_DIALOG_WIZARD;
829             break;
830         case Bookmarks_Event:
831             i_id = INTF_DIALOG_BOOKMARKS;
832             break;
833         case UpdateVLC_Event:
834             i_id = INTF_DIALOG_UPDATEVLC;
835             break;
836         case VLM_Event:
837             i_id = INTF_DIALOG_VLM;
838             break;
839         default:
840             i_id = INTF_DIALOG_FILE;
841             break;
842         }
843
844         p_intf->p_sys->pf_show_dialog( p_intf, i_id, 1, 0 );
845     }
846 }
847
848 void Interface::OnExtended( wxCommandEvent& WXUNUSED(event) )
849 {
850     UpdateVideoWindow( p_intf, video_window );
851
852     if( !extra_frame )
853     {
854         /* Create the extra panel */
855         extra_frame = new ExtraPanel( p_intf, main_panel );
856         panel_sizer->Add( extra_frame, 0, wxEXPAND , 0 );
857         ext_min_size = extra_frame->GetBestSize();
858     }
859
860     b_extra = !b_extra;
861     panel_sizer->Show( extra_frame, b_extra );
862
863     SetIntfMinSize();
864     main_sizer->Layout();
865     main_sizer->Fit( this );
866 }
867
868 void Interface::OnSmallPlaylist( wxCommandEvent& WXUNUSED(event) )
869 {
870     UpdateVideoWindow( p_intf, video_window );
871
872     if( !playlist_manager )
873     {
874         /* Create the extra panel */
875         playlist_manager = new PlaylistManager( p_intf, splitter );
876         playlist_min_size = playlist_manager->GetBestSize();
877     }
878
879     b_playlist_manager = !b_playlist_manager;
880
881     if( b_playlist_manager )
882         splitter->SplitHorizontally( main_panel, playlist_manager,
883                                      -playlist_min_size.GetHeight() );
884     else
885         splitter->Unsplit( playlist_manager );
886
887     SetIntfMinSize();
888     main_sizer->Layout();
889     main_sizer->Fit( this );
890 }
891
892 void Interface::OnPlayStream( wxCommandEvent& WXUNUSED(event) )
893 {
894     PlayStream();
895 }
896
897 void Interface::PlayStream()
898 {
899     wxCommandEvent dummy;
900     playlist_t *p_playlist =
901         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
902                                        FIND_ANYWHERE );
903     if( p_playlist == NULL ) return;
904
905     if( p_playlist->i_size && p_playlist->i_enabled )
906     {
907         vlc_value_t state;
908
909         input_thread_t *p_input = (input_thread_t *)vlc_object_find( p_intf,
910                                                        VLC_OBJECT_INPUT,
911                                                        FIND_ANYWHERE );
912         if( p_input == NULL )
913         {
914             /* No stream was playing, start one */
915             playlist_Play( p_playlist );
916             vlc_object_release( p_playlist );
917             input_manager->Update();
918             return;
919         }
920
921         var_Get( p_input, "state", &state );
922         if( state.i_int != PAUSE_S )
923         {
924             /* A stream is being played, pause it */
925             state.i_int = PAUSE_S;
926         }
927         else
928         {
929             /* Stream is paused, resume it */
930             state.i_int = PLAYING_S;
931         }
932         var_Set( p_input, "state", state );
933
934         vlc_object_release( p_input );
935         vlc_object_release( p_playlist );
936         input_manager->Update();
937     }
938     else
939     {
940         /* If the playlist is empty, open a file requester instead */
941         vlc_object_release( p_playlist );
942         OnShowDialog( dummy );
943     }
944 }
945
946 void Interface::OnStopStream( wxCommandEvent& WXUNUSED(event) )
947 {
948     StopStream();
949 }
950 void Interface::StopStream()
951 {
952     playlist_t * p_playlist =
953         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
954                                        FIND_ANYWHERE );
955     if( p_playlist == NULL )
956     {
957         return;
958     }
959
960     playlist_Stop( p_playlist );
961     vlc_object_release( p_playlist );
962     input_manager->Update();
963 }
964
965 void Interface::OnPrevStream( wxCommandEvent& WXUNUSED(event) )
966 {
967     PrevStream();
968 }
969
970 void Interface::PrevStream()
971 {
972     playlist_t * p_playlist =
973         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
974                                        FIND_ANYWHERE );
975     if( p_playlist == NULL )
976     {
977         return;
978     }
979
980     playlist_Prev( p_playlist );
981     vlc_object_release( p_playlist );
982 }
983
984 void Interface::OnNextStream( wxCommandEvent& WXUNUSED(event) )
985 {
986     NextStream();
987 }
988
989 void Interface::NextStream()
990 {
991     playlist_t * p_playlist =
992         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
993                                        FIND_ANYWHERE );
994     if( p_playlist == NULL )
995     {
996         return;
997     }
998     playlist_Next( p_playlist );
999     vlc_object_release( p_playlist );
1000 }
1001
1002 void Interface::OnSlowStream( wxCommandEvent& WXUNUSED(event) )
1003 {
1004     input_thread_t *p_input =
1005         (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
1006                                            FIND_ANYWHERE );
1007     if( p_input )
1008     {
1009         vlc_value_t val; val.b_bool = VLC_TRUE;
1010
1011         var_Set( p_input, "rate-slower", val );
1012         vlc_object_release( p_input );
1013     }
1014 }
1015
1016 void Interface::OnFastStream( wxCommandEvent& WXUNUSED(event) )
1017 {
1018     input_thread_t *p_input =
1019         (input_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_INPUT,
1020                                            FIND_ANYWHERE );
1021     if( p_input )
1022     {
1023         vlc_value_t val; val.b_bool = VLC_TRUE;
1024
1025         var_Set( p_input, "rate-faster", val );
1026         vlc_object_release( p_input );
1027     }
1028 }
1029
1030 void Interface::TogglePlayButton( int i_playing_status )
1031 {
1032     wxToolBarToolBase *p_tool = (wxToolBarToolBase *)
1033         GetToolBar()->GetToolClientData( PlayStream_Event );
1034     if( !p_tool ) return;
1035
1036     if( i_playing_status == PLAYING_S )
1037     {
1038         p_tool->SetNormalBitmap( wxBitmap( pause_xpm ) );
1039         p_tool->SetLabel( wxU(_("Pause")) );
1040         p_tool->SetShortHelp( wxU(_(HELP_PAUSE)) );
1041     }
1042     else
1043     {
1044         p_tool->SetNormalBitmap( wxBitmap( play_xpm ) );
1045         p_tool->SetLabel( wxU(_("Play")) );
1046         p_tool->SetShortHelp( wxU(_(HELP_PLAY)) );
1047     }
1048
1049     GetToolBar()->Realize();
1050
1051 #if defined( __WXMSW__ )
1052     /* Needed to work around a bug in wxToolBar::Realize() */
1053     GetToolBar()->SetSize( GetSize().GetWidth(),
1054                            GetToolBar()->GetSize().GetHeight() );
1055     GetToolBar()->Update();
1056 #endif
1057
1058     GetToolBar()->ToggleTool( PlayStream_Event, true );
1059     GetToolBar()->ToggleTool( PlayStream_Event, false );
1060 }
1061
1062 #if wxUSE_DRAG_AND_DROP
1063 /*****************************************************************************
1064  * Definition of DragAndDrop class.
1065  *****************************************************************************/
1066 DragAndDrop::DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t _b_enqueue )
1067 {
1068     p_intf = _p_intf;
1069     b_enqueue = _b_enqueue;
1070 }
1071
1072 bool DragAndDrop::OnDropFiles( wxCoord, wxCoord,
1073                                const wxArrayString& filenames )
1074 {
1075     /* Add dropped files to the playlist */
1076
1077     playlist_t *p_playlist =
1078         (playlist_t *)vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
1079                                        FIND_ANYWHERE );
1080     if( p_playlist == NULL )
1081     {
1082         return FALSE;
1083     }
1084
1085     for( size_t i = 0; i < filenames.GetCount(); i++ )
1086     {
1087         char *psz_utf8 = wxFromLocale( filenames[i] );
1088
1089         playlist_Add( p_playlist, psz_utf8, psz_utf8,
1090                       PLAYLIST_APPEND | ((i | b_enqueue) ? 0 : PLAYLIST_GO),
1091                       PLAYLIST_END );
1092         wxLocaleFree( psz_utf8 );
1093     }
1094
1095     vlc_object_release( p_playlist );
1096
1097     return TRUE;
1098 }
1099 #endif
1100
1101 /*****************************************************************************
1102  * Definition of VolCtrl class.
1103  *****************************************************************************/
1104 class wxVolCtrl: public wxGauge
1105 {
1106 public:
1107     /* Constructor */
1108     wxVolCtrl( intf_thread_t *_p_intf, wxWindow* parent, wxWindowID id,
1109                wxPoint = wxDefaultPosition, wxSize = wxSize( 20, -1 ) );
1110     virtual ~wxVolCtrl() {};
1111
1112     void UpdateVolume();
1113     int GetVolume();
1114
1115     void OnChange( wxMouseEvent& event );
1116
1117 private:
1118     intf_thread_t *p_intf;
1119
1120     DECLARE_EVENT_TABLE();
1121 };
1122
1123 BEGIN_EVENT_TABLE(wxVolCtrl, wxWindow)
1124     /* Mouse events */
1125     EVT_LEFT_DOWN(wxVolCtrl::OnChange)
1126     EVT_MOTION(wxVolCtrl::OnChange)
1127 END_EVENT_TABLE()
1128
1129 wxVolCtrl::wxVolCtrl( intf_thread_t *_p_intf, wxWindow* parent, wxWindowID id,
1130                       wxPoint point, wxSize size )
1131   : wxGauge( parent, id, 200, point, size, wxGA_HORIZONTAL | wxGA_SMOOTH )
1132 {
1133     p_intf = _p_intf;
1134     UpdateVolume();
1135 }
1136
1137 void wxVolCtrl::OnChange( wxMouseEvent& event )
1138 {
1139     if( !event.LeftDown() && !event.LeftIsDown() ) return;
1140
1141     int i_volume = event.GetX() * 200 / GetClientSize().GetWidth();
1142     aout_VolumeSet( p_intf, i_volume * AOUT_VOLUME_MAX / 200 / 2 );
1143     UpdateVolume();
1144 }
1145
1146 void wxVolCtrl::UpdateVolume()
1147 {
1148     audio_volume_t i_volume;
1149     aout_VolumeGet( p_intf, &i_volume );
1150
1151     int i_gauge_volume = i_volume * 200 * 2 / AOUT_VOLUME_MAX;
1152     if( i_gauge_volume == GetValue() ) return;
1153
1154     SetValue( i_gauge_volume );
1155     SetToolTip( wxString::Format((wxString)wxU(_("Volume")) + wxT(" %d"),
1156                 i_gauge_volume / 2 ) );
1157 }
1158
1159 #if defined(__WXGTK__)
1160 #define VLCVOL_HEIGHT p_parent->GetSize().GetHeight()
1161 #else
1162 #define VLCVOL_HEIGHT TOOLBAR_BMP_HEIGHT
1163 #endif
1164 VLCVolCtrl::VLCVolCtrl( intf_thread_t *_p_intf, wxWindow *p_parent )
1165   :wxControl( p_parent, -1, wxDefaultPosition, wxSize(64, VLCVOL_HEIGHT ),
1166               wxBORDER_NONE ),
1167    i_y_offset((VLCVOL_HEIGHT - TOOLBAR_BMP_HEIGHT) / 2),
1168    b_mute(0), p_intf(_p_intf)
1169 {
1170     gauge = new wxVolCtrl( p_intf, this, -1, wxPoint( 18, i_y_offset ),
1171                            wxSize( 44, TOOLBAR_BMP_HEIGHT ) );
1172 }
1173
1174 void VLCVolCtrl::OnPaint( wxPaintEvent &evt )
1175 {
1176     wxPaintDC dc( this );
1177     wxBitmap mPlayBitmap( b_mute ? speaker_mute_xpm : speaker_xpm );
1178     dc.DrawBitmap( mPlayBitmap, 0, i_y_offset, TRUE );
1179 }
1180
1181 void VLCVolCtrl::OnChange( wxMouseEvent& event )
1182 {
1183     if( event.GetX() < TOOLBAR_BMP_WIDTH )
1184     {
1185         int i_volume;
1186         aout_VolumeMute( p_intf, (audio_volume_t *)&i_volume );
1187
1188         b_mute = !b_mute;
1189         Refresh();
1190     }
1191 }
1192
1193 void VLCVolCtrl::UpdateVolume()
1194 {
1195     gauge->UpdateVolume();
1196
1197     int i_volume = gauge->GetValue();
1198     if( !!i_volume == !b_mute ) return;
1199     b_mute = !b_mute;
1200     Refresh();
1201 }
1202
1203 /*****************************************************************************
1204  * Systray class.
1205  *****************************************************************************/
1206
1207 #ifdef wxHAS_TASK_BAR_ICON
1208
1209 BEGIN_EVENT_TABLE(Systray, wxTaskBarIcon)
1210     /* Mouse events */
1211 #ifdef WIN32
1212     EVT_TASKBAR_LEFT_DCLICK(Systray::OnLeftClick)
1213 #else
1214     EVT_TASKBAR_LEFT_DOWN(Systray::OnLeftClick)
1215 #endif
1216     /* Menu events */
1217     EVT_MENU(Iconize_Event, Systray::OnMenuIconize)
1218     EVT_MENU(Exit_Event, Systray::OnExit)
1219     EVT_MENU(PlayStream_Event, Systray::OnPlayStream)
1220     EVT_MENU(NextStream_Event, Systray::OnNextStream)
1221     EVT_MENU(PrevStream_Event, Systray::OnPrevStream)
1222     EVT_MENU(StopStream_Event, Systray::OnStopStream)
1223 END_EVENT_TABLE()
1224
1225 Systray::Systray( Interface *_p_main_interface, intf_thread_t *_p_intf )
1226 {
1227     p_main_interface = _p_main_interface;
1228     p_intf = _p_intf;
1229
1230     SetIcon( wxIcon( vlc16x16_xpm ), wxT("VLC media player") );
1231     if( !IsOk() || !IsIconInstalled() )
1232     {
1233         msg_Warn(p_intf, "cannot set systray icon, weird things may happen");
1234     }
1235 }
1236
1237 /* Event handlers */
1238 void Systray::OnMenuIconize( wxCommandEvent& event )
1239 {
1240     p_main_interface->Show( ! p_main_interface->IsShown() );
1241     if ( p_main_interface->IsShown() ) p_main_interface->Raise();
1242 }
1243
1244 void Systray::OnLeftClick( wxTaskBarIconEvent& event )
1245 {
1246     wxCommandEvent cevent;
1247     OnMenuIconize(cevent);
1248 }
1249
1250 void Systray::OnExit( wxCommandEvent& event )
1251 {
1252     p_main_interface->Close(TRUE);
1253 }
1254
1255 void Systray::OnPrevStream( wxCommandEvent& event )
1256 {
1257     p_main_interface->PrevStream();
1258 }
1259
1260 void Systray::OnNextStream( wxCommandEvent& event )
1261 {
1262     p_main_interface->NextStream();
1263 }
1264
1265 void Systray::OnPlayStream( wxCommandEvent& event )
1266 {
1267     p_main_interface->PlayStream();
1268 }
1269
1270 void Systray::OnStopStream( wxCommandEvent& event )
1271 {
1272     p_main_interface->StopStream();
1273 }
1274
1275 /* Systray popup menu */
1276 wxMenu* Systray::CreatePopupMenu()
1277 {
1278     int minimal = config_GetInt( p_intf, "wx-minimal" );
1279
1280     wxMenu* systray_menu = new wxMenu;
1281     systray_menu->Append( Exit_Event, wxU(_("Quit VLC")) );
1282     systray_menu->AppendSeparator();
1283     systray_menu->Append( PlayStream_Event, wxU(_("Play/Pause")) );
1284
1285     if (!minimal)
1286     {
1287     systray_menu->Append( PrevStream_Event, wxU(_("Previous")) );
1288     systray_menu->Append( NextStream_Event, wxU(_("Next")) );
1289     systray_menu->Append( StopStream_Event, wxU(_("Stop")) );
1290     }
1291     systray_menu->AppendSeparator();
1292     systray_menu->Append( Iconize_Event, wxU(_("Show/Hide interface")) );
1293     return systray_menu;
1294 }
1295
1296 void Systray::UpdateTooltip( const wxChar* tooltip )
1297 {
1298     SetIcon( wxIcon( vlc16x16_xpm ), tooltip );
1299 }
1300 #endif