+ p_subcategory_item = p_category_item;
+
+ [p_subcategory_item->o_children addObject:[[VLCTreeItem alloc]
+ initWithName:[[VLCMain sharedInstance]
+ localizedString: module_GetName( p_module, false ) ]
+ withTitle:[[VLCMain sharedInstance]
+ localizedString: module_GetLongName( p_module ) ]
+ withHelp: @""
+ ID: ((vlc_object_t*)p_module)->i_object_id
+ parent:p_subcategory_item
+ children:IsALeafNode
+ whithCategory: -1]];
+ }
+ vlc_list_release( p_list );
+ }
+ }
+ return o_children;
+}
+
+- (int)getObjectID
+{
+ return i_object_id;
+}
+
+- (NSString *)getName
+{
+ return o_name;
+}
+
+- (NSString *)getTitle
+{
+ return o_title;
+}
+
+- (NSString *)getHelp
+{
+ return o_help;
+}
+
+- (VLCTreeItem *)childAtIndex:(int)i_index
+{
+ return [[self children] objectAtIndex:i_index];
+}
+
+- (int)numberOfChildren {
+ id i_tmp = [self children];
+ return (i_tmp == IsALeafNode) ? (-1) : (int)[i_tmp count];
+}
+
+- (BOOL)hasPrefs:(NSString *)o_module_name
+{
+ intf_thread_t *p_intf = VLCIntf;
+ module_t *p_parser;
+ vlc_list_t *p_list;
+ char *psz_module_name;
+ int i_index;
+
+ psz_module_name = (char *)[o_module_name UTF8String];
+
+ /* look for module */
+ p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
+
+ for( i_index = 0; i_index < p_list->i_count; i_index++ )
+ {
+ p_parser = (module_t *)p_list->p_values[i_index].p_object ;
+
+ if( !strcmp( module_GetObjName( p_parser ), psz_module_name ) )
+ {
+ unsigned int confsize;
+ module_GetConfig( p_parser, &confsize );
+ BOOL b_has_prefs = confsize != 0;
+ vlc_list_release( p_list );
+ return( b_has_prefs );
+ }
+ }
+
+ vlc_list_release( p_list );
+
+ return( NO );
+}
+
+- (NSView *)showView:(NSScrollView *)o_prefs_view
+ advancedView:(bool) b_advanced
+{
+ NSRect s_vrc;
+ NSView *o_view;
+
+ [[VLCPrefs sharedInstance] setTitle: [self getTitle]];
+ /* NSLog( [self getHelp] ); */
+ s_vrc = [[o_prefs_view contentView] bounds]; s_vrc.size.height -= 4;
+ o_view = [[VLCFlippedView alloc] initWithFrame: s_vrc];
+ [o_view setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin |
+ NSViewMaxYMargin];
+
+/* Create all subviews if it isn't already done because we cannot use */
+/* setHiden for MacOS < 10.3*/
+ if( o_subviews == nil )
+ {
+ intf_thread_t *p_intf = VLCIntf;
+ vlc_list_t *p_list;
+ module_t *p_module = NULL;
+ module_t *p_main_module;
+ module_config_t *p_items;
+ unsigned int confsize;
+
+ o_subviews = [[NSMutableArray alloc] initWithCapacity:10];
+ /* Get a pointer to the module */
+ if( i_object_category == -1 )
+ {
+ p_module = (module_t *) vlc_object_get( i_object_id );
+ assert( p_module );
+
+ p_items = module_GetConfig( p_module, &confsize );
+
+ for( unsigned int i = 0; i < confsize; i++ )
+ {
+ switch( p_items[i].i_type )