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
......
This diff is collapsed.
...@@ -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