X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=projects%2Fmacosx%2Fvlc_app%2FSources%2FVLCAppAdditions.h;fp=projects%2Fmacosx%2Fvlc_app%2FSources%2FVLCAppAdditions.h;h=758c44a97608a247f1a9357645e6d4840b488956;hb=b3372f1fd0cd732b956eeb545bd40873af6fc42a;hp=0000000000000000000000000000000000000000;hpb=2e888fde246ecb0d346ecc02e7df0c82724f02b9;p=vlc diff --git a/projects/macosx/vlc_app/Sources/VLCAppAdditions.h b/projects/macosx/vlc_app/Sources/VLCAppAdditions.h new file mode 100644 index 0000000000..758c44a976 --- /dev/null +++ b/projects/macosx/vlc_app/Sources/VLCAppAdditions.h @@ -0,0 +1,124 @@ +/***************************************************************************** + * VLCAppAdditions.m: Helpful additions to NS* classes + ***************************************************************************** + * Copyright (C) 2007 Pierre d'Herbemont + * Copyright (C) 2007 the VideoLAN team + * $Id$ + * + * Authors: Pierre d'Herbemont + * Felix Kühne + * Jérôme Decoodt + * + * 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 + * GNU General Public License for more details. + * + * 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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. + *****************************************************************************/ + +#import + +/***************************************************************************** + * NSIndexPath (VLCAppAddition) + *****************************************************************************/ +@interface NSIndexPath (VLCAppAddition) +- (NSIndexPath *)indexPathByRemovingFirstIndex; +- (NSUInteger)lastIndex; +@end + +/***************************************************************************** + * NSArray (VLCAppAddition) + *****************************************************************************/ +@interface NSArray (VLCAppAddition) +- (id)objectAtIndexPath:(NSIndexPath *)path withNodeKeyPath:(NSString *)nodeKeyPath; +@end + +/***************************************************************************** + * NSView (VLCAppAdditions) + *****************************************************************************/ +@interface NSView (VLCAppAdditions) +- (void)moveSubviewsToVisible; +@end + +/***************************************************************************** + * VLCOneSplitView + * + * Missing functionality to a one-split view + *****************************************************************************/ +@interface VLCOneSplitView : NSSplitView +{ + BOOL fixedCursorDuringResize; +} +@property (assign) BOOL fixedCursorDuringResize; +- (float)sliderPosition; +- (void)setSliderPosition:(float)newPosition; +@end + +/***************************************************************************** + * NSScreen (VLCAdditions) + * + * Missing extension to NSScreen + *****************************************************************************/ + +@interface NSScreen (VLCAdditions) + ++ (NSScreen *)screenWithDisplayID: (CGDirectDisplayID)displayID; +- (BOOL)isMainScreen; +- (BOOL)isScreen: (NSScreen*)screen; +- (CGDirectDisplayID)displayID; +- (void)blackoutOtherScreens; ++ (void)unblackoutScreens; +@end + +/***************************************************************************** + * VLCWindow + * + * Missing extension to NSWindow (Used only when needing setCanBecomeKeyWindow) + *****************************************************************************/ + +@interface VLCWindow : NSWindow +{ + BOOL canBecomeKeyWindow; + BOOL isset_canBecomeKeyWindow; +} +- (void)setCanBecomeKeyWindow: (BOOL)canBecomeKey; +@end + + +/***************************************************************************** + * VLCImageCustomizedSlider + * + * Slider personalized by backgroundImage and knobImage + *****************************************************************************/ + +@interface VLCImageCustomizedSlider : NSSlider +{ + NSImage * knobImage; + NSImage * backgroundImage; +} +@property (retain) NSImage * knobImage; +@property (retain) NSImage * backgroundImage; + +- (void)drawKnobInRect: (NSRect)knobRect; +- (void)drawBackgroundInRect: (NSRect)knobRect; + +- (void)drawRect: (NSRect)rect; +@end + +/***************************************************************************** + * NSImageView (VLCAppAdditions) + * + * Make the image view move the window by mouse down by default + *****************************************************************************/ + +@interface NSImageView (VLCAppAdditions) +- (BOOL)mouseDownCanMoveWindow; +@end