1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: wxwindows.h,v 1.81 2003/12/16 03:21:47 rocky 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>
43 #include <wx/checkbox.h>
46 DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
53 #define SLIDER_MAX_POS 10000
55 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
56 #if defined( ENABLE_NLS ) && defined( HAVE_GETTEXT ) && \
57 defined( WIN32 ) && !defined( HAVE_INCLUDED_GETTEXT )
59 # define wxU(utf8) wxString(utf8, wxConvUTF8)
61 # define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
65 #else // ENABLE_NLS && HAVE_GETTEXT && WIN32 && !HAVE_INCLUDED_GETTEXT
67 # define wxU(ansi) wxString(ansi, *wxConvCurrent)
69 # define wxU(ansi) ansi
85 wxArrayString SeparateEntries( wxString );
87 /*****************************************************************************
88 * intf_sys_t: description and status of wxwindows interface
89 *****************************************************************************/
92 /* the wx parent window */
99 /* The input thread */
100 input_thread_t * p_input;
103 int i_slider_pos; /* slider position */
104 int i_slider_oldpos; /* previous position */
105 vlc_bool_t b_slider_free; /* slider status */
107 /* The messages window */
108 msg_subscription_t* p_sub; /* message bank subscription */
110 /* Playlist management */
111 int i_playing; /* playlist selected item */
113 /* Send an event to show a dialog */
114 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
115 intf_dialog_args_t *p_arg );
118 wxMenu *p_popup_menu;
122 /*****************************************************************************
124 *****************************************************************************/
126 /*****************************************************************************
127 * Classes declarations.
128 *****************************************************************************/
132 class Timer: public wxTimer
136 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
139 virtual void Notify();
142 intf_thread_t *p_intf;
143 Interface *p_main_interface;
144 int i_old_playing_status;
149 class Interface: public wxFrame
153 Interface( intf_thread_t *p_intf );
154 virtual ~Interface();
155 void TogglePlayButton( int i_playing_status );
157 // wxFlexGridSizer *frame_sizer;
158 wxBoxSizer *frame_sizer;
159 wxStatusBar *statusbar;
162 wxWindow *slider_frame;
163 wxWindow *extra_frame;
164 wxStaticBox *slider_box;
168 wxStaticBox *adjust_box;
169 wxSlider *brightness_slider;
170 wxSlider *contrast_slider;
171 wxSlider *saturation_slider;
172 wxSlider *hue_slider;
174 wxStaticBox *other_box;
175 wxComboBox *ratio_combo;
180 void UpdateAcceleratorTable();
181 void CreateOurMenuBar();
182 void CreateOurToolBar();
183 void CreateOurExtraPanel();
184 void CreateOurSlider();
185 void Open( int i_access_method );
187 /* Event handlers (these functions should _not_ be virtual) */
188 void OnExit( wxCommandEvent& event );
189 void OnAbout( wxCommandEvent& event );
191 void OnOpenFileSimple( wxCommandEvent& event );
192 void OnOpenFile( wxCommandEvent& event );
193 void OnOpenDisc( wxCommandEvent& event );
194 void OnOpenNet( wxCommandEvent& event );
195 void OnOpenSat( wxCommandEvent& event );
196 void OnOpenV4L( wxCommandEvent& event );
197 void OnStream( wxCommandEvent& event );
198 void OnExtra( wxCommandEvent& event );
199 void OnShowDialog( wxCommandEvent& event );
200 void OnPlayStream( wxCommandEvent& event );
201 void OnStopStream( wxCommandEvent& event );
202 void OnSliderUpdate( wxScrollEvent& event );
203 void OnPrevStream( wxCommandEvent& event );
204 void OnNextStream( wxCommandEvent& event );
205 void OnSlowStream( wxCommandEvent& event );
206 void OnFastStream( wxCommandEvent& event );
208 void OnEnableAdjust( wxCommandEvent& event );
209 void OnHueUpdate( wxScrollEvent& event );
210 void OnContrastUpdate( wxScrollEvent& event );
211 void OnBrightnessUpdate( wxScrollEvent& event );
212 void OnSaturationUpdate( wxScrollEvent& event );
214 void OnRatio( wxCommandEvent& event );
215 void OnEnableVisual( wxCommandEvent& event );
217 void OnMenuOpen( wxMenuEvent& event );
219 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
220 void OnContextMenu2(wxContextMenuEvent& event);
222 void OnContextMenu(wxMouseEvent& event);
224 DECLARE_EVENT_TABLE();
227 intf_thread_t *p_intf;
230 int i_old_playing_status;
232 /* For auto-generated menus */
233 wxMenu *p_settings_menu;
234 vlc_bool_t b_settings_menu;
235 wxMenu *p_audio_menu;
236 vlc_bool_t b_audio_menu;
237 wxMenu *p_video_menu;
238 vlc_bool_t b_video_menu;
239 wxMenu *p_navig_menu;
240 vlc_bool_t b_navig_menu;
245 /* Dialogs Provider */
246 class DialogsProvider: public wxFrame
250 DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
251 virtual ~DialogsProvider();
254 void Open( int i_access_method, int i_arg );
256 /* Event handlers (these functions should _not_ be virtual) */
257 void OnExit( wxCommandEvent& event );
258 void OnPlaylist( wxCommandEvent& event );
259 void OnMessages( wxCommandEvent& event );
260 void OnFileInfo( wxCommandEvent& event );
261 void OnPreferences( wxCommandEvent& event );
262 void OnStreamDialog( wxCommandEvent& event );
264 void OnOpenFileGeneric( wxCommandEvent& event );
265 void OnOpenFileSimple( wxCommandEvent& event );
266 void OnOpenFile( wxCommandEvent& event );
267 void OnOpenDisc( wxCommandEvent& event );
268 void OnOpenNet( wxCommandEvent& event );
269 void OnOpenSat( wxCommandEvent& event );
271 void OnPopupMenu( wxCommandEvent& event );
273 void OnIdle( wxIdleEvent& event );
275 void OnExitThread( wxCommandEvent& event );
277 DECLARE_EVENT_TABLE();
279 intf_thread_t *p_intf;
282 /* Secondary windows */
283 OpenDialog *p_open_dialog;
284 wxFileDialog *p_file_dialog;
285 Playlist *p_playlist_dialog;
286 Messages *p_messages_dialog;
287 FileInfo *p_fileinfo_dialog;
288 StreamDialog *p_stream_dialog;
289 wxFrame *p_prefs_dialog;
290 wxFileDialog *p_file_generic_dialog;
294 class AutoBuiltPanel;
295 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
298 class SubsFileDialog;
299 class OpenDialog: public wxFrame
303 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
304 int i_access_method, int i_arg = 0 );
306 /* Extended Contructor */
307 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
308 int i_access_method, int i_arg = 0 , int _i_method = 0 );
309 virtual ~OpenDialog();
312 int Show( int i_access_method, int i_arg = 0 );
315 void UpdateMRL( int i_access_method );
320 wxPanel *FilePanel( wxWindow* parent );
321 wxPanel *DiscPanel( wxWindow* parent );
322 wxPanel *NetPanel( wxWindow* parent );
323 wxPanel *V4LPanel( wxWindow* parent );
325 ArrayOfAutoBuiltPanel input_tab_array;
327 /* Event handlers (these functions should _not_ be virtual) */
328 void OnOk( wxCommandEvent& event );
329 void OnCancel( wxCommandEvent& event );
331 void OnPageChange( wxNotebookEvent& event );
332 void OnMRLChange( wxCommandEvent& event );
334 /* Event handlers for the file page */
335 void OnFilePanelChange( wxCommandEvent& event );
336 void OnFileBrowse( wxCommandEvent& event );
338 /* Event handlers for the disc page */
339 void OnDiscPanelChange( wxCommandEvent& event );
340 void OnDiscTypeChange( wxCommandEvent& event );
341 void OnDiscDeviceChange( wxCommandEvent& event );
343 /* Event handlers for the net page */
344 void OnNetPanelChange( wxCommandEvent& event );
345 void OnNetTypeChange( wxCommandEvent& event );
347 /* Event handlers for the v4l page */
348 void OnV4LPanelChange( wxCommandEvent& event );
349 void OnV4LTypeChange( wxCommandEvent& event );
350 void OnV4LSettingsChange( wxCommandEvent& event );
352 /* Event handlers for the stream output */
353 void OnSubsFileEnable( wxCommandEvent& event );
354 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
356 /* Event handlers for the stream output */
357 void OnSoutEnable( wxCommandEvent& event );
358 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
360 DECLARE_EVENT_TABLE();
362 intf_thread_t *p_intf;
364 int i_current_access_method;
365 int i_disc_type_selection;
367 int i_method; /* Normal or for the stream dialog ? */
368 wxComboBox *mrl_combo;
369 wxNotebook *notebook;
371 /* Controls for the file panel */
372 wxComboBox *file_combo;
373 wxFileDialog *file_dialog;
375 /* Controls for the disc panel */
376 wxRadioBox *disc_type;
377 wxTextCtrl *disc_device;
378 wxSpinCtrl *disc_title;
379 wxSpinCtrl *disc_chapter;
381 /* The media equivalent name for a DVD names. For example,
382 "Title", is "Track" for a CD-DA */
383 wxStaticText *disc_title_label;
384 wxStaticText *disc_chapter_label;
386 /* Indicates if the disc device control was modified */
387 bool b_disc_device_changed;
389 /* Controls for the net panel */
390 wxRadioBox *net_type;
392 wxPanel *net_subpanels[4];
393 wxRadioButton *net_radios[4];
394 wxSpinCtrl *net_ports[4];
396 wxTextCtrl *net_addrs[4];
397 wxCheckBox *net_ipv6;
399 /* Controls for the v4l panel */
400 wxRadioBox *video_type;
401 wxTextCtrl *video_device;
402 wxSpinCtrl *video_channel;
403 wxButton *v4l_button;
404 V4LDialog *v4l_dialog;
405 wxArrayString v4l_mrl;
407 /* Controls for the subtitles file */
408 wxButton *subsfile_button;
409 wxCheckBox *subsfile_checkbox;
410 SubsFileDialog *subsfile_dialog;
411 wxArrayString subsfile_mrl;
413 /* Controls for the stream output */
414 wxButton *sout_button;
415 wxCheckBox *sout_checkbox;
416 SoutDialog *sout_dialog;
417 wxArrayString sout_mrl;
433 class V4LDialog: public wxDialog
437 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
438 virtual ~V4LDialog();
440 wxArrayString GetOptions();
444 wxPanel *AudioPanel( wxWindow* parent );
445 wxPanel *CommonPanel( wxWindow* parent );
446 wxPanel *BitratePanel( wxWindow* parent );
449 /* Event handlers (these functions should _not_ be virtual) */
450 void OnOk( wxCommandEvent& event );
451 void OnCancel( wxCommandEvent& event );
452 void OnMRLChange( wxCommandEvent& event );
453 void OnAudioEnable( wxCommandEvent& event );
454 void OnAudioChange( wxCommandEvent& event );
455 void OnAudioChannel( wxCommandEvent& event );
456 void OnSizeEnable( wxCommandEvent& event );
457 void OnSize( wxCommandEvent& event );
458 void OnNormEnable( wxCommandEvent& event );
459 void OnNorm( wxCommandEvent& event );
460 void OnFrequencyEnable( wxCommandEvent& event );
461 void OnFrequency( wxCommandEvent& event );
462 void OnBitrateEnable( wxCommandEvent& event );
463 void OnBitrate( wxCommandEvent& event );
464 void OnMaxBitrateEnable( wxCommandEvent& event );
465 void OnMaxBitrate( wxCommandEvent& event );
467 DECLARE_EVENT_TABLE();
469 intf_thread_t *p_intf;
472 wxComboBox *mrl_combo;
476 /* Controls for the v4l advanced options */
477 wxPanel *common_subpanel;
478 wxPanel *common_panel;
479 wxCheckBox *size_checkbox;
480 wxComboBox *size_combo;
481 wxCheckBox *norm_checkbox;
482 wxComboBox *norm_combo;
483 wxCheckBox *frequency_checkbox;
484 wxSpinCtrl *frequency;
486 wxPanel *audio_subpanel;
487 wxPanel *audio_panel;
488 wxCheckBox *audio_checkbox;
489 wxTextCtrl *audio_device;
490 wxSpinCtrl *audio_channel;
492 wxPanel *bitrate_subpanel;
493 wxPanel *bitrate_panel;
494 wxCheckBox *bitrate_checkbox;
496 wxCheckBox *maxbitrate_checkbox;
497 wxSpinCtrl *maxbitrate;
501 /* Stream output Dialog */
515 TS_ENCAPSULATION = 0,
533 class SoutDialog: public wxDialog
537 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
538 virtual ~SoutDialog();
540 wxArrayString GetOptions();
544 wxPanel *AccessPanel( wxWindow* parent );
545 wxPanel *MiscPanel( wxWindow* parent );
546 wxPanel *EncapsulationPanel( wxWindow* parent );
547 wxPanel *TranscodingPanel( wxWindow* parent );
550 /* Event handlers (these functions should _not_ be virtual) */
551 void OnOk( wxCommandEvent& event );
552 void OnCancel( wxCommandEvent& event );
553 void OnMRLChange( wxCommandEvent& event );
554 void OnAccessTypeChange( wxCommandEvent& event );
556 /* Event handlers for the file access output */
557 void OnFileChange( wxCommandEvent& event );
558 void OnFileBrowse( wxCommandEvent& event );
559 void OnFileDump( wxCommandEvent& event );
561 /* Event handlers for the net access output */
562 void OnNetChange( wxCommandEvent& event );
564 /* Event specific to the announce address */
565 void OnAnnounceAddrChange( wxCommandEvent& event );
567 /* Event handlers for the encapsulation panel */
568 void OnEncapsulationChange( wxCommandEvent& event );
570 /* Event handlers for the transcoding panel */
571 void OnTranscodingEnable( wxCommandEvent& event );
572 void OnTranscodingChange( wxCommandEvent& event );
574 /* Event handlers for the misc panel */
575 void OnSAPMiscChange( wxCommandEvent& event );
576 void OnSLPMiscChange( wxCommandEvent& event );
578 DECLARE_EVENT_TABLE();
580 intf_thread_t *p_intf;
583 wxComboBox *mrl_combo;
585 /* Controls for the access outputs */
586 wxPanel *access_panel;
587 wxPanel *access_subpanels[ACCESS_OUT_NUM];
588 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
592 wxComboBox *file_combo;
593 wxCheckBox *dump_checkbox;
594 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
595 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
597 /* Controls for the SAP announces */
599 wxPanel *misc_subpanels[MISC_SOUT_NUM];
600 wxCheckBox *sap_checkbox;
601 wxCheckBox *slp_checkbox;
602 wxTextCtrl *announce_addr;
604 /* Controls for the encapsulation */
605 wxPanel *encapsulation_panel;
606 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
607 int i_encapsulation_type;
609 /* Controls for transcoding */
610 wxPanel *transcoding_panel;
611 wxCheckBox *video_transc_checkbox;
612 wxComboBox *video_codec_combo;
613 wxComboBox *audio_codec_combo;
614 wxCheckBox *audio_transc_checkbox;
615 wxComboBox *video_bitrate_combo;
616 wxComboBox *audio_bitrate_combo;
617 wxComboBox *audio_channels_combo;
618 wxComboBox *video_scale_combo;
621 /* Subtitles File Dialog */
622 class SubsFileDialog: public wxDialog
626 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
627 virtual ~SubsFileDialog();
629 wxComboBox *file_combo;
630 wxComboBox *encoding_combo;
631 wxSpinCtrl *delay_spinctrl;
632 wxSpinCtrl *fps_spinctrl;
635 /* Event handlers (these functions should _not_ be virtual) */
636 void OnOk( wxCommandEvent& event );
637 void OnCancel( wxCommandEvent& event );
638 void OnFileBrowse( wxCommandEvent& event );
640 DECLARE_EVENT_TABLE();
642 intf_thread_t *p_intf;
647 class StreamDialog: public wxFrame
651 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
652 virtual ~StreamDialog();
655 void OnClose( wxCommandEvent& event );
656 void OnOpen( wxCommandEvent& event );
657 void OnSout( wxCommandEvent& event );
658 void OnStart( wxCommandEvent& event );
660 DECLARE_EVENT_TABLE();
662 intf_thread_t *p_intf;
664 wxStaticText *step2_label;
665 wxStaticText *step3_label;
666 wxButton *sout_button;
667 wxButton *start_button;
669 wxArrayString sout_mrl;
670 OpenDialog *p_open_dialog;
671 SoutDialog *p_sout_dialog;
676 /* Preferences Dialog */
678 class PrefsDialog: public wxFrame
682 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
683 virtual ~PrefsDialog();
686 wxPanel *PrefsPanel( wxWindow* parent );
688 /* Event handlers (these functions should _not_ be virtual) */
689 void OnOk( wxCommandEvent& event );
690 void OnCancel( wxCommandEvent& event );
691 void OnSave( wxCommandEvent& event );
692 void OnResetAll( wxCommandEvent& event );
693 void OnAdvanced( wxCommandEvent& event );
695 DECLARE_EVENT_TABLE();
697 intf_thread_t *p_intf;
699 PrefsTreeCtrl *prefs_tree;
703 class Messages: public wxFrame
707 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
709 bool Show( bool show = TRUE );
713 /* Event handlers (these functions should _not_ be virtual) */
714 void OnClose( wxCommandEvent& event );
715 void OnClear( wxCommandEvent& event );
716 void OnSaveLog( wxCommandEvent& event );
718 DECLARE_EVENT_TABLE();
720 intf_thread_t *p_intf;
721 wxTextCtrl *textctrl;
722 wxTextAttr *info_attr;
723 wxTextAttr *err_attr;
724 wxTextAttr *warn_attr;
725 wxTextAttr *dbg_attr;
727 wxFileDialog *save_log_dialog;
729 vlc_bool_t b_verbose;
733 class ItemInfoDialog;
735 class Playlist: public wxFrame
739 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
742 void UpdatePlaylist();
743 void ShowPlaylist( bool show );
749 void DeleteItem( int item );
751 /* Event handlers (these functions should _not_ be virtual) */
752 void OnAddFile( wxCommandEvent& event );
753 void OnAddMRL( wxCommandEvent& event );
754 void OnClose( wxCommandEvent& event );
755 void OnSearch( wxCommandEvent& event );
756 void OnEnDis( wxCommandEvent& event );
757 void OnInfos( wxCommandEvent& event );
758 void OnSearchTextChange( wxCommandEvent& event );
759 void OnOpen( wxCommandEvent& event );
760 void OnSave( wxCommandEvent& event );
762 void OnSort( wxCommandEvent& event );
763 void OnColSelect( wxListEvent& event );
765 void OnUp( wxCommandEvent& event);
766 void OnDown( wxCommandEvent& event);
768 void OnEnableSelection( wxCommandEvent& event );
769 void OnDisableSelection( wxCommandEvent& event );
770 void OnInvertSelection( wxCommandEvent& event );
771 void OnDeleteSelection( wxCommandEvent& event );
772 void OnSelectAll( wxCommandEvent& event );
773 void OnRandom( wxCommandEvent& event );
774 void OnRepeat( wxCommandEvent& event );
775 void OnLoop ( wxCommandEvent& event );
776 void OnActivateItem( wxListEvent& event );
777 void OnKeyDown( wxListEvent& event );
778 void OnNewGroup( wxCommandEvent& event );
782 wxTextCtrl *search_text;
783 wxButton *search_button;
784 DECLARE_EVENT_TABLE();
787 ItemInfoDialog *iteminfo_dialog;
789 intf_thread_t *p_intf;
790 wxListView *listview;
791 wxTreeCtrl *treeview;
792 int i_update_counter;
801 class NewGroup: public wxDialog
805 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
810 /* Event handlers (these functions should _not_ be virtual) */
811 void OnOk( wxCommandEvent& event );
812 void OnCancel( wxCommandEvent& event );
814 DECLARE_EVENT_TABLE();
816 intf_thread_t *p_intf;
817 wxTextCtrl *groupname;
820 friend class Playlist;
821 friend class ItemInfoDialog;
826 /* ItemInfo Dialog */
827 class ItemInfoDialog: public wxDialog
831 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
832 wxWindow *p_parent );
833 virtual ~ItemInfoDialog();
835 wxArrayString GetOptions();
838 wxPanel *InfoPanel( wxWindow* parent );
839 wxPanel *GroupPanel( wxWindow* parent );
841 /* Event handlers (these functions should _not_ be virtual) */
842 void OnOk( wxCommandEvent& event );
843 void OnCancel( wxCommandEvent& event );
844 void OnNewGroup( wxCommandEvent& event );
846 DECLARE_EVENT_TABLE();
848 intf_thread_t *p_intf;
849 playlist_item_t *p_item;
852 /* Controls for the iteminfo dialog box */
853 wxPanel *info_subpanel;
856 wxPanel *group_subpanel;
857 wxPanel *group_panel;
859 wxTextCtrl *uri_text;
860 wxTextCtrl *name_text;
861 wxTextCtrl *author_text;
863 wxCheckBox *enabled_checkbox;
864 wxComboBox *group_combo;
870 class FileInfo: public wxFrame
874 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
876 void UpdateFileInfo();
879 void OnClose( wxCommandEvent& event );
881 DECLARE_EVENT_TABLE();
883 intf_thread_t *p_intf;
884 wxTreeCtrl *fileinfo_tree;
885 wxTreeItemId fileinfo_root;
886 wxString fileinfo_root_label;
891 #if !defined(__WXX11__)
892 /* Drag and Drop class */
893 class DragAndDrop: public wxFileDropTarget
896 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
898 virtual bool OnDropFiles( wxCoord x, wxCoord y,
899 const wxArrayString& filenames );
902 intf_thread_t *p_intf;
903 vlc_bool_t b_enqueue;
908 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
909 const wxPoint& pos );
910 wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
911 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
912 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
913 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
915 class MenuEvtHandler : public wxEvtHandler
918 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
919 virtual ~MenuEvtHandler();
921 void OnMenuEvent( wxCommandEvent& event );
922 void OnShowDialog( wxCommandEvent& event );
926 DECLARE_EVENT_TABLE()
928 intf_thread_t *p_intf;
929 Interface *p_main_interface;
932 class Menu: public wxMenu
936 Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
937 char **ppsz_names, int *pi_objects, int i_start_id );
941 /* Event handlers (these functions should _not_ be virtual) */
942 void OnClose( wxCommandEvent& event );
943 void OnShowDialog( wxCommandEvent& event );
944 void OnEntrySelected( wxCommandEvent& event );
946 wxMenu *Menu::CreateDummyMenu();
947 void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
948 wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t * );
950 DECLARE_EVENT_TABLE();
952 intf_thread_t *p_intf;
957 static inline int ConvertHotkeyModifiers( int i_hotkey )
959 int i_accel_flags = 0;
960 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
961 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
962 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
963 return i_accel_flags;
966 static inline int ConvertHotkey( int i_hotkey )
968 int i_key = i_hotkey & ~KEY_MODIFIER;
969 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
970 else if( i_key & KEY_SPECIAL )
974 case KEY_LEFT: return WXK_LEFT;
975 case KEY_RIGHT: return WXK_RIGHT;
976 case KEY_UP: return WXK_UP;
977 case KEY_DOWN: return WXK_DOWN;
978 case KEY_SPACE: return WXK_SPACE;
979 case KEY_ENTER: return WXK_RETURN;
980 case KEY_F1: return WXK_F1;
981 case KEY_F2: return WXK_F2;
982 case KEY_F3: return WXK_F3;
983 case KEY_F4: return WXK_F4;
984 case KEY_F5: return WXK_F5;
985 case KEY_F6: return WXK_F6;
986 case KEY_F7: return WXK_F7;
987 case KEY_F8: return WXK_F8;
988 case KEY_F9: return WXK_F9;
989 case KEY_F10: return WXK_F10;
990 case KEY_F11: return WXK_F11;
991 case KEY_F12: return WXK_F12;
992 case KEY_HOME: return WXK_HOME;
993 case KEY_END: return WXK_HOME;
994 case KEY_MENU: return WXK_MENU;
995 case KEY_ESC: return WXK_ESCAPE;
996 case KEY_PAGEUP: return WXK_PRIOR;
997 case KEY_PAGEDOWN: return WXK_NEXT;
998 case KEY_TAB: return WXK_TAB;
999 case KEY_BACKSPACE: return WXK_BACK;