]> git.sesse.net Git - vlc/blobdiff - modules/gui/wince/preferences_widgets.cpp
Merge branch 1.0-bugfix
[vlc] / modules / gui / wince / preferences_widgets.cpp
index 0071c0f9413fa74a56c2db6f0e3ca511a244f486..7fc13d4354f0f44bb35c5cb6d15b44c585eef85e 100644 (file)
@@ -29,7 +29,7 @@
 # include "config.h"
 #endif
 
-#include <vlc/vlc.h>
+#include <vlc_common.h>
 #include <vlc_interface.h>
 
 #include "wince.h"
@@ -140,7 +140,7 @@ int ConfigControl::GetType()
     return i_type;
 }
 
-vlc_bool_t ConfigControl::IsAdvanced()
+bool ConfigControl::IsAdvanced()
 {
     return b_advanced;
 }
@@ -171,14 +171,11 @@ KeyConfigControl::KeyConfigControl( vlc_object_t *p_this,
                                     int * py_pos )
   : ConfigControl( p_this, p_item, parent, hInst )
 {
-    // Number of keys descriptions
-    unsigned int i_keys = sizeof(vlc_keys)/sizeof(key_descriptor_t);
-
     // Init the keys decriptions array
     if( m_keysList == NULL )
     {
-        m_keysList = new string[i_keys];
-        for( unsigned int i = 0; i < i_keys; i++ )
+        m_keysList = new string[vlc_num_keys];
+        for( size_t i = 0; i < vlc_num_keys; ++i )
         {
             m_keysList[i] = vlc_keys[i].psz_key_string;
         }
@@ -193,7 +190,7 @@ KeyConfigControl::KeyConfigControl( vlc_object_t *p_this,
     alt = CreateWindow( _T("BUTTON"), _T("Alt"),
                         WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
                         20, *py_pos, 15, 15, parent, NULL, hInst, NULL );
-    Button_SetCheck( alt, p_item->i_value & KEY_MODIFIER_ALT ? BST_CHECKED :
+    Button_SetCheck( alt, p_item->i_type & KEY_MODIFIER_ALT ? BST_CHECKED :
                      BST_UNCHECKED );
 
     alt_label = CreateWindow( _T("STATIC"), _T("Alt"),
@@ -204,7 +201,7 @@ KeyConfigControl::KeyConfigControl( vlc_object_t *p_this,
                 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
                 20 + 15 + 5 + 30 + 5, *py_pos, 15, 15,
                 parent, NULL, hInst, NULL );
-    Button_SetCheck( ctrl, p_item->i_value & KEY_MODIFIER_CTRL ? BST_CHECKED :
+    Button_SetCheck( ctrl, p_item->i_type & KEY_MODIFIER_CTRL ? BST_CHECKED :
                      BST_UNCHECKED );
 
     ctrl_label = CreateWindow( _T("STATIC"), _T("Ctrl"),
@@ -216,7 +213,7 @@ KeyConfigControl::KeyConfigControl( vlc_object_t *p_this,
                 WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
                 20 + 15 + 5 + 2*(30 + 5) + 15 + 5, *py_pos, 15, 15,
                 parent, NULL, hInst, NULL );
-    Button_SetCheck( shift, p_item->i_value & KEY_MODIFIER_SHIFT ?
+    Button_SetCheck( shift, p_item->i_type & KEY_MODIFIER_SHIFT ?
                      BST_CHECKED : BST_UNCHECKED );
 
     shift_label = CreateWindow( _T("STATIC"), _T("Shift"),
@@ -233,12 +230,12 @@ KeyConfigControl::KeyConfigControl( vlc_object_t *p_this,
 
     *py_pos += 15 + 10;
 
-    for( unsigned int i = 0; i < i_keys ; i++ )
+    for( size_t i = 0; i < vlc_num_keys ; ++i )
     {
         ComboBox_AddString( combo, _FROMMB(m_keysList[i].c_str()) );
         ComboBox_SetItemData( combo, i, (void*)vlc_keys[i].i_key_code );
         if( (unsigned int)vlc_keys[i].i_key_code ==
-            ( ((unsigned int)p_item->i_value) & ~KEY_MODIFIER ) )
+            ( ((unsigned int)p_item->i_type) & ~KEY_MODIFIER ) )
         {
             ComboBox_SetCurSel( combo, i );
             ComboBox_SetText( combo, _FROMMB(m_keysList[i].c_str()) );
@@ -287,7 +284,7 @@ ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this,
                                           int * py_pos )
   : ConfigControl( p_this, p_item, parent, hInst )
 {
-    vlc_list_t *p_list;
+    module_t **p_list;
     module_t *p_parser;
 
     label = CreateWindow( _T("STATIC"), _FROMMB(p_item->psz_text),
@@ -306,29 +303,30 @@ ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this,
     *py_pos += 15 + 10;
 
     /* build a list of available modules */
-    p_list = vlc_list_find( p_this, VLC_OBJECT_MODULE, FIND_ANYWHERE );
+    p_list = module_list_get( NULL );
     ComboBox_AddString( combo, _T("Default") );
     ComboBox_SetItemData( combo, 0, (void *)NULL );
     ComboBox_SetCurSel( combo, 0 );
     //ComboBox_SetText( combo, _T("Default") );
-    for( int i_index = 0; i_index < p_list->i_count; i_index++ )
+
+    for( size_t i_index = 0; p_list[i_index]; i_index++ )
     {
-        p_parser = (module_t *)p_list->p_values[i_index].p_object ;
+        p_parser = p_list[i_index];
 
-        if( !strcmp( p_parser->psz_capability, p_item->psz_type ) )
+        if( module_provides( p_parser, p_item->psz_type ) )
         {
-            ComboBox_AddString( combo, _FROMMB(p_parser->psz_longname) );
+            ComboBox_AddString( combo, _FROMMB(module_GetLongName( p_parser ) ));
             ComboBox_SetItemData( combo, i_index,
-                                  (void*)p_parser->psz_object_name );
-            if( p_item->psz_value && !strcmp(p_item->psz_value,
-                                             p_parser->psz_object_name) )
+                                  (void *) module_get_object( p_parser ) );
+            if( p_item->value.psz && !strcmp( p_item->value.psz,
+                                             module_get_object( p_parser )) )
             {
                 ComboBox_SetCurSel( combo, i_index );
-                //ComboBox_SetText( combo, _FROMMB(p_parser->psz_longname) );
+                //ComboBox_SetText( combo, _FROMMB( module_GetLongName(p_parser)) );
             }
         }
     }
-    vlc_list_release( p_list );
+    module_list_free( p_list );
 }
 
 ModuleConfigControl::~ModuleConfigControl()
@@ -360,8 +358,8 @@ StringConfigControl::StringConfigControl( vlc_object_t *p_this,
 
     *py_pos += 15 + 10;
 
-    textctrl = CreateWindow( _T("EDIT"), p_item->psz_value ?
-                             _FROMMB(p_item->psz_value) : _T(""),
+    textctrl = CreateWindow( _T("EDIT"), p_item->psz_type ?
+                             _FROMMB(p_item->psz_type) : _T(""),
                              WS_CHILD | WS_VISIBLE | WS_BORDER | SS_LEFT |
                              ES_AUTOHSCROLL, 20, *py_pos - 3, 180, 15 + 3,
                              parent, NULL, hInst, NULL );
@@ -473,7 +471,7 @@ void StringListConfigControl::OnAction( wxCommandEvent& event )
     {
         combo->Clear();
         UpdateCombo( p_item );
-        p_item->b_dirty = VLC_FALSE;
+        p_item->b_dirty = false;
     }
 }
 
@@ -671,7 +669,7 @@ void IntegerListConfigControl::OnAction( wxCommandEvent& event )
     {
         combo->Clear();
         UpdateCombo( p_item );
-        p_item->b_dirty = VLC_FALSE;
+        p_item->b_dirty = false;
     }
 }
 
@@ -733,7 +731,7 @@ FloatConfigControl::FloatConfigControl( vlc_object_t *p_this,
     *py_pos += 15 + 10;
 
     TCHAR psz_string[100];
-    _stprintf( psz_string, _T("%f"), p_item->f_value );
+    _stprintf( psz_string, _T("%d"), p_item->i_type );
     textctrl = CreateWindow( _T("EDIT"), psz_string,
         WS_CHILD | WS_VISIBLE | WS_BORDER | SS_RIGHT | ES_AUTOHSCROLL,
         20, *py_pos - 3, 70, 15 + 3, parent, NULL, hInst, NULL );
@@ -776,7 +774,7 @@ BoolConfigControl::BoolConfigControl( vlc_object_t *p_this,
                              WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
                              5, *py_pos, 15, 15,
                              parent, NULL, hInst, NULL );
-    Button_SetCheck( checkbox, p_item->i_value ? BST_CHECKED : BST_UNCHECKED );
+    Button_SetCheck( checkbox, config_GetInt(p_this, p_item->psz_name) ? BST_CHECKED : BST_UNCHECKED );
 
     checkbox_label = CreateWindow( _T("STATIC"), _FROMMB(p_item->psz_text),
                                    WS_CHILD | WS_VISIBLE | SS_LEFT,