summaryrefslogtreecommitdiffstats
path: root/video/out/cocoa
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2014-10-08 19:23:47 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2014-10-08 19:38:35 +0200
commit69fa956f5012f92186e123af37b5bbff8554bbdc (patch)
treef16a5c301740dd4e3d5dc0b5d6842bcfb94e9af9 /video/out/cocoa
parent06ecf54fdfe5732bac37111753a0e2e3f40ca7ae (diff)
downloadmpv-69fa956f5012f92186e123af37b5bbff8554bbdc.tar.bz2
mpv-69fa956f5012f92186e123af37b5bbff8554bbdc.tar.xz
cocoa: allow to embed into an arbitrary NSView
Basically add if guards on all the problematic features. I'm still thinking about a better way to handle this, but for the time being, this will do.
Diffstat (limited to 'video/out/cocoa')
-rw-r--r--video/out/cocoa/events_view.h1
-rw-r--r--video/out/cocoa/events_view.m5
-rw-r--r--video/out/cocoa/video_view.h1
-rw-r--r--video/out/cocoa/video_view.m5
4 files changed, 6 insertions, 6 deletions
diff --git a/video/out/cocoa/events_view.h b/video/out/cocoa/events_view.h
index 3dc0e0306e..ff2500a7bc 100644
--- a/video/out/cocoa/events_view.h
+++ b/video/out/cocoa/events_view.h
@@ -21,6 +21,5 @@
@interface MpvEventsView : NSView <NSDraggingDestination>
@property(nonatomic, retain) MpvCocoaAdapter *adapter;
- (void)setFullScreen:(BOOL)willBeFullscreen;
-- (NSRect)frameInPixels;
- (BOOL)canHideCursor;
@end
diff --git a/video/out/cocoa/events_view.m b/video/out/cocoa/events_view.m
index 91b00fcb0b..744c3f27c7 100644
--- a/video/out/cocoa/events_view.m
+++ b/video/out/cocoa/events_view.m
@@ -130,11 +130,6 @@
- (BOOL)becomeFirstResponder { return YES; }
- (BOOL)resignFirstResponder { return YES; }
-- (NSRect)frameInPixels
-{
- return [self convertRectToBacking:[self frame]];
-}
-
- (BOOL)canHideCursor
{
return !self.hasMouseDown && [self containsMouseLocation];
diff --git a/video/out/cocoa/video_view.h b/video/out/cocoa/video_view.h
index d31d1e014e..3935a9b0af 100644
--- a/video/out/cocoa/video_view.h
+++ b/video/out/cocoa/video_view.h
@@ -20,4 +20,5 @@
@interface MpvVideoView : NSView
@property(nonatomic, retain) MpvCocoaAdapter *adapter;
+- (NSRect)frameInPixels;
@end
diff --git a/video/out/cocoa/video_view.m b/video/out/cocoa/video_view.m
index 851954c167..07db876534 100644
--- a/video/out/cocoa/video_view.m
+++ b/video/out/cocoa/video_view.m
@@ -35,4 +35,9 @@
[super setFrameSize:size];
[self.adapter setNeedsResize];
}
+
+- (NSRect)frameInPixels
+{
+ return [self convertRectToBacking:[self frame]];
+}
@end