1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: wxwindows.h,v 1.76 2003/12/09 00:46:03 yoann Exp $
7 * Authors: Gildas Bazin <gbazin@netcourrier.com>
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.
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.
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 *****************************************************************************/
24 #ifdef WIN32 /* mingw32 hack */
29 /* Let vlc take care of the i18n stuff */
30 #define WXINTL_NO_GETTEXT_MACRO
32 #include <wx/wxprec.h>
35 #include <wx/listctrl.h>
36 #include <wx/textctrl.h>
37 #include <wx/notebook.h>
38 #include <wx/spinctrl.h>
40 #include <wx/treectrl.h>
45 DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
52 #define SLIDER_MAX_POS 10000
54 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
55 #if defined( ENABLE_NLS ) && defined( HAVE_GETTEXT ) && \
56 defined( WIN32 ) && !defined( HAVE_INCLUDED_GETTEXT )
58 # define wxU(utf8) wxString(utf8, wxConvUTF8)
60 # define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
64 #else // ENABLE_NLS && HAVE_GETTEXT && WIN32 && !HAVE_INCLUDED_GETTEXT
66 # define wxU(ansi) wxString(ansi, *wxConvCurrent)
68 # define wxU(ansi) ansi
84 wxArrayString SeparateEntries( wxString );
86 /*****************************************************************************
87 * intf_sys_t: description and status of wxwindows interface
88 *****************************************************************************/
91 /* the wx parent window */
98 /* The input thread */
99 input_thread_t * p_input;
102 int i_slider_pos; /* slider position */
103 int i_slider_oldpos; /* previous position */
104 vlc_bool_t b_slider_free; /* slider status */
106 /* The messages window */
107 msg_subscription_t* p_sub; /* message bank subscription */
109 /* Playlist management */
110 int i_playing; /* playlist selected item */
112 /* Send an event to show a dialog */
113 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
114 intf_dialog_args_t *p_arg );
117 wxMenu *p_popup_menu;
121 /*****************************************************************************
123 *****************************************************************************/
125 /*****************************************************************************
126 * Classes declarations.
127 *****************************************************************************/
131 class Timer: public wxTimer
135 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
138 virtual void Notify();
141 intf_thread_t *p_intf;
142 Interface *p_main_interface;
143 int i_old_playing_status;
148 class Interface: public wxFrame
152 Interface( intf_thread_t *p_intf );
153 virtual ~Interface();
154 void TogglePlayButton( int i_playing_status );
156 // wxFlexGridSizer *frame_sizer;
157 wxBoxSizer *frame_sizer;
158 wxStatusBar *statusbar;
161 wxWindow *slider_frame;
162 wxWindow *extra_frame;
163 wxStaticBox *slider_box;
167 wxStaticBox *adjust_box;
168 wxSlider *brightness_slider;
169 wxSlider *contrast_slider;
170 wxSlider *saturation_slider;
171 wxSlider *hue_slider;
173 wxStaticBox *other_box;
174 wxComboBox *ratio_combo;
179 void UpdateAcceleratorTable();
180 void CreateOurMenuBar();
181 void CreateOurToolBar();
182 void CreateOurExtraPanel();
183 void CreateOurSlider();
184 void Open( int i_access_method );
186 /* Event handlers (these functions should _not_ be virtual) */
187 void OnExit( wxCommandEvent& event );
188 void OnAbout( wxCommandEvent& event );
190 void OnOpenFileSimple( wxCommandEvent& event );
191 void OnOpenFile( wxCommandEvent& event );
192 void OnOpenDisc( wxCommandEvent& event );
193 void OnOpenNet( wxCommandEvent& event );
194 void OnOpenSat( wxCommandEvent& event );
195 void OnOpenV4L( wxCommandEvent& event );
196 void OnStream( wxCommandEvent& event );
197 void OnExtra( wxCommandEvent& event );
198 void OnShowDialog( wxCommandEvent& event );
199 void OnPlayStream( wxCommandEvent& event );
200 void OnStopStream( wxCommandEvent& event );
201 void OnSliderUpdate( wxScrollEvent& event );
202 void OnPrevStream( wxCommandEvent& event );
203 void OnNextStream( wxCommandEvent& event );
204 void OnSlowStream( wxCommandEvent& event );
205 void OnFastStream( wxCommandEvent& event );
207 void OnEnableAdjust( wxCommandEvent& event );
208 void OnHueUpdate( wxScrollEvent& event );
209 void OnContrastUpdate( wxScrollEvent& event );
210 void OnBrightnessUpdate( wxScrollEvent& event );
211 void OnSaturationUpdate( wxScrollEvent& event );
213 void OnRatio( wxCommandEvent& event );
214 void OnEnableVisual( wxCommandEvent& event );
216 void OnMenuOpen( wxMenuEvent& event );
218 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
219 void OnContextMenu2(wxContextMenuEvent& event);
221 void OnContextMenu(wxMouseEvent& event);
223 DECLARE_EVENT_TABLE();
226 intf_thread_t *p_intf;
229 int i_old_playing_status;
231 /* For auto-generated menus */
232 wxMenu *p_settings_menu;
233 vlc_bool_t b_settings_menu;
234 wxMenu *p_audio_menu;
235 vlc_bool_t b_audio_menu;
236 wxMenu *p_video_menu;
237 vlc_bool_t b_video_menu;
238 wxMenu *p_navig_menu;
239 vlc_bool_t b_navig_menu;
244 /* Dialogs Provider */
245 class DialogsProvider: public wxFrame
249 DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
250 virtual ~DialogsProvider();
253 void Open( int i_access_method, int i_arg );
255 /* Event handlers (these functions should _not_ be virtual) */
256 void OnExit( wxCommandEvent& event );
257 void OnPlaylist( wxCommandEvent& event );
258 void OnMessages( wxCommandEvent& event );
259 void OnFileInfo( wxCommandEvent& event );
260 void OnPreferences( wxCommandEvent& event );
261 void OnStreamDialog( wxCommandEvent& event );
263 void OnOpenFileGeneric( wxCommandEvent& event );
264 void OnOpenFileSimple( wxCommandEvent& event );
265 void OnOpenFile( wxCommandEvent& event );
266 void OnOpenDisc( wxCommandEvent& event );
267 void OnOpenNet( wxCommandEvent& event );
268 void OnOpenSat( wxCommandEvent& event );
270 void OnPopupMenu( wxCommandEvent& event );
272 void OnIdle( wxIdleEvent& event );
274 void OnExitThread( wxCommandEvent& event );
276 DECLARE_EVENT_TABLE();
278 intf_thread_t *p_intf;
281 /* Secondary windows */
282 OpenDialog *p_open_dialog;
283 wxFileDialog *p_file_dialog;
284 Playlist *p_playlist_dialog;
285 Messages *p_messages_dialog;
286 FileInfo *p_fileinfo_dialog;
287 StreamDialog *p_stream_dialog;
288 wxFrame *p_prefs_dialog;
289 wxFileDialog *p_file_generic_dialog;
293 class AutoBuiltPanel;
294 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
297 class SubsFileDialog;
298 class OpenDialog: public wxFrame
302 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
303 int i_access_method, int i_arg = 0 );
305 /* Extended Contructor */
306 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
307 int i_access_method, int i_arg = 0 , int _i_method = 0 );
308 virtual ~OpenDialog();
311 int Show( int i_access_method, int i_arg = 0 );
314 void UpdateMRL( int i_access_method );
319 wxPanel *FilePanel( wxWindow* parent );
320 wxPanel *DiscPanel( wxWindow* parent );
321 wxPanel *NetPanel( wxWindow* parent );
322 wxPanel *V4LPanel( wxWindow* parent );
324 ArrayOfAutoBuiltPanel input_tab_array;
326 /* Event handlers (these functions should _not_ be virtual) */
327 void OnOk( wxCommandEvent& event );
328 void OnCancel( wxCommandEvent& event );
330 void OnPageChange( wxNotebookEvent& event );
331 void OnMRLChange( wxCommandEvent& event );
333 /* Event handlers for the file page */
334 void OnFilePanelChange( wxCommandEvent& event );
335 void OnFileBrowse( wxCommandEvent& event );
337 /* Event handlers for the disc page */
338 void OnDiscPanelChange( wxCommandEvent& event );
339 void OnDiscTypeChange( wxCommandEvent& event );
340 void OnDiscDeviceChange( wxCommandEvent& event );
342 /* Event handlers for the net page */
343 void OnNetPanelChange( wxCommandEvent& event );
344 void OnNetTypeChange( wxCommandEvent& event );
346 /* Event handlers for the v4l page */
347 void OnV4LPanelChange( wxCommandEvent& event );
348 void OnV4LTypeChange( wxCommandEvent& event );
349 void OnV4LSettingsChange( wxCommandEvent& event );
351 /* Event handlers for the stream output */
352 void OnSubsFileEnable( wxCommandEvent& event );
353 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
355 /* Event handlers for the stream output */
356 void OnSoutEnable( wxCommandEvent& event );
357 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
359 DECLARE_EVENT_TABLE();
361 intf_thread_t *p_intf;
363 int i_current_access_method;
365 int i_method; /* Normal or for the stream dialog ? */
366 wxComboBox *mrl_combo;
367 wxNotebook *notebook;
369 /* Controls for the file panel */
370 wxComboBox *file_combo;
371 wxFileDialog *file_dialog;
373 /* Controls for the disc panel */
374 wxRadioBox *disc_type;
375 wxTextCtrl *disc_device;
376 wxSpinCtrl *disc_title;
377 wxSpinCtrl *disc_chapter;
379 /* Indicates if the disc device control was modified */
380 bool b_disc_device_changed;
382 /* Controls for the net panel */
383 wxRadioBox *net_type;
385 wxPanel *net_subpanels[4];
386 wxRadioButton *net_radios[4];
387 wxSpinCtrl *net_ports[4];
389 wxTextCtrl *net_addrs[4];
391 /* Controls for the v4l panel */
392 wxRadioBox *video_type;
393 wxTextCtrl *video_device;
394 wxSpinCtrl *video_channel;
395 wxButton *v4l_button;
396 V4LDialog *v4l_dialog;
397 wxArrayString v4l_mrl;
399 /* Controls for the subtitles file */
400 wxButton *subsfile_button;
401 wxCheckBox *subsfile_checkbox;
402 SubsFileDialog *subsfile_dialog;
403 wxArrayString subsfile_mrl;
405 /* Controls for the stream output */
406 wxButton *sout_button;
407 wxCheckBox *sout_checkbox;
408 SoutDialog *sout_dialog;
409 wxArrayString sout_mrl;
425 class V4LDialog: public wxDialog
429 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
430 virtual ~V4LDialog();
432 wxArrayString GetOptions();
436 wxPanel *AudioPanel( wxWindow* parent );
437 wxPanel *CommonPanel( wxWindow* parent );
438 wxPanel *BitratePanel( wxWindow* parent );
441 /* Event handlers (these functions should _not_ be virtual) */
442 void OnOk( wxCommandEvent& event );
443 void OnCancel( wxCommandEvent& event );
444 void OnMRLChange( wxCommandEvent& event );
445 void OnAudioEnable( wxCommandEvent& event );
446 void OnAudioChange( wxCommandEvent& event );
447 void OnAudioChannel( wxCommandEvent& event );
448 void OnSizeEnable( wxCommandEvent& event );
449 void OnSize( wxCommandEvent& event );
450 void OnNormEnable( wxCommandEvent& event );
451 void OnNorm( wxCommandEvent& event );
452 void OnFrequencyEnable( wxCommandEvent& event );
453 void OnFrequency( wxCommandEvent& event );
454 void OnBitrateEnable( wxCommandEvent& event );
455 void OnBitrate( wxCommandEvent& event );
456 void OnMaxBitrateEnable( wxCommandEvent& event );
457 void OnMaxBitrate( wxCommandEvent& event );
459 DECLARE_EVENT_TABLE();
461 intf_thread_t *p_intf;
464 wxComboBox *mrl_combo;
468 /* Controls for the v4l advanced options */
469 wxPanel *common_subpanel;
470 wxPanel *common_panel;
471 wxCheckBox *size_checkbox;
472 wxComboBox *size_combo;
473 wxCheckBox *norm_checkbox;
474 wxComboBox *norm_combo;
475 wxCheckBox *frequency_checkbox;
476 wxSpinCtrl *frequency;
478 wxPanel *audio_subpanel;
479 wxPanel *audio_panel;
480 wxCheckBox *audio_checkbox;
481 wxTextCtrl *audio_device;
482 wxSpinCtrl *audio_channel;
484 wxPanel *bitrate_subpanel;
485 wxPanel *bitrate_panel;
486 wxCheckBox *bitrate_checkbox;
488 wxCheckBox *maxbitrate_checkbox;
489 wxSpinCtrl *maxbitrate;
493 /* Stream output Dialog */
507 TS_ENCAPSULATION = 0,
524 class SoutDialog: public wxDialog
528 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
529 virtual ~SoutDialog();
531 wxArrayString GetOptions();
535 wxPanel *AccessPanel( wxWindow* parent );
536 wxPanel *MiscPanel( wxWindow* parent );
537 wxPanel *EncapsulationPanel( wxWindow* parent );
538 wxPanel *TranscodingPanel( wxWindow* parent );
541 /* Event handlers (these functions should _not_ be virtual) */
542 void OnOk( wxCommandEvent& event );
543 void OnCancel( wxCommandEvent& event );
544 void OnMRLChange( wxCommandEvent& event );
545 void OnAccessTypeChange( wxCommandEvent& event );
547 /* Event handlers for the file access output */
548 void OnFileChange( wxCommandEvent& event );
549 void OnFileBrowse( wxCommandEvent& event );
550 void OnFileDump( wxCommandEvent& event );
552 /* Event handlers for the net access output */
553 void OnNetChange( wxCommandEvent& event );
555 /* Event specific to the announce address */
556 void OnAnnounceAddrChange( wxCommandEvent& event );
558 /* Event handlers for the encapsulation panel */
559 void OnEncapsulationChange( wxCommandEvent& event );
561 /* Event handlers for the transcoding panel */
562 void OnTranscodingEnable( wxCommandEvent& event );
563 void OnTranscodingChange( wxCommandEvent& event );
565 /* Event handlers for the misc panel */
566 void OnSAPMiscChange( wxCommandEvent& event );
567 void OnSLPMiscChange( wxCommandEvent& event );
569 DECLARE_EVENT_TABLE();
571 intf_thread_t *p_intf;
574 wxComboBox *mrl_combo;
576 /* Controls for the access outputs */
577 wxPanel *access_panel;
578 wxPanel *access_subpanels[ACCESS_OUT_NUM];
579 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
583 wxComboBox *file_combo;
584 wxCheckBox *dump_checkbox;
585 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
586 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
588 /* Controls for the SAP announces */
590 wxPanel *misc_subpanels[MISC_SOUT_NUM];
591 wxCheckBox *sap_checkbox;
592 wxCheckBox *slp_checkbox;
593 wxTextCtrl *announce_addr;
595 /* Controls for the encapsulation */
596 wxPanel *encapsulation_panel;
597 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
598 int i_encapsulation_type;
600 /* Controls for transcoding */
601 wxPanel *transcoding_panel;
602 wxCheckBox *video_transc_checkbox;
603 wxComboBox *video_codec_combo;
604 wxComboBox *audio_codec_combo;
605 wxCheckBox *audio_transc_checkbox;
606 wxComboBox *video_bitrate_combo;
607 wxComboBox *audio_bitrate_combo;
608 wxComboBox *audio_channels_combo;
611 /* Subtitles File Dialog */
612 class SubsFileDialog: public wxDialog
616 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
617 virtual ~SubsFileDialog();
619 wxComboBox *file_combo;
620 wxComboBox *encoding_combo;
621 wxSpinCtrl *delay_spinctrl;
622 wxSpinCtrl *fps_spinctrl;
625 /* Event handlers (these functions should _not_ be virtual) */
626 void OnOk( wxCommandEvent& event );
627 void OnCancel( wxCommandEvent& event );
628 void OnFileBrowse( wxCommandEvent& event );
630 DECLARE_EVENT_TABLE();
632 intf_thread_t *p_intf;
637 class StreamDialog: public wxFrame
641 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
642 virtual ~StreamDialog();
645 void OnClose( wxCommandEvent& event );
646 void OnOpen( wxCommandEvent& event );
647 void OnSout( wxCommandEvent& event );
648 void OnStart( wxCommandEvent& event );
650 DECLARE_EVENT_TABLE();
652 intf_thread_t *p_intf;
654 wxStaticText *step2_label;
655 wxStaticText *step3_label;
656 wxButton *sout_button;
657 wxButton *start_button;
659 wxArrayString sout_mrl;
660 OpenDialog *p_open_dialog;
661 SoutDialog *p_sout_dialog;
666 /* Preferences Dialog */
668 class PrefsDialog: public wxFrame
672 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
673 virtual ~PrefsDialog();
676 wxPanel *PrefsPanel( wxWindow* parent );
678 /* Event handlers (these functions should _not_ be virtual) */
679 void OnOk( wxCommandEvent& event );
680 void OnCancel( wxCommandEvent& event );
681 void OnSave( wxCommandEvent& event );
682 void OnResetAll( wxCommandEvent& event );
683 void OnAdvanced( wxCommandEvent& event );
685 DECLARE_EVENT_TABLE();
687 intf_thread_t *p_intf;
689 PrefsTreeCtrl *prefs_tree;
693 class Messages: public wxFrame
697 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
699 bool Show( bool show = TRUE );
703 /* Event handlers (these functions should _not_ be virtual) */
704 void OnClose( wxCommandEvent& event );
705 void OnClear( wxCommandEvent& event );
706 void OnSaveLog( wxCommandEvent& event );
708 DECLARE_EVENT_TABLE();
710 intf_thread_t *p_intf;
711 wxTextCtrl *textctrl;
712 wxTextAttr *info_attr;
713 wxTextAttr *err_attr;
714 wxTextAttr *warn_attr;
715 wxTextAttr *dbg_attr;
717 wxFileDialog *save_log_dialog;
719 vlc_bool_t b_verbose;
723 class ItemInfoDialog;
725 class Playlist: public wxFrame
729 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
732 void UpdatePlaylist();
733 void ShowPlaylist( bool show );
739 void DeleteItem( int item );
741 /* Event handlers (these functions should _not_ be virtual) */
742 void OnAddFile( wxCommandEvent& event );
743 void OnAddMRL( wxCommandEvent& event );
744 void OnClose( wxCommandEvent& event );
745 void OnSearch( wxCommandEvent& event );
746 void OnEnDis( wxCommandEvent& event );
747 void OnInfos( wxCommandEvent& event );
748 void OnSearchTextChange( wxCommandEvent& event );
749 void OnOpen( wxCommandEvent& event );
750 void OnSave( wxCommandEvent& event );
752 void OnSort( wxCommandEvent& event );
753 void OnColSelect( wxListEvent& event );
755 void OnUp( wxCommandEvent& event);
756 void OnDown( wxCommandEvent& event);
758 void OnEnableSelection( wxCommandEvent& event );
759 void OnDisableSelection( wxCommandEvent& event );
760 void OnInvertSelection( wxCommandEvent& event );
761 void OnDeleteSelection( wxCommandEvent& event );
762 void OnSelectAll( wxCommandEvent& event );
763 void OnRandom( wxCommandEvent& event );
764 void OnRepeat( wxCommandEvent& event );
765 void OnLoop ( wxCommandEvent& event );
766 void OnActivateItem( wxListEvent& event );
767 void OnKeyDown( wxListEvent& event );
768 void OnNewGroup( wxCommandEvent& event );
772 wxTextCtrl *search_text;
773 wxButton *search_button;
774 DECLARE_EVENT_TABLE();
777 ItemInfoDialog *iteminfo_dialog;
779 intf_thread_t *p_intf;
780 wxListView *listview;
781 wxTreeCtrl *treeview;
782 int i_update_counter;
791 class NewGroup: public wxDialog
795 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
800 /* Event handlers (these functions should _not_ be virtual) */
801 void OnOk( wxCommandEvent& event );
802 void OnCancel( wxCommandEvent& event );
804 DECLARE_EVENT_TABLE();
806 intf_thread_t *p_intf;
807 wxTextCtrl *groupname;
810 friend class Playlist;
811 friend class ItemInfoDialog;
816 /* ItemInfo Dialog */
817 class ItemInfoDialog: public wxDialog
821 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
822 wxWindow *p_parent );
823 virtual ~ItemInfoDialog();
825 wxArrayString GetOptions();
828 wxPanel *InfoPanel( wxWindow* parent );
829 wxPanel *GroupPanel( wxWindow* parent );
831 /* Event handlers (these functions should _not_ be virtual) */
832 void OnOk( wxCommandEvent& event );
833 void OnCancel( wxCommandEvent& event );
834 void OnNewGroup( wxCommandEvent& event );
836 DECLARE_EVENT_TABLE();
838 intf_thread_t *p_intf;
839 playlist_item_t *p_item;
842 /* Controls for the iteminfo dialog box */
843 wxPanel *info_subpanel;
846 wxPanel *group_subpanel;
847 wxPanel *group_panel;
849 wxTextCtrl *uri_text;
850 wxTextCtrl *name_text;
851 wxTextCtrl *author_text;
853 wxCheckBox *enabled_checkbox;
854 wxComboBox *group_combo;
860 class FileInfo: public wxFrame
864 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
866 void UpdateFileInfo();
869 void OnClose( wxCommandEvent& event );
871 DECLARE_EVENT_TABLE();
873 intf_thread_t *p_intf;
874 wxTreeCtrl *fileinfo_tree;
875 wxTreeItemId fileinfo_root;
876 wxString fileinfo_root_label;
881 #if !defined(__WXX11__)
882 /* Drag and Drop class */
883 class DragAndDrop: public wxFileDropTarget
886 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
888 virtual bool OnDropFiles( wxCoord x, wxCoord y,
889 const wxArrayString& filenames );
892 intf_thread_t *p_intf;
893 vlc_bool_t b_enqueue;
898 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
899 const wxPoint& pos );
900 wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
901 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
902 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
903 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
905 class MenuEvtHandler : public wxEvtHandler
908 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
909 virtual ~MenuEvtHandler();
911 void OnMenuEvent( wxCommandEvent& event );
912 void OnShowDialog( wxCommandEvent& event );
916 DECLARE_EVENT_TABLE()
918 intf_thread_t *p_intf;
919 Interface *p_main_interface;
922 class Menu: public wxMenu
926 Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
927 char **ppsz_names, int *pi_objects, int i_start_id );
931 /* Event handlers (these functions should _not_ be virtual) */
932 void OnClose( wxCommandEvent& event );
933 void OnShowDialog( wxCommandEvent& event );
934 void OnEntrySelected( wxCommandEvent& event );
936 wxMenu *Menu::CreateDummyMenu();
937 void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
938 wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t * );
940 DECLARE_EVENT_TABLE();
942 intf_thread_t *p_intf;
947 static inline int ConvertHotkeyModifiers( int i_hotkey )
949 int i_accel_flags = 0;
950 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
951 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
952 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
953 return i_accel_flags;
956 static inline int ConvertHotkey( int i_hotkey )
958 int i_key = i_hotkey & ~KEY_MODIFIER;
959 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
960 else if( i_key & KEY_SPECIAL )
964 case KEY_LEFT: return WXK_LEFT;
965 case KEY_RIGHT: return WXK_RIGHT;
966 case KEY_UP: return WXK_UP;
967 case KEY_DOWN: return WXK_DOWN;
968 case KEY_SPACE: return WXK_SPACE;
969 case KEY_ENTER: return WXK_RETURN;
970 case KEY_F1: return WXK_F1;
971 case KEY_F2: return WXK_F2;
972 case KEY_F3: return WXK_F3;
973 case KEY_F4: return WXK_F4;
974 case KEY_F5: return WXK_F5;
975 case KEY_F6: return WXK_F6;
976 case KEY_F7: return WXK_F7;
977 case KEY_F8: return WXK_F8;
978 case KEY_F9: return WXK_F9;
979 case KEY_F10: return WXK_F10;
980 case KEY_F11: return WXK_F11;
981 case KEY_F12: return WXK_F12;
982 case KEY_HOME: return WXK_HOME;
983 case KEY_END: return WXK_HOME;
984 case KEY_MENU: return WXK_MENU;
985 case KEY_ESC: return WXK_ESCAPE;
986 case KEY_PAGEUP: return WXK_PRIOR;
987 case KEY_PAGEDOWN: return WXK_NEXT;
988 case KEY_TAB: return WXK_TAB;
989 case KEY_BACKSPACE: return WXK_BACK;