wxwindows.h 16.2 KB
Newer Older
Gildas Bazin's avatar
 
Gildas Bazin committed
1 2 3 4
/*****************************************************************************
 * wxwindows.h: private wxWindows interface description
 *****************************************************************************
 * Copyright (C) 1999, 2000 VideoLAN
Gildas Bazin's avatar
 
Gildas Bazin committed
5
 * $Id: wxwindows.h,v 1.43 2003/07/17 17:30:40 gbazin Exp $
Gildas Bazin's avatar
 
Gildas Bazin committed
6 7 8 9 10 11 12
 *
 * 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.
13
 *
Gildas Bazin's avatar
 
Gildas Bazin committed
14 15 16 17 18 19 20 21 22 23
 * 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.
 *****************************************************************************/

24
#include <wx/listctrl.h>
25
#include <wx/textctrl.h>
Gildas Bazin's avatar
 
Gildas Bazin committed
26 27
#include <wx/notebook.h>
#include <wx/spinctrl.h>
Gildas Bazin's avatar
 
Gildas Bazin committed
28
#include <wx/dnd.h>
29
#include <wx/treectrl.h>
Gildas Bazin's avatar
 
Gildas Bazin committed
30
#include <wx/gauge.h>
31

Gildas Bazin's avatar
 
Gildas Bazin committed
32 33 34 35 36 37 38 39 40 41 42 43
DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );

enum
{
    FILE_ACCESS,
    DISC_ACCESS,
    NET_ACCESS,
    SAT_ACCESS,
    FILE_SIMPLE_ACCESS
};

class OpenDialog;
44
class Playlist;
45
class Messages;
46
class FileInfo;
47

Gildas Bazin's avatar
 
Gildas Bazin committed
48 49
#define SLIDER_MAX_POS 10000

Gildas Bazin's avatar
 
Gildas Bazin committed
50 51 52 53 54 55 56
/* wxU is used to convert ansi strings to unicode strings (wchar_t) */
#if wxUSE_UNICODE
#   define wxU(ansi) wxString(ansi, *wxConvCurrent)
#else
#   define wxU(ansi) ansi
#endif

Gildas Bazin's avatar
 
Gildas Bazin committed
57
#if !defined(MODULE_NAME_IS_skins)
Gildas Bazin's avatar
 
Gildas Bazin committed
58
/*****************************************************************************
59
 * intf_sys_t: description and status of wxwindows interface
Gildas Bazin's avatar
 
Gildas Bazin committed
60 61 62 63 64
 *****************************************************************************/
struct intf_sys_t
{
    /* the wx parent window */
    wxWindow            *p_wxwindow;
Gildas Bazin's avatar
 
Gildas Bazin committed
65
    wxIcon              *p_icon;
Gildas Bazin's avatar
 
Gildas Bazin committed
66 67 68 69 70 71 72 73 74 75

    /* 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 */
Gildas Bazin's avatar
 
Gildas Bazin committed
76
    vlc_bool_t          b_slider_free;                      /* slider status */
Gildas Bazin's avatar
 
Gildas Bazin committed
77 78 79 80 81 82 83

    /* The messages window */
    msg_subscription_t* p_sub;                  /* message bank subscription */

    /* Playlist management */
    int                 i_playing;                 /* playlist selected item */

Gildas Bazin's avatar
 
Gildas Bazin committed
84 85 86
    /* Send an event to show a dialog */
    void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg );

Gildas Bazin's avatar
 
Gildas Bazin committed
87 88 89 90
    /* Popup menu */
    wxMenu              *p_popup_menu;
    vlc_bool_t          b_popup_change;

Gildas Bazin's avatar
 
Gildas Bazin committed
91
};
Gildas Bazin's avatar
 
Gildas Bazin committed
92
#endif /* !defined(MODULE_NAME_IS_skins) */
Gildas Bazin's avatar
 
Gildas Bazin committed
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115

/*****************************************************************************
 * 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;
Gildas Bazin's avatar
 
Gildas Bazin committed
116
    int i_old_playing_status;
Gildas Bazin's avatar
 
Gildas Bazin committed
117
    int i_old_rate;
Gildas Bazin's avatar
 
Gildas Bazin committed
118 119 120 121 122 123 124 125 126
};

/* Main Interface */
class Interface: public wxFrame
{
public:
    /* Constructor */
    Interface( intf_thread_t *p_intf );
    virtual ~Interface();
Gildas Bazin's avatar
 
Gildas Bazin committed
127
    void TogglePlayButton( int i_playing_status );
Gildas Bazin's avatar
 
Gildas Bazin committed
128 129

