1 /*****************************************************************************
2 * interface.hpp: Main interface headers
3 *****************************************************************************
4 * Copyright (C) 1999-2005 the VideoLAN team
7 * Authors: Gildas Bazin <gbazin@videolan.org>
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 #ifndef _WXVLC_INTERFACE_H_
25 #define _WXVLC_INTERFACE_H_
27 #include "wxwidgets.hpp"
28 #include "input_manager.hpp"
32 #include <wx/taskbar.h>
41 #if wxUSE_DRAG_AND_DROP
42 /* Drag and Drop class */
43 class DragAndDrop: public wxFileDropTarget
46 DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
47 virtual bool OnDropFiles( wxCoord x, wxCoord y,
48 const wxArrayString& filenames );
51 intf_thread_t *p_intf;
56 /* Systray integration */
57 #ifdef wxHAS_TASK_BAR_ICON
58 class Systray: public wxTaskBarIcon
61 Systray( Interface* p_main_interface, intf_thread_t *p_intf );
62 virtual ~Systray() {};
63 wxMenu* CreatePopupMenu();
64 void UpdateTooltip( const wxChar* tooltip );
67 void OnMenuIconize( wxCommandEvent& event );
68 void OnLeftClick( wxTaskBarIconEvent& event );
69 void OnPlayStream ( wxCommandEvent& event );
70 void OnStopStream ( wxCommandEvent& event );
71 void OnPrevStream ( wxCommandEvent& event );
72 void OnNextStream ( wxCommandEvent& event );
73 void OnExit( wxCommandEvent& event );
74 Interface* p_main_interface;
75 intf_thread_t *p_intf;
81 class Interface: public wxFrame
85 Interface( intf_thread_t *p_intf, long style = wxDEFAULT_FRAME_STYLE );
88 void TogglePlayButton( int i_playing_status );
95 wxBoxSizer *main_sizer;
99 wxBoxSizer *panel_sizer;
101 wxStatusBar *statusbar;
103 InputManager *input_manager;
107 #ifdef wxHAS_TASK_BAR_ICON
111 wxWindow *video_window;
115 void CreateOurMenuBar();
116 void CreateOurToolBar();
117 void CreateOurExtendedPanel();
118 void Open( int i_access_method );
120 void SetIntfMinSize();
122 /* Event handlers (these functions should _not_ be virtual) */
123 void OnExit( wxCommandEvent& event );
124 void OnAbout( wxCommandEvent& event );
126 void OnOpenFileSimple( wxCommandEvent& event );
127 void OnOpenDir( wxCommandEvent& event );
128 void OnOpenFile( wxCommandEvent& event );
129 void OnOpenDisc( wxCommandEvent& event );
130 void OnOpenNet( wxCommandEvent& event );
131 void OnOpenSat( wxCommandEvent& event );
133 void OnExtended( wxCommandEvent& event );
134 void OnSmallPlaylist( wxCommandEvent& event );
136 void OnBookmarks( wxCommandEvent& event );
137 void OnShowDialog( wxCommandEvent& event );
138 void OnPlayStream( wxCommandEvent& event );
139 void OnStopStream( wxCommandEvent& event );
140 void OnPrevStream( wxCommandEvent& event );
141 void OnNextStream( wxCommandEvent& event );
142 void OnSlowStream( wxCommandEvent& event );
143 void OnFastStream( wxCommandEvent& event );
145 void OnMenuOpen( wxMenuEvent& event );
147 #if defined( __WXMSW__ ) || defined( __WXMAC__ )
148 void OnContextMenu2(wxContextMenuEvent& event);
150 void OnContextMenu(wxMouseEvent& event);
152 void OnControlEvent( wxCommandEvent& event );
154 DECLARE_EVENT_TABLE();
157 intf_thread_t *p_intf;
159 int i_old_playing_status;
161 /* For auto-generated menus */
162 wxMenu *p_settings_menu;
163 wxMenu *p_audio_menu;
164 wxMenu *p_video_menu;
165 wxMenu *p_navig_menu;
169 wxPanel *extra_frame;
172 wxPanel *playlist_manager;
174 /* Utility dimensions */
175 wxSize main_min_size;
183 WindowSettings( intf_thread_t *_p_intf );
184 virtual ~WindowSettings();
197 void SetSettings( int id, bool _b_shown,
198 wxPoint p = wxDefaultPosition, wxSize s = wxDefaultSize );
199 bool GetSettings( int id, bool& _b_shown, wxPoint& p, wxSize& s );
201 void SetScreen( int i_screen_w, int i_screen_h );
204 intf_thread_t *p_intf;
208 bool b_valid[ID_MAX];
209 bool b_shown[ID_MAX];
210 wxPoint position[ID_MAX];
215 class MenuEvtHandler : public wxEvtHandler
218 MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
219 virtual ~MenuEvtHandler();
221 void OnMenuEvent( wxCommandEvent& event );
222 void OnShowDialog( wxCommandEvent& event );
225 DECLARE_EVENT_TABLE()
227 intf_thread_t *p_intf;
228 Interface *p_main_interface;
232 void PopupMenu( intf_thread_t *, wxWindow *, const wxPoint& );
233 wxMenu *SettingsMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
234 wxMenu *AudioMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
235 wxMenu *VideoMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );
236 wxMenu *NavigMenu( intf_thread_t *, wxWindow *, wxMenu * = NULL );