Commit 2617285f authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* modules/gui/macosx/intf.m: fix

* modules/gui/macosx/prefs.?: New preferences parse code.
  New widgets aren't being created just yet.
  OS X version is broken now, but it already was. we need to fix this before
  a release. Code is largely ported from wxwindows...
parent 77a52019
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* intf.m: MacOS X interface module * intf.m: MacOS X interface module
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2004 VideoLAN * Copyright (C) 2002-2004 VideoLAN
* $Id: intf.m,v 1.114 2004/01/25 17:01:57 murray Exp $ * $Id: intf.m,v 1.115 2004/01/30 12:44:21 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Christophe Massiot <massiot@via.ecp.fr> * Christophe Massiot <massiot@via.ecp.fr>
...@@ -286,8 +286,8 @@ int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable, ...@@ -286,8 +286,8 @@ int PlaylistChanged( vlc_object_t *p_this, const char *psz_variable,
vlc_value_t old_val, vlc_value_t new_val, void *param ) vlc_value_t old_val, vlc_value_t new_val, void *param )
{ {
intf_thread_t * p_intf = [NSApp getIntf]; intf_thread_t * p_intf = [NSApp getIntf];
p_intf->p_sys->b_playlist_update = VLC_TRUE; p_intf->p_sys->b_playlist_update = TRUE;
p_intf->p_sys->b_intf_update = VLC_TRUE; p_intf->p_sys->b_intf_update = TRUE;
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -435,7 +435,7 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key ) ...@@ -435,7 +435,7 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
} }
- (void)initStrings - (void)initStrings
{ {
[o_window setTitle: _NS("VLC - Controller")]; [o_window setTitle: _NS("VLC - Controller")];
[o_scrollfield setStringValue: _NS("VLC media player")]; [o_scrollfield setStringValue: _NS("VLC media player")];
...@@ -636,6 +636,7 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key ) ...@@ -636,6 +636,7 @@ unsigned int VLCModifiersToCocoa( unsigned int i_key )
{ {
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self ); var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-change", PlaylistChanged, self ); var_AddCallback( p_playlist, "item-change", PlaylistChanged, self );
var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, self );
#define p_input p_playlist->p_input #define p_input p_playlist->p_input
......
/***************************************************************************** /*****************************************************************************
* prefs.h: MacOS X module for vlc * prefs.h: MacOS X module for vlc
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2004 VideoLAN
* $Id: prefs.h,v 1.13 2004/01/25 17:01:57 murray Exp $ * $Id: prefs.h,v 1.14 2004/01/30 12:44:21 hartman Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <hartman at videolan dot org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -21,22 +22,26 @@ ...@@ -21,22 +22,26 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/ *****************************************************************************/
#define PREFS_WRAP 300
@interface VLCTreeItem : NSObject @interface VLCTreeItem : NSObject
{ {
NSString *o_name;
int i_object_id; int i_object_id;
char *psz_help;
char *psz_section;
NSString *o_name;
NSMutableArray *o_config_controls;
VLCTreeItem *o_parent; VLCTreeItem *o_parent;
NSMutableArray *o_children; NSMutableArray *o_children;
} }
+ (VLCTreeItem *)rootItem; + (VLCTreeItem *)rootItem;
- (id)initWithID: (int)i_id parent: (VLCTreeItem *)o_parent_item;
- (int)numberOfChildren; - (int)numberOfChildren;
- (VLCTreeItem *)childAtIndex:(int)i_index; - (VLCTreeItem *)childAtIndex:(int)i_index;
- (int)getObjectID; - (int)objectID;
- (NSString *)getName; - (NSString *)name;
- (BOOL)hasPrefs:(NSString *)o_module_name; - (void)setName:(NSString *)a_name;
@end @end
...@@ -47,9 +52,7 @@ ...@@ -47,9 +52,7 @@
{ {
intf_thread_t *p_intf; intf_thread_t *p_intf;
vlc_bool_t b_advanced; vlc_bool_t b_advanced;
VLCTreeItem *o_config_tree;
NSView *o_empty_view; NSView *o_empty_view;
NSMutableDictionary *o_save_prefs;
IBOutlet id o_prefs_window; IBOutlet id o_prefs_window;
IBOutlet id o_tree; IBOutlet id o_tree;
...@@ -67,105 +70,6 @@ ...@@ -67,105 +70,6 @@
- (IBAction)resetAll: (id)sender; - (IBAction)resetAll: (id)sender;
- (void)sheetDidEnd:(NSWindow *)o_sheet returnCode:(int)i_return contextInfo:(void *)o_context; - (void)sheetDidEnd:(NSWindow *)o_sheet returnCode:(int)i_return contextInfo:(void *)o_context;
- (IBAction)advancedToggle: (id)sender; - (IBAction)advancedToggle: (id)sender;
- (IBAction)openFileDialog: (id)sender; - (void)showViewForID: (int)i_id;
- (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void *)o_context_info;
- (void)showViewForID: (int) i_id andName:(NSString *)o_item_name;
- (void)configChanged:(id)o_unknown;
@end
@interface VLCFlippedView : NSView
{
}
@end
#define INTF_CONTROL_CONFIG(x) \
@interface VLC##x : NS##x \
{ \
NSString *o_module_name; \
NSString *o_config_name; \
int i_config_type; \
} \
- (void)setModuleName:(NSString *)_o_module_name; \
- (void)setConfigName:(NSString *)_o_config_name; \
- (void)setConfigType:(int)_i_config_type; \
- (NSString *)moduleName; \
- (NSString *)configName; \
- (int)configType; \
@end
#define IMPL_CONTROL_CONFIG(x) \
@implementation VLC##x \
- (id)init \
{ \
self = [super init]; \
if( self != nil ) \
{ \
o_module_name = nil; \
o_config_name = nil; \
i_config_type = 0; \
} \
return( self ); \
} \
- (void)dealloc \
{ \
if( o_module_name != nil ) \
{ \
[o_module_name release]; \
} \
if( o_config_name != nil ) \
{ \
[o_config_name release]; \
} \
[super dealloc]; \
} \
- (void)setModuleName:(NSString *)_o_module_name \
{ \
if( o_module_name != nil ) \
{ \
[o_module_name release]; \
} \
o_module_name = [_o_module_name retain]; \
} \
- (void)setConfigName:(NSString *)_o_config_name \
{ \
if( o_config_name != nil ) \
{ \
[o_config_name release]; \
} \
o_config_name = [_o_config_name retain]; \
} \
- (void)setConfigType:(int)_i_config_type \
{ \
i_config_type = _i_config_type; \
} \
- (NSString *)moduleName \
{ \
return( o_module_name ); \
} \
- (NSString *)configName \
{ \
return( o_config_name ); \
} \
- (int)configType \
{ \
return( i_config_type ); \
} \
@end
INTF_CONTROL_CONFIG(Button);
INTF_CONTROL_CONFIG(PopUpButton);
INTF_CONTROL_CONFIG(ComboBox);
INTF_CONTROL_CONFIG(TextField);
INTF_CONTROL_CONFIG(Slider);
INTF_CONTROL_CONFIG(Matrix);
#define CONTROL_CONFIG( obj, mname, ctype, cname ) \
{ \
[obj setModuleName: mname]; \
[obj setConfigType: ctype]; \
[obj setConfigName: [NSString stringWithUTF8String: cname]]; \
}
@end
\ No newline at end of file
This diff is collapsed.
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