1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999-2004 VideoLAN
5 * $Id: wxwindows.h,v 1.89 2004/02/16 17:14:39 zorglub Exp $
7 * Authors: Gildas Bazin <gbazin@netcourrier.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 #ifdef WIN32 /* mingw32 hack */
29 /* Let vlc take care of the i18n stuff */
30 #define WXINTL_NO_GETTEXT_MACRO
32 #include <wx/wxprec.h>
35 #include <wx/listctrl.h>
36 #include <wx/textctrl.h>
37 #include <wx/notebook.h>
38 #include <wx/spinctrl.h>
40 #include <wx/treectrl.h>
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 ? */
380 wxComboBox *mrl_combo;
381 wxNotebook *notebook;
383 /* Controls for the file panel */
384 wxComboBox *file_combo;
385 wxFileDialog *file_dialog;
387 /* Controls for the disc panel */
388 wxRadioBox *disc_type;
389 wxTextCtrl *disc_device;
390 wxSpinCtrl *disc_title;
391 wxSpinCtrl *disc_chapter;
393 /* The media equivalent name for a DVD names. For example,
394 "Title", is "Track" for a CD-DA */
395 wxStaticText *disc_title_label;
396 wxStaticText *disc_chapter_label;
398 /* Indicates if the disc device control was modified */
399 bool b_disc_device_changed;
401 /* Controls for the net panel */
402 wxRadioBox *net_type;
404 wxPanel *net_subpanels[4];
405 wxRadioButton *net_radios[4];
406 wxSpinCtrl *net_ports[4];
408 wxTextCtrl *net_addrs[4];
409 wxCheckBox *net_ipv6;
411 /* Controls for the v4l panel */
412 wxRadioBox *video_type;
413 wxTextCtrl *video_device;
414 wxSpinCtrl *video_channel;
415 wxButton *v4l_button;
416 V4LDialog *v4l_dialog;
417 wxArrayString v4l_mrl;
419 /* Controls for the subtitles file */
420 wxButton *subsfile_button;
421 wxCheckBox *subsfile_checkbox;
422 SubsFileDialog *subsfile_dialog;
423 wxArrayString subsfile_mrl;
425 /* Controls for the stream output */
426 wxButton *sout_button;
427 wxCheckBox *sout_checkbox;
428 SoutDialog *sout_dialog;
429 wxArrayString sout_mrl;
445 class V4LDialog: public wxDialog
449 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
450 virtual ~V4LDialog();
452 wxArrayString GetOptions();
456 wxPanel *AudioPanel( wxWindow* parent );
457 wxPanel *CommonPanel( wxWindow* parent );
458 wxPanel *BitratePanel( wxWindow* parent );
461 /* Event handlers (these functions should _not_ be virtual) */
462 void OnOk( wxCommandEvent& event );
463 void OnCancel( wxCommandEvent& event );
464 void OnMRLChange( wxCommandEvent& event );
465 void OnAudioEnable( wxCommandEvent& event );
466 void OnAudioChange( wxCommandEvent& event );
467 void OnAudioChannel( wxCommandEvent& event );
468 void OnSizeEnable( wxCommandEvent& event );
469 void OnSize( wxCommandEvent& event );
470 void OnNormEnable( wxCommandEvent& event );
471 void OnNorm( wxCommandEvent& event );
472 void OnFrequencyEnable( wxCommandEvent& event );
473 void OnFrequency( wxCommandEvent& event );
474 void OnBitrateEnable( wxCommandEvent& event );
475 void OnBitrate( wxCommandEvent& event );
476 void OnMaxBitrateEnable( wxCommandEvent& event );
477 void OnMaxBitrate( wxCommandEvent& event );
479 DECLARE_EVENT_TABLE();
481 intf_thread_t *p_intf;
484 wxComboBox *mrl_combo;
488 /* Controls for the v4l advanced options */
489 wxPanel *common_subpanel;
490 wxPanel *common_panel;
491 wxCheckBox *size_checkbox;
492 wxComboBox *size_combo;
493 wxCheckBox *norm_checkbox;
494 wxComboBox *norm_combo;
495 wxCheckBox *frequency_checkbox;
496 wxSpinCtrl *frequency;
498 wxPanel *audio_subpanel;
499 wxPanel *audio_panel;
500 wxCheckBox *audio_checkbox;
501 wxTextCtrl *audio_device;
502 wxSpinCtrl *audio_channel;
504 wxPanel *bitrate_subpanel;
505 wxPanel *bitrate_panel;
506 wxCheckBox *bitrate_checkbox;
508 wxCheckBox *maxbitrate_checkbox;
509 wxSpinCtrl *maxbitrate;
513 /* Stream output Dialog */
527 TS_ENCAPSULATION = 0,
545 class SoutDialog: public wxDialog
549 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
550 virtual ~SoutDialog();
552 wxArrayString GetOptions();
556 wxPanel *AccessPanel( wxWindow* parent );
557 wxPanel *MiscPanel( wxWindow* parent );
558 wxPanel *EncapsulationPanel( wxWindow* parent );
559 wxPanel *TranscodingPanel( wxWindow* parent );
562 /* Event handlers (these functions should _not_ be virtual) */
563 void OnOk( wxCommandEvent& event );
564 void OnCancel( wxCommandEvent& event );
565 void OnMRLChange( wxCommandEvent& event );
566 void OnAccessTypeChange( wxCommandEvent& event );
568 /* Event handlers for the file access output */
569 void OnFileChange( wxCommandEvent& event );
570 void OnFileBrowse( wxCommandEvent& event );
571 void OnFileDump( wxCommandEvent& event );
573 /* Event handlers for the net access output */
574 void OnNetChange( wxCommandEvent& event );
576 /* Event specific to the announce address */
577 void OnAnnounceAddrChange( wxCommandEvent& event );
579 /* Event handlers for the encapsulation panel */
580 void OnEncapsulationChange( wxCommandEvent& event );
582 /* Event handlers for the transcoding panel */
583 void OnTranscodingEnable( wxCommandEvent& event );
584 void OnTranscodingChange( wxCommandEvent& event );
586 /* Event handlers for the misc panel */
587 void OnSAPMiscChange( wxCommandEvent& event );
588 void OnSLPMiscChange( wxCommandEvent& event );
590 DECLARE_EVENT_TABLE();
592 intf_thread_t *p_intf;
595 wxComboBox *mrl_combo;
597 /* Controls for the access outputs */
598 wxPanel *access_panel;
599 wxPanel *access_subpanels[ACCESS_OUT_NUM];
600 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
604 wxComboBox *file_combo;
605 wxCheckBox *dump_checkbox;
606 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
607 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
609 /* Controls for the SAP announces */
611 wxPanel *misc_subpanels[MISC_SOUT_NUM];
612 wxCheckBox *sap_checkbox;
613 wxCheckBox *slp_checkbox;
614 wxTextCtrl *announce_addr;
616 /* Controls for the encapsulation */
617 wxPanel *encapsulation_panel;
618 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
619 int i_encapsulation_type;
621 /* Controls for transcoding */
622 wxPanel *transcoding_panel;
623 wxCheckBox *video_transc_checkbox;
624 wxComboBox *video_codec_combo;
625 wxComboBox *audio_codec_combo;
626 wxCheckBox *audio_transc_checkbox;
627 wxComboBox *video_bitrate_combo;
628 wxComboBox *audio_bitrate_combo;
629 wxComboBox *audio_channels_combo;
630 wxComboBox *video_scale_combo;
633 /* Subtitles File Dialog */
634 class SubsFileDialog: public wxDialog
638 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
639 virtual ~SubsFileDialog();
641 wxComboBox *file_combo;
642 wxComboBox *encoding_combo;
643 wxSpinCtrl *delay_spinctrl;
644 wxSpinCtrl *fps_spinctrl;
647 /* Event handlers (these functions should _not_ be virtual) */
648 void OnOk( wxCommandEvent& event );
649 void OnCancel( wxCommandEvent& event );
650 void OnFileBrowse( wxCommandEvent& event );
652 DECLARE_EVENT_TABLE();
654 intf_thread_t *p_intf;
659 class StreamDialog: public wxFrame
663 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
664 virtual ~StreamDialog();
667 void OnClose( wxCommandEvent& event );
668 void OnOpen( wxCommandEvent& event );
669 void OnSout( wxCommandEvent& event );
670 void OnStart( wxCommandEvent& event );
672 DECLARE_EVENT_TABLE();
674 intf_thread_t *p_intf;
676 wxStaticText *step2_label;
677 wxStaticText *step3_label;
678 wxButton *sout_button;
679 wxButton *start_button;
681 wxArrayString sout_mrl;
682 OpenDialog *p_open_dialog;
683 SoutDialog *p_sout_dialog;
688 /* Preferences Dialog */
690 class PrefsDialog: public wxFrame
694 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
695 virtual ~PrefsDialog();
698 wxPanel *PrefsPanel( wxWindow* parent );
700 /* Event handlers (these functions should _not_ be virtual) */
701 void OnOk( wxCommandEvent& event );
702 void OnCancel( wxCommandEvent& event );
703 void OnSave( wxCommandEvent& event );
704 void OnResetAll( wxCommandEvent& event );
705 void OnAdvanced( wxCommandEvent& event );
707 DECLARE_EVENT_TABLE();
709 intf_thread_t *p_intf;
711 PrefsTreeCtrl *prefs_tree;
715 class Messages: public wxFrame
719 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
721 bool Show( bool show = TRUE );
725 /* Event handlers (these functions should _not_ be virtual) */
726 void OnClose( wxCommandEvent& event );
727 void OnClear( wxCommandEvent& event );
728 void OnSaveLog( wxCommandEvent& event );
730 DECLARE_EVENT_TABLE();
732 intf_thread_t *p_intf;
733 wxTextCtrl *textctrl;
734 wxTextAttr *info_attr;
735 wxTextAttr *err_attr;
736 wxTextAttr *warn_attr;
737 wxTextAttr *dbg_attr;
739 wxFileDialog *save_log_dialog;
741 vlc_bool_t b_verbose;
745 class ItemInfoDialog;
747 class ExportPlaylist;
748 class Playlist: public wxFrame
752 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
755 void UpdatePlaylist();
756 void ShowPlaylist( bool show );
757 void UpdateItem( int );
763 void DeleteItem( int item );
764 void ShowInfos( int item );
766 /* Event handlers (these functions should _not_ be virtual) */
767 void OnAddFile( wxCommandEvent& event );
768 void OnAddMRL( wxCommandEvent& event );
769 void OnClose( wxCommandEvent& event );
770 void OnSearch( wxCommandEvent& event );
771 void OnEnDis( wxCommandEvent& event );
772 void OnInfos( wxCommandEvent& event );
773 void OnSearchTextChange( wxCommandEvent& event );
774 void OnOpen( wxCommandEvent& event );
775 void OnSave( wxCommandEvent& event );
777 void OnSort( wxCommandEvent& event );
778 void OnColSelect( wxListEvent& event );
780 void OnUp( wxCommandEvent& event);
781 void OnDown( wxCommandEvent& event);
783 void OnEnableSelection( wxCommandEvent& event );
784 void OnDisableSelection( wxCommandEvent& event );
785 void OnInvertSelection( wxCommandEvent& event );
786 void OnDeleteSelection( wxCommandEvent& event );
787 void OnSelectAll( wxCommandEvent& event );
788 void OnRandom( wxCommandEvent& event );
789 void OnRepeat( wxCommandEvent& event );
790 void OnLoop ( wxCommandEvent& event );
791 void OnActivateItem( wxListEvent& event );
792 void OnKeyDown( wxListEvent& event );
793 void OnNewGroup( wxCommandEvent& event );
795 /* Popup functions */
796 void OnPopup( wxListEvent& event );
797 void OnPopupPlay( wxMenuEvent& event );
798 void OnPopupDel( wxMenuEvent& event );
799 void OnPopupEna( wxMenuEvent& event );
800 void OnPopupInfo( wxMenuEvent& event );
803 wxTextCtrl *search_text;
804 wxButton *search_button;
805 DECLARE_EVENT_TABLE();
809 ItemInfoDialog *iteminfo_dialog;
811 intf_thread_t *p_intf;
812 wxListView *listview;
813 wxTreeCtrl *treeview;
814 int i_update_counter;
822 int i_duration_sorted;
826 class NewGroup: public wxDialog
830 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
835 /* Event handlers (these functions should _not_ be virtual) */
836 void OnOk( wxCommandEvent& event );
837 void OnCancel( wxCommandEvent& event );
839 DECLARE_EVENT_TABLE();
841 intf_thread_t *p_intf;
842 wxTextCtrl *groupname;
845 friend class Playlist;
846 friend class ItemInfoDialog;
850 /* ItemInfo Dialog */
851 class ItemInfoDialog: public wxDialog
855 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
856 wxWindow *p_parent );
857 virtual ~ItemInfoDialog();
859 wxArrayString GetOptions();
862 wxPanel *InfoPanel( wxWindow* parent );
863 wxPanel *GroupPanel( wxWindow* parent );
865 /* Event handlers (these functions should _not_ be virtual) */
866 void OnOk( wxCommandEvent& event );
867 void OnCancel( wxCommandEvent& event );
868 void OnNewGroup( wxCommandEvent& event );
872 DECLARE_EVENT_TABLE();
874 intf_thread_t *p_intf;
875 playlist_item_t *p_item;
878 /* Controls for the iteminfo dialog box */
879 wxPanel *info_subpanel;
882 wxPanel *group_subpanel;
883 wxPanel *group_panel;
885 wxTextCtrl *uri_text;
886 wxTextCtrl *name_text;
887 wxTextCtrl *author_text;
889 wxTreeCtrl *info_tree;
890 wxTreeItemId info_root;
892 wxCheckBox *enabled_checkbox;
893 wxComboBox *group_combo;
899 class FileInfo: public wxFrame
903 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
905 void UpdateFileInfo();
908 void OnClose( wxCommandEvent& event );
910 DECLARE_EVENT_TABLE();
912 intf_thread_t *p_intf;
913 wxTreeCtrl *fileinfo_tree;
914 wxTreeItemId fileinfo_root;
915 wxString fileinfo_root_label;
920 #if !defined(__WXX11__)
921 /* Drag and Drop class */
922 class DragAndDrop: public wxFileDropTarget
925 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
927 virtual bool OnDropFiles( wxCoord x, wxCoord y,
928 const wxArrayString& filenames );
931 intf_thread_t *p_intf;
932 vlc_bool_t b_enqueue;
937 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
938 const wxPoint& pos );
939 wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
940 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
941 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
942 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
944 class MenuEvtHandler : public wxEvtHandler
947 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
948 virtual ~MenuEvtHandler();
950 void OnMenuEvent( wxCommandEvent& event );
951 void OnShowDialog( wxCommandEvent& event );
955 DECLARE_EVENT_TABLE()
957 intf_thread_t *p_intf;
958 Interface *p_main_interface;
961 class Menu: public wxMenu
965 Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
966 char **ppsz_names, int *pi_objects, int i_start_id );
970 /* Event handlers (these functions should _not_ be virtual) */
971 void OnClose( wxCommandEvent& event );
972 void OnShowDialog( wxCommandEvent& event );
973 void OnEntrySelected( wxCommandEvent& event );
975 wxMenu *Menu::CreateDummyMenu();
976 void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
977 wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t * );
979 DECLARE_EVENT_TABLE();
981 intf_thread_t *p_intf;
986 static inline int ConvertHotkeyModifiers( int i_hotkey )
988 int i_accel_flags = 0;
989 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
990 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
991 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
992 return i_accel_flags;
995 static inline int ConvertHotkey( int i_hotkey )
997 int i_key = i_hotkey & ~KEY_MODIFIER;
998 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
999 else if( i_key & KEY_SPECIAL )
1003 case KEY_LEFT: return WXK_LEFT;
1004 case KEY_RIGHT: return WXK_RIGHT;
1005 case KEY_UP: return WXK_UP;
1006 case KEY_DOWN: return WXK_DOWN;
1007 case KEY_SPACE: return WXK_SPACE;
1008 case KEY_ENTER: return WXK_RETURN;
1009 case KEY_F1: return WXK_F1;
1010 case KEY_F2: return WXK_F2;
1011 case KEY_F3: return WXK_F3;
1012 case KEY_F4: return WXK_F4;
1013 case KEY_F5: return WXK_F5;
1014 case KEY_F6: return WXK_F6;
1015 case KEY_F7: return WXK_F7;
1016 case KEY_F8: return WXK_F8;
1017 case KEY_F9: return WXK_F9;
1018 case KEY_F10: return WXK_F10;
1019 case KEY_F11: return WXK_F11;
1020 case KEY_F12: return WXK_F12;
1021 case KEY_HOME: return WXK_HOME;
1022 case KEY_END: return WXK_HOME;
1023 case KEY_MENU: return WXK_MENU;
1024 case KEY_ESC: return WXK_ESCAPE;
1025 case KEY_PAGEUP: return WXK_PRIOR;
1026 case KEY_PAGEDOWN: return WXK_NEXT;
1027 case KEY_TAB: return WXK_TAB;
1028 case KEY_BACKSPACE: return WXK_BACK;