]> git.sesse.net Git - vlc/blob - modules/gui/macosx/prefs_widgets.h
*: remove useless code
[vlc] / modules / gui / macosx / prefs_widgets.h
1 /*****************************************************************************
2  * prefs_widgets.h: Preferences controls
3  *****************************************************************************
4  * Copyright (C) 2002-2003 VideoLAN
5  * $Id$
6  *
7  * Authors: Derk-Jan Hartman <hartman at videolan.org> 
8  *
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.
13  * 
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.
18  *
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  *****************************************************************************/
23
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]
31
32 @interface VLCConfigControl : NSView
33 {
34     module_config_t *p_item;
35     char            *psz_name;
36     NSTextField     *o_label;
37     int             i_type;
38     int             i_view_type;
39     vlc_bool_t      b_advanced;
40 }
41
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;
46 - (int)getType;
47 - (int)getViewType;
48 - (BOOL)isAdvanced;
49 - (void)setYPos:(int)i_yPos;
50 - (int)intValue;
51 - (float)floatValue;
52 - (char *)stringValue;
53 - (void)applyChanges;
54 static NSMenu   *o_keys_menu = nil;
55
56 + (int)calcVerticalMargin: (int)i_curItem lastItem:(int)i_lastItem;
57
58 @end
59
60 @interface StringConfigControl : VLCConfigControl
61 {
62     NSTextField     *o_textfield;
63 }
64
65 - (id) initWithItem: (module_config_t *)_p_item
66            withView: (NSView *)o_parent_view;
67
68 @end
69
70 @interface StringListConfigControl : VLCConfigControl
71 {
72     NSComboBox      *o_combo;
73 }
74
75 - (id) initWithItem: (module_config_t *)_p_item
76            withView: (NSView *)o_parent_view;
77
78 @end
79
80 @interface FileConfigControl : VLCConfigControl
81 {
82     NSTextField     *o_textfield;
83     NSButton        *o_button;
84     BOOL            b_directory;
85 }
86
87 - (id) initWithItem: (module_config_t *)_p_item
88            withView: (NSView *)o_parent_view;
89
90 - (IBAction)openFileDialog: (id)sender;
91 - (void)pathChosenInPanel:(NSOpenPanel *)o_sheet withReturn:(int)i_return_code contextInfo:(void  *)o_context_info;
92
93 @end
94
95 @interface ModuleConfigControl : VLCConfigControl
96 {
97     NSPopUpButton   *o_popup;
98 }
99
100 - (id) initWithItem: (module_config_t *)_p_item
101            withView: (NSView *)o_parent_view;
102
103 @end
104
105 @interface IntegerConfigControl : VLCConfigControl
106 {
107     NSTextField     *o_textfield;
108     NSStepper       *o_stepper;
109 }
110
111
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;
116
117 @end
118
119 @interface IntegerListConfigControl : VLCConfigControl
120 {
121     NSComboBox      *o_combo;
122 }
123
124 - (id) initWithItem: (module_config_t *)_p_item
125            withView: (NSView *)o_parent_view;
126
127 @end
128
129 @interface RangedIntegerConfigControl : VLCConfigControl
130 {
131     NSSlider        *o_slider;
132     NSTextField     *o_textfield;
133     NSTextField     *o_textfield_min;
134     NSTextField     *o_textfield_max;
135 }
136
137
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;
142
143 @end
144
145 @interface BoolConfigControl : VLCConfigControl
146 {
147     NSButton        *o_checkbox;
148 }
149
150 - (id) initWithItem: (module_config_t *)_p_item
151            withView: (NSView *)o_parent_view;
152
153 @end
154
155 @interface FloatConfigControl : VLCConfigControl
156 {
157     NSTextField     *o_textfield;
158     NSStepper       *o_stepper;
159 }
160
161
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;
166
167 @end
168
169 @interface RangedFloatConfigControl : VLCConfigControl
170 {
171     NSSlider        *o_slider;
172     NSTextField     *o_textfield;
173     NSTextField     *o_textfield_min;
174     NSTextField     *o_textfield_max;
175 }
176
177
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;
182
183 @end
184
185 @interface KeyConfigControlBefore103 : VLCConfigControl
186 {
187     NSButton        *o_cmd_checkbox;
188     NSButton        *o_ctrl_checkbox;
189     NSButton        *o_alt_checkbox;
190     NSButton        *o_shift_checkbox;
191     NSPopUpButton   *o_popup;
192 }
193
194 - (id) initWithItem: (module_config_t *)_p_item
195            withView: (NSView *)o_parent_view;
196
197 @end
198
199 @interface KeyConfigControlAfter103 : VLCConfigControl
200 {
201     NSPopUpButton   *o_popup;
202 }
203
204 - (id) initWithItem: (module_config_t *)_p_item
205            withView: (NSView *)o_parent_view;
206
207 @end
208
209 @interface ModuleListConfigControl : VLCConfigControl
210 {
211     NSTextField     *o_textfield;
212     NSScrollView    *o_scrollview;
213     NSMutableArray  *o_modulearray;
214 }
215
216 - (id) initWithItem: (module_config_t *)_p_item
217            withView: (NSView *)o_parent_view;
218
219 @end
220
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
225