wxwindows.h 26.9 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.82 2003/12/22 14:31:01 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 25 26 27 28 29 30 31 32 33 34
#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>

35
#include <wx/listctrl.h>
36
#include <wx/textctrl.h>
Gildas Bazin's avatar
 
Gildas Bazin committed
37 38
#include <wx/notebook.h>
#include <wx/spinctrl.h>
Gildas Bazin's avatar
 
Gildas Bazin committed
39
#include <wx/dnd.h>
40
#include <wx/treectrl.h>
Gildas Bazin's avatar
 
Gildas Bazin committed
41
#include <wx/gauge.h>
42
#include <wx/accel.h>
43
#include <wx/checkbox.h>
44
#include "vlc_keys.h"
45

Gildas Bazin's avatar
 
Gildas Bazin committed
46 47 48
DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );

class OpenDialog;
49
class Playlist;
50
class Messages;
51
class FileInfo;
52

Gildas Bazin's avatar
 
Gildas Bazin committed
53 54
#define SLIDER_MAX_POS 10000

Gildas Bazin's avatar
 
Gildas Bazin committed
55 56 57 58 59 60
/* wxU is used to convert ansi/utf8 strings to unicode strings (wchar_t) */
#if defined( ENABLE_NLS ) && defined( HAVE_GETTEXT ) && \
    defined( WIN32 ) && !defined( HAVE_INCLUDED_GETTEXT )
#if wxUSE_UNICODE
#   define wxU(utf8) wxString(utf8, wxConvUTF8)
#else
Gildas Bazin's avatar
 
Gildas Bazin committed
61
#   define wxU(utf8) wxString(wxConvUTF8.cMB2WC(utf8), *wxConvCurrent)
Gildas Bazin's avatar
 
Gildas Bazin committed
62
#endif
Gildas Bazin's avatar
 
Gildas Bazin committed
63
#define ISUTF8 1
Gildas Bazin's avatar
 
Gildas Bazin committed
64 65

#else // ENABLE_NLS && HAVE_GETTEXT && WIN32 && !HAVE_INCLUDED_GETTEXT
Gildas Bazin's avatar
 
Gildas Bazin committed
66 67 68 69 70
#if wxUSE_UNICODE
#   define wxU(ansi) wxString(ansi, *wxConvCurrent)
#else
#   define wxU(ansi) ansi
#endif
Gildas Bazin's avatar
 
Gildas Bazin committed
71
#define ISUTF8 0
Gildas Bazin's avatar
 
Gildas Bazin committed
72

Gildas Bazin's avatar
 
Gildas Bazin committed
73 74
#endif

Gildas Bazin's avatar
 
Gildas Bazin committed
75 76 77 78 79 80 81 82
/* 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

Gildas Bazin's avatar
 
Gildas Bazin committed
83 84
#define WRAPCOUNT 80

85 86 87 88 89 90 91 92
#define OPEN_NORMAL 0
#define OPEN_STREAM 1

#define MODE_NONE 0
#define MODE_GROUP 1
#define MODE_AUTHOR 2
#define MODE_TITLE 3

Gildas Bazin's avatar
 
Gildas Bazin committed
93 94
wxArrayString SeparateEntries( wxString );

Gildas Bazin's avatar
 
Gildas Bazin committed
95
/*****************************************************************************
96
 * intf_sys_t: description and status of wxwindows interface
Gildas Bazin's avatar
 
Gildas Bazin committed
97 98 99 100 101
 *****************************************************************************/
struct intf_sys_t
{
    /* the wx parent window */
    wxWindow            *p_wxwindow;
Gildas Bazin's avatar
 
Gildas Bazin committed
102
    wxIcon              *p_icon;
Gildas Bazin's avatar
 
Gildas Bazin committed
103 104 105 106 107 108 109 110 111 112

    /* 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
113
    vlc_bool_t          b_slider_free;                      /* slider status */
Gildas Bazin's avatar
 
Gildas Bazin committed
114 115 116 117 118 119 120

    /* 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
121
    /* Send an event to show a dialog */
Gildas Bazin's avatar
 
Gildas Bazin committed
122 123
    void (*pf_show_dialog) ( intf_thread_t *p_intf, int i_dialog, int i_arg,
                             intf_dialog_args_t *p_arg );
Gildas Bazin's avatar
 
Gildas Bazin committed
124

Gildas Bazin's avatar
 
Gildas Bazin committed
125 126 127
    /* Popup menu */
    wxMenu              *p_popup_menu;

Gildas Bazin's avatar
 
Gildas Bazin committed
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151
};

