]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/misc.h
macosx: create new classes for all controls bar related code
[vlc] / modules / gui / macosx / misc.h
index 0a657b6df12c247a5febd853b9b47d273b487d7b..3520d3cde93dc2d7067e2948ba3f4dbec868bce9 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * misc.h: code not specific to vlc
  *****************************************************************************
- * Copyright (C) 2003-2011 the VideoLAN team
+ * Copyright (C) 2003-2012 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *****************************************************************************/
 
 #import <Cocoa/Cocoa.h>
-#import <ApplicationServices/ApplicationServices.h>
+#import "CompatibilityFixes.h"
 
-#ifndef MAC_OS_X_VERSION_10_6
-@protocol NSWindowDelegate <NSObject> @end
-NSUInteger NSApplicationPresentationAutoHideDock;
-NSUInteger NSApplicationPresentationAutoHideMenuBar;
-NSUInteger NSApplicationPresentationDefault;
-#endif
+/*****************************************************************************
+ * NSSound (VLCAdditions)
+ *
+ * added code to change the system volume, needed for the apple remote code
+ * this is simplified code, which won't let you set the exact volume
+ * (that's what the audio output is for after all), but just the system volume
+ * in steps of 1/16 (matching the default AR or volume key implementation).
+ *****************************************************************************/
+
+@interface NSSound (VLCAdditions)
++ (float)systemVolumeForChannel:(int)channel;
++ (bool)setSystemVolume:(float)volume forChannel:(int)channel;
++ (void)increaseSystemVolume;
++ (void)decreaseSystemVolume;
+@end
 
 /*****************************************************************************
  * NSAnimation (VLCAddition)
  *****************************************************************************/
 
 @interface NSAnimation (VLCAdditions)
-- (void)setUserInfo: (void *)userInfo;
-- (void *)userInfo;
+@property (readwrite) void * userInfo;
+
 @end
 
 /*****************************************************************************
@@ -49,85 +58,68 @@ NSUInteger NSApplicationPresentationDefault;
 
 @interface NSScreen (VLCAdditions)
 
+@property (readonly) BOOL mainScreen;
+
 + (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID;
-- (BOOL)isMainScreen;
 - (BOOL)isScreen: (NSScreen*)screen;
 - (CGDirectDisplayID)displayID;
 - (void)blackoutOtherScreens;
 + (void)unblackoutScreens;
 @end
 
+
 /*****************************************************************************
- * VLCWindow
- *
- *  Missing extension to NSWindow
+ * VLBrushedMetalImageView
  *****************************************************************************/
 
-@interface VLCWindow : NSWindow <NSWindowDelegate>
-{
-    BOOL b_canBecomeKeyWindow;
-    BOOL b_isset_canBecomeKeyWindow;
-    NSViewAnimation *animation;
-}
-
-- (void)setCanBecomeKeyWindow: (BOOL)canBecomeKey;
-
-/* animate mode is only supported in >=10.4 */
-- (void)orderFront: (id)sender animate: (BOOL)animate;
-
-/* animate mode is only supported in >=10.4 */
-- (void)orderOut: (id)sender animate: (BOOL)animate;
-
-/* animate mode is only supported in >=10.4 */
-- (void)orderOut: (id)sender animate: (BOOL)animate callback:(NSInvocation *)callback;
+@interface VLBrushedMetalImageView : NSImageView
 
-/* animate mode is only supported in >=10.4 */
-- (void)closeAndAnimate: (BOOL)animate;
 @end
 
 
 /*****************************************************************************
- * VLCControllerView
+ * MPSlider
  *****************************************************************************/
 
-@interface VLCControllerView : NSView
-{
-}
+@interface MPSlider : NSSlider
 
 @end
 
 /*****************************************************************************
- * VLBrushedMetalImageView
+ * ProgressView
  *****************************************************************************/
 
-@interface VLBrushedMetalImageView : NSImageView
-{
+@interface VLCProgressView : NSView
 
-}
+- (void)scrollWheel:(NSEvent *)o_event;
 
 @end
 
 
 /*****************************************************************************
- * MPSlider
+ * TimeLineSlider
  *****************************************************************************/
 
-@interface MPSlider : NSSlider
+@interface TimeLineSlider : NSSlider
 {
+    NSImage *o_knob_img;
+    NSRect img_rect;
+    BOOL b_dark;
 }
+@property (readonly) CGFloat knobPosition;
+
+- (void)drawRect:(NSRect)rect;
+- (void)drawKnobInRect:(NSRect)knobRect;
 
 @end
 
 /*****************************************************************************
- * TimeLineSlider
+ * VLCVolumeSliderCommon
  *****************************************************************************/
 
-@interface TimeLineSlider : NSSlider
-{
-}
+@interface VLCVolumeSliderCommon : NSSlider
 
-- (void)drawRect:(NSRect)rect;
-- (void)drawKnobInRect:(NSRect)knobRect;
+- (void)scrollWheel:(NSEvent *)o_event;
 
 @end
 
@@ -135,8 +127,10 @@ NSUInteger NSApplicationPresentationDefault;
  * ITSlider
  *****************************************************************************/
 
-@interface ITSlider : NSSlider
+@interface ITSlider : VLCVolumeSliderCommon
 {
+    NSImage *img;
+    NSRect image_rect;
 }
 
 - (void)drawRect:(NSRect)rect;
@@ -152,6 +146,36 @@ NSUInteger NSApplicationPresentationDefault;
 
 @interface VLCTimeField : NSTextField
 {
+    NSShadow * o_string_shadow;
+    NSDictionary * o_string_attributes_dict;
+    NSTextAlignment textAlignment;
 }
-- (BOOL)timeRemaining;
+@property (readonly) BOOL timeRemaining;
+@end
+
+/*****************************************************************************
+ * VLCMainWindowSplitView interface
+ *****************************************************************************/
+@interface VLCMainWindowSplitView : NSSplitView
+
+@end
+
+/*****************************************************************************
+ * VLCThreePartImageView interface
+ *****************************************************************************/
+@interface VLCThreePartImageView : NSView
+{
+    NSImage * o_left_img;
+    NSImage * o_middle_img;
+    NSImage * o_right_img;
+}
+
+- (void)setImagesLeft:(NSImage *)left middle: (NSImage *)middle right:(NSImage *)right;
+@end
+
+/*****************************************************************************
+ * VLCThreePartDropView interface
+ *****************************************************************************/
+@interface VLCThreePartDropView : VLCThreePartImageView
+
 @end