[vlc-commits] vout_macosx: restore compilation support for OS X 10.5 and 10.6
Felix Paul Kühne
git at videolan.org
Tue Jun 12 19:23:28 CEST 2012
vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jun 12 19:22:36 2012 +0200| [4b2e143fa82231ecf563a8cb133edcc0839b4e1f] | committer: Felix Paul Kühne
vout_macosx: restore compilation support for OS X 10.5 and 10.6
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4b2e143fa82231ecf563a8cb133edcc0839b4e1f
---
modules/video_output/macosx.m | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index 0fe6041..11416bd 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -53,6 +53,17 @@
- (BOOL)isFullscreen;
@end
+/* compilation support for 10.5 and 10.6 */
+#define OSX_LION NSAppKitVersionNumber >= 1115.2
+#ifndef MAC_OS_X_VERSION_10_7
+
+ at interface NSView (IntroducedInLion)
+- (NSRect)convertRectToBacking:(NSRect)aRect;
+- (void)setWantsBestResolutionOpenGLSurface:(BOOL)aBool;
+ at endif
+
+#endif
+
/**
* Forward declarations
*/
@@ -391,7 +402,7 @@ static int Control (vout_display_t *vd, int query, va_list ap)
{
NSRect bounds;
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
- if ([sys->glView respondsToSelector:@selector(convertRectToBacking:)])
+ if (OSX_LION)
bounds = [sys->glView convertRectToBacking:[sys->glView bounds]];
else
bounds = [sys->glView bounds];
@@ -512,7 +523,7 @@ static void OpenglSwap (vlc_gl_t *gl)
return nil;
/* enable HiDPI support on OS X 10.7 and later */
- if ([self respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])
+ if (OSX_LION)
[self setWantsBestResolutionOpenGLSurface:YES];
/* Swap buffers only during the vertical retrace of the monitor.
@@ -533,7 +544,7 @@ static void OpenglSwap (vlc_gl_t *gl)
NSView *parentView = [value pointerValue];
NSRect frame;
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
- if ([parentView respondsToSelector:@selector(convertRectToBacking:)])
+ if (OSX_LION)
frame = [parentView convertRectToBacking:[parentView bounds]];
else
frame = [parentView bounds];
@@ -635,7 +646,7 @@ static void OpenglSwap (vlc_gl_t *gl)
NSRect bounds;
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
- if ([self respondsToSelector:@selector(convertRectToBacking:)])
+ if (OSX_LION)
bounds = [self convertRectToBacking:[self bounds]];
else
bounds = [self bounds];
@@ -773,7 +784,7 @@ static void OpenglSwap (vlc_gl_t *gl)
BOOL b_inside;
/* on HiDPI displays, the point bounds don't equal the actual pixel based bounds */
- if ([self respondsToSelector:@selector(convertRectToBacking:)])
+ if (OSX_LION)
s_rect = [self convertRectToBacking:[self bounds]];
else
s_rect = [self bounds];
More information about the vlc-commits
mailing list