/*****************************************************************************
 * 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
152
    int i_old_playing_status;
Gildas Bazin's avatar
 
Gildas Bazin committed
153
    int i_old_rate;
Gildas Bazin's avatar
 
Gildas Bazin committed
154 155 156 157 158 159 160 161 162
};

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

Clément Stenac's avatar
Clément Stenac committed
165
//    wxFlexGridSizer *frame_sizer;
Gildas Bazin's avatar
 
Gildas Bazin committed
166
    wxBoxSizer  *frame_sizer;
Gildas Bazin's avatar
 
Gildas Bazin committed
167 168
    wxStatusBar *statusbar;

Gildas Bazin's avatar
 
Gildas Bazin committed
169 170
    wxSlider    *slider;
    wxWindow    *slider_frame;
Clément Stenac's avatar
Clément Stenac committed
171
    wxWindow    *extra_frame;
Gildas Bazin's avatar
 
Gildas Bazin committed
172 173
    wxStaticBox *slider_box;

Clément Stenac's avatar
Clément Stenac committed
174 175 176 177 178 179 180 181 182 183 184
    vlc_bool_t b_extra;

    wxStaticBox *adjust_box;
    wxSlider *brightness_slider;
    wxSlider *contrast_slider;
    wxSlider *saturation_slider;
    wxSlider *hue_slider;

    wxStaticBox *other_box;
    wxComboBox *ratio_combo;

Gildas Bazin's avatar
 
Gildas Bazin committed
185 186
    wxGauge     *volctrl;

Gildas Bazin's avatar
 
Gildas Bazin committed
187
private:
188
    void UpdateAcceleratorTable();
Gildas Bazin's avatar
 
Gildas Bazin committed
189 190
    void CreateOurMenuBar();
    void CreateOurToolBar();
Clément Stenac's avatar
Clément Stenac committed
191
    void CreateOurExtraPanel();
Gildas Bazin's avatar
 
Gildas Bazin committed
192
    void CreateOurSlider();
Gildas Bazin's avatar
 
Gildas Bazin committed
193
    void Open( int i_access_method );
Gildas Bazin's avatar
 
Gildas Bazin committed
194

Gildas Bazin's avatar
 
Gildas Bazin committed
195
    /* Event handlers (these functions should _not_ be virtual) */
