1 /*****************************************************************************
2 * prefs_widgets.h: Preferences controls
3 *****************************************************************************
4 * Copyright (C) 2002-2003 VideoLAN
7 * Authors: Derk-Jan Hartman <hartman at videolan.org>
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 *****************************************************************************/
24 #define CONFIG_ITEM_STRING_LIST (CONFIG_ITEM_STRING + 1)
25 #define CONFIG_ITEM_RANGED_INTEGER (CONFIG_ITEM_INTEGER + 1)
26 #define CONFIG_ITEM_KEY_BEFORE_10_3 (CONFIG_ITEM_KEY + 1)
27 #define CONFIG_ITEM_KEY_AFTER_10_3 (CONFIG_ITEM_KEY + 2)
28 #define MACOS_VERSION [[[NSDictionary dictionaryWithContentsOfFile: \
29 @"/System/Library/CoreServices/SystemVersion.plist"] \
30 objectForKey: @"ProductVersion"] floatValue]
32 @interface VLCConfigControl : NSView
34 module_config_t *p_item;
39 vlc_bool_t b_advanced;
42 + (VLCConfigControl *)newControl: (module_config_t *)_p_item
43 withView: (NSView *)o_parent_view;
44 - (id)initWithFrame: (NSRect)frame item: (module_config_t *)p_item;
45 - (NSString *)getName;
49 - (void)setYPos:(int)i_yPos;
52 - (char *)stringValue;
54 static NSMenu *o_keys_menu = nil;
56 + (int)calcVerticalMargin: (int)i_curItem lastItem:(int)i_lastItem;
60 @interface StringConfigControl : VLCConfigControl
62 NSTextField *o_textfield;
65 - (id) initWithItem: (module_config_t *)_p_item
66 withView: (NSView *)o_parent_view;
70 @interface StringListConfigControl : VLCConfigControl
75 - (id) initWithItem: (module_config_t *)_p_item
76 withView: (NSView *)o_parent_view;
80 @interface FileConfigControl : VLCConfigControl
82 NSTextField *o_textfield;
87 - (id) initWithItem: (module_config_t *)_p_item
88 withView: (NSView *)o_parent_view;
90 - (IBAction)openFileDialog: (id)sender;
91 - (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void *)o_context_info;
95 @interface ModuleConfigControl : VLCConfigControl
97 NSPopUpButton *o_popup;
100 - (id) initWithItem: (module_config_t *)_p_item
101 withView: (NSView *)o_parent_view;
105 @interface IntegerConfigControl : VLCConfigControl
107 NSTextField *o_textfield;
108 NSStepper *o_stepper;
112 - (id) initWithItem: (module_config_t *)_p_item
113 withView: (NSView *)o_parent_view;
114 - (IBAction)stepperChanged:(id)sender;
115 - (void)textfieldChanged:(NSNotification *)o_notification;
119 @interface IntegerListConfigControl : VLCConfigControl
124 - (id) initWithItem: (module_config_t *)_p_item
125 withView: (NSView *)o_parent_view;
129 @interface RangedIntegerConfigControl : VLCConfigControl
132 NSTextField *o_textfield;
133 NSTextField *o_textfield_min;
134 NSTextField *o_textfield_max;
138 - (id) initWithItem: (module_config_t *)_p_item
139 withView: (NSView *)o_parent_view;
140 - (IBAction)sliderChanged:(id)sender;
141 - (void)textfieldChanged:(NSNotification *)o_notification;
145 @interface BoolConfigControl : VLCConfigControl
147 NSButton *o_checkbox;
150 - (id) initWithItem: (module_config_t *)_p_item
151 withView: (NSView *)o_parent_view;
155 @interface FloatConfigControl : VLCConfigControl
157 NSTextField *o_textfield;
158 NSStepper *o_stepper;
162 - (id) initWithItem: (module_config_t *)_p_item
163 withView: (NSView *)o_parent_view;
164 - (IBAction)stepperChanged:(id)sender;
165 - (void)textfieldChanged:(NSNotification *)o_notification;
169 @interface RangedFloatConfigControl : VLCConfigControl
172 NSTextField *o_textfield;
173 NSTextField *o_textfield_min;
174 NSTextField *o_textfield_max;
178 - (id) initWithItem: (module_config_t *)_p_item
179 withView: (NSView *)o_parent_view;
180 - (IBAction)sliderChanged:(id)sender;
181 - (void)textfieldChanged:(NSNotification *)o_notification;
185 @interface KeyConfigControlBefore103 : VLCConfigControl
187 NSButton *o_cmd_checkbox;
188 NSButton *o_ctrl_checkbox;
189 NSButton *o_alt_checkbox;
190 NSButton *o_shift_checkbox;
191 NSPopUpButton *o_popup;
194 - (id) initWithItem: (module_config_t *)_p_item
195 withView: (NSView *)o_parent_view;
199 @interface KeyConfigControlAfter103 : VLCConfigControl
201 NSPopUpButton *o_popup;
204 - (id) initWithItem: (module_config_t *)_p_item
205 withView: (NSView *)o_parent_view;
209 @interface ModuleListConfigControl : VLCConfigControl
211 NSTextField *o_textfield;
212 NSScrollView *o_scrollview;
213 NSMutableArray *o_modulearray;
216 - (id) initWithItem: (module_config_t *)_p_item
217 withView: (NSView *)o_parent_view;
221 //#undef CONFIG_ITEM_LIST_STRING
222 //#undef CONFIG_ITEM_RANGED_INTEGER
223 //#undef CONFIG_ITEM_KEY_BEFORE_10_3
224 //#undef CONFIG_ITEM_KEY_AFTER_10_3