1 /*****************************************************************************
2 * prefs.h: MacOS X plugin for vlc
3 *****************************************************************************
4 * Copyright (C) 2002-2003 VideoLAN
5 * $Id: prefs.h,v 1.6 2003/05/20 15:23:25 hartman Exp $
7 * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
26 @interface VLCTreeItem : NSObject
30 VLCTreeItem *o_parent;
31 NSMutableArray *o_children;
34 + (VLCTreeItem *)rootItem;
35 - (int)numberOfChildren;
36 - (VLCTreeItem *)childAtIndex:(int)i_index;
38 - (NSString *)getName;
39 - (BOOL)hasPrefs:(NSString *)o_module_name;
43 /*****************************************************************************
45 *****************************************************************************/
46 @interface VLCPrefs : NSObject
48 intf_thread_t *p_intf;
49 vlc_bool_t b_advanced;
50 VLCTreeItem *o_config_tree;
53 IBOutlet id o_prefs_window;
55 IBOutlet id o_prefs_view;
56 IBOutlet id o_save_btn;
57 IBOutlet id o_cancel_btn;
58 IBOutlet id o_reset_btn;
59 IBOutlet id o_advanced_ckb;
64 - (IBAction)savePrefs: (id)sender;
65 - (IBAction)closePrefs: (id)sender;
66 - (IBAction)resetAll: (id)sender;
67 - (IBAction)advancedToggle: (id)sender;
68 - (void)showViewForID: (int) i_id andName:(NSString *)o_item_name;
69 - (void)configChanged:(id)o_unknown;
73 @interface VLCFlippedView : NSView
80 #define INTF_CONTROL_CONFIG(x) \
81 @interface VLC##x : NS##x \
83 NSString *o_module_name; \
84 NSString *o_config_name; \
87 - (void)setModuleName:(NSString *)_o_module_name; \
88 - (void)setConfigName:(NSString *)_o_config_name; \
89 - (void)setConfigType:(int)_i_config_type; \
90 - (NSString *)moduleName; \
91 - (NSString *)configName; \
95 #define IMPL_CONTROL_CONFIG(x) \
96 @implementation VLC##x \
99 self = [super init]; \
102 o_module_name = nil; \
103 o_config_name = nil; \
110 if( o_module_name != nil ) \
112 [o_module_name release]; \
114 if( o_config_name != nil ) \
116 [o_config_name release]; \
120 - (void)setModuleName:(NSString *)_o_module_name \
122 if( o_module_name != nil ) \
124 [o_module_name release]; \
126 o_module_name = [_o_module_name retain]; \
128 - (void)setConfigName:(NSString *)_o_config_name \
130 if( o_config_name != nil ) \
132 [o_config_name release]; \
134 o_config_name = [_o_config_name retain]; \
136 - (void)setConfigType:(int)_i_config_type \
138 i_config_type = _i_config_type; \
140 - (NSString *)moduleName \
142 return( o_module_name ); \
144 - (NSString *)configName \
146 return( o_config_name ); \
150 return( i_config_type ); \
154 INTF_CONTROL_CONFIG(Button);
155 INTF_CONTROL_CONFIG(PopUpButton);
156 INTF_CONTROL_CONFIG(ComboBox);
157 INTF_CONTROL_CONFIG(TextField);
159 #define CONTROL_CONFIG( obj, mname, ctype, cname ) \
161 [obj setModuleName: mname]; \
162 [obj setConfigType: ctype]; \
163 [obj setConfigName: [NSString stringWithCString: cname]]; \