]> git.sesse.net Git - vlc/blob - projects/macosx/vlc_app/Sources/VLCAppAdditions.h
Rework of vout_OSDEpg.
[vlc] / projects / macosx / vlc_app / Sources / VLCAppAdditions.h
1 /*****************************************************************************
2  * VLCAppAdditions.m: Helpful additions to NS* classes
3  *****************************************************************************
4  * Copyright (C) 2007 Pierre d'Herbemont
5  * Copyright (C) 2007 the VideoLAN team
6  * $Id$
7  *
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>
11  *
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.
16  *
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.
21  *
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  *****************************************************************************/
26
27 #import <Cocoa/Cocoa.h>
28
29 /*****************************************************************************
30  * NSIndexPath (VLCAppAddition)
31  *****************************************************************************/
32 @interface NSIndexPath (VLCAppAddition)
33 - (NSIndexPath *)indexPathByRemovingFirstIndex;
34 - (NSUInteger)lastIndex;
35 @end
36
37 /*****************************************************************************
38  * NSArray (VLCAppAddition)
39  *****************************************************************************/
40 @interface NSArray (VLCAppAddition)
41 - (id)objectAtIndexPath:(NSIndexPath *)path withNodeKeyPath:(NSString *)nodeKeyPath;
42 @end
43
44 /*****************************************************************************
45  * NSView (VLCAppAdditions)
46  *****************************************************************************/
47 @interface NSView (VLCAppAdditions)
48 - (void)moveSubviewsToVisible;
49 @end
50
51 /*****************************************************************************
52  * VLCOneSplitView
53  *
54  *  Missing functionality to a one-split view
55  *****************************************************************************/
56 @interface VLCOneSplitView : NSSplitView
57 {
58 }
59 - (float)sliderPosition;
60 - (void)setSliderPosition:(float)newPosition;
61 @end
62
63 /*****************************************************************************
64  * NSScreen (VLCAdditions)
65  *
66  *  Missing extension to NSScreen
67  *****************************************************************************/
68
69 @interface NSScreen (VLCAdditions)
70
71 + (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID;
72 - (BOOL)isMainScreen;
73 - (BOOL)isScreen: (NSScreen*)screen;
74 - (CGDirectDisplayID)displayID;
75 - (void)blackoutOtherScreens;
76 + (void)unblackoutScreens;
77 @end
78
79 /*****************************************************************************
80  * VLCWindow
81  *
82  *  Missing extension to NSWindow (Used only when needing setCanBecomeKeyWindow)
83  *****************************************************************************/
84
85 @interface VLCWindow : NSWindow
86 {
87     BOOL canBecomeKeyWindow;
88     BOOL isset_canBecomeKeyWindow;
89 }
90 - (void)setCanBecomeKeyWindow: (BOOL)canBecomeKey;
91 @end
92
93
94 /*****************************************************************************
95  * VLCImageCustomizedSlider
96  *
97  *  Slider personalized by backgroundImage and knobImage
98  *****************************************************************************/
99
100 @interface VLCImageCustomizedSlider : NSSlider
101 {
102     NSImage * knobImage;
103     NSImage * backgroundImage;
104 }
105 @property (retain) NSImage * knobImage;
106 @property (retain) NSImage * backgroundImage;
107
108 - (void)drawKnobInRect: (NSRect)knobRect;
109 - (void)drawBackgroundInRect: (NSRect)knobRect;
110
111 - (void)drawRect: (NSRect)rect;
112 @end
113
114 /*****************************************************************************
115  * NSImageView (VLCAppAdditions)
116  *
117  *  Make the image view move the window by mouse down by default
118  *****************************************************************************/
119
120 @interface NSImageView (VLCAppAdditions)
121 - (BOOL)mouseDownCanMoveWindow;
122 @end
123
124 /*****************************************************************************
125  * NSImage (VLCAppAdditions)
126  *
127  *  Make the image view move the window by mouse down by default
128  *****************************************************************************/
129
130 @interface NSImage (VLCAppAdditions)
131 - (CGImageRef)CGImage;
132 @end