]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/wxwindows.h
*All: fixed unwanted fileinfo window refresh under windows.
[vlc] / modules / gui / wxwindows / wxwindows.h
index 73d9ba8c507c97a873befbec58e29f7f359fd9b9..2e77c201da82a99360066499c57f3396f5568a41 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.5 2002/12/13 01:50:32 gbazin Exp $
+ * $Id: wxwindows.h,v 1.18 2003/04/21 16:55:53 anil Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -10,7 +10,7 @@
  * 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
  *****************************************************************************/
 
 #include <wx/listctrl.h>
+#include <wx/textctrl.h>
+#include <wx/notebook.h>
+#include <wx/spinctrl.h>
 #include <wx/dnd.h>
+#include <wx/treectrl.h>
 
 class Playlist;
+class Messages;
+class FileInfo;
 
 #define SLIDER_MAX_POS 10000
 
 /*****************************************************************************
- * intf_sys_t: description and status of Gtk+ interface
+ * intf_sys_t: description and status of wxwindows interface
  *****************************************************************************/
 struct intf_sys_t
 {
     /* the wx parent window */
     wxWindow            *p_wxwindow;
+    wxIcon              *p_icon;
 
     /* secondary windows */
     Playlist            *p_playlist_window;
+    Messages            *p_messages_window;
+    FileInfo            *p_fileinfo_window;
 
     /* special actions */
     vlc_bool_t          b_playing;
@@ -47,7 +56,7 @@ struct intf_sys_t
     vlc_bool_t          b_slider_free;                      /* slider status */
 
     /* menus handlers */
-    vlc_bool_t          b_program_update;   /* do we need to update programs 
+    vlc_bool_t          b_program_update;   /* do we need to update programs
                                                                         menu */
     vlc_bool_t          b_title_update;  /* do we need to update title menus */
     vlc_bool_t          b_chapter_update;            /* do we need to update
@@ -96,6 +105,7 @@ public:
 private:
     intf_thread_t *p_intf;
     Interface *p_main_interface;
+    int i_old_playing_status;
 };
 
 /* Main Interface */
@@ -105,6 +115,7 @@ public:
     /* Constructor */
     Interface( intf_thread_t *p_intf );
     virtual ~Interface();
+    void TogglePlayButton( int i_playing_status );
 
     wxBoxSizer  *frame_sizer;
     wxStatusBar *statusbar;
@@ -113,19 +124,32 @@ public:
     wxWindow    *slider_frame;
     wxStaticBox *slider_box;
 
+    wxMenu      *p_popup_menu;
+
+    wxArrayString mrl_history;
+
 private:
     void CreateOurMenuBar();
     void CreateOurToolBar();
     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 OnMessages( wxCommandEvent& event );
     void OnPlaylist( wxCommandEvent& event );
+    void OnLogs( wxCommandEvent& event );
+    void OnFileInfo( wxCommandEvent& event );
+    void OnPreferences( wxCommandEvent& event );
+
     void OnOpenFile( wxCommandEvent& event );
+    void OnOpenDisc( wxCommandEvent& event );
+    void OnOpenNet( wxCommandEvent& event );
+    void OnOpenSat( wxCommandEvent& event );
+
     void OnPlayStream( wxCommandEvent& event );
     void OnStopStream( wxCommandEvent& event );
-    void OnPauseStream( wxCommandEvent& event );
     void OnSliderUpdate( wxScrollEvent& event );
     void OnPrevStream( wxCommandEvent& event );
     void OnNextStream( wxCommandEvent& event );
@@ -134,6 +158,211 @@ private:
 
     Timer *timer;
     intf_thread_t *p_intf;
+
+    wxFrame *p_prefs_dialog;
+
+    int i_old_playing_status;
+};
+
+/* Open Dialog */
+class OpenDialog: public wxDialog
+{
+public:
+    /* Constructor */
+    OpenDialog( intf_thread_t *p_intf, Interface *p_main_interface,
+                int i_access_method );
+    virtual ~OpenDialog();
+    void Rebuild();
+    void Manage();
+
+    wxString mrl;
+
+private:
+    wxPanel *FilePanel( wxWindow* parent );
+    wxPanel *DiscPanel( wxWindow* parent );
+    wxPanel *NetPanel( wxWindow* parent );
+    wxPanel *SatPanel( wxWindow* parent );
+
+    void UpdateMRL( int i_access_method );
+
+    /* 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 );
+
+    /* Event handlers for the net page */
+    void OnNetPanelChange( wxCommandEvent& event );
+    void OnNetTypeChange( wxCommandEvent& event );
+
+    /* Event handlers for the stream output */
+    void OnSoutEnable( wxCommandEvent& event );
+    void OnSoutSettings( wxCommandEvent& WXUNUSED(event) );
+
+    /* Event handlers for the demux dump */
+    void OnDemuxDumpEnable( wxCommandEvent& event );
+    void OnDemuxDumpBrowse( wxCommandEvent& event );
+    void OnDemuxDumpChange( wxCommandEvent& event );
+
+    DECLARE_EVENT_TABLE();
+
+    intf_thread_t *p_intf;
+    Interface *p_main_interface;
+    int i_current_access_method;
+
+    wxComboBox *mrl_combo;
+
+    /* Controls for the file panel */
+    wxComboBox *file_combo;
+
+    /* 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];
+
+    /* Controls for the stream output */
+    wxButton *sout_button;
+    wxCheckBox *sout_checkbox;
+
+    /* Controls for the demux dump */
+    wxTextCtrl *demuxdump_textctrl;
+    wxButton *demuxdump_button;
+    wxCheckBox *demuxdump_checkbox;
+};
+
+enum
+{
+    FILE_ACCESS = 0,
+    DISC_ACCESS,
+    NET_ACCESS,
+    SAT_ACCESS
+};
+
+/* Stream output Dialog */
+class SoutDialog: public wxDialog
+{
+public:
+    /* Constructor */
+    SoutDialog( intf_thread_t *p_intf, Interface *p_main_interface );
+    virtual ~SoutDialog();
+
+    wxString mrl;
+
+private:
+    void UpdateMRL();
+    wxPanel *AccessPanel( wxWindow* parent );
+    wxPanel *EncapsulationPanel( 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 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 );
+
+    /* Event handlers for the encapsulation panel */
+    void OnEncapsulationChange( wxCommandEvent& event );
+
+    DECLARE_EVENT_TABLE();
+
+    intf_thread_t *p_intf;
+    Interface *p_main_interface;
+
+    wxComboBox *mrl_combo;
+    wxPanel *access_panel;
+    wxPanel *encapsulation_panel;
+
+    /* Controls for the access outputs */
+    wxPanel *access_subpanels[4];
+    wxRadioButton *access_radios[4];
+
+    int i_access_type;
+
+    wxComboBox *file_combo;
+    wxSpinCtrl *net_port;
+    wxTextCtrl *net_addr;
+
+    /* Controls for the encapsulation */
+    wxRadioButton *encapsulation_radios[4];
+    int i_encapsulation_type;
+
+};
+
+/* Preferences Dialog */
+class PrefsTreeCtrl;
+class PrefsDialog: public wxFrame
+{
+public:
+    /* Constructor */
+    PrefsDialog( intf_thread_t *p_intf, Interface *p_main_interface );
+    virtual ~PrefsDialog();
+
+private:
+    wxPanel *PrefsPanel( wxWindow* parent );
+
+    /* Event handlers (these functions should _not_ be virtual) */
+    void OnOk( wxCommandEvent& event );
+    void OnCancel( wxCommandEvent& event );
+    void OnSave( wxCommandEvent& event );
+
+    DECLARE_EVENT_TABLE();
+
+    intf_thread_t *p_intf;
+    Interface *p_main_interface;
+
+    PrefsTreeCtrl *prefs_tree;
+};
+
+/* Messages */
+class Messages: public wxFrame
+{
+public:
+    /* Constructor */
+    Messages( intf_thread_t *p_intf, Interface *_p_main_interface );
+    virtual ~Messages();
+    void UpdateLog();
+
+private:
+    /* Event handlers (these functions should _not_ be virtual) */
+    void OnClose( wxCommandEvent& event );
+    void OnVerbose( wxCommandEvent& event );
+
+    DECLARE_EVENT_TABLE();
+
+    intf_thread_t *p_intf;
+    Interface *p_main_interface;
+    wxTextCtrl *textctrl;
+    wxTextAttr *info_attr;
+    wxTextAttr *err_attr;
+    wxTextAttr *warn_attr;
+    wxTextAttr *dbg_attr;
+
+    vlc_bool_t b_verbose;
 };
 
 /* Playlist */
