]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/wxwindows.h
* modules/gui/wxwindows/*: some code cleanup for the bookmarks dialog.
[vlc] / modules / gui / wxwindows / wxwindows.h
index 84b810cb84dcace76cf2a6007437958c3ef00d3f..4f862ba3086a5019780a87cd2c4e236ffafb66c7 100644 (file)
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * wxwindows.h: private wxWindows interface description
  *****************************************************************************
- * Copyright (C) 1999, 2000 VideoLAN
- * $Id: wxwindows.h,v 1.78 2003/12/13 00:45:49 rocky Exp $
+ * Copyright (C) 1999-2004 VideoLAN
+ * $Id$
  *
- * Authors: Gildas Bazin <gbazin@netcourrier.com>
+ * Authors: Gildas Bazin <gbazin@videolan.org>
  *
  * 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
 #include <wx/checkbox.h>
 #include "vlc_keys.h"
 
-DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
+/* Hmmm, work-around for newest wxWin */
+#ifdef wxStaticCastEvent
+#   undef wxStaticCastEvent
+#   define wxStaticCastEvent(type, val) ((type)(val))
+#endif
 
-class OpenDialog;
-class Playlist;
-class Messages;
-class FileInfo;
+DECLARE_LOCAL_EVENT_TYPE( wxEVT_DIALOG, 0 );
+DECLARE_LOCAL_EVENT_TYPE( wxEVT_INTF, 1 );
 
 #define SLIDER_MAX_POS 10000
 
 /* 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 defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
 #if wxUSE_UNICODE
 #   define wxU(utf8) wxString(utf8, wxConvUTF8)
 #else
@@ -62,7 +63,7 @@ class FileInfo;
 #endif
 #define ISUTF8 1
 
-#else // ENABLE_NLS && HAVE_GETTEXT && WIN32 && !HAVE_INCLUDED_GETTEXT
+#else // ENABLE_NLS && ENABLE_UTF8
 #if wxUSE_UNICODE
 #   define wxU(ansi) wxString(ansi, *wxConvCurrent)
 #else
@@ -72,6 +73,14 @@ class FileInfo;
 
 #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
@@ -82,7 +91,9 @@ class FileInfo;
 #define MODE_AUTHOR 2
 #define MODE_TITLE 3
 
-wxArrayString SeparateEntries( wxString );
+class PrefsTreeCtrl;
+class AutoBuiltPanel;
+class VideoWindow;
 
 /*****************************************************************************
  * intf_sys_t: description and status of wxwindows interface
@@ -117,17 +128,35 @@ struct intf_sys_t
     /* Popup menu */
     wxMenu              *p_popup_menu;
 
+    VideoWindow         *p_video_window;
+    wxBoxSizer          *p_video_sizer;
 };
 
 /*****************************************************************************
  * Prototypes
  *****************************************************************************/
