1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999-2004 VideoLAN
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 );
53 DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
61 #define SLIDER_MAX_POS 10000
63 /* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
64 #if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
66 # define wxU(utf8) wxString(utf8, wxConvUTF8)
68 # define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
72 #else // ENABLE_NLS && ENABLE_UTF8
74 # define wxU(ansi) wxString(ansi, *wxConvCurrent)
76 # define wxU(ansi) ansi
82 /* wxL2U (locale to unicode) is used to convert ansi strings to unicode
83 * strings (wchar_t) */
85 # define wxL2U(ansi) wxString(ansi, *wxConvCurrent)
87 # define wxL2U(ansi) ansi
100 wxArrayString SeparateEntries( wxString );
102 /*****************************************************************************
103 * intf_sys_t: description and status of wxwindows interface
104 *****************************************************************************/
107 /* the wx parent window */
108 wxWindow *p_wxwindow;
111 /* special actions */
112 vlc_bool_t b_playing;
114 /* The input thread */
115 input_thread_t * p_input;
118 int i_slider_pos; /* slider position */
119 int i_slider_oldpos; /* previous position */
120 vlc_bool_t b_slider_free; /* slider status */
122 /* The messages window */
123 msg_subscription_t* p_sub; /* message bank subscription */
125 /* Playlist management */
126 int i_playing; /* playlist selected item */
128 /* Send an event to show a dialog */
129 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
130 intf_dialog_args_t *p_arg );
133 wxMenu *p_popup_menu;
135 VideoWindow *p_video_window;
136 wxBoxSizer *p_video_sizer;
139 /*****************************************************************************
141 *****************************************************************************/
143 /*****************************************************************************
144 * Classes declarations.
145 *****************************************************************************/
149 class Timer: public wxTimer
153 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
156 virtual void Notify();
159 intf_thread_t *p_intf;
160 Interface *p_main_interface;
161 int i_old_playing_status;
166 class Interface: public wxFrame
170 Interface( intf_thread_t *p_intf );
171 virtual ~Interface();
172 void TogglePlayButton( int i_playing_status );
174 // wxFlexGridSizer *frame_sizer;
175 wxBoxSizer *frame_sizer;
176 wxStatusBar *statusbar;
179 wxWindow *slider_frame;
180 wxWindow *extra_frame;
181 wxStaticBox *slider_box;
185 wxStaticBox *adjust_box;
186 wxSlider *brightness_slider;
187 wxSlider *contrast_slider;
188 wxSlider *saturation_slider;
189 wxSlider *hue_slider;
190 wxSlider *gamma_slider;
192 wxStaticBox *other_box;
193 wxComboBox *ratio_combo;
198 void UpdateAcceleratorTable();
199 void CreateOurMenuBar();
200 void CreateOurToolBar();
201 void CreateOurExtendedPanel();
202 void CreateOurSlider();
203 void Open( int i_access_method );
205 /* Event handlers (these functions should _not_ be virtual) */
206 void OnExit( wxCommandEvent& event );
207 void OnAbout( wxCommandEvent& event );
209 void OnOpenFileSimple( wxCommandEvent& event );
210 void OnOpenFile( wxCommandEvent& event );
211 void OnOpenDisc( wxCommandEvent& event );
212 void OnOpenNet( wxCommandEvent& event );
213 void OnOpenSat( wxCommandEvent& event );
214 void OnOpenV4L( wxCommandEvent& event );
215 void OnExtended( wxCommandEvent& event );
216 void OnBookmarks( wxCommandEvent& event );
217 void OnShowDialog( wxCommandEvent& event );
218 void OnPlayStream( wxCommandEvent& event );
219 void OnStopStream( wxCommandEvent& event );
220 void OnSliderUpdate( wxScrollEvent& event );
221 void OnPrevStream( wxCommandEvent& event );
222 void OnNextStream( wxCommandEvent& event );
223 void OnSlowStream( wxCommandEvent& event );
224 void OnFastStream( wxCommandEvent& event );
226 void OnEnableAdjust( wxCommandEvent& event );
227 void OnHueUpdate( wxScrollEvent& event );
228 void OnContrastUpdate( wxScrollEvent& event );
229 void OnBrightnessUpdate( wxScrollEvent& event );
230 void OnSaturationUpdate( wxScrollEvent& event );
231 void OnGammaUpdate( wxScrollEvent& event );
233 void OnRatio( wxCommandEvent& event );
234 void OnEnableVisual( wxCommandEvent& event );
236 void OnMenuOpen( wxMenuEvent& event );
238 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
239 void OnContextMenu2(wxContextMenuEvent& event);
241 void OnContextMenu(wxMouseEvent& event);
243 void UpdateSizeEvent( wxCommandEvent& event );
245 DECLARE_EVENT_TABLE();
248 intf_thread_t *p_intf;
251 int i_old_playing_status;
253 /* For auto-generated menus */
254 wxMenu *p_settings_menu;
255 vlc_bool_t b_settings_menu;
256 wxMenu *p_audio_menu;
257 vlc_bool_t b_audio_menu;
258 wxMenu *p_video_menu;
259 vlc_bool_t b_video_menu;
260 wxMenu *p_navig_menu;
261 vlc_bool_t b_navig_menu;
265 class BookmarksDialog;
267 /* Dialogs Provider */
268 class DialogsProvider: public wxFrame
272 DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
273 virtual ~DialogsProvider();
276 void Open( int i_access_method, int i_arg );
278 /* Event handlers (these functions should _not_ be virtual) */
279 void OnExit( wxCommandEvent& event );
280 void OnPlaylist( wxCommandEvent& event );
281 void OnMessages( wxCommandEvent& event );
282 void OnFileInfo( wxCommandEvent& event );
283 void OnPreferences( wxCommandEvent& event );
284 void OnStreamWizardDialog( wxCommandEvent& event );
285 void OnBookmarks( wxCommandEvent& event );
287 void OnOpenFileGeneric( wxCommandEvent& event );
288 void OnOpenFileSimple( wxCommandEvent& event );
289 void OnOpenFile( wxCommandEvent& event );
290 void OnOpenDisc( wxCommandEvent& event );
291 void OnOpenNet( wxCommandEvent& event );
292 void OnOpenSat( wxCommandEvent& event );
294 void OnPopupMenu( wxCommandEvent& event );
296 void OnIdle( wxIdleEvent& event );
298 void OnExitThread( wxCommandEvent& event );
300 DECLARE_EVENT_TABLE();
302 intf_thread_t *p_intf;
305 /* Secondary windows */
306 OpenDialog *p_open_dialog;
307 wxFileDialog *p_file_dialog;
308 Playlist *p_playlist_dialog;
309 Messages *p_messages_dialog;
310 FileInfo *p_fileinfo_dialog;
311 StreamDialog *p_streamwizard_dialog;
312 wxFrame *p_prefs_dialog;
313 BookmarksDialog *p_bookmarks_dialog;
314 wxFileDialog *p_file_generic_dialog;
318 class AutoBuiltPanel;
319 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
322 class SubsFileDialog;
323 class OpenDialog: public wxFrame
327 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
328 int i_access_method, int i_arg = 0 );
330 /* Extended Contructor */
331 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
332 int i_access_method, int i_arg = 0 , int _i_method = 0 );
333 virtual ~OpenDialog();
336 int Show( int i_access_method, int i_arg = 0 );
339 void UpdateMRL( int i_access_method );
344 wxPanel *FilePanel( wxWindow* parent );
345 wxPanel *DiscPanel( wxWindow* parent );
346 wxPanel *NetPanel( wxWindow* parent );
347 wxPanel *V4LPanel( wxWindow* parent );
349 ArrayOfAutoBuiltPanel input_tab_array;
351 /* Event handlers (these functions should _not_ be virtual) */
352 void OnOk( wxCommandEvent& event );
353 void OnCancel( wxCommandEvent& event );
355 void OnPageChange( wxNotebookEvent& event );
356 void OnMRLChange( wxCommandEvent& event );
358 /* Event handlers for the file page */
359 void OnFilePanelChange( wxCommandEvent& event );
360 void OnFileBrowse( wxCommandEvent& event );
362 /* Event handlers for the disc page */
363 void OnDiscPanelChange( wxCommandEvent& event );
364 void OnDiscTypeChange( wxCommandEvent& event );
365 void OnDiscDeviceChange( wxCommandEvent& event );
367 /* Event handlers for the net page */
368 void OnNetPanelChange( wxCommandEvent& event );
369 void OnNetTypeChange( wxCommandEvent& event );
371 /* Event handlers for the v4l page */
372 void OnV4LPanelChange( wxCommandEvent& event );
373 void OnV4LTypeChange( wxCommandEvent& event );
374 void OnV4LSettingsChange( wxCommandEvent& event );
376 /* Event handlers for the stream output */
377 void OnSubsFileEnable( wxCommandEvent& event );
378 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
380 /* Event handlers for the stream output */
381 void OnSoutEnable( wxCommandEvent& event );
382 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
384 DECLARE_EVENT_TABLE();
386 intf_thread_t *p_intf;
388 int i_current_access_method;
389 int i_disc_type_selection;
391 int i_method; /* Normal or for the stream dialog ? */
394 wxComboBox *mrl_combo;
395 wxNotebook *notebook;
397 /* Controls for the file panel */
398 wxComboBox *file_combo;
399 wxFileDialog *file_dialog;
401 /* Controls for the disc panel */
402 wxRadioBox *disc_type;
403 wxTextCtrl *disc_device;
404 wxSpinCtrl *disc_title;
405 wxSpinCtrl *disc_chapter;
407 /* The media equivalent name for a DVD names. For example,
408 "Title", is "Track" for a CD-DA */
409 wxStaticText *disc_title_label;
410 wxStaticText *disc_chapter_label;
412 /* Indicates if the disc device control was modified */
413 bool b_disc_device_changed;
415 /* Controls for the net panel */
416 wxRadioBox *net_type;
418 wxPanel *net_subpanels[4];
419 wxRadioButton *net_radios[4];
420 wxSpinCtrl *net_ports[4];
422 wxTextCtrl *net_addrs[4];
423 wxCheckBox *net_ipv6;
425 /* Controls for the v4l panel */
426 wxRadioBox *video_type;
427 wxTextCtrl *video_device;
428 wxSpinCtrl *video_channel;
429 wxButton *v4l_button;
430 V4LDialog *v4l_dialog;
431 wxArrayString v4l_mrl;
433 /* Controls for the subtitles file */
434 wxButton *subsfile_button;
435 wxCheckBox *subsfile_checkbox;
436 SubsFileDialog *subsfile_dialog;
437 wxArrayString subsfile_mrl;
439 /* Controls for the stream output */
440 wxButton *sout_button;
441 wxCheckBox *sout_checkbox;
442 SoutDialog *sout_dialog;
443 wxArrayString sout_mrl;
459 class V4LDialog: public wxDialog
463 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
464 virtual ~V4LDialog();
466 wxArrayString GetOptions();
470 wxPanel *AudioPanel( wxWindow* parent );
471 wxPanel *CommonPanel( wxWindow* parent );
472 wxPanel *BitratePanel( wxWindow* parent );
475 /* Event handlers (these functions should _not_ be virtual) */
476 void OnOk( wxCommandEvent& event );
477 void OnCancel( wxCommandEvent& event );
478 void OnMRLChange( wxCommandEvent& event );
479 void OnAudioEnable( wxCommandEvent& event );
480 void OnAudioChange( wxCommandEvent& event );
481 void OnAudioChannel( wxCommandEvent& event );
482 void OnSizeEnable( wxCommandEvent& event );
483 void OnSize( wxCommandEvent& event );
484 void OnNormEnable( wxCommandEvent& event );
485 void OnNorm( wxCommandEvent& event );
486 void OnFrequencyEnable( wxCommandEvent& event );
487 void OnFrequency( wxCommandEvent& event );
488 void OnBitrateEnable( wxCommandEvent& event );
489 void OnBitrate( wxCommandEvent& event );
490 void OnMaxBitrateEnable( wxCommandEvent& event );
491 void OnMaxBitrate( wxCommandEvent& event );
493 DECLARE_EVENT_TABLE();
495 intf_thread_t *p_intf;
498 wxComboBox *mrl_combo;
502 /* Controls for the v4l advanced options */
503 wxPanel *common_subpanel;
504 wxPanel *common_panel;
505 wxCheckBox *size_checkbox;
506 wxComboBox *size_combo;
507 wxCheckBox *norm_checkbox;
508 wxComboBox *norm_combo;
509 wxCheckBox *frequency_checkbox;
510 wxSpinCtrl *frequency;
512 wxPanel *audio_subpanel;
513 wxPanel *audio_panel;
514 wxCheckBox *audio_checkbox;
515 wxTextCtrl *audio_device;
516 wxSpinCtrl *audio_channel;
518 wxPanel *bitrate_subpanel;
519 wxPanel *bitrate_panel;
520 wxCheckBox *bitrate_checkbox;
522 wxCheckBox *maxbitrate_checkbox;
523 wxSpinCtrl *maxbitrate;
527 /* Stream output Dialog */
541 TS_ENCAPSULATION = 0,
559 class SoutDialog: public wxDialog
563 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
564 virtual ~SoutDialog();
566 wxArrayString GetOptions();
570 wxPanel *AccessPanel( wxWindow* parent );
571 wxPanel *MiscPanel( wxWindow* parent );
572 wxPanel *EncapsulationPanel( wxWindow* parent );
573 wxPanel *TranscodingPanel( wxWindow* parent );
576 /* Event handlers (these functions should _not_ be virtual) */
577 void OnOk( wxCommandEvent& event );
578 void OnCancel( wxCommandEvent& event );
579 void OnMRLChange( wxCommandEvent& event );
580 void OnAccessTypeChange( wxCommandEvent& event );
582 /* Event handlers for the file access output */
583 void OnFileChange( wxCommandEvent& event );
584 void OnFileBrowse( wxCommandEvent& event );
585 void OnFileDump( wxCommandEvent& event );
587 /* Event handlers for the net access output */
588 void OnNetChange( wxCommandEvent& event );
590 /* Event specific to the announce address */
591 void OnAnnounceAddrChange( wxCommandEvent& event );
593 /* Event handlers for the encapsulation panel */
594 void OnEncapsulationChange( wxCommandEvent& event );
596 /* Event handlers for the transcoding panel */
597 void OnTranscodingEnable( wxCommandEvent& event );
598 void OnTranscodingChange( wxCommandEvent& event );
600 /* Event handlers for the misc panel */
601 void OnSAPMiscChange( wxCommandEvent& event );
602 void OnSLPMiscChange( wxCommandEvent& event );
604 DECLARE_EVENT_TABLE();
606 intf_thread_t *p_intf;
609 wxComboBox *mrl_combo;
611 /* Controls for the access outputs */
612 wxPanel *access_panel;
613 wxPanel *access_subpanels[ACCESS_OUT_NUM];
614 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
618 wxComboBox *file_combo;
619 wxCheckBox *dump_checkbox;
620 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
621 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
623 /* Controls for the SAP announces */
625 wxPanel *misc_subpanels[MISC_SOUT_NUM];
626 wxCheckBox *sap_checkbox;
627 wxCheckBox *slp_checkbox;
628 wxTextCtrl *announce_addr;
630 /* Controls for the encapsulation */
631 wxPanel *encapsulation_panel;
632 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
633 int i_encapsulation_type;
635 /* Controls for transcoding */
636 wxPanel *transcoding_panel;
637 wxCheckBox *video_transc_checkbox;
638 wxComboBox *video_codec_combo;
639 wxComboBox *audio_codec_combo;
640 wxCheckBox *audio_transc_checkbox;
641 wxComboBox *video_bitrate_combo;
642 wxComboBox *audio_bitrate_combo;
643 wxComboBox *audio_channels_combo;
644 wxComboBox *video_scale_combo;
647 /* Subtitles File Dialog */
648 class SubsFileDialog: public wxDialog
652 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
653 virtual ~SubsFileDialog();
655 wxComboBox *file_combo;
656 wxComboBox *encoding_combo;
657 wxSpinCtrl *delay_spinctrl;
658 wxSpinCtrl *fps_spinctrl;
661 /* Event handlers (these functions should _not_ be virtual) */
662 void OnOk( wxCommandEvent& event );
663 void OnCancel( wxCommandEvent& event );
664 void OnFileBrowse( wxCommandEvent& event );
666 DECLARE_EVENT_TABLE();
668 intf_thread_t *p_intf;
673 class StreamDialog: public wxFrame
677 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
678 virtual ~StreamDialog();
681 void OnClose( wxCommandEvent& event );
682 void OnOpen( wxCommandEvent& event );
683 void OnSout( wxCommandEvent& event );
684 void OnStart( wxCommandEvent& event );
686 DECLARE_EVENT_TABLE();
688 intf_thread_t *p_intf;
690 wxStaticText *step2_label;
691 wxStaticText *step3_label;
692 wxButton *sout_button;
693 wxButton *start_button;
695 wxArrayString sout_mrl;
696 OpenDialog *p_open_dialog;
697 SoutDialog *p_sout_dialog;
702 /* Preferences Dialog */
704 class PrefsDialog: public wxFrame
708 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
709 virtual ~PrefsDialog();
712 wxPanel *PrefsPanel( wxWindow* parent );
714 /* Event handlers (these functions should _not_ be virtual) */
715 void OnOk( wxCommandEvent& event );
716 void OnCancel( wxCommandEvent& event );
717 void OnSave( wxCommandEvent& event );
718 void OnResetAll( wxCommandEvent& event );
719 void OnAdvanced( wxCommandEvent& event );
721 DECLARE_EVENT_TABLE();
723 intf_thread_t *p_intf;
725 PrefsTreeCtrl *prefs_tree;
729 class Messages: public wxFrame
733 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
735 bool Show( bool show = TRUE );
739 /* Event handlers (these functions should _not_ be virtual) */
740 void OnClose( wxCommandEvent& event );
741 void OnClear( wxCommandEvent& event );
742 void OnSaveLog( wxCommandEvent& event );
744 DECLARE_EVENT_TABLE();
746 intf_thread_t *p_intf;
747 wxTextCtrl *textctrl;
748 wxTextAttr *info_attr;
749 wxTextAttr *err_attr;
750 wxTextAttr *warn_attr;
751 wxTextAttr *dbg_attr;
753 wxFileDialog *save_log_dialog;
755 vlc_bool_t b_verbose;
759 class ItemInfoDialog;
761 class ExportPlaylist;
762 class Playlist: public wxFrame
766 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
769 void UpdatePlaylist();
770 void ShowPlaylist( bool show );
771 void UpdateItem( int );
776 void DeleteItem( int item );
777 void ShowInfos( int item );
779 /* Event handlers (these functions should _not_ be virtual) */
780 void OnAddFile( wxCommandEvent& event );
781 void OnAddMRL( wxCommandEvent& event );
782 void OnClose( wxCommandEvent& event );
783 void OnSearch( wxCommandEvent& event );
784 void OnEnDis( wxCommandEvent& event );
785 void OnInfos( wxCommandEvent& event );
786 void OnSearchTextChange( wxCommandEvent& event );
787 void OnOpen( wxCommandEvent& event );
788 void OnSave( wxCommandEvent& event );
790 void OnSort( wxCommandEvent& event );
791 void OnColSelect( wxListEvent& event );
793 void OnUp( wxCommandEvent& event);
794 void OnDown( wxCommandEvent& event);
796 void OnEnableSelection( wxCommandEvent& event );
797 void OnDisableSelection( wxCommandEvent& event );
798 void OnInvertSelection( wxCommandEvent& event );
799 void OnDeleteSelection( wxCommandEvent& event );
800 void OnSelectAll( wxCommandEvent& event );
801 void OnRandom( wxCommandEvent& event );
802 void OnRepeat( wxCommandEvent& event );
803 void OnLoop ( wxCommandEvent& event );
804 void OnActivateItem( wxListEvent& event );
805 void OnKeyDown( wxListEvent& event );
806 void OnNewGroup( wxCommandEvent& event );
808 /* Popup functions */
809 void OnPopup( wxListEvent& event );
810 void OnPopupPlay( wxMenuEvent& event );
811 void OnPopupDel( wxMenuEvent& event );
812 void OnPopupEna( wxMenuEvent& event );
813 void OnPopupInfo( wxMenuEvent& event );
817 void OnPlaylistEvent( wxCommandEvent& event );
819 wxTextCtrl *search_text;
820 wxButton *search_button;
821 DECLARE_EVENT_TABLE();
825 ItemInfoDialog *iteminfo_dialog;
827 intf_thread_t *p_intf;
828 wxListView *listview;
829 wxTreeCtrl *treeview;
830 int i_update_counter;
838 int i_duration_sorted;
842 class NewGroup: public wxDialog
846 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
851 /* Event handlers (these functions should _not_ be virtual) */
852 void OnOk( wxCommandEvent& event );
853 void OnCancel( wxCommandEvent& event );
855 DECLARE_EVENT_TABLE();
857 intf_thread_t *p_intf;
858 wxTextCtrl *groupname;
861 friend class Playlist;
862 friend class ItemInfoDialog;
866 /* ItemInfo Dialog */
867 class ItemInfoDialog: public wxDialog
871 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
872 wxWindow *p_parent );
873 virtual ~ItemInfoDialog();
875 wxArrayString GetOptions();
878 wxPanel *InfoPanel( wxWindow* parent );
879 wxPanel *GroupPanel( wxWindow* parent );
881 /* Event handlers (these functions should _not_ be virtual) */
882 void OnOk( wxCommandEvent& event );
883 void OnCancel( wxCommandEvent& event );
884 void OnNewGroup( wxCommandEvent& event );
888 DECLARE_EVENT_TABLE();
890 intf_thread_t *p_intf;
891 playlist_item_t *p_item;
894 /* Controls for the iteminfo dialog box */
895 wxPanel *info_subpanel;
898 wxPanel *group_subpanel;
899 wxPanel *group_panel;
901 wxTextCtrl *uri_text;
902 wxTextCtrl *name_text;
903 wxTextCtrl *author_text;
905 wxTreeCtrl *info_tree;
906 wxTreeItemId info_root;
908 wxCheckBox *enabled_checkbox;
909 wxComboBox *group_combo;
915 class FileInfo: public wxFrame
919 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
921 void UpdateFileInfo();
924 void OnClose( wxCommandEvent& event );
926 DECLARE_EVENT_TABLE();
928 intf_thread_t *p_intf;
929 wxTreeCtrl *fileinfo_tree;
930 wxTreeItemId fileinfo_root;
931 wxString fileinfo_root_label;
936 #if !defined(__WXX11__)
937 /* Drag and Drop class */
938 class DragAndDrop: public wxFileDropTarget
941 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
943 virtual bool OnDropFiles( wxCoord x, wxCoord y,
944 const wxArrayString& filenames );
947 intf_thread_t *p_intf;
948 vlc_bool_t b_enqueue;
953 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
954 const wxPoint& pos );
955 wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
956 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
957 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
958 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
960 class MenuEvtHandler : public wxEvtHandler
963 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
964 virtual ~MenuEvtHandler();
966 void OnMenuEvent( wxCommandEvent& event );
967 void OnShowDialog( wxCommandEvent& event );
971 DECLARE_EVENT_TABLE()
973 intf_thread_t *p_intf;
974 Interface *p_main_interface;
977 class Menu: public wxMenu
981 Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
982 char **ppsz_names, int *pi_objects, int i_start_id );
986 /* Event handlers (these functions should _not_ be virtual) */
987 void OnClose( wxCommandEvent& event );
988 void OnShowDialog( wxCommandEvent& event );
989 void OnEntrySelected( wxCommandEvent& event );
991 wxMenu *Menu::CreateDummyMenu();
992 void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
993 wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t *, bool );
995 DECLARE_EVENT_TABLE();
997 intf_thread_t *p_intf;
1002 wxWindow *VideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
1004 class BookmarksDialog: public wxFrame
1008 BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
1009 virtual ~BookmarksDialog();
1017 /* Event handlers (these functions should _not_ be virtual) */
1018 void OnClose( wxCommandEvent& event );
1019 void OnAdd( wxCommandEvent& event );
1020 void OnDel( wxCommandEvent& event );
1021 void OnActivateItem( wxListEvent& event );
1023 DECLARE_EVENT_TABLE();
1025 intf_thread_t *p_intf;
1028 wxListView *list_ctrl;
1031 static inline int ConvertHotkeyModifiers( int i_hotkey )
1033 int i_accel_flags = 0;
1034 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
1035 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
1036 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
1037 return i_accel_flags;
1040 static inline int ConvertHotkey( int i_hotkey )
1042 int i_key = i_hotkey & ~KEY_MODIFIER;
1043 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
1044 else if( i_key & KEY_SPECIAL )
1048 case KEY_LEFT: return WXK_LEFT;
1049 case KEY_RIGHT: return WXK_RIGHT;
1050 case KEY_UP: return WXK_UP;
1051 case KEY_DOWN: return WXK_DOWN;
1052 case KEY_SPACE: return WXK_SPACE;
1053 case KEY_ENTER: return WXK_RETURN;
1054 case KEY_F1: return WXK_F1;
1055 case KEY_F2: return WXK_F2;
1056 case KEY_F3: return WXK_F3;
1057 case KEY_F4: return WXK_F4;
1058 case KEY_F5: return WXK_F5;
1059 case KEY_F6: return WXK_F6;
1060 case KEY_F7: return WXK_F7;
1061 case KEY_F8: return WXK_F8;
1062 case KEY_F9: return WXK_F9;
1063 case KEY_F10: return WXK_F10;
1064 case KEY_F11: return WXK_F11;
1065 case KEY_F12: return WXK_F12;
1066 case KEY_HOME: return WXK_HOME;
1067 case KEY_END: return WXK_HOME;
1068 case KEY_MENU: return WXK_MENU;
1069 case KEY_ESC: return WXK_ESCAPE;
1070 case KEY_PAGEUP: return WXK_PRIOR;
1071 case KEY_PAGEDOWN: return WXK_NEXT;
1072 case KEY_TAB: return WXK_TAB;
1073 case KEY_BACKSPACE: return WXK_BACK;