196 197
    void OnExit( wxCommandEvent& event );
    void OnAbout( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
198

199 200 201 202 203 204
    void OnOpenFileSimple( wxCommandEvent& event );
    void OnOpenFile( wxCommandEvent& event );
    void OnOpenDisc( wxCommandEvent& event );
    void OnOpenNet( wxCommandEvent& event );
    void OnOpenSat( wxCommandEvent& event );
    void OnOpenV4L( wxCommandEvent& event );
205
    void OnStream( wxCommandEvent& event );
Clément Stenac's avatar
Clément Stenac committed
206
    void OnExtra( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
207
    void OnShowDialog( wxCommandEvent& event );
208 209 210
    void OnPlayStream( wxCommandEvent& event );
    void OnStopStream( wxCommandEvent& event );
    void OnSliderUpdate( wxScrollEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
211 212
    void OnPrevStream( wxCommandEvent& event );
    void OnNextStream( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
213 214
    void OnSlowStream( wxCommandEvent& event );
    void OnFastStream( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
215

Clément Stenac's avatar
Clément Stenac committed
216 217 218 219 220 221 222
    void OnEnableAdjust( wxCommandEvent& event );
    void OnHueUpdate( wxScrollEvent& event );
    void OnContrastUpdate( wxScrollEvent& event );
    void OnBrightnessUpdate( wxScrollEvent& event );
    void OnSaturationUpdate( wxScrollEvent& event );

    void OnRatio( wxCommandEvent& event );
223
    void OnEnableVisual( wxCommandEvent& event );
Clément Stenac's avatar
Clément Stenac committed
224

Gildas Bazin's avatar
 
Gildas Bazin committed
225
    void OnMenuOpen( wxMenuEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
226 227

#if defined( __WXMSW__ ) || defined( __WXMAC__ )
Gildas Bazin's avatar
 
Gildas Bazin committed
228
    void OnContextMenu2(wxContextMenuEvent& event);
Gildas Bazin's avatar
 
Gildas Bazin committed
229
#endif
Gildas Bazin's avatar
 
Gildas Bazin committed
230
    void OnContextMenu(wxMouseEvent& event);
Gildas Bazin's avatar
 
Gildas Bazin committed
231

Gildas Bazin's avatar
 
Gildas Bazin committed
232 233 234 235
    DECLARE_EVENT_TABLE();

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

Gildas Bazin's avatar
 
Gildas Bazin committed
237
private:
Gildas Bazin's avatar
 
Gildas Bazin committed
238
    int i_old_playing_status;
Gildas Bazin's avatar
 
Gildas Bazin committed
239 240

    /* For auto-generated menus */
Gildas Bazin's avatar
 
Gildas Bazin committed
241 242
    wxMenu *p_settings_menu;
    vlc_bool_t b_settings_menu;
Gildas Bazin's avatar
 
Gildas Bazin committed
243 244 245 246
    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
247 248
    wxMenu *p_navig_menu;
    vlc_bool_t b_navig_menu;
Gildas Bazin's avatar
 
Gildas Bazin committed
249 250
};

251 252
class StreamDialog;

Gildas Bazin's avatar
 
Gildas Bazin committed
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269
/* 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 );
270
    void OnStreamDialog( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
271

Gildas Bazin's avatar
 
Gildas Bazin committed
272
    void OnOpenFileGeneric( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
273 274 275 276 277 278
    void OnOpenFileSimple( wxCommandEvent& event );
    void OnOpenFile( wxCommandEvent& event );
    void OnOpenDisc( wxCommandEvent& event );
    void OnOpenNet( wxCommandEvent& event );
    void OnOpenSat( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
279 280
    void OnPopupMenu( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
281 282
    void OnIdle( wxIdleEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
283 284
    void OnExitThread( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
285 286 287 288 289 290 291 292 293 294 295
    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;
296
    StreamDialog        *p_stream_dialog;
Gildas Bazin's avatar
 
Gildas Bazin committed
297
    wxFrame             *p_prefs_dialog;
Gildas Bazin's avatar
 
Gildas Bazin committed
298
    wxFileDialog        *p_file_generic_dialog;
Gildas Bazin's avatar
 
Gildas Bazin committed
299 300
};

Gildas Bazin's avatar
 
Gildas Bazin committed
301
/* Open Dialog */
302 303
class AutoBuiltPanel;
WX_DEFINE_ARRAY(AutoBuiltPanel *, ArrayOfAutoBuiltPanel);
304
class V4LDialog;
Gildas Bazin's avatar
 
Gildas Bazin committed
305 306
class SoutDialog;
class SubsFileDialog;
Gildas Bazin's avatar
 
Gildas Bazin committed
307
class OpenDialog: public wxFrame
Gildas Bazin's avatar
 
Gildas Bazin committed
308 309 310
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
311
    OpenDialog( intf_thread_t *p_intf, wxWindow *p_parent,
312 313 314 315 316
                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 );
Gildas Bazin's avatar
 
Gildas Bazin committed
317 318
    virtual ~OpenDialog();

Gildas Bazin's avatar
 
Gildas Bazin committed
319 320
    int Show();
    int Show( int i_access_method, int i_arg = 0 );
Gildas Bazin's avatar
 
Gildas Bazin committed
321

322 323 324
    void UpdateMRL();
    void UpdateMRL( int i_access_method );

Gildas Bazin's avatar
 
Gildas Bazin committed
325
    wxArrayString mrl;
Gildas Bazin's avatar
 
Gildas Bazin committed
326 327 328 329 330

private:
    wxPanel *FilePanel( wxWindow* parent );
    wxPanel *DiscPanel( wxWindow* parent );
    wxPanel *NetPanel( wxWindow* parent );
331
    wxPanel *V4LPanel( wxWindow* parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
332

333
    ArrayOfAutoBuiltPanel input_tab_array;
Gildas Bazin's avatar
 
Gildas Bazin committed
334 335 336 337 338 339 340 341

    /* 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
342
    /* Event handlers for the file page */
Gildas Bazin's avatar
 
Gildas Bazin committed
343 344 345 346 347 348
    void OnFilePanelChange( wxCommandEvent& event );
    void OnFileBrowse( wxCommandEvent& event );

    /* Event handlers for the disc page */
    void OnDiscPanelChange( wxCommandEvent& event );
    void OnDiscTypeChange( wxCommandEvent& event );
349
    void OnDiscDeviceChange( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
350 351 352 353 354

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

355 356 357 358 359
    /* Event handlers for the v4l page */
    void OnV4LPanelChange( wxCommandEvent& event );
    void OnV4LTypeChange( wxCommandEvent& event );
    void OnV4LSettingsChange( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
360 361 362 363
    /* Event handlers for the stream output */
    void OnSubsFileEnable( wxCommandEvent& event );
    void OnSubsFileSettings( wxCommandEvent& WXUNUSED(event) );

Gildas Bazin's avatar
 
Gildas Bazin committed
364 365 366 367
    /* Event handlers for the stream output */
    void OnSoutEnable( wxCommandEvent& event );
    void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );

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

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

375
    int i_method; /* Normal or for the stream dialog ? */
Gildas Bazin's avatar
 
Gildas Bazin committed
376
    wxComboBox *mrl_combo;
Gildas Bazin's avatar
 
Gildas Bazin committed
377
    wxNotebook *notebook;
Gildas Bazin's avatar
 
Gildas Bazin committed
378 379 380

    /* Controls for the file panel */
    wxComboBox *file_combo;
Gildas Bazin's avatar
 
Gildas Bazin committed
381
    wxFileDialog *file_dialog;
Gildas Bazin's avatar
 
Gildas Bazin committed
382 383 384 385 386 387

    /* Controls for the disc panel */
    wxRadioBox *disc_type;
    wxTextCtrl *disc_device;
    wxSpinCtrl *disc_title;
    wxSpinCtrl *disc_chapter;
388 389 390 391 392

    /* 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;
393 394 395 396
    
    /* Indicates if the disc device control was modified */
    bool b_disc_device_changed;
    
Gildas Bazin's avatar
 
Gildas Bazin committed
397 398 399 400 401 402
    /* Controls for the net panel */
    wxRadioBox *net_type;
    int i_net_type;
    wxPanel *net_subpanels[4];
    wxRadioButton *net_radios[4];
    wxSpinCtrl *net_ports[4];
Gildas Bazin's avatar
 
Gildas Bazin committed
403
    int        i_net_ports[4];
Gildas Bazin's avatar
 
Gildas Bazin committed
404
    wxTextCtrl *net_addrs[4];
405
    wxCheckBox *net_ipv6;
Gildas Bazin's avatar
 
Gildas Bazin committed
406

407 408 409 410 411 412 413 414
    /* Controls for the v4l panel */
    wxRadioBox *video_type;
    wxTextCtrl *video_device;
    wxSpinCtrl *video_channel;
    wxButton *v4l_button;
    V4LDialog *v4l_dialog;
    wxArrayString v4l_mrl;

Gildas Bazin's avatar
 
Gildas Bazin committed
415 416 417
    /* Controls for the subtitles file */
    wxButton *subsfile_button;
    wxCheckBox *subsfile_checkbox;
Gildas Bazin's avatar
 
Gildas Bazin committed
418
    SubsFileDialog *subsfile_dialog;
419
    wxArrayString subsfile_mrl;
Gildas Bazin's avatar
 
Gildas Bazin committed
420

Gildas Bazin's avatar
 
Gildas Bazin committed
421 422
    /* Controls for the stream output */
    wxButton *sout_button;
Gildas Bazin's avatar
 
Gildas Bazin committed
423
    wxCheckBox *sout_checkbox;
Gildas Bazin's avatar
 
Gildas Bazin committed
424
    SoutDialog *sout_dialog;
425
    wxArrayString sout_mrl;
Gildas Bazin's avatar
 
Gildas Bazin committed
426 427
};

428 429 430 431 432
enum
{
    FILE_ACCESS = 0,
    DISC_ACCESS,
    NET_ACCESS,
433
#ifndef WIN32
434
    V4L_ACCESS,
435 436
#endif
    MAX_ACCESS,
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
    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 );
454
    wxPanel *BitratePanel( wxWindow* parent );
455 456 457 458 459 460 461
    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 );
462
    void OnAudioChange( wxCommandEvent& event );
463 464 465 466 467 468 469
    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 );
470 471 472 473
    void OnBitrateEnable( wxCommandEvent& event );
    void OnBitrate( wxCommandEvent& event );
    void OnMaxBitrateEnable( wxCommandEvent& event );
    void OnMaxBitrate( wxCommandEvent& event );
474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499

    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;

500 501 502 503 504 505 506
    wxPanel *bitrate_subpanel;
    wxPanel *bitrate_panel;
    wxCheckBox *bitrate_checkbox;
    wxSpinCtrl *bitrate;
    wxCheckBox *maxbitrate_checkbox;
    wxSpinCtrl *maxbitrate;

507 508
};

Gildas Bazin's avatar
 
Gildas Bazin committed
509
/* Stream output Dialog */
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526
enum
{
    PLAY_ACCESS_OUT = 0,
    FILE_ACCESS_OUT,
    HTTP_ACCESS_OUT,
    MMSH_ACCESS_OUT,
    UDP_ACCESS_OUT,
    RTP_ACCESS_OUT,
    ACCESS_OUT_NUM
};

enum
{
    TS_ENCAPSULATION = 0,
    PS_ENCAPSULATION,
    MPEG1_ENCAPSULATION,
    OGG_ENCAPSULATION,
527
    RAW_ENCAPSULATION,
528 529 530 531 532 533 534 535 536 537 538 539 540
    ASF_ENCAPSULATION,
    AVI_ENCAPSULATION,
    MP4_ENCAPSULATION,
    MOV_ENCAPSULATION,
    ENCAPS_NUM
};

enum
{
    ANN_MISC_SOUT = 0,
    MISC_SOUT_NUM
};

Gildas Bazin's avatar
 
Gildas Bazin committed
541 542 543 544
class SoutDialog: public wxDialog
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
545
    SoutDialog( intf_thread_t *p_intf, wxWindow *p_parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
546 547
    virtual ~SoutDialog();

Gildas Bazin's avatar
 
Gildas Bazin committed
548
    wxArrayString GetOptions();
Gildas Bazin's avatar
 
Gildas Bazin committed
549 550 551 552

private:
    void UpdateMRL();
    wxPanel *AccessPanel( wxWindow* parent );
Mohammed Adnène Trojette's avatar
 
Mohammed Adnène Trojette committed
553
    wxPanel *MiscPanel( wxWindow* parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
554
    wxPanel *EncapsulationPanel( wxWindow* parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
555
    wxPanel *TranscodingPanel( wxWindow* parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
556
    void    ParseMRL();
Gildas Bazin's avatar
 
Gildas Bazin committed
557 558 559 560 561 562 563 564 565 566

    /* 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 );
Gildas Bazin's avatar
 
Gildas Bazin committed
567
    void OnFileDump( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
568 569 570 571

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

572 573 574
    /* Event specific to the announce address */
    void OnAnnounceAddrChange( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
575 576 577
    /* Event handlers for the encapsulation panel */
    void OnEncapsulationChange( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
578 579 580 581
    /* Event handlers for the transcoding panel */
    void OnTranscodingEnable( wxCommandEvent& event );
    void OnTranscodingChange( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
582 583
    /* Event handlers for the misc panel */
    void OnSAPMiscChange( wxCommandEvent& event );
584
    void OnSLPMiscChange( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
585

Gildas Bazin's avatar
 
Gildas Bazin committed
586 587 588
    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;
Gildas Bazin's avatar
 
Gildas Bazin committed
589
    wxWindow *p_parent;
Gildas Bazin's avatar
 
Gildas Bazin committed
590 591 592 593

    wxComboBox *mrl_combo;

    /* Controls for the access outputs */
Gildas Bazin's avatar
 
Gildas Bazin committed
594
    wxPanel *access_panel;
595 596
    wxPanel *access_subpanels[ACCESS_OUT_NUM];
    wxCheckBox *access_checkboxes[ACCESS_OUT_NUM];
Gildas Bazin's avatar
 
Gildas Bazin committed
597 598 599 600

    int i_access_type;

    wxComboBox *file_combo;
Gildas Bazin's avatar
 
Gildas Bazin committed
601
    wxCheckBox *dump_checkbox;
602 603
    wxSpinCtrl *net_ports[ACCESS_OUT_NUM];
    wxTextCtrl *net_addrs[ACCESS_OUT_NUM];
Gildas Bazin's avatar
 
Gildas Bazin committed
604

Mohammed Adnène Trojette's avatar
 
Mohammed Adnène Trojette committed
605
    /* Controls for the SAP announces */
Gildas Bazin's avatar
 
Gildas Bazin committed
606
    wxPanel *misc_panel;
607
    wxPanel *misc_subpanels[MISC_SOUT_NUM];
Gildas Bazin's avatar
 
Gildas Bazin committed
608
    wxCheckBox *sap_checkbox;
609 610 611
    wxCheckBox *slp_checkbox;
    wxTextCtrl *announce_addr;

Gildas Bazin's avatar
 
Gildas Bazin committed
612
    /* Controls for the encapsulation */
Gildas Bazin's avatar
 
Gildas Bazin committed
613
    wxPanel *encapsulation_panel;
614
    wxRadioButton *encapsulation_radios[ENCAPS_NUM];
Gildas Bazin's avatar
 
Gildas Bazin committed
615 616
    int i_encapsulation_type;

Gildas Bazin's avatar
 
Gildas Bazin committed
617
    /* Controls for transcoding */
Gildas Bazin's avatar
 
Gildas Bazin committed
618
    wxPanel *transcoding_panel;
Gildas Bazin's avatar
 
Gildas Bazin committed
619 620 621 622 623 624
    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
625
    wxComboBox *audio_channels_combo;
626
    wxComboBox *video_scale_combo;
Gildas Bazin's avatar
 
Gildas Bazin committed
627 628
};

Gildas Bazin's avatar
 
Gildas Bazin committed
629 630 631 632 633 634 635 636 637
/* Subtitles File Dialog */
class SubsFileDialog: public wxDialog
{
public:
    /* Constructor */
    SubsFileDialog( intf_thread_t *p_intf, wxWindow *p_parent );
    virtual ~SubsFileDialog();

    wxComboBox *file_combo;
Gildas Bazin's avatar
 
Gildas Bazin committed
638
    wxComboBox *encoding_combo;
Gildas Bazin's avatar
 
Gildas Bazin committed
639 640 641 642 643 644 645 646 647 648 649 650 651 652 653
    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;
};

654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683
/* Stream */
class StreamDialog: public wxFrame
{
public:
    /* Constructor */
    StreamDialog( intf_thread_t *p_intf, wxWindow *p_parent );
    virtual ~StreamDialog();

private:
    void OnClose( wxCommandEvent& event );
    void OnOpen( wxCommandEvent& event );
    void OnSout( wxCommandEvent& event );
    void OnStart( wxCommandEvent& event );

    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;

    wxStaticText *step2_label;
    wxStaticText *step3_label;
    wxButton *sout_button;
    wxButton *start_button;
    wxArrayString mrl;
    wxArrayString sout_mrl;
    OpenDialog *p_open_dialog;
    SoutDialog *p_sout_dialog;
};



Gildas Bazin's avatar
 
Gildas Bazin committed
684
/* Preferences Dialog */
Gildas Bazin's avatar
 
Gildas Bazin committed
685
class PrefsTreeCtrl;
Gildas Bazin's avatar
 
Gildas Bazin committed
686
class PrefsDialog: public wxFrame
Gildas Bazin's avatar
 
Gildas Bazin committed
687 688 689
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
690
    PrefsDialog( intf_thread_t *p_intf, wxWindow *p_parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
691 692 693 694 695 696 697 698
    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
699
    void OnSave( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
700
    void OnResetAll( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
701
    void OnAdvanced( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
702 703 704 705

    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;
Gildas Bazin's avatar
 
Gildas Bazin committed
706 707

    PrefsTreeCtrl *prefs_tree;
Gildas Bazin's avatar
 
Gildas Bazin committed
708 709
};

710 711 712 713 714
/* Messages */
class Messages: public wxFrame
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
715
    Messages( intf_thread_t *p_intf, wxWindow *p_parent );
716
    virtual ~Messages();
717
    bool Show( bool show = TRUE );
718 719 720 721 722
    void UpdateLog();

private:
    /* Event handlers (these functions should _not_ be virtual) */
    void OnClose( wxCommandEvent& event );
723
    void OnClear( wxCommandEvent& event );
724
    void OnSaveLog( wxCommandEvent& event );
725 726 727 728 729 730 731 732 733

    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
734

735
    wxFileDialog *save_log_dialog;
736

Gildas Bazin's avatar
 
Gildas Bazin committed
737
    vlc_bool_t b_verbose;
738 739
};

740
/* Playlist */
Clément Stenac's avatar
Clément Stenac committed
741
class ItemInfoDialog;
742
class NewGroup;
743 744 745 746
class Playlist: public wxFrame
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
747
    Playlist( intf_thread_t *p_intf, wxWindow *p_parent );
748
    virtual ~Playlist();
Gildas Bazin's avatar
 
Gildas Bazin committed
749 750 751 752 753 754

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

    bool b_need_update;
    vlc_mutex_t lock;
755 756

private:
757 758
    void DeleteItem( int item );

759
    /* Event handlers (these functions should _not_ be virtual) */
Gildas Bazin's avatar
 
Gildas Bazin committed
760
    void OnAddFile( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
761
    void OnAddMRL( wxCommandEvent& event );
762
    void OnClose( wxCommandEvent& event );
Clément Stenac's avatar
Clément Stenac committed
763
    void OnSearch( wxCommandEvent& event );
Clément Stenac's avatar
Clément Stenac committed
764 765
    void OnEnDis( wxCommandEvent& event );
    void OnInfos( wxCommandEvent& event );
Clément Stenac's avatar
Clément Stenac committed
766
    void OnSearchTextChange( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
767 768
    void OnOpen( wxCommandEvent& event );
    void OnSave( wxCommandEvent& event );
769 770

    void OnSort( wxCommandEvent& event );
771
    void OnColSelect( wxListEvent& event );
772 773 774 775

    void OnUp( wxCommandEvent& event);
    void OnDown( wxCommandEvent& event);

Clément Stenac's avatar
Clément Stenac committed
776 777
    void OnEnableSelection( wxCommandEvent& event );
    void OnDisableSelection( wxCommandEvent& event );
778 779 780
    void OnInvertSelection( wxCommandEvent& event );
    void OnDeleteSelection( wxCommandEvent& event );
    void OnSelectAll( wxCommandEvent& event );
781
    void OnRandom( wxCommandEvent& event );
782
    void OnRepeat( wxCommandEvent& event );
783
    void OnLoop ( wxCommandEvent& event );
784 785
    void OnActivateItem( wxListEvent& event );
    void OnKeyDown( wxListEvent& event );
786 787
    void OnNewGroup( wxCommandEvent& event );

Gildas Bazin's avatar
 
Gildas Bazin committed
788
    void Rebuild();
789

Clément Stenac's avatar
Clément Stenac committed
790
    wxTextCtrl *search_text;
Clément Stenac's avatar
Clément Stenac committed
791
    wxButton *search_button;
792 793
    DECLARE_EVENT_TABLE();

Clément Stenac's avatar
Clément Stenac committed
794 795 796

    ItemInfoDialog *iteminfo_dialog;

797 798
    intf_thread_t *p_intf;
    wxListView *listview;
799
    wxTreeCtrl *treeview;
Gildas Bazin's avatar
 
Gildas Bazin committed
800
    int i_update_counter;
801
    int i_sort_mode;
802 803 804 805

    int i_title_sorted;
    int i_author_sorted;
    int i_group_sorted;
806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830
};


class NewGroup: public wxDialog
{
public:
    /* Constructor */
    NewGroup( intf_thread_t *p_intf, wxWindow *p_parent );
    virtual ~NewGroup();

private:

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

    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;
    wxTextCtrl *groupname;

protected:
    friend class Playlist;
    friend class ItemInfoDialog;
    char *psz_name;
831
};
Gildas Bazin's avatar
 
Gildas Bazin committed
832

Clément Stenac's avatar
Clément Stenac committed
833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851

/* ItemInfo Dialog */
class ItemInfoDialog: public wxDialog
{
public:
    /* Constructor */
    ItemInfoDialog( intf_thread_t *p_intf, playlist_item_t *_p_item,
                    wxWindow *p_parent );
    virtual ~ItemInfoDialog();

    wxArrayString GetOptions();

private:
    wxPanel *InfoPanel( wxWindow* parent );
    wxPanel *GroupPanel( wxWindow* parent );

    /* Event handlers (these functions should _not_ be virtual) */
    void OnOk( wxCommandEvent& event );
    void OnCancel( wxCommandEvent& event );
852
    void OnNewGroup( wxCommandEvent& event );
Clément Stenac's avatar
Clément Stenac committed
853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871

    DECLARE_EVENT_TABLE();

    intf_thread_t *p_intf;
    playlist_item_t *p_item;
    wxWindow *p_parent;

    /* Controls for the iteminfo dialog box */
    wxPanel *info_subpanel;
    wxPanel *info_panel;

    wxPanel *group_subpanel;
    wxPanel *group_panel;

    wxTextCtrl *uri_text;
    wxTextCtrl *name_text;
    wxTextCtrl *author_text;

    wxCheckBox *enabled_checkbox;
872 873
    wxComboBox *group_combo;
    int ids_array[100];
Clément Stenac's avatar
Clément Stenac committed
874 875 876
};


877 878 879 880 881
/* File Info */
class FileInfo: public wxFrame
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
882
    FileInfo( intf_thread_t *p_intf, wxWindow *p_parent );
883
    virtual ~FileInfo();
884
    void UpdateFileInfo();
885 886 887

private:
    void OnClose( wxCommandEvent& event );
888

889
    DECLARE_EVENT_TABLE();
890

891 892 893
    intf_thread_t *p_intf;
    wxTreeCtrl *fileinfo_tree;
    wxTreeItemId fileinfo_root;
Anil Daoud's avatar
 
Anil Daoud committed
894
    wxString fileinfo_root_label;
895

896 897
};

898

Gildas Bazin's avatar
 
Gildas Bazin committed
899
#if !defined(__WXX11__)
Gildas Bazin's avatar
 
Gildas Bazin committed
900 901 902 903
/* Drag and Drop class */
class DragAndDrop: public wxFileDropTarget
{
public:
Gildas Bazin's avatar
 
Gildas Bazin committed
904
    DragAndDrop( intf_thread_t *_p_intf, vlc_bool_t b_enqueue = VLC_FALSE );
Gildas Bazin's avatar
 
Gildas Bazin committed
905 906 907 908 909 910

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

private:
    intf_thread_t *p_intf;
Gildas Bazin's avatar
 
Gildas Bazin committed
911
    vlc_bool_t b_enqueue;
Gildas Bazin's avatar
 
Gildas Bazin committed
912
};
Gildas Bazin's avatar
 
Gildas Bazin committed
913
#endif
Gildas Bazin's avatar
 
Gildas Bazin committed
914

Gildas Bazin's avatar
 
Gildas Bazin committed
915
/* Menus */
Gildas Bazin's avatar
 
Gildas Bazin committed
916
void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
Gildas Bazin's avatar
 
Gildas Bazin committed
917
                const wxPoint& pos );
Gildas Bazin's avatar
 
Gildas Bazin committed
918
wxMenu *SettingsMenu( intf_thread_t *_p_intf, wxWindow *p_parent );
Gildas Bazin's avatar
 
Gildas Bazin committed
919 920 921
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
922

Gildas Bazin's avatar
 
Gildas Bazin committed
923
class MenuEvtHandler : public wxEvtHandler
Gildas Bazin's avatar
 
Gildas Bazin committed
924 925
{
public:
Gildas Bazin's avatar
 
Gildas Bazin committed
926 927
    MenuEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
    virtual ~MenuEvtHandler();
Gildas Bazin's avatar
 
Gildas Bazin committed
928

Gildas Bazin's avatar
 
Gildas Bazin committed
929 930
    void OnMenuEvent( wxCommandEvent& event );
    void OnShowDialog( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
931 932 933 934 935 936 937 938 939

private:

    DECLARE_EVENT_TABLE()

    intf_thread_t *p_intf;
    Interface *p_main_interface;
};

Gildas Bazin's avatar
 
Gildas Bazin committed
940
class Menu: public wxMenu
Gildas Bazin's avatar
 
Gildas Bazin committed
941 942 943
{
public:
    /* Constructor */
Gildas Bazin's avatar
 
Gildas Bazin committed
944
    Menu( intf_thread_t *p_intf, wxWindow *p_parent, int i_count,
Gildas Bazin's avatar
 
Gildas Bazin committed
945
          char **ppsz_names, int *pi_objects, int i_start_id );
Gildas Bazin's avatar
 
Gildas Bazin committed
946
    virtual ~Menu();
Gildas Bazin's avatar
 
Gildas Bazin committed
947 948

private:
Gildas Bazin's avatar
 
Gildas Bazin committed
949 950
    /* Event handlers (these functions should _not_ be virtual) */
    void OnClose( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
951
    void OnShowDialog( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
952
    void OnEntrySelected( wxCommandEvent& event );
Gildas Bazin's avatar
 
Gildas Bazin committed
953

Gildas Bazin's avatar
 
Gildas Bazin committed
954 955 956 957 958 959 960 961 962
    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
963
};
964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008

static inline int ConvertHotkeyModifiers( int i_hotkey )
{
    int i_accel_flags = 0;
    if( i_hotkey & KEY_MODIFIER_ALT ) i_accel_flags |= wxACCEL_ALT;
    if( i_hotkey & KEY_MODIFIER_CTRL ) i_accel_flags |= wxACCEL_CTRL;
    if( i_hotkey & KEY_MODIFIER_SHIFT ) i_accel_flags |= wxACCEL_SHIFT;
    return i_accel_flags;
}

static inline int ConvertHotkey( int i_hotkey )
{
    int i_key = i_hotkey & ~KEY_MODIFIER;
    if( i_key & KEY_ASCII ) return i_key & KEY_ASCII;
    else if( i_key & KEY_SPECIAL )
    {
        switch ( i_key )
        {
        case KEY_LEFT: return WXK_LEFT;
        case KEY_RIGHT: return WXK_RIGHT;
        case KEY_UP: return WXK_UP;
        case KEY_DOWN: return WXK_DOWN;
        case KEY_SPACE: return WXK_SPACE;
        case KEY_ENTER: return WXK_RETURN;
        case KEY_F1: return WXK_F1;
        case KEY_F2: return WXK_F2;
        case KEY_F3: return WXK_F3;
        case KEY_F4: return WXK_F4;
        case KEY_F5: return WXK_F5;
        case KEY_F6: return WXK_F6;
        case KEY_F7: return WXK_F7;
        case KEY_F8: return WXK_F8;
        case KEY_F9: return WXK_F9;
        case KEY_F10: return WXK_F10;
        case KEY_F11: return WXK_F11;
        case KEY_F12: return WXK_F12;
        case KEY_HOME: return WXK_HOME;
        case KEY_END: return WXK_HOME;
        case KEY_MENU: return WXK_MENU;
        case KEY_ESC: return WXK_ESCAPE;
        case KEY_PAGEUP: return WXK_PRIOR;
        case KEY_PAGEDOWN: return WXK_NEXT;
        case KEY_TAB: return WXK_TAB;
        case KEY_BACKSPACE: return WXK_BACK;
        }
1009
    }
1010
    return 0;
1011
}