+wxArrayString SeparateEntries( wxString );
+wxWindow *VideoWindow( intf_thread_t *p_intf, wxWindow *p_parent );
+wxWindow *BookmarksDialog( intf_thread_t *p_intf, wxWindow *p_parent );
+
+namespace wxvlc
+{
+class Interface;
+class OpenDialog;
+class V4LDialog;
+class SoutDialog;
+class SubsFileDialog;
+class Playlist;
+class Messages;
+class FileInfo;
+class StreamDialog;
+class ItemInfoDialog;
+class NewGroup;
+class ExportPlaylist;
 
 /*****************************************************************************
  * Classes declarations.
  *****************************************************************************/
-class Interface;
-
 /* Timer */
 class Timer: public wxTimer
 {
@@ -154,7 +183,6 @@ public:
     virtual ~Interface();
     void TogglePlayButton( int i_playing_status );
 
-//    wxFlexGridSizer *frame_sizer;
     wxBoxSizer  *frame_sizer;
     wxStatusBar *statusbar;
 
@@ -170,6 +198,7 @@ public:
     wxSlider *contrast_slider;
     wxSlider *saturation_slider;
     wxSlider *hue_slider;
+    wxSlider *gamma_slider;
 
     wxStaticBox *other_box;
     wxComboBox *ratio_combo;
@@ -180,7 +209,7 @@ private:
     void UpdateAcceleratorTable();
     void CreateOurMenuBar();
     void CreateOurToolBar();
-    void CreateOurExtraPanel();
+    void CreateOurExtendedPanel();
     void CreateOurSlider();
     void Open( int i_access_method );
 
@@ -194,8 +223,8 @@ private:
     void OnOpenNet( wxCommandEvent& event );
     void OnOpenSat( wxCommandEvent& event );
     void OnOpenV4L( wxCommandEvent& event );
-    void OnStream( wxCommandEvent& event );
-    void OnExtra( wxCommandEvent& event );
+    void OnExtended( wxCommandEvent& event );
+    void OnBookmarks( wxCommandEvent& event );
     void OnShowDialog( wxCommandEvent& event );
     void OnPlayStream( wxCommandEvent& event );
     void OnStopStream( wxCommandEvent& event );
@@ -210,6 +239,7 @@ private:
     void OnContrastUpdate( wxScrollEvent& event );
     void OnBrightnessUpdate( wxScrollEvent& event );
     void OnSaturationUpdate( wxScrollEvent& event );
+    void OnGammaUpdate( wxScrollEvent& event );
 
     void OnRatio( wxCommandEvent& event );
     void OnEnableVisual( wxCommandEvent& event );
@@ -221,6 +251,8 @@ private:
 #endif
     void OnContextMenu(wxMouseEvent& event);
 
+    void UpdateSizeEvent( wxCommandEvent& event );
+
     DECLARE_EVENT_TABLE();
 
     Timer *timer;
@@ -240,8 +272,6 @@ private:
     vlc_bool_t b_navig_menu;
 };
 
-class StreamDialog;
-
 /* Dialogs Provider */
 class DialogsProvider: public wxFrame
 {
@@ -259,7 +289,8 @@ private:
     void OnMessages( wxCommandEvent& event );
     void OnFileInfo( wxCommandEvent& event );
     void OnPreferences( wxCommandEvent& event );
-    void OnStreamDialog( wxCommandEvent& event );
+    void OnStreamWizardDialog( wxCommandEvent& event );
+    void OnBookmarks( wxCommandEvent& event );
 
     void OnOpenFileGeneric( wxCommandEvent& event );
     void OnOpenFileSimple( wxCommandEvent& event );
@@ -285,17 +316,14 @@ public:
     Playlist            *p_playlist_dialog;
     Messages            *p_messages_dialog;
     FileInfo            *p_fileinfo_dialog;
-    StreamDialog        *p_stream_dialog;
+    StreamDialog        *p_streamwizard_dialog;
     wxFrame             *p_prefs_dialog;
+    wxWindow            *p_bookmarks_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:
@@ -362,8 +390,11 @@ private:
     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;
 
@@ -515,6 +546,7 @@ enum
     PS_ENCAPSULATION,
     MPEG1_ENCAPSULATION,
     OGG_ENCAPSULATION,
+    RAW_ENCAPSULATION,
     ASF_ENCAPSULATION,
     AVI_ENCAPSULATION,
     MP4_ENCAPSULATION,
@@ -613,6 +645,7 @@ private:
     wxComboBox *video_bitrate_combo;
     wxComboBox *audio_bitrate_combo;
     wxComboBox *audio_channels_combo;
+    wxComboBox *video_scale_combo;
 };
 
 /* Subtitles File Dialog */
@@ -671,7 +704,6 @@ private:
 
 
 /* Preferences Dialog */
-class PrefsTreeCtrl;
 class PrefsDialog: public wxFrame
 {
 public:
@@ -727,8 +759,6 @@ private:
 };
 
 /* Playlist */
-class ItemInfoDialog;
-class NewGroup;
 class Playlist: public wxFrame
 {
 public:
@@ -738,12 +768,13 @@ public:
 
     void UpdatePlaylist();
     void ShowPlaylist( bool show );
+    void UpdateItem( int );
 
     bool b_need_update;
-    vlc_mutex_t lock;
 
 private:
     void DeleteItem( int item );
+    void ShowInfos( int item );
 
     /* Event handlers (these functions should _not_ be virtual) */
     void OnAddFile( wxCommandEvent& event );
@@ -774,12 +805,22 @@ private:
     void OnKeyDown( wxListEvent& event );
     void OnNewGroup( wxCommandEvent& event );
 
+    /* Popup functions */
+    void OnPopup( wxListEvent& event );
+    void OnPopupPlay( wxMenuEvent& event );
+    void OnPopupDel( wxMenuEvent& event );
+    void OnPopupEna( wxMenuEvent& event );
+    void OnPopupInfo( wxMenuEvent& event );
     void Rebuild();
 
+    /* Custom events */
+    void OnPlaylistEvent( wxCommandEvent& event );
+
     wxTextCtrl *search_text;
     wxButton *search_button;
     DECLARE_EVENT_TABLE();
 
+    wxMenu *popup_menu;
 
     ItemInfoDialog *iteminfo_dialog;
 
@@ -789,12 +830,14 @@ private:
     int i_update_counter;
     int i_sort_mode;
 
+    int i_popup_item;
+
     int i_title_sorted;
     int i_author_sorted;
     int i_group_sorted;
+    int i_duration_sorted;
 };
 
-
 class NewGroup: public wxDialog
 {
 public:
@@ -819,7 +862,6 @@ protected:
     char *psz_name;
 };
 
-
 /* ItemInfo Dialog */
 class ItemInfoDialog: public wxDialog
 {
@@ -840,6 +882,8 @@ private:
     void OnCancel( wxCommandEvent& event );
     void OnNewGroup( wxCommandEvent& event );
 
+    void UpdateInfo();
+
     DECLARE_EVENT_TABLE();
 
     intf_thread_t *p_intf;
@@ -857,6 +901,9 @@ private:
     wxTextCtrl *name_text;
     wxTextCtrl *author_text;
 
+    wxTreeCtrl *info_tree;
+    wxTreeItemId info_root;
+
     wxCheckBox *enabled_checkbox;
     wxComboBox *group_combo;
     int ids_array[100];
@@ -900,6 +947,7 @@ private:
     vlc_bool_t b_enqueue;
 };
 #endif
+} // end of wxvlc namespace
 
 /* Menus */
 void PopupMenu( intf_thread_t *_p_intf, wxWindow *p_parent,
@@ -909,6 +957,8 @@ 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 );
 
+namespace wxvlc
+{
 class MenuEvtHandler : public wxEvtHandler
 {
 public:
@@ -942,7 +992,7 @@ private:
 
     wxMenu *Menu::CreateDummyMenu();
     void   Menu::CreateMenuItem( wxMenu *, char *, vlc_object_t * );
-    wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t * );
+    wxMenu *Menu::CreateChoicesMenu( char *, vlc_object_t *, bool );
 
     DECLARE_EVENT_TABLE();
 
@@ -951,6 +1001,9 @@ private:
     int  i_item_id;
 };
 
+} // end of wxvlc namespace
+using namespace wxvlc;
+
 static inline int ConvertHotkeyModifiers( int i_hotkey )
 {
     int i_accel_flags = 0;