1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: wxwindows.h,v 1.66 2003/10/29 17:32:54 zorglub 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_audio_menu;
233 vlc_bool_t b_audio_menu;
234 wxMenu *p_video_menu;
235 vlc_bool_t b_video_menu;
236 wxMenu *p_navig_menu;
237 vlc_bool_t b_navig_menu;
239 vlc_bool_t b_misc_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;
295 class SubsFileDialog;
296 class OpenDialog: public wxFrame
300 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
301 int i_access_method, int i_arg = 0 );
303 /* Extended Contructor */
304 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
305 int i_access_method, int i_arg = 0 , int _i_method = 0 );
306 virtual ~OpenDialog();
309 int Show( int i_access_method, int i_arg = 0 );
314 wxPanel *FilePanel( wxWindow* parent );
315 wxPanel *DiscPanel( wxWindow* parent );
316 wxPanel *NetPanel( wxWindow* parent );
317 wxPanel *SatPanel( wxWindow* parent );
318 wxPanel *V4LPanel( wxWindow* parent );
320 void UpdateMRL( int i_access_method );
322 /* Event handlers (these functions should _not_ be virtual) */
323 void OnOk( wxCommandEvent& event );
324 void OnCancel( wxCommandEvent& event );
326 void OnPageChange( wxNotebookEvent& event );
327 void OnMRLChange( wxCommandEvent& event );
329 /* Event handlers for the file page */
330 void OnFilePanelChange( wxCommandEvent& event );
331 void OnFileBrowse( wxCommandEvent& event );
333 /* Event handlers for the disc page */
334 void OnDiscPanelChange( wxCommandEvent& event );
335 void OnDiscTypeChange( wxCommandEvent& event );
337 /* Event handlers for the net page */
338 void OnNetPanelChange( wxCommandEvent& event );
339 void OnNetTypeChange( wxCommandEvent& event );
341 /* Event handlers for the v4l page */
342 void OnV4LPanelChange( wxCommandEvent& event );
343 void OnV4LTypeChange( wxCommandEvent& event );
344 void OnV4LSettingsChange( wxCommandEvent& event );
346 /* Event handlers for the stream output */
347 void OnSubsFileEnable( wxCommandEvent& event );
348 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
350 /* Event handlers for the stream output */
351 void OnSoutEnable( wxCommandEvent& event );
352 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
354 /* Event handlers for the demux dump */
355 void OnDemuxDumpEnable( wxCommandEvent& event );
356 void OnDemuxDumpBrowse( wxCommandEvent& event );
357 void OnDemuxDumpChange( wxCommandEvent& 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;
378 wxSpinCtrl *disc_chapter;
381 /* Controls for the net panel */
382 wxRadioBox *net_type;
384 wxPanel *net_subpanels[4];
385 wxRadioButton *net_radios[4];
386 wxSpinCtrl *net_ports[4];
388 wxTextCtrl *net_addrs[4];
390 /* Controls for the v4l panel */
391 wxRadioBox *video_type;
392 wxTextCtrl *video_device;
393 wxSpinCtrl *video_channel;
394 wxButton *v4l_button;
395 V4LDialog *v4l_dialog;
396 wxArrayString v4l_mrl;
398 /* Controls for the subtitles file */
399 wxButton *subsfile_button;
400 wxCheckBox *subsfile_checkbox;
401 SubsFileDialog *subsfile_dialog;
402 wxArrayString subsfile_mrl;
404 /* Controls for the stream output */
405 wxButton *sout_button;
406 wxCheckBox *sout_checkbox;
407 SoutDialog *sout_dialog;
408 wxArrayString sout_mrl;
410 /* Controls for the demux dump */
411 wxTextCtrl *demuxdump_textctrl;
412 wxButton *demuxdump_button;
413 wxCheckBox *demuxdump_checkbox;
414 wxFileDialog *demuxdump_dialog;
428 class V4LDialog: public wxDialog
432 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
433 virtual ~V4LDialog();
435 wxArrayString GetOptions();
439 wxPanel *AudioPanel( wxWindow* parent );
440 wxPanel *CommonPanel( wxWindow* parent );
441 wxPanel *BitratePanel( wxWindow* parent );
444 /* Event handlers (these functions should _not_ be virtual) */
445 void OnOk( wxCommandEvent& event );
446 void OnCancel( wxCommandEvent& event );
447 void OnMRLChange( wxCommandEvent& event );
448 void OnAudioEnable( wxCommandEvent& event );
449 void OnAudioChannel( wxCommandEvent& event );
450 void OnSizeEnable( wxCommandEvent& event );
451 void OnSize( wxCommandEvent& event );
452 void OnNormEnable( wxCommandEvent& event );
453 void OnNorm( wxCommandEvent& event );
454 void OnFrequencyEnable( wxCommandEvent& event );
455 void OnFrequency( wxCommandEvent& event );
456 void OnBitrateEnable( wxCommandEvent& event );
457 void OnBitrate( wxCommandEvent& event );
458 void OnMaxBitrateEnable( wxCommandEvent& event );
459 void OnMaxBitrate( wxCommandEvent& event );
461 DECLARE_EVENT_TABLE();
463 intf_thread_t *p_intf;
466 wxComboBox *mrl_combo;
470 /* Controls for the v4l advanced options */
471 wxPanel *common_subpanel;
472 wxPanel *common_panel;
473 wxCheckBox *size_checkbox;
474 wxComboBox *size_combo;
475 wxCheckBox *norm_checkbox;
476 wxComboBox *norm_combo;
477 wxCheckBox *frequency_checkbox;
478 wxSpinCtrl *frequency;
480 wxPanel *audio_subpanel;
481 wxPanel *audio_panel;
482 wxCheckBox *audio_checkbox;
483 wxTextCtrl *audio_device;
484 wxSpinCtrl *audio_channel;
486 wxPanel *bitrate_subpanel;
487 wxPanel *bitrate_panel;
488 wxCheckBox *bitrate_checkbox;
490 wxCheckBox *maxbitrate_checkbox;
491 wxSpinCtrl *maxbitrate;
495 /* Stream output Dialog */
509 TS_ENCAPSULATION = 0,
526 class SoutDialog: public wxDialog
530 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
531 virtual ~SoutDialog();
533 wxArrayString GetOptions();
537 wxPanel *AccessPanel( wxWindow* parent );
538 wxPanel *MiscPanel( wxWindow* parent );
539 wxPanel *EncapsulationPanel( wxWindow* parent );
540 wxPanel *TranscodingPanel( wxWindow* parent );
543 /* Event handlers (these functions should _not_ be virtual) */
544 void OnOk( wxCommandEvent& event );
545 void OnCancel( wxCommandEvent& event );
546 void OnMRLChange( wxCommandEvent& event );
547 void OnAccessTypeChange( wxCommandEvent& event );
549 /* Event handlers for the file access output */
550 void OnFileChange( wxCommandEvent& event );
551 void OnFileBrowse( wxCommandEvent& event );
553 /* Event handlers for the net access output */
554 void OnNetChange( wxCommandEvent& event );
556 /* Event specific to the announce address */
557 void OnAnnounceAddrChange( wxCommandEvent& event );
559 /* Event handlers for the encapsulation panel */
560 void OnEncapsulationChange( wxCommandEvent& event );
562 /* Event handlers for the transcoding panel */
563 void OnTranscodingEnable( wxCommandEvent& event );
564 void OnTranscodingChange( wxCommandEvent& event );
566 /* Event handlers for the misc panel */
567 void OnSAPMiscChange( wxCommandEvent& event );
568 void OnSLPMiscChange( wxCommandEvent& event );
570 DECLARE_EVENT_TABLE();
572 intf_thread_t *p_intf;
575 wxComboBox *mrl_combo;
577 /* Controls for the access outputs */
578 wxPanel *access_subpanels[ACCESS_OUT_NUM];
579 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
583 wxComboBox *file_combo;
584 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
585 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
587 /* Controls for the SAP announces */
588 wxPanel *misc_subpanels[MISC_SOUT_NUM];
589 wxCheckBox *sap_checkbox;
590 wxCheckBox *slp_checkbox;
591 wxTextCtrl *announce_addr;
593 /* Controls for the encapsulation */
594 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
595 int i_encapsulation_type;
597 /* Controls for transcoding */
598 wxCheckBox *video_transc_checkbox;
599 wxComboBox *video_codec_combo;
600 wxComboBox *audio_codec_combo;
601 wxCheckBox *audio_transc_checkbox;
602 wxComboBox *video_bitrate_combo;
603 wxComboBox *audio_bitrate_combo;
604 wxComboBox *audio_channels_combo;
607 /* Subtitles File Dialog */
608 class SubsFileDialog: public wxDialog
612 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
613 virtual ~SubsFileDialog();
615 wxComboBox *file_combo;
616 wxComboBox *encoding_combo;
617 wxSpinCtrl *delay_spinctrl;
618 wxSpinCtrl *fps_spinctrl;
621 /* Event handlers (these functions should _not_ be virtual) */
622 void OnOk( wxCommandEvent& event );
623 void OnCancel( wxCommandEvent& event );
624 void OnFileBrowse( wxCommandEvent& event );
626 DECLARE_EVENT_TABLE();
628 intf_thread_t *p_intf;
633 class StreamDialog: public wxFrame
637 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
638 virtual ~StreamDialog();
641 void OnClose( wxCommandEvent& event );
642 void OnOpen( wxCommandEvent& event );
643 void OnSout( wxCommandEvent& event );
644 void OnStart( wxCommandEvent& event );
646 DECLARE_EVENT_TABLE();
648 intf_thread_t *p_intf;
650 wxStaticText *step2_label;
651 wxStaticText *step3_label;
652 wxButton *sout_button;
653 wxButton *start_button;
655 wxArrayString sout_mrl;
656 OpenDialog *p_open_dialog;
657 SoutDialog *p_sout_dialog;
662 /* Preferences Dialog */
664 class PrefsDialog: public wxFrame
668 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
669 virtual ~PrefsDialog();
672 wxPanel *PrefsPanel( wxWindow* parent );
674 /* Event handlers (these functions should _not_ be virtual) */
675 void OnOk( wxCommandEvent& event );
676 void OnCancel( wxCommandEvent& event );
677 void OnSave( wxCommandEvent& event );
678 void OnResetAll( wxCommandEvent& event );
679 void OnAdvanced( wxCommandEvent& event );
681 DECLARE_EVENT_TABLE();
683 intf_thread_t *p_intf;
685 PrefsTreeCtrl *prefs_tree;
689 class Messages: public wxFrame
693 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
695 bool Show( bool show = TRUE );
699 /* Event handlers (these functions should _not_ be virtual) */
700 void OnClose( wxCommandEvent& event );
701 void OnClear( wxCommandEvent& event );
702 void OnSaveLog( wxCommandEvent& event );
704 DECLARE_EVENT_TABLE();
706 intf_thread_t *p_intf;
707 wxTextCtrl *textctrl;
708 wxTextAttr *info_attr;
709 wxTextAttr *err_attr;
710 wxTextAttr *warn_attr;
711 wxTextAttr *dbg_attr;
713 wxFileDialog *save_log_dialog;
715 vlc_bool_t b_verbose;
719 class ItemInfoDialog;
721 class Playlist: public wxFrame
725 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
728 void UpdatePlaylist();
729 void ShowPlaylist( bool show );
735 void DeleteItem( int item );
737 /* Event handlers (these functions should _not_ be virtual) */
738 void OnAddFile( wxCommandEvent& event );
739 void OnAddMRL( wxCommandEvent& event );
740 void OnClose( wxCommandEvent& event );
741 void OnSearch( wxCommandEvent& event );
742 void OnEnDis( wxCommandEvent& event );
743 void OnInfos( wxCommandEvent& event );
744 void OnSearchTextChange( wxCommandEvent& event );
745 void OnOpen( wxCommandEvent& event );
746 void OnSave( wxCommandEvent& event );
748 void OnSort( wxCommandEvent& event );
750 void OnUp( wxCommandEvent& event);
751 void OnDown( wxCommandEvent& event);
753 void OnEnableSelection( wxCommandEvent& event );
754 void OnDisableSelection( wxCommandEvent& event );
755 void OnInvertSelection( wxCommandEvent& event );
756 void OnDeleteSelection( wxCommandEvent& event );
757 void OnSelectAll( wxCommandEvent& event );
758 void OnRandom( wxCommandEvent& event );
759 void OnRepeat( wxCommandEvent& event );
760 void OnLoop ( wxCommandEvent& event );
761 void OnActivateItem( wxListEvent& event );
762 void OnKeyDown( wxListEvent& event );
763 void OnNewGroup( wxCommandEvent& event );
767 wxTextCtrl *search_text;
768 wxButton *search_button;
769 DECLARE_EVENT_TABLE();
772 ItemInfoDialog *iteminfo_dialog;
774 intf_thread_t *p_intf;
775 wxListView *listview;
776 wxTreeCtrl *treeview;
777 int i_update_counter;
782 class NewGroup: public wxDialog
786 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
791 /* Event handlers (these functions should _not_ be virtual) */
792 void OnOk( wxCommandEvent& event );
793 void OnCancel( wxCommandEvent& event );
795 DECLARE_EVENT_TABLE();
797 intf_thread_t *p_intf;
798 wxTextCtrl *groupname;
801 friend class Playlist;
802 friend class ItemInfoDialog;
807 /* ItemInfo Dialog */
808 class ItemInfoDialog: public wxDialog
812 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
813 wxWindow *p_parent );
814 virtual ~ItemInfoDialog();
816 wxArrayString GetOptions();
819 wxPanel *InfoPanel( wxWindow* parent );
820 wxPanel *GroupPanel( wxWindow* parent );
822 /* Event handlers (these functions should _not_ be virtual) */
823 void OnOk( wxCommandEvent& event );
824 void OnCancel( wxCommandEvent& event );
825 void OnNewGroup( wxCommandEvent& event );
827 DECLARE_EVENT_TABLE();
829 intf_thread_t *p_intf;
830 playlist_item_t *p_item;
833 /* Controls for the iteminfo dialog box */
834 wxPanel *info_subpanel;
837 wxPanel *group_subpanel;
838 wxPanel *group_panel;
840 wxTextCtrl *uri_text;
841 wxTextCtrl *name_text;
842 wxTextCtrl *author_text;
844 wxCheckBox *enabled_checkbox;
845 wxComboBox *group_combo;
851 class FileInfo: public wxFrame
855 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
857 void UpdateFileInfo();
860 void OnClose( wxCommandEvent& event );
862 DECLARE_EVENT_TABLE();
864 intf_thread_t *p_intf;
865 wxTreeCtrl *fileinfo_tree;
866 wxTreeItemId fileinfo_root;
867 wxString fileinfo_root_label;
872 #if !defined(__WXX11__)
873 /* Drag and Drop class */
874 class DragAndDrop: public wxFileDropTarget
877 DragAndDrop( intf_thread_t *_p_intf );
879 virtual bool OnDropFiles( wxCoord x, wxCoord y,
880 const wxArrayString& filenames );
883 intf_thread_t *p_intf;
888 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
889 const wxPoint& pos );
890 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
891 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
892 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
893 wxMenu *MiscMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
895 class MenuEvtHandler : public wxEvtHandler
898 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
899 virtual ~MenuEvtHandler();
901 void OnMenuEvent( wxCommandEvent& event );
902 void OnShowDialog( wxCommandEvent& event );
906 DECLARE_EVENT_TABLE()
908 intf_thread_t *p_intf;
909 Interface *p_main_interface;
912 class Menu: public wxMenu
916 Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
917 char **ppsz_names, int *pi_objects, int i_start_id );
921 /* Event handlers (these functions should _not_ be virtual) */
922 void OnClose( wxCommandEvent& event );
923 void OnShowDialog( wxCommandEvent& event );
924 void OnEntrySelected( wxCommandEvent& event );
926 wxMenu *Menu::CreateDummyMenu();
927 void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
928 wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t * );
930 DECLARE_EVENT_TABLE();
932 intf_thread_t *p_intf;
937 static inline int ConvertHotkeyModifiers( int i_hotkey )
939 int i_accel_flags = 0;
940 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
941 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
942 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
943 return i_accel_flags;
946 static inline int ConvertHotkey( int i_hotkey )
948 int i_key = i_hotkey & ~KEY_MODIFIER;
949 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
950 else if( i_key & KEY_SPECIAL )
954 case KEY_LEFT: return WXK_LEFT;
955 case KEY_RIGHT: return WXK_RIGHT;
956 case KEY_UP: return WXK_UP;
957 case KEY_DOWN: return WXK_DOWN;
958 case KEY_SPACE: return WXK_SPACE;
959 case KEY_ENTER: return WXK_RETURN;
960 case KEY_F1: return WXK_F1;
961 case KEY_F2: return WXK_F2;
962 case KEY_F3: return WXK_F3;
963 case KEY_F4: return WXK_F4;
964 case KEY_F5: return WXK_F5;
965 case KEY_F6: return WXK_F6;
966 case KEY_F7: return WXK_F7;
967 case KEY_F8: return WXK_F8;
968 case KEY_F9: return WXK_F9;
969 case KEY_F10: return WXK_F10;
970 case KEY_F11: return WXK_F11;
971 case KEY_F12: return WXK_F12;
972 case KEY_HOME: return WXK_HOME;
973 case KEY_END: return WXK_HOME;
974 case KEY_MENU: return WXK_MENU;
975 case KEY_ESC: return WXK_ESCAPE;
976 case KEY_PAGEUP: return WXK_PRIOR;
977 case KEY_PAGEDOWN: return WXK_NEXT;
978 case KEY_TAB: return WXK_TAB;
979 case KEY_BACKSPACE: return WXK_BACK;