/*****************************************************************************
* 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"
/*****************************************************************************
- * NSImage (VLCAddition)
+ * 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 NSImage (VLCAdditions)
-+ (id)imageWithWarningIcon;
-+ (id)imageWithErrorIcon;
+@interface NSSound (VLCAdditions)
++ (float)systemVolumeForChannel:(int)channel;
++ (bool)setSystemVolume:(float)volume forChannel:(int)channel;
++ (void)increaseSystemVolume;
++ (void)decreaseSystemVolume;
@end
/*****************************************************************************
*****************************************************************************/
@interface NSAnimation (VLCAdditions)
-- (void)setUserInfo: (void *)userInfo;
-- (void *)userInfo;
+@property (readwrite) void * userInfo;
+
@end
/*****************************************************************************
@interface NSScreen (VLCAdditions)
+ (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID;
-- (BOOL)isMainScreen;
+- (BOOL)hasMenuBar;
+- (BOOL)hasDock;
- (BOOL)isScreen: (NSScreen*)screen;
- (CGDirectDisplayID)displayID;
- (void)blackoutOtherScreens;
+ (void)unblackoutScreens;
@end
+
/*****************************************************************************
- * VLCWindow
- *
- * Missing extension to NSWindow
+ * VLBrushedMetalImageView
*****************************************************************************/
-@interface VLCWindow : NSWindow
-{
- BOOL b_canBecomeKeyWindow;
- BOOL b_isset_canBecomeKeyWindow;
- NSViewAnimation *animation;
-}
+@interface VLBrushedMetalImageView : NSImageView
-- (void)setCanBecomeKeyWindow: (BOOL)canBecomeKey;
+@end
-/* 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;
+/*****************************************************************************
+ * MPSlider
+ *****************************************************************************/
-/* animate mode is only supported in >=10.4 */
-- (void)orderOut: (id)sender animate: (BOOL)animate callback:(NSInvocation *)callback;
+@interface MPSlider : NSSlider
-/* animate mode is only supported in >=10.4 */
-- (void)closeAndAnimate: (BOOL)animate;
@end
-
/*****************************************************************************
- * VLCControllerWindow
+ * ProgressView
*****************************************************************************/
+@interface VLCProgressView : NSView
-@interface VLCControllerWindow : NSWindow
-{
-}
+- (void)scrollWheel:(NSEvent *)o_event;
@end
+
/*****************************************************************************
- * VLCControllerView
+ * TimeLineSlider
*****************************************************************************/
-@interface VLCControllerView : NSView
+@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
/*****************************************************************************
- * VLBrushedMetalImageView
+ * VLCVolumeSliderCommon
*****************************************************************************/
-@interface VLBrushedMetalImageView : NSImageView
-{
+@interface VLCVolumeSliderCommon : NSSlider
-}
+- (void)scrollWheel:(NSEvent *)o_event;
@end
-
/*****************************************************************************
- * MPSlider
+ * ITSlider
*****************************************************************************/
-@interface MPSlider : NSSlider
+@interface ITSlider : VLCVolumeSliderCommon
{
+ NSImage *img;
+ NSRect image_rect;
}
+- (void)drawRect:(NSRect)rect;
+- (void)drawKnobInRect:(NSRect)knobRect;
+
@end
/*****************************************************************************
- * TimeLineSlider
+ * VLCTimeField interface
+ *****************************************************************************
+ * we need the implementation to catch our click-event in the controller window
*****************************************************************************/
-@interface TimeLineSlider : NSSlider
+@interface VLCTimeField : NSTextField
{
+ NSShadow * o_string_shadow;
+ NSDictionary * o_string_attributes_dict;
+ NSTextAlignment textAlignment;
}
+@property (readonly) BOOL timeRemaining;
+@end
-- (void)drawRect:(NSRect)rect;
-- (void)drawKnobInRect:(NSRect)knobRect;
+/*****************************************************************************
+ * VLCMainWindowSplitView interface
+ *****************************************************************************/
+@interface VLCMainWindowSplitView : NSSplitView
@end
/*****************************************************************************
- * ITSlider
+ * VLCThreePartImageView interface
*****************************************************************************/
-
-@interface ITSlider : NSSlider
+@interface VLCThreePartImageView : NSView
{
+ NSImage * o_left_img;
+ NSImage * o_middle_img;
+ NSImage * o_right_img;
}
-- (void)drawRect:(NSRect)rect;
-- (void)drawKnobInRect:(NSRect)knobRect;
-
+- (void)setImagesLeft:(NSImage *)left middle: (NSImage *)middle right:(NSImage *)right;
@end
/*****************************************************************************
- * VLCTimeField interface
- *****************************************************************************
- * we need the implementation to catch our click-event in the controller window
+ * VLCThreePartDropView interface
*****************************************************************************/
+@interface VLCThreePartDropView : VLCThreePartImageView
-@interface VLCTimeField : NSTextField
-{
-}
@end