[vlc-commits] macosx/coreinteraction: a bit more cleanup
Felix Paul Kühne
git at videolan.org
Tue Jan 29 23:34:57 CET 2019
vlc | branch: master | Felix Paul Kühne <felix at feepk.net> | Tue Jan 29 19:28:22 2019 +0100| [ea059f7020a686dd8777515e6bbfdb3375661905] | committer: Felix Paul Kühne
macosx/coreinteraction: a bit more cleanup
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ea059f7020a686dd8777515e6bbfdb3375661905
---
modules/gui/macosx/VLCCoreInteraction.h | 2 --
modules/gui/macosx/VLCCoreInteraction.m | 21 ---------------------
modules/gui/macosx/VLCPlaylist.h | 2 ++
modules/gui/macosx/VLCPlaylist.m | 11 +++++++++++
modules/gui/macosx/VLCVoutView.m | 5 +++--
modules/gui/macosx/misc.m | 4 +++-
6 files changed, 19 insertions(+), 26 deletions(-)
diff --git a/modules/gui/macosx/VLCCoreInteraction.h b/modules/gui/macosx/VLCCoreInteraction.h
index 0521477f35..96c6ff800d 100644
--- a/modules/gui/macosx/VLCCoreInteraction.h
+++ b/modules/gui/macosx/VLCCoreInteraction.h
@@ -76,8 +76,6 @@
- (void)addSubtitlesToCurrentInput:(NSArray *)paths;
-- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
-
- (void)toggleFullscreen;
- (BOOL)keyEvent:(NSEvent *)o_event;
diff --git a/modules/gui/macosx/VLCCoreInteraction.m b/modules/gui/macosx/VLCCoreInteraction.m
index 037e1e184c..9ae0635273 100644
--- a/modules/gui/macosx/VLCCoreInteraction.m
+++ b/modules/gui/macosx/VLCCoreInteraction.m
@@ -24,19 +24,11 @@
#import "VLCMain.h"
#import "VLCOpenWindowController.h"
#import "VLCPlaylist.h"
-#import <math.h>
-#import <vlc_playlist_legacy.h>
-#import <vlc_input.h>
-#import <vlc_aout.h>
-#import <vlc_vout.h>
-#import <vlc_vout_osd.h>
-#import <vlc/vlc.h>
#import <vlc_strings.h>
#import <vlc_url.h>
#import <vlc_modules.h>
#import <vlc_plugin.h>
#import <vlc_actions.h>
-#import "VLCInputManager.h"
#import "VLCClickerManager.h"
static int BossCallback(vlc_object_t *p_this, const char *psz_var,
@@ -622,19 +614,6 @@ static int BossCallback(vlc_object_t *p_this, const char *psz_var,
}
}
-#pragma mark - Drop support for files into the video, controls bar or drop box
-
-- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
-{
- NSArray *items = [[[VLCMain sharedInstance] playlist] createItemsFromExternalPasteboard:[sender draggingPasteboard]];
-
- if (items.count == 0)
- return NO;
-
- [[[VLCMain sharedInstance] playlist] addPlaylistItems:items tryAsSubtitle:YES];
- return YES;
-}
-
#pragma mark - video output stuff
- (void)setAspectRatioIsLocked:(BOOL)b_value
diff --git a/modules/gui/macosx/VLCPlaylist.h b/modules/gui/macosx/VLCPlaylist.h
index 830f6133f5..e499bfe332 100644
--- a/modules/gui/macosx/VLCPlaylist.h
+++ b/modules/gui/macosx/VLCPlaylist.h
@@ -63,6 +63,8 @@
- (NSArray *)draggedItems;
+- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender;
+
/**
* Prepares an array of playlist items for all suitable pasteboard types.
*
diff --git a/modules/gui/macosx/VLCPlaylist.m b/modules/gui/macosx/VLCPlaylist.m
index 2cf43401e3..51981725ab 100644
--- a/modules/gui/macosx/VLCPlaylist.m
+++ b/modules/gui/macosx/VLCPlaylist.m
@@ -497,6 +497,17 @@
#pragma mark -
#pragma mark Item helpers
+- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
+{
+ NSArray *items = [self createItemsFromExternalPasteboard:[sender draggingPasteboard]];
+
+ if (items.count == 0)
+ return NO;
+
+ [self addPlaylistItems:items tryAsSubtitle:YES];
+ return YES;
+}
+
- (input_item_t *)createItem:(NSDictionary *)itemToCreateDict
{
intf_thread_t *p_intf = getIntf();
diff --git a/modules/gui/macosx/VLCVoutView.m b/modules/gui/macosx/VLCVoutView.m
index 5be09304d4..d5e31012d7 100644
--- a/modules/gui/macosx/VLCVoutView.m
+++ b/modules/gui/macosx/VLCVoutView.m
@@ -32,8 +32,9 @@
#import "CompatibilityFixes.h"
#import "VLCMain.h"
-#import "VLCVoutView.h"
#import "VLCCoreInteraction.h"
+#import "VLCVoutView.h"
+#import "VLCPlaylist.h"
#import "VLCMainMenu.h"
#import <QuartzCore/QuartzCore.h>
@@ -130,7 +131,7 @@
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
- BOOL b_returned = [[VLCCoreInteraction sharedInstance] performDragOperation:sender];
+ BOOL b_returned = [[[VLCMain sharedInstance] playlist] performDragOperation:sender];
[self setNeedsDisplay:YES];
return b_returned;
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index e3d03fe778..d6e4f253a8 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -24,6 +24,8 @@
#import "CompatibilityFixes.h"
#import "misc.h"
#import "VLCMainWindow.h"
+#import "VLCMain.h"
+#import "VLCPlaylist.h"
#import "VLCMainMenu.h"
#import "VLCControlsBarCommon.h"
#import "VLCCoreInteraction.h"
@@ -122,7 +124,7 @@
if (_dropHandler && [_dropHandler respondsToSelector:@selector(performDragOperation:)])
b_returned = [_dropHandler performDragOperation:sender];
else // default
- b_returned = [[VLCCoreInteraction sharedInstance] performDragOperation:sender];
+ b_returned = [[[VLCMain sharedInstance] playlist] performDragOperation:sender];
[self setNeedsDisplay:YES];
return b_returned;
More information about the vlc-commits
mailing list