    wxBoxSizer  *frame_sizer;
Gildas Bazin's avatar
 
Gildas Bazin committed
130 131
    wxStatusBar *statusbar;

Gildas Bazin's avatar
 
Gildas Bazin committed
132 133 134 135
    wxSlider    *slider;
    wxWindow    *slider_frame;
    wxStaticBox *slider_box;

Gildas Bazin's avatar
 
Gildas Bazin committed
136 137
    wxGauge     *volctrl;

Gildas Bazin's avatar
 
Gildas Bazin committed
138
private:
Gildas Bazin's avatar
 
Gildas Bazin committed
139 140 141
    void CreateOurMenuBar();
    void CreateOurToolBar();
    void CreateOurSlider();
Gildas Bazin's avatar
 
Gildas Bazin committed
142
    void Open( int i_access_method );
Gildas Bazin's avatar
 
Gildas Bazin committed
143

Gildas Bazin's avatar
 
Gildas Bazin committed
144
    /* Event handlers (these functions should _not_ be virtual) */
145 146
    void OnExit( wxCommandEvent& event );
    void OnAbout( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
147

Gildas Bazin's avatar
 
Gildas Bazin committed
148
    void OnShowDialog( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
149

150 151 152
    void OnPlayStream( wxCommandEvent& event );
    void OnStopStream( wxCommandEvent& event );
    void OnSliderUpdate( wxScrollEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
153 154
    void OnPrevStream( wxCommandEvent& event );
    void OnNextStream( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
155 156
    void OnSlowStream( wxCommandEvent& event );
    void OnFastStream( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
157

Gildas Bazin's avatar
 
Gildas Bazin committed
158
    void OnMenuOpen( wxMenuEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
159 160

#if defined( __WXMSW__ ) || defined( __WXMAC__ )
Gildas Bazin's avatar
 
Gildas Bazin committed
161
    void OnContextMenu2(wxContextMenuEvent& event);
Gildas Bazin's avatar
 
Gildas Bazin committed
162
#endif
Gildas Bazin's avatar
 
Gildas Bazin committed
163
    void OnContextMenu(wxMouseEvent& event);
Gildas Bazin's avatar
 
Gildas Bazin committed
164

Gildas Bazin's avatar
 
Gildas Bazin committed
165 166 167 168
    DECLARE_EVENT_TABLE();

    Timer *timer;
    intf_thread_t *p_intf;
Gildas Bazin's avatar
 
Gildas Bazin committed
169

Gildas Bazin's avatar
 
Gildas Bazin committed
170
private:
Gildas Bazin's avatar
 
Gildas Bazin committed
171
    int i_old_playing_status;
Gildas Bazin's avatar
 
Gildas Bazin committed
172 173 174 175 176 177

    /* For auto-generated menus */
    wxMenu *p_audio_menu;
    vlc_bool_t b_audio_menu;
    wxMenu *p_video_menu;
    vlc_bool_t b_video_menu;
Gildas Bazin's avatar
 
Gildas Bazin committed
178 179
    wxMenu *p_navig_menu;
    vlc_bool_t b_navig_menu;
Gildas Bazin's avatar
 
Gildas Bazin committed
180 181
};

Gildas Bazin's avatar
 
Gildas Bazin committed
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221
/* 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 OnOpenFileSimple( wxCommandEvent& event );
    void OnOpenFile( wxCommandEvent& event );
    void OnOpenDisc( wxCommandEvent& event );
    void OnOpenNet( wxCommandEvent& event );
    void OnOpenSat( wxCommandEvent& event );

    void OnIdle( wxIdleEvent& 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;
    wxFrame             *p_prefs_dialog;
};

Gildas Bazin's avatar
 
Gildas Bazin committed
222
/* Open Dialog */
Gildas Bazin's avatar
 
Gildas Bazin committed
223 224
class SoutDialog;
class SubsFileDialog;
Gildas Bazin's avatar
 
Gildas Bazin committed
225
class OpenDialog: public wxFrame
Gildas Bazin's avatar
 
Gildas Bazin committed
226 227 228
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
229
    OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
Gildas Bazin's avatar
 
Gildas Bazin committed
230
                int i_access_method, int i_arg = 0 );
Gildas Bazin's avatar
 
Gildas Bazin committed
231 232
    virtual ~OpenDialog();

Gildas Bazin's avatar
 
Gildas Bazin committed
233 234
    int Show();
    int Show( int i_access_method, int i_arg = 0 );
Gildas Bazin's avatar
 
Gildas Bazin committed
235

Gildas Bazin's avatar
 
Gildas Bazin committed
236
    wxArrayString mrl;
Gildas Bazin's avatar
 
Gildas Bazin committed
237 238 239 240 241 242 243

private:
    wxPanel *FilePanel( wxWindow* parent );
    wxPanel *DiscPanel( wxWindow* parent );
    wxPanel *NetPanel( wxWindow* parent );
    wxPanel *SatPanel( wxWindow* parent );

Gildas Bazin's avatar
 
Gildas Bazin committed
244
    void UpdateMRL( int i_access_method );
Gildas Bazin's avatar
 
Gildas Bazin committed
245
    wxArrayString SeparateEntries( wxString );
Gildas Bazin's avatar
 
Gildas Bazin committed
246 247 248 249 250 251 252 253

    /* Event handlers (these functions should _not_ be virtual) */
    void OnOk( wxCommandEvent& event );
    void OnCancel( wxCommandEvent& event );

    void OnPageChange( wxNotebookEvent& event );
    void OnMRLChange( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
254
    /* Event handlers for the file page */
Gildas Bazin's avatar
 
Gildas Bazin committed
255 256 257 258 259 260 261 262 263 264 265
    void OnFilePanelChange( wxCommandEvent& event );
    void OnFileBrowse( wxCommandEvent& event );

    /* Event handlers for the disc page */
    void OnDiscPanelChange( wxCommandEvent& event );
    void OnDiscTypeChange( wxCommandEvent& event );

    /* Event handlers for the net page */
    void OnNetPanelChange( wxCommandEvent& event );
    void OnNetTypeChange( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
266 267 268 269
    /* Event handlers for the stream output */
    void OnSubsFileEnable( wxCommandEvent& event );
    void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );

Gildas Bazin's avatar
 
Gildas Bazin committed
270 271 272 273
    /* Event handlers for the stream output */
    void OnSoutEnable( wxCommandEvent& event );
    void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );

Gildas Bazin's avatar
 
Gildas Bazin committed
274 275 276 277 278
    /* Event handlers for the demux dump */
    void OnDemuxDumpEnable( wxCommandEvent& event );
    void OnDemuxDumpBrowse( wxCommandEvent& event );
    void OnDemuxDumpChange( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
279 280 281
    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;
Gildas Bazin's avatar
 
Gildas Bazin committed
282
    wxWindow *p_parent;
Gildas Bazin's avatar
 
Gildas Bazin committed
283
    int i_current_access_method;
Gildas Bazin's avatar
 
Gildas Bazin committed
284 285

    wxComboBox *mrl_combo;
Gildas Bazin's avatar
 
Gildas Bazin committed
286
    wxNotebook *notebook;
Gildas Bazin's avatar
 
Gildas Bazin committed
287 288 289

    /* Controls for the file panel */
    wxComboBox *file_combo;
Gildas Bazin's avatar
 
Gildas Bazin committed
290
    wxFileDialog *file_dialog;
Gildas Bazin's avatar
 
Gildas Bazin committed
291 292 293 294 295 296 297 298 299 300 301 302 303 304

    /* Controls for the disc panel */
    wxRadioBox *disc_type;
    wxTextCtrl *disc_device;
    wxSpinCtrl *disc_title;
    wxSpinCtrl *disc_chapter;

    /* Controls for the net panel */
    wxRadioBox *net_type;
    int i_net_type;
    wxPanel *net_subpanels[4];
    wxRadioButton *net_radios[4];
    wxSpinCtrl *net_ports[4];
    wxTextCtrl *net_addrs[4];
Gildas Bazin's avatar
 
Gildas Bazin committed
305

Gildas Bazin's avatar
 
Gildas Bazin committed
306 307 308
    /* Controls for the subtitles file */
    wxButton *subsfile_button;
    wxCheckBox *subsfile_checkbox;
Gildas Bazin's avatar
 
Gildas Bazin committed
309
    SubsFileDialog *subsfile_dialog;
Gildas Bazin's avatar
 
Gildas Bazin committed
310

Gildas Bazin's avatar
 
Gildas Bazin committed
311 312
    /* Controls for the stream output */
    wxButton *sout_button;
Gildas Bazin's avatar
 
Gildas Bazin committed
313
    wxCheckBox *sout_checkbox;
Gildas Bazin's avatar
 
Gildas Bazin committed
314
    SoutDialog *sout_dialog;
Gildas Bazin's avatar
 
Gildas Bazin committed
315 316 317 318 319

    /* Controls for the demux dump */
    wxTextCtrl *demuxdump_textctrl;
    wxButton *demuxdump_button;
    wxCheckBox *demuxdump_checkbox;
Gildas Bazin's avatar
 
Gildas Bazin committed
320
    wxFileDialog *demuxdump_dialog;
Gildas Bazin's avatar
 
Gildas Bazin committed
321 322
};

Gildas Bazin's avatar
 
Gildas Bazin committed
323 324 325 326 327
/* Stream output Dialog */
class SoutDialog: public wxDialog
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
328
    SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
329 330 331 332 333 334 335
    virtual ~SoutDialog();

    wxString mrl;

private:
    void UpdateMRL();
    wxPanel *AccessPanel( wxWindow* parent );
Mohammed Adnène Trojette's avatar
 
Mohammed Adnène Trojette committed
336
    wxPanel *MiscPanel( wxWindow* parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
337
    wxPanel *EncapsulationPanel( wxWindow* parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
338
    wxPanel *TranscodingPanel( wxWindow* parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
339
    void    ParseMRL();
Gildas Bazin's avatar
 
Gildas Bazin committed
340 341 342 343 344 345 346 347 348 349 350 351 352 353

    /* Event handlers (these functions should _not_ be virtual) */
    void OnOk( wxCommandEvent& event );
    void OnCancel( wxCommandEvent& event );
    void OnMRLChange( wxCommandEvent& event );
    void OnAccessTypeChange( wxCommandEvent& event );

    /* Event handlers for the file access output */
    void OnFileChange( wxCommandEvent& event );
    void OnFileBrowse( wxCommandEvent& event );

    /* Event handlers for the net access output */
    void OnNetChange( wxCommandEvent& event );

Mohammed Adnène Trojette's avatar
 
Mohammed Adnène Trojette committed
354 355 356
    /* Event specific to the sap address */
    void OnSAPAddrChange( wxCommandEvent& event );
    
Gildas Bazin's avatar
 
Gildas Bazin committed
357 358 359
    /* Event handlers for the encapsulation panel */
    void OnEncapsulationChange( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
360 361 362 363
    /* Event handlers for the transcoding panel */
    void OnTranscodingEnable( wxCommandEvent& event );
    void OnTranscodingChange( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
364 365 366
    /* Event handlers for the misc panel */
    void OnSAPMiscChange( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
367 368 369
    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;
Gildas Bazin's avatar
 
Gildas Bazin committed
370
    wxWindow *p_parent;
Gildas Bazin's avatar
 
Gildas Bazin committed
371 372 373 374

    wxComboBox *mrl_combo;

    /* Controls for the access outputs */
Gildas Bazin's avatar
 
Gildas Bazin committed
375 376
    wxPanel *access_subpanels[5];
    wxCheckBox *access_checkboxes[5];
Gildas Bazin's avatar
 
Gildas Bazin committed
377 378 379 380

    int i_access_type;

    wxComboBox *file_combo;
Gildas Bazin's avatar
 
Gildas Bazin committed
381 382
    wxSpinCtrl *net_ports[5];
    wxTextCtrl *net_addrs[5];
Gildas Bazin's avatar
 
Gildas Bazin committed
383

Mohammed Adnène Trojette's avatar
 
Mohammed Adnène Trojette committed
384
    /* Controls for the SAP announces */
Gildas Bazin's avatar
 
Gildas Bazin committed
385 386 387
    wxPanel *misc_subpanels[1];
    wxCheckBox *sap_checkbox;
    wxTextCtrl *sap_addr;
Mohammed Adnène Trojette's avatar
 
Mohammed Adnène Trojette committed
388
                            
Gildas Bazin's avatar
 
Gildas Bazin committed
389
    /* Controls for the encapsulation */
Gildas Bazin's avatar
 
Gildas Bazin committed
390
    wxRadioButton *encapsulation_radios[5];
Gildas Bazin's avatar
 
Gildas Bazin committed
391 392
    int i_encapsulation_type;

Gildas Bazin's avatar
 
Gildas Bazin committed
393 394 395 396 397 398 399
    /* Controls for transcoding */
    wxCheckBox *video_transc_checkbox;
    wxComboBox *video_codec_combo;
    wxComboBox *audio_codec_combo;
    wxCheckBox *audio_transc_checkbox;
    wxComboBox *video_bitrate_combo;
    wxComboBox *audio_bitrate_combo;
Gildas Bazin's avatar
 
Gildas Bazin committed
400
    wxComboBox *audio_channels_combo;
Gildas Bazin's avatar
 
Gildas Bazin committed
401 402
};

Gildas Bazin's avatar
 
Gildas Bazin committed
403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426
/* Subtitles File Dialog */
class SubsFileDialog: public wxDialog
{
public:
    /* Constructor */
    SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
    virtual ~SubsFileDialog();

    wxComboBox *file_combo;
    wxSpinCtrl *delay_spinctrl;
    wxSpinCtrl *fps_spinctrl;

private:
    /* Event handlers (these functions should _not_ be virtual) */
    void OnOk( wxCommandEvent& event );
    void OnCancel( wxCommandEvent& event );
    void OnFileBrowse( wxCommandEvent& event );

    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;
    wxWindow *p_parent;
};

Gildas Bazin's avatar
 
Gildas Bazin committed
427
/* Preferences Dialog */
Gildas Bazin's avatar
 
Gildas Bazin committed
428
class PrefsTreeCtrl;
Gildas Bazin's avatar
 
Gildas Bazin committed
429
class PrefsDialog: public wxFrame
Gildas Bazin's avatar
 
Gildas Bazin committed
430 431 432
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
433
    PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
434 435 436 437 438 439 440 441
    virtual ~PrefsDialog();

private:
    wxPanel *PrefsPanel( wxWindow* parent );

    /* Event handlers (these functions should _not_ be virtual) */
    void OnOk( wxCommandEvent& event );
    void OnCancel( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
442
    void OnSave( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
443
    void OnResetAll( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
444 445 446 447

    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;
Gildas Bazin's avatar
 
Gildas Bazin committed
448 449

    PrefsTreeCtrl *prefs_tree;
Gildas Bazin's avatar
 
Gildas Bazin committed
450 451
};

452 453 454 455 456
/* Messages */
class Messages: public wxFrame
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
457
    Messages( intf_thread_t *p_intf, wxWindow *p_parent );
458 459 460 461 462 463
    virtual ~Messages();
    void UpdateLog();

private:
    /* Event handlers (these functions should _not_ be virtual) */
    void OnClose( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
464
    void OnVerbose( wxCommandEvent& event );
465
    void OnClear( wxCommandEvent& event );
466
    void OnSaveLog( wxCommandEvent& event );
467 468 469 470 471 472 473 474 475

    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;
    wxTextCtrl *textctrl;
    wxTextAttr *info_attr;
    wxTextAttr *err_attr;
    wxTextAttr *warn_attr;
    wxTextAttr *dbg_attr;
Gildas Bazin's avatar
 
Gildas Bazin committed
476

477 478
    wxFileDialog *save_log_dialog;
    
Gildas Bazin's avatar
 
Gildas Bazin committed
479
    vlc_bool_t b_verbose;
480 481
};

482 483 484 485 486
/* Playlist */
class Playlist: public wxFrame
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
487
    Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
488
    virtual ~Playlist();
Gildas Bazin's avatar
 
Gildas Bazin committed
489 490 491 492 493 494

    void UpdatePlaylist();
    void ShowPlaylist( bool show );

    bool b_need_update;
    vlc_mutex_t lock;
495 496

private:
497 498
    void DeleteItem( int item );

499
    /* Event handlers (these functions should _not_ be virtual) */
Gildas Bazin's avatar
 
Gildas Bazin committed
500
    void OnAddFile( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
501
    void OnAddMRL( wxCommandEvent& event );
502
    void OnClose( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
503 504
    void OnOpen( wxCommandEvent& event );
    void OnSave( wxCommandEvent& event );
505 506 507 508 509
    void OnInvertSelection( wxCommandEvent& event );
    void OnDeleteSelection( wxCommandEvent& event );
    void OnSelectAll( wxCommandEvent& event );
    void OnActivateItem( wxListEvent& event );
    void OnKeyDown( wxListEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
510
    void Rebuild();
511 512 513 514 515

    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;
    wxListView *listview;
Gildas Bazin's avatar
 
Gildas Bazin committed
516
    int i_update_counter;
517
};
Gildas Bazin's avatar
 
Gildas Bazin committed
518

519 520 521 522 523
/* File Info */
class FileInfo: public wxFrame
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
524
    FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
525
    virtual ~FileInfo();
526
    void UpdateFileInfo();
527 528 529

private:
    void OnClose( wxCommandEvent& event );
530

531
    DECLARE_EVENT_TABLE();
532 533 534 535
   
    intf_thread_t *p_intf;
    wxTreeCtrl *fileinfo_tree;
    wxTreeItemId fileinfo_root;
Anil Daoud's avatar
 
Anil Daoud committed
536
    wxString fileinfo_root_label;
537

538 539
};

Gildas Bazin's avatar
 
Gildas Bazin committed
540
#if !defined(__WXX11__)
Gildas Bazin's avatar
 
Gildas Bazin committed
541 542 543 544 545 546 547 548 549 550 551 552
/* Drag and Drop class */
class DragAndDrop: public wxFileDropTarget
{
public:
    DragAndDrop( intf_thread_t *_p_intf );

    virtual bool OnDropFiles( wxCoord x, wxCoord y,
                              const wxArrayString& filenames );

private:
    intf_thread_t *p_intf;
};
Gildas Bazin's avatar
 
Gildas Bazin committed
553
#endif
Gildas Bazin's avatar
 
Gildas Bazin committed
554

Gildas Bazin's avatar
 
Gildas Bazin committed
555
/* Menus */
Gildas Bazin's avatar
 
Gildas Bazin committed
556
void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
Gildas Bazin's avatar
 
Gildas Bazin committed
557
                const wxPoint& pos );
Gildas Bazin's avatar
 
Gildas Bazin committed
558 559 560
wxMenu *AudioMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
wxMenu *VideoMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
wxMenu *NavigMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
561

Gildas Bazin's avatar
 
Gildas Bazin committed
562
class MenuEvtHandler : public wxEvtHandler
Gildas Bazin's avatar
 
Gildas Bazin committed
563 564
{
public:
Gildas Bazin's avatar
 
Gildas Bazin committed
565 566
    MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
    virtual ~MenuEvtHandler();
Gildas Bazin's avatar
 
Gildas Bazin committed
567

Gildas Bazin's avatar
 
Gildas Bazin committed
568 569
    void OnMenuEvent( wxCommandEvent& event );
    void OnShowDialog( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
570 571 572 573 574 575 576 577 578

private:

    DECLARE_EVENT_TABLE()

    intf_thread_t *p_intf;
    Interface *p_main_interface;
};

Gildas Bazin's avatar
 
Gildas Bazin committed
579
class Menu: public wxMenu
Gildas Bazin's avatar
 
Gildas Bazin committed
580 581 582
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
583
    Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
Gildas Bazin's avatar
 
Gildas Bazin committed
584
          char **ppsz_names, int *pi_objects, int i_start_id );
Gildas Bazin's avatar
 
Gildas Bazin committed
585
    virtual ~Menu();
Gildas Bazin's avatar
 
Gildas Bazin committed
586 587

private:
Gildas Bazin's avatar
 
Gildas Bazin committed
588 589
    /* Event handlers (these functions should _not_ be virtual) */
    void OnClose( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
590
    void OnShowDialog( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
591
    void OnEntrySelected( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
592

Gildas Bazin's avatar
 
Gildas Bazin committed
593 594 595 596 597 598 599 600 601
    wxMenu *Menu::CreateDummyMenu();
    void   Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
    wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t * );

    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;

    int  i_item_id;
Gildas Bazin's avatar
 
Gildas Bazin committed
602
};