Commit f1e8c225 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: added native fullscreen support for OS X Lion

parent 11b25c5b
......@@ -83,6 +83,7 @@ Interfaces:
* Mac OS X: new Track Synchronization panel
* Mac OS X: new Video Effects panel for color and geometry adjustments
* Mac OS X: re-written Open Disc functionality with automatic media detection
* Mac OS X: support for the native fullscreen mode on OS X Lion
* The rc and telnet lua interfaces were merged into a new "cli" interface
* dbus: Rewrite of the main loop to use a more efficient poll-based model
* dbus: Upgrade to an mpris2 compliant interface, see http://www.mpris.org
......@@ -99,6 +100,7 @@ Video Output:
chroma conversion
* New video output for Android platform, based on Surface
* Support for 9/10bits output in the OpenGL output
* Updated OpenGL video output for Mac, which requires a Quartz Extreme capable Mac
Audio Output:
* New audio output based on AudioQueue API for iOS
......
......@@ -102,6 +102,8 @@ static VLCAudioEffects *_o_sharedInstance = nil;
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"filter"]] setLabel:_NS("Filter")];
[o_window setTitle:_NS("Audio Effects")];
[o_window setExcludedFromWindowsMenu:YES];
if (NSAppKitVersionNumber >= 1115.2)
[o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[self setupEqualizer];
[self resetCompressor];
......
......@@ -278,14 +278,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
- (void)toggleFullscreen
{
input_thread_t * p_input = pl_CurrentInput( VLCIntf );
if( p_input != NULL )
{
playlist_t * p_playlist = pl_Get( VLCIntf );
var_ToggleBool( p_playlist, "fullscreen" );
vlc_object_release( p_input );
}
}
@end
......@@ -218,6 +218,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
o_temp_view = [[NSView alloc] init];
[o_temp_view setAutoresizingMask:NSViewHeightSizable | NSViewWidthSizable];
[o_dropzone_view setFrame: [o_playlist_table frame]];
if (NSAppKitVersionNumber >= 1115.2)
[self setCollectionBehavior: NSWindowCollectionBehaviorFullScreenPrimary];
/* create the sidebar */
o_sidebaritems = [[NSMutableArray alloc] init];
......@@ -803,7 +805,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
{
[o_video_view removeFromSuperviewWithoutNeedingDisplay];
[o_video_view setFrame: [o_split_view frame]];
[[self contentView] addSubview: o_video_view];
[[self contentView] addSubview:o_video_view positioned:NSWindowAbove relativeTo:nil];
}
b_nonembedded = NO;
}
......@@ -1313,8 +1315,6 @@ static VLCMainWindow *_o_sharedInstance = nil;
/* fullscreenAnimation will be unlocked when animation ends */
}
/* Make sure setFrame gets executed on main thread especially if we are animating.
* (Thus we won't block the video output thread) */
- (void)setFrame:(NSRect)frame display:(BOOL)display animate:(BOOL)animate
......
......@@ -61,6 +61,9 @@ static VLCTrackSynchronization *_o_sharedInstance = nil;
[o_sv_speed_lbl setStringValue: _NS("Speed of the subtitles:")];
[[o_sv_speed_value_fld formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("fps")]];
if (NSAppKitVersionNumber >= 1115.2)
[o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[self resetValues:self];
}
......
......@@ -60,6 +60,9 @@ static VLCVideoEffects *_o_sharedInstance = nil;
{
[o_window setTitle: _NS("Video Effects")];
[o_window setExcludedFromWindowsMenu:YES];
if (NSAppKitVersionNumber >= 1115.2)
[o_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"basic"]] setLabel:_NS("Basic")];
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"crop"]] setLabel:_NS("Crop")];
[[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"geometry"]] setLabel:_NS("Geometry")];
......
......@@ -67,6 +67,12 @@ static VLAboutBox *_o_sharedInstance = nil;
[super dealloc];
}
- (void)awakeFromNib
{
if (NSAppKitVersionNumber >= 1115.2)
[o_about_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
}
/*****************************************************************************
* VLC About Window
*****************************************************************************/
......
......@@ -71,6 +71,9 @@ static VLCBookmarks *_o_sharedInstance = nil;
- (void)awakeFromNib
{
if (NSAppKitVersionNumber >= 1115.2)
[o_bookmarks_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[self initStrings];
}
......
......@@ -49,6 +49,8 @@
[win setOpaque:NO];
[win setHasShadow: NO];
[win setBackgroundColor:[NSColor clearColor]];
if (NSAppKitVersionNumber >= 1115.2)
[win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
/* let the window sit on top of everything else and start out completely transparent */
[win setLevel:NSModalPanelWindowLevel];
......
......@@ -38,6 +38,7 @@
#include <Cocoa/Cocoa.h>
#import "SPMediaKeyTap.h" /* for the media key support */
#import "misc.h"
#import "MainWindow.h"
/*****************************************************************************
* Local prototypes.
......@@ -108,7 +109,7 @@ struct intf_sys_t
BOOL nib_bookmarks_loaded; /* Bookmarks nibfile */
BOOL b_active_videoplayback;
id o_mainwindow; /* VLCMainWindow */
VLCMainWindow *o_mainwindow; /* VLCMainWindow */
IBOutlet VLCControls * o_controls; /* VLCControls */
IBOutlet VLCPlaylist * o_playlist; /* VLCPlaylist */
......
......@@ -41,7 +41,6 @@
#import "intf.h"
#import "MainMenu.h"
#import "MainWindow.h"
#import "vout.h"
#import "prefs.h"
#import "playlist.h"
......@@ -260,7 +259,6 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var,
case INPUT_EVENT_ES:
break;
case INPUT_EVENT_TELETEXT:
NSLog( @"teletext" );
break;
case INPUT_EVENT_AOUT:
break;
......@@ -563,6 +561,9 @@ static VLCMain *_o_sharedMainInstance = nil;
var_AddCallback(p_playlist, "volume", VolumeUpdated, self);
var_AddCallback(p_playlist, "mute", VolumeUpdated, self);
if ([NSApp currentSystemPresentationOptions] == NSApplicationPresentationFullScreen)
var_SetBool( p_playlist, "fullscreen", YES );
/* load our Core Dialogs nib */
nib_coredialogs_loaded = [NSBundle loadNibNamed:@"CoreDialogs" owner: NSApp];
......@@ -1229,10 +1230,30 @@ unsigned int CocoaKeyToVLC( unichar i_key )
#pragma mark Interface updaters
- (void)fullscreenChanged
{
if(! [o_mainwindow isFullscreen] )
playlist_t * p_playlist = pl_Get( VLCIntf );
BOOL b_fullscreen = var_GetBool( p_playlist, "fullscreen" );
if (NSAppKitVersionNumber >= 1115.2)
{
[o_mainwindow toggleFullScreen: self];
if(b_fullscreen)
[NSApp setPresentationOptions:(NSApplicationPresentationFullScreen)];
else
[NSApp setPresentationOptions:(NSApplicationPresentationDefault)];
}
else
{
input_thread_t * p_input = pl_CurrentInput( VLCIntf );
if( p_input != NULL )
{
if(b_fullscreen)
[o_mainwindow performSelectorOnMainThread:@selector(enterFullscreen) withObject:nil waitUntilDone:NO];
else
[o_mainwindow performSelectorOnMainThread:@selector(leaveFullscreen) withObject:nil waitUntilDone:NO];
vlc_object_release( p_input );
}
}
}
- (void)PlaylistItemChanged
......
......@@ -104,6 +104,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
- (void)awakeFromNib
{
if (NSAppKitVersionNumber >= 1115.2)
[o_panel setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[o_panel setTitle: _NS("Open Source")];
[o_mrl_lbl setStringValue: _NS("Media Resource Locator (MRL)")];
......
......@@ -69,6 +69,8 @@ static VLCInfo *_o_sharedInstance = nil;
{
[o_info_window setExcludedFromWindowsMenu: YES];
[o_info_window setFloatingPanel: NO];
if (NSAppKitVersionNumber >= 1115.2)
[o_info_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[o_info_window setTitle: _NS("Media Information")];
[o_uri_lbl setStringValue: _NS("Location")];
......
......@@ -175,6 +175,9 @@ static VLCPrefs *_o_sharedMainInstance = nil;
{
p_intf = VLCIntf;
if (NSAppKitVersionNumber >= 1115.2)
[o_prefs_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[self initStrings];
[o_prefs_view setBorderType: NSGrooveBorder];
[o_prefs_view setHasVerticalScroller: YES];
......
......@@ -104,6 +104,9 @@ static VLCSimplePrefs *_o_sharedInstance = nil;
[o_sprefs_toolbar setDelegate: self];
[o_sprefs_win setToolbar: o_sprefs_toolbar];
if (NSAppKitVersionNumber >= 1115.2)
[o_sprefs_win setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
/* setup useful stuff */
o_hotkeysNonUseableKeys = [[NSArray arrayWithObjects: @"Command-c", @"Command-x", @"Command-v", @"Command-a", @"Command-," , @"Command-h", @"Command-Alt-h", @"Command-Shift-o", @"Command-o", @"Command-d", @"Command-n", @"Command-s", @"Command-z", @"Command-l", @"Command-r", @"Command-3", @"Command-m", @"Command-w", @"Command-Shift-w", @"Command-Shift-c", @"Command-Shift-p", @"Command-i", @"Command-e", @"Command-Shift-e", @"Command-b", @"Command-Shift-m", @"Command-Ctrl-m", @"Command-?", @"Command-Alt-?", nil] retain];
}
......
......@@ -71,6 +71,9 @@ static VLCWizard *_o_sharedInstance = nil;
- (void)awakeFromNib
{
if (NSAppKitVersionNumber >= 1115.2)
[o_wizard_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
/* some minor cleanup */
[o_t2_tbl_plst setEnabled:NO];
o_userSelections = [[NSMutableDictionary alloc] init];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment