1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999-2004 VideoLAN
7 * Authors: Gildas Bazin <gbazin@videolan.org>
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>
44 #include <wx/wizard.h>
47 /* Hmmm, work-around for newest wxWin */
48 #ifdef wxStaticCastEvent
49 # undef wxStaticCastEvent
50 # define wxStaticCastEvent(type, val) ((type)(val))
53 DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
54 DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
56 #define SLIDER_MAX_POS 10000
58 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
59 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
61 # define wxU(utf8) wxString(utf8, wxConvUTF8)
63 # define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
67 #else // ENABLE_NLS && ENABLE_UTF8
69 # define wxU(ansi) wxString(ansi, *wxConvCurrent)
71 # define wxU(ansi) ansi
77 /* wxL2U (locale to unicode) is used to convert ansi strings to unicode
78 * strings (wchar_t) */
80 # define wxL2U(ansi) wxString(ansi, *wxConvCurrent)
82 # define wxL2U(ansi) ansi
95 class DialogsProvider;
100 /*****************************************************************************
101 * intf_sys_t: description and status of wxwindows interface
102 *****************************************************************************/
105 /* the wx parent window */
106 wxWindow *p_wxwindow;
109 /* special actions */
110 vlc_bool_t b_playing;
112 /* The input thread */
113 input_thread_t * p_input;
116 int i_slider_pos; /* slider position */
117 int i_slider_oldpos; /* previous position */
118 vlc_bool_t b_slider_free; /* slider status */
120 /* The messages window */
121 msg_subscription_t* p_sub; /* message bank subscription */
123 /* Playlist management */
124 int i_playing; /* playlist selected item */
126 /* Send an event to show a dialog */
127 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
128 intf_dialog_args_t *p_arg );
131 wxMenu *p_popup_menu;
133 VideoWindow *p_video_window;
134 wxBoxSizer *p_video_sizer;
137 /*****************************************************************************
139 *****************************************************************************/
140 wxArrayString SeparateEntries( wxString );
141 wxWindow *VideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
142 wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
143 wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
151 class SubsFileDialog;
157 class ItemInfoDialog;
159 class ExportPlaylist;
161 /*****************************************************************************
162 * Classes declarations.
163 *****************************************************************************/
165 class Timer: public wxTimer
169 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
172 virtual void Notify();
175 intf_thread_t *p_intf;
176 Interface *p_main_interface;
177 int i_old_playing_status;
182 class Interface: public wxFrame
186 Interface( intf_thread_t *p_intf );
187 virtual ~Interface();
188 void TogglePlayButton( int i_playing_status );
190 wxBoxSizer *frame_sizer;
191 wxStatusBar *statusbar;
194 wxWindow *slider_frame;
195 wxWindow *extra_frame;
199 wxStaticBox *adjust_box;
200 wxSlider *brightness_slider;
201 wxSlider *contrast_slider;
202 wxSlider *saturation_slider;
203 wxSlider *hue_slider;
204 wxSlider *gamma_slider;
206 wxStaticBox *other_box;
207 wxComboBox *ratio_combo;
212 void UpdateAcceleratorTable();
213 void CreateOurMenuBar();
214 void CreateOurToolBar();
215 void CreateOurExtendedPanel();
216 void CreateOurSlider();
217 void Open( int i_access_method );
219 /* Event handlers (these functions should _not_ be virtual) */
220 void OnExit( wxCommandEvent& event );
221 void OnAbout( wxCommandEvent& event );
223 void OnOpenFileSimple( wxCommandEvent& event );
224 void OnOpenFile( wxCommandEvent& event );
225 void OnOpenDisc( wxCommandEvent& event );
226 void OnOpenNet( wxCommandEvent& event );
227 void OnOpenSat( wxCommandEvent& event );
228 void OnOpenV4L( wxCommandEvent& event );
229 void OnExtended( wxCommandEvent& event );
230 void OnBookmarks( wxCommandEvent& event );
231 void OnShowDialog( wxCommandEvent& event );
232 void OnPlayStream( wxCommandEvent& event );
233 void OnStopStream( wxCommandEvent& event );
234 void OnSliderUpdate( wxScrollEvent& event );
235 void OnPrevStream( wxCommandEvent& event );
236 void OnNextStream( wxCommandEvent& event );
237 void OnSlowStream( wxCommandEvent& event );
238 void OnFastStream( wxCommandEvent& event );
240 void OnEnableAdjust( wxCommandEvent& event );
241 void OnHueUpdate( wxScrollEvent& event );
242 void OnContrastUpdate( wxScrollEvent& event );
243 void OnBrightnessUpdate( wxScrollEvent& event );
244 void OnSaturationUpdate( wxScrollEvent& event );
245 void OnGammaUpdate( wxScrollEvent& event );
247 void OnRatio( wxCommandEvent& event );
248 void OnEnableVisual( wxCommandEvent& event );
250 void OnMenuOpen( wxMenuEvent& event );
252 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
253 void OnContextMenu2(wxContextMenuEvent& event);
255 void OnContextMenu(wxMouseEvent& event);
257 void OnControlEvent( wxCommandEvent& event );
259 DECLARE_EVENT_TABLE();
262 intf_thread_t *p_intf;
265 int i_old_playing_status;
267 /* For auto-generated menus */
268 wxMenu *p_settings_menu;
269 wxMenu *p_audio_menu;
270 wxMenu *p_video_menu;
271 wxMenu *p_navig_menu;
275 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
276 class OpenDialog: public wxFrame
280 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
281 int i_access_method, int i_arg = 0 );
283 /* Extended Contructor */
284 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
285 int i_access_method, int i_arg = 0 , int _i_method = 0 );
286 virtual ~OpenDialog();
289 int Show( int i_access_method, int i_arg = 0 );
292 void UpdateMRL( int i_access_method );
297 wxPanel *FilePanel( wxWindow* parent );
298 wxPanel *DiscPanel( wxWindow* parent );
299 wxPanel *NetPanel( wxWindow* parent );
300 wxPanel *V4LPanel( wxWindow* parent );
302 ArrayOfAutoBuiltPanel input_tab_array;
304 /* Event handlers (these functions should _not_ be virtual) */
305 void OnOk( wxCommandEvent& event );
306 void OnCancel( wxCommandEvent& event );
308 void OnPageChange( wxNotebookEvent& event );
309 void OnMRLChange( wxCommandEvent& event );
311 /* Event handlers for the file page */
312 void OnFilePanelChange( wxCommandEvent& event );
313 void OnFileBrowse( wxCommandEvent& event );
315 /* Event handlers for the disc page */
316 void OnDiscPanelChange( wxCommandEvent& event );
317 void OnDiscTypeChange( wxCommandEvent& event );
318 void OnDiscDeviceChange( wxCommandEvent& event );
320 /* Event handlers for the net page */
321 void OnNetPanelChange( wxCommandEvent& event );
322 void OnNetTypeChange( wxCommandEvent& event );
324 /* Event handlers for the v4l page */
325 void OnV4LPanelChange( wxCommandEvent& event );
326 void OnV4LTypeChange( wxCommandEvent& event );
327 void OnV4LSettingsChange( wxCommandEvent& event );
329 /* Event handlers for the stream output */
330 void OnSubsFileEnable( wxCommandEvent& event );
331 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
333 /* Event handlers for the stream output */
334 void OnSoutEnable( wxCommandEvent& event );
335 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
337 DECLARE_EVENT_TABLE();
339 intf_thread_t *p_intf;
341 int i_current_access_method;
342 int i_disc_type_selection;
344 int i_method; /* Normal or for the stream dialog ? */
347 wxComboBox *mrl_combo;
348 wxNotebook *notebook;
350 /* Controls for the file panel */
351 wxComboBox *file_combo;
352 wxFileDialog *file_dialog;
354 /* Controls for the disc panel */
355 wxRadioBox *disc_type;
356 wxTextCtrl *disc_device;
357 wxSpinCtrl *disc_title;
358 wxSpinCtrl *disc_chapter;
360 /* The media equivalent name for a DVD names. For example,
361 "Title", is "Track" for a CD-DA */
362 wxStaticText *disc_title_label;
363 wxStaticText *disc_chapter_label;
365 /* Indicates if the disc device control was modified */
366 bool b_disc_device_changed;
368 /* Controls for the net panel */
369 wxRadioBox *net_type;
371 wxPanel *net_subpanels[4];
372 wxRadioButton *net_radios[4];
373 wxSpinCtrl *net_ports[4];
375 wxTextCtrl *net_addrs[4];
376 wxCheckBox *net_ipv6;
378 /* Controls for the v4l panel */
379 wxRadioBox *video_type;
380 wxTextCtrl *video_device;
381 wxSpinCtrl *video_channel;
382 wxButton *v4l_button;
383 V4LDialog *v4l_dialog;
384 wxArrayString v4l_mrl;
386 /* Controls for the subtitles file */
387 wxButton *subsfile_button;
388 wxCheckBox *subsfile_checkbox;
389 SubsFileDialog *subsfile_dialog;
390 wxArrayString subsfile_mrl;
392 /* Controls for the stream output */
393 wxButton *sout_button;
394 wxCheckBox *sout_checkbox;
395 SoutDialog *sout_dialog;
396 wxArrayString sout_mrl;
405 /* Auto-built panels */
408 #define MAX_ACCESS CAPTURE_ACCESS
411 class V4LDialog: public wxDialog
415 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
416 virtual ~V4LDialog();
418 wxArrayString GetOptions();
422 wxPanel *AudioPanel( wxWindow* parent );
423 wxPanel *CommonPanel( wxWindow* parent );
424 wxPanel *BitratePanel( wxWindow* parent );
427 /* Event handlers (these functions should _not_ be virtual) */
428 void OnOk( wxCommandEvent& event );
429 void OnCancel( wxCommandEvent& event );
430 void OnMRLChange( wxCommandEvent& event );
431 void OnAudioEnable( wxCommandEvent& event );
432 void OnAudioChange( wxCommandEvent& event );
433 void OnAudioChannel( wxCommandEvent& event );
434 void OnSizeEnable( wxCommandEvent& event );
435 void OnSize( wxCommandEvent& event );
436 void OnNormEnable( wxCommandEvent& event );
437 void OnNorm( wxCommandEvent& event );
438 void OnFrequencyEnable( wxCommandEvent& event );
439 void OnFrequency( wxCommandEvent& event );
440 void OnBitrateEnable( wxCommandEvent& event );
441 void OnBitrate( wxCommandEvent& event );
442 void OnMaxBitrateEnable( wxCommandEvent& event );
443 void OnMaxBitrate( wxCommandEvent& event );
445 DECLARE_EVENT_TABLE();
447 intf_thread_t *p_intf;
450 wxComboBox *mrl_combo;
454 /* Controls for the v4l advanced options */
455 wxPanel *common_subpanel;
456 wxPanel *common_panel;
457 wxCheckBox *size_checkbox;
458 wxComboBox *size_combo;
459 wxCheckBox *norm_checkbox;
460 wxComboBox *norm_combo;
461 wxCheckBox *frequency_checkbox;
462 wxSpinCtrl *frequency;
464 wxPanel *audio_subpanel;
465 wxPanel *audio_panel;
466 wxCheckBox *audio_checkbox;
467 wxTextCtrl *audio_device;
468 wxSpinCtrl *audio_channel;
470 wxPanel *bitrate_subpanel;
471 wxPanel *bitrate_panel;
472 wxCheckBox *bitrate_checkbox;
474 wxCheckBox *maxbitrate_checkbox;
475 wxSpinCtrl *maxbitrate;
479 /* Stream output Dialog */
493 TS_ENCAPSULATION = 0,
511 class SoutDialog: public wxDialog
515 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
516 virtual ~SoutDialog();
518 wxArrayString GetOptions();
522 wxPanel *AccessPanel( wxWindow* parent );
523 wxPanel *MiscPanel( wxWindow* parent );
524 wxPanel *EncapsulationPanel( wxWindow* parent );
525 wxPanel *TranscodingPanel( wxWindow* parent );
528 /* Event handlers (these functions should _not_ be virtual) */
529 void OnOk( wxCommandEvent& event );
530 void OnCancel( wxCommandEvent& event );
531 void OnMRLChange( wxCommandEvent& event );
532 void OnAccessTypeChange( wxCommandEvent& event );
534 /* Event handlers for the file access output */
535 void OnFileChange( wxCommandEvent& event );
536 void OnFileBrowse( wxCommandEvent& event );
537 void OnFileDump( wxCommandEvent& event );
539 /* Event handlers for the net access output */
540 void OnNetChange( wxCommandEvent& event );
542 /* Event specific to the announce address */
543 void OnAnnounceAddrChange( wxCommandEvent& event );
545 /* Event handlers for the encapsulation panel */
546 void OnEncapsulationChange( wxCommandEvent& event );
548 /* Event handlers for the transcoding panel */
549 void OnTranscodingEnable( wxCommandEvent& event );
550 void OnTranscodingChange( wxCommandEvent& event );
552 /* Event handlers for the misc panel */
553 void OnSAPMiscChange( wxCommandEvent& event );
554 void OnSLPMiscChange( wxCommandEvent& event );
556 DECLARE_EVENT_TABLE();
558 intf_thread_t *p_intf;
561 wxComboBox *mrl_combo;
563 /* Controls for the access outputs */
564 wxPanel *access_panel;
565 wxPanel *access_subpanels[ACCESS_OUT_NUM];
566 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
570 wxComboBox *file_combo;
571 wxCheckBox *dump_checkbox;
572 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
573 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
575 /* Controls for the SAP announces */
577 wxPanel *misc_subpanels[MISC_SOUT_NUM];
578 wxCheckBox *sap_checkbox;
579 wxCheckBox *slp_checkbox;
580 wxTextCtrl *announce_addr;
582 /* Controls for the encapsulation */
583 wxPanel *encapsulation_panel;
584 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
585 int i_encapsulation_type;
587 /* Controls for transcoding */
588 wxPanel *transcoding_panel;
589 wxCheckBox *video_transc_checkbox;
590 wxComboBox *video_codec_combo;
591 wxComboBox *audio_codec_combo;
592 wxCheckBox *audio_transc_checkbox;
593 wxComboBox *video_bitrate_combo;
594 wxComboBox *audio_bitrate_combo;
595 wxComboBox *audio_channels_combo;
596 wxComboBox *video_scale_combo;
599 /* Subtitles File Dialog */
600 class SubsFileDialog: public wxDialog
604 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
605 virtual ~SubsFileDialog();
607 wxComboBox *file_combo;
608 wxComboBox *encoding_combo;
609 wxSpinCtrl *delay_spinctrl;
610 wxSpinCtrl *fps_spinctrl;
613 /* Event handlers (these functions should _not_ be virtual) */
614 void OnOk( wxCommandEvent& event );
615 void OnCancel( wxCommandEvent& event );
616 void OnFileBrowse( wxCommandEvent& event );
618 DECLARE_EVENT_TABLE();
620 intf_thread_t *p_intf;
625 class StreamDialog: public wxFrame
629 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
630 virtual ~StreamDialog();
633 void OnClose( wxCommandEvent& event );
634 void OnOpen( wxCommandEvent& event );
635 void OnSout( wxCommandEvent& event );
636 void OnStart( wxCommandEvent& event );
638 DECLARE_EVENT_TABLE();
640 intf_thread_t *p_intf;
642 wxStaticText *step2_label;
643 wxStaticText *step3_label;
644 wxButton *sout_button;
645 wxButton *start_button;
647 wxArrayString sout_mrl;
648 OpenDialog *p_open_dialog;
649 SoutDialog *p_sout_dialog;
653 class WizardDialog : public wxWizard
657 WizardDialog( intf_thread_t *p_intf, wxWindow *p_parent );
658 virtual ~WizardDialog();
659 void SetTranscode( char *vcodec, int vb, char *acodec,int ab);
660 void SetMrl( const char *mrl );
661 void SetStream( char *method, char *address );
662 void SetTranscodeOut( char *address );
663 void SetAction( int i_action );
665 void SetMux( char *mux );
671 char *vcodec,*acodec,*method,*address,*mrl,*mux;
672 DECLARE_EVENT_TABLE();
674 intf_thread_t *p_intf;
678 /* Preferences Dialog */
679 class PrefsDialog: public wxFrame
683 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
684 virtual ~PrefsDialog();
687 wxPanel *PrefsPanel( wxWindow* parent );
689 /* Event handlers (these functions should _not_ be virtual) */
690 void OnOk( wxCommandEvent& event );
691 void OnCancel( wxCommandEvent& event );
692 void OnSave( wxCommandEvent& event );
693 void OnResetAll( wxCommandEvent& event );
694 void OnAdvanced( wxCommandEvent& event );
696 DECLARE_EVENT_TABLE();
698 intf_thread_t *p_intf;
700 PrefsTreeCtrl *prefs_tree;
704 class Messages: public wxFrame
708 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
710 bool Show( bool show = TRUE );
714 /* Event handlers (these functions should _not_ be virtual) */
715 void OnClose( wxCommandEvent& event );
716 void OnClear( wxCommandEvent& event );
717 void OnSaveLog( wxCommandEvent& event );
719 DECLARE_EVENT_TABLE();
721 intf_thread_t *p_intf;
722 wxTextCtrl *textctrl;
723 wxTextAttr *info_attr;
724 wxTextAttr *err_attr;
725 wxTextAttr *warn_attr;
726 wxTextAttr *dbg_attr;
728 wxFileDialog *save_log_dialog;
730 vlc_bool_t b_verbose;
734 class Playlist: public wxFrame
738 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
741 void UpdatePlaylist();
742 void ShowPlaylist( bool show );
743 void UpdateItem( int );
748 void DeleteItem( int item );
749 void ShowInfos( 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 );
780 /* Popup functions */
781 void OnPopup( wxListEvent& event );
782 void OnPopupPlay( wxMenuEvent& event );
783 void OnPopupDel( wxMenuEvent& event );
784 void OnPopupEna( wxMenuEvent& event );
785 void OnPopupInfo( wxMenuEvent& event );
789 void OnPlaylistEvent( wxCommandEvent& event );
791 wxTextCtrl *search_text;
792 wxButton *search_button;
793 DECLARE_EVENT_TABLE();
797 ItemInfoDialog *iteminfo_dialog;
799 intf_thread_t *p_intf;
800 wxListView *listview;
801 wxTreeCtrl *treeview;
802 int i_update_counter;
810 int i_duration_sorted;
813 class NewGroup: public wxDialog
817 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
822 /* Event handlers (these functions should _not_ be virtual) */
823 void OnOk( wxCommandEvent& event );
824 void OnCancel( wxCommandEvent& event );
826 DECLARE_EVENT_TABLE();
828 intf_thread_t *p_intf;
829 wxTextCtrl *groupname;
832 friend class Playlist;
833 friend class ItemInfoDialog;
837 /* ItemInfo Dialog */
838 class ItemInfoDialog: public wxDialog
842 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
843 wxWindow *p_parent );
844 virtual ~ItemInfoDialog();
846 wxArrayString GetOptions();
849 wxPanel *InfoPanel( wxWindow* parent );
850 wxPanel *GroupPanel( wxWindow* parent );
852 /* Event handlers (these functions should _not_ be virtual) */
853 void OnOk( wxCommandEvent& event );
854 void OnCancel( wxCommandEvent& event );
855 void OnNewGroup( wxCommandEvent& event );
859 DECLARE_EVENT_TABLE();
861 intf_thread_t *p_intf;
862 playlist_item_t *p_item;
865 /* Controls for the iteminfo dialog box */
866 wxPanel *info_subpanel;
869 wxPanel *group_subpanel;
870 wxPanel *group_panel;
872 wxTextCtrl *uri_text;
873 wxTextCtrl *name_text;
874 wxTextCtrl *author_text;
876 wxTreeCtrl *info_tree;
877 wxTreeItemId info_root;
879 wxCheckBox *enabled_checkbox;
880 wxComboBox *group_combo;
886 class FileInfo: public wxFrame
890 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
892 void UpdateFileInfo();
895 void OnClose( wxCommandEvent& event );
897 DECLARE_EVENT_TABLE();
899 intf_thread_t *p_intf;
900 wxTreeCtrl *fileinfo_tree;
901 wxTreeItemId fileinfo_root;
902 wxString fileinfo_root_label;
907 #if !defined(__WXX11__)
908 /* Drag and Drop class */
909 class DragAndDrop: public wxFileDropTarget
912 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
914 virtual bool OnDropFiles( wxCoord x, wxCoord y,
915 const wxArrayString& filenames );
918 intf_thread_t *p_intf;
919 vlc_bool_t b_enqueue;
922 } // end of wxvlc namespace
925 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
926 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
927 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
928 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
929 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
933 class MenuEvtHandler : public wxEvtHandler
936 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
937 virtual ~MenuEvtHandler();
939 void OnMenuEvent( wxCommandEvent& event );
940 void OnShowDialog( wxCommandEvent& event );
944 DECLARE_EVENT_TABLE()
946 intf_thread_t *p_intf;
947 Interface *p_main_interface;
950 } // end of wxvlc namespace
951 using namespace wxvlc;
953 static inline int ConvertHotkeyModifiers( int i_hotkey )
955 int i_accel_flags = 0;
956 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
957 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
958 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
959 return i_accel_flags;
962 static inline int ConvertHotkey( int i_hotkey )
964 int i_key = i_hotkey & ~KEY_MODIFIER;
965 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
966 else if( i_key & KEY_SPECIAL )
970 case KEY_LEFT: return WXK_LEFT;
971 case KEY_RIGHT: return WXK_RIGHT;
972 case KEY_UP: return WXK_UP;
973 case KEY_DOWN: return WXK_DOWN;
974 case KEY_SPACE: return WXK_SPACE;
975 case KEY_ENTER: return WXK_RETURN;
976 case KEY_F1: return WXK_F1;
977 case KEY_F2: return WXK_F2;
978 case KEY_F3: return WXK_F3;
979 case KEY_F4: return WXK_F4;
980 case KEY_F5: return WXK_F5;
981 case KEY_F6: return WXK_F6;
982 case KEY_F7: return WXK_F7;
983 case KEY_F8: return WXK_F8;
984 case KEY_F9: return WXK_F9;
985 case KEY_F10: return WXK_F10;
986 case KEY_F11: return WXK_F11;
987 case KEY_F12: return WXK_F12;
988 case KEY_HOME: return WXK_HOME;
989 case KEY_END: return WXK_HOME;
990 case KEY_MENU: return WXK_MENU;
991 case KEY_ESC: return WXK_ESCAPE;
992 case KEY_PAGEUP: return WXK_PRIOR;
993 case KEY_PAGEDOWN: return WXK_NEXT;
994 case KEY_TAB: return WXK_TAB;
995 case KEY_BACKSPACE: return WXK_BACK;