Commit a0ff74f7 authored by Jérome Decoodt's avatar Jérome Decoodt

Added widget, fix save, etc.

Known bugs: changing advanced view, detection of MacOS X version at
            runtime and many others...
parent f07020df
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
VLCTreeItem *o_parent; VLCTreeItem *o_parent;
NSMutableArray *o_children; NSMutableArray *o_children;
int i_object_category; int i_object_category;
NSView *o_view;
} }
+ (VLCTreeItem *)rootItem; + (VLCTreeItem *)rootItem;
...@@ -36,7 +37,8 @@ ...@@ -36,7 +37,8 @@
- (int)getObjectID; - (int)getObjectID;
- (NSString *)getName; - (NSString *)getName;
- (BOOL)hasPrefs:(NSString *)o_module_name; - (BOOL)hasPrefs:(NSString *)o_module_name;
- (NSView *)showView:(NSScrollView *)o_prefs_view; - (NSView *)showView:(NSScrollView *)o_prefs_view advancedView:(vlc_bool_t) b_advanced;
- (void)applyChanges;
@end @end
......
...@@ -126,6 +126,7 @@ static VLCPrefs *_o_sharedMainInstance = nil; ...@@ -126,6 +126,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
- (IBAction)savePrefs: (id)sender - (IBAction)savePrefs: (id)sender
{ {
/* TODO: call savePrefs on Root item */ /* TODO: call savePrefs on Root item */
[[VLCTreeItem rootItem] applyChanges];
config_SaveConfigFile( p_intf, NULL ); config_SaveConfigFile( p_intf, NULL );
[o_prefs_window orderOut:self]; [o_prefs_window orderOut:self];
} }
...@@ -148,10 +149,8 @@ static VLCPrefs *_o_sharedMainInstance = nil; ...@@ -148,10 +149,8 @@ static VLCPrefs *_o_sharedMainInstance = nil;
if( i_return == NSAlertAlternateReturn ) if( i_return == NSAlertAlternateReturn )
{ {
config_ResetAll( p_intf ); config_ResetAll( p_intf );
[[o_tree itemAtRow:[o_tree selectedRow]] showView:o_prefs_view]; [[o_tree itemAtRow:[o_tree selectedRow]] showView:o_prefs_view advancedView:
/* [self showViewForID: [[o_tree itemAtRow:[o_tree selectedRow]] getObjectID] ([o_advanced_ckb state] == NSOnState)?VLC_TRUE:VLC_FALSE];
andName: [[o_tree itemAtRow:[o_tree selectedRow]] getName]];
*/
} }
} }
...@@ -160,10 +159,8 @@ static VLCPrefs *_o_sharedMainInstance = nil; ...@@ -160,10 +159,8 @@ static VLCPrefs *_o_sharedMainInstance = nil;
b_advanced = !b_advanced; b_advanced = !b_advanced;
[o_advanced_ckb setState: b_advanced]; [o_advanced_ckb setState: b_advanced];
/* refresh the view of the current treeitem */ /* refresh the view of the current treeitem */
[[o_tree itemAtRow:[o_tree selectedRow]] showView:o_prefs_view]; [[o_tree itemAtRow:[o_tree selectedRow]] showView:o_prefs_view advancedView:
/* [self showViewForID: [[o_tree itemAtRow:[o_tree selectedRow]] getObjectID] ([o_advanced_ckb state] == NSOnState)?VLC_TRUE:VLC_FALSE];
andName: [[o_tree itemAtRow:[o_tree selectedRow]] getName]];
*/
} }
- (void)loadConfigTree - (void)loadConfigTree
...@@ -177,7 +174,8 @@ static VLCPrefs *_o_sharedMainInstance = nil; ...@@ -177,7 +174,8 @@ static VLCPrefs *_o_sharedMainInstance = nil;
/* update the document view to the view of the selected tree item */ /* update the document view to the view of the selected tree item */
- (void)outlineViewSelectionDidChange:(NSNotification *)o_notification - (void)outlineViewSelectionDidChange:(NSNotification *)o_notification
{ {
[[o_tree itemAtRow:[o_tree selectedRow]] showView: o_prefs_view]; [[o_tree itemAtRow:[o_tree selectedRow]] showView: o_prefs_view advancedView:
([o_advanced_ckb state] == NSOnState)?VLC_TRUE:VLC_FALSE];
} }
@end @end
...@@ -189,7 +187,7 @@ static VLCPrefs *_o_sharedMainInstance = nil; ...@@ -189,7 +187,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
} }
- (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item { - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item {
return (item == nil) ? YES : ([item numberOfChildren] != -1); return (item == nil) ? YES : (([item numberOfChildren] != -1) && ([item numberOfChildren] != 0));
} }
- (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item { - (id)outlineView:(NSOutlineView *)outlineView child:(int)index ofItem:(id)item {
...@@ -219,6 +217,7 @@ static VLCTreeItem *o_root_item = nil; ...@@ -219,6 +217,7 @@ static VLCTreeItem *o_root_item = nil;
o_parent = o_parent_item; o_parent = o_parent_item;
o_children = o_children_array; o_children = o_children_array;
i_object_category = i_category; i_object_category = i_category;
o_view = nil;
} }
return( self ); return( self );
} }
...@@ -290,6 +289,8 @@ static VLCTreeItem *o_root_item = nil; ...@@ -290,6 +289,8 @@ static VLCTreeItem *o_root_item = nil;
break; break;
case CONFIG_SUBCATEGORY: case CONFIG_SUBCATEGORY:
o_child_name = [[VLCMain sharedInstance] localizedString: config_CategoryNameGet(p_item->i_value ) ]; o_child_name = [[VLCMain sharedInstance] localizedString: config_CategoryNameGet(p_item->i_value ) ];
if( p_item->i_value != SUBCAT_VIDEO_GENERAL &&
p_item->i_value != SUBCAT_AUDIO_GENERAL )
[p_last_category->o_children addObject:[[VLCTreeItem alloc] initWithName: o_child_name [p_last_category->o_children addObject:[[VLCTreeItem alloc] initWithName: o_child_name
ID: p_item->i_value parent:p_last_category children:[[NSMutableArray alloc] initWithCapacity:10] whithCategory: p_item - p_module->p_config]]; ID: p_item->i_value parent:p_last_category children:[[NSMutableArray alloc] initWithCapacity:10] whithCategory: p_item - p_module->p_config]];
break; break;
...@@ -343,7 +344,7 @@ static VLCTreeItem *o_root_item = nil; ...@@ -343,7 +344,7 @@ static VLCTreeItem *o_root_item = nil;
long cookie; long cookie;
vlc_bool_t b_found = VLC_FALSE; vlc_bool_t b_found = VLC_FALSE;
int i; unsigned int i;
VLCTreeItem* p_category_item, * p_subcategory_item; VLCTreeItem* p_category_item, * p_subcategory_item;
for (i = 0 ; i < [o_children count] ; i++) for (i = 0 ; i < [o_children count] ; i++)
{ {
...@@ -431,27 +432,20 @@ static VLCTreeItem *o_root_item = nil; ...@@ -431,27 +432,20 @@ static VLCTreeItem *o_root_item = nil;
return( NO ); return( NO );
} }
- (NSView *)showView:(NSScrollView *)o_prefs_view - (NSView *)showView:(NSScrollView *)o_prefs_view advancedView:(vlc_bool_t) b_advanced
{ {
fprintf( stderr, "[%s] showView\n", [o_name UTF8String] ); fprintf( stderr, "[%s] showView\n", [o_name UTF8String] );
vlc_list_t *p_list; if( o_view == nil )
{
intf_thread_t *p_intf = VLCIntf; intf_thread_t *p_intf = VLCIntf;
module_t *p_parser; vlc_list_t *p_list;
module_config_t *p_item, *p_first_item; module_t *p_parser = NULL;
NSView *o_view; module_config_t *p_item;
NSRect s_rc; /* rect */ NSRect s_vrc;
NSTextField *o_text_field; /* input field / label */
NSRect s_vrc; /* view rect */
NSString *o_module_name;
int i_pos, i_module_tag;
NSPoint o_pos;
vlc_bool_t b_advanced = VLC_TRUE;
s_vrc = [[o_prefs_view contentView] bounds];
s_vrc.size.height -= 4;
o_view = [[NSView alloc] initWithFrame: s_vrc];
p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE ); s_vrc = [[o_prefs_view contentView] bounds]; s_vrc.size.height -= 4;
o_view = [[VLCFlippedView alloc] initWithFrame: s_vrc];
[o_view setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
/* Get a pointer to the module */ /* Get a pointer to the module */
if( i_object_category == -1 ) if( i_object_category == -1 )
...@@ -460,16 +454,128 @@ fprintf( stderr, "[%s] showView\n", [o_name UTF8String] ); ...@@ -460,16 +454,128 @@ fprintf( stderr, "[%s] showView\n", [o_name UTF8String] );
if( !p_parser || p_parser->i_object_type != VLC_OBJECT_MODULE ) if( !p_parser || p_parser->i_object_type != VLC_OBJECT_MODULE )
{ {
/* 0OOoo something went really bad */ /* 0OOoo something went really bad */
vlc_list_release( p_list ); return nil;
return o_view; }
p_item = p_parser->p_config;
int i = 0;
int i_yPos = -2;
int i_lastItem = 0;
p_item = p_parser->p_config + 1;
do
{
if( !p_item )
{
fprintf( stderr, "Something is going very bad... skipping null item\n" );
break;
}
switch(p_item->i_type)
{
case CONFIG_SUBCATEGORY:
fprintf( stderr, "drawing subcategory %s\n", [o_name UTF8String] );
break;
case CONFIG_SECTION:
fprintf( stderr, "drawing section %s\n", p_item->psz_text );
break;
case CONFIG_CATEGORY:
fprintf( stderr, "drawing category %s\n", [o_name UTF8String] );
break;
case CONFIG_HINT_END:
fprintf( stderr, "end of (sub)category\n" );
break;
case CONFIG_HINT_USAGE:
fprintf( stderr, "skipping hint usage\n" );
break;
default:
fprintf( stderr, "%s (%d) is ", p_item->psz_name, p_item->i_type );
{
VLCConfigControl *o_control = nil;
int i_widget = 0;
if( p_item->b_advanced && (! b_advanced) )
break;
switch( p_item->i_type )
{
case CONFIG_ITEM_STRING:
fprintf( stderr, "CONFIG_ITEM_STRING" );
if( !p_item->i_list )
i_widget = CONFIG_ITEM_STRING;
else
i_widget = CONFIG_ITEM_STRING_LIST;
break;
case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY:
fprintf( stderr, "CONFIG_ITEM_FILE" );
i_widget = CONFIG_ITEM_FILE;
break;
case CONFIG_ITEM_MODULE:
case CONFIG_ITEM_MODULE_CAT:
fprintf( stderr, "CONFIG_ITEM_MODULE" );
i_widget = CONFIG_ITEM_MODULE;
break;
case CONFIG_ITEM_INTEGER:
fprintf( stderr, "CONFIG_ITEM_INTEGER" );
if( p_item->i_list )
i_widget = CONFIG_ITEM_STRING_LIST;
else if( p_item->i_min != 0 || p_item->i_max != 0 )
i_widget = CONFIG_ITEM_RANGED_INTEGER;
else
i_widget = CONFIG_ITEM_INTEGER;
break;
case CONFIG_ITEM_FLOAT:
fprintf( stderr, "CONFIG_ITEM_FLOAT" );
if( p_item->f_min != 0 || p_item->f_max != 0 )
i_widget = CONFIG_ITEM_RANGED_INTEGER;
else
i_widget = CONFIG_ITEM_INTEGER;
break;
case CONFIG_ITEM_BOOL:
fprintf( stderr, "CONFIG_ITEM_BOOL" );
i_widget = CONFIG_ITEM_BOOL;
break;
case CONFIG_ITEM_KEY:
fprintf( stderr, "CONFIG_ITEM_KEY" );
#define MACOS_VERSION 4
if( MACOS_VERSION < 3 )
i_widget = CONFIG_ITEM_KEY_BEFORE_10_3;
else
i_widget = CONFIG_ITEM_KEY_AFTER_10_3;
break;
case CONFIG_ITEM_MODULE_LIST:
case CONFIG_ITEM_MODULE_LIST_CAT:
fprintf( stderr, "CONFIG_ITEM_MODULE_LIST" );
i_widget = CONFIG_ITEM_MODULE_LIST;
break;
default:
fprintf( stderr, "***UNKNOWN***" );
}
if( i_widget != 0 )
{
i_yPos += [VLCConfigControl calcVerticalMargin:i_widget lastItem:i_lastItem];
o_control = [VLCConfigControl newControl:p_item
withView:o_view
yOffset: i_yPos
lastItem: i_lastItem];
if( o_control != nil )
{
i_yPos += [o_control frame].size.height;
i_lastItem = i_widget;
[o_control setAutoresizingMask: NSViewMaxYMargin | NSViewWidthSizable];
[o_view addSubview: o_control];
}
}
fprintf( stderr, "\n" );
break;
} }
o_module_name = [NSString stringWithUTF8String: p_parser->psz_object_name]; }
fprintf( stderr, "showView: going to show [%d] %s\n", i_object_id, p_parser->psz_object_name ); } while( p_item++->i_type != CONFIG_HINT_END );
p_first_item = p_item = p_parser->p_config;
vlc_object_release( p_parser );
} }
else else
{ {
int i_index; int i_index;
p_list = vlc_list_find( p_intf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
if( !p_list ) return o_view; if( !p_list ) return o_view;
/* /*
...@@ -486,104 +592,152 @@ fprintf( stderr, "showView: going to show [%d] %s\n", i_object_id, p_parser->psz ...@@ -486,104 +592,152 @@ fprintf( stderr, "showView: going to show [%d] %s\n", i_object_id, p_parser->psz
msg_Err( p_intf, "could not find the main module in our preferences" ); msg_Err( p_intf, "could not find the main module in our preferences" );
return o_view; return o_view;
} }
p_first_item = p_item = (p_parser->p_config + i_object_category); p_item = (p_parser->p_config + i_object_category);
} if( ( p_item->i_type == CONFIG_CATEGORY ) &&
o_view = nil; ( ( p_item->i_value == CAT_AUDIO ) || ( p_item->i_value == CAT_VIDEO ) ) )
i_module_tag = 3; p_item++;
/* These defines should come from "Apple Human Interface Guidelines" */ int i = 0;
#define X_ORIGIN 20 int i_yPos = -2;
#define Y_ORIGIN 17 int i_lastItem = 0;
#define Y_INTER 8
/* Init View */
s_vrc = [[o_prefs_view contentView] bounds]; s_vrc.size.height -= 4;
o_view = [[VLCFlippedView alloc] initWithFrame: s_vrc];
[o_view setAutoresizingMask: NSViewWidthSizable];
o_pos.x = X_ORIGIN; do
o_pos.y = Y_ORIGIN;
BOOL b_right_cat = TRUE;
if( p_item ) do ; while ( ( p_item->i_type == CONFIG_CATEGORY || p_item->i_type == CONFIG_SUBCATEGORY ) && p_item++ );
if( p_item ) do
{ {
fprintf( stderr, "Category: %d\n", p_item->i_type ); p_item++;
if( p_item->i_type == CONFIG_HINT_CATEGORY ) if( !p_item )
{ {
if( !strcmp( p_parser->psz_object_name, "main" ) && fprintf( stderr, "Something is going very bad... skipping null item\n" );
[o_name isEqualToString: [[VLCMain sharedInstance] localizedString: p_item->psz_text]] ) break;
b_right_cat = TRUE;
else if( strcmp( p_parser->psz_object_name, "main" ) )
b_right_cat = TRUE;
else b_right_cat = FALSE;
} }
else if( p_item->i_type == CONFIG_HINT_END && !strcmp( p_parser->psz_object_name, "main" ) ) switch(p_item->i_type)
b_right_cat = FALSE; {
case CONFIG_SUBCATEGORY:
if( (p_item->b_advanced && !b_advanced ) || !b_right_cat ) fprintf( stderr, "drawing subcategory %s\n", [o_name UTF8String] );
break;
case CONFIG_SECTION:
fprintf( stderr, "drawing section %s\n", p_item->psz_text );
break;
case CONFIG_CATEGORY:
fprintf( stderr, "drawing category %s\n", [o_name UTF8String] );
break;
case CONFIG_HINT_END:
fprintf( stderr, "end of (sub)category\n" );
break;
case CONFIG_HINT_USAGE:
fprintf( stderr, "skipping hint usage\n" );
break;
default:
fprintf( stderr, "%s (%d) is ", p_item->psz_name, p_item->i_type );
{ {
continue;
}
fprintf( stderr, "Creating view for: %s\n", p_item->psz_name );
VLCConfigControl *o_control = nil; VLCConfigControl *o_control = nil;
int i_widget = 0;
switch( p_item->i_type ) switch( p_item->i_type )
{ {
case CONFIG_ITEM_STRING: case CONFIG_ITEM_STRING:
{ fprintf( stderr, "CONFIG_ITEM_STRING" );
if( !p_item->i_list ) if( !p_item->i_list )
o_control = [StringConfigControl newControl:p_item i_widget = CONFIG_ITEM_STRING;
withView:o_view withObject:p_intf offset: o_pos];
else else
o_control = [StringListConfigControl newControl:p_item i_widget = CONFIG_ITEM_STRING_LIST;
withView:o_view withObject:p_intf offset: o_pos];
}
break; break;
case CONFIG_ITEM_FILE: case CONFIG_ITEM_FILE:
case CONFIG_ITEM_DIRECTORY: case CONFIG_ITEM_DIRECTORY:
{ fprintf( stderr, "CONFIG_ITEM_FILE" );
o_control = [FileConfigControl newControl: p_item withView: o_view i_widget = CONFIG_ITEM_FILE;
withObject: p_intf offset: o_pos]; break;
} case CONFIG_ITEM_MODULE:
case CONFIG_ITEM_MODULE_CAT:
fprintf( stderr, "CONFIG_ITEM_MODULE" );
i_widget = CONFIG_ITEM_MODULE;
break; break;
case CONFIG_ITEM_INTEGER: case CONFIG_ITEM_INTEGER:
{ fprintf( stderr, "CONFIG_ITEM_INTEGER" );
if( !p_item->i_list ) if( p_item->i_list )
o_control = [IntegerConfigControl newControl:p_item i_widget = CONFIG_ITEM_STRING_LIST;
withView:o_view withObject:p_intf offset: o_pos];
else if( p_item->i_min != 0 || p_item->i_max != 0 ) else if( p_item->i_min != 0 || p_item->i_max != 0 )
o_control = [RangedIntegerConfigControl newControl:p_item i_widget = CONFIG_ITEM_RANGED_INTEGER;
withView:o_view withObject:p_intf offset: o_pos];
else else
o_control = [IntegerListConfigControl newControl:p_item i_widget = CONFIG_ITEM_INTEGER;
withView:o_view withObject:p_intf offset: o_pos]; break;
} case CONFIG_ITEM_FLOAT:
fprintf( stderr, "CONFIG_ITEM_FLOAT" );
if( p_item->f_min != 0 || p_item->f_max != 0 )
i_widget = CONFIG_ITEM_RANGED_INTEGER;
else
i_widget = CONFIG_ITEM_INTEGER;
break;
case CONFIG_ITEM_BOOL:
fprintf( stderr, "CONFIG_ITEM_BOOL" );
i_widget = CONFIG_ITEM_BOOL;
break; break;
case CONFIG_ITEM_KEY: case CONFIG_ITEM_KEY:
{ fprintf( stderr, "CONFIG_ITEM_KEY" );
o_control = [KeyConfigControl newControl:p_item withView:o_view withObject:p_intf offset: o_pos]; #define MACOS_VERSION 4
} if( MACOS_VERSION < 3 )
i_widget = CONFIG_ITEM_KEY_BEFORE_10_3;
else
i_widget = CONFIG_ITEM_KEY_AFTER_10_3;
break;
case CONFIG_ITEM_MODULE_LIST:
case CONFIG_ITEM_MODULE_LIST_CAT:
fprintf( stderr, "CONFIG_ITEM_MODULE_LIST" );
i_widget = CONFIG_ITEM_MODULE_LIST;
break; break;
default:
fprintf( stderr, "***UNKNOWN***" );
} }
if( i_widget != 0 )
{
i_yPos += [VLCConfigControl calcVerticalMargin:i_widget lastItem:i_lastItem];
o_control = [VLCConfigControl newControl:p_item
withView:o_view
yOffset: i_yPos
lastItem: i_lastItem];
if( o_control != nil ) if( o_control != nil )
{ {
i_yPos += [o_control frame].size.height;
i_lastItem = i_widget;
[o_control setAutoresizingMask: NSViewMaxYMargin | NSViewWidthSizable];
[o_view addSubview: o_control]; [o_view addSubview: o_control];
o_pos.y += [o_control frame].size.height + Y_INTER;
} }
#undef Y_ORIGIN
#undef X_ORIGIN
} }
while( p_item->i_type != CONFIG_HINT_END && p_item->i_type != CONFIG_CATEGORY && p_item->i_type != CONFIG_SUBCATEGORY && p_item++ ); fprintf( stderr, "\n" );
break;
}
}
} while ( ( p_item->i_type != CONFIG_HINT_END ) && ( p_item->i_type != CONFIG_SUBCATEGORY ) );
vlc_object_release( p_parser ); vlc_object_release( p_parser );
vlc_list_release( p_list ); vlc_list_release( p_list );
}
[o_prefs_view setDocumentView: o_view]; }
[o_prefs_view setNeedsDisplay: TRUE]; else
{
NSRect s_vrc;
s_vrc = [[o_prefs_view contentView] bounds]; s_vrc.size.height -= 4;
[o_view setFrame: s_vrc];
}
if( o_view != nil )
[o_prefs_view setDocumentView:o_view];
return o_view; return o_view;
} }
- (void)applyChanges
{
unsigned int i;
if( o_view != nil )
{
//Item has been shown
fprintf( stderr, "[%s] applying changes\n", [o_name cString]);
NSArray *o_subviews = [o_view subviews];
for( i = 0 ; i < [o_subviews count] ; i++ )
[[o_subviews objectAtIndex:i] applyChanges];
}
if( o_children != IsALeafNode )
for( i = 0 ; i < [o_children count] ; i++ )
[[o_children objectAtIndex:i] applyChanges];
}
@end @end
......
...@@ -21,20 +21,22 @@ ...@@ -21,20 +21,22 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#define CONFIG_ITEM_STRING_LIST (CONFIG_ITEM_STRING + 1)
#define CONFIG_ITEM_RANGED_INTEGER (CONFIG_ITEM_INTEGER + 1)
#define CONFIG_ITEM_KEY_BEFORE_10_3 (CONFIG_ITEM_KEY + 1)
#define CONFIG_ITEM_KEY_AFTER_10_3 (CONFIG_ITEM_KEY + 2)
@interface VLCConfigControl : NSView @interface VLCConfigControl : NSView
{ {
vlc_object_t *p_this;
module_config_t *p_item; module_config_t *p_item;
char *psz_name; char *psz_name;
NSTextField *o_label; NSTextField *o_label;
int i_type; int i_type;
vlc_bool_t b_advanced; vlc_bool_t b_advanced;
NSView *contentView;
} }
+ (VLCConfigControl *)newControl: (module_config_t *)p_item withView: (NSView *)o_parent_view withObject: (vlc_object_t *)p_this offset:(NSPoint) offset; + (VLCConfigControl *)newControl: (module_config_t *)_p_item withView: (NSView *)o_parent_view yOffset:(int) i_yPos lastItem: (int) i_lastItem;
- (id)initWithFrame: (NSRect)frame item: (module_config_t *)p_item withObject: (vlc_object_t *)_p_this; - (id)initWithFrame: (NSRect)frame item: (module_config_t *)p_item;
- (NSString *)getName; - (NSString *)getName;
- (int)getType; - (int)getType;
- (BOOL)isAdvanced; - (BOOL)isAdvanced;
...@@ -42,30 +44,23 @@ ...@@ -42,30 +44,23 @@
- (int)intValue; - (int)intValue;
- (float)floatValue; - (float)floatValue;
- (char *)stringValue; - (char *)stringValue;
- (void)applyChanges;
static NSMenu *o_keys_menu = nil;
@end + (int)calcVerticalMargin: (int)i_curItem lastItem:(int)i_lastItem;
@interface KeyConfigControl : VLCConfigControl
{
NSMatrix *o_matrix;
NSComboBox *o_combo;
}
@end @end
#if 0
@interface ModuleConfigControl : VLCConfigControl
{
NSPopUpButton *o_popup;
}
@end
#endif
@interface StringConfigControl : VLCConfigControl @interface StringConfigControl : VLCConfigControl
{ {
NSTextField *o_textfield; NSTextField *o_textfield;
} }
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
@end @end
@interface StringListConfigControl : VLCConfigControl @interface StringListConfigControl : VLCConfigControl
...@@ -73,7 +68,13 @@ ...@@ -73,7 +68,13 @@
NSComboBox *o_combo; NSComboBox *o_combo;
} }
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
@end @end
@interface FileConfigControl : VLCConfigControl @interface FileConfigControl : VLCConfigControl
{ {
NSTextField *o_textfield; NSTextField *o_textfield;
...@@ -81,17 +82,39 @@ ...@@ -81,17 +82,39 @@
BOOL b_directory; BOOL b_directory;
} }
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
- (IBAction)openFileDialog: (id)sender; - (IBAction)openFileDialog: (id)sender;
- (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void *)o_context_info; - (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void *)o_context_info;
@end @end
@interface ModuleConfigControl : VLCConfigControl
{
NSPopUpButton *o_popup;
}
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
@end
@interface IntegerConfigControl : VLCConfigControl @interface IntegerConfigControl : VLCConfigControl
{ {
NSTextField *o_textfield; NSTextField *o_textfield;
NSStepper *o_stepper; NSStepper *o_stepper;
} }
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
- (IBAction)stepperChanged:(id)sender; - (IBAction)stepperChanged:(id)sender;
- (void)textfieldChanged:(NSNotification *)o_notification; - (void)textfieldChanged:(NSNotification *)o_notification;
...@@ -102,6 +125,11 @@ ...@@ -102,6 +125,11 @@
NSComboBox *o_combo; NSComboBox *o_combo;
} }
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
@end @end
@interface RangedIntegerConfigControl : VLCConfigControl @interface RangedIntegerConfigControl : VLCConfigControl
...@@ -112,17 +140,42 @@ ...@@ -112,17 +140,42 @@
NSTextField *o_textfield_max; NSTextField *o_textfield_max;
} }
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
- (IBAction)sliderChanged:(id)sender; - (IBAction)sliderChanged:(id)sender;
- (void)textfieldChanged:(NSNotification *)o_notification; - (void)textfieldChanged:(NSNotification *)o_notification;
@end @end
#if 0
@interface BoolConfigControl : VLCConfigControl
{
NSButton *o_checkbox;
}
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
@end
@interface FloatConfigControl : VLCConfigControl @interface FloatConfigControl : VLCConfigControl
{ {
NSTextField *o_textfield; NSTextField *o_textfield;
NSStepper *o_stepper;
} }
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
- (IBAction)stepperChanged:(id)sender;
- (void)textfieldChanged:(NSNotification *)o_notification;
@end @end
@interface RangedFloatConfigControl : VLCConfigControl @interface RangedFloatConfigControl : VLCConfigControl
...@@ -133,16 +186,60 @@ ...@@ -133,16 +186,60 @@
NSTextField *o_textfield_max; NSTextField *o_textfield_max;
} }
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
- (IBAction)sliderChanged:(id)sender; - (IBAction)sliderChanged:(id)sender;
- (void)textfieldChanged:(NSNotification *)o_notification; - (void)textfieldChanged:(NSNotification *)o_notification;
@end @end
@interface KeyConfigControlBefore103 : VLCConfigControl
{
NSButton *o_cmd_checkbox;
NSButton *o_ctrl_checkbox;
NSButton *o_alt_checkbox;
NSButton *o_shift_checkbox;
NSPopUpButton *o_popup;
}
@interface BoolConfigControl : VLCConfigControl - (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
@end
@interface KeyConfigControlAfter103 : VLCConfigControl
{ {
NSButton *o_checkbox; NSPopUpButton *o_popup;
}
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
@end
@interface ModuleListConfigControl : VLCConfigControl
{
NSTextField *o_textfield;
NSScrollView *o_scrollview;
NSMutableArray *o_modulearray;
} }
- (id) initWithItem: (module_config_t *)_p_item
withView: (NSView *)o_parent_view
withVerticalOffset: (int)i_yPos
withLastItem: (int)i_lastItem;
@end @end
#endif
\ No newline at end of file //#undef CONFIG_ITEM_LIST_STRING
//#undef CONFIG_ITEM_RANGED_INTEGER
//#undef CONFIG_ITEM_KEY_BEFORE_10_3
//#undef CONFIG_ITEM_KEY_AFTER_10_3
This source diff could not be displayed because it is too large. You can view the blob instead.
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