- (IBAction)showPosition: (id)sender
{
- vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
- FIND_ANYWHERE );
+ vout_thread_t *p_vout = input_GetVout( pl_CurrentInput( VLCIntf ));
if( p_vout != NULL )
{
- intf_thread_t * p_intf = VLCIntf;
- var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_POSITION );
+ var_SetInteger( VLCIntf->p_libvlc, "key-action", ACTIONID_POSITION );
vlc_object_release( (vlc_object_t *)p_vout );
}
}
{
NSString *o_title = [sender title];
- vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
- FIND_ANYWHERE );
+ vout_thread_t *p_vout = input_GetVout( pl_CurrentInput( VLCIntf ));
if( p_vout != NULL )
{
id o_vout_view = [self voutView];
if( key )
{
- vout_thread_t *p_vout = vlc_object_find( VLCIntf, VLC_OBJECT_VOUT,
- FIND_ANYWHERE );
+ vout_thread_t *p_vout = input_GetVout( pl_CurrentInput( VLCIntf ));
+
if( p_vout != NULL )
{
/* Escape */
NSEnumerator *o_enumerator = [o_windows objectEnumerator];
bEnabled = FALSE;
- vout_thread_t *p_vout = vlc_object_find( p_intf, VLC_OBJECT_VOUT,
- FIND_ANYWHERE );
+ vout_thread_t *p_vout = input_GetVout( pl_CurrentInput( VLCIntf ));
if( p_vout != NULL )
{
if( [[o_mi title] isEqualToString: _NS("Float on Top")] )
* Preamble
*****************************************************************************/
-/* DisableScreenUpdates, SetSystemUIMode, ... */
-#import <QuickTime/QuickTime.h>
-
#import "intf.h"
#import "controls.h"
#import "vout.h"
#import "fspanel.h"
#import "playlist.h"
+/* SetSystemUIMode, ... */
+#import <Carbon/Carbon.h>
+
/*****************************************************************************
* extension to NSWindow's interface to fix compilation warnings
* and let us access this functions properly
@implementation VLCEmbeddedWindow
+- (id)initWithContentRect:(NSRect)contentRect styleMask: (NSUInteger)windowStyle backing:(NSBackingStoreType)bufferingType defer:(BOOL)deferCreation
+{
+ BOOL b_useTextured = YES;
+ if( [[NSWindow class] instancesRespondToSelector:@selector(setContentBorderThickness:forEdge:)] )
+ {
+ b_useTextured = NO;
+ windowStyle ^= NSTexturedBackgroundWindowMask;
+ }
+ self = [super initWithContentRect:contentRect styleMask:windowStyle backing:bufferingType defer:deferCreation];
+ if(! b_useTextured )
+ {
+ [self setContentBorderThickness:28.0 forEdge:NSMinYEdge];
+ }
+ return self;
+}
+
- (void)awakeFromNib
{
[self setDelegate: self];
[o_btn_playlist setToolTip: _NS("Playlist")];
[self setTitle: _NS("VLC media player")];
- if(MACOS_VERSION < 10.5f) {
- o_img_play = [NSImage imageNamed: @"play"];
- o_img_pause = [NSImage imageNamed: @"pause"];
- [o_btn_play setImage: [NSImage imageNamed: @"play"]];
- }
- else {
- o_img_play = [NSImage imageNamed: @"play_big"];
- o_img_pause = [NSImage imageNamed: @"pause_big"];
- }
+ o_img_play = [NSImage imageNamed: @"play_big"];
+ o_img_pause = [NSImage imageNamed: @"pause_big"];
+
[self controlTintChanged];
[[NSNotificationCenter defaultCenter] addObserver: self
selector: @selector( controlTintChanged )
if( [o_btn_play alternateImage] == o_img_play_pressed )
b_playing = YES;
- if (MACOS_VERSION < 10.5f) {
- /* System is running Tiger and should use aqua buttons */
- [o_btn_backward setImage: [NSImage imageNamed: @"skip_previous_active"]];
- [o_btn_forward setImage: [NSImage imageNamed: @"skip_forward_active"]];
- if( [NSColor currentControlTint] == NSGraphiteControlTint )
- {
- o_img_play_pressed = [NSImage imageNamed: @"play_graphite"];
- o_img_pause_pressed = [NSImage imageNamed: @"pause_graphite"];
- [o_btn_backward setAlternateImage: [NSImage imageNamed: @"skip_previous_graphite"]];
- [o_btn_forward setAlternateImage: [NSImage imageNamed: @"skip_forward_graphite"]];
- }
- else
- {
- o_img_play_pressed = [NSImage imageNamed: @"play_blue"];
- o_img_pause_pressed = [NSImage imageNamed: @"pause_blue"];
- [o_btn_backward setAlternateImage: [NSImage imageNamed: @"skip_previous_blue"]];
- [o_btn_forward setAlternateImage: [NSImage imageNamed: @"skip_forward_blue"]];
- }
- }
- else{
- /* System is running Leopard or later and should use metal buttons */
- o_img_play_pressed = [NSImage imageNamed: @"play_big_down"];
- o_img_pause_pressed = [NSImage imageNamed: @"pause_big_down"];
- }
+ o_img_play_pressed = [NSImage imageNamed: @"play_big_down"];
+ o_img_pause_pressed = [NSImage imageNamed: @"pause_big_down"];
if( b_playing )
[o_btn_play setAlternateImage: o_img_play_pressed];
[o_fullscreen_window setBackgroundColor: [NSColor blackColor]];
[o_fullscreen_window setCanBecomeKeyWindow: YES];
- if (![self isVisible] || [self alphaValue] == 0.0 || MACOS_VERSION < 10.4f)
+ if (![self isVisible] || [self alphaValue] == 0.0)
{
- /* We don't animate if we are not visible or if we are running on
- * Mac OS X <10.4 which doesn't support NSAnimation, instead we
+ /* We don't animate if we are not visible, instead we
* simply fade the display */
CGDisplayFadeReservationToken token;
}
/* Make sure we don't see the o_view disappearing of the screen during this operation */
- DisableScreenUpdates();
+ NSDisableScreenUpdates();
[[self contentView] replaceSubview:o_view with:o_temp_view];
[o_temp_view setFrame:[o_view frame]];
[o_fullscreen_window setContentView:o_view];
[o_fullscreen_window makeKeyAndOrderFront:self];
- EnableScreenUpdates();
- }
-
- if (MACOS_VERSION < 10.4f)
- {
- /* We were already fullscreen nothing to do when NSAnimation
- * is not supported */
- [self unlockFullscreenAnimation];
- return;
+ NSEnableScreenUpdates();
}
/* We are in fullscreen (and no animation is running) */
return;
}
- if (fadeout || MACOS_VERSION < 10.4f)
+ if (fadeout)
{
- /* We don't animate if we are not visible or if we are running on
- * Mac OS X <10.4 which doesn't support NSAnimation, instead we
+ /* We don't animate if we are not visible, instead we
* simply fade the display */
CGDisplayFadeReservationToken token;
{
/* This function is private and should be only triggered at the end of the fullscreen change animation */
/* Make sure we don't see the o_view disappearing of the screen during this operation */
- DisableScreenUpdates();
+ NSDisableScreenUpdates();
[o_view retain];
[o_view removeFromSuperviewWithoutNeedingDisplay];
[[self contentView] replaceSubview:o_temp_view with:o_view];
if ([self isVisible])
[super makeKeyAndOrderFront:self]; /* our version contains a workaround */
[o_fullscreen_window orderOut: self];
- EnableScreenUpdates();
+ NSEnableScreenUpdates();
[o_fullscreen_window release];
o_fullscreen_window = nil;