wxwindows.h
来自「VLC媒体播放程序」· C头文件 代码 · 共 1,039 行 · 第 1/2 页
H
1,039 行
/***************************************************************************** * wxwindows.h: private wxWindows interface description ***************************************************************************** * Copyright (C) 1999-2004 VideoLAN * $Id: wxwindows.h,v 1.95 2004/03/01 18:31:13 gbazin Exp $ * * Authors: Gildas Bazin <gbazin@netcourrier.com> * * 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 "vlc_keys.h"/* Hmmm, work-around for newest wxWin */#ifdef wxStaticCastEvent# undef wxStaticCastEvent# define wxStaticCastEvent(type, val) ((type)(val))#endifDECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );class OpenDialog;class Playlist;class Messages;class FileInfo;#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, *wxConvCurrent)#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) */#if wxUSE_UNICODE# define wxL2U(ansi) wxString(ansi, *wxConvCurrent)#else# define wxL2U(ansi) ansi#endif#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 3wxArrayString SeparateEntries( wxString );/***************************************************************************** * intf_sys_t: description and status of wxwindows interface *****************************************************************************/struct intf_sys_t{ /* the wx parent window */ wxWindow *p_wxwindow; wxIcon *p_icon; /* special actions */ vlc_bool_t b_playing; /* 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 */ /* 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;};/***************************************************************************** * Prototypes *****************************************************************************//***************************************************************************** * Classes declarations. *****************************************************************************/class Interface;/* Timer */class Timer: public wxTimer{public: /* Constructor */ Timer( intf_thread_t *p_intf, Interface *p_main_interface ); virtual ~Timer(); virtual void Notify();private: intf_thread_t *p_intf; Interface *p_main_interface; int i_old_playing_status; int i_old_rate;};/* Main Interface */class Interface: public wxFrame{public: /* Constructor */ Interface( intf_thread_t *p_intf ); virtual ~Interface(); void TogglePlayButton( int i_playing_status );// wxFlexGridSizer *frame_sizer; wxBoxSizer *frame_sizer; wxStatusBar *statusbar; wxSlider *slider; wxWindow *slider_frame; wxWindow *extra_frame; wxStaticBox *slider_box; vlc_bool_t b_extra; wxStaticBox *adjust_box; wxSlider *brightness_slider; wxSlider *contrast_slider; wxSlider *saturation_slider; wxSlider *hue_slider; wxSlider *gamma_slider; wxStaticBox *other_box; wxComboBox *ratio_combo; wxGauge *volctrl;private: void UpdateAcceleratorTable(); void CreateOurMenuBar(); void CreateOurToolBar(); void CreateOurExtraPanel(); void CreateOurSlider(); void Open( int i_access_method ); /* Event handlers (these functions should _not_ be virtual) */ void OnExit( wxCommandEvent& event ); void OnAbout( wxCommandEvent& event ); void OnOpenFileSimple( wxCommandEvent& event ); void OnOpenFile( wxCommandEvent& event ); void OnOpenDisc( wxCommandEvent& event ); void OnOpenNet( wxCommandEvent& event ); void OnOpenSat( wxCommandEvent& event ); void OnOpenV4L( wxCommandEvent& event ); void OnExtra( 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 OnEnableAdjust( wxCommandEvent& event ); void OnHueUpdate( wxScrollEvent& event ); void OnContrastUpdate( wxScrollEvent& event ); void OnBrightnessUpdate( wxScrollEvent& event ); void OnSaturationUpdate( wxScrollEvent& event ); void OnGammaUpdate( wxScrollEvent& event ); void OnRatio( wxCommandEvent& event ); void OnEnableVisual( wxCommandEvent& event ); void OnMenuOpen( wxMenuEvent& event );#if defined( __WXMSW__ ) || defined( __WXMAC__ ) void OnContextMenu2(wxContextMenuEvent& event);#endif void OnContextMenu(wxMouseEvent& event); DECLARE_EVENT_TABLE(); Timer *timer; intf_thread_t *p_intf;private: int i_old_playing_status; /* For auto-generated menus */ wxMenu *p_settings_menu; vlc_bool_t b_settings_menu; wxMenu *p_audio_menu; vlc_bool_t b_audio_menu; wxMenu *p_video_menu; vlc_bool_t b_video_menu; wxMenu *p_navig_menu; vlc_bool_t b_navig_menu;};class StreamDialog;/* Dialogs Provider */class DialogsProvider: public wxFrame{public: /* Constructor */ DialogsProvider( intf_thread_t *p_intf, wxWindow *p_parent ); virtual ~DialogsProvider();private: void Open( int i_access_method, int i_arg ); /* Event handlers (these functions should _not_ be virtual) */ void OnExit( wxCommandEvent& event ); void OnPlaylist( wxCommandEvent& event ); void OnMessages( wxCommandEvent& event ); void OnFileInfo( wxCommandEvent& event ); void OnPreferences( wxCommandEvent& event ); void OnStreamWizardDialog( wxCommandEvent& event ); void OnOpenFileGeneric( wxCommandEvent& event ); void OnOpenFileSimple( wxCommandEvent& event ); void OnOpenFile( wxCommandEvent& event ); void OnOpenDisc( wxCommandEvent& event ); void OnOpenNet( wxCommandEvent& event ); void OnOpenSat( wxCommandEvent& event ); void OnPopupMenu( wxCommandEvent& event ); void OnIdle( wxIdleEvent& event ); void OnExitThread( wxCommandEvent& event ); DECLARE_EVENT_TABLE(); intf_thread_t *p_intf;public: /* Secondary windows */ OpenDialog *p_open_dialog; wxFileDialog *p_file_dialog; Playlist *p_playlist_dialog; Messages *p_messages_dialog; FileInfo *p_fileinfo_dialog; StreamDialog *p_streamwizard_dialog; wxFrame *p_prefs_dialog; wxFileDialog *p_file_generic_dialog;};/* Open Dialog */class AutoBuiltPanel;WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);class V4LDialog;class SoutDialog;class SubsFileDialog;class OpenDialog: public wxFrame{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 ); wxPanel *V4LPanel( wxWindow* parent ); ArrayOfAutoBuiltPanel input_tab_array; /* Event handlers (these functions should _not_ be virtual) */ void OnOk( wxCommandEvent& event ); void OnCancel( wxCommandEvent& 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 OnDiscPanelChange( wxCommandEvent& event ); void OnDiscTypeChange( wxCommandEvent& event ); void OnDiscDeviceChange( wxCommandEvent& event ); /* Event handlers for the net page */ void OnNetPanelChange( wxCommandEvent& event ); void OnNetTypeChange( wxCommandEvent& event ); /* Event handlers for the v4l page */ void OnV4LPanelChange( wxCommandEvent& event ); void OnV4LTypeChange( wxCommandEvent& event ); void OnV4LSettingsChange( 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) ); 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; wxSpinCtrl *disc_chapter; /* 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; /* 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_ipv6; /* Controls for the v4l panel */ wxRadioBox *video_type; wxTextCtrl *video_device; wxSpinCtrl *video_channel; wxButton *v4l_button; V4LDialog *v4l_dialog; wxArrayString v4l_mrl; /* 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;};enum{ FILE_ACCESS = 0, DISC_ACCESS, NET_ACCESS,#ifndef WIN32 V4L_ACCESS,#endif MAX_ACCESS, FILE_SIMPLE_ACCESS};/* V4L Dialog */class V4LDialog: public wxDialog{public: /* Constructor */ V4LDialog( intf_thread_t *p_intf, wxWindow *p_parent ); virtual ~V4LDialog(); wxArrayString GetOptions();private: void UpdateMRL(); wxPanel *AudioPanel( wxWindow* parent ); wxPanel *CommonPanel( wxWindow* parent ); wxPanel *BitratePanel( wxWindow* parent ); void ParseMRL(); /* Event handlers (these functions should _not_ be virtual) */ void OnOk( wxCommandEvent& event ); void OnCancel( wxCommandEvent& event ); void OnMRLChange( wxCommandEvent& event ); void OnAudioEnable( wxCommandEvent& event ); void OnAudioChange( wxCommandEvent& event ); void OnAudioChannel( wxCommandEvent& event ); void OnSizeEnable( wxCommandEvent& event ); void OnSize( wxCommandEvent& event ); void OnNormEnable( wxCommandEvent& event ); void OnNorm( wxCommandEvent& event ); void OnFrequencyEnable( wxCommandEvent& event ); void OnFrequency( wxCommandEvent& event ); void OnBitrateEnable( wxCommandEvent& event ); void OnBitrate( wxCommandEvent& event ); void OnMaxBitrateEnable( wxCommandEvent& event ); void OnMaxBitrate( wxCommandEvent& event ); DECLARE_EVENT_TABLE(); intf_thread_t *p_intf; wxWindow *p_parent; wxComboBox *mrl_combo; int i_access_type; /* Controls for the v4l advanced options */ wxPanel *common_subpanel; wxPanel *common_panel; wxCheckBox *size_checkbox; wxComboBox *size_combo; wxCheckBox *norm_checkbox; wxComboBox *norm_combo; wxCheckBox *frequency_checkbox; wxSpinCtrl *frequency; wxPanel *audio_subpanel; wxPanel *audio_panel; wxCheckBox *audio_checkbox; wxTextCtrl *audio_device; wxSpinCtrl *audio_channel; wxPanel *bitrate_subpanel; wxPanel *bitrate_panel; wxCheckBox *bitrate_checkbox; wxSpinCtrl *bitrate; wxCheckBox *maxbitrate_checkbox; wxSpinCtrl *maxbitrate;};/* Stream output Dialog */enum{ PLAY_ACCESS_OUT = 0,
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?