X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fwince%2Fpreferences_widgets.cpp;h=7fc13d4354f0f44bb35c5cb6d15b44c585eef85e;hb=7f12470415d98e9e0ac725f2bb96b5fa74ef27f1;hp=f0554818c9dbeaff4ff070a40f2545b64a0aa6a0;hpb=81c5ac29fa2e80426c1b1dfcc941a1aabe8bc808;p=vlc diff --git a/modules/gui/wince/preferences_widgets.cpp b/modules/gui/wince/preferences_widgets.cpp index f0554818c9..7fc13d4354 100644 --- a/modules/gui/wince/preferences_widgets.cpp +++ b/modules/gui/wince/preferences_widgets.cpp @@ -25,9 +25,11 @@ /***************************************************************************** * Preamble *****************************************************************************/ -#include /* strerror() */ -#include -#include +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include #include #include "wince.h" @@ -49,10 +51,6 @@ ConfigControl *CreateConfigControl( vlc_object_t *p_this, { ConfigControl *p_control = NULL; - if( p_item->psz_current ) - { - return NULL; - } switch( p_item->i_type ) { case CONFIG_ITEM_MODULE: @@ -142,7 +140,7 @@ int ConfigControl::GetType() return i_type; } -vlc_bool_t ConfigControl::IsAdvanced() +bool ConfigControl::IsAdvanced() { return b_advanced; } @@ -173,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; } @@ -195,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"), @@ -206,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"), @@ -218,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"), @@ -235,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()) ); @@ -289,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), @@ -308,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() @@ -362,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 ); @@ -475,7 +471,7 @@ void StringListConfigControl::OnAction( wxCommandEvent& event ) { combo->Clear(); UpdateCombo( p_item ); - p_item->b_dirty = VLC_FALSE; + p_item->b_dirty = false; } } @@ -673,7 +669,7 @@ void IntegerListConfigControl::OnAction( wxCommandEvent& event ) { combo->Clear(); UpdateCombo( p_item ); - p_item->b_dirty = VLC_FALSE; + p_item->b_dirty = false; } } @@ -691,7 +687,7 @@ int IntegerListConfigControl::GetIntValue() * RangedIntConfigControl implementation *****************************************************************************/ RangedIntConfigControl::RangedIntConfigControl( vlc_object_t *p_this, - module_config_t *p_item, + module_config_t *p_item, HWND parent, HINSTANCE hInst, int * py_pos ) : ConfigControl( p_this, p_item, parent, hInst ) @@ -735,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 ); @@ -752,7 +748,7 @@ float FloatConfigControl::GetFloatValue() { float f_value; - int i_size = Edit_GetTextLength( textctrl ); + int i_size = Edit_GetTextLength( textctrl ); TCHAR *psz_string = (TCHAR *)malloc( (i_size + 1) * sizeof(TCHAR) ); Edit_GetText( textctrl, psz_string, i_size + 1 ); @@ -778,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,