]> git.sesse.net Git - vlc/blob - modules/gui/wxwindows/wxwindows.h
* interface.cpp: fixed a stack corruption which caused a segfault in the
[vlc] / modules / gui / wxwindows / wxwindows.h
1 /*****************************************************************************
2  * wxwindows.h: private wxWindows interface description
3  *****************************************************************************
4  * Copyright (C) 1999, 2000 VideoLAN
5  * $Id: wxwindows.h,v 1.56 2003/08/22 08:06:25 asmax Exp $
6  *
7  * Authors: Gildas Bazin <gbazin@netcourrier.com>
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 #include <wx/listctrl.h>
25 #include <wx/textctrl.h>
26 #include <wx/notebook.h>
27 #include <wx/spinctrl.h>
28 #include <wx/dnd.h>
29 #include <wx/treectrl.h>
30 #include <wx/gauge.h>
31 #include <wx/accel.h>
32 #include "vlc_keys.h"
33
34 DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
35
36 class OpenDialog;
37 class Playlist;
38 class Messages;
39 class FileInfo;
40
41 #define SLIDER_MAX_POS 10000
42
43 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
44 #if defined( ENABLE_NLS ) && defined( HAVE_GETTEXT ) && \
45     defined( WIN32 ) && !defined( HAVE_INCLUDED_GETTEXT )
46 #if wxUSE_UNICODE
47 #   define wxU(utf8) wxString(utf8, wxConvUTF8)
48 #else
49 #   define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
50 #endif
51
52 #else // ENABLE_NLS && HAVE_GETTEXT && WIN32 && !HAVE_INCLUDED_GETTEXT
53 #if wxUSE_UNICODE
54 #   define wxU(ansi) wxString(ansi, *wxConvCurrent)
55 #else
56 #   define wxU(ansi) ansi
57 #endif
58
59 #endif
60
61 wxArrayString SeparateEntries( wxString );
62
63 /*****************************************************************************
64  * intf_sys_t: description and status of wxwindows interface
65  *****************************************************************************/
66 struct intf_sys_t
67 {
68     /* the wx parent window */
69     wxWindow            *p_wxwindow;
70     wxIcon              *p_icon;
71
72     /* special actions */
73     vlc_bool_t          b_playing;
74
75     /* The input thread */
76     input_thread_t *    p_input;
77
78     /* The slider */
79     int                 i_slider_pos;                     /* slider position */
80     int                 i_slider_oldpos;                /* previous position */
81     vlc_bool_t          b_slider_free;                      /* slider status */
82
83     /* The messages window */
84     msg_subscription_t* p_sub;                  /* message bank subscription */
85
86     /* Playlist management */
87     int                 i_playing;                 /* playlist selected item */
88
89     /* Send an event to show a dialog */
90     void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
91                              intf_dialog_args_t *p_arg );
92
93     /* Popup menu */
94     wxMenu              *p_popup_menu;
95
96 };
97
98 /*****************************************************************************
99  * Prototypes
100  *****************************************************************************/
101
102 /*****************************************************************************
103  * Classes declarations.
104  *****************************************************************************/
105 class Interface;
106
107 /* Timer */
108 class Timer: public wxTimer
109 {
110 public:
111     /* Constructor */
112     Timer( intf_thread_t *p_intf, Interface *p_main_interface );
113     virtual ~Timer();
114
115     virtual void Notify();
116
117 private:
118     intf_thread_t *p_intf;
119     Interface *p_main_interface;
120     int i_old_playing_status;
121     int i_old_rate;
122 };
123
124 /* Main Interface */
125 class Interface: public wxFrame
126 {
127 public:
128     /* Constructor */
129     Interface( intf_thread_t *p_intf );
130     virtual ~Interface();
131     void TogglePlayButton( int i_playing_status );
132
133     wxBoxSizer  *frame_sizer;
134     wxStatusBar *statusbar;
135
136     wxSlider    *slider;
137     wxWindow    *slider_frame;
138     wxStaticBox *slider_box;
139
140     wxGauge     *volctrl;
141
142 private:
143     void UpdateAcceleratorTable();
144     void CreateOurMenuBar();
145     void CreateOurToolBar();
146     void CreateOurSlider();
147     void Open( int i_access_method );
148
149     /* Event handlers (these functions should _not_ be virtual) */
150     void OnExit( wxCommandEvent& event );
151     void OnAbout( wxCommandEvent& event );
152
153     void OnOpenFileSimple( wxCommandEvent& event );
154     void OnOpenFile( wxCommandEvent& event );
155     void OnOpenDisc( wxCommandEvent& event );
156     void OnOpenNet( wxCommandEvent& event );
157     void OnOpenSat( wxCommandEvent& event );
158     void OnOpenV4L( wxCommandEvent& event );
159     void OnShowDialog( wxCommandEvent& event );
160     void OnPlayStream( wxCommandEvent& event );
161     void OnStopStream( wxCommandEvent& event );
162     void OnSliderUpdate( wxScrollEvent& event );
163     void OnPrevStream( wxCommandEvent& event );
164     void OnNextStream( wxCommandEvent& event );
165     void OnSlowStream( wxCommandEvent& event );
166     void OnFastStream( wxCommandEvent& event );
167
168     void OnMenuOpen( wxMenuEvent& event );
169
170 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
171     void OnContextMenu2(wxContextMenuEvent& event);
172 #endif
173     void OnContextMenu(wxMouseEvent& event);
174
175     DECLARE_EVENT_TABLE();
176
177     Timer *timer;
178     intf_thread_t *p_intf;
179
180 private:
181     int i_old_playing_status;
182
183     /* For auto-generated menus */
184     wxMenu *p_audio_menu;
185     vlc_bool_t b_audio_menu;
186     wxMenu *p_video_menu;
187     vlc_bool_t b_video_menu;
188     wxMenu *p_navig_menu;
189     vlc_bool_t b_navig_menu;
190 };
191
192 /* Dialogs Provider */
193 class DialogsProvider: public wxFrame
194 {
195 public:
196     /* Constructor */
197     DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
198     virtual ~DialogsProvider();
199
200 private:
201     void Open( int i_access_method, int i_arg );
202
203     /* Event handlers (these functions should _not_ be virtual) */
204     void OnExit( wxCommandEvent& event );
205     void OnPlaylist( wxCommandEvent& event );
206     void OnMessages( wxCommandEvent& event );
207     void OnFileInfo( wxCommandEvent& event );
208     void OnPreferences( wxCommandEvent& event );
209
210     void OnOpenFileGeneric( wxCommandEvent& event );
211     void OnOpenFileSimple( wxCommandEvent& event );
212     void OnOpenFile( wxCommandEvent& event );
213     void OnOpenDisc( wxCommandEvent& event );
214     void OnOpenNet( wxCommandEvent& event );
215     void OnOpenSat( wxCommandEvent& event );
216
217     void OnPopupMenu( wxCommandEvent& event );
218
219     void OnIdle( wxIdleEvent& event );
220
221     void OnExitThread( wxCommandEvent& event );
222
223     DECLARE_EVENT_TABLE();
224
225     intf_thread_t *p_intf;
226
227 public:
228     /* Secondary windows */
229     OpenDialog          *p_open_dialog;
230     wxFileDialog        *p_file_dialog;
231     Playlist            *p_playlist_dialog;
232     Messages            *p_messages_dialog;
233     FileInfo            *p_fileinfo_dialog;
234     wxFrame             *p_prefs_dialog;
235     wxFileDialog        *p_file_generic_dialog;
236 };
237
238 /* Open Dialog */
239 class V4LDialog;
240 class SoutDialog;
241 class SubsFileDialog;
242 class OpenDialog: public wxFrame
243 {
244 public:
245     /* Constructor */
246     OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
247                 int i_access_method, int i_arg = 0 );
248     virtual ~OpenDialog();
249
250     int Show();
251     int Show( int i_access_method, int i_arg = 0 );
252
253     wxArrayString mrl;
254
255 private:
256     wxPanel *FilePanel( wxWindow* parent );
257     wxPanel *DiscPanel( wxWindow* parent );
258     wxPanel *NetPanel( wxWindow* parent );
259     wxPanel *SatPanel( wxWindow* parent );
260     wxPanel *V4LPanel( wxWindow* parent );
261
262     void UpdateMRL( int i_access_method );
263
264     /* Event handlers (these functions should _not_ be virtual) */
265     void OnOk( wxCommandEvent& event );
266     void OnCancel( wxCommandEvent& event );
267
268     void OnPageChange( wxNotebookEvent& event );
269     void OnMRLChange( wxCommandEvent& event );
270
271     /* Event handlers for the file page */
272     void OnFilePanelChange( wxCommandEvent& event );
273     void OnFileBrowse( wxCommandEvent& event );
274
275     /* Event handlers for the disc page */
276     void OnDiscPanelChange( wxCommandEvent& event );
277     void OnDiscTypeChange( wxCommandEvent& event );
278
279     /* Event handlers for the net page */
280     void OnNetPanelChange( wxCommandEvent& event );
281     void OnNetTypeChange( wxCommandEvent& event );
282
283     /* Event handlers for the v4l page */
284     void OnV4LPanelChange( wxCommandEvent& event );
285     void OnV4LTypeChange( wxCommandEvent& event );
286     void OnV4LSettingsChange( wxCommandEvent& event );
287
288     /* Event handlers for the stream output */
289     void OnSubsFileEnable( wxCommandEvent& event );
290     void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
291
292     /* Event handlers for the stream output */
293     void OnSoutEnable( wxCommandEvent& event );
294     void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
295
296     /* Event handlers for the demux dump */
297     void OnDemuxDumpEnable( wxCommandEvent& event );
298     void OnDemuxDumpBrowse( wxCommandEvent& event );
299     void OnDemuxDumpChange( wxCommandEvent& event );
300
301     DECLARE_EVENT_TABLE();
302
303     intf_thread_t *p_intf;
304     wxWindow *p_parent;
305     int i_current_access_method;
306
307     wxComboBox *mrl_combo;
308     wxNotebook *notebook;
309
310     /* Controls for the file panel */
311     wxComboBox *file_combo;
312     wxFileDialog *file_dialog;
313
314     /* Controls for the disc panel */
315     wxRadioBox *disc_type;
316     wxTextCtrl *disc_device;
317     wxSpinCtrl *disc_title;
318     int        i_disc_title;
319     wxSpinCtrl *disc_chapter;
320     int        i_disc_chapter;
321
322     /* Controls for the net panel */
323     wxRadioBox *net_type;
324     int i_net_type;
325     wxPanel *net_subpanels[4];
326     wxRadioButton *net_radios[4];
327     wxSpinCtrl *net_ports[4];
328     int        i_net_ports[4];
329     wxTextCtrl *net_addrs[4];
330
331     /* Controls for the v4l panel */
332     wxRadioBox *video_type;
333     wxTextCtrl *video_device;
334     wxSpinCtrl *video_channel;
335     wxButton *v4l_button;
336     V4LDialog *v4l_dialog;
337     wxArrayString v4l_mrl;
338
339     /* Controls for the subtitles file */
340     wxButton *subsfile_button;
341     wxCheckBox *subsfile_checkbox;
342     SubsFileDialog *subsfile_dialog;
343     wxArrayString subsfile_mrl;
344
345     /* Controls for the stream output */
346     wxButton *sout_button;
347     wxCheckBox *sout_checkbox;
348     SoutDialog *sout_dialog;
349     wxArrayString sout_mrl;
350
351     /* Controls for the demux dump */
352     wxTextCtrl *demuxdump_textctrl;
353     wxButton *demuxdump_button;
354     wxCheckBox *demuxdump_checkbox;
355     wxFileDialog *demuxdump_dialog;
356 };
357
358 enum
359 {
360     FILE_ACCESS = 0,
361     DISC_ACCESS,
362     NET_ACCESS,
363     SAT_ACCESS,
364     V4L_ACCESS,
365     FILE_SIMPLE_ACCESS
366 };
367
368 /* V4L Dialog */
369 class V4LDialog: public wxDialog
370 {
371 public:
372     /* Constructor */
373     V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
374     virtual ~V4LDialog();
375
376     wxArrayString GetOptions();
377
378 private:
379     void UpdateMRL();
380     wxPanel *AudioPanel( wxWindow* parent );
381     wxPanel *CommonPanel( wxWindow* parent );
382     wxPanel *BitratePanel( wxWindow* parent );
383     void    ParseMRL();
384
385     /* Event handlers (these functions should _not_ be virtual) */
386     void OnOk( wxCommandEvent& event );
387     void OnCancel( wxCommandEvent& event );
388     void OnMRLChange( wxCommandEvent& event );
389     void OnAudioEnable( wxCommandEvent& event );
390     void OnAudioChannel( wxCommandEvent& event );
391     void OnSizeEnable( wxCommandEvent& event );
392     void OnSize( wxCommandEvent& event );
393     void OnNormEnable( wxCommandEvent& event );
394     void OnNorm( wxCommandEvent& event );
395     void OnFrequencyEnable( wxCommandEvent& event );
396     void OnFrequency( wxCommandEvent& event );
397     void OnBitrateEnable( wxCommandEvent& event );
398     void OnBitrate( wxCommandEvent& event );
399     void OnMaxBitrateEnable( wxCommandEvent& event );
400     void OnMaxBitrate( wxCommandEvent& event );
401
402     DECLARE_EVENT_TABLE();
403
404     intf_thread_t *p_intf;
405     wxWindow *p_parent;
406
407     wxComboBox *mrl_combo;
408
409     int i_access_type;
410
411     /* Controls for the v4l advanced options */
412     wxPanel *common_subpanel;
413     wxPanel *common_panel;
414     wxCheckBox *size_checkbox;
415     wxComboBox *size_combo;
416     wxCheckBox *norm_checkbox;
417     wxComboBox *norm_combo;
418     wxCheckBox *frequency_checkbox;
419     wxSpinCtrl *frequency;
420
421     wxPanel *audio_subpanel;
422     wxPanel *audio_panel;
423     wxCheckBox *audio_checkbox;
424     wxTextCtrl *audio_device;
425     wxSpinCtrl *audio_channel;
426
427     wxPanel *bitrate_subpanel;
428     wxPanel *bitrate_panel;
429     wxCheckBox *bitrate_checkbox;
430     wxSpinCtrl *bitrate;
431     wxCheckBox *maxbitrate_checkbox;
432     wxSpinCtrl *maxbitrate;
433
434 };
435
436 /* Stream output Dialog */
437 class SoutDialog: public wxDialog
438 {
439 public:
440     /* Constructor */
441     SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
442     virtual ~SoutDialog();
443
444     wxArrayString GetOptions();
445
446 private:
447     void UpdateMRL();
448     wxPanel *AccessPanel( wxWindow* parent );
449     wxPanel *MiscPanel( wxWindow* parent );
450     wxPanel *EncapsulationPanel( wxWindow* parent );
451     wxPanel *TranscodingPanel( wxWindow* parent );
452     void    ParseMRL();
453
454     /* Event handlers (these functions should _not_ be virtual) */
455     void OnOk( wxCommandEvent& event );
456     void OnCancel( wxCommandEvent& event );
457     void OnMRLChange( wxCommandEvent& event );
458     void OnAccessTypeChange( wxCommandEvent& event );
459
460     /* Event handlers for the file access output */
461     void OnFileChange( wxCommandEvent& event );
462     void OnFileBrowse( wxCommandEvent& event );
463
464     /* Event handlers for the net access output */
465     void OnNetChange( wxCommandEvent& event );
466
467     /* Event specific to the announce address */
468     void OnAnnounceAddrChange( wxCommandEvent& event );
469
470     /* Event handlers for the encapsulation panel */
471     void OnEncapsulationChange( wxCommandEvent& event );
472
473     /* Event handlers for the transcoding panel */
474     void OnTranscodingEnable( wxCommandEvent& event );
475     void OnTranscodingChange( wxCommandEvent& event );
476
477     /* Event handlers for the misc panel */
478     void OnSAPMiscChange( wxCommandEvent& event );
479     void OnSLPMiscChange( wxCommandEvent& event );
480
481     DECLARE_EVENT_TABLE();
482
483     intf_thread_t *p_intf;
484     wxWindow *p_parent;
485
486     wxComboBox *mrl_combo;
487
488     /* Controls for the access outputs */
489     wxPanel *access_subpanels[5];
490     wxCheckBox *access_checkboxes[5];
491
492     int i_access_type;
493
494     wxComboBox *file_combo;
495     wxSpinCtrl *net_ports[5];
496     wxTextCtrl *net_addrs[5];
497
498     /* Controls for the SAP announces */
499     wxPanel *misc_subpanels[1];
500     wxCheckBox *sap_checkbox;
501     wxCheckBox *slp_checkbox;
502     wxTextCtrl *announce_addr;
503
504     /* Controls for the encapsulation */
505     wxRadioButton *encapsulation_radios[5];
506     int i_encapsulation_type;
507
508     /* Controls for transcoding */
509     wxCheckBox *video_transc_checkbox;
510     wxComboBox *video_codec_combo;
511     wxComboBox *audio_codec_combo;
512     wxCheckBox *audio_transc_checkbox;
513     wxComboBox *video_bitrate_combo;
514     wxComboBox *audio_bitrate_combo;
515     wxComboBox *audio_channels_combo;
516 };
517
518 /* Subtitles File Dialog */
519 class SubsFileDialog: public wxDialog
520 {
521 public:
522     /* Constructor */
523     SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
524     virtual ~SubsFileDialog();
525
526     wxComboBox *file_combo;
527     wxComboBox *encoding_combo;
528     wxSpinCtrl *delay_spinctrl;
529     wxSpinCtrl *fps_spinctrl;
530
531 private:
532     /* Event handlers (these functions should _not_ be virtual) */
533     void OnOk( wxCommandEvent& event );
534     void OnCancel( wxCommandEvent& event );
535     void OnFileBrowse( wxCommandEvent& event );
536
537     DECLARE_EVENT_TABLE();
538
539     intf_thread_t *p_intf;
540     wxWindow *p_parent;
541 };
542
543 /* Preferences Dialog */
544 class PrefsTreeCtrl;
545 class PrefsDialog: public wxFrame
546 {
547 public:
548     /* Constructor */
549     PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
550     virtual ~PrefsDialog();
551
552 private:
553     wxPanel *PrefsPanel( wxWindow* parent );
554
555     /* Event handlers (these functions should _not_ be virtual) */
556     void OnOk( wxCommandEvent& event );
557     void OnCancel( wxCommandEvent& event );
558     void OnSave( wxCommandEvent& event );
559     void OnResetAll( wxCommandEvent& event );
560
561     DECLARE_EVENT_TABLE();
562
563     intf_thread_t *p_intf;
564
565     PrefsTreeCtrl *prefs_tree;
566 };
567
568 /* Messages */
569 class Messages: public wxFrame
570 {
571 public:
572     /* Constructor */
573     Messages( intf_thread_t *p_intf, wxWindow *p_parent );
574     virtual ~Messages();
575     void UpdateLog();
576
577 private:
578     /* Event handlers (these functions should _not_ be virtual) */
579     void OnClose( wxCommandEvent& event );
580     void OnVerbose( wxCommandEvent& event );
581     void OnClear( wxCommandEvent& event );
582     void OnSaveLog( wxCommandEvent& event );
583
584     DECLARE_EVENT_TABLE();
585
586     intf_thread_t *p_intf;
587     wxTextCtrl *textctrl;
588     wxTextAttr *info_attr;
589     wxTextAttr *err_attr;
590     wxTextAttr *warn_attr;
591     wxTextAttr *dbg_attr;
592
593     wxFileDialog *save_log_dialog;
594
595     vlc_bool_t b_verbose;
596 };
597
598 /* Playlist */
599 class Playlist: public wxFrame
600 {
601 public:
602     /* Constructor */
603     Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
604     virtual ~Playlist();
605
606     void UpdatePlaylist();
607     void ShowPlaylist( bool show );
608
609     bool b_need_update;
610     vlc_mutex_t lock;
611
612 private:
613     void DeleteItem( int item );
614
615     /* Event handlers (these functions should _not_ be virtual) */
616     void OnAddFile( wxCommandEvent& event );
617     void OnAddMRL( wxCommandEvent& event );
618     void OnClose( wxCommandEvent& event );
619     void OnOpen( wxCommandEvent& event );
620     void OnSave( wxCommandEvent& event );
621     void OnInvertSelection( wxCommandEvent& event );
622     void OnDeleteSelection( wxCommandEvent& event );
623     void OnSelectAll( wxCommandEvent& event );
624     void OnRandom( wxCommandEvent& event );
625     void OnLoop ( wxCommandEvent& event );
626     void OnActivateItem( wxListEvent& event );
627     void OnKeyDown( wxListEvent& event );
628     void Rebuild();
629
630     DECLARE_EVENT_TABLE();
631
632     intf_thread_t *p_intf;
633     wxListView *listview;
634     int i_update_counter;
635 };
636
637 /* File Info */
638 class FileInfo: public wxFrame
639 {
640 public:
641     /* Constructor */
642     FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
643     virtual ~FileInfo();
644     void UpdateFileInfo();
645
646 private:
647     void OnClose( wxCommandEvent& event );
648
649     DECLARE_EVENT_TABLE();
650
651     intf_thread_t *p_intf;
652     wxTreeCtrl *fileinfo_tree;
653     wxTreeItemId fileinfo_root;
654     wxString fileinfo_root_label;
655
656 };
657
658 #if !defined(__WXX11__)
659 /* Drag and Drop class */
660 class DragAndDrop: public wxFileDropTarget
661 {
662 public:
663     DragAndDrop( intf_thread_t *_p_intf );
664
665     virtual bool OnDropFiles( wxCoord x, wxCoord y,
666                               const wxArrayString& filenames );
667
668 private:
669     intf_thread_t *p_intf;
670 };
671 #endif
672
673 /* Menus */
674 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
675                 const wxPoint& pos );
676 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
677 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
678 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
679
680 class MenuEvtHandler : public wxEvtHandler
681 {
682 public:
683     MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
684     virtual ~MenuEvtHandler();
685
686     void OnMenuEvent( wxCommandEvent& event );
687     void OnShowDialog( wxCommandEvent& event );
688
689 private:
690
691     DECLARE_EVENT_TABLE()
692
693     intf_thread_t *p_intf;
694     Interface *p_main_interface;
695 };
696
697 class Menu: public wxMenu
698 {
699 public:
700     /* Constructor */
701     Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
702           char **ppsz_names, int *pi_objects, int i_start_id );
703     virtual ~Menu();
704
705 private:
706     /* Event handlers (these functions should _not_ be virtual) */
707     void OnClose( wxCommandEvent& event );
708     void OnShowDialog( wxCommandEvent& event );
709     void OnEntrySelected( wxCommandEvent& event );
710
711     wxMenu *Menu::CreateDummyMenu();
712     void   Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
713     wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t * );
714
715     DECLARE_EVENT_TABLE();
716
717     intf_thread_t *p_intf;
718
719     int  i_item_id;
720 };
721
722 static inline int ConvertHotkeyModifiers( int i_hotkey )
723 {
724     int i_accel_flags = 0;
725     if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
726     if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
727     if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
728     return i_accel_flags;
729 }
730
731 static inline int ConvertHotkey( int i_hotkey )
732 {
733     int i_key = i_hotkey & ~KEY_MODIFIER;
734     if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
735     else if( i_key & KEY_SPECIAL )
736     {
737         switch ( i_key )
738         {
739         case KEY_LEFT: return WXK_LEFT;
740         case KEY_RIGHT: return WXK_RIGHT;
741         case KEY_UP: return WXK_UP;
742         case KEY_DOWN: return WXK_DOWN;
743         case KEY_SPACE: return WXK_SPACE;
744         case KEY_ENTER: return WXK_RETURN;
745         case KEY_F1: return WXK_F1;
746         case KEY_F2: return WXK_F2;
747         case KEY_F3: return WXK_F3;
748         case KEY_F4: return WXK_F4;
749         case KEY_F5: return WXK_F5;
750         case KEY_F6: return WXK_F6;
751         case KEY_F7: return WXK_F7;
752         case KEY_F8: return WXK_F8;
753         case KEY_F9: return WXK_F9;
754         case KEY_F10: return WXK_F10;
755         case KEY_F11: return WXK_F11;
756         case KEY_F12: return WXK_F12;
757         case KEY_HOME: return WXK_HOME;
758         case KEY_END: return WXK_HOME;
759         case KEY_MENU: return WXK_MENU;
760         case KEY_ESC: return WXK_ESCAPE;
761         case KEY_PAGEUP: return WXK_PRIOR;
762         case KEY_PAGEDOWN: return WXK_NEXT;
763         case KEY_TAB: return WXK_TAB;
764         case KEY_BACKSPACE: return WXK_BACK;
765         }
766     }
767     return 0;
768 }