2
2
* MainWindow.h: MacOS X interface module
3
3
*****************************************************************************
4
4
* Copyright (C) 2002-2012 VLC authors and VideoLAN
5
* $Id: 3473ef086cc3a473a27e139ed837ddf96b93a497 $
5
* $Id: 6e7e36f73986eac80931e803f1d899019577f3c0 $
7
7
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
8
8
* Jon Lech Johansen <jon-vl@nanocrew.net>
123
123
- (BOOL)performKeyEquivalent:(NSEvent *)o_event
125
126
// these are key events which should be handled by vlc core, but are attached to a main menu item
126
127
if( ![self isEvent: o_event forKey: "key-vol-up"] &&
127
128
![self isEvent: o_event forKey: "key-vol-down"] &&
132
133
if([[NSApp mainMenu] performKeyEquivalent:o_event])
136
return [[VLCMain sharedInstance] hasDefinedShortcutKey:o_event] ||
139
return [[VLCMain sharedInstance] hasDefinedShortcutKey:o_event force:b_force] ||
137
140
[(VLCControls *)[[VLCMain sharedInstance] controls] keyEvent:o_event];
1663
1666
if( new_frame.origin.y < screenFrame.origin.y )
1664
1667
new_frame.origin.y = screenFrame.origin.y;
1669
CGFloat right_screen_point = screenFrame.origin.x + screenFrame.size.width;
1670
CGFloat right_window_point = new_frame.origin.x + new_frame.size.width;
1671
if( right_window_point > right_screen_point )
1672
new_frame.origin.x -= ( right_window_point - right_screen_point );
1666
1674
[[o_videoWindow animator] setFrame:new_frame display:YES];
1738
1741
NSScreen *screen;
1739
1742
NSRect screen_rect;
1741
vout_thread_t *p_vout = getVout();
1742
1744
BOOL blackout_other_displays = config_GetInt( VLCIntf, "macosx-black" );
1743
1745
id o_videoWindow = b_nonembedded ? o_detached_video_window : self;
1746
screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)config_GetInt( VLCIntf, "macosx-vdev" )];
1747
screen = [NSScreen screenWithDisplayID:(CGDirectDisplayID)config_GetInt( VLCIntf, "macosx-vdev" )];
1748
1748
[self lockFullscreenAnimation];
2198
2195
- (void)windowDidEnterFullScreen:(NSNotification *)notification
2197
// Indeed, we somehow can have an "inactive" fullscreen (but a visible window!).
2198
// But this creates some problems when leaving fs over remote intfs, so activate app here.
2199
[NSApp activateIgnoringOtherApps:YES];
2200
2201
[o_fspanel setVoutWasUpdated: (int)[[self screen] displayID]];
2201
2202
[o_fspanel setActive: nil];
2551
#pragma mark Accessibility stuff
2553
- (NSArray *)accessibilityAttributeNames
2555
if( !b_dark_interface )
2556
return [super accessibilityAttributeNames];
2558
static NSMutableArray *attributes = nil;
2559
if ( attributes == nil ) {
2560
attributes = [[super accessibilityAttributeNames] mutableCopy];
2561
NSArray *appendAttributes = [NSArray arrayWithObjects: NSAccessibilitySubroleAttribute,
2562
NSAccessibilityCloseButtonAttribute,
2563
NSAccessibilityMinimizeButtonAttribute,
2564
NSAccessibilityZoomButtonAttribute,
2567
for( NSString *attribute in appendAttributes )
2569
if( ![attributes containsObject:attribute] )
2570
[attributes addObject:attribute];
2576
- (id)accessibilityAttributeValue: (NSString*)o_attribute_name
2578
if( b_dark_interface )
2580
VLCMainWindowTitleView *o_tbv = o_titlebar_view;
2582
if( [o_attribute_name isEqualTo: NSAccessibilitySubroleAttribute] )
2583
return NSAccessibilityStandardWindowSubrole;
2585
if( [o_attribute_name isEqualTo: NSAccessibilityCloseButtonAttribute] )
2586
return [[o_tbv closeButton] cell];
2588
if( [o_attribute_name isEqualTo: NSAccessibilityMinimizeButtonAttribute] )
2589
return [[o_tbv minimizeButton] cell];
2591
if( [o_attribute_name isEqualTo: NSAccessibilityZoomButtonAttribute] )
2592
return [[o_tbv zoomButton] cell];
2595
return [super accessibilityAttributeValue: o_attribute_name];
2598
- (id)detachedTitlebarView
2600
return o_detached_titlebar_view;
2550
2604
@implementation VLCDetachedVideoWindow
2755
2804
[self setFrame: maxRect display: YES animate: YES];
2807
- (NSArray *)accessibilityAttributeNames
2809
if( !b_dark_interface )
2810
return [super accessibilityAttributeNames];
2812
static NSMutableArray *attributes = nil;
2813
if ( attributes == nil ) {
2814
attributes = [[super accessibilityAttributeNames] mutableCopy];
2815
NSArray *appendAttributes = [NSArray arrayWithObjects: NSAccessibilitySubroleAttribute,
2816
NSAccessibilityCloseButtonAttribute,
2817
NSAccessibilityMinimizeButtonAttribute,
2818
NSAccessibilityZoomButtonAttribute,
2821
for( NSString *attribute in appendAttributes )
2823
if( ![attributes containsObject:attribute] )
2824
[attributes addObject:attribute];
2830
- (id)accessibilityAttributeValue: (NSString*)o_attribute_name
2832
if( b_dark_interface )
2834
VLCMainWindowTitleView *o_tbv = [[VLCMainWindow sharedInstance] detachedTitlebarView];
2836
if( [o_attribute_name isEqualTo: NSAccessibilitySubroleAttribute] )
2837
return NSAccessibilityStandardWindowSubrole;
2839
if( [o_attribute_name isEqualTo: NSAccessibilityCloseButtonAttribute] )
2840
return [[o_tbv closeButton] cell];
2842
if( [o_attribute_name isEqualTo: NSAccessibilityMinimizeButtonAttribute] )
2843
return [[o_tbv minimizeButton] cell];
2845
if( [o_attribute_name isEqualTo: NSAccessibilityZoomButtonAttribute] )
2846
return [[o_tbv zoomButton] cell];
2849
return [super accessibilityAttributeValue: o_attribute_name];