]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/prefs_widgets.h
macosx: fill the side bar with SDs, etc.
[vlc] / modules / gui / macosx / prefs_widgets.h
index f1c1ef0005c54eb34852fc00591955e7d4928fb9..0dc983c33d3f174169c45c6b9f4466e9e0c6a4cc 100644 (file)
@@ -1,16 +1,16 @@
 /*****************************************************************************
  * prefs_widgets.h: Preferences controls
  *****************************************************************************
- * Copyright (C) 2002-2003 VideoLAN
+ * Copyright (C) 2002-2007 the VideoLAN team
  * $Id$
  *
- * Authors: Derk-Jan Hartman <hartman at videolan.org> 
+ * Authors: Derk-Jan Hartman <hartman at videolan.org>
  *
  * 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
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, 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)
-#define MACOS_VERSION [[[NSDictionary dictionaryWithContentsOfFile: \
-            @"/System/Library/CoreServices/SystemVersion.plist"] \
-            objectForKey: @"ProductVersion"] floatValue]
+#define CONFIG_ITEM_STRING_LIST (CONFIG_ITEM_STRING + 10)
+#define CONFIG_ITEM_RANGED_INTEGER (CONFIG_ITEM_INTEGER + 10)
+#define LEFTMARGIN  18
+#define RIGHTMARGIN 18
+
+#ifndef MAC_OS_X_VERSION_10_6
+@protocol NSComboBoxDataSource <NSObject> @end
+@protocol NSTextFieldDelegate <NSObject> @end
+#endif
+
+static NSMenu   *o_keys_menu = nil;
 
 @interface VLCConfigControl : NSView
 {
     NSTextField     *o_label;
     int             i_type;
     int             i_view_type;
-    vlc_bool_t      b_advanced;
+    bool      b_advanced;
 }
 
 + (VLCConfigControl *)newControl: (module_config_t *)_p_item
         withView: (NSView *)o_parent_view;
 - (id)initWithFrame: (NSRect)frame item: (module_config_t *)p_item;
-- (NSString *)getName;
-- (int)getType;
-- (int)getViewType;
+- (NSString *)name;
+- (int)type;
+- (int)viewType;
 - (BOOL)isAdvanced;
 - (void)setYPos:(int)i_yPos;
 - (int)intValue;
 - (float)floatValue;
 - (char *)stringValue;
 - (void)applyChanges;
-static NSMenu   *o_keys_menu = nil;
+- (void)resetValues;
+- (int)labelSize;
+- (void) alignWithXPosition:(int)i_xPos;
 
 + (int)calcVerticalMargin: (int)i_curItem lastItem:(int)i_lastItem;
 
@@ -67,7 +73,7 @@ static NSMenu   *o_keys_menu = nil;
 
 @end
 
-@interface StringListConfigControl : VLCConfigControl
+@interface StringListConfigControl : VLCConfigControl <NSComboBoxDataSource>
 {
     NSComboBox      *o_combo;
 }
@@ -102,7 +108,7 @@ static NSMenu   *o_keys_menu = nil;
 
 @end
 
-@interface IntegerConfigControl : VLCConfigControl
+@interface IntegerConfigControl : VLCConfigControl <NSTextFieldDelegate>
 {
     NSTextField     *o_textfield;
     NSStepper       *o_stepper;
@@ -116,7 +122,7 @@ static NSMenu   *o_keys_menu = nil;
 
 @end
 
-@interface IntegerListConfigControl : VLCConfigControl
+@interface IntegerListConfigControl : VLCConfigControl <NSComboBoxDataSource>
 {
     NSComboBox      *o_combo;
 }
@@ -126,7 +132,7 @@ static NSMenu   *o_keys_menu = nil;
 
 @end
 
-@interface RangedIntegerConfigControl : VLCConfigControl
+@interface RangedIntegerConfigControl : VLCConfigControl <NSTextFieldDelegate>
 {
     NSSlider        *o_slider;
     NSTextField     *o_textfield;
@@ -152,7 +158,7 @@ static NSMenu   *o_keys_menu = nil;
 
 @end
 
-@interface FloatConfigControl : VLCConfigControl
+@interface FloatConfigControl : VLCConfigControl <NSTextFieldDelegate>
 {
     NSTextField     *o_textfield;
     NSStepper       *o_stepper;
@@ -166,7 +172,7 @@ static NSMenu   *o_keys_menu = nil;
 
 @end
 
-@interface RangedFloatConfigControl : VLCConfigControl
+@interface RangedFloatConfigControl : VLCConfigControl <NSTextFieldDelegate>
 {
     NSSlider        *o_slider;
     NSTextField     *o_textfield;
@@ -182,21 +188,7 @@ static NSMenu   *o_keys_menu = nil;
 
 @end
 
-@interface KeyConfigControlBefore103 : VLCConfigControl
-{
-    NSButton        *o_cmd_checkbox;
-    NSButton        *o_ctrl_checkbox;
-    NSButton        *o_alt_checkbox;
-    NSButton        *o_shift_checkbox;
-    NSPopUpButton   *o_popup;
-}
-
-- (id) initWithItem: (module_config_t *)_p_item
-           withView: (NSView *)o_parent_view;
-
-@end
-
-@interface KeyConfigControlAfter103 : VLCConfigControl
+@interface KeyConfigControl : VLCConfigControl
 {
     NSPopUpButton   *o_popup;
 }
@@ -206,7 +198,7 @@ static NSMenu   *o_keys_menu = nil;
 
 @end
 
-@interface ModuleListConfigControl : VLCConfigControl
+@interface ModuleListConfigControl : VLCConfigControl <NSTableViewDataSource>
 {
     NSTextField     *o_textfield;
     NSScrollView    *o_scrollview;
@@ -220,6 +212,4 @@ static NSMenu   *o_keys_menu = nil;
 
 //#undef CONFIG_ITEM_LIST_STRING
 //#undef CONFIG_ITEM_RANGED_INTEGER
-//#undef CONFIG_ITEM_KEY_BEFORE_10_3
-//#undef CONFIG_ITEM_KEY_AFTER_10_3