Commit e4e2ff7f authored by Geoffroy Couprie's avatar Geoffroy Couprie

WinCE intf: get rid of VLC_OBJECT_MODULE

parent 559e9799
...@@ -321,10 +321,8 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf, ...@@ -321,10 +321,8 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
PrefsDialog *_p_prefs_dialog, HWND hwnd, PrefsDialog *_p_prefs_dialog, HWND hwnd,
HINSTANCE hInst ) HINSTANCE hInst )
{ {
vlc_list_t *p_list;
module_t *p_module = NULL; module_t *p_module = NULL;
module_config_t *p_item; module_config_t *p_item;
int i_index;
INITCOMMONCONTROLSEX iccex; INITCOMMONCONTROLSEX iccex;
RECT rcClient; RECT rcClient;
...@@ -362,10 +360,6 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf, ...@@ -362,10 +360,6 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM; tvi.mask = TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
/* List the plugins */
p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
if( !p_list ) return;
/* /*
* Build a tree of the main options * Build a tree of the main options
*/ */
...@@ -385,25 +379,14 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf, ...@@ -385,25 +379,14 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
general_item = hPrev; general_item = hPrev;
/* Build the categories list */ /* Build the categories list */
for( i_index = 0; i_index < p_list->i_count; i_index++ ) p_module = module_get_main();
{
p_module = (module_t *)p_list->p_values[i_index].p_object;
if( strcmp( module_get_object( p_module ), "main" ) == 0 )
break;
}
/* TODO replace by
* p_module = module_get_main( p_intf );
*/
if( i_index < p_list->i_count )
{
unsigned int confsize; unsigned int confsize;
const char *psz_help; const char *psz_help;
module_config_t * p_config; module_config_t * p_config;
/* We found the main module */
/* Enumerate config categories and store a reference so we can /* Enumerate config categories and store a reference so we can
* generate their config panel them when it is asked by the user. */ * generate their config panel when it is asked by the user. */
p_config = module_config_get (p_module, &confsize); p_config = module_config_get (p_module, &confsize);
for( size_t i = 0; i < confsize; i++ ) for( size_t i = 0; i < confsize; i++ )
...@@ -504,20 +487,20 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf, ...@@ -504,20 +487,20 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
} }
TreeView_SortChildren( hwndTV, general_item, 0 ); TreeView_SortChildren( hwndTV, general_item, 0 );
module_config_free( p_config ); module_config_free( p_config );
}
/* List the plugins */
module_t **p_list = module_list_get( NULL );
module_config_t *p_config;
/* /*
* Build a tree of all the plugins * Build a tree of all the plugins
*/ */
for( i_index = 0; i_index < p_list->i_count; i_index++ ) for( size_t i_index = 0; p_list[i_index]; i_index++ )
{ {
/* Take every module */ /* Take every module */
p_module = (module_t *)p_list->p_values[i_index].p_object; p_module = p_list[i_index];
/* Exclude the main module */ /* Exclude the main module */
if( !strcmp( module_get_object( p_module ), "main" ) ) if( module_is_main( p_module ) )
continue; continue;
/* Exclude empty plugins (submodules don't have config options, they /* Exclude empty plugins (submodules don't have config options, they
...@@ -547,7 +530,6 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf, ...@@ -547,7 +530,6 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
} }
module_config_free (p_config); module_config_free (p_config);
//if( !i_options ) continue;
/* Dummy item, please proceed */ /* Dummy item, please proceed */
if( !b_options || i_category == 0 || i_subcategory == 0 ) continue; if( !b_options || i_category == 0 || i_subcategory == 0 ) continue;
...@@ -588,7 +570,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf, ...@@ -588,7 +570,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
config_data->i_object_id = p_item->value.i; config_data->i_object_id = p_item->value.i;
config_data->p_module = p_module; config_data->p_module = p_module;
tvi.pszText = _FROMMB(module_name( p_module, false )); tvi.pszText = _FROMMB(module_get_name( p_module, false ));
tvi.cchTextMax = _tcslen(tvi.pszText); tvi.cchTextMax = _tcslen(tvi.pszText);
tvi.lParam = (long)config_data; tvi.lParam = (long)config_data;
...@@ -621,7 +603,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf, ...@@ -621,7 +603,7 @@ PrefsTreeCtrl::PrefsTreeCtrl( intf_thread_t *_p_intf,
} }
/* Clean-up everything */ /* Clean-up everything */
vlc_list_release( p_list ); module_list_free( p_list );
TreeView_Expand( hwndTV, general_item, TVE_EXPANDPARTIAL |TVE_EXPAND ); TreeView_Expand( hwndTV, general_item, TVE_EXPANDPARTIAL |TVE_EXPAND );
} }
...@@ -764,7 +746,7 @@ PrefsPanel::PrefsPanel( HWND parent, HINSTANCE hInst, intf_thread_t *_p_intf, ...@@ -764,7 +746,7 @@ PrefsPanel::PrefsPanel( HWND parent, HINSTANCE hInst, intf_thread_t *_p_intf,
/* Initializations */ /* Initializations */
p_intf = _p_intf; p_intf = _p_intf;
p_prefs_dialog = _p_prefs_dialog; p_prefs_dialog = _p_prefs_dialog;
vlc_list_t *p_list = NULL; module_t **p_list;
b_advanced = true; b_advanced = true;
...@@ -786,14 +768,13 @@ PrefsPanel::PrefsPanel( HWND parent, HINSTANCE hInst, intf_thread_t *_p_intf, ...@@ -786,14 +768,13 @@ PrefsPanel::PrefsPanel( HWND parent, HINSTANCE hInst, intf_thread_t *_p_intf,
else else
{ {
/* List the plugins */ /* List the plugins */
int i_index; size_t i_index;
bool b_found = false; bool b_found = false;
p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); p_list = module_list_get( NULL );
if( !p_list ) return;
for( i_index = 0; i_index < p_list->i_count; i_index++ ) for( i_index = 0; p_list[i_index]; i_index++ )
{ {
p_module = (module_t *)p_list->p_values[i_index].p_object; p_module = p_list[i_index];
if( !strcmp( module_get_object(p_module), "main" ) ) if( !strcmp( module_get_object(p_module), "main" ) )
{ {
b_found = true; b_found = true;
......
...@@ -287,7 +287,7 @@ ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this, ...@@ -287,7 +287,7 @@ ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this,
int * py_pos ) int * py_pos )
: ConfigControl( p_this, p_item, parent, hInst ) : ConfigControl( p_this, p_item, parent, hInst )
{ {
vlc_list_t *p_list; module_t **p_list;
module_t *p_parser; module_t *p_parser;
label = CreateWindow( _T("STATIC"), _FROMMB(p_item->psz_text), label = CreateWindow( _T("STATIC"), _FROMMB(p_item->psz_text),
...@@ -306,14 +306,15 @@ ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this, ...@@ -306,14 +306,15 @@ ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this,
*py_pos += 15 + 10; *py_pos += 15 + 10;
/* build a list of available modules */ /* 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_AddString( combo, _T("Default") );
ComboBox_SetItemData( combo, 0, (void *)NULL ); ComboBox_SetItemData( combo, 0, (void *)NULL );
ComboBox_SetCurSel( combo, 0 ); ComboBox_SetCurSel( combo, 0 );
//ComboBox_SetText( combo, _T("Default") ); //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( module_provides( p_parser, p_item->psz_type ) ) if( module_provides( p_parser, p_item->psz_type ) )
{ {
...@@ -324,11 +325,11 @@ ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this, ...@@ -324,11 +325,11 @@ ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this,
module_get_object( p_parser )) ) module_get_object( p_parser )) )
{ {
ComboBox_SetCurSel( combo, i_index ); 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() ModuleConfigControl::~ModuleConfigControl()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment