1 /*****************************************************************************
2 * VLCAppAdditions.m: Helpful additions to NS* classes
3 *****************************************************************************
4 * Copyright (C) 2007 Pierre d'Herbemont
5 * Copyright (C) 2007 the VideoLAN team
8 * Authors: Pierre d'Herbemont <pdherbemont # videolan.org>
9 * Felix Kühne <fkuehne at videolan dot org>
10 * Jérôme Decoodt <djc at videolan dot org>
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
25 *****************************************************************************/
27 #import <Cocoa/Cocoa.h>
29 /*****************************************************************************
30 * NSIndexPath (VLCAppAddition)
31 *****************************************************************************/
32 @interface NSIndexPath (VLCAppAddition)
33 - (NSIndexPath *)indexPathByRemovingFirstIndex;
34 - (NSUInteger)lastIndex;
37 /*****************************************************************************
38 * NSArray (VLCAppAddition)
39 *****************************************************************************/
40 @interface NSArray (VLCAppAddition)
41 - (id)objectAtIndexPath:(NSIndexPath *)path withNodeKeyPath:(NSString *)nodeKeyPath;
44 /*****************************************************************************
45 * NSView (VLCAppAdditions)
46 *****************************************************************************/
47 @interface NSView (VLCAppAdditions)
48 - (void)moveSubviewsToVisible;
51 /*****************************************************************************
54 * Missing functionality to a one-split view
55 *****************************************************************************/
56 @interface VLCOneSplitView : NSSplitView
59 - (float)sliderPosition;
60 - (void)setSliderPosition:(float)newPosition;
63 /*****************************************************************************
64 * NSScreen (VLCAdditions)
66 * Missing extension to NSScreen
67 *****************************************************************************/
69 @interface NSScreen (VLCAdditions)
71 + (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID;
73 - (BOOL)isScreen: (NSScreen*)screen;
74 - (CGDirectDisplayID)displayID;
75 - (void)blackoutOtherScreens;
76 + (void)unblackoutScreens;
79 /*****************************************************************************
82 * Missing extension to NSWindow (Used only when needing setCanBecomeKeyWindow)
83 *****************************************************************************/
85 @interface VLCWindow : NSWindow
87 BOOL canBecomeKeyWindow;
88 BOOL isset_canBecomeKeyWindow;
90 - (void)setCanBecomeKeyWindow: (BOOL)canBecomeKey;
94 /*****************************************************************************
95 * VLCImageCustomizedSlider
97 * Slider personalized by backgroundImage and knobImage
98 *****************************************************************************/
100 @interface VLCImageCustomizedSlider : NSSlider
103 NSImage * backgroundImage;
105 @property (retain) NSImage * knobImage;
106 @property (retain) NSImage * backgroundImage;
108 - (void)drawKnobInRect: (NSRect)knobRect;
109 - (void)drawBackgroundInRect: (NSRect)knobRect;
111 - (void)drawRect: (NSRect)rect;
114 /*****************************************************************************
115 * NSImageView (VLCAppAdditions)
117 * Make the image view move the window by mouse down by default
118 *****************************************************************************/
120 @interface NSImageView (VLCAppAdditions)
121 - (BOOL)mouseDownCanMoveWindow;
124 /*****************************************************************************
125 * NSImage (VLCAppAdditions)
127 * Make the image view move the window by mouse down by default
128 *****************************************************************************/
130 @interface NSImage (VLCAppAdditions)
131 - (CGImageRef)CGImage;