@@ -147,6 +376,8 @@ public:
     void Manage();
 
 private:
+    void DeleteItem( int item );
+
     /* Event handlers (these functions should _not_ be virtual) */
     void OnAddUrl( wxCommandEvent& event );
     void OnAddDirectory( wxCommandEvent& event );
@@ -159,13 +390,33 @@ private:
 
     DECLARE_EVENT_TABLE();
 
-    void DeleteItem( int item );
     intf_thread_t *p_intf;
     Interface *p_main_interface;
     wxListView *listview;
     wxButton *ok_button;
 };
 
+/* File Info */
+class FileInfo: public wxFrame
+{
+public:
+    /* Constructor */
+    FileInfo( intf_thread_t *p_intf, Interface *p_main_interface );
+    virtual ~FileInfo();
+    void UpdateFileInfo();
+
+private:
+    void OnClose( wxCommandEvent& event );
+
+    DECLARE_EVENT_TABLE();
+   
+    intf_thread_t *p_intf;
+    wxTreeCtrl *fileinfo_tree;
+    wxTreeItemId fileinfo_root;
+    wxString fileinfo_root_label;
+
+};
+
 #if !defined(__WXX11__)
 /* Drag and Drop class */
 class DragAndDrop: public wxFileDropTarget
@@ -195,9 +446,56 @@ private:
     void OnEntrySelected( wxCommandEvent& event );
 
     wxMenu *PopupMenu::CreateDummyMenu();
+    void   PopupMenu::CreateMenuEntry( char *, vlc_object_t * );
+    wxMenu *PopupMenu::CreateSubMenu( char *, vlc_object_t * );
 
     DECLARE_EVENT_TABLE();
 
     intf_thread_t *p_intf;
     Interface *p_main_interface;
+
+    int  i_item_id;
+};
+
+class PopupEvtHandler : public wxEvtHandler
+{
+public:
+    PopupEvtHandler( intf_thread_t *p_intf, Interface *p_main_interface );
+    virtual ~PopupEvtHandler();
+
+    void PopupEvtHandler::OnMenuEvent( wxCommandEvent& event );
+
+private:
+
+    DECLARE_EVENT_TABLE()
+
+    intf_thread_t *p_intf;
+    Interface *p_main_interface;
+};
+
+class wxMenuItemExt: public wxMenuItem
+{
+public:
+    /* Constructor */
+    wxMenuItemExt( wxMenu* parentMenu, int id,
+                   const wxString& text,
+                   const wxString& helpString,
+                   wxItemKind kind,
+                   char *_psz_var, int _i_object_id, vlc_value_t _val ):
+        wxMenuItem( parentMenu, id, text, helpString, kind )
+    {
+        /* Initializations */
+        psz_var = _psz_var;
+        i_object_id = _i_object_id;
+        val = _val;
+    };
+
+    virtual ~wxMenuItemExt() { if( psz_var ) free( psz_var ); };
+
+    char *psz_var;
+    int  i_object_id;
+    vlc_value_t val;
+
+private:
+
 };