#error You are not libvlc or one of its plugins. You cannot include this file
#endif
-#if 1
-/* FIXME: scheduled for privatization */
-#define MODULE_SHORTCUT_MAX 50
-
-/* The module handle type. */
-#if defined(HAVE_DL_DYLD)
-# if defined (HAVE_MACH_O_DYLD_H)
-# include <mach-o/dyld.h>
-# endif
-typedef NSModule module_handle_t;
-#elif defined(HAVE_IMAGE_H)
-typedef int module_handle_t;
-#elif defined(WIN32) || defined(UNDER_CE)
-typedef void * module_handle_t;
-#elif defined(HAVE_DL_DLOPEN)
-typedef void * module_handle_t;
-#elif defined(HAVE_DL_SHL_LOAD)
-typedef shl_t module_handle_t;
-#endif
-
-/**
- * Module descriptor
- */
-struct module_t
-{
- VLC_COMMON_MEMBERS
-
- /*
- * Variables set by the module to identify itself
- */
- const char *psz_shortname; /**< Module name */
- const char *psz_longname; /**< Module descriptive name */
- const char *psz_help; /**< Long help string for "special" modules */
-
- /** Shortcuts to the module */
- const char *pp_shortcuts[ MODULE_SHORTCUT_MAX ];
-
- char *psz_capability; /**< Capability */
- int i_score; /**< Score for the capability */
- uint32_t i_cpu; /**< Required CPU capabilities */
-
- vlc_bool_t b_unloadable; /**< Can we be dlclosed? */
- vlc_bool_t b_reentrant; /**< Are we reentrant? */
- vlc_bool_t b_submodule; /**< Is this a submodule? */
-
- /* Callbacks */
- int ( * pf_activate ) ( vlc_object_t * );
- void ( * pf_deactivate ) ( vlc_object_t * );
-
- /*
- * Variables set by the module to store its config options
- */
- module_config_t *p_config; /* Module configuration structure */
- size_t confsize; /* Number of module_config_t items */
- unsigned int i_config_items; /* number of configuration items */
- unsigned int i_bool_items; /* number of bool config items */
-
- /*
- * Variables used internally by the module manager
- */
- /* Plugin-specific stuff */
- module_handle_t handle; /* Unique handle */
- char * psz_filename; /* Module filename */
-
- vlc_bool_t b_builtin; /* Set to true if the module is built in */
- vlc_bool_t b_loaded; /* Set to true if the dll is loaded */
-};
-#endif
-
/*****************************************************************************
* Exported functions.
*****************************************************************************/
VLC_EXPORT( module_t *, __module_FindName, ( vlc_object_t *, const char * ) );
VLC_EXPORT( void, module_Put, ( module_t *module ) );
+VLC_EXPORT( module_config_t *, module_GetConfig, ( const module_t *, unsigned * ) );
+VLC_EXPORT( void, module_PutConfig, ( module_config_t * ) );
+
/* Return a NULL terminated array with the names of the modules that have a
* certain capability.
PrefsItemData *data = NULL;
QTreeWidgetItem *current_item = NULL;
- for (size_t i = 0; i < p_module->confsize; i++)
+ unsigned confsize;
+ module_config_t *p_config;
+
+ p_config = module_GetConfig (p_module, &confsize);
+
+ for (size_t i = 0; i < confsize; i++)
{
- const module_config_t *p_item = p_module->p_config + i;
+ module_config_t *p_item = p_config + i;
+
const char *psz_help;
QIcon icon;
switch( p_item->i_type )
break;
}
}
+ module_PutConfig (p_config);
/* Build the tree of plugins */
for( int i_index = 0; i_index < p_list->i_count; i_index++ )
// Main module excluded
if( !strcmp( module_GetObjName( p_module ), "main" ) ) continue;
- /* Exclude submodules; they have no config options of their own */
- if( p_module->b_submodule ) continue;
-
- unsigned i_subcategory = 0, i_category = 0;
+ unsigned i_subcategory = 0, i_category = 0, confsize;
bool b_options = false;
+ module_config_t *p_config = module_GetConfig (p_module, &confsize);
- for (size_t i = 0; i < p_module->confsize; i++)
+ for (size_t i = 0; i < confsize; i++)
{
- const module_config_t *p_item = p_module->p_config + i;
+ const module_config_t *p_item = p_config + i;
if( p_item->i_type == CONFIG_CATEGORY )
i_category = p_item->value.i;
if( b_options && i_category && i_subcategory )
break;
}
+ module_PutConfig (p_config);
if( !b_options || i_category == 0 || i_subcategory == 0 ) continue;
// Locate the category item;
if( !b_found ) continue;
PrefsItemData *module_data = new PrefsItemData();
- module_data->b_submodule = p_module->b_submodule;
module_data->i_type = TYPE_MODULE;
module_data->psz_name = strdup( module_GetObjName( p_module ) );
- module_data->i_object_id = p_module->b_submodule ?
- ((module_t *)p_module->p_parent)->i_object_id :
- p_module->i_object_id;
module_data->help.clear();
// TODO image
QTreeWidgetItem *module_item = new QTreeWidgetItem();
if( data->i_type == TYPE_CATEGORY )
return;
else if( data->i_type == TYPE_MODULE )
- p_module = (module_t *) vlc_object_get( p_intf, data->i_object_id );
+ p_module = module_FindName( VLC_OBJECT(p_intf), data->psz_name );
else
{
- p_module = config_FindModule( VLC_OBJECT(p_intf), "main" );
+ p_module = module_FindName( VLC_OBJECT(p_intf), "main" );
assert( p_module );
- vlc_object_yield( p_module );
}
- module_t *p_realmodule = p_module->b_submodule
- ? (module_t *)(p_module->p_parent)
- : p_module;
-
- module_config_t *p_item = p_realmodule->p_config;
- module_config_t *p_end = p_item + p_realmodule->confsize;
+ unsigned confsize;
+ module_config_t *p_config = module_GetConfig (p_module, &confsize),
+ *p_item = p_config,
+ *p_end = p_config + confsize;
if( data->i_type == TYPE_SUBCATEGORY || data->i_type == TYPE_CATSUBCAT )
{
p_item++;
}
}
+ module_PutConfig (p_config);
/* Widgets now */
global_layout = new QVBoxLayout();
}
else
{
+ const char *psz_help = module_GetHelp (p_module);
head = QString( qtr( module_GetLongName( p_module ) ) );
- if( p_module->psz_help )
+ if( psz_help )
{
help.append( "\n" );
- help.append( qtr( module_GetHelp( p_module ) ) );
+ help.append( qtr( psz_help ) );
}
}
layout->addWidget( box, i_line, 0, 1, 2 );
}
- vlc_object_release( p_module );
+ module_Put( p_module );
scrolled_area->setSizePolicy( QSizePolicy::Preferred,QSizePolicy::Fixed );
scrolled_area->setLayout( layout );
int i_object_id;
int i_subcat_id;
int i_type;
- bool b_submodule;
char *psz_name;
QString name;
QString help;
{
if( !strcmp( module_GetObjName( p_parser ), "main" ) ) continue;
- for (size_t i = 0; i < p_parser->confsize; i++)
+ unsigned confsize;
+ module_config_t *p_config;
+
+ p_config = module_GetConfig (p_parser, &confsize);
+ for (size_t i = 0; i < confsize; i++)
{
- module_config_t *p_config = p_parser->p_config + i;
/* Hack: required subcategory is stored in i_min */
- if( p_config->i_type == CONFIG_SUBCATEGORY &&
- p_config->value.i == p_item->min.i )
+ const module_config_t *p_cfg = p_config + i;
+ if( p_cfg->i_type == CONFIG_SUBCATEGORY &&
+ p_cfg->value.i == p_item->min.i )
combo->addItem( qtr( module_GetLongName( p_parser )),
QVariant( module_GetObjName( p_parser ) ) );
if( p_item->value.psz && !strcmp( p_item->value.psz,
module_GetObjName( p_parser ) ) )
combo->setCurrentIndex( combo->count() - 1 );
}
+ module_PutConfig (p_config);
}
else if( module_IsCapable( p_parser, p_item->psz_type ) )
{
cb->setToolTip( formatTooltip( qtr( module_GetLongName( p_parser ))));\
cbl->checkBox = cb; \
\
- int i = -1; \
- while( p_parser->pp_shortcuts[++i] != NULL); \
- i--; \
-\
- cbl->psz_module = strdup( i>=0?p_parser->pp_shortcuts[i] \
- : module_GetObjName( p_parser ) ); \
+ cbl->psz_module = strdup( module_GetObjName( p_parser ) ); \
modules.push_back( cbl ); \
}
{
if( !strcmp( module_GetObjName( p_parser ), "main" ) ) continue;
- for (size_t i = 0; i < p_parser->confsize; i++)
+ unsigned confsize;
+ module_config_t *p_config = module_GetConfig (p_parser, &confsize);
+
+ for (size_t i = 0; i < confsize; i++)
{
- module_config_t *p_config = p_parser->p_config + i;
+ module_config_t *p_cfg = p_config + i;
/* Hack: required subcategory is stored in i_min */
- if( p_config->i_type == CONFIG_SUBCATEGORY &&
- p_config->value.i == p_item->min.i )
+ if( p_cfg->i_type == CONFIG_SUBCATEGORY &&
+ p_cfg->value.i == p_item->min.i )
{
CHECKBOX_LISTS;
}
}
+ module_PutConfig (p_config);
}
else if( module_IsCapable( p_parser, p_item->psz_type ) )
{
module_t *p_main = config_FindModule( p_this, "main" );
assert( p_main );
- for (size_t i = 0; i < p_main->confsize; i++)
+ unsigned confsize;
+ module_config_t *p_config;
+
+ p_config = module_GetConfig (p_main, &confsize);
+
+ for (size_t i = 0; i < confsize; i++)
{
- module_config_t *p_item = p_main->p_config + i;
+ module_config_t *p_item = p_config + i;
if( p_item->i_type & CONFIG_ITEM && p_item->psz_name &&
strstr( p_item->psz_name , "key-" ) && !EMPTY_STR( p_item->psz_text ) )
table->addTopLevelItem( treeItem );
}
}
+ module_PutConfig (p_config);
+
table->resizeColumnToContents( 0 );
CONNECT( table, itemClicked( QTreeWidgetItem *, int ),
};
-#if 0
#define MODULE_SHORTCUT_MAX 50
/* The module handle type. */
vlc_bool_t b_builtin; /* Set to true if the module is built in */
vlc_bool_t b_loaded; /* Set to true if the dll is loaded */
};
-#endif
#define module_InitBank(a) __module_InitBank(VLC_OBJECT(a))