1 /*****************************************************************************
2 * wxwindows.h: private wxWindows interface description
3 *****************************************************************************
4 * Copyright (C) 1999, 2000 VideoLAN
5 * $Id: wxwindows.h,v 1.77 2003/12/10 21:54:17 courmisch 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
85 wxArrayString SeparateEntries( wxString );
87 /*****************************************************************************
88 * intf_sys_t: description and status of wxwindows interface
89 *****************************************************************************/
92 /* the wx parent window */
99 /* The input thread */
100 input_thread_t * p_input;
103 int i_slider_pos; /* slider position */
104 int i_slider_oldpos; /* previous position */
105 vlc_bool_t b_slider_free; /* slider status */
107 /* The messages window */
108 msg_subscription_t* p_sub; /* message bank subscription */
110 /* Playlist management */
111 int i_playing; /* playlist selected item */
113 /* Send an event to show a dialog */
114 void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
115 intf_dialog_args_t *p_arg );
118 wxMenu *p_popup_menu;
122 /*****************************************************************************
124 *****************************************************************************/
126 /*****************************************************************************
127 * Classes declarations.
128 *****************************************************************************/
132 class Timer: public wxTimer
136 Timer( intf_thread_t *p_intf, Interface *p_main_interface );
139 virtual void Notify();
142 intf_thread_t *p_intf;
143 Interface *p_main_interface;
144 int i_old_playing_status;
149 class Interface: public wxFrame
153 Interface( intf_thread_t *p_intf );
154 virtual ~Interface();
155 void TogglePlayButton( int i_playing_status );
157 // wxFlexGridSizer *frame_sizer;
158 wxBoxSizer *frame_sizer;
159 wxStatusBar *statusbar;
162 wxWindow *slider_frame;
163 wxWindow *extra_frame;
164 wxStaticBox *slider_box;
168 wxStaticBox *adjust_box;
169 wxSlider *brightness_slider;
170 wxSlider *contrast_slider;
171 wxSlider *saturation_slider;
172 wxSlider *hue_slider;
174 wxStaticBox *other_box;
175 wxComboBox *ratio_combo;
180 void UpdateAcceleratorTable();
181 void CreateOurMenuBar();
182 void CreateOurToolBar();
183 void CreateOurExtraPanel();
184 void CreateOurSlider();
185 void Open( int i_access_method );
187 /* Event handlers (these functions should _not_ be virtual) */
188 void OnExit( wxCommandEvent& event );
189 void OnAbout( wxCommandEvent& event );
191 void OnOpenFileSimple( wxCommandEvent& event );
192 void OnOpenFile( wxCommandEvent& event );
193 void OnOpenDisc( wxCommandEvent& event );
194 void OnOpenNet( wxCommandEvent& event );
195 void OnOpenSat( wxCommandEvent& event );
196 void OnOpenV4L( wxCommandEvent& event );
197 void OnStream( wxCommandEvent& event );
198 void OnExtra( wxCommandEvent& event );
199 void OnShowDialog( wxCommandEvent& event );
200 void OnPlayStream( wxCommandEvent& event );
201 void OnStopStream( wxCommandEvent& event );
202 void OnSliderUpdate( wxScrollEvent& event );
203 void OnPrevStream( wxCommandEvent& event );
204 void OnNextStream( wxCommandEvent& event );
205 void OnSlowStream( wxCommandEvent& event );
206 void OnFastStream( wxCommandEvent& event );
208 void OnEnableAdjust( wxCommandEvent& event );
209 void OnHueUpdate( wxScrollEvent& event );
210 void OnContrastUpdate( wxScrollEvent& event );
211 void OnBrightnessUpdate( wxScrollEvent& event );
212 void OnSaturationUpdate( wxScrollEvent& event );
214 void OnRatio( wxCommandEvent& event );
215 void OnEnableVisual( wxCommandEvent& event );
217 void OnMenuOpen( wxMenuEvent& event );
219 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
220 void OnContextMenu2(wxContextMenuEvent& event);
222 void OnContextMenu(wxMouseEvent& event);
224 DECLARE_EVENT_TABLE();
227 intf_thread_t *p_intf;
230 int i_old_playing_status;
232 /* For auto-generated menus */
233 wxMenu *p_settings_menu;
234 vlc_bool_t b_settings_menu;
235 wxMenu *p_audio_menu;
236 vlc_bool_t b_audio_menu;
237 wxMenu *p_video_menu;
238 vlc_bool_t b_video_menu;
239 wxMenu *p_navig_menu;
240 vlc_bool_t b_navig_menu;
245 /* Dialogs Provider */
246 class DialogsProvider: public wxFrame
250 DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );
251 virtual ~DialogsProvider();
254 void Open( int i_access_method, int i_arg );
256 /* Event handlers (these functions should _not_ be virtual) */
257 void OnExit( wxCommandEvent& event );
258 void OnPlaylist( wxCommandEvent& event );
259 void OnMessages( wxCommandEvent& event );
260 void OnFileInfo( wxCommandEvent& event );
261 void OnPreferences( wxCommandEvent& event );
262 void OnStreamDialog( wxCommandEvent& event );
264 void OnOpenFileGeneric( wxCommandEvent& event );
265 void OnOpenFileSimple( wxCommandEvent& event );
266 void OnOpenFile( wxCommandEvent& event );
267 void OnOpenDisc( wxCommandEvent& event );
268 void OnOpenNet( wxCommandEvent& event );
269 void OnOpenSat( wxCommandEvent& event );
271 void OnPopupMenu( wxCommandEvent& event );
273 void OnIdle( wxIdleEvent& event );
275 void OnExitThread( wxCommandEvent& event );
277 DECLARE_EVENT_TABLE();
279 intf_thread_t *p_intf;
282 /* Secondary windows */
283 OpenDialog *p_open_dialog;
284 wxFileDialog *p_file_dialog;
285 Playlist *p_playlist_dialog;
286 Messages *p_messages_dialog;
287 FileInfo *p_fileinfo_dialog;
288 StreamDialog *p_stream_dialog;
289 wxFrame *p_prefs_dialog;
290 wxFileDialog *p_file_generic_dialog;
294 class AutoBuiltPanel;
295 WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
298 class SubsFileDialog;
299 class OpenDialog: public wxFrame
303 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
304 int i_access_method, int i_arg = 0 );
306 /* Extended Contructor */
307 OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
308 int i_access_method, int i_arg = 0 , int _i_method = 0 );
309 virtual ~OpenDialog();
312 int Show( int i_access_method, int i_arg = 0 );
315 void UpdateMRL( int i_access_method );
320 wxPanel *FilePanel( wxWindow* parent );
321 wxPanel *DiscPanel( wxWindow* parent );
322 wxPanel *NetPanel( wxWindow* parent );
323 wxPanel *V4LPanel( wxWindow* parent );
325 ArrayOfAutoBuiltPanel input_tab_array;
327 /* Event handlers (these functions should _not_ be virtual) */
328 void OnOk( wxCommandEvent& event );
329 void OnCancel( wxCommandEvent& event );
331 void OnPageChange( wxNotebookEvent& event );
332 void OnMRLChange( wxCommandEvent& event );
334 /* Event handlers for the file page */
335 void OnFilePanelChange( wxCommandEvent& event );
336 void OnFileBrowse( wxCommandEvent& event );
338 /* Event handlers for the disc page */
339 void OnDiscPanelChange( wxCommandEvent& event );
340 void OnDiscTypeChange( wxCommandEvent& event );
341 void OnDiscDeviceChange( wxCommandEvent& event );
343 /* Event handlers for the net page */
344 void OnNetPanelChange( wxCommandEvent& event );
345 void OnNetTypeChange( wxCommandEvent& event );
347 /* Event handlers for the v4l page */
348 void OnV4LPanelChange( wxCommandEvent& event );
349 void OnV4LTypeChange( wxCommandEvent& event );
350 void OnV4LSettingsChange( wxCommandEvent& event );
352 /* Event handlers for the stream output */
353 void OnSubsFileEnable( wxCommandEvent& event );
354 void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );
356 /* Event handlers for the stream output */
357 void OnSoutEnable( wxCommandEvent& event );
358 void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
360 DECLARE_EVENT_TABLE();
362 intf_thread_t *p_intf;
364 int i_current_access_method;
366 int i_method; /* Normal or for the stream dialog ? */
367 wxComboBox *mrl_combo;
368 wxNotebook *notebook;
370 /* Controls for the file panel */
371 wxComboBox *file_combo;
372 wxFileDialog *file_dialog;
374 /* Controls for the disc panel */
375 wxRadioBox *disc_type;
376 wxTextCtrl *disc_device;
377 wxSpinCtrl *disc_title;
378 wxSpinCtrl *disc_chapter;
380 /* Indicates if the disc device control was modified */
381 bool b_disc_device_changed;
383 /* Controls for the net panel */
384 wxRadioBox *net_type;
386 wxPanel *net_subpanels[4];
387 wxRadioButton *net_radios[4];
388 wxSpinCtrl *net_ports[4];
390 wxTextCtrl *net_addrs[4];
391 wxCheckBox *net_ipv6;
393 /* Controls for the v4l panel */
394 wxRadioBox *video_type;
395 wxTextCtrl *video_device;
396 wxSpinCtrl *video_channel;
397 wxButton *v4l_button;
398 V4LDialog *v4l_dialog;
399 wxArrayString v4l_mrl;
401 /* Controls for the subtitles file */
402 wxButton *subsfile_button;
403 wxCheckBox *subsfile_checkbox;
404 SubsFileDialog *subsfile_dialog;
405 wxArrayString subsfile_mrl;
407 /* Controls for the stream output */
408 wxButton *sout_button;
409 wxCheckBox *sout_checkbox;
410 SoutDialog *sout_dialog;
411 wxArrayString sout_mrl;
427 class V4LDialog: public wxDialog
431 V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent );
432 virtual ~V4LDialog();
434 wxArrayString GetOptions();
438 wxPanel *AudioPanel( wxWindow* parent );
439 wxPanel *CommonPanel( wxWindow* parent );
440 wxPanel *BitratePanel( wxWindow* parent );
443 /* Event handlers (these functions should _not_ be virtual) */
444 void OnOk( wxCommandEvent& event );
445 void OnCancel( wxCommandEvent& event );
446 void OnMRLChange( wxCommandEvent& event );
447 void OnAudioEnable( wxCommandEvent& event );
448 void OnAudioChange( wxCommandEvent& event );
449 void OnAudioChannel( wxCommandEvent& event );
450 void OnSizeEnable( wxCommandEvent& event );
451 void OnSize( wxCommandEvent& event );
452 void OnNormEnable( wxCommandEvent& event );
453 void OnNorm( wxCommandEvent& event );
454 void OnFrequencyEnable( wxCommandEvent& event );
455 void OnFrequency( wxCommandEvent& event );
456 void OnBitrateEnable( wxCommandEvent& event );
457 void OnBitrate( wxCommandEvent& event );
458 void OnMaxBitrateEnable( wxCommandEvent& event );
459 void OnMaxBitrate( wxCommandEvent& event );
461 DECLARE_EVENT_TABLE();
463 intf_thread_t *p_intf;
466 wxComboBox *mrl_combo;
470 /* Controls for the v4l advanced options */
471 wxPanel *common_subpanel;
472 wxPanel *common_panel;
473 wxCheckBox *size_checkbox;
474 wxComboBox *size_combo;
475 wxCheckBox *norm_checkbox;
476 wxComboBox *norm_combo;
477 wxCheckBox *frequency_checkbox;
478 wxSpinCtrl *frequency;
480 wxPanel *audio_subpanel;
481 wxPanel *audio_panel;
482 wxCheckBox *audio_checkbox;
483 wxTextCtrl *audio_device;
484 wxSpinCtrl *audio_channel;
486 wxPanel *bitrate_subpanel;
487 wxPanel *bitrate_panel;
488 wxCheckBox *bitrate_checkbox;
490 wxCheckBox *maxbitrate_checkbox;
491 wxSpinCtrl *maxbitrate;
495 /* Stream output Dialog */
509 TS_ENCAPSULATION = 0,
526 class SoutDialog: public wxDialog
530 SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
531 virtual ~SoutDialog();
533 wxArrayString GetOptions();
537 wxPanel *AccessPanel( wxWindow* parent );
538 wxPanel *MiscPanel( wxWindow* parent );
539 wxPanel *EncapsulationPanel( wxWindow* parent );
540 wxPanel *TranscodingPanel( wxWindow* parent );
543 /* Event handlers (these functions should _not_ be virtual) */
544 void OnOk( wxCommandEvent& event );
545 void OnCancel( wxCommandEvent& event );
546 void OnMRLChange( wxCommandEvent& event );
547 void OnAccessTypeChange( wxCommandEvent& event );
549 /* Event handlers for the file access output */
550 void OnFileChange( wxCommandEvent& event );
551 void OnFileBrowse( wxCommandEvent& event );
552 void OnFileDump( wxCommandEvent& event );
554 /* Event handlers for the net access output */
555 void OnNetChange( wxCommandEvent& event );
557 /* Event specific to the announce address */
558 void OnAnnounceAddrChange( wxCommandEvent& event );
560 /* Event handlers for the encapsulation panel */
561 void OnEncapsulationChange( wxCommandEvent& event );
563 /* Event handlers for the transcoding panel */
564 void OnTranscodingEnable( wxCommandEvent& event );
565 void OnTranscodingChange( wxCommandEvent& event );
567 /* Event handlers for the misc panel */
568 void OnSAPMiscChange( wxCommandEvent& event );
569 void OnSLPMiscChange( wxCommandEvent& event );
571 DECLARE_EVENT_TABLE();
573 intf_thread_t *p_intf;
576 wxComboBox *mrl_combo;
578 /* Controls for the access outputs */
579 wxPanel *access_panel;
580 wxPanel *access_subpanels[ACCESS_OUT_NUM];
581 wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
585 wxComboBox *file_combo;
586 wxCheckBox *dump_checkbox;
587 wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
588 wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
590 /* Controls for the SAP announces */
592 wxPanel *misc_subpanels[MISC_SOUT_NUM];
593 wxCheckBox *sap_checkbox;
594 wxCheckBox *slp_checkbox;
595 wxTextCtrl *announce_addr;
597 /* Controls for the encapsulation */
598 wxPanel *encapsulation_panel;
599 wxRadioButton *encapsulation_radios[ENCAPS_NUM];
600 int i_encapsulation_type;
602 /* Controls for transcoding */
603 wxPanel *transcoding_panel;
604 wxCheckBox *video_transc_checkbox;
605 wxComboBox *video_codec_combo;
606 wxComboBox *audio_codec_combo;
607 wxCheckBox *audio_transc_checkbox;
608 wxComboBox *video_bitrate_combo;
609 wxComboBox *audio_bitrate_combo;
610 wxComboBox *audio_channels_combo;
613 /* Subtitles File Dialog */
614 class SubsFileDialog: public wxDialog
618 SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
619 virtual ~SubsFileDialog();
621 wxComboBox *file_combo;
622 wxComboBox *encoding_combo;
623 wxSpinCtrl *delay_spinctrl;
624 wxSpinCtrl *fps_spinctrl;
627 /* Event handlers (these functions should _not_ be virtual) */
628 void OnOk( wxCommandEvent& event );
629 void OnCancel( wxCommandEvent& event );
630 void OnFileBrowse( wxCommandEvent& event );
632 DECLARE_EVENT_TABLE();
634 intf_thread_t *p_intf;
639 class StreamDialog: public wxFrame
643 StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
644 virtual ~StreamDialog();
647 void OnClose( wxCommandEvent& event );
648 void OnOpen( wxCommandEvent& event );
649 void OnSout( wxCommandEvent& event );
650 void OnStart( wxCommandEvent& event );
652 DECLARE_EVENT_TABLE();
654 intf_thread_t *p_intf;
656 wxStaticText *step2_label;
657 wxStaticText *step3_label;
658 wxButton *sout_button;
659 wxButton *start_button;
661 wxArrayString sout_mrl;
662 OpenDialog *p_open_dialog;
663 SoutDialog *p_sout_dialog;
668 /* Preferences Dialog */
670 class PrefsDialog: public wxFrame
674 PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
675 virtual ~PrefsDialog();
678 wxPanel *PrefsPanel( wxWindow* parent );
680 /* Event handlers (these functions should _not_ be virtual) */
681 void OnOk( wxCommandEvent& event );
682 void OnCancel( wxCommandEvent& event );
683 void OnSave( wxCommandEvent& event );
684 void OnResetAll( wxCommandEvent& event );
685 void OnAdvanced( wxCommandEvent& event );
687 DECLARE_EVENT_TABLE();
689 intf_thread_t *p_intf;
691 PrefsTreeCtrl *prefs_tree;
695 class Messages: public wxFrame
699 Messages( intf_thread_t *p_intf, wxWindow *p_parent );
701 bool Show( bool show = TRUE );
705 /* Event handlers (these functions should _not_ be virtual) */
706 void OnClose( wxCommandEvent& event );
707 void OnClear( wxCommandEvent& event );
708 void OnSaveLog( wxCommandEvent& event );
710 DECLARE_EVENT_TABLE();
712 intf_thread_t *p_intf;
713 wxTextCtrl *textctrl;
714 wxTextAttr *info_attr;
715 wxTextAttr *err_attr;
716 wxTextAttr *warn_attr;
717 wxTextAttr *dbg_attr;
719 wxFileDialog *save_log_dialog;
721 vlc_bool_t b_verbose;
725 class ItemInfoDialog;
727 class Playlist: public wxFrame
731 Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
734 void UpdatePlaylist();
735 void ShowPlaylist( bool show );
741 void DeleteItem( int item );
743 /* Event handlers (these functions should _not_ be virtual) */
744 void OnAddFile( wxCommandEvent& event );
745 void OnAddMRL( wxCommandEvent& event );
746 void OnClose( wxCommandEvent& event );
747 void OnSearch( wxCommandEvent& event );
748 void OnEnDis( wxCommandEvent& event );
749 void OnInfos( wxCommandEvent& event );
750 void OnSearchTextChange( wxCommandEvent& event );
751 void OnOpen( wxCommandEvent& event );
752 void OnSave( wxCommandEvent& event );
754 void OnSort( wxCommandEvent& event );
755 void OnColSelect( wxListEvent& event );
757 void OnUp( wxCommandEvent& event);
758 void OnDown( wxCommandEvent& event);
760 void OnEnableSelection( wxCommandEvent& event );
761 void OnDisableSelection( wxCommandEvent& event );
762 void OnInvertSelection( wxCommandEvent& event );
763 void OnDeleteSelection( wxCommandEvent& event );
764 void OnSelectAll( wxCommandEvent& event );
765 void OnRandom( wxCommandEvent& event );
766 void OnRepeat( wxCommandEvent& event );
767 void OnLoop ( wxCommandEvent& event );
768 void OnActivateItem( wxListEvent& event );
769 void OnKeyDown( wxListEvent& event );
770 void OnNewGroup( wxCommandEvent& event );
774 wxTextCtrl *search_text;
775 wxButton *search_button;
776 DECLARE_EVENT_TABLE();
779 ItemInfoDialog *iteminfo_dialog;
781 intf_thread_t *p_intf;
782 wxListView *listview;
783 wxTreeCtrl *treeview;
784 int i_update_counter;
793 class NewGroup: public wxDialog
797 NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
802 /* Event handlers (these functions should _not_ be virtual) */
803 void OnOk( wxCommandEvent& event );
804 void OnCancel( wxCommandEvent& event );
806 DECLARE_EVENT_TABLE();
808 intf_thread_t *p_intf;
809 wxTextCtrl *groupname;
812 friend class Playlist;
813 friend class ItemInfoDialog;
818 /* ItemInfo Dialog */
819 class ItemInfoDialog: public wxDialog
823 ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
824 wxWindow *p_parent );
825 virtual ~ItemInfoDialog();
827 wxArrayString GetOptions();
830 wxPanel *InfoPanel( wxWindow* parent );
831 wxPanel *GroupPanel( wxWindow* parent );
833 /* Event handlers (these functions should _not_ be virtual) */
834 void OnOk( wxCommandEvent& event );
835 void OnCancel( wxCommandEvent& event );
836 void OnNewGroup( wxCommandEvent& event );
838 DECLARE_EVENT_TABLE();
840 intf_thread_t *p_intf;
841 playlist_item_t *p_item;
844 /* Controls for the iteminfo dialog box */
845 wxPanel *info_subpanel;
848 wxPanel *group_subpanel;
849 wxPanel *group_panel;
851 wxTextCtrl *uri_text;
852 wxTextCtrl *name_text;
853 wxTextCtrl *author_text;
855 wxCheckBox *enabled_checkbox;
856 wxComboBox *group_combo;
862 class FileInfo: public wxFrame
866 FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
868 void UpdateFileInfo();
871 void OnClose( wxCommandEvent& event );
873 DECLARE_EVENT_TABLE();
875 intf_thread_t *p_intf;
876 wxTreeCtrl *fileinfo_tree;
877 wxTreeItemId fileinfo_root;
878 wxString fileinfo_root_label;
883 #if !defined(__WXX11__)
884 /* Drag and Drop class */
885 class DragAndDrop: public wxFileDropTarget
888 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
890 virtual bool OnDropFiles( wxCoord x, wxCoord y,
891 const wxArrayString& filenames );
894 intf_thread_t *p_intf;
895 vlc_bool_t b_enqueue;
900 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
901 const wxPoint& pos );
902 wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
903 wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
904 wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
905 wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
907 class MenuEvtHandler : public wxEvtHandler
910 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
911 virtual ~MenuEvtHandler();
913 void OnMenuEvent( wxCommandEvent& event );
914 void OnShowDialog( wxCommandEvent& event );
918 DECLARE_EVENT_TABLE()
920 intf_thread_t *p_intf;
921 Interface *p_main_interface;
924 class Menu: public wxMenu
928 Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
929 char **ppsz_names, int *pi_objects, int i_start_id );
933 /* Event handlers (these functions should _not_ be virtual) */
934 void OnClose( wxCommandEvent& event );
935 void OnShowDialog( wxCommandEvent& event );
936 void OnEntrySelected( wxCommandEvent& event );
938 wxMenu *Menu::CreateDummyMenu();
939 void Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
940 wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t * );
942 DECLARE_EVENT_TABLE();
944 intf_thread_t *p_intf;
949 static inline int ConvertHotkeyModifiers( int i_hotkey )
951 int i_accel_flags = 0;
952 if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
953 if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
954 if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
955 return i_accel_flags;
958 static inline int ConvertHotkey( int i_hotkey )
960 int i_key = i_hotkey & ~KEY_MODIFIER;
961 if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
962 else if( i_key & KEY_SPECIAL )
966 case KEY_LEFT: return WXK_LEFT;
967 case KEY_RIGHT: return WXK_RIGHT;
968 case KEY_UP: return WXK_UP;
969 case KEY_DOWN: return WXK_DOWN;
970 case KEY_SPACE: return WXK_SPACE;
971 case KEY_ENTER: return WXK_RETURN;
972 case KEY_F1: return WXK_F1;
973 case KEY_F2: return WXK_F2;
974 case KEY_F3: return WXK_F3;
975 case KEY_F4: return WXK_F4;
976 case KEY_F5: return WXK_F5;
977 case KEY_F6: return WXK_F6;
978 case KEY_F7: return WXK_F7;
979 case KEY_F8: return WXK_F8;
980 case KEY_F9: return WXK_F9;
981 case KEY_F10: return WXK_F10;
982 case KEY_F11: return WXK_F11;
983 case KEY_F12: return WXK_F12;
984 case KEY_HOME: return WXK_HOME;
985 case KEY_END: return WXK_HOME;
986 case KEY_MENU: return WXK_MENU;
987 case KEY_ESC: return WXK_ESCAPE;
988 case KEY_PAGEUP: return WXK_PRIOR;
989 case KEY_PAGEDOWN: return WXK_NEXT;
990 case KEY_TAB: return WXK_TAB;
991 case KEY_BACKSPACE: return WXK_BACK;