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: ...@@ -70,10 +70,8 @@ contrib-macosx-$(ARCH)-$(CONTRIBREV).tar.bz2:
(cd build-src && rm -rf *gecko* && $(MAKE) .gecko) (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 # libiconv.la is no longer present on Snow Leopard, so fix possible references to it, which would
# result in linking issues # 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 $(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) (cd build-src && rm -f .iconv && $(MAKE) .iconv-from-os)
endif
touch .$(CONTRIBREV) touch .$(CONTRIBREV)
using-bin: .$(CONTRIBREV) using-bin: .$(CONTRIBREV)
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
<archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10"> <archive type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="7.10">
<data> <data>
<int key="IBDocument.SystemTarget">1040</int> <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.InterfaceBuilderVersion">851</string>
<string key="IBDocument.AppKitVersion">1138.11</string> <string key="IBDocument.AppKitVersion">1138</string>
<string key="IBDocument.HIToolboxVersion">566.00</string> <string key="IBDocument.HIToolboxVersion">566.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions"> <object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
...@@ -21,14 +21,14 @@ ...@@ -21,14 +21,14 @@
</object> </object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs"> <object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
<integer value="1617"/>
<integer value="2730"/>
<integer value="4682"/>
<integer value="4596"/> <integer value="4596"/>
<integer value="915"/> <integer value="915"/>
<integer value="334"/> <integer value="1617"/>
<integer value="283"/> <integer value="2730"/>
<integer value="4722"/> <integer value="4722"/>
<integer value="283"/>
<integer value="2"/>
<integer value="334"/>
</object> </object>
<object class="NSArray" key="IBDocument.PluginDependencies"> <object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
...@@ -1217,7 +1217,7 @@ ...@@ -1217,7 +1217,7 @@
<bool key="CIEnabled">YES</bool> <bool key="CIEnabled">YES</bool>
</object> </object>
<int key="NSViewLayerContentsRedrawPolicy">2</int> <int key="NSViewLayerContentsRedrawPolicy">2</int>
<string key="NSClassName">NSView</string> <string key="NSClassName">VLCVoutView</string>
</object> </object>
</object> </object>
<string key="NSFrameSize">{604, 310}</string> <string key="NSFrameSize">{604, 310}</string>
...@@ -16238,6 +16238,25 @@ LCAuLi4</string> ...@@ -16238,6 +16238,25 @@ LCAuLi4</string>
<string key="superclassName">NSView</string> <string key="superclassName">NSView</string>
<reference key="sourceIdentifier" ref="736371707"/> <reference key="sourceIdentifier" ref="736371707"/>
</object> </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>
<object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+"> <object class="NSMutableArray" key="referencedPartialClassDescriptionsV3.2+">
<bool key="EncodedWithXMLCoder">YES</bool> <bool key="EncodedWithXMLCoder">YES</bool>
......
...@@ -56,5 +56,4 @@ ...@@ -56,5 +56,4 @@
- (void)setAspectRatioLocked:(BOOL)b_value; - (void)setAspectRatioLocked:(BOOL)b_value;
- (BOOL)aspectRatioIsLocked; - (BOOL)aspectRatioIsLocked;
- (void)toggleFullscreen; - (void)toggleFullscreen;
- (id)voutView;
@end @end
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#import "CoreInteraction.h" #import "CoreInteraction.h"
#import "intf.h" #import "intf.h"
#import "vout.h"
#import "open.h" #import "open.h"
#import <vlc_playlist.h> #import <vlc_playlist.h>
#import <vlc_input.h> #import <vlc_input.h>
...@@ -93,9 +92,6 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -93,9 +92,6 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
- (void)stop - (void)stop
{ {
var_SetInteger( VLCIntf->p_libvlc, "key-action", ACTIONID_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 - (void)faster
...@@ -270,26 +266,4 @@ static VLCCoreInteraction *_o_sharedInstance = nil; ...@@ -270,26 +266,4 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
vlc_object_release( p_input ); 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 @end
...@@ -251,6 +251,7 @@ ...@@ -251,6 +251,7 @@
var:(const char *)psz_variable var:(const char *)psz_variable
selector:(SEL)pf_callback; selector:(SEL)pf_callback;
- (id)voutMenu;
@end @end
/***************************************************************************** /*****************************************************************************
......
...@@ -623,6 +623,11 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -623,6 +623,11 @@ static VLCMainMenu *_o_sharedInstance = nil;
} }
} }
- (id)voutMenu
{
return o_vout_menu;
}
#pragma mark - #pragma mark -
#pragma mark Panels #pragma mark Panels
...@@ -1204,8 +1209,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -1204,8 +1209,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
{ {
if( [o_title isEqualToString: _NS("Float on Top")] ) if( [o_title isEqualToString: _NS("Float on Top")] )
{ {
var_Get( p_vout, "video-on-top", &val ); [o_mi setState: var_GetBool( p_vout, "video-on-top" )];
[o_mi setState: val.b_bool ? NSOnState : NSOffState];
} }
bEnabled = TRUE; bEnabled = TRUE;
...@@ -1215,8 +1219,7 @@ static VLCMainMenu *_o_sharedInstance = nil; ...@@ -1215,8 +1219,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
} }
if( [o_title isEqualToString: _NS("Fullscreen")] ) if( [o_title isEqualToString: _NS("Fullscreen")] )
{ {
var_Get( p_playlist, "fullscreen", &val ); [o_mi setState: var_GetBool( p_playlist, "fullscreen" )];
[o_mi setState: val.b_bool];
bEnabled = TRUE; bEnabled = TRUE;
} }
[self setupMenus]; /* Make sure video menu is up to date */ [self setupMenus]; /* Make sure video menu is up to date */
......
...@@ -157,6 +157,8 @@ ...@@ -157,6 +157,8 @@
- (void)hasBecomeFullscreen; - (void)hasBecomeFullscreen;
- (void)setFrameOnMainThread:(NSData*)packedargs; - (void)setFrameOnMainThread:(NSData*)packedargs;
- (id)fspanel;
@end @end
@interface VLCProgressBarGradientEffect : NSView { @interface VLCProgressBarGradientEffect : NSView {
......
...@@ -646,8 +646,8 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -646,8 +646,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
int i_volume_step = 0; int i_volume_step = 0;
i_volume_step = config_GetInt( VLCIntf->p_libvlc, "volume-step" ); i_volume_step = config_GetInt( VLCIntf->p_libvlc, "volume-step" );
[o_volume_sld setFloatValue: (float)i_lastShownVolume / i_volume_step]; [o_volume_sld setFloatValue: (float)i_lastShownVolume / i_volume_step];
if ([o_fspanel respondsToSelector:@selector(setVolumeLevel:)]) // if ([o_fspanel respondsToSelector:@selector(setVolumeLevel:)])
[o_fspanel setVolumeLevel: (float)i_lastShownVolume / i_volume_step]; // [o_fspanel setVolumeLevel: (float)i_lastShownVolume / i_volume_step];
} }
} }
...@@ -1292,6 +1292,10 @@ static VLCMainWindow *_o_sharedInstance = nil; ...@@ -1292,6 +1292,10 @@ static VLCMainWindow *_o_sharedInstance = nil;
} }
} }
- (id)fspanel
{
return o_fspanel;
}
#pragma mark - #pragma mark -
#pragma mark Side Bar Data handling #pragma mark Side Bar Data handling
......
...@@ -166,19 +166,6 @@ ...@@ -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 - (IBAction)telxTransparent:(id)sender
{ {
vlc_object_t *p_vbi; vlc_object_t *p_vbi;
...@@ -329,11 +316,14 @@ ...@@ -329,11 +316,14 @@
/* Escape */ /* Escape */
if( key == (unichar) 0x1b ) if( key == (unichar) 0x1b )
{ {
id o_vout_view = [[VLCCoreInteraction sharedInstance] voutView]; vout_thread_t *p_vout = getVout();
if( o_vout_view && [o_vout_view isFullscreen] ) if (p_vout)
{ {
[o_vout_view toggleFullscreen]; if (var_GetBool( p_vout, "fullscreen" ))
eventHandled = YES; {
[[VLCCoreInteraction sharedInstance] toggleFullscreen];
eventHandled = YES;
}
} }
} }
else if( key == ' ' ) else if( key == ' ' )
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
/* SetSystemUIMode, ... */ /* SetSystemUIMode, ... */
#import <Carbon/Carbon.h> #import <Carbon/Carbon.h>
#if 0
/***************************************************************************** /*****************************************************************************
* VLCEmbeddedWindow Implementation * VLCEmbeddedWindow Implementation
*****************************************************************************/ *****************************************************************************/
...@@ -1006,3 +1008,5 @@ ...@@ -1006,3 +1008,5 @@
NSRectFill(divider);*/ NSRectFill(divider);*/
} }
@end @end
#endif
...@@ -178,13 +178,15 @@ ...@@ -178,13 +178,15 @@
- (void)setActive:(id)noData - (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; b_nonActive = NO;
[self fadeIn]; [self fadeIn];
} }
vlc_object_release( p_vout );
} }
} }
...@@ -247,8 +249,13 @@ ...@@ -247,8 +249,13 @@
- (void)mouseExited:(NSEvent *)theEvent - (void)mouseExited:(NSEvent *)theEvent
{ {
/* give up our focus, so the vout may show us again without letting the user clicking it */ /* 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();
[[[[VLCCoreInteraction sharedInstance] voutView] window] makeKeyWindow]; if (p_vout)
{
if (var_GetBool( p_vout, "fullscreen" ))
[[[[VLCCoreInteraction sharedInstance] voutView] window] makeKeyWindow];
vlc_object_release( p_vout );
}
} }
- (void)hideMouse - (void)hideMouse
......
...@@ -744,10 +744,6 @@ static VLCMain *_o_sharedMainInstance = nil; ...@@ -744,10 +744,6 @@ static VLCMain *_o_sharedMainInstance = nil;
[NSApp activateIgnoringOtherApps:YES]; [NSApp activateIgnoringOtherApps:YES];
[o_remote stopListening: self]; [o_remote stopListening: self];
var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_STOP ); 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 - #pragma mark -
...@@ -1276,6 +1272,15 @@ unsigned int CocoaKeyToVLC( unichar i_key ) ...@@ -1276,6 +1272,15 @@ unsigned int CocoaKeyToVLC( unichar i_key )
- (void)updatePlaybackPosition - (void)updatePlaybackPosition
{ {
[o_mainwindow updateTimeSlider]; [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 - (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$ * $Id$
* *
* Authors: Colin Delacroix <colin@zoy.org> * Authors: Derk-Jan Hartman <hartman at videolan dot org>
* Florian G. Pflug <fgp@phlo.org>
* Jon Lech Johansen <jon-vl@nanocrew.net>
* Eric Petit <titer@m0k.org> * Eric Petit <titer@m0k.org>
* Benjamin Pracht <bigben at videolan dot 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 * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
...@@ -25,107 +25,13 @@ ...@@ -25,107 +25,13 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. * 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 * VLCVoutView interface
*****************************************************************************/ *****************************************************************************/
@protocol VLCVoutViewResetting
+ (void)resetVout: (vout_thread_t *)p_vout;
@end
@interface VLCVoutView : NSView @interface VLCVoutView : NSView
{ {
vout_thread_t * p_vout; NSView * o_view;
NSRect * s_frame;
NSView <VLCVoutViewResetting> * o_view;
vout_thread_t * p_real_vout;
id o_window; id o_window;
} }
- (BOOL)setVout: (vout_thread_t *) p_arg_vout subView: (NSView *) view @end
frame: (NSRect *) s_arg_frame; \ No newline at end of file
- (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
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