Commit 0cdef305 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: re-implemented VLCVoutView and removed dead or outdated code

parent e3a1b511
......@@ -70,10 +70,8 @@ contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2:
(cd build-src && rm -rf *gecko* && $(MAKE) .gecko)
# libiconv.la is no longer present on Snow Leopard, so fix possible references to it, which would
# result in linking issues
ifdef HAVE_MACOSX_DARWIN_10
(cd $(PREFIX)/lib && sed -e 's%/usr/lib/libiconv.la%$(PREFIX)/lib/libiconv.la%g' -i.orig *.la && rm -f *.la.orig)
(cd build-src && rm -f .iconv && $(MAKE) .iconv-from-os)
endif
touch .$(CONTRIBREV)
using-bin: .$(CONTRIBREV)
......
......@@ -2,9 +2,9 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data>
<int key="IBDocument.SystemTarget">1040</int>
<string key="IBDocument.SystemVersion">11C26</string>
<string key="IBDocument.SystemVersion">11A511</string>
<string key="IBDocument.InterfaceBuilderVersion">851</string>
<string key="IBDocument.AppKitVersion">1138.11</string>
<string key="IBDocument.AppKitVersion">1138</string>
<string key="IBDocument.HIToolboxVersion">566.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -21,14 +21,14 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1617"/>
<integer value="2730"/>
<integer value="4682"/>
<integer value="4596"/>
<integer value="915"/>
<integer value="334"/>
<integer value="283"/>
<integer value="1617"/>
<integer value="2730"/>
<integer value="4722"/>
<integer value="283"/>
<integer value="2"/>
<integer value="334"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -1217,7 +1217,7 @@
<bool key="CIEnabled">YES</bool>
</object>
<int key="NSViewLayerContentsRedrawPolicy">2</int>
<string key="NSClassName">NSView</string>
<string key="NSClassName">VLCVoutView</string>
</object>
</object>
<string key="NSFrameSize">{604, 310}</string>
......@@ -16238,6 +16238,25 @@ LCAuLi4</string>
<string key="superclassName">NSView</string>
<reference key="sourceIdentifier" ref="736371707"/>
</object>
<object class="IBPartialClassDescription">
<string key="className">VLCVoutView</string>
<string key="superclassName">NSView</string>
<object class="NSMutableDictionary" key="outlets">
<string key="NS.key.0">o_window</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
<string key="NS.key.0">o_window</string>
<object class="IBToOneOutletInfo" key="NS.object.0">
<string key="name">o_window</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBDocumentRelativeSource</string>
<string key="minorKey">../../../../../modules/gui/macosx/vout.h</string>
</object>
</object>
</object>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool>
......
......@@ -56,5 +56,4 @@
- (void)setAspectRatioLocked:(BOOL)b_value;
- (BOOL)aspectRatioIsLocked;
- (void)toggleFullscreen;
- (id)voutView;
@end
......@@ -23,7 +23,6 @@
#import "CoreInteraction.h"
#import "intf.h"
#import "vout.h"
#import "open.h"
#import <vlc_playlist.h>
#import <vlc_input.h>
......@@ -93,9 +92,6 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
- (void)stop
{
var_SetInteger( VLCIntf->p_libvlc, "key-action", ACTIONID_STOP );
/* Close the window directly, because we do know that there
* won't be anymore video. It's currently waiting a bit. */
[[[self voutView] window] orderOut:self];
}
- (void)faster
......@@ -270,26 +266,4 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
vlc_object_release( p_input );
}
}
- (id)voutView
{
id o_window;
id o_voutView = nil;
id o_embeddedViewList = [[VLCMain sharedInstance] embeddedList];
NSEnumerator *o_enumerator = [[NSApp orderedWindows] objectEnumerator];
while( !o_voutView && ( o_window = [o_enumerator nextObject] ) )
{
/* We have an embedded vout */
if( [o_embeddedViewList windowContainsEmbedded: o_window] )
{
o_voutView = [o_embeddedViewList viewForWindow: o_window];
}
/* We have a detached vout */
else if( [[o_window className] isEqualToString: @"VLCVoutWindow"] )
{
o_voutView = [o_window voutView];
}
}
return [[o_voutView retain] autorelease];
}
@end
......@@ -251,6 +251,7 @@
var:(const char *)psz_variable
selector:(SEL)pf_callback;
- (id)voutMenu;
@end
/*****************************************************************************
......
......@@ -623,6 +623,11 @@ static VLCMainMenu *_o_sharedInstance = nil;
}
}
- (id)voutMenu
{
return o_vout_menu;
}
#pragma mark -
#pragma mark Panels
......@@ -1204,8 +1209,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
{
if( [o_title isEqualToString: _NS("Float on Top")] )
{
var_Get( p_vout, "video-on-top", &val );
[o_mi setState: val.b_bool ? NSOnState : NSOffState];
[o_mi setState: var_GetBool( p_vout, "video-on-top" )];
}
bEnabled = TRUE;
......@@ -1215,8 +1219,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
}
if( [o_title isEqualToString: _NS("Fullscreen")] )
{
var_Get( p_playlist, "fullscreen", &val );
[o_mi setState: val.b_bool];
[o_mi setState: var_GetBool( p_playlist, "fullscreen" )];
bEnabled = TRUE;
}
[self setupMenus]; /* Make sure video menu is up to date */
......
......@@ -157,6 +157,8 @@
- (void)hasBecomeFullscreen;
- (void)setFrameOnMainThread:(NSData*)packedargs;
- (id)fspanel;
@end
@interface VLCProgressBarGradientEffect : NSView {
......
......@@ -646,8 +646,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
int i_volume_step = 0;
i_volume_step = config_GetInt( VLCIntf->p_libvlc, "volume-step" );
[o_volume_sld setFloatValue: (float)i_lastShownVolume / i_volume_step];
if ([o_fspanel respondsToSelector:@selector(setVolumeLevel:)])
[o_fspanel setVolumeLevel: (float)i_lastShownVolume / i_volume_step];
// if ([o_fspanel respondsToSelector:@selector(setVolumeLevel:)])
// [o_fspanel setVolumeLevel: (float)i_lastShownVolume / i_volume_step];
}
}
......@@ -1292,6 +1292,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
}
}
- (id)fspanel
{
return o_fspanel;
}
#pragma mark -
#pragma mark Side Bar Data handling
......
......@@ -166,19 +166,6 @@
}
}
- (IBAction)toogleFullscreen:(id)sender {
[[VLCCoreInteraction sharedInstance] toggleFullscreen];
}
- (BOOL) isFullscreen {
id o_vout_view = [[VLCCoreInteraction sharedInstance] voutView];
if( o_vout_view )
{
return [o_vout_view isFullscreen];
}
return NO;
}
- (IBAction)telxTransparent:(id)sender
{
vlc_object_t *p_vbi;
......@@ -329,13 +316,16 @@
/* Escape */
if( key == (unichar) 0x1b )
{
id o_vout_view = [[VLCCoreInteraction sharedInstance] voutView];
if( o_vout_view && [o_vout_view isFullscreen] )
vout_thread_t *p_vout = getVout();
if (p_vout)
{
if (var_GetBool( p_vout, "fullscreen" ))
{
[o_vout_view toggleFullscreen];
[[VLCCoreInteraction sharedInstance] toggleFullscreen];
eventHandled = YES;
}
}
}
else if( key == ' ' )
{
[self play:self];
......
......@@ -38,6 +38,8 @@
/* SetSystemUIMode, ... */
#import <Carbon/Carbon.h>
#if 0
/*****************************************************************************
* VLCEmbeddedWindow Implementation
*****************************************************************************/
......@@ -1006,3 +1008,5 @@
NSRectFill(divider);*/
}
@end
#endif
......@@ -178,13 +178,15 @@
- (void)setActive:(id)noData
{
if( [[VLCCoreInteraction sharedInstance] voutView] != nil )
vout_thread_t *p_vout = getVout();
if (p_vout)
{
if( [[[VLCCoreInteraction sharedInstance] voutView] isFullscreen] )
if (var_GetBool( p_vout, "fullscreen" ))
{
b_nonActive = NO;
[self fadeIn];
}
vlc_object_release( p_vout );
}
}
......@@ -247,8 +249,13 @@
- (void)mouseExited:(NSEvent *)theEvent
{
/* give up our focus, so the vout may show us again without letting the user clicking it */
if( [[[VLCCoreInteraction sharedInstance] voutView] isFullscreen] )
vout_thread_t *p_vout = getVout();
if (p_vout)
{
if (var_GetBool( p_vout, "fullscreen" ))
[[[[VLCCoreInteraction sharedInstance] voutView] window] makeKeyWindow];
vlc_object_release( p_vout );
}
}
- (void)hideMouse
......
......@@ -744,10 +744,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[NSApp activateIgnoringOtherApps:YES];
[o_remote stopListening: self];
var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_STOP );
/* Close the window directly, because we do know that there
* won't be anymore video. It's currently waiting a bit. */
[[[o_coreinteraction voutView] window] orderOut:self];
}
#pragma mark -
......@@ -1276,6 +1272,15 @@ unsigned int CocoaKeyToVLC( unichar i_key )
- (void)updatePlaybackPosition
{
[o_mainwindow updateTimeSlider];
input_thread_t * p_input;
p_input = pl_CurrentInput( p_intf );
if( p_input )
{
if( var_GetInteger( p_input, "state" ) == PLAYING_S )
UpdateSystemActivity( UsrActivity );
vlc_object_release( p_input );
}
}
- (void)updateVolume
......
/*****************************************************************************
* vout.h: MacOS X interface module
* vout.h: MacOS X video output module
*****************************************************************************
* Copyright (C) 2001-2007 the VideoLAN team
* Copyright (C) 2002-2011 the VideoLAN team
* $Id$
*
* Authors: Colin Delacroix <colin@zoy.org>
* Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Authors: Derk-Jan Hartman <hartman at videolan dot org>
* Eric Petit <titer@m0k.org>
* Benjamin Pracht <bigben at videolan dot org>
* Pierre d'Herbemont <pdherbemont # videolan org>
* Felix Paul Kühne <fkuehne at videolan dot org>
*
* 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
......@@ -25,107 +25,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import "misc.h"
/*****************************************************************************
* VLCEmbeddedList interface
*****************************************************************************/
@interface VLCEmbeddedList : NSObject
{
NSMutableArray * o_embedded_array;
}
- (id)embeddedVout;
- (void)releaseEmbeddedVout: (id)o_vout_view;
- (void)addEmbeddedVout: (id)o_vout_view;
- (BOOL)windowContainsEmbedded: (id)o_window;
- (id)viewForWindow: (id)o_window;
@end
/*****************************************************************************
* VLCVoutView interface
*****************************************************************************/
@protocol VLCVoutViewResetting
+ (void)resetVout: (vout_thread_t *)p_vout;
@end
@interface VLCVoutView : NSView
{
vout_thread_t * p_vout;
NSRect * s_frame;
NSView * o_view;
NSView <VLCVoutViewResetting> * o_view;
vout_thread_t * p_real_vout;
id o_window;
}
- (BOOL)setVout: (vout_thread_t *) p_arg_vout subView: (NSView *) view
frame: (NSRect *) s_arg_frame;
- (void)closeVout;
- (void)updateTitle;
- (void)manage;
- (void)scaleWindowWithFactor: (float)factor animate: (BOOL)animate;
- (void)setOnTop:(BOOL)b_on_top;
- (void)toggleFloatOnTop;
- (void)toggleFullscreen;
- (BOOL)isFullscreen;
- (void)snapshot;
- (id)voutWindow;
+ (id)voutView: (vout_thread_t *)p_vout subView: (NSView *) view
frame: (NSRect *) s_frame;
+ (vout_thread_t *)realVout: (vout_thread_t *)p_vout;
- (void)enterFullscreen;
- (void)leaveFullscreen;
@end
/*****************************************************************************
* VLCVoutDetachedView interface
*****************************************************************************/
@interface VLCDetachedVoutView : VLCVoutView
{
mtime_t i_time_mouse_last_moved;
}
- (void)hideMouse: (BOOL)b_hide;
@end
/*****************************************************************************
* VLCEmbeddedView interface
*****************************************************************************/
@interface VLCEmbeddedVoutView : VLCVoutView
{
BOOL b_used;
id o_embeddedwindow;
}
- (void)setUsed: (BOOL)b_new_used;
- (BOOL)isUsed;
@end
/*****************************************************************************
* VLCVoutWindow interface
*****************************************************************************/
@interface VLCVoutWindow : VLCWindow
{
vout_thread_t * p_vout;
VLCVoutView * o_view;
NSRect * s_frame;
bool b_init_ok;
BOOL fullscreen;
NSRect initialFrame;
}
- (id) initWithVout: (vout_thread_t *) p_vout view: (VLCVoutView *) view
frame: (NSRect *) s_frame;
- (id)initMainThread: (id) sender;
- (void)leaveFullscreen;
- (void)enterFullscreen;
- (id)voutView;
@end
\ No newline at end of file
This diff is collapsed.
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