1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: wxwindows.h,v 1.83 2004/01/05 13:00: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;
182 wxStaticBox *other_box;
183 wxComboBox *ratio_combo;
188 void UpdateAcceleratorTable();
189 void CreateOurMenuBar();
190 void CreateOurToolBar();
191 void CreateOurExtraPanel();
192 void CreateOurSlider();
193 void Open( int i_access_method );
195 /* Event handlers (these functions should _not_ be virtual) */
196 void OnExit( wxCommandEvent& event );
197 void OnAbout( wxCommandEvent& event );
199 void OnOpenFileSimple( wxCommandEvent& event );
200 void OnOpenFile( wxCommandEvent& event );
201 void OnOpenDisc( wxCommandEvent& event );
202 void OnOpenNet( wxCommandEvent& event );
203 void OnOpenSat( wxCommandEvent& event );
204 void OnOpenV4L( wxCommandEvent& event );
205 void OnStream( wxCommandEvent& event );
206 void OnExtra( wxCommandEvent& event );
207 void OnShowDialog( wxCommandEvent& event );
208 void OnPlayStream( wxCommandEvent& event );
209 void OnStopStream( wxCommandEvent& event );
210 void OnSliderUpdate( wxScrollEvent& event );
211 void OnPrevStream( wxCommandEvent& event );
212 void OnNextStream( wxCommandEvent& event );
213 void OnSlowStream( wxCommandEvent& event );
214 void OnFastStream( wxCommandEvent& event );
216 void OnEnableAdjust( wxCommandEvent& event );
217 void OnHueUpdate( wxScrollEvent& event );
218 void OnContrastUpdate( wxScrollEvent& event );
219 void OnBrightnessUpdate( wxScrollEvent& event );
220 void OnSaturationUpdate( wxScrollEvent& event );
222 void OnRatio( wxCommandEvent& event );
223 void OnEnableVisual( wxCommandEvent& event );
225 void OnMenuOpen( wxMenuEvent& event );
227 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
228 void OnContextMenu2(wxContextMenuEvent& event);
230 void OnContextMenu(wxMouseEvent& event);
232 DECLARE_EVENT_TABLE();
235 intf_thread_t *p_intf;
238 int i_old_playing_status;
240 /* For auto-generated menus */
241 wxMenu *p_settings_menu;
242 vlc_bool_t b_settings_menu;
243 wxMenu *p_audio_menu;
244 vlc_bool_t b_audio_menu;
245 wxMenu *p_video_menu;
246 vlc_bool_t b_video_menu;
247 wxMenu *p_navig_menu;
248 vlc_bool_t b_navig_menu;
253 /* Dialogs Provider */
254 class DialogsProvider: public wxFrame
258 DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
259 virtual ~DialogsProvider();
262 void Open( int i_access_method, int i_arg );
264 /* Event handlers (these functions should _not_ be virtual) */
265 void OnExit( wxCommandEvent& event );
266 void OnPlaylist( wxCommandEvent& event );
267 void OnMessages( wxCommandEvent& event );
268 void OnFileInfo( wxCommandEvent& event );
269 void OnPreferences( wxCommandEvent& event );
270 void OnStreamDialog( wxCommandEvent& event );
272 void OnOpenFileGeneric( wxCommandEvent& event );
273 void OnOpenFileSimple( wxCommandEvent& event );
274 void OnOpenFile( wxCommandEvent& event );
275 void OnOpenDisc( wxCommandEvent& event );
276 void OnOpenNet( wxCommandEvent& event );
277 void OnOpenSat( wxCommandEvent& event );
279 void OnPopupMenu( wxCommandEvent& event );
281 void OnIdle( wxIdleEvent& event );
283 void OnExitThread( wxCommandEvent& event );
285 DECLARE_EVENT_TABLE();
287 intf_thread_t *p_intf;
290 /* Secondary windows */
291 OpenDialog *p_open_dialog;
292 wxFileDialog *p_file_dialog;
293 Playlist *p_playlist_dialog;
294 Messages *p_messages_dialog;
295 FileInfo *p_fileinfo_dialog;
296 StreamDialog *p_stream_dialog;
297 wxFrame *p_prefs_dialog;
298 wxFileDialog *p_file_generic_dialog;
302 class AutoBuiltPanel;
303 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
306 class SubsFileDialog;
307 class OpenDialog: public wxFrame
311 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
312 int i_access_method, int i_arg = 0 );
314 /* Extended Contructor */
315 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
316 int i_access_method, int i_arg = 0 , int _i_method = 0 );
317 virtual ~OpenDialog();
320 int Show( int i_access_method, int i_arg = 0 );
323 void UpdateMRL( int i_access_method );
328 wxPanel *FilePanel( wxWindow* parent );
329 wxPanel *DiscPanel( wxWindow* parent );
330 wxPanel *NetPanel( wxWindow* parent );
331 wxPanel *V4LPanel( wxWindow* parent );
333 ArrayOfAutoBuiltPanel input_tab_array;
335 /* Event handlers (these functions should _not_ be virtual) */
336 void OnOk( wxCommandEvent& event );
337 void OnCancel( wxCommandEvent& event );
339 void OnPageChange( wxNotebookEvent& event );
340 void OnMRLChange( wxCommandEvent& event );
342 /* Event handlers for the file page */
343 void OnFilePanelChange( wxCommandEvent& event );
344 void OnFileBrowse( wxCommandEvent& event );
346 /* Event handlers for the disc page */
347 void OnDiscPanelChange( wxCommandEvent& event );
348 void OnDiscTypeChange( wxCommandEvent& event );
349 void OnDiscDeviceChange( wxCommandEvent& event );
351 /* Event handlers for the net page */
352 void OnNetPanelChange( wxCommandEvent& event );
353 void OnNetTypeChange( wxCommandEvent& event );
355 /* Event handlers for the v4l page */
356 void OnV4LPanelChange( wxCommandEvent& event );
357 void OnV4LTypeChange( wxCommandEvent& event );
358 void OnV4LSettingsChange( wxCommandEvent& event );
360 /* Event handlers for the stream output */
361 void OnSubsFileEnable( wxCommandEvent& event );
362 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
364 /* Event handlers for the stream output */
365 void OnSoutEnable( wxCommandEvent& event );
366 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
368 DECLARE_EVENT_TABLE();
370 intf_thread_t *p_intf;
372 int i_current_access_method;
373 int i_disc_type_selection;
375 int i_method; /* Normal or for the stream dialog ? */
376 wxComboBox *mrl_combo;
377 wxNotebook *notebook;
379 /* Controls for the file panel */
380 wxComboBox *file_combo;
381 wxFileDialog *file_dialog;
383 /* Controls for the disc panel */
384 wxRadioBox *disc_type;
385 wxTextCtrl *disc_device;
386 wxSpinCtrl *disc_title;
387 wxSpinCtrl *disc_chapter;
389 /* The media equivalent name for a DVD names. For example,
390 "Title", is "Track" for a CD-DA */
391 wxStaticText *disc_title_label;
392 wxStaticText *disc_chapter_label;
394 /* Indicates if the disc device control was modified */
395 bool b_disc_device_changed;
397 /* Controls for the net panel */
398 wxRadioBox *net_type;
400 wxPanel *net_subpanels[4];
401 wxRadioButton *net_radios[4];
402 wxSpinCtrl *net_ports[4];
404 wxTextCtrl *net_addrs[4];
405 wxCheckBox *net_ipv6;
407 /* Controls for the v4l panel */
408 wxRadioBox *video_type;
409 wxTextCtrl *video_device;
410 wxSpinCtrl *video_channel;
411 wxButton *v4l_button;
412 V4LDialog *v4l_dialog;
413 wxArrayString v4l_mrl;
415 /* Controls for the subtitles file */
416 wxButton *subsfile_button;
417 wxCheckBox *subsfile_checkbox;
418 SubsFileDialog *subsfile_dialog;
419 wxArrayString subsfile_mrl;
421 /* Controls for the stream output */
422 wxButton *sout_button;
423 wxCheckBox *sout_checkbox;
424 SoutDialog *sout_dialog;
425 wxArrayString sout_mrl;
441 class V4LDialog: public wxDialog
445 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
446 virtual ~V4LDialog();
448 wxArrayString GetOptions();
452 wxPanel *AudioPanel( wxWindow* parent );
453 wxPanel *CommonPanel( wxWindow* parent );
454 wxPanel *BitratePanel( wxWindow* parent );
457 /* Event handlers (these functions should _not_ be virtual) */
458 void OnOk( wxCommandEvent& event );
459 void OnCancel( wxCommandEvent& event );
460 void OnMRLChange( wxCommandEvent& event );
461 void OnAudioEnable( wxCommandEvent& event );
462 void OnAudioChange( wxCommandEvent& event );
463 void OnAudioChannel( wxCommandEvent& event );
464 void OnSizeEnable( wxCommandEvent& event );
465 void OnSize( wxCommandEvent& event );
466 void OnNormEnable( wxCommandEvent& event );
467 void OnNorm( wxCommandEvent& event );
468 void OnFrequencyEnable( wxCommandEvent& event );
469 void OnFrequency( wxCommandEvent& event );
470 void OnBitrateEnable( wxCommandEvent& event );
471 void OnBitrate( wxCommandEvent& event );
472 void OnMaxBitrateEnable( wxCommandEvent& event );
473 void OnMaxBitrate( wxCommandEvent& event );
475 DECLARE_EVENT_TABLE();
477 intf_thread_t *p_intf;
480 wxComboBox *mrl_combo;
484 /* Controls for the v4l advanced options */
485 wxPanel *common_subpanel;
486 wxPanel *common_panel;
487 wxCheckBox *size_checkbox;
488 wxComboBox *size_combo;
489 wxCheckBox *norm_checkbox;
490 wxComboBox *norm_combo;
491 wxCheckBox *frequency_checkbox;
492 wxSpinCtrl *frequency;
494 wxPanel *audio_subpanel;
495 wxPanel *audio_panel;
496 wxCheckBox *audio_checkbox;
497 wxTextCtrl *audio_device;
498 wxSpinCtrl *audio_channel;
500 wxPanel *bitrate_subpanel;
501 wxPanel *bitrate_panel;
502 wxCheckBox *bitrate_checkbox;
504 wxCheckBox *maxbitrate_checkbox;
505 wxSpinCtrl *maxbitrate;
509 /* Stream output Dialog */
523 TS_ENCAPSULATION = 0,
541 class SoutDialog: public wxDialog
545 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
546 virtual ~SoutDialog();
548 wxArrayString GetOptions();
552 wxPanel *AccessPanel( wxWindow* parent );
553 wxPanel *MiscPanel( wxWindow* parent );
554 wxPanel *EncapsulationPanel( wxWindow* parent );
555 wxPanel *TranscodingPanel( wxWindow* parent );
558 /* Event handlers (these functions should _not_ be virtual) */
559 void OnOk( wxCommandEvent& event );
560 void OnCancel( wxCommandEvent& event );
561 void OnMRLChange( wxCommandEvent& event );
562 void OnAccessTypeChange( wxCommandEvent& event );
564 /* Event handlers for the file access output */
565 void OnFileChange( wxCommandEvent& event );
566 void OnFileBrowse( wxCommandEvent& event );
567 void OnFileDump( wxCommandEvent& event );
569 /* Event handlers for the net access output */
570 void OnNetChange( wxCommandEvent& event );
572 /* Event specific to the announce address */
573 void OnAnnounceAddrChange( wxCommandEvent& event );
575 /* Event handlers for the encapsulation panel */
576 void OnEncapsulationChange( wxCommandEvent& event );
578 /* Event handlers for the transcoding panel */
579 void OnTranscodingEnable( wxCommandEvent& event );
580 void OnTranscodingChange( wxCommandEvent& event );
582 /* Event handlers for the misc panel */
583 void OnSAPMiscChange( wxCommandEvent& event );
584 void OnSLPMiscChange( wxCommandEvent& event );
586 DECLARE_EVENT_TABLE();
588 intf_thread_t *p_intf;
591 wxComboBox *mrl_combo;
593 /* Controls for the access outputs */
594 wxPanel *access_panel;
595 wxPanel *access_subpanels[ACCESS_OUT_NUM];
596 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
600 wxComboBox *file_combo;
601 wxCheckBox *dump_checkbox;
602 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
603 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
605 /* Controls for the SAP announces */
607 wxPanel *misc_subpanels[MISC_SOUT_NUM];
608 wxCheckBox *sap_checkbox;
609 wxCheckBox *slp_checkbox;
610 wxTextCtrl *announce_addr;
612 /* Controls for the encapsulation */
613 wxPanel *encapsulation_panel;
614 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
615 int i_encapsulation_type;
617 /* Controls for transcoding */
618 wxPanel *transcoding_panel;
619 wxCheckBox *video_transc_checkbox;
620 wxComboBox *video_codec_combo;
621 wxComboBox *audio_codec_combo;
622 wxCheckBox *audio_transc_checkbox;
623 wxComboBox *video_bitrate_combo;
624 wxComboBox *audio_bitrate_combo;
625 wxComboBox *audio_channels_combo;
626 wxComboBox *video_scale_combo;
629 /* Subtitles File Dialog */
630 class SubsFileDialog: public wxDialog
634 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
635 virtual ~SubsFileDialog();
637 wxComboBox *file_combo;
638 wxComboBox *encoding_combo;
639 wxSpinCtrl *delay_spinctrl;
640 wxSpinCtrl *fps_spinctrl;
643 /* Event handlers (these functions should _not_ be virtual) */
644 void OnOk( wxCommandEvent& event );
645 void OnCancel( wxCommandEvent& event );
646 void OnFileBrowse( wxCommandEvent& event );
648 DECLARE_EVENT_TABLE();
650 intf_thread_t *p_intf;
655 class StreamDialog: public wxFrame
659 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
660 virtual ~StreamDialog();
663 void OnClose( wxCommandEvent& event );
664 void OnOpen( wxCommandEvent& event );
665 void OnSout( wxCommandEvent& event );
666 void OnStart( wxCommandEvent& event );
668 DECLARE_EVENT_TABLE();
670 intf_thread_t *p_intf;
672 wxStaticText *step2_label;
673 wxStaticText *step3_label;
674 wxButton *sout_button;
675 wxButton *start_button;
677 wxArrayString sout_mrl;
678 OpenDialog *p_open_dialog;
679 SoutDialog *p_sout_dialog;
684 /* Preferences Dialog */
686 class PrefsDialog: public wxFrame
690 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
691 virtual ~PrefsDialog();
694 wxPanel *PrefsPanel( wxWindow* parent );
696 /* Event handlers (these functions should _not_ be virtual) */
697 void OnOk( wxCommandEvent& event );
698 void OnCancel( wxCommandEvent& event );
699 void OnSave( wxCommandEvent& event );
700 void OnResetAll( wxCommandEvent& event );
701 void OnAdvanced( wxCommandEvent& event );
703 DECLARE_EVENT_TABLE();
705 intf_thread_t *p_intf;
707 PrefsTreeCtrl *prefs_tree;
711 class Messages: public wxFrame
715 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
717 bool Show( bool show = TRUE );
721 /* Event handlers (these functions should _not_ be virtual) */
722 void OnClose( wxCommandEvent& event );
723 void OnClear( wxCommandEvent& event );
724 void OnSaveLog( wxCommandEvent& event );
726 DECLARE_EVENT_TABLE();
728 intf_thread_t *p_intf;
729 wxTextCtrl *textctrl;
730 wxTextAttr *info_attr;
731 wxTextAttr *err_attr;
732 wxTextAttr *warn_attr;
733 wxTextAttr *dbg_attr;
735 wxFileDialog *save_log_dialog;
737 vlc_bool_t b_verbose;
741 class ItemInfoDialog;
743 class Playlist: public wxFrame
747 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
750 void UpdatePlaylist();
751 void ShowPlaylist( bool show );
752 void UpdateItem( int );
758 void DeleteItem( int item );
759 void ShowInfos( int item );
761 /* Event handlers (these functions should _not_ be virtual) */
762 void OnAddFile( wxCommandEvent& event );
763 void OnAddMRL( wxCommandEvent& event );
764 void OnClose( wxCommandEvent& event );
765 void OnSearch( wxCommandEvent& event );
766 void OnEnDis( wxCommandEvent& event );
767 void OnInfos( wxCommandEvent& event );
768 void OnSearchTextChange( wxCommandEvent& event );
769 void OnOpen( wxCommandEvent& event );
770 void OnSave( wxCommandEvent& event );
772 void OnSort( wxCommandEvent& event );
773 void OnColSelect( wxListEvent& event );
775 void OnUp( wxCommandEvent& event);
776 void OnDown( wxCommandEvent& event);
778 void OnEnableSelection( wxCommandEvent& event );
779 void OnDisableSelection( wxCommandEvent& event );
780 void OnInvertSelection( wxCommandEvent& event );
781 void OnDeleteSelection( wxCommandEvent& event );
782 void OnSelectAll( wxCommandEvent& event );
783 void OnRandom( wxCommandEvent& event );
784 void OnRepeat( wxCommandEvent& event );
785 void OnLoop ( wxCommandEvent& event );
786 void OnActivateItem( wxListEvent& event );
787 void OnKeyDown( wxListEvent& event );
788 void OnNewGroup( wxCommandEvent& event );
790 /* Popup functions */
791 void OnPopup( wxListEvent& event );
792 void OnPopupPlay( wxMenuEvent& event );
793 void OnPopupDel( wxMenuEvent& event );
794 void OnPopupEna( wxMenuEvent& event );
795 void OnPopupInfo( wxMenuEvent& event );
798 wxTextCtrl *search_text;
799 wxButton *search_button;
800 DECLARE_EVENT_TABLE();
804 ItemInfoDialog *iteminfo_dialog;
806 intf_thread_t *p_intf;
807 wxListView *listview;
808 wxTreeCtrl *treeview;
809 int i_update_counter;
820 class NewGroup: public wxDialog
824 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
829 /* Event handlers (these functions should _not_ be virtual) */
830 void OnOk( wxCommandEvent& event );
831 void OnCancel( wxCommandEvent& event );
833 DECLARE_EVENT_TABLE();
835 intf_thread_t *p_intf;
836 wxTextCtrl *groupname;
839 friend class Playlist;
840 friend class ItemInfoDialog;
845 /* ItemInfo Dialog */
846 class ItemInfoDialog: public wxDialog
850 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
851 wxWindow *p_parent );
852 virtual ~ItemInfoDialog();
854 wxArrayString GetOptions();
857 wxPanel *InfoPanel( wxWindow* parent );
858 wxPanel *GroupPanel( wxWindow* parent );
860 /* Event handlers (these functions should _not_ be virtual) */
861 void OnOk( wxCommandEvent& event );
862 void OnCancel( wxCommandEvent& event );
863 void OnNewGroup( wxCommandEvent& event );
867 DECLARE_EVENT_TABLE();
869 intf_thread_t *p_intf;
870 playlist_item_t *p_item;
873 /* Controls for the iteminfo dialog box */
874 wxPanel *info_subpanel;
877 wxPanel *group_subpanel;
878 wxPanel *group_panel;
880 wxTextCtrl *uri_text;
881 wxTextCtrl *name_text;
882 wxTextCtrl *author_text;
884 wxTreeCtrl *info_tree;
885 wxTreeItemId info_root;
887 wxCheckBox *enabled_checkbox;
888 wxComboBox *group_combo;
894 class FileInfo: public wxFrame
898 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
900 void UpdateFileInfo();
903 void OnClose( wxCommandEvent& event );
905 DECLARE_EVENT_TABLE();
907 intf_thread_t *p_intf;
908 wxTreeCtrl *fileinfo_tree;
909 wxTreeItemId fileinfo_root;
910 wxString fileinfo_root_label;
915 #if !defined(__WXX11__)
916 /* Drag and Drop class */
917 class DragAndDrop: public wxFileDropTarget
920 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
922 virtual bool OnDropFiles( wxCoord x, wxCoord y,
923 const wxArrayString& filenames );
926 intf_thread_t *p_intf;
927 vlc_bool_t b_enqueue;
932 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
933 const wxPoint& pos );
934 wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
935 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
936 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
937 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
939 class MenuEvtHandler : public wxEvtHandler
942 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
943 virtual ~MenuEvtHandler();
945 void OnMenuEvent( wxCommandEvent& event );
946 void OnShowDialog( wxCommandEvent& event );
950 DECLARE_EVENT_TABLE()
952 intf_thread_t *p_intf;
953 Interface *p_main_interface;
956 class Menu: public wxMenu
960 Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
961 char **ppsz_names, int *pi_objects, int i_start_id );
965 /* Event handlers (these functions should _not_ be virtual) */
966 void OnClose( wxCommandEvent& event );
967 void OnShowDialog( wxCommandEvent& event );
968 void OnEntrySelected( wxCommandEvent& event );
970 wxMenu *Menu::CreateDummyMenu();
971 void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
972 wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t * );
974 DECLARE_EVENT_TABLE();
976 intf_thread_t *p_intf;
981 static inline int ConvertHotkeyModifiers( int i_hotkey )
983 int i_accel_flags = 0;
984 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
985 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
986 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
987 return i_accel_flags;
990 static inline int ConvertHotkey( int i_hotkey )
992 int i_key = i_hotkey & ~KEY_MODIFIER;
993 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
994 else if( i_key & KEY_SPECIAL )
998 case KEY_LEFT: return WXK_LEFT;
999 case KEY_RIGHT: return WXK_RIGHT;
1000 case KEY_UP: return WXK_UP;
1001 case KEY_DOWN: return WXK_DOWN;
1002 case KEY_SPACE: return WXK_SPACE;
1003 case KEY_ENTER: return WXK_RETURN;
1004 case KEY_F1: return WXK_F1;
1005 case KEY_F2: return WXK_F2;
1006 case KEY_F3: return WXK_F3;
1007 case KEY_F4: return WXK_F4;
1008 case KEY_F5: return WXK_F5;
1009 case KEY_F6: return WXK_F6;
1010 case KEY_F7: return WXK_F7;
1011 case KEY_F8: return WXK_F8;
1012 case KEY_F9: return WXK_F9;
1013 case KEY_F10: return WXK_F10;
1014 case KEY_F11: return WXK_F11;
1015 case KEY_F12: return WXK_F12;
1016 case KEY_HOME: return WXK_HOME;
1017 case KEY_END: return WXK_HOME;
1018 case KEY_MENU: return WXK_MENU;
1019 case KEY_ESC: return WXK_ESCAPE;
1020 case KEY_PAGEUP: return WXK_PRIOR;
1021 case KEY_PAGEDOWN: return WXK_NEXT;
1022 case KEY_TAB: return WXK_TAB;
1023 case KEY_BACKSPACE: return WXK_BACK;