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>
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 );
53 DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
55 #define SLIDER_MAX_POS 10000
57 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
58 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
60 # define wxU(utf8) wxString(utf8, wxConvUTF8)
62 # define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
66 #else // ENABLE_NLS && ENABLE_UTF8
68 # define wxU(ansi) wxString(ansi, *wxConvCurrent)
70 # define wxU(ansi) ansi
76 /* wxL2U (locale to unicode) is used to convert ansi strings to unicode
77 * strings (wchar_t) */
79 # define wxL2U(ansi) wxString(ansi, *wxConvCurrent)
81 # define wxL2U(ansi) ansi
98 /*****************************************************************************
99 * intf_sys_t: description and status of wxwindows interface
100 *****************************************************************************/
103 /* the wx parent window */
104 wxWindow *p_wxwindow;
107 /* special actions */
108 vlc_bool_t b_playing;
110 /* The input thread */
111 input_thread_t * p_input;
114 int i_slider_pos; /* slider position */
115 int i_slider_oldpos; /* previous position */
116 vlc_bool_t b_slider_free; /* slider status */
118 /* The messages window */
119 msg_subscription_t* p_sub; /* message bank subscription */
121 /* Playlist management */
122 int i_playing; /* playlist selected item */
124 /* Send an event to show a dialog */
125 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
126 intf_dialog_args_t *p_arg );
129 wxMenu *p_popup_menu;
131 VideoWindow *p_video_window;
132 wxBoxSizer *p_video_sizer;
135 /*****************************************************************************
137 *****************************************************************************/
138 wxArrayString SeparateEntries( wxString );
139 wxWindow *VideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
140 wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
148 class SubsFileDialog;
153 class ItemInfoDialog;
155 class ExportPlaylist;
157 /*****************************************************************************
158 * Classes declarations.
159 *****************************************************************************/
161 class Timer: public wxTimer
165 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
168 virtual void Notify();
171 intf_thread_t *p_intf;
172 Interface *p_main_interface;
173 int i_old_playing_status;
178 class Interface: public wxFrame
182 Interface( intf_thread_t *p_intf );
183 virtual ~Interface();
184 void TogglePlayButton( int i_playing_status );
186 wxBoxSizer *frame_sizer;
187 wxStatusBar *statusbar;
190 wxWindow *slider_frame;
191 wxWindow *extra_frame;
195 wxStaticBox *adjust_box;
196 wxSlider *brightness_slider;
197 wxSlider *contrast_slider;
198 wxSlider *saturation_slider;
199 wxSlider *hue_slider;
200 wxSlider *gamma_slider;
202 wxStaticBox *other_box;
203 wxComboBox *ratio_combo;
208 void UpdateAcceleratorTable();
209 void CreateOurMenuBar();
210 void CreateOurToolBar();
211 void CreateOurExtendedPanel();
212 void CreateOurSlider();
213 void Open( int i_access_method );
215 /* Event handlers (these functions should _not_ be virtual) */
216 void OnExit( wxCommandEvent& event );
217 void OnAbout( wxCommandEvent& event );
219 void OnOpenFileSimple( wxCommandEvent& event );
220 void OnOpenFile( wxCommandEvent& event );
221 void OnOpenDisc( wxCommandEvent& event );
222 void OnOpenNet( wxCommandEvent& event );
223 void OnOpenSat( wxCommandEvent& event );
224 void OnOpenV4L( wxCommandEvent& event );
225 void OnExtended( wxCommandEvent& event );
226 void OnBookmarks( wxCommandEvent& event );
227 void OnShowDialog( wxCommandEvent& event );
228 void OnPlayStream( wxCommandEvent& event );
229 void OnStopStream( wxCommandEvent& event );
230 void OnSliderUpdate( wxScrollEvent& event );
231 void OnPrevStream( wxCommandEvent& event );
232 void OnNextStream( wxCommandEvent& event );
233 void OnSlowStream( wxCommandEvent& event );
234 void OnFastStream( wxCommandEvent& event );
236 void OnEnableAdjust( wxCommandEvent& event );
237 void OnHueUpdate( wxScrollEvent& event );
238 void OnContrastUpdate( wxScrollEvent& event );
239 void OnBrightnessUpdate( wxScrollEvent& event );
240 void OnSaturationUpdate( wxScrollEvent& event );
241 void OnGammaUpdate( wxScrollEvent& event );
243 void OnRatio( wxCommandEvent& event );
244 void OnEnableVisual( wxCommandEvent& event );
246 void OnMenuOpen( wxMenuEvent& event );
248 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
249 void OnContextMenu2(wxContextMenuEvent& event);
251 void OnContextMenu(wxMouseEvent& event);
253 void UpdateSizeEvent( wxCommandEvent& event );
255 DECLARE_EVENT_TABLE();
258 intf_thread_t *p_intf;
261 int i_old_playing_status;
263 /* For auto-generated menus */
264 wxMenu *p_settings_menu;
265 vlc_bool_t b_settings_menu;
266 wxMenu *p_audio_menu;
267 vlc_bool_t b_audio_menu;
268 wxMenu *p_video_menu;
269 vlc_bool_t b_video_menu;
270 wxMenu *p_navig_menu;
271 vlc_bool_t b_navig_menu;
274 /* Dialogs Provider */
275 class DialogsProvider: public wxFrame
279 DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
280 virtual ~DialogsProvider();
283 void Open( int i_access_method, int i_arg );
285 /* Event handlers (these functions should _not_ be virtual) */
286 void OnExit( wxCommandEvent& event );
287 void OnPlaylist( wxCommandEvent& event );
288 void OnMessages( wxCommandEvent& event );
289 void OnFileInfo( wxCommandEvent& event );
290 void OnPreferences( wxCommandEvent& event );
291 void OnStreamWizardDialog( wxCommandEvent& event );
292 void OnBookmarks( wxCommandEvent& event );
294 void OnOpenFileGeneric( wxCommandEvent& event );
295 void OnOpenFileSimple( wxCommandEvent& event );
296 void OnOpenFile( wxCommandEvent& event );
297 void OnOpenDisc( wxCommandEvent& event );
298 void OnOpenNet( wxCommandEvent& event );
299 void OnOpenSat( wxCommandEvent& event );
301 void OnPopupMenu( wxCommandEvent& event );
303 void OnIdle( wxIdleEvent& event );
305 void OnExitThread( wxCommandEvent& event );
307 DECLARE_EVENT_TABLE();
309 intf_thread_t *p_intf;
312 /* Secondary windows */
313 OpenDialog *p_open_dialog;
314 wxFileDialog *p_file_dialog;
315 Playlist *p_playlist_dialog;
316 Messages *p_messages_dialog;
317 FileInfo *p_fileinfo_dialog;
318 StreamDialog *p_streamwizard_dialog;
319 wxFrame *p_prefs_dialog;
320 wxWindow *p_bookmarks_dialog;
321 wxFileDialog *p_file_generic_dialog;
325 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
326 class OpenDialog: public wxFrame
330 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
331 int i_access_method, int i_arg = 0 );
333 /* Extended Contructor */
334 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
335 int i_access_method, int i_arg = 0 , int _i_method = 0 );
336 virtual ~OpenDialog();
339 int Show( int i_access_method, int i_arg = 0 );
342 void UpdateMRL( int i_access_method );
347 wxPanel *FilePanel( wxWindow* parent );
348 wxPanel *DiscPanel( wxWindow* parent );
349 wxPanel *NetPanel( wxWindow* parent );
350 wxPanel *V4LPanel( wxWindow* parent );
352 ArrayOfAutoBuiltPanel input_tab_array;
354 /* Event handlers (these functions should _not_ be virtual) */
355 void OnOk( wxCommandEvent& event );
356 void OnCancel( wxCommandEvent& event );
358 void OnPageChange( wxNotebookEvent& event );
359 void OnMRLChange( wxCommandEvent& event );
361 /* Event handlers for the file page */
362 void OnFilePanelChange( wxCommandEvent& event );
363 void OnFileBrowse( wxCommandEvent& event );
365 /* Event handlers for the disc page */
366 void OnDiscPanelChange( wxCommandEvent& event );
367 void OnDiscTypeChange( wxCommandEvent& event );
368 void OnDiscDeviceChange( wxCommandEvent& event );
370 /* Event handlers for the net page */
371 void OnNetPanelChange( wxCommandEvent& event );
372 void OnNetTypeChange( wxCommandEvent& event );
374 /* Event handlers for the v4l page */
375 void OnV4LPanelChange( wxCommandEvent& event );
376 void OnV4LTypeChange( wxCommandEvent& event );
377 void OnV4LSettingsChange( wxCommandEvent& event );
379 /* Event handlers for the stream output */
380 void OnSubsFileEnable( wxCommandEvent& event );
381 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
383 /* Event handlers for the stream output */
384 void OnSoutEnable( wxCommandEvent& event );
385 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
387 DECLARE_EVENT_TABLE();
389 intf_thread_t *p_intf;
391 int i_current_access_method;
392 int i_disc_type_selection;
394 int i_method; /* Normal or for the stream dialog ? */
397 wxComboBox *mrl_combo;
398 wxNotebook *notebook;
400 /* Controls for the file panel */
401 wxComboBox *file_combo;
402 wxFileDialog *file_dialog;
404 /* Controls for the disc panel */
405 wxRadioBox *disc_type;
406 wxTextCtrl *disc_device;
407 wxSpinCtrl *disc_title;
408 wxSpinCtrl *disc_chapter;
410 /* The media equivalent name for a DVD names. For example,
411 "Title", is "Track" for a CD-DA */
412 wxStaticText *disc_title_label;
413 wxStaticText *disc_chapter_label;
415 /* Indicates if the disc device control was modified */
416 bool b_disc_device_changed;
418 /* Controls for the net panel */
419 wxRadioBox *net_type;
421 wxPanel *net_subpanels[4];
422 wxRadioButton *net_radios[4];
423 wxSpinCtrl *net_ports[4];
425 wxTextCtrl *net_addrs[4];
426 wxCheckBox *net_ipv6;
428 /* Controls for the v4l panel */
429 wxRadioBox *video_type;
430 wxTextCtrl *video_device;
431 wxSpinCtrl *video_channel;
432 wxButton *v4l_button;
433 V4LDialog *v4l_dialog;
434 wxArrayString v4l_mrl;
436 /* Controls for the subtitles file */
437 wxButton *subsfile_button;
438 wxCheckBox *subsfile_checkbox;
439 SubsFileDialog *subsfile_dialog;
440 wxArrayString subsfile_mrl;
442 /* Controls for the stream output */
443 wxButton *sout_button;
444 wxCheckBox *sout_checkbox;
445 SoutDialog *sout_dialog;
446 wxArrayString sout_mrl;
462 class V4LDialog: public wxDialog
466 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
467 virtual ~V4LDialog();
469 wxArrayString GetOptions();
473 wxPanel *AudioPanel( wxWindow* parent );
474 wxPanel *CommonPanel( wxWindow* parent );
475 wxPanel *BitratePanel( wxWindow* parent );
478 /* Event handlers (these functions should _not_ be virtual) */
479 void OnOk( wxCommandEvent& event );
480 void OnCancel( wxCommandEvent& event );
481 void OnMRLChange( wxCommandEvent& event );
482 void OnAudioEnable( wxCommandEvent& event );
483 void OnAudioChange( wxCommandEvent& event );
484 void OnAudioChannel( wxCommandEvent& event );
485 void OnSizeEnable( wxCommandEvent& event );
486 void OnSize( wxCommandEvent& event );
487 void OnNormEnable( wxCommandEvent& event );
488 void OnNorm( wxCommandEvent& event );
489 void OnFrequencyEnable( wxCommandEvent& event );
490 void OnFrequency( wxCommandEvent& event );
491 void OnBitrateEnable( wxCommandEvent& event );
492 void OnBitrate( wxCommandEvent& event );
493 void OnMaxBitrateEnable( wxCommandEvent& event );
494 void OnMaxBitrate( wxCommandEvent& event );
496 DECLARE_EVENT_TABLE();
498 intf_thread_t *p_intf;
501 wxComboBox *mrl_combo;
505 /* Controls for the v4l advanced options */
506 wxPanel *common_subpanel;
507 wxPanel *common_panel;
508 wxCheckBox *size_checkbox;
509 wxComboBox *size_combo;
510 wxCheckBox *norm_checkbox;
511 wxComboBox *norm_combo;
512 wxCheckBox *frequency_checkbox;
513 wxSpinCtrl *frequency;
515 wxPanel *audio_subpanel;
516 wxPanel *audio_panel;
517 wxCheckBox *audio_checkbox;
518 wxTextCtrl *audio_device;
519 wxSpinCtrl *audio_channel;
521 wxPanel *bitrate_subpanel;
522 wxPanel *bitrate_panel;
523 wxCheckBox *bitrate_checkbox;
525 wxCheckBox *maxbitrate_checkbox;
526 wxSpinCtrl *maxbitrate;
530 /* Stream output Dialog */
544 TS_ENCAPSULATION = 0,
562 class SoutDialog: public wxDialog
566 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
567 virtual ~SoutDialog();
569 wxArrayString GetOptions();
573 wxPanel *AccessPanel( wxWindow* parent );
574 wxPanel *MiscPanel( wxWindow* parent );
575 wxPanel *EncapsulationPanel( wxWindow* parent );
576 wxPanel *TranscodingPanel( wxWindow* parent );
579 /* Event handlers (these functions should _not_ be virtual) */
580 void OnOk( wxCommandEvent& event );
581 void OnCancel( wxCommandEvent& event );
582 void OnMRLChange( wxCommandEvent& event );
583 void OnAccessTypeChange( wxCommandEvent& event );
585 /* Event handlers for the file access output */
586 void OnFileChange( wxCommandEvent& event );
587 void OnFileBrowse( wxCommandEvent& event );
588 void OnFileDump( wxCommandEvent& event );
590 /* Event handlers for the net access output */
591 void OnNetChange( wxCommandEvent& event );
593 /* Event specific to the announce address */
594 void OnAnnounceAddrChange( wxCommandEvent& event );
596 /* Event handlers for the encapsulation panel */
597 void OnEncapsulationChange( wxCommandEvent& event );
599 /* Event handlers for the transcoding panel */
600 void OnTranscodingEnable( wxCommandEvent& event );
601 void OnTranscodingChange( wxCommandEvent& event );
603 /* Event handlers for the misc panel */
604 void OnSAPMiscChange( wxCommandEvent& event );
605 void OnSLPMiscChange( wxCommandEvent& event );
607 DECLARE_EVENT_TABLE();
609 intf_thread_t *p_intf;
612 wxComboBox *mrl_combo;
614 /* Controls for the access outputs */
615 wxPanel *access_panel;
616 wxPanel *access_subpanels[ACCESS_OUT_NUM];
617 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
621 wxComboBox *file_combo;
622 wxCheckBox *dump_checkbox;
623 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
624 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
626 /* Controls for the SAP announces */
628 wxPanel *misc_subpanels[MISC_SOUT_NUM];
629 wxCheckBox *sap_checkbox;
630 wxCheckBox *slp_checkbox;
631 wxTextCtrl *announce_addr;
633 /* Controls for the encapsulation */
634 wxPanel *encapsulation_panel;
635 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
636 int i_encapsulation_type;
638 /* Controls for transcoding */
639 wxPanel *transcoding_panel;
640 wxCheckBox *video_transc_checkbox;
641 wxComboBox *video_codec_combo;
642 wxComboBox *audio_codec_combo;
643 wxCheckBox *audio_transc_checkbox;
644 wxComboBox *video_bitrate_combo;
645 wxComboBox *audio_bitrate_combo;
646 wxComboBox *audio_channels_combo;
647 wxComboBox *video_scale_combo;
650 /* Subtitles File Dialog */
651 class SubsFileDialog: public wxDialog
655 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
656 virtual ~SubsFileDialog();
658 wxComboBox *file_combo;
659 wxComboBox *encoding_combo;
660 wxSpinCtrl *delay_spinctrl;
661 wxSpinCtrl *fps_spinctrl;
664 /* Event handlers (these functions should _not_ be virtual) */
665 void OnOk( wxCommandEvent& event );
666 void OnCancel( wxCommandEvent& event );
667 void OnFileBrowse( wxCommandEvent& event );
669 DECLARE_EVENT_TABLE();
671 intf_thread_t *p_intf;
676 class StreamDialog: public wxFrame
680 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
681 virtual ~StreamDialog();
684 void OnClose( wxCommandEvent& event );
685 void OnOpen( wxCommandEvent& event );
686 void OnSout( wxCommandEvent& event );
687 void OnStart( wxCommandEvent& event );
689 DECLARE_EVENT_TABLE();
691 intf_thread_t *p_intf;
693 wxStaticText *step2_label;
694 wxStaticText *step3_label;
695 wxButton *sout_button;
696 wxButton *start_button;
698 wxArrayString sout_mrl;
699 OpenDialog *p_open_dialog;
700 SoutDialog *p_sout_dialog;
705 /* Preferences Dialog */
706 class PrefsDialog: public wxFrame
710 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
711 virtual ~PrefsDialog();
714 wxPanel *PrefsPanel( wxWindow* parent );
716 /* Event handlers (these functions should _not_ be virtual) */
717 void OnOk( wxCommandEvent& event );
718 void OnCancel( wxCommandEvent& event );
719 void OnSave( wxCommandEvent& event );
720 void OnResetAll( wxCommandEvent& event );
721 void OnAdvanced( wxCommandEvent& event );
723 DECLARE_EVENT_TABLE();
725 intf_thread_t *p_intf;
727 PrefsTreeCtrl *prefs_tree;
731 class Messages: public wxFrame
735 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
737 bool Show( bool show = TRUE );
741 /* Event handlers (these functions should _not_ be virtual) */
742 void OnClose( wxCommandEvent& event );
743 void OnClear( wxCommandEvent& event );
744 void OnSaveLog( wxCommandEvent& event );
746 DECLARE_EVENT_TABLE();
748 intf_thread_t *p_intf;
749 wxTextCtrl *textctrl;
750 wxTextAttr *info_attr;
751 wxTextAttr *err_attr;
752 wxTextAttr *warn_attr;
753 wxTextAttr *dbg_attr;
755 wxFileDialog *save_log_dialog;
757 vlc_bool_t b_verbose;
761 class Playlist: public wxFrame
765 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
768 void UpdatePlaylist();
769 void ShowPlaylist( bool show );
770 void UpdateItem( int );
775 void DeleteItem( int item );
776 void ShowInfos( int item );
778 /* Event handlers (these functions should _not_ be virtual) */
779 void OnAddFile( wxCommandEvent& event );
780 void OnAddMRL( wxCommandEvent& event );
781 void OnClose( wxCommandEvent& event );
782 void OnSearch( wxCommandEvent& event );
783 void OnEnDis( wxCommandEvent& event );
784 void OnInfos( wxCommandEvent& event );
785 void OnSearchTextChange( wxCommandEvent& event );
786 void OnOpen( wxCommandEvent& event );
787 void OnSave( wxCommandEvent& event );
789 void OnSort( wxCommandEvent& event );
790 void OnColSelect( wxListEvent& event );
792 void OnUp( wxCommandEvent& event);
793 void OnDown( wxCommandEvent& event);
795 void OnEnableSelection( wxCommandEvent& event );
796 void OnDisableSelection( wxCommandEvent& event );
797 void OnInvertSelection( wxCommandEvent& event );
798 void OnDeleteSelection( wxCommandEvent& event );
799 void OnSelectAll( wxCommandEvent& event );
800 void OnRandom( wxCommandEvent& event );
801 void OnRepeat( wxCommandEvent& event );
802 void OnLoop ( wxCommandEvent& event );
803 void OnActivateItem( wxListEvent& event );
804 void OnKeyDown( wxListEvent& event );
805 void OnNewGroup( wxCommandEvent& event );
807 /* Popup functions */
808 void OnPopup( wxListEvent& event );
809 void OnPopupPlay( wxMenuEvent& event );
810 void OnPopupDel( wxMenuEvent& event );
811 void OnPopupEna( wxMenuEvent& event );
812 void OnPopupInfo( wxMenuEvent& event );
816 void OnPlaylistEvent( wxCommandEvent& event );
818 wxTextCtrl *search_text;
819 wxButton *search_button;
820 DECLARE_EVENT_TABLE();
824 ItemInfoDialog *iteminfo_dialog;
826 intf_thread_t *p_intf;
827 wxListView *listview;
828 wxTreeCtrl *treeview;
829 int i_update_counter;
837 int i_duration_sorted;
840 class NewGroup: public wxDialog
844 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
849 /* Event handlers (these functions should _not_ be virtual) */
850 void OnOk( wxCommandEvent& event );
851 void OnCancel( wxCommandEvent& event );
853 DECLARE_EVENT_TABLE();
855 intf_thread_t *p_intf;
856 wxTextCtrl *groupname;
859 friend class Playlist;
860 friend class ItemInfoDialog;
864 /* ItemInfo Dialog */
865 class ItemInfoDialog: public wxDialog
869 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
870 wxWindow *p_parent );
871 virtual ~ItemInfoDialog();
873 wxArrayString GetOptions();
876 wxPanel *InfoPanel( wxWindow* parent );
877 wxPanel *GroupPanel( wxWindow* parent );
879 /* Event handlers (these functions should _not_ be virtual) */
880 void OnOk( wxCommandEvent& event );
881 void OnCancel( wxCommandEvent& event );
882 void OnNewGroup( wxCommandEvent& event );
886 DECLARE_EVENT_TABLE();
888 intf_thread_t *p_intf;
889 playlist_item_t *p_item;
892 /* Controls for the iteminfo dialog box */
893 wxPanel *info_subpanel;
896 wxPanel *group_subpanel;
897 wxPanel *group_panel;
899 wxTextCtrl *uri_text;
900 wxTextCtrl *name_text;
901 wxTextCtrl *author_text;
903 wxTreeCtrl *info_tree;
904 wxTreeItemId info_root;
906 wxCheckBox *enabled_checkbox;
907 wxComboBox *group_combo;
913 class FileInfo: public wxFrame
917 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
919 void UpdateFileInfo();
922 void OnClose( wxCommandEvent& event );
924 DECLARE_EVENT_TABLE();
926 intf_thread_t *p_intf;
927 wxTreeCtrl *fileinfo_tree;
928 wxTreeItemId fileinfo_root;
929 wxString fileinfo_root_label;
934 #if !defined(__WXX11__)
935 /* Drag and Drop class */
936 class DragAndDrop: public wxFileDropTarget
939 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
941 virtual bool OnDropFiles( wxCoord x, wxCoord y,
942 const wxArrayString& filenames );
945 intf_thread_t *p_intf;
946 vlc_bool_t b_enqueue;
949 } // end of wxvlc namespace
952 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
953 const wxPoint& pos );
954 wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
955 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
956 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
957 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
961 class MenuEvtHandler : public wxEvtHandler
964 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
965 virtual ~MenuEvtHandler();
967 void OnMenuEvent( wxCommandEvent& event );
968 void OnShowDialog( wxCommandEvent& event );
972 DECLARE_EVENT_TABLE()
974 intf_thread_t *p_intf;
975 Interface *p_main_interface;
978 class Menu: public wxMenu
982 Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
983 char **ppsz_names, int *pi_objects, int i_start_id );
987 /* Event handlers (these functions should _not_ be virtual) */
988 void OnClose( wxCommandEvent& event );
989 void OnShowDialog( wxCommandEvent& event );
990 void OnEntrySelected( wxCommandEvent& event );
992 wxMenu *Menu::CreateDummyMenu();
993 void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
994 wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t *, bool );
996 DECLARE_EVENT_TABLE();
998 intf_thread_t *p_intf;
1003 } // end of wxvlc namespace
1004 using namespace wxvlc;
1006 static inline int ConvertHotkeyModifiers( int i_hotkey )
1008 int i_accel_flags = 0;
1009 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
1010 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
1011 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
1012 return i_accel_flags;
1015 static inline int ConvertHotkey( int i_hotkey )
1017 int i_key = i_hotkey & ~KEY_MODIFIER;
1018 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
1019 else if( i_key & KEY_SPECIAL )
1023 case KEY_LEFT: return WXK_LEFT;
1024 case KEY_RIGHT: return WXK_RIGHT;
1025 case KEY_UP: return WXK_UP;
1026 case KEY_DOWN: return WXK_DOWN;
1027 case KEY_SPACE: return WXK_SPACE;
1028 case KEY_ENTER: return WXK_RETURN;
1029 case KEY_F1: return WXK_F1;
1030 case KEY_F2: return WXK_F2;
1031 case KEY_F3: return WXK_F3;
1032 case KEY_F4: return WXK_F4;
1033 case KEY_F5: return WXK_F5;
1034 case KEY_F6: return WXK_F6;
1035 case KEY_F7: return WXK_F7;
1036 case KEY_F8: return WXK_F8;
1037 case KEY_F9: return WXK_F9;
1038 case KEY_F10: return WXK_F10;
1039 case KEY_F11: return WXK_F11;
1040 case KEY_F12: return WXK_F12;
1041 case KEY_HOME: return WXK_HOME;
1042 case KEY_END: return WXK_HOME;
1043 case KEY_MENU: return WXK_MENU;
1044 case KEY_ESC: return WXK_ESCAPE;
1045 case KEY_PAGEUP: return WXK_PRIOR;
1046 case KEY_PAGEDOWN: return WXK_NEXT;
1047 case KEY_TAB: return WXK_TAB;
1048 case KEY_BACKSPACE: return WXK_BACK;