]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/prefs_widgets.m
macosx: Fix controller playlist toggling to use the contentRect and not the window...
[vlc] / modules / gui / macosx / prefs_widgets.m
index 1092cf092e872a9c75710668d220abbd5daadce4..01ee64ecce4e006a3f62faf7824cbbfbe248d087 100644 (file)
@@ -11,7 +11,7 @@
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
-#include <vlc/vlc.h>
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
 #include "vlc_keys.h"
 
 #include "intf.h"
@@ -38,7 +42,7 @@
 #define OFFSET_RIGHT 20
 #define OFFSET_BETWEEN 2
 
-#define UPWARDS_WHITE_ARROW                 "\xE2\x87\xA7" 
+#define UPWARDS_WHITE_ARROW                 "\xE2\x87\xA7"
 #define OPTION_KEY                          "\xE2\x8C\xA5"
 #define UP_ARROWHEAD                        "\xE2\x8C\x83"
 #define PLACE_OF_INTEREST_SIGN              "\xE2\x8C\x98"
     [o_menu addItem: o_mi];                                                 \
 }
 
-#define ADD_LABEL( o_label, superFrame, x_offset, my_y_offset, label )      \
+#define ADD_LABEL( o_label, superFrame, x_offset, my_y_offset, label,       \
+    tooltip )                                                               \
 {                                                                           \
     NSRect s_rc = superFrame;                                               \
     s_rc.size.height = 17;                                                  \
     [o_label setEditable: NO];                                              \
     [o_label setSelectable: NO];                                            \
     [o_label setStringValue: label];                                        \
+    [o_label setToolTip: tooltip];                                          \
     [o_label setFont:[NSFont systemFontOfSize:0]];                          \
     [o_label sizeToFit];                                                    \
 }
     if( self != nil )
     {
         p_item = _p_item;
-        psz_name = strdup( p_item->psz_name );
+        psz_name = p_item->psz_name;
         o_label = NULL;
         i_type = p_item->i_type;
         i_view_type = 0;
     [self setFrame:frame];
 }
 
-#if GC_ENABLED
-- (void)finalize
-{
-    /* since dealloc isn't called on 10.5 if GC is enabled and since GC is
-     * Obj-C only, we need to do this: */
-    if( psz_name ) free( psz_name );
-    [super finalize];
-}
-#endif
-
 - (void)dealloc
 {
     if( o_label ) [o_label release];
-    if( psz_name ) free( psz_name );
+    free( psz_name );
     [super dealloc];
 }
 
                       withView: (NSView *)o_parent_view
 {
     VLCConfigControl *p_control = NULL;
-    /* Skip depracated options */
-    if( _p_item->psz_current )
-    {
-        return NULL;
-    }
 
     switch( _p_item->i_type )
     {
     if( [super initWithFrame: mainFrame item: _p_item] != nil )
     {
         i_view_type = CONFIG_ITEM_STRING;
+        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString:
+                              [[VLCMain sharedInstance] localizedString: (char *)p_item->psz_longtext]
+                                                          toWidth: PREFS_WRAP];
+
         /* add the label */
         if( p_item->psz_text )
             o_labelString = [[VLCMain sharedInstance]
                                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_textfieldTooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the textfield */
-        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance] localizedString: (char *)p_item->psz_longtext]
-                                         toWidth: PREFS_WRAP];
         if( p_item->value.psz )
             o_textfieldString = [[VLCMain sharedInstance]
                                     localizedString: (char *)p_item->value.psz];
     {
         int i_index;
         i_view_type = CONFIG_ITEM_STRING_LIST;
+
+        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString:
+                              [[VLCMain sharedInstance]
+                               localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
+
         /* add the label */
         if( p_item->psz_text )
             o_labelString = [[VLCMain sharedInstance]
                                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_textfieldTooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the textfield */
-        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
         ADD_COMBO( o_combo, mainFrame, [o_label frame].size.width,
             -2, 0, o_textfieldTooltip )
         [o_combo setAutoresizingMask:NSViewWidthSizable ];
            withView: (NSView *)o_parent_view
 {
     NSRect mainFrame = [o_parent_view frame];
-    NSString *o_labelString, *o_buttonTooltip, *o_textfieldString;
-    NSString *o_textfieldTooltip;
+    NSString *o_labelString, *o_itemTooltip, *o_textfieldString;
     mainFrame.size.height = 46;
     mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN;
     mainFrame.origin.x = LEFTMARGIN;
     {
         i_view_type = CONFIG_ITEM_FILE;
 
+        o_itemTooltip = [[VLCMain sharedInstance]
+                           wrapString: [[VLCMain sharedInstance]
+                                        localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
+
         /* is it a directory */
         b_directory = ( [self getType] == CONFIG_ITEM_DIRECTORY ) ? YES : NO;
 
                                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, 3, o_labelString )
+        ADD_LABEL( o_label, mainFrame, 0, 3, o_labelString, o_itemTooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the button */
-        o_buttonTooltip = [[VLCMain sharedInstance]
-                wrapString: [[VLCMain sharedInstance]
-                localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        ADD_RIGHT_BUTTON( o_button, mainFrame, 0, 0, o_buttonTooltip,
+        ADD_RIGHT_BUTTON( o_button, mainFrame, 0, 0, o_itemTooltip,
                             _NS("Browse...") )
         [o_button setAutoresizingMask:NSViewMinXMargin ];
         [self addSubview: o_button];
 
         /* build the textfield */
-        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
         if( p_item->value.psz )
-            o_textfieldString = [[VLCMain sharedInstance]
-                                    localizedString: (char *)p_item->value.psz];
+            o_textfieldString = [NSString stringWithFormat: @"%s", (char *)p_item->value.psz];
         else
             o_textfieldString = [NSString stringWithString: @""];
         ADD_TEXTFIELD( o_textfield, mainFrame, 12, 2, mainFrame.size.width -
                         8 - [o_button frame].size.width,
-                        o_textfieldTooltip, o_textfieldString )
+                        o_itemTooltip, o_textfieldString )
         [o_textfield setAutoresizingMask:NSViewWidthSizable ];
         [self addSubview: o_textfield];
     }
         types:nil
         modalForWindow:[sender window]
         modalDelegate: self
-        didEndSelector: @selector(pathChosenInPanel: 
+        didEndSelector: @selector(pathChosenInPanel:
                         withReturn:
                         contextInfo:)
         contextInfo: nil];
         int i_index;
         vlc_list_t *p_list;
         module_t *p_parser;
-        module_config_t *p_end;
         i_view_type = CONFIG_ITEM_MODULE;
 
+        o_popupTooltip = [[VLCMain sharedInstance] wrapString:
+                          [[VLCMain sharedInstance]
+                           localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
+
         /* add the label */
         if( p_item->psz_text )
             o_labelString = [[VLCMain sharedInstance]
                                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -1, o_labelString )
+        ADD_LABEL( o_label, mainFrame, 0, -1, o_labelString, o_popupTooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the popup */
-        o_popupTooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
         ADD_POPUP( o_popup, mainFrame, [o_label frame].size.width,
             -2, 0, o_popupTooltip )
         [o_popup setAutoresizingMask:NSViewWidthSizable ];
         for( i_index = 0; i_index < p_list->i_count; i_index++ )
         {
             p_parser = (module_t *)p_list->p_values[i_index].p_object;
-            p_end = p_item + p_parser->confsize;
+
             if( p_item->i_type == CONFIG_ITEM_MODULE )
             {
-                if( !strcmp( p_parser->psz_capability,
-                            p_item->psz_type ) )
+                if( module_IsCapable( p_parser, p_item->psz_type ) )
                 {
                     NSString *o_description = [[VLCMain sharedInstance]
-                        localizedString: (char *)p_parser->psz_longname];
+                        localizedString: module_GetLongName( p_parser )];
                     [o_popup addItemWithTitle: o_description];
 
                     if( p_item->value.psz &&
-                !strcmp( p_item->value.psz, p_parser->psz_object_name ) )
+                !strcmp( p_item->value.psz, module_GetObjName( p_parser ) ) )
                         [o_popup selectItem:[o_popup lastItem]];
                 }
             }
             else
             {
-                module_config_t *p_config;
-                if( !strcmp( p_parser->psz_object_name, "main" ) )
-                      continue;
-
-                p_config = p_parser->p_config;
-                if( p_config ) do
+                int i;
+
+                if( !strcmp( module_GetObjName( p_parser ), "main" ) )
+                    continue;
+                unsigned int confsize;
+                unsigned int unused;
+                module_GetConfig( p_parser, &confsize );
+                for ( i = 0; i < confsize; i++ )
                 {
+                    module_config_t *p_config = module_GetConfig( p_parser, &unused ) + i;
                     /* Hack: required subcategory is stored in i_min */
                     if( p_config->i_type == CONFIG_SUBCATEGORY &&
                         p_config->value.i == p_item->min.i )
                     {
                         NSString *o_description = [[VLCMain sharedInstance]
-                            localizedString: (char *)p_parser->psz_longname];
+                            localizedString: module_GetLongName( p_parser )];
                         [o_popup addItemWithTitle: o_description];
 
                         if( p_item->value.psz && !strcmp(p_item->value.psz,
-                                                p_parser->psz_object_name) )
+                                                module_GetObjName( p_parser )) )
                             [o_popup selectItem:[o_popup lastItem]];
                     }
-                } while( p_item < p_end && p_config++ );
+                }
             }
         }
         vlc_list_release( p_list );
 {
     NSString *newval = [o_popup titleOfSelectedItem];
     char *returnval = NULL;
-    int i_index;
+    int i_module_index;
     vlc_list_t *p_list;
     module_t *p_parser;
-    module_config_t *p_end;
 
     p_list = vlc_list_find( VLCIntf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
-    for( i_index = 0; i_index < p_list->i_count; i_index++ )
+    for( i_module_index = 0; i_module_index < p_list->i_count; i_module_index++ )
     {
-        p_parser = (module_t *)p_list->p_values[i_index].p_object;
-         p_end = p_item + p_parser->confsize;
+        p_parser = (module_t *)p_list->p_values[i_module_index].p_object;
+
         if( p_item->i_type == CONFIG_ITEM_MODULE )
         {
-            if( !strcmp( p_parser->psz_capability,
-                    p_item->psz_type ) )
+            if( module_IsCapable( p_parser, p_item->psz_type ) )
             {
                 NSString *o_description = [[VLCMain sharedInstance]
-                    localizedString: (char *)p_parser->psz_longname];
+                    localizedString: module_GetLongName( p_parser )];
                 if( [newval isEqualToString: o_description] )
                 {
-                    returnval = strdup(p_parser->psz_object_name);
+                    returnval = strdup( module_GetObjName( p_parser ));
                     break;
                 }
             }
         }
         else
         {
-            module_config_t *p_config;
-            if( !strcmp( p_parser->psz_object_name, "main" ) )
-                  continue;
+            int i;
 
-            p_config = p_parser->p_config;
-            if( p_config ) do
+            if( !strcmp( module_GetObjName( p_parser ), "main" ) )
+                continue;
+            unsigned int confsize, unused;
+            module_GetConfig( p_parser, &confsize );
+            for ( i = 0; i < confsize; i++ )
             {
+                module_config_t *p_config = module_GetConfig( p_parser, &unused ) + i;
                 /* Hack: required subcategory is stored in i_min */
                 if( p_config->i_type == CONFIG_SUBCATEGORY &&
                     p_config->value.i == p_item->min.i )
                 {
                     NSString *o_description = [[VLCMain sharedInstance]
-                        localizedString: (char *)p_parser->psz_longname];
+                        localizedString: module_GetLongName( p_parser )];
                     if( [newval isEqualToString: o_description] )
                     {
-                        returnval = strdup(p_parser->psz_object_name);
+                        returnval = strdup(module_GetObjName( p_parser ));
                         break;
                     }
                 }
-            } while( p_item < p_end && p_config++ );
+            }
         }
     }
     vlc_list_release( p_list );
            withView: (NSView *)o_parent_view
 {
     NSRect mainFrame = [o_parent_view frame];
-    NSString *o_labelString, *o_tooltip, *o_textfieldString;
+    NSString *o_labelString, *o_tooltip;
     mainFrame.size.height = 23;
     mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 1;
     mainFrame.origin.x = LEFTMARGIN;
                                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_tooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the stepper */
         ADD_STEPPER( o_stepper, mainFrame, mainFrame.size.width - 19,
-            0, o_tooltip, -1600, 1600)
+            0, o_tooltip, -100000, 100000)
         [o_stepper setIntValue: p_item->value.i];
         [o_stepper setAutoresizingMask:NSViewMaxXMargin ];
         [self addSubview: o_stepper];
 
-        /* build the textfield */
-        if( p_item->value.psz )
-            o_textfieldString = [[VLCMain sharedInstance]
-                                    localizedString: (char *)p_item->value.psz];
-        else
-            o_textfieldString = [NSString stringWithString: @""];
         ADD_TEXTFIELD( o_textfield, mainFrame, mainFrame.size.width - 19 - 52,
             1, 49, o_tooltip, @"" )
         [o_textfield setIntValue: p_item->value.i];
         int i_index;
         i_view_type = CONFIG_ITEM_STRING_LIST;
 
+        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString:
+                              [[VLCMain sharedInstance]
+                               localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];        
+
         /* add the label */
         if( p_item->psz_text )
             o_labelString = [[VLCMain sharedInstance]
                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_textfieldTooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the textfield */
-        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
         ADD_COMBO( o_combo, mainFrame, [o_label frame].size.width,
             -2, 0, o_textfieldTooltip )
         [o_combo setAutoresizingMask:NSViewWidthSizable ];
     {
         i_view_type = CONFIG_ITEM_RANGED_INTEGER;
 
+        o_tooltip = [[VLCMain sharedInstance] wrapString:
+                     [[VLCMain sharedInstance]
+                      localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
+
         /* add the label */
         if( p_item->psz_text )
             o_labelString = [[VLCMain sharedInstance]
                                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_tooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the textfield */
-        o_tooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
         ADD_TEXTFIELD( o_textfield, mainFrame, [o_label frame].size.width + 2,
             28, 49, o_tooltip, @"" )
         [o_textfield setIntValue: p_item->value.i];
         [self addSubview: o_textfield];
 
         /* build the mintextfield */
-        ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888" )
+        ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888", @"" )
         [o_textfield_min setIntValue: p_item->min.i];
         [o_textfield_min setAutoresizingMask:NSViewMaxXMargin ];
         [o_textfield_min setAlignment:NSRightTextAlignment];
 
         /* build the maxtextfield */
         ADD_LABEL( o_textfield_max, mainFrame,
-                    mainFrame.size.width - 31, -30, @"8888" )
+                    mainFrame.size.width - 31, -30, @"8888", @"" )
         [o_textfield_max setIntValue: p_item->max.i];
         [o_textfield_max setAutoresizingMask:NSViewMinXMargin ];
         [self addSubview: o_textfield_max];
            withView: (NSView *)o_parent_view
 {
     NSRect mainFrame = [o_parent_view frame];
-    NSString *o_labelString, *o_tooltip, *o_textfieldString;
+    NSString *o_labelString, *o_tooltip;
     mainFrame.size.height = 23;
     mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 1;
     mainFrame.origin.x = LEFTMARGIN;
                                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -2, o_labelString )
+        ADD_LABEL( o_label, mainFrame, 0, -2, o_labelString, o_tooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the stepper */
         ADD_STEPPER( o_stepper, mainFrame, mainFrame.size.width - 19,
-            0, o_tooltip, -1600, 1600)
+            0, o_tooltip, -100000, 100000)
         [o_stepper setFloatValue: p_item->value.f];
         [o_stepper setAutoresizingMask:NSViewMaxXMargin ];
         [self addSubview: o_stepper];
 
         /* build the textfield */
-        if( p_item->value.psz )
-            o_textfieldString = [[VLCMain sharedInstance]
-                                    localizedString: (char *)p_item->value.psz];
-        else
-            o_textfieldString = [NSString stringWithString: @""];
         ADD_TEXTFIELD( o_textfield, mainFrame, mainFrame.size.width - 19 - 52,
             1, 49, o_tooltip, @"" )
         [o_textfield setFloatValue: p_item->value.f];
     {
         i_view_type = CONFIG_ITEM_RANGED_INTEGER;
 
+        o_tooltip = [[VLCMain sharedInstance] wrapString:
+                     [[VLCMain sharedInstance]
+                      localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];        
+
         /* add the label */
         if( p_item->psz_text )
             o_labelString = [[VLCMain sharedInstance]
                                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_tooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the textfield */
-        o_tooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
         ADD_TEXTFIELD( o_textfield, mainFrame, [o_label frame].size.width + 2,
             28, 49, o_tooltip, @"" )
         [o_textfield setFloatValue: p_item->value.f];
         [self addSubview: o_textfield];
 
         /* build the mintextfield */
-        ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888" )
+        ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888", @"" )
         [o_textfield_min setFloatValue: p_item->min.f];
         [o_textfield_min setAutoresizingMask:NSViewMaxXMargin ];
         [o_textfield_min setAlignment:NSRightTextAlignment];
 
         /* build the maxtextfield */
         ADD_LABEL( o_textfield_max, mainFrame, mainFrame.size.width - 31,
-            -30, @"8888" )
+            -30, @"8888", @"" )
         [o_textfield_max setFloatValue: p_item->max.f];
         [o_textfield_max setAutoresizingMask:NSViewMinXMargin ];
         [self addSubview: o_textfield_max];
                                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, [o_checkbox frame].size.width, 0, o_labelString )
+        ADD_LABEL( o_label, mainFrame, [o_checkbox frame].size.width, 0, o_labelString, o_tooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
     }
     {
         i_view_type = CONFIG_ITEM_KEY_AFTER_10_3;
 
+        o_tooltip = [[VLCMain sharedInstance] wrapString:
+                     [[VLCMain sharedInstance]
+                      localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
+
         /* add the label */
         if( p_item->psz_text )
             o_labelString = [[VLCMain sharedInstance]
                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -1, o_labelString )
+        ADD_LABEL( o_label, mainFrame, 0, -1, o_labelString, o_tooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the popup */
-        o_tooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
         ADD_POPUP( o_popup, mainFrame, [o_label frame].origin.x +
             [o_label frame].size.width + 3,
             -2, 0, o_tooltip )
             unsigned int i;
             o_keys_menu = [[NSMenu alloc] initWithTitle: @"Keys Menu"];
             for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++)
-                if( vlc_keys[i].psz_key_string && *vlc_keys[i].psz_key_string )
+                if( vlc_keys[i].psz_key_string )
                     POPULATE_A_KEY( o_keys_menu,
-                        [NSString stringWithCString:vlc_keys[i].psz_key_string]
+                        [NSString stringWithUTF8String:vlc_keys[i].psz_key_string]
                         , vlc_keys[i].i_key_code)
         }
         [o_popup setMenu:[o_keys_menu copyWithZone:nil]];
@@ -2060,38 +2045,42 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
 //Fill our array to know how may items we have...
     vlc_list_t *p_list;
     module_t *p_parser;
-    module_config_t *p_end;
-    int i_index;
+    int i_module_index;
     NSRect mainFrame = [o_parent_view frame];
     NSString *o_labelString, *o_textfieldString, *o_tooltip;
 
     o_modulearray = [[NSMutableArray alloc] initWithCapacity:10];
     /* build a list of available modules */
     p_list = vlc_list_find( VLCIntf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
-    for( i_index = 0; i_index < p_list->i_count; i_index++ )
+    for( i_module_index = 0; i_module_index < p_list->i_count; i_module_index++ )
     {
-        p_parser = (module_t *)p_list->p_values[i_index].p_object;
-        p_end = p_item + p_parser->confsize;
+        int i;
+        p_parser = (module_t *)p_list->p_values[i_module_index].p_object;
 
-        if( !strcmp( p_parser->psz_object_name, "main" ) )
+        if( !strcmp( module_GetObjName( p_parser ), "main" ) )
             continue;
 
-        module_config_t *p_config = p_parser->p_config;
-        if( p_config ) do
+        unsigned int confsize;
+        module_GetConfig( p_parser, &confsize );
+
+        for ( i = 0; i < confsize; i++ )
         {
+            unsigned int unused;
+            module_config_t *p_config = module_GetConfig( p_parser, &unused ) + i;
             NSString *o_modulelongname, *o_modulename;
             NSNumber *o_moduleenabled = nil;
+
             /* Hack: required subcategory is stored in i_min */
             if( p_config->i_type == CONFIG_SUBCATEGORY &&
                 p_config->value.i == _p_item->min.i )
             {
                 o_modulelongname = [NSString stringWithUTF8String:
-                                        p_parser->psz_longname];
+                                        module_GetLongName( p_parser )];
                 o_modulename = [NSString stringWithUTF8String:
-                                        p_parser->psz_object_name];
+                                        module_GetObjName( p_parser )];
 
                 if( _p_item->value.psz &&
-                    strstr( _p_item->value.psz, p_parser->psz_object_name ) )
+                    strstr( _p_item->value.psz, module_GetObjName( p_parser ) ) )
                     o_moduleenabled = [NSNumber numberWithBool:YES];
                 else
                     o_moduleenabled = [NSNumber numberWithBool:NO];
@@ -2100,7 +2089,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
                     arrayWithObjects: o_modulename, o_modulelongname,
                     o_moduleenabled, nil]];
             }
-        } while( p_item < p_end && p_config++ );
+        }
     }
     vlc_list_release( p_list );
 
@@ -2112,20 +2101,21 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
     {
         i_view_type = CONFIG_ITEM_MODULE_LIST;
 
+        o_tooltip = [[VLCMain sharedInstance] wrapString:
+                     [[VLCMain sharedInstance]
+                      localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
+
         /* add the label */
         if( p_item->psz_text )
             o_labelString = [[VLCMain sharedInstance]
                                 localizedString: (char *)p_item->psz_text];
         else
             o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_tooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the textfield */
-        o_tooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: (char *)p_item->psz_longtext ] toWidth: PREFS_WRAP];
         if( p_item->value.psz )
             o_textfieldString = [[VLCMain sharedInstance]
                 localizedString: (char *)p_item->value.psz];
@@ -2163,7 +2153,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
     [o_dataCell setTitle:@""];
     [o_dataCell setFont:[NSFont systemFontOfSize:0]];
     NSTableColumn *o_tableColumn = [[NSTableColumn alloc]
-        initWithIdentifier:[NSString stringWithCString: "Enabled"]];
+        initWithIdentifier:@"Enabled"];
     [o_tableColumn setHeaderCell: o_headerCell];
     [o_tableColumn setDataCell: o_dataCell];
     [o_tableColumn setWidth:17];
@@ -2173,7 +2163,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
     o_dataCell = [[NSTextFieldCell alloc] init];
     [o_dataCell setFont:[NSFont systemFontOfSize:12]];
     o_tableColumn = [[NSTableColumn alloc]
-        initWithIdentifier:[NSString stringWithCString: "Module"]];
+        initWithIdentifier:@"Module"];
     [o_tableColumn setHeaderCell: o_headerCell];
     [o_tableColumn setDataCell: o_dataCell];
     [o_tableColumn setWidth:388 - 17];
@@ -2227,7 +2217,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
 
 - (char *)stringValue
 {
-    return strdup( [[o_textfield stringValue] cString] );
+    return strdup( [[o_textfield stringValue] UTF8String] );
 }
 
 @end
@@ -2333,11 +2323,9 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
 - (id)tableView:(NSTableView *)aTableView
     objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
 {
-    if( [[aTableColumn identifier] isEqualToString:
-        [NSString stringWithCString:"Enabled"]] )
+    if( [[aTableColumn identifier] isEqualToString: @"Enabled"] )
         return [[o_modulearray objectAtIndex:rowIndex] objectAtIndex:2];
-    if( [[aTableColumn identifier] isEqualToString:
-        [NSString stringWithCString:"Module"]] )
+    if( [[aTableColumn identifier] isEqualToString: @"Module"] )
         return [[o_modulearray objectAtIndex:rowIndex] objectAtIndex:1];
 
     return nil;