[vlc-commits] macosx: fix some compiler warnings / deprecated methods
David Fuhrmann
git at videolan.org
Thu Aug 13 21:14:08 CEST 2015
vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Thu Aug 13 20:54:34 2015 +0200| [c8961ccb94dca25b49717018fef91fe413f5c936] | committer: David Fuhrmann
macosx: fix some compiler warnings / deprecated methods
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c8961ccb94dca25b49717018fef91fe413f5c936
---
modules/gui/macosx/AppleRemote.h | 2 +-
modules/gui/macosx/AppleRemote.m | 4 ++--
modules/gui/macosx/PXSourceList.m | 20 +++++---------------
modules/gui/macosx/VLCVoutWindowController.m | 4 ++--
modules/gui/macosx/Windows.m | 4 ++--
modules/gui/macosx/misc.m | 2 +-
modules/gui/macosx/prefs_widgets.m | 2 +-
7 files changed, 14 insertions(+), 24 deletions(-)
diff --git a/modules/gui/macosx/AppleRemote.h b/modules/gui/macosx/AppleRemote.h
index 7b88b32..396fbc5 100644
--- a/modules/gui/macosx/AppleRemote.h
+++ b/modules/gui/macosx/AppleRemote.h
@@ -179,7 +179,7 @@ The class is not thread safe
/* A NSApplication delegate which is used to activate and deactivate listening to the remote control
* dependent on the activation state of your application.
* All events are delegated to the original NSApplication delegate if necessary */
- at interface AppleRemoteApplicationDelegate : NSObject {
+ at interface AppleRemoteApplicationDelegate : NSObject<NSApplicationDelegate> {
id applicationDelegate;
}
diff --git a/modules/gui/macosx/AppleRemote.m b/modules/gui/macosx/AppleRemote.m
index eaaf24c..72e438a 100644
--- a/modules/gui/macosx/AppleRemote.m
+++ b/modules/gui/macosx/AppleRemote.m
@@ -162,12 +162,12 @@ const NSTimeInterval HOLD_RECOGNITION_TIME_INTERVAL=0.4;
if ([self listeningOnAppActivate]) return;
AppleRemoteApplicationDelegate* appDelegate = [[AppleRemoteApplicationDelegate alloc] initWithApplicationDelegate: [NSApp delegate]];
/* NSApp does not retain its delegate therefore we keep retain count on 1 */
- [NSApp setDelegate: appDelegate];
+ [(NSApplication *)NSApp setDelegate: appDelegate];
} else {
if ([self listeningOnAppActivate]==NO) return;
AppleRemoteApplicationDelegate* appDelegate = (AppleRemoteApplicationDelegate*)[NSApp delegate];
id previousAppDelegate = [appDelegate applicationDelegate];
- [NSApp setDelegate: previousAppDelegate];
+ [(NSApplication *)NSApp setDelegate: previousAppDelegate];
}
}
diff --git a/modules/gui/macosx/PXSourceList.m b/modules/gui/macosx/PXSourceList.m
index 7d5677c..18e62e5 100644
--- a/modules/gui/macosx/PXSourceList.m
+++ b/modules/gui/macosx/PXSourceList.m
@@ -378,21 +378,11 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
iconRect = NSMakeRect(NSMidX(iconRect)-(actualIconSize.width/2.0f), NSMidY(iconRect)-(actualIconSize.height/2.0f), actualIconSize.width, actualIconSize.height);
}
- //Use 10.6 NSImage drawing if we can
- if(NSAppKitVersionNumber >= 1115.2) { // Lion
- [icon drawInRect:iconRect
- fromRect:NSZeroRect
- operation:NSCompositeSourceOver
- fraction:1
- respectFlipped:YES hints:nil];
- }
- else {
- [icon setFlipped:[self isFlipped]];
- [icon drawInRect:iconRect
- fromRect:NSZeroRect
- operation:NSCompositeSourceOver
- fraction:1];
- }
+ [icon drawInRect:iconRect
+ fromRect:NSZeroRect
+ operation:NSCompositeSourceOver
+ fraction:1
+ respectFlipped:YES hints:nil];
}
}
}
diff --git a/modules/gui/macosx/VLCVoutWindowController.m b/modules/gui/macosx/VLCVoutWindowController.m
index a23653b..1196231 100644
--- a/modules/gui/macosx/VLCVoutWindowController.m
+++ b/modules/gui/macosx/VLCVoutWindowController.m
@@ -356,8 +356,8 @@ void WindowClose(vout_window_t *p_wnd)
if ([o_vout_dict count] == 1) {
NSWindow * o_first_window = [o_vout_dict objectForKey: [[o_vout_dict allKeys] firstObject]];
- NSPoint topleftbase = NSMakePoint(0, [o_first_window frame].size.height);
- top_left_point = [o_first_window convertBaseToScreen: topleftbase];
+ NSRect topleftBaseRect = NSMakeRect(0, [o_first_window frame].size.height, 0, 0);
+ top_left_point = [o_first_window convertRectToScreen: topleftBaseRect].origin;
}
top_left_point = [o_new_video_window cascadeTopLeftFromPoint: top_left_point];
diff --git a/modules/gui/macosx/Windows.m b/modules/gui/macosx/Windows.m
index 1b0c4f3..c953bbe 100644
--- a/modules/gui/macosx/Windows.m
+++ b/modules/gui/macosx/Windows.m
@@ -513,8 +513,8 @@
NSSize windowMinSize = [self minSize];
NSRect screenFrame = [[self screen] visibleFrame];
- NSPoint topleftbase = NSMakePoint(0, [self frame].size.height);
- NSPoint topleftscreen = [self convertBaseToScreen: topleftbase];
+ NSRect topleftbase = NSMakeRect(0, [self frame].size.height, 0, 0);
+ NSPoint topleftscreen = [self convertRectToScreen: topleftbase].origin;
CGFloat f_width = size.width;
CGFloat f_height = size.height;
diff --git a/modules/gui/macosx/misc.m b/modules/gui/macosx/misc.m
index 2d9fd38..2d8e3ed 100644
--- a/modules/gui/macosx/misc.m
+++ b/modules/gui/macosx/misc.m
@@ -407,7 +407,7 @@ static bool b_old_spaces_style = YES;
NSRect frameRect = [self bounds];
[[NSColor selectedControlColor] set];
- NSFrameRectWithWidthUsingOperation(frameRect, 2., NSCompositeHighlight);
+ NSFrameRectWithWidthUsingOperation(frameRect, 2., NSCompositeSourceOver);
}
[super drawRect:dirtyRect];
diff --git a/modules/gui/macosx/prefs_widgets.m b/modules/gui/macosx/prefs_widgets.m
index 2edc1e8..abb1051 100644
--- a/modules/gui/macosx/prefs_widgets.m
+++ b/modules/gui/macosx/prefs_widgets.m
@@ -2221,7 +2221,7 @@ o_moduleenabled = [NSNumber numberWithBool:NO];\
// We don't ever want to drop onto a row, only between rows.
if (op == NSTableViewDropOn)
[table setDropRow:(row+1) dropOperation:NSTableViewDropAbove];
- return NSTableViewDropAbove;
+ return NSDragOperationGeneric;
}
- (BOOL)tableView:(NSTableView*)table acceptDrop:(id <NSDraggingInfo>)info
More information about the vlc-commits
mailing list