1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999-2004 VideoLAN
5 * $Id: wxwindows.h,v 1.95 2004/03/01 18:31:13 gbazin 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 /* Hmmm, work-around for newest wxWin */
47 #ifdef wxStaticCastEvent
48 # undef wxStaticCastEvent
49 # define wxStaticCastEvent(type, val) ((type)(val))
52 DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
59 #define SLIDER_MAX_POS 10000
61 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
62 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
64 # define wxU(utf8) wxString(utf8, wxConvUTF8)
66 # define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
70 #else // ENABLE_NLS && ENABLE_UTF8
72 # define wxU(ansi) wxString(ansi, *wxConvCurrent)
74 # define wxU(ansi) ansi
80 /* wxL2U (locale to unicode) is used to convert ansi strings to unicode
81 * strings (wchar_t) */
83 # define wxL2U(ansi) wxString(ansi, *wxConvCurrent)
85 # define wxL2U(ansi) ansi
98 wxArrayString SeparateEntries( wxString );
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;
135 /*****************************************************************************
137 *****************************************************************************/
139 /*****************************************************************************
140 * Classes declarations.
141 *****************************************************************************/
145 class Timer: public wxTimer
149 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
152 virtual void Notify();
155 intf_thread_t *p_intf;
156 Interface *p_main_interface;
157 int i_old_playing_status;
162 class Interface: public wxFrame
166 Interface( intf_thread_t *p_intf );
167 virtual ~Interface();
168 void TogglePlayButton( int i_playing_status );
170 // wxFlexGridSizer *frame_sizer;
171 wxBoxSizer *frame_sizer;
172 wxStatusBar *statusbar;
175 wxWindow *slider_frame;
176 wxWindow *extra_frame;
177 wxStaticBox *slider_box;
181 wxStaticBox *adjust_box;
182 wxSlider *brightness_slider;
183 wxSlider *contrast_slider;
184 wxSlider *saturation_slider;
185 wxSlider *hue_slider;
186 wxSlider *gamma_slider;
188 wxStaticBox *other_box;
189 wxComboBox *ratio_combo;
194 void UpdateAcceleratorTable();
195 void CreateOurMenuBar();
196 void CreateOurToolBar();
197 void CreateOurExtraPanel();
198 void CreateOurSlider();
199 void Open( int i_access_method );
201 /* Event handlers (these functions should _not_ be virtual) */
202 void OnExit( wxCommandEvent& event );
203 void OnAbout( wxCommandEvent& event );
205 void OnOpenFileSimple( wxCommandEvent& event );
206 void OnOpenFile( wxCommandEvent& event );
207 void OnOpenDisc( wxCommandEvent& event );
208 void OnOpenNet( wxCommandEvent& event );
209 void OnOpenSat( wxCommandEvent& event );
210 void OnOpenV4L( wxCommandEvent& event );
211 void OnExtra( wxCommandEvent& event );
212 void OnShowDialog( wxCommandEvent& event );
213 void OnPlayStream( wxCommandEvent& event );
214 void OnStopStream( wxCommandEvent& event );
215 void OnSliderUpdate( wxScrollEvent& event );
216 void OnPrevStream( wxCommandEvent& event );
217 void OnNextStream( wxCommandEvent& event );
218 void OnSlowStream( wxCommandEvent& event );
219 void OnFastStream( wxCommandEvent& event );
221 void OnEnableAdjust( wxCommandEvent& event );
222 void OnHueUpdate( wxScrollEvent& event );
223 void OnContrastUpdate( wxScrollEvent& event );
224 void OnBrightnessUpdate( wxScrollEvent& event );
225 void OnSaturationUpdate( wxScrollEvent& event );
226 void OnGammaUpdate( wxScrollEvent& event );
228 void OnRatio( wxCommandEvent& event );
229 void OnEnableVisual( wxCommandEvent& event );
231 void OnMenuOpen( wxMenuEvent& event );
233 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
234 void OnContextMenu2(wxContextMenuEvent& event);
236 void OnContextMenu(wxMouseEvent& event);
238 DECLARE_EVENT_TABLE();
241 intf_thread_t *p_intf;
244 int i_old_playing_status;
246 /* For auto-generated menus */
247 wxMenu *p_settings_menu;
248 vlc_bool_t b_settings_menu;
249 wxMenu *p_audio_menu;
250 vlc_bool_t b_audio_menu;
251 wxMenu *p_video_menu;
252 vlc_bool_t b_video_menu;
253 wxMenu *p_navig_menu;
254 vlc_bool_t b_navig_menu;
259 /* Dialogs Provider */
260 class DialogsProvider: public wxFrame
264 DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
265 virtual ~DialogsProvider();
268 void Open( int i_access_method, int i_arg );
270 /* Event handlers (these functions should _not_ be virtual) */
271 void OnExit( wxCommandEvent& event );
272 void OnPlaylist( wxCommandEvent& event );
273 void OnMessages( wxCommandEvent& event );
274 void OnFileInfo( wxCommandEvent& event );
275 void OnPreferences( wxCommandEvent& event );
276 void OnStreamWizardDialog( wxCommandEvent& event );
278 void OnOpenFileGeneric( wxCommandEvent& event );
279 void OnOpenFileSimple( wxCommandEvent& event );
280 void OnOpenFile( wxCommandEvent& event );
281 void OnOpenDisc( wxCommandEvent& event );
282 void OnOpenNet( wxCommandEvent& event );
283 void OnOpenSat( wxCommandEvent& event );
285 void OnPopupMenu( wxCommandEvent& event );
287 void OnIdle( wxIdleEvent& event );
289 void OnExitThread( wxCommandEvent& event );
291 DECLARE_EVENT_TABLE();
293 intf_thread_t *p_intf;
296 /* Secondary windows */
297 OpenDialog *p_open_dialog;
298 wxFileDialog *p_file_dialog;
299 Playlist *p_playlist_dialog;
300 Messages *p_messages_dialog;
301 FileInfo *p_fileinfo_dialog;
302 StreamDialog *p_streamwizard_dialog;
303 wxFrame *p_prefs_dialog;
304 wxFileDialog *p_file_generic_dialog;
308 class AutoBuiltPanel;
309 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
312 class SubsFileDialog;
313 class OpenDialog: public wxFrame
317 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
318 int i_access_method, int i_arg = 0 );
320 /* Extended Contructor */
321 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
322 int i_access_method, int i_arg = 0 , int _i_method = 0 );
323 virtual ~OpenDialog();
326 int Show( int i_access_method, int i_arg = 0 );
329 void UpdateMRL( int i_access_method );
334 wxPanel *FilePanel( wxWindow* parent );
335 wxPanel *DiscPanel( wxWindow* parent );
336 wxPanel *NetPanel( wxWindow* parent );
337 wxPanel *V4LPanel( wxWindow* parent );
339 ArrayOfAutoBuiltPanel input_tab_array;
341 /* Event handlers (these functions should _not_ be virtual) */
342 void OnOk( wxCommandEvent& event );
343 void OnCancel( wxCommandEvent& event );
345 void OnPageChange( wxNotebookEvent& event );
346 void OnMRLChange( wxCommandEvent& event );
348 /* Event handlers for the file page */
349 void OnFilePanelChange( wxCommandEvent& event );
350 void OnFileBrowse( wxCommandEvent& event );
352 /* Event handlers for the disc page */
353 void OnDiscPanelChange( wxCommandEvent& event );
354 void OnDiscTypeChange( wxCommandEvent& event );
355 void OnDiscDeviceChange( wxCommandEvent& event );
357 /* Event handlers for the net page */
358 void OnNetPanelChange( wxCommandEvent& event );
359 void OnNetTypeChange( wxCommandEvent& event );
361 /* Event handlers for the v4l page */
362 void OnV4LPanelChange( wxCommandEvent& event );
363 void OnV4LTypeChange( wxCommandEvent& event );
364 void OnV4LSettingsChange( wxCommandEvent& event );
366 /* Event handlers for the stream output */
367 void OnSubsFileEnable( wxCommandEvent& event );
368 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
370 /* Event handlers for the stream output */
371 void OnSoutEnable( wxCommandEvent& event );
372 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
374 DECLARE_EVENT_TABLE();
376 intf_thread_t *p_intf;
378 int i_current_access_method;
379 int i_disc_type_selection;
381 int i_method; /* Normal or for the stream dialog ? */
384 wxComboBox *mrl_combo;
385 wxNotebook *notebook;
387 /* Controls for the file panel */
388 wxComboBox *file_combo;
389 wxFileDialog *file_dialog;
391 /* Controls for the disc panel */
392 wxRadioBox *disc_type;
393 wxTextCtrl *disc_device;
394 wxSpinCtrl *disc_title;
395 wxSpinCtrl *disc_chapter;
397 /* The media equivalent name for a DVD names. For example,
398 "Title", is "Track" for a CD-DA */
399 wxStaticText *disc_title_label;
400 wxStaticText *disc_chapter_label;
402 /* Indicates if the disc device control was modified */
403 bool b_disc_device_changed;
405 /* Controls for the net panel */
406 wxRadioBox *net_type;
408 wxPanel *net_subpanels[4];
409 wxRadioButton *net_radios[4];
410 wxSpinCtrl *net_ports[4];
412 wxTextCtrl *net_addrs[4];
413 wxCheckBox *net_ipv6;
415 /* Controls for the v4l panel */
416 wxRadioBox *video_type;
417 wxTextCtrl *video_device;
418 wxSpinCtrl *video_channel;
419 wxButton *v4l_button;
420 V4LDialog *v4l_dialog;
421 wxArrayString v4l_mrl;
423 /* Controls for the subtitles file */
424 wxButton *subsfile_button;
425 wxCheckBox *subsfile_checkbox;
426 SubsFileDialog *subsfile_dialog;
427 wxArrayString subsfile_mrl;
429 /* Controls for the stream output */
430 wxButton *sout_button;
431 wxCheckBox *sout_checkbox;
432 SoutDialog *sout_dialog;
433 wxArrayString sout_mrl;
449 class V4LDialog: public wxDialog
453 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
454 virtual ~V4LDialog();
456 wxArrayString GetOptions();
460 wxPanel *AudioPanel( wxWindow* parent );
461 wxPanel *CommonPanel( wxWindow* parent );
462 wxPanel *BitratePanel( wxWindow* parent );
465 /* Event handlers (these functions should _not_ be virtual) */
466 void OnOk( wxCommandEvent& event );
467 void OnCancel( wxCommandEvent& event );
468 void OnMRLChange( wxCommandEvent& event );
469 void OnAudioEnable( wxCommandEvent& event );
470 void OnAudioChange( wxCommandEvent& event );
471 void OnAudioChannel( wxCommandEvent& event );
472 void OnSizeEnable( wxCommandEvent& event );
473 void OnSize( wxCommandEvent& event );
474 void OnNormEnable( wxCommandEvent& event );
475 void OnNorm( wxCommandEvent& event );
476 void OnFrequencyEnable( wxCommandEvent& event );
477 void OnFrequency( wxCommandEvent& event );
478 void OnBitrateEnable( wxCommandEvent& event );
479 void OnBitrate( wxCommandEvent& event );
480 void OnMaxBitrateEnable( wxCommandEvent& event );
481 void OnMaxBitrate( wxCommandEvent& event );
483 DECLARE_EVENT_TABLE();
485 intf_thread_t *p_intf;
488 wxComboBox *mrl_combo;
492 /* Controls for the v4l advanced options */
493 wxPanel *common_subpanel;
494 wxPanel *common_panel;
495 wxCheckBox *size_checkbox;
496 wxComboBox *size_combo;
497 wxCheckBox *norm_checkbox;
498 wxComboBox *norm_combo;
499 wxCheckBox *frequency_checkbox;
500 wxSpinCtrl *frequency;
502 wxPanel *audio_subpanel;
503 wxPanel *audio_panel;
504 wxCheckBox *audio_checkbox;
505 wxTextCtrl *audio_device;
506 wxSpinCtrl *audio_channel;
508 wxPanel *bitrate_subpanel;
509 wxPanel *bitrate_panel;
510 wxCheckBox *bitrate_checkbox;
512 wxCheckBox *maxbitrate_checkbox;
513 wxSpinCtrl *maxbitrate;
517 /* Stream output Dialog */
531 TS_ENCAPSULATION = 0,
549 class SoutDialog: public wxDialog
553 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
554 virtual ~SoutDialog();
556 wxArrayString GetOptions();
560 wxPanel *AccessPanel( wxWindow* parent );
561 wxPanel *MiscPanel( wxWindow* parent );
562 wxPanel *EncapsulationPanel( wxWindow* parent );
563 wxPanel *TranscodingPanel( wxWindow* parent );
566 /* Event handlers (these functions should _not_ be virtual) */
567 void OnOk( wxCommandEvent& event );
568 void OnCancel( wxCommandEvent& event );
569 void OnMRLChange( wxCommandEvent& event );
570 void OnAccessTypeChange( wxCommandEvent& event );
572 /* Event handlers for the file access output */
573 void OnFileChange( wxCommandEvent& event );
574 void OnFileBrowse( wxCommandEvent& event );
575 void OnFileDump( wxCommandEvent& event );
577 /* Event handlers for the net access output */
578 void OnNetChange( wxCommandEvent& event );
580 /* Event specific to the announce address */
581 void OnAnnounceAddrChange( wxCommandEvent& event );
583 /* Event handlers for the encapsulation panel */
584 void OnEncapsulationChange( wxCommandEvent& event );
586 /* Event handlers for the transcoding panel */
587 void OnTranscodingEnable( wxCommandEvent& event );
588 void OnTranscodingChange( wxCommandEvent& event );
590 /* Event handlers for the misc panel */
591 void OnSAPMiscChange( wxCommandEvent& event );
592 void OnSLPMiscChange( wxCommandEvent& event );
594 DECLARE_EVENT_TABLE();
596 intf_thread_t *p_intf;
599 wxComboBox *mrl_combo;
601 /* Controls for the access outputs */
602 wxPanel *access_panel;
603 wxPanel *access_subpanels[ACCESS_OUT_NUM];
604 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
608 wxComboBox *file_combo;
609 wxCheckBox *dump_checkbox;
610 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
611 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
613 /* Controls for the SAP announces */
615 wxPanel *misc_subpanels[MISC_SOUT_NUM];
616 wxCheckBox *sap_checkbox;
617 wxCheckBox *slp_checkbox;
618 wxTextCtrl *announce_addr;
620 /* Controls for the encapsulation */
621 wxPanel *encapsulation_panel;
622 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
623 int i_encapsulation_type;
625 /* Controls for transcoding */
626 wxPanel *transcoding_panel;
627 wxCheckBox *video_transc_checkbox;
628 wxComboBox *video_codec_combo;
629 wxComboBox *audio_codec_combo;
630 wxCheckBox *audio_transc_checkbox;
631 wxComboBox *video_bitrate_combo;
632 wxComboBox *audio_bitrate_combo;
633 wxComboBox *audio_channels_combo;
634 wxComboBox *video_scale_combo;
637 /* Subtitles File Dialog */
638 class SubsFileDialog: public wxDialog
642 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
643 virtual ~SubsFileDialog();
645 wxComboBox *file_combo;
646 wxComboBox *encoding_combo;
647 wxSpinCtrl *delay_spinctrl;
648 wxSpinCtrl *fps_spinctrl;
651 /* Event handlers (these functions should _not_ be virtual) */
652 void OnOk( wxCommandEvent& event );
653 void OnCancel( wxCommandEvent& event );
654 void OnFileBrowse( wxCommandEvent& event );
656 DECLARE_EVENT_TABLE();
658 intf_thread_t *p_intf;
663 class StreamDialog: public wxFrame
667 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
668 virtual ~StreamDialog();
671 void OnClose( wxCommandEvent& event );
672 void OnOpen( wxCommandEvent& event );
673 void OnSout( wxCommandEvent& event );
674 void OnStart( wxCommandEvent& event );
676 DECLARE_EVENT_TABLE();
678 intf_thread_t *p_intf;
680 wxStaticText *step2_label;
681 wxStaticText *step3_label;
682 wxButton *sout_button;
683 wxButton *start_button;
685 wxArrayString sout_mrl;
686 OpenDialog *p_open_dialog;
687 SoutDialog *p_sout_dialog;
692 /* Preferences Dialog */
694 class PrefsDialog: public wxFrame
698 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
699 virtual ~PrefsDialog();
702 wxPanel *PrefsPanel( wxWindow* parent );
704 /* Event handlers (these functions should _not_ be virtual) */
705 void OnOk( wxCommandEvent& event );
706 void OnCancel( wxCommandEvent& event );
707 void OnSave( wxCommandEvent& event );
708 void OnResetAll( wxCommandEvent& event );
709 void OnAdvanced( wxCommandEvent& event );
711 DECLARE_EVENT_TABLE();
713 intf_thread_t *p_intf;
715 PrefsTreeCtrl *prefs_tree;
719 class Messages: public wxFrame
723 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
725 bool Show( bool show = TRUE );
729 /* Event handlers (these functions should _not_ be virtual) */
730 void OnClose( wxCommandEvent& event );
731 void OnClear( wxCommandEvent& event );
732 void OnSaveLog( wxCommandEvent& event );
734 DECLARE_EVENT_TABLE();
736 intf_thread_t *p_intf;
737 wxTextCtrl *textctrl;
738 wxTextAttr *info_attr;
739 wxTextAttr *err_attr;
740 wxTextAttr *warn_attr;
741 wxTextAttr *dbg_attr;
743 wxFileDialog *save_log_dialog;
745 vlc_bool_t b_verbose;
749 class ItemInfoDialog;
751 class ExportPlaylist;
752 class Playlist: public wxFrame
756 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
759 void UpdatePlaylist();
760 void ShowPlaylist( bool show );
761 void UpdateItem( int );
766 void DeleteItem( int item );
767 void ShowInfos( int item );
769 /* Event handlers (these functions should _not_ be virtual) */
770 void OnAddFile( wxCommandEvent& event );
771 void OnAddMRL( wxCommandEvent& event );
772 void OnClose( wxCommandEvent& event );
773 void OnSearch( wxCommandEvent& event );
774 void OnEnDis( wxCommandEvent& event );
775 void OnInfos( wxCommandEvent& event );
776 void OnSearchTextChange( wxCommandEvent& event );
777 void OnOpen( wxCommandEvent& event );
778 void OnSave( wxCommandEvent& event );
780 void OnSort( wxCommandEvent& event );
781 void OnColSelect( wxListEvent& event );
783 void OnUp( wxCommandEvent& event);
784 void OnDown( wxCommandEvent& event);
786 void OnEnableSelection( wxCommandEvent& event );
787 void OnDisableSelection( wxCommandEvent& event );
788 void OnInvertSelection( wxCommandEvent& event );
789 void OnDeleteSelection( wxCommandEvent& event );
790 void OnSelectAll( wxCommandEvent& event );
791 void OnRandom( wxCommandEvent& event );
792 void OnRepeat( wxCommandEvent& event );
793 void OnLoop ( wxCommandEvent& event );
794 void OnActivateItem( wxListEvent& event );
795 void OnKeyDown( wxListEvent& event );
796 void OnNewGroup( wxCommandEvent& event );
798 /* Popup functions */
799 void OnPopup( wxListEvent& event );
800 void OnPopupPlay( wxMenuEvent& event );
801 void OnPopupDel( wxMenuEvent& event );
802 void OnPopupEna( wxMenuEvent& event );
803 void OnPopupInfo( wxMenuEvent& event );
807 void OnPlaylistEvent( wxCommandEvent& event );
809 wxTextCtrl *search_text;
810 wxButton *search_button;
811 DECLARE_EVENT_TABLE();
815 ItemInfoDialog *iteminfo_dialog;
817 intf_thread_t *p_intf;
818 wxListView *listview;
819 wxTreeCtrl *treeview;
820 int i_update_counter;
828 int i_duration_sorted;
832 class NewGroup: public wxDialog
836 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
841 /* Event handlers (these functions should _not_ be virtual) */
842 void OnOk( wxCommandEvent& event );
843 void OnCancel( wxCommandEvent& event );
845 DECLARE_EVENT_TABLE();
847 intf_thread_t *p_intf;
848 wxTextCtrl *groupname;
851 friend class Playlist;
852 friend class ItemInfoDialog;
856 /* ItemInfo Dialog */
857 class ItemInfoDialog: public wxDialog
861 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
862 wxWindow *p_parent );
863 virtual ~ItemInfoDialog();
865 wxArrayString GetOptions();
868 wxPanel *InfoPanel( wxWindow* parent );
869 wxPanel *GroupPanel( wxWindow* parent );
871 /* Event handlers (these functions should _not_ be virtual) */
872 void OnOk( wxCommandEvent& event );
873 void OnCancel( wxCommandEvent& event );
874 void OnNewGroup( wxCommandEvent& event );
878 DECLARE_EVENT_TABLE();
880 intf_thread_t *p_intf;
881 playlist_item_t *p_item;
884 /* Controls for the iteminfo dialog box */
885 wxPanel *info_subpanel;
888 wxPanel *group_subpanel;
889 wxPanel *group_panel;
891 wxTextCtrl *uri_text;
892 wxTextCtrl *name_text;
893 wxTextCtrl *author_text;
895 wxTreeCtrl *info_tree;
896 wxTreeItemId info_root;
898 wxCheckBox *enabled_checkbox;
899 wxComboBox *group_combo;
905 class FileInfo: public wxFrame
909 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
911 void UpdateFileInfo();
914 void OnClose( wxCommandEvent& event );
916 DECLARE_EVENT_TABLE();
918 intf_thread_t *p_intf;
919 wxTreeCtrl *fileinfo_tree;
920 wxTreeItemId fileinfo_root;
921 wxString fileinfo_root_label;
926 #if !defined(__WXX11__)
927 /* Drag and Drop class */
928 class DragAndDrop: public wxFileDropTarget
931 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
933 virtual bool OnDropFiles( wxCoord x, wxCoord y,
934 const wxArrayString& filenames );
937 intf_thread_t *p_intf;
938 vlc_bool_t b_enqueue;
943 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
944 const wxPoint& pos );
945 wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
946 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
947 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
948 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
950 class MenuEvtHandler : public wxEvtHandler
953 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
954 virtual ~MenuEvtHandler();
956 void OnMenuEvent( wxCommandEvent& event );
957 void OnShowDialog( wxCommandEvent& event );
961 DECLARE_EVENT_TABLE()
963 intf_thread_t *p_intf;
964 Interface *p_main_interface;
967 class Menu: public wxMenu
971 Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
972 char **ppsz_names, int *pi_objects, int i_start_id );
976 /* Event handlers (these functions should _not_ be virtual) */
977 void OnClose( wxCommandEvent& event );
978 void OnShowDialog( wxCommandEvent& event );
979 void OnEntrySelected( wxCommandEvent& event );
981 wxMenu *Menu::CreateDummyMenu();
982 void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
983 wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t *, bool );
985 DECLARE_EVENT_TABLE();
987 intf_thread_t *p_intf;
992 static inline int ConvertHotkeyModifiers( int i_hotkey )
994 int i_accel_flags = 0;
995 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
996 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
997 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
998 return i_accel_flags;
1001 static inline int ConvertHotkey( int i_hotkey )
1003 int i_key = i_hotkey & ~KEY_MODIFIER;
1004 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
1005 else if( i_key & KEY_SPECIAL )
1009 case KEY_LEFT: return WXK_LEFT;
1010 case KEY_RIGHT: return WXK_RIGHT;
1011 case KEY_UP: return WXK_UP;
1012 case KEY_DOWN: return WXK_DOWN;
1013 case KEY_SPACE: return WXK_SPACE;
1014 case KEY_ENTER: return WXK_RETURN;
1015 case KEY_F1: return WXK_F1;
1016 case KEY_F2: return WXK_F2;
1017 case KEY_F3: return WXK_F3;
1018 case KEY_F4: return WXK_F4;
1019 case KEY_F5: return WXK_F5;
1020 case KEY_F6: return WXK_F6;
1021 case KEY_F7: return WXK_F7;
1022 case KEY_F8: return WXK_F8;
1023 case KEY_F9: return WXK_F9;
1024 case KEY_F10: return WXK_F10;
1025 case KEY_F11: return WXK_F11;
1026 case KEY_F12: return WXK_F12;
1027 case KEY_HOME: return WXK_HOME;
1028 case KEY_END: return WXK_HOME;
1029 case KEY_MENU: return WXK_MENU;
1030 case KEY_ESC: return WXK_ESCAPE;
1031 case KEY_PAGEUP: return WXK_PRIOR;
1032 case KEY_PAGEDOWN: return WXK_NEXT;
1033 case KEY_TAB: return WXK_TAB;
1034 case KEY_BACKSPACE: return WXK_BACK;