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 );
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 );
147 class SubsFileDialog;
152 class BookmarksDialog;
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;
192 wxStaticBox *slider_box;
196 wxStaticBox *adjust_box;
197 wxSlider *brightness_slider;
198 wxSlider *contrast_slider;
199 wxSlider *saturation_slider;
200 wxSlider *hue_slider;
201 wxSlider *gamma_slider;
203 wxStaticBox *other_box;
204 wxComboBox *ratio_combo;
209 void UpdateAcceleratorTable();
210 void CreateOurMenuBar();
211 void CreateOurToolBar();
212 void CreateOurExtendedPanel();
213 void CreateOurSlider();
214 void Open( int i_access_method );
216 /* Event handlers (these functions should _not_ be virtual) */
217 void OnExit( wxCommandEvent& event );
218 void OnAbout( wxCommandEvent& event );
220 void OnOpenFileSimple( wxCommandEvent& event );
221 void OnOpenFile( wxCommandEvent& event );
222 void OnOpenDisc( wxCommandEvent& event );
223 void OnOpenNet( wxCommandEvent& event );
224 void OnOpenSat( wxCommandEvent& event );
225 void OnOpenV4L( wxCommandEvent& event );
226 void OnExtended( wxCommandEvent& event );
227 void OnBookmarks( wxCommandEvent& event );
228 void OnShowDialog( wxCommandEvent& event );
229 void OnPlayStream( wxCommandEvent& event );
230 void OnStopStream( wxCommandEvent& event );
231 void OnSliderUpdate( wxScrollEvent& event );
232 void OnPrevStream( wxCommandEvent& event );
233 void OnNextStream( wxCommandEvent& event );
234 void OnSlowStream( wxCommandEvent& event );
235 void OnFastStream( wxCommandEvent& event );
237 void OnEnableAdjust( wxCommandEvent& event );
238 void OnHueUpdate( wxScrollEvent& event );
239 void OnContrastUpdate( wxScrollEvent& event );
240 void OnBrightnessUpdate( wxScrollEvent& event );
241 void OnSaturationUpdate( wxScrollEvent& event );
242 void OnGammaUpdate( wxScrollEvent& event );
244 void OnRatio( wxCommandEvent& event );
245 void OnEnableVisual( wxCommandEvent& event );
247 void OnMenuOpen( wxMenuEvent& event );
249 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
250 void OnContextMenu2(wxContextMenuEvent& event);
252 void OnContextMenu(wxMouseEvent& event);
254 void UpdateSizeEvent( wxCommandEvent& event );
256 DECLARE_EVENT_TABLE();
259 intf_thread_t *p_intf;
262 int i_old_playing_status;
264 /* For auto-generated menus */
265 wxMenu *p_settings_menu;
266 vlc_bool_t b_settings_menu;
267 wxMenu *p_audio_menu;
268 vlc_bool_t b_audio_menu;
269 wxMenu *p_video_menu;
270 vlc_bool_t b_video_menu;
271 wxMenu *p_navig_menu;
272 vlc_bool_t b_navig_menu;
275 /* Dialogs Provider */
276 class DialogsProvider: public wxFrame
280 DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
281 virtual ~DialogsProvider();
284 void Open( int i_access_method, int i_arg );
286 /* Event handlers (these functions should _not_ be virtual) */
287 void OnExit( wxCommandEvent& event );
288 void OnPlaylist( wxCommandEvent& event );
289 void OnMessages( wxCommandEvent& event );
290 void OnFileInfo( wxCommandEvent& event );
291 void OnPreferences( wxCommandEvent& event );
292 void OnStreamWizardDialog( wxCommandEvent& event );
293 void OnBookmarks( wxCommandEvent& event );
295 void OnOpenFileGeneric( wxCommandEvent& event );
296 void OnOpenFileSimple( wxCommandEvent& event );
297 void OnOpenFile( wxCommandEvent& event );
298 void OnOpenDisc( wxCommandEvent& event );
299 void OnOpenNet( wxCommandEvent& event );
300 void OnOpenSat( wxCommandEvent& event );
302 void OnPopupMenu( wxCommandEvent& event );
304 void OnIdle( wxIdleEvent& event );
306 void OnExitThread( wxCommandEvent& event );
308 DECLARE_EVENT_TABLE();
310 intf_thread_t *p_intf;
313 /* Secondary windows */
314 OpenDialog *p_open_dialog;
315 wxFileDialog *p_file_dialog;
316 Playlist *p_playlist_dialog;
317 Messages *p_messages_dialog;
318 FileInfo *p_fileinfo_dialog;
319 StreamDialog *p_streamwizard_dialog;
320 wxFrame *p_prefs_dialog;
321 BookmarksDialog *p_bookmarks_dialog;
322 wxFileDialog *p_file_generic_dialog;
326 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
327 class OpenDialog: public wxFrame
331 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
332 int i_access_method, int i_arg = 0 );
334 /* Extended Contructor */
335 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
336 int i_access_method, int i_arg = 0 , int _i_method = 0 );
337 virtual ~OpenDialog();
340 int Show( int i_access_method, int i_arg = 0 );
343 void UpdateMRL( int i_access_method );
348 wxPanel *FilePanel( wxWindow* parent );
349 wxPanel *DiscPanel( wxWindow* parent );
350 wxPanel *NetPanel( wxWindow* parent );
351 wxPanel *V4LPanel( wxWindow* parent );
353 ArrayOfAutoBuiltPanel input_tab_array;
355 /* Event handlers (these functions should _not_ be virtual) */
356 void OnOk( wxCommandEvent& event );
357 void OnCancel( wxCommandEvent& event );
359 void OnPageChange( wxNotebookEvent& event );
360 void OnMRLChange( wxCommandEvent& event );
362 /* Event handlers for the file page */
363 void OnFilePanelChange( wxCommandEvent& event );
364 void OnFileBrowse( wxCommandEvent& event );
366 /* Event handlers for the disc page */
367 void OnDiscPanelChange( wxCommandEvent& event );
368 void OnDiscTypeChange( wxCommandEvent& event );
369 void OnDiscDeviceChange( wxCommandEvent& event );
371 /* Event handlers for the net page */
372 void OnNetPanelChange( wxCommandEvent& event );
373 void OnNetTypeChange( wxCommandEvent& event );
375 /* Event handlers for the v4l page */
376 void OnV4LPanelChange( wxCommandEvent& event );
377 void OnV4LTypeChange( wxCommandEvent& event );
378 void OnV4LSettingsChange( wxCommandEvent& event );
380 /* Event handlers for the stream output */
381 void OnSubsFileEnable( wxCommandEvent& event );
382 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
384 /* Event handlers for the stream output */
385 void OnSoutEnable( wxCommandEvent& event );
386 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
388 DECLARE_EVENT_TABLE();
390 intf_thread_t *p_intf;
392 int i_current_access_method;
393 int i_disc_type_selection;
395 int i_method; /* Normal or for the stream dialog ? */
398 wxComboBox *mrl_combo;
399 wxNotebook *notebook;
401 /* Controls for the file panel */
402 wxComboBox *file_combo;
403 wxFileDialog *file_dialog;
405 /* Controls for the disc panel */
406 wxRadioBox *disc_type;
407 wxTextCtrl *disc_device;
408 wxSpinCtrl *disc_title;
409 wxSpinCtrl *disc_chapter;
411 /* The media equivalent name for a DVD names. For example,
412 "Title", is "Track" for a CD-DA */
413 wxStaticText *disc_title_label;
414 wxStaticText *disc_chapter_label;
416 /* Indicates if the disc device control was modified */
417 bool b_disc_device_changed;
419 /* Controls for the net panel */
420 wxRadioBox *net_type;
422 wxPanel *net_subpanels[4];
423 wxRadioButton *net_radios[4];
424 wxSpinCtrl *net_ports[4];
426 wxTextCtrl *net_addrs[4];
427 wxCheckBox *net_ipv6;
429 /* Controls for the v4l panel */
430 wxRadioBox *video_type;
431 wxTextCtrl *video_device;
432 wxSpinCtrl *video_channel;
433 wxButton *v4l_button;
434 V4LDialog *v4l_dialog;
435 wxArrayString v4l_mrl;
437 /* Controls for the subtitles file */
438 wxButton *subsfile_button;
439 wxCheckBox *subsfile_checkbox;
440 SubsFileDialog *subsfile_dialog;
441 wxArrayString subsfile_mrl;
443 /* Controls for the stream output */
444 wxButton *sout_button;
445 wxCheckBox *sout_checkbox;
446 SoutDialog *sout_dialog;
447 wxArrayString sout_mrl;
463 class V4LDialog: public wxDialog
467 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
468 virtual ~V4LDialog();
470 wxArrayString GetOptions();
474 wxPanel *AudioPanel( wxWindow* parent );
475 wxPanel *CommonPanel( wxWindow* parent );
476 wxPanel *BitratePanel( wxWindow* parent );
479 /* Event handlers (these functions should _not_ be virtual) */
480 void OnOk( wxCommandEvent& event );
481 void OnCancel( wxCommandEvent& event );
482 void OnMRLChange( wxCommandEvent& event );
483 void OnAudioEnable( wxCommandEvent& event );
484 void OnAudioChange( wxCommandEvent& event );
485 void OnAudioChannel( wxCommandEvent& event );
486 void OnSizeEnable( wxCommandEvent& event );
487 void OnSize( wxCommandEvent& event );
488 void OnNormEnable( wxCommandEvent& event );
489 void OnNorm( wxCommandEvent& event );
490 void OnFrequencyEnable( wxCommandEvent& event );
491 void OnFrequency( wxCommandEvent& event );
492 void OnBitrateEnable( wxCommandEvent& event );
493 void OnBitrate( wxCommandEvent& event );
494 void OnMaxBitrateEnable( wxCommandEvent& event );
495 void OnMaxBitrate( wxCommandEvent& event );
497 DECLARE_EVENT_TABLE();
499 intf_thread_t *p_intf;
502 wxComboBox *mrl_combo;
506 /* Controls for the v4l advanced options */
507 wxPanel *common_subpanel;
508 wxPanel *common_panel;
509 wxCheckBox *size_checkbox;
510 wxComboBox *size_combo;
511 wxCheckBox *norm_checkbox;
512 wxComboBox *norm_combo;
513 wxCheckBox *frequency_checkbox;
514 wxSpinCtrl *frequency;
516 wxPanel *audio_subpanel;
517 wxPanel *audio_panel;
518 wxCheckBox *audio_checkbox;
519 wxTextCtrl *audio_device;
520 wxSpinCtrl *audio_channel;
522 wxPanel *bitrate_subpanel;
523 wxPanel *bitrate_panel;
524 wxCheckBox *bitrate_checkbox;
526 wxCheckBox *maxbitrate_checkbox;
527 wxSpinCtrl *maxbitrate;
531 /* Stream output Dialog */
545 TS_ENCAPSULATION = 0,
563 class SoutDialog: public wxDialog
567 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
568 virtual ~SoutDialog();
570 wxArrayString GetOptions();
574 wxPanel *AccessPanel( wxWindow* parent );
575 wxPanel *MiscPanel( wxWindow* parent );
576 wxPanel *EncapsulationPanel( wxWindow* parent );
577 wxPanel *TranscodingPanel( wxWindow* parent );
580 /* Event handlers (these functions should _not_ be virtual) */
581 void OnOk( wxCommandEvent& event );
582 void OnCancel( wxCommandEvent& event );
583 void OnMRLChange( wxCommandEvent& event );
584 void OnAccessTypeChange( wxCommandEvent& event );
586 /* Event handlers for the file access output */
587 void OnFileChange( wxCommandEvent& event );
588 void OnFileBrowse( wxCommandEvent& event );
589 void OnFileDump( wxCommandEvent& event );
591 /* Event handlers for the net access output */
592 void OnNetChange( wxCommandEvent& event );
594 /* Event specific to the announce address */
595 void OnAnnounceAddrChange( wxCommandEvent& event );
597 /* Event handlers for the encapsulation panel */
598 void OnEncapsulationChange( wxCommandEvent& event );
600 /* Event handlers for the transcoding panel */
601 void OnTranscodingEnable( wxCommandEvent& event );
602 void OnTranscodingChange( wxCommandEvent& event );
604 /* Event handlers for the misc panel */
605 void OnSAPMiscChange( wxCommandEvent& event );
606 void OnSLPMiscChange( wxCommandEvent& event );
608 DECLARE_EVENT_TABLE();
610 intf_thread_t *p_intf;
613 wxComboBox *mrl_combo;
615 /* Controls for the access outputs */
616 wxPanel *access_panel;
617 wxPanel *access_subpanels[ACCESS_OUT_NUM];
618 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
622 wxComboBox *file_combo;
623 wxCheckBox *dump_checkbox;
624 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
625 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
627 /* Controls for the SAP announces */
629 wxPanel *misc_subpanels[MISC_SOUT_NUM];
630 wxCheckBox *sap_checkbox;
631 wxCheckBox *slp_checkbox;
632 wxTextCtrl *announce_addr;
634 /* Controls for the encapsulation */
635 wxPanel *encapsulation_panel;
636 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
637 int i_encapsulation_type;
639 /* Controls for transcoding */
640 wxPanel *transcoding_panel;
641 wxCheckBox *video_transc_checkbox;
642 wxComboBox *video_codec_combo;
643 wxComboBox *audio_codec_combo;
644 wxCheckBox *audio_transc_checkbox;
645 wxComboBox *video_bitrate_combo;
646 wxComboBox *audio_bitrate_combo;
647 wxComboBox *audio_channels_combo;
648 wxComboBox *video_scale_combo;
651 /* Subtitles File Dialog */
652 class SubsFileDialog: public wxDialog
656 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
657 virtual ~SubsFileDialog();
659 wxComboBox *file_combo;
660 wxComboBox *encoding_combo;
661 wxSpinCtrl *delay_spinctrl;
662 wxSpinCtrl *fps_spinctrl;
665 /* Event handlers (these functions should _not_ be virtual) */
666 void OnOk( wxCommandEvent& event );
667 void OnCancel( wxCommandEvent& event );
668 void OnFileBrowse( wxCommandEvent& event );
670 DECLARE_EVENT_TABLE();
672 intf_thread_t *p_intf;
677 class StreamDialog: public wxFrame
681 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
682 virtual ~StreamDialog();
685 void OnClose( wxCommandEvent& event );
686 void OnOpen( wxCommandEvent& event );
687 void OnSout( wxCommandEvent& event );
688 void OnStart( wxCommandEvent& event );
690 DECLARE_EVENT_TABLE();
692 intf_thread_t *p_intf;
694 wxStaticText *step2_label;
695 wxStaticText *step3_label;
696 wxButton *sout_button;
697 wxButton *start_button;
699 wxArrayString sout_mrl;
700 OpenDialog *p_open_dialog;
701 SoutDialog *p_sout_dialog;
706 /* Preferences Dialog */
707 class PrefsDialog: public wxFrame
711 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
712 virtual ~PrefsDialog();
715 wxPanel *PrefsPanel( wxWindow* parent );
717 /* Event handlers (these functions should _not_ be virtual) */
718 void OnOk( wxCommandEvent& event );
719 void OnCancel( wxCommandEvent& event );
720 void OnSave( wxCommandEvent& event );
721 void OnResetAll( wxCommandEvent& event );
722 void OnAdvanced( wxCommandEvent& event );
724 DECLARE_EVENT_TABLE();
726 intf_thread_t *p_intf;
728 PrefsTreeCtrl *prefs_tree;
732 class Messages: public wxFrame
736 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
738 bool Show( bool show = TRUE );
742 /* Event handlers (these functions should _not_ be virtual) */
743 void OnClose( wxCommandEvent& event );
744 void OnClear( wxCommandEvent& event );
745 void OnSaveLog( wxCommandEvent& event );
747 DECLARE_EVENT_TABLE();
749 intf_thread_t *p_intf;
750 wxTextCtrl *textctrl;
751 wxTextAttr *info_attr;
752 wxTextAttr *err_attr;
753 wxTextAttr *warn_attr;
754 wxTextAttr *dbg_attr;
756 wxFileDialog *save_log_dialog;
758 vlc_bool_t b_verbose;
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;
841 class NewGroup: public wxDialog
845 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
850 /* Event handlers (these functions should _not_ be virtual) */
851 void OnOk( wxCommandEvent& event );
852 void OnCancel( wxCommandEvent& event );
854 DECLARE_EVENT_TABLE();
856 intf_thread_t *p_intf;
857 wxTextCtrl *groupname;
860 friend class Playlist;
861 friend class ItemInfoDialog;
865 /* ItemInfo Dialog */
866 class ItemInfoDialog: public wxDialog
870 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
871 wxWindow *p_parent );
872 virtual ~ItemInfoDialog();
874 wxArrayString GetOptions();
877 wxPanel *InfoPanel( wxWindow* parent );
878 wxPanel *GroupPanel( wxWindow* parent );
880 /* Event handlers (these functions should _not_ be virtual) */
881 void OnOk( wxCommandEvent& event );
882 void OnCancel( wxCommandEvent& event );
883 void OnNewGroup( wxCommandEvent& event );
887 DECLARE_EVENT_TABLE();
889 intf_thread_t *p_intf;
890 playlist_item_t *p_item;
893 /* Controls for the iteminfo dialog box */
894 wxPanel *info_subpanel;
897 wxPanel *group_subpanel;
898 wxPanel *group_panel;
900 wxTextCtrl *uri_text;
901 wxTextCtrl *name_text;
902 wxTextCtrl *author_text;
904 wxTreeCtrl *info_tree;
905 wxTreeItemId info_root;
907 wxCheckBox *enabled_checkbox;
908 wxComboBox *group_combo;
914 class FileInfo: public wxFrame
918 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
920 void UpdateFileInfo();
923 void OnClose( wxCommandEvent& event );
925 DECLARE_EVENT_TABLE();
927 intf_thread_t *p_intf;
928 wxTreeCtrl *fileinfo_tree;
929 wxTreeItemId fileinfo_root;
930 wxString fileinfo_root_label;
935 #if !defined(__WXX11__)
936 /* Drag and Drop class */
937 class DragAndDrop: public wxFileDropTarget
940 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
942 virtual bool OnDropFiles( wxCoord x, wxCoord y,
943 const wxArrayString& filenames );
946 intf_thread_t *p_intf;
947 vlc_bool_t b_enqueue;
950 } // end of wxvlc namespace
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 );
962 class MenuEvtHandler : public wxEvtHandler
965 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
966 virtual ~MenuEvtHandler();
968 void OnMenuEvent( wxCommandEvent& event );
969 void OnShowDialog( wxCommandEvent& event );
973 DECLARE_EVENT_TABLE()
975 intf_thread_t *p_intf;
976 Interface *p_main_interface;
979 class Menu: public wxMenu
983 Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
984 char **ppsz_names, int *pi_objects, int i_start_id );
988 /* Event handlers (these functions should _not_ be virtual) */
989 void OnClose( wxCommandEvent& event );
990 void OnShowDialog( wxCommandEvent& event );
991 void OnEntrySelected( wxCommandEvent& event );
993 wxMenu *Menu::CreateDummyMenu();
994 void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
995 wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t *, bool );
997 DECLARE_EVENT_TABLE();
999 intf_thread_t *p_intf;
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 OnClear( wxCommandEvent& event );
1022 void OnActivateItem( wxListEvent& event );
1023 void OnUpdate( wxCommandEvent &event );
1025 DECLARE_EVENT_TABLE();
1027 intf_thread_t *p_intf;
1030 wxListView *list_ctrl;
1033 } // end of wxvlc namespace
1034 using namespace wxvlc;
1036 static inline int ConvertHotkeyModifiers( int i_hotkey )
1038 int i_accel_flags = 0;
1039 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
1040 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
1041 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
1042 return i_accel_flags;
1045 static inline int ConvertHotkey( int i_hotkey )
1047 int i_key = i_hotkey & ~KEY_MODIFIER;
1048 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
1049 else if( i_key & KEY_SPECIAL )
1053 case KEY_LEFT: return WXK_LEFT;
1054 case KEY_RIGHT: return WXK_RIGHT;
1055 case KEY_UP: return WXK_UP;
1056 case KEY_DOWN: return WXK_DOWN;
1057 case KEY_SPACE: return WXK_SPACE;
1058 case KEY_ENTER: return WXK_RETURN;
1059 case KEY_F1: return WXK_F1;
1060 case KEY_F2: return WXK_F2;
1061 case KEY_F3: return WXK_F3;
1062 case KEY_F4: return WXK_F4;
1063 case KEY_F5: return WXK_F5;
1064 case KEY_F6: return WXK_F6;
1065 case KEY_F7: return WXK_F7;
1066 case KEY_F8: return WXK_F8;
1067 case KEY_F9: return WXK_F9;
1068 case KEY_F10: return WXK_F10;
1069 case KEY_F11: return WXK_F11;
1070 case KEY_F12: return WXK_F12;
1071 case KEY_HOME: return WXK_HOME;
1072 case KEY_END: return WXK_HOME;
1073 case KEY_MENU: return WXK_MENU;
1074 case KEY_ESC: return WXK_ESCAPE;
1075 case KEY_PAGEUP: return WXK_PRIOR;
1076 case KEY_PAGEDOWN: return WXK_NEXT;
1077 case KEY_TAB: return WXK_TAB;
1078 case KEY_BACKSPACE: return WXK_BACK;