📄 wxwindows.h
字号:
/***************************************************************************** * wxwindows.h: private wxWindows interface description ***************************************************************************** * Copyright (C) 1999-2005 VideoLAN * $Id: wxwindows.h 11236 2005-06-01 19:53:37Z courmisch $ * * Authors: Gildas Bazin <gbazin@videolan.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. *****************************************************************************/#ifdef WIN32 /* mingw32 hack */#undef Yield#undef CreateDialog#endif/* Let vlc take care of the i18n stuff */#define WXINTL_NO_GETTEXT_MACRO#include <wx/wxprec.h>#include <wx/wx.h>#include <wx/listctrl.h>#include <wx/textctrl.h>#include <wx/notebook.h>#include <wx/spinctrl.h>#include <wx/dnd.h>#include <wx/treectrl.h>#include <wx/gauge.h>#include <wx/accel.h>#include <wx/checkbox.h>#include <wx/wizard.h>#include <wx/taskbar.h>#include "vlc_keys.h"#if (!wxCHECK_VERSION(2,5,0))typedef long wxTreeItemIdValue;#endifDECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );#define SLIDER_MAX_POS 10000/* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */#if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )#if wxUSE_UNICODE# define wxU(utf8) wxString(utf8, wxConvUTF8)#else# define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)#endif#define ISUTF8 1#else // ENABLE_NLS && ENABLE_UTF8#if wxUSE_UNICODE# define wxU(ansi) wxString(ansi, wxConvLocal)#else# define wxU(ansi) (ansi)#endif#define ISUTF8 0#endif/* wxL2U (locale to unicode) is used to convert ansi strings to unicode * strings (wchar_t) */#define wxL2U(ansi) wxU(ansi)#define WRAPCOUNT 80#define OPEN_NORMAL 0#define OPEN_STREAM 1#define MODE_NONE 0#define MODE_GROUP 1#define MODE_AUTHOR 2#define MODE_TITLE 3enum{ ID_CONTROLS_TIMER, ID_SLIDER_TIMER,};class DialogsProvider;class PrefsTreeCtrl;class AutoBuiltPanel;class VideoWindow;class WindowSettings;/***************************************************************************** * intf_sys_t: description and status of wxwindows interface *****************************************************************************/struct intf_sys_t{ /* the wx parent window */ wxWindow *p_wxwindow; wxIcon *p_icon; /* window settings */ WindowSettings *p_window_settings; /* special actions */ vlc_bool_t b_playing; vlc_bool_t b_intf_show; /* interface to be shown */ /* The input thread */ input_thread_t * p_input; /* The slider */ int i_slider_pos; /* slider position */ int i_slider_oldpos; /* previous position */ vlc_bool_t b_slider_free; /* slider status */ /* The messages window */ msg_subscription_t* p_sub; /* message bank subscription */ /* Playlist management */ int i_playing; /* playlist selected item */ unsigned i_playlist_usage; /* Send an event to show a dialog */ void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg, intf_dialog_args_t *p_arg ); /* Popup menu */ wxMenu *p_popup_menu; /* Hotkeys */ int i_first_hotkey_event; int i_hotkeys; /* Embedded vout */ VideoWindow *p_video_window; wxBoxSizer *p_video_sizer; vlc_bool_t b_video_autosize; /* Aout */ aout_instance_t *p_aout;};/***************************************************************************** * Prototypes *****************************************************************************/wxArrayString SeparateEntries( wxString );wxWindow *CreateVideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );void UpdateVideoWindow( intf_thread_t *p_intf, wxWindow *p_window );wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );wxWindow *CreateDialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent );namespace wxvlc{class Interface;class OpenDialog;class SoutDialog;class SubsFileDialog;class Playlist;class Messages;class FileInfo;class StreamDialog;class WizardDialog;class ItemInfoDialog;class NewGroup;class ExportPlaylist;/***************************************************************************** * Classes declarations. *****************************************************************************//* Timer */class Timer: public wxTimer{public: /* Constructor */ Timer( intf_thread_t *p_intf, Interface *p_main_interface ); virtual ~Timer(); virtual void Notify();private: //use wxWindow::IsShown instead //vlc_bool_t b_slider_shown; //vlc_bool_t b_disc_shown; intf_thread_t *p_intf; Interface *p_main_interface; vlc_bool_t b_init; int i_old_playing_status; int i_old_rate;};/* Extended panel */class ExtraPanel: public wxPanel{public: /* Constructor */ ExtraPanel( intf_thread_t *p_intf, wxWindow *p_parent ); virtual ~ExtraPanel(); wxStaticBox *adjust_box; wxButton *restoredefaults_button; wxSlider *brightness_slider; wxSlider *contrast_slider; wxSlider *saturation_slider; wxSlider *hue_slider; wxSlider *gamma_slider; wxStaticBox *other_box; wxComboBox *ratio_combo; char *psz_bands; float f_preamp; vlc_bool_t b_update;private: wxPanel *VideoPanel( wxWindow * ); wxPanel *EqzPanel( wxWindow * ); wxPanel *AudioPanel( wxWindow * ); wxNotebook *notebook; wxCheckBox *eq_chkbox; wxCheckBox *eq_2p_chkbox; wxButton *eq_restoredefaults_button; wxSlider *smooth_slider; wxStaticText *smooth_text; wxSlider *preamp_slider; wxStaticText * preamp_text; int i_smooth; wxWindow *p_parent; wxSlider *band_sliders[10]; wxStaticText *band_texts[10]; int i_values[10]; void CheckAout(); /* Event handlers (these functions should _not_ be virtual) */ void OnEnableAdjust( wxCommandEvent& ); void OnEnableEqualizer( wxCommandEvent& ); void OnRestoreDefaults( wxCommandEvent& ); void OnChangeEqualizer( wxScrollEvent& ); void OnAdjustUpdate( wxScrollEvent& ); void OnRatio( wxCommandEvent& ); void OnFiltersInfo( wxCommandEvent& ); void OnSelectFilter( wxCommandEvent& ); void OnEqSmooth( wxScrollEvent& ); void OnPreamp( wxScrollEvent& ); void OnEq2Pass( wxCommandEvent& ); void OnEqRestore( wxCommandEvent& ); void OnHeadphone( wxCommandEvent& ); void OnNormvol( wxCommandEvent& ); void OnNormvolSlider( wxScrollEvent& ); void OnIdle( wxIdleEvent& ); DECLARE_EVENT_TABLE(); intf_thread_t *p_intf; vlc_bool_t b_my_update;};#if 0/* Extended Window */class ExtraWindow: public wxFrame{public: /* Constructor */ ExtraWindow( intf_thread_t *p_intf, wxWindow *p_parent, wxPanel *panel ); virtual ~ExtraWindow();private: wxPanel *panel; DECLARE_EVENT_TABLE(); intf_thread_t *p_intf;};#endif/* Systray integration */#ifdef wxHAS_TASK_BAR_ICONclass Systray: public wxTaskBarIcon{public: Systray( Interface* p_main_interface, intf_thread_t *p_intf ); virtual ~Systray() {}; wxMenu* CreatePopupMenu(); void UpdateTooltip( const wxChar* tooltip );private: void OnMenuIconize( wxCommandEvent& event ); void OnLeftClick( wxTaskBarIconEvent& event ); void OnPlayStream ( wxCommandEvent& event ); void OnStopStream ( wxCommandEvent& event ); void OnPrevStream ( wxCommandEvent& event ); void OnNextStream ( wxCommandEvent& event ); void OnExit( wxCommandEvent& event ); Interface* p_main_interface; intf_thread_t *p_intf; DECLARE_EVENT_TABLE()};#endif/* Main Interface */class Interface: public wxFrame{public: /* Constructor */ Interface( intf_thread_t *p_intf, long style = wxDEFAULT_FRAME_STYLE ); virtual ~Interface(); void Init(); void TogglePlayButton( int i_playing_status ); void Update(); void PlayStream(); void StopStream(); void PrevStream(); void NextStream(); wxBoxSizer *frame_sizer; wxStatusBar *statusbar; void HideSlider(bool layout = true); void ShowSlider(bool show = true, bool layout = true); wxSlider *slider; wxWindow *slider_frame; wxBoxSizer *slider_sizer; wxPanel *extra_frame; void HideDiscFrame(bool layout = true); void ShowDiscFrame(bool show = true, bool layout = true); wxPanel *disc_frame; wxBoxSizer *disc_sizer; wxBitmapButton *disc_menu_button; wxBitmapButton *disc_prev_button; wxBitmapButton *disc_next_button; wxFrame *extra_window; vlc_bool_t b_extra; vlc_bool_t b_undock; wxControl *volctrl;#ifdef wxHAS_TASK_BAR_ICON Systray *p_systray;#endif wxTimer m_controls_timer; wxTimer m_slider_timer;private: void SetupHotkeys(); void CreateOurMenuBar(); void CreateOurToolBar(); void CreateOurExtendedPanel(); void CreateOurSlider(); void Open( int i_access_method ); /* Event handlers (these functions should _not_ be virtual) */ void OnControlsTimer(wxTimerEvent& WXUNUSED(event)); void OnSliderTimer(wxTimerEvent& WXUNUSED(event)); void OnExit( wxCommandEvent& event ); void OnAbout( wxCommandEvent& event ); void OnOpenFileSimple( wxCommandEvent& event ); void OnOpenDir( wxCommandEvent& event ); void OnOpenFile( wxCommandEvent& event ); void OnOpenDisc( wxCommandEvent& event ); void OnOpenNet( wxCommandEvent& event ); void OnOpenSat( wxCommandEvent& event ); void OnExtended( wxCommandEvent& event ); //void OnUndock( wxCommandEvent& event ); void OnBookmarks( wxCommandEvent& event ); void OnShowDialog( wxCommandEvent& event ); void OnPlayStream( wxCommandEvent& event ); void OnStopStream( wxCommandEvent& event ); void OnSliderUpdate( wxScrollEvent& event ); void OnPrevStream( wxCommandEvent& event ); void OnNextStream( wxCommandEvent& event ); void OnSlowStream( wxCommandEvent& event ); void OnFastStream( wxCommandEvent& event ); void OnDiscMenu( wxCommandEvent& event ); void OnDiscPrev( wxCommandEvent& event ); void OnDiscNext( wxCommandEvent& event ); void OnMenuOpen( wxMenuEvent& event );#if defined( __WXMSW__ ) || defined( __WXMAC__ ) void OnContextMenu2(wxContextMenuEvent& event);#endif void OnContextMenu(wxMouseEvent& event); void OnControlEvent( wxCommandEvent& event ); DECLARE_EVENT_TABLE(); Timer *timer; intf_thread_t *p_intf; wxWindow *video_window; int i_old_playing_status; /* For auto-generated menus */ wxMenu *p_settings_menu; wxMenu *p_audio_menu; wxMenu *p_video_menu; wxMenu *p_navig_menu;};/* Open Dialog */WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);class OpenDialog: public wxDialog{public: /* Constructor */ OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent, int i_access_method, int i_arg = 0 ); /* Extended Contructor */ OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent, int i_access_method, int i_arg = 0 , int _i_method = 0 ); virtual ~OpenDialog(); int Show(); int Show( int i_access_method, int i_arg = 0 ); void UpdateMRL(); void UpdateMRL( int i_access_method ); wxArrayString mrl;private: wxPanel *FilePanel( wxWindow* parent ); wxPanel *DiscPanel( wxWindow* parent ); wxPanel *NetPanel( wxWindow* parent ); ArrayOfAutoBuiltPanel input_tab_array; /* Event handlers (these functions should _not_ be virtual) */ void OnOk( wxCommandEvent& event ); void OnCancel( wxCommandEvent& event ); void OnClose( wxCloseEvent& event ); void OnPageChange( wxNotebookEvent& event ); void OnMRLChange( wxCommandEvent& event ); /* Event handlers for the file page */ void OnFilePanelChange( wxCommandEvent& event ); void OnFileBrowse( wxCommandEvent& event ); /* Event handlers for the disc page */ void OnDiscPanelChangeSpin( wxSpinEvent& event ); void OnDiscPanelChange( wxCommandEvent& event ); void OnDiscTypeChange( wxCommandEvent& event ); void OnDiscDeviceChange( wxCommandEvent& event ); /* Event handlers for the net page */ void OnNetPanelChangeSpin( wxSpinEvent& event ); void OnNetPanelChange( wxCommandEvent& event ); void OnNetTypeChange( wxCommandEvent& event ); /* Event handlers for the stream output */ void OnSubsFileEnable( wxCommandEvent& event ); void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) ); /* Event handlers for the stream output */ void OnSoutEnable( wxCommandEvent& event ); void OnSoutSettings( wxCommandEvent& WXUNUSED(event) ); /* Event handlers for the caching option */ void OnCachingEnable( wxCommandEvent& event ); void OnCachingChange( wxCommandEvent& event ); void OnCachingChangeSpin( wxSpinEvent& event ); DECLARE_EVENT_TABLE(); intf_thread_t *p_intf; wxWindow *p_parent; int i_current_access_method; int i_disc_type_selection; int i_method; /* Normal or for the stream dialog ? */ int i_open_arg; wxComboBox *mrl_combo; wxNotebook *notebook; /* Controls for the file panel */ wxComboBox *file_combo; wxFileDialog *file_dialog; /* Controls for the disc panel */ wxRadioBox *disc_type; wxTextCtrl *disc_device; wxSpinCtrl *disc_title; int i_disc_title; wxSpinCtrl *disc_chapter; int i_disc_chapter; wxSpinCtrl *disc_sub; int i_disc_sub; /* The media equivalent name for a DVD names. For example, * "Title", is "Track" for a CD-DA */ wxStaticText *disc_title_label; wxStaticText *disc_chapter_label; wxStaticText *disc_sub_label; /* Indicates if the disc device control was modified */ bool b_disc_device_changed; /* Controls for the net panel */ wxRadioBox *net_type; int i_net_type; wxPanel *net_subpanels[4]; wxRadioButton *net_radios[4]; wxSpinCtrl *net_ports[4]; int i_net_ports[4]; wxTextCtrl *net_addrs[4]; wxCheckBox *net_timeshift; wxCheckBox *net_ipv6; /* Controls for the subtitles file */ wxButton *subsfile_button; wxCheckBox *subsfile_checkbox; SubsFileDialog *subsfile_dialog; wxArrayString subsfile_mrl; /* Controls for the stream output */ wxButton *sout_button; wxCheckBox *sout_checkbox; SoutDialog *sout_dialog; wxArrayString sout_mrl; /* Controls for the caching options */ wxCheckBox *caching_checkbox; wxSpinCtrl *caching_value; int i_caching;};enum{ FILE_ACCESS = 0, DISC_ACCESS, NET_ACCESS, /* Auto-built panels */ CAPTURE_ACCESS};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -