1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999-2004 VideoLAN
5 * $Id: wxwindows.h,v 1.87 2004/01/25 03:29:02 hartman 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
75 /* wxL2U (locale to unicode) is used to convert ansi strings to unicode
76 * strings (wchar_t) */
78 # define wxL2U(ansi) wxString(ansi, *wxConvCurrent)
80 # define wxL2U(ansi) ansi
93 wxArrayString SeparateEntries( wxString );
95 /*****************************************************************************
96 * intf_sys_t: description and status of wxwindows interface
97 *****************************************************************************/
100 /* the wx parent window */
101 wxWindow *p_wxwindow;
104 /* special actions */
105 vlc_bool_t b_playing;
107 /* The input thread */
108 input_thread_t * p_input;
111 int i_slider_pos; /* slider position */
112 int i_slider_oldpos; /* previous position */
113 vlc_bool_t b_slider_free; /* slider status */
115 /* The messages window */
116 msg_subscription_t* p_sub; /* message bank subscription */
118 /* Playlist management */
119 int i_playing; /* playlist selected item */
121 /* Send an event to show a dialog */
122 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
123 intf_dialog_args_t *p_arg );
126 wxMenu *p_popup_menu;
130 /*****************************************************************************
132 *****************************************************************************/
134 /*****************************************************************************
135 * Classes declarations.
136 *****************************************************************************/
140 class Timer: public wxTimer
144 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
147 virtual void Notify();
150 intf_thread_t *p_intf;
151 Interface *p_main_interface;
152 int i_old_playing_status;
157 class Interface: public wxFrame
161 Interface( intf_thread_t *p_intf );
162 virtual ~Interface();
163 void TogglePlayButton( int i_playing_status );
165 // wxFlexGridSizer *frame_sizer;
166 wxBoxSizer *frame_sizer;
167 wxStatusBar *statusbar;
170 wxWindow *slider_frame;
171 wxWindow *extra_frame;
172 wxStaticBox *slider_box;
176 wxStaticBox *adjust_box;
177 wxSlider *brightness_slider;
178 wxSlider *contrast_slider;
179 wxSlider *saturation_slider;
180 wxSlider *hue_slider;
181 wxSlider *gamma_slider;
183 wxStaticBox *other_box;
184 wxComboBox *ratio_combo;
189 void UpdateAcceleratorTable();
190 void CreateOurMenuBar();
191 void CreateOurToolBar();
192 void CreateOurExtraPanel();
193 void CreateOurSlider();
194 void Open( int i_access_method );
196 /* Event handlers (these functions should _not_ be virtual) */
197 void OnExit( wxCommandEvent& event );
198 void OnAbout( wxCommandEvent& event );
200 void OnOpenFileSimple( wxCommandEvent& event );
201 void OnOpenFile( wxCommandEvent& event );
202 void OnOpenDisc( wxCommandEvent& event );
203 void OnOpenNet( wxCommandEvent& event );
204 void OnOpenSat( wxCommandEvent& event );
205 void OnOpenV4L( wxCommandEvent& event );
206 void OnStream( wxCommandEvent& event );
207 void OnExtra( wxCommandEvent& event );
208 void OnShowDialog( wxCommandEvent& event );
209 void OnPlayStream( wxCommandEvent& event );
210 void OnStopStream( wxCommandEvent& event );
211 void OnSliderUpdate( wxScrollEvent& event );
212 void OnPrevStream( wxCommandEvent& event );
213 void OnNextStream( wxCommandEvent& event );
214 void OnSlowStream( wxCommandEvent& event );
215 void OnFastStream( wxCommandEvent& event );
217 void OnEnableAdjust( wxCommandEvent& event );
218 void OnHueUpdate( wxScrollEvent& event );
219 void OnContrastUpdate( wxScrollEvent& event );
220 void OnBrightnessUpdate( wxScrollEvent& event );
221 void OnSaturationUpdate( wxScrollEvent& event );
222 void OnGammaUpdate( wxScrollEvent& event );
224 void OnRatio( wxCommandEvent& event );
225 void OnEnableVisual( wxCommandEvent& event );
227 void OnMenuOpen( wxMenuEvent& event );
229 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
230 void OnContextMenu2(wxContextMenuEvent& event);
232 void OnContextMenu(wxMouseEvent& event);
234 DECLARE_EVENT_TABLE();
237 intf_thread_t *p_intf;
240 int i_old_playing_status;
242 /* For auto-generated menus */
243 wxMenu *p_settings_menu;
244 vlc_bool_t b_settings_menu;
245 wxMenu *p_audio_menu;
246 vlc_bool_t b_audio_menu;
247 wxMenu *p_video_menu;
248 vlc_bool_t b_video_menu;
249 wxMenu *p_navig_menu;
250 vlc_bool_t b_navig_menu;
255 /* Dialogs Provider */
256 class DialogsProvider: public wxFrame
260 DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
261 virtual ~DialogsProvider();
264 void Open( int i_access_method, int i_arg );
266 /* Event handlers (these functions should _not_ be virtual) */
267 void OnExit( wxCommandEvent& event );
268 void OnPlaylist( wxCommandEvent& event );
269 void OnMessages( wxCommandEvent& event );
270 void OnFileInfo( wxCommandEvent& event );
271 void OnPreferences( wxCommandEvent& event );
272 void OnStreamDialog( wxCommandEvent& event );
274 void OnOpenFileGeneric( wxCommandEvent& event );
275 void OnOpenFileSimple( wxCommandEvent& event );
276 void OnOpenFile( wxCommandEvent& event );
277 void OnOpenDisc( wxCommandEvent& event );
278 void OnOpenNet( wxCommandEvent& event );
279 void OnOpenSat( wxCommandEvent& event );
281 void OnPopupMenu( wxCommandEvent& event );
283 void OnIdle( wxIdleEvent& event );
285 void OnExitThread( wxCommandEvent& event );
287 DECLARE_EVENT_TABLE();
289 intf_thread_t *p_intf;
292 /* Secondary windows */
293 OpenDialog *p_open_dialog;
294 wxFileDialog *p_file_dialog;
295 Playlist *p_playlist_dialog;
296 Messages *p_messages_dialog;
297 FileInfo *p_fileinfo_dialog;
298 StreamDialog *p_stream_dialog;
299 wxFrame *p_prefs_dialog;
300 wxFileDialog *p_file_generic_dialog;
304 class AutoBuiltPanel;
305 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
308 class SubsFileDialog;
309 class OpenDialog: public wxFrame
313 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
314 int i_access_method, int i_arg = 0 );
316 /* Extended Contructor */
317 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
318 int i_access_method, int i_arg = 0 , int _i_method = 0 );
319 virtual ~OpenDialog();
322 int Show( int i_access_method, int i_arg = 0 );
325 void UpdateMRL( int i_access_method );
330 wxPanel *FilePanel( wxWindow* parent );
331 wxPanel *DiscPanel( wxWindow* parent );
332 wxPanel *NetPanel( wxWindow* parent );
333 wxPanel *V4LPanel( wxWindow* parent );
335 ArrayOfAutoBuiltPanel input_tab_array;
337 /* Event handlers (these functions should _not_ be virtual) */
338 void OnOk( wxCommandEvent& event );
339 void OnCancel( wxCommandEvent& event );
341 void OnPageChange( wxNotebookEvent& event );
342 void OnMRLChange( wxCommandEvent& event );
344 /* Event handlers for the file page */
345 void OnFilePanelChange( wxCommandEvent& event );
346 void OnFileBrowse( wxCommandEvent& event );
348 /* Event handlers for the disc page */
349 void OnDiscPanelChange( wxCommandEvent& event );
350 void OnDiscTypeChange( wxCommandEvent& event );
351 void OnDiscDeviceChange( wxCommandEvent& event );
353 /* Event handlers for the net page */
354 void OnNetPanelChange( wxCommandEvent& event );
355 void OnNetTypeChange( wxCommandEvent& event );
357 /* Event handlers for the v4l page */
358 void OnV4LPanelChange( wxCommandEvent& event );
359 void OnV4LTypeChange( wxCommandEvent& event );
360 void OnV4LSettingsChange( wxCommandEvent& event );
362 /* Event handlers for the stream output */
363 void OnSubsFileEnable( wxCommandEvent& event );
364 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
366 /* Event handlers for the stream output */
367 void OnSoutEnable( wxCommandEvent& event );
368 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
370 DECLARE_EVENT_TABLE();
372 intf_thread_t *p_intf;
374 int i_current_access_method;
375 int i_disc_type_selection;
377 int i_method; /* Normal or for the stream dialog ? */
378 wxComboBox *mrl_combo;
379 wxNotebook *notebook;
381 /* Controls for the file panel */
382 wxComboBox *file_combo;
383 wxFileDialog *file_dialog;
385 /* Controls for the disc panel */
386 wxRadioBox *disc_type;
387 wxTextCtrl *disc_device;
388 wxSpinCtrl *disc_title;
389 wxSpinCtrl *disc_chapter;
391 /* The media equivalent name for a DVD names. For example,
392 "Title", is "Track" for a CD-DA */
393 wxStaticText *disc_title_label;
394 wxStaticText *disc_chapter_label;
396 /* Indicates if the disc device control was modified */
397 bool b_disc_device_changed;
399 /* Controls for the net panel */
400 wxRadioBox *net_type;
402 wxPanel *net_subpanels[4];
403 wxRadioButton *net_radios[4];
404 wxSpinCtrl *net_ports[4];
406 wxTextCtrl *net_addrs[4];
407 wxCheckBox *net_ipv6;
409 /* Controls for the v4l panel */
410 wxRadioBox *video_type;
411 wxTextCtrl *video_device;
412 wxSpinCtrl *video_channel;
413 wxButton *v4l_button;
414 V4LDialog *v4l_dialog;
415 wxArrayString v4l_mrl;
417 /* Controls for the subtitles file */
418 wxButton *subsfile_button;
419 wxCheckBox *subsfile_checkbox;
420 SubsFileDialog *subsfile_dialog;
421 wxArrayString subsfile_mrl;
423 /* Controls for the stream output */
424 wxButton *sout_button;
425 wxCheckBox *sout_checkbox;
426 SoutDialog *sout_dialog;
427 wxArrayString sout_mrl;
443 class V4LDialog: public wxDialog
447 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
448 virtual ~V4LDialog();
450 wxArrayString GetOptions();
454 wxPanel *AudioPanel( wxWindow* parent );
455 wxPanel *CommonPanel( wxWindow* parent );
456 wxPanel *BitratePanel( wxWindow* parent );
459 /* Event handlers (these functions should _not_ be virtual) */
460 void OnOk( wxCommandEvent& event );
461 void OnCancel( wxCommandEvent& event );
462 void OnMRLChange( wxCommandEvent& event );
463 void OnAudioEnable( wxCommandEvent& event );
464 void OnAudioChange( wxCommandEvent& event );
465 void OnAudioChannel( wxCommandEvent& event );
466 void OnSizeEnable( wxCommandEvent& event );
467 void OnSize( wxCommandEvent& event );
468 void OnNormEnable( wxCommandEvent& event );
469 void OnNorm( wxCommandEvent& event );
470 void OnFrequencyEnable( wxCommandEvent& event );
471 void OnFrequency( wxCommandEvent& event );
472 void OnBitrateEnable( wxCommandEvent& event );
473 void OnBitrate( wxCommandEvent& event );
474 void OnMaxBitrateEnable( wxCommandEvent& event );
475 void OnMaxBitrate( wxCommandEvent& event );
477 DECLARE_EVENT_TABLE();
479 intf_thread_t *p_intf;
482 wxComboBox *mrl_combo;
486 /* Controls for the v4l advanced options */
487 wxPanel *common_subpanel;
488 wxPanel *common_panel;
489 wxCheckBox *size_checkbox;
490 wxComboBox *size_combo;
491 wxCheckBox *norm_checkbox;
492 wxComboBox *norm_combo;
493 wxCheckBox *frequency_checkbox;
494 wxSpinCtrl *frequency;
496 wxPanel *audio_subpanel;
497 wxPanel *audio_panel;
498 wxCheckBox *audio_checkbox;
499 wxTextCtrl *audio_device;
500 wxSpinCtrl *audio_channel;
502 wxPanel *bitrate_subpanel;
503 wxPanel *bitrate_panel;
504 wxCheckBox *bitrate_checkbox;
506 wxCheckBox *maxbitrate_checkbox;
507 wxSpinCtrl *maxbitrate;
511 /* Stream output Dialog */
525 TS_ENCAPSULATION = 0,
543 class SoutDialog: public wxDialog
547 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
548 virtual ~SoutDialog();
550 wxArrayString GetOptions();
554 wxPanel *AccessPanel( wxWindow* parent );
555 wxPanel *MiscPanel( wxWindow* parent );
556 wxPanel *EncapsulationPanel( wxWindow* parent );
557 wxPanel *TranscodingPanel( wxWindow* parent );
560 /* Event handlers (these functions should _not_ be virtual) */
561 void OnOk( wxCommandEvent& event );
562 void OnCancel( wxCommandEvent& event );
563 void OnMRLChange( wxCommandEvent& event );
564 void OnAccessTypeChange( wxCommandEvent& event );
566 /* Event handlers for the file access output */
567 void OnFileChange( wxCommandEvent& event );
568 void OnFileBrowse( wxCommandEvent& event );
569 void OnFileDump( wxCommandEvent& event );
571 /* Event handlers for the net access output */
572 void OnNetChange( wxCommandEvent& event );
574 /* Event specific to the announce address */
575 void OnAnnounceAddrChange( wxCommandEvent& event );
577 /* Event handlers for the encapsulation panel */
578 void OnEncapsulationChange( wxCommandEvent& event );
580 /* Event handlers for the transcoding panel */
581 void OnTranscodingEnable( wxCommandEvent& event );
582 void OnTranscodingChange( wxCommandEvent& event );
584 /* Event handlers for the misc panel */
585 void OnSAPMiscChange( wxCommandEvent& event );
586 void OnSLPMiscChange( wxCommandEvent& event );
588 DECLARE_EVENT_TABLE();
590 intf_thread_t *p_intf;
593 wxComboBox *mrl_combo;
595 /* Controls for the access outputs */
596 wxPanel *access_panel;
597 wxPanel *access_subpanels[ACCESS_OUT_NUM];
598 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
602 wxComboBox *file_combo;
603 wxCheckBox *dump_checkbox;
604 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
605 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
607 /* Controls for the SAP announces */
609 wxPanel *misc_subpanels[MISC_SOUT_NUM];
610 wxCheckBox *sap_checkbox;
611 wxCheckBox *slp_checkbox;
612 wxTextCtrl *announce_addr;
614 /* Controls for the encapsulation */
615 wxPanel *encapsulation_panel;
616 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
617 int i_encapsulation_type;
619 /* Controls for transcoding */
620 wxPanel *transcoding_panel;
621 wxCheckBox *video_transc_checkbox;
622 wxComboBox *video_codec_combo;
623 wxComboBox *audio_codec_combo;
624 wxCheckBox *audio_transc_checkbox;
625 wxComboBox *video_bitrate_combo;
626 wxComboBox *audio_bitrate_combo;
627 wxComboBox *audio_channels_combo;
628 wxComboBox *video_scale_combo;
631 /* Subtitles File Dialog */
632 class SubsFileDialog: public wxDialog
636 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
637 virtual ~SubsFileDialog();
639 wxComboBox *file_combo;
640 wxComboBox *encoding_combo;
641 wxSpinCtrl *delay_spinctrl;
642 wxSpinCtrl *fps_spinctrl;
645 /* Event handlers (these functions should _not_ be virtual) */
646 void OnOk( wxCommandEvent& event );
647 void OnCancel( wxCommandEvent& event );
648 void OnFileBrowse( wxCommandEvent& event );
650 DECLARE_EVENT_TABLE();
652 intf_thread_t *p_intf;
657 class StreamDialog: public wxFrame
661 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
662 virtual ~StreamDialog();
665 void OnClose( wxCommandEvent& event );
666 void OnOpen( wxCommandEvent& event );
667 void OnSout( wxCommandEvent& event );
668 void OnStart( wxCommandEvent& event );
670 DECLARE_EVENT_TABLE();
672 intf_thread_t *p_intf;
674 wxStaticText *step2_label;
675 wxStaticText *step3_label;
676 wxButton *sout_button;
677 wxButton *start_button;
679 wxArrayString sout_mrl;
680 OpenDialog *p_open_dialog;
681 SoutDialog *p_sout_dialog;
686 /* Preferences Dialog */
688 class PrefsDialog: public wxFrame
692 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
693 virtual ~PrefsDialog();
696 wxPanel *PrefsPanel( wxWindow* parent );
698 /* Event handlers (these functions should _not_ be virtual) */
699 void OnOk( wxCommandEvent& event );
700 void OnCancel( wxCommandEvent& event );
701 void OnSave( wxCommandEvent& event );
702 void OnResetAll( wxCommandEvent& event );
703 void OnAdvanced( wxCommandEvent& event );
705 DECLARE_EVENT_TABLE();
707 intf_thread_t *p_intf;
709 PrefsTreeCtrl *prefs_tree;
713 class Messages: public wxFrame
717 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
719 bool Show( bool show = TRUE );
723 /* Event handlers (these functions should _not_ be virtual) */
724 void OnClose( wxCommandEvent& event );
725 void OnClear( wxCommandEvent& event );
726 void OnSaveLog( wxCommandEvent& event );
728 DECLARE_EVENT_TABLE();
730 intf_thread_t *p_intf;
731 wxTextCtrl *textctrl;
732 wxTextAttr *info_attr;
733 wxTextAttr *err_attr;
734 wxTextAttr *warn_attr;
735 wxTextAttr *dbg_attr;
737 wxFileDialog *save_log_dialog;
739 vlc_bool_t b_verbose;
743 class ItemInfoDialog;
745 class ExportPlaylist;
746 class Playlist: public wxFrame
750 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
753 void UpdatePlaylist();
754 void ShowPlaylist( bool show );
755 void UpdateItem( int );
761 void DeleteItem( int item );
762 void ShowInfos( int item );
764 /* Event handlers (these functions should _not_ be virtual) */
765 void OnAddFile( wxCommandEvent& event );
766 void OnAddMRL( wxCommandEvent& event );
767 void OnClose( wxCommandEvent& event );
768 void OnSearch( wxCommandEvent& event );
769 void OnEnDis( wxCommandEvent& event );
770 void OnInfos( wxCommandEvent& event );
771 void OnSearchTextChange( wxCommandEvent& event );
772 void OnOpen( wxCommandEvent& event );
773 void OnSave( wxCommandEvent& event );
775 void OnSort( wxCommandEvent& event );
776 void OnColSelect( wxListEvent& event );
778 void OnUp( wxCommandEvent& event);
779 void OnDown( wxCommandEvent& event);
781 void OnEnableSelection( wxCommandEvent& event );
782 void OnDisableSelection( wxCommandEvent& event );
783 void OnInvertSelection( wxCommandEvent& event );
784 void OnDeleteSelection( wxCommandEvent& event );
785 void OnSelectAll( wxCommandEvent& event );
786 void OnRandom( wxCommandEvent& event );
787 void OnRepeat( wxCommandEvent& event );
788 void OnLoop ( wxCommandEvent& event );
789 void OnActivateItem( wxListEvent& event );
790 void OnKeyDown( wxListEvent& event );
791 void OnNewGroup( wxCommandEvent& event );
793 /* Popup functions */
794 void OnPopup( wxListEvent& event );
795 void OnPopupPlay( wxMenuEvent& event );
796 void OnPopupDel( wxMenuEvent& event );
797 void OnPopupEna( wxMenuEvent& event );
798 void OnPopupInfo( wxMenuEvent& event );
801 wxTextCtrl *search_text;
802 wxButton *search_button;
803 DECLARE_EVENT_TABLE();
807 ItemInfoDialog *iteminfo_dialog;
809 intf_thread_t *p_intf;
810 wxListView *listview;
811 wxTreeCtrl *treeview;
812 int i_update_counter;
823 class NewGroup: public wxDialog
827 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
832 /* Event handlers (these functions should _not_ be virtual) */
833 void OnOk( wxCommandEvent& event );
834 void OnCancel( wxCommandEvent& event );
836 DECLARE_EVENT_TABLE();
838 intf_thread_t *p_intf;
839 wxTextCtrl *groupname;
842 friend class Playlist;
843 friend class ItemInfoDialog;
847 /* ItemInfo Dialog */
848 class ItemInfoDialog: public wxDialog
852 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
853 wxWindow *p_parent );
854 virtual ~ItemInfoDialog();
856 wxArrayString GetOptions();
859 wxPanel *InfoPanel( wxWindow* parent );
860 wxPanel *GroupPanel( wxWindow* parent );
862 /* Event handlers (these functions should _not_ be virtual) */
863 void OnOk( wxCommandEvent& event );
864 void OnCancel( wxCommandEvent& event );
865 void OnNewGroup( wxCommandEvent& event );
869 DECLARE_EVENT_TABLE();
871 intf_thread_t *p_intf;
872 playlist_item_t *p_item;
875 /* Controls for the iteminfo dialog box */
876 wxPanel *info_subpanel;
879 wxPanel *group_subpanel;
880 wxPanel *group_panel;
882 wxTextCtrl *uri_text;
883 wxTextCtrl *name_text;
884 wxTextCtrl *author_text;
886 wxTreeCtrl *info_tree;
887 wxTreeItemId info_root;
889 wxCheckBox *enabled_checkbox;
890 wxComboBox *group_combo;
896 class FileInfo: public wxFrame
900 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
902 void UpdateFileInfo();
905 void OnClose( wxCommandEvent& event );
907 DECLARE_EVENT_TABLE();
909 intf_thread_t *p_intf;
910 wxTreeCtrl *fileinfo_tree;
911 wxTreeItemId fileinfo_root;
912 wxString fileinfo_root_label;
917 #if !defined(__WXX11__)
918 /* Drag and Drop class */
919 class DragAndDrop: public wxFileDropTarget
922 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
924 virtual bool OnDropFiles( wxCoord x, wxCoord y,
925 const wxArrayString& filenames );
928 intf_thread_t *p_intf;
929 vlc_bool_t b_enqueue;
934 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
935 const wxPoint& pos );
936 wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
937 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
938 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
939 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
941 class MenuEvtHandler : public wxEvtHandler
944 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
945 virtual ~MenuEvtHandler();
947 void OnMenuEvent( wxCommandEvent& event );
948 void OnShowDialog( wxCommandEvent& event );
952 DECLARE_EVENT_TABLE()
954 intf_thread_t *p_intf;
955 Interface *p_main_interface;
958 class Menu: public wxMenu
962 Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
963 char **ppsz_names, int *pi_objects, int i_start_id );
967 /* Event handlers (these functions should _not_ be virtual) */
968 void OnClose( wxCommandEvent& event );
969 void OnShowDialog( wxCommandEvent& event );
970 void OnEntrySelected( wxCommandEvent& event );
972 wxMenu *Menu::CreateDummyMenu();
973 void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
974 wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t * );
976 DECLARE_EVENT_TABLE();
978 intf_thread_t *p_intf;
983 static inline int ConvertHotkeyModifiers( int i_hotkey )
985 int i_accel_flags = 0;
986 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
987 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
988 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
989 return i_accel_flags;
992 static inline int ConvertHotkey( int i_hotkey )
994 int i_key = i_hotkey & ~KEY_MODIFIER;
995 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
996 else if( i_key & KEY_SPECIAL )
1000 case KEY_LEFT: return WXK_LEFT;
1001 case KEY_RIGHT: return WXK_RIGHT;
1002 case KEY_UP: return WXK_UP;
1003 case KEY_DOWN: return WXK_DOWN;
1004 case KEY_SPACE: return WXK_SPACE;
1005 case KEY_ENTER: return WXK_RETURN;
1006 case KEY_F1: return WXK_F1;
1007 case KEY_F2: return WXK_F2;
1008 case KEY_F3: return WXK_F3;
1009 case KEY_F4: return WXK_F4;
1010 case KEY_F5: return WXK_F5;
1011 case KEY_F6: return WXK_F6;
1012 case KEY_F7: return WXK_F7;
1013 case KEY_F8: return WXK_F8;
1014 case KEY_F9: return WXK_F9;
1015 case KEY_F10: return WXK_F10;
1016 case KEY_F11: return WXK_F11;
1017 case KEY_F12: return WXK_F12;
1018 case KEY_HOME: return WXK_HOME;
1019 case KEY_END: return WXK_HOME;
1020 case KEY_MENU: return WXK_MENU;
1021 case KEY_ESC: return WXK_ESCAPE;
1022 case KEY_PAGEUP: return WXK_PRIOR;
1023 case KEY_PAGEDOWN: return WXK_NEXT;
1024 case KEY_TAB: return WXK_TAB;
1025 case KEY_BACKSPACE: return WXK_BACK;