macosx: fix some compiler warnings / deprecated methods
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Thu, 13 Aug 2015 18:54:34 +0000 (20:54 +0200)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Thu, 13 Aug 2015 19:11:45 +0000 (21:11 +0200)
modules/gui/macosx/AppleRemote.h
modules/gui/macosx/AppleRemote.m
modules/gui/macosx/PXSourceList.m
modules/gui/macosx/VLCVoutWindowController.m
modules/gui/macosx/Windows.m
modules/gui/macosx/misc.m
modules/gui/macosx/prefs_widgets.m

index 7b88b32..396fbc5 100644 (file)
@@ -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 */
-@interface AppleRemoteApplicationDelegate : NSObject {
+@interface AppleRemoteApplicationDelegate : NSObject<NSApplicationDelegate> {
     id applicationDelegate;
 }
 
index eaaf24c..72e438a 100644 (file)
@@ -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];
     }
 }
 
index 7d5677c..18e62e5 100644 (file)
@@ -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];
                 }
             }
         }
index a23653b..1196231 100644 (file)
@@ -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];
index 1b0c4f3..c953bbe 100644 (file)
     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;
index 2d9fd38..2d8e3ed 100644 (file)
@@ -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];
index 2edc1e8..abb1051 100644 (file)
@@ -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