macosx: remove legacy code for pre-Yosemite macOS versions
authorFelix Paul Kühne <felix@feepk.net>
Sun, 10 Jun 2018 11:53:36 +0000 (13:53 +0200)
committerFelix Paul Kühne <felix@feepk.net>
Sun, 10 Jun 2018 11:55:16 +0000 (13:55 +0200)
modules/gui/macosx/CompatibilityFixes.h
modules/gui/macosx/Makefile.am
modules/gui/macosx/UI/VLCFullScreenPanel.xib
modules/gui/macosx/VLCAboutWindowController.m
modules/gui/macosx/VLCDefaultValueSliderCell.m
modules/gui/macosx/VLCHelpWindowController.m
modules/gui/macosx/VLCTintedImageButtonCell.h [deleted file]
modules/gui/macosx/VLCTintedImageButtonCell.m [deleted file]
modules/gui/macosx/VLCVideoEffectsWindowController.m
po/POTFILES.in

index 5af0d7a..759219f 100644 (file)
@@ -26,7 +26,6 @@
 
 #pragma mark -
 #pragma OS detection code
-#define OSX_YOSEMITE_AND_HIGHER (NSAppKitVersionNumber >= 1334)
 #define OSX_EL_CAPITAN_AND_HIGHER (NSAppKitVersionNumber >= 1404)
 #define OSX_SIERRA_AND_HIGHER (NSAppKitVersionNumber >= 1485)
 #define OSX_SIERRA_DOT_TWO_AND_HIGHER (NSAppKitVersionNumber >= 1504.76) // this is needed to check for MPRemoteCommandCenter
index e10209f..2ce0319 100644 (file)
@@ -91,7 +91,6 @@ libmacosx_plugin_la_SOURCES = \
        gui/macosx/VLCDefaultValueSlider.h gui/macosx/VLCDefaultValueSlider.m \
        gui/macosx/VLCDefaultValueSliderCell.h gui/macosx/VLCDefaultValueSliderCell.m \
        gui/macosx/VLCImageButton.h gui/macosx/VLCImageButton.m \
-       gui/macosx/VLCTintedImageButtonCell.h gui/macosx/VLCTintedImageButtonCell.m \
        gui/macosx/VLCTimeField.h gui/macosx/VLCTimeField.m \
        gui/macosx/VLCHexNumberFormatter.h gui/macosx/VLCHexNumberFormatter.m \
        gui/macosx/VLCSlider.h gui/macosx/VLCSlider.m \
index f4e3b40..832d56d 100644 (file)
@@ -1,9 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="10117" systemVersion="16G29" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14269.12" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
-        <development version="7000" identifier="xcode"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/>
-        <capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14269.12"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="VLCFSPanelController">
         </customObject>
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
-        <window title="Fullscreen Controls" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" hasShadow="NO" hidesOnDeactivate="YES" oneShot="NO" showsToolbarButton="NO" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="a2r-mH-Iqe">
+        <window title="Fullscreen Controls" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" restorable="NO" hasShadow="NO" hidesOnDeactivate="YES" visibleAtLaunch="NO" frameAutosaveName="" animationBehavior="default" id="a2r-mH-Iqe">
             <windowCollectionBehavior key="collectionBehavior" fullScreenAuxiliary="YES" fullScreenDisallowsTiling="YES"/>
             <windowPositionMask key="initialPositionMask" bottomStrut="YES"/>
             <rect key="contentRect" x="376" y="105" width="480" height="80"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1280" height="778"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1178"/>
             <value key="minSize" type="size" width="480" height="60"/>
             <value key="maxSize" type="size" width="4068" height="150"/>
             <view key="contentView" id="Npt-C5-K77" customClass="VLCFSPanelDraggableView">
@@ -46,7 +46,7 @@
                                     <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="10" id="Ccf-qh-Z4p"/>
                                     <constraint firstAttribute="width" secondItem="iYd-wn-Bnl" secondAttribute="height" multiplier="25:14" id="hNf-AC-5xt"/>
                                 </constraints>
-                                <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCVolumeOnTemplate" imagePosition="only" alignment="center" alternateImage="VLCVolumeOffTemplate" imageScaling="proportionallyUpOrDown" inset="2" id="KZQ-HO-iWj" customClass="VLCTintedImageButtonCell">
+                                <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCVolumeOnTemplate" imagePosition="only" alignment="center" alternateImage="VLCVolumeOffTemplate" imageScaling="proportionallyUpOrDown" inset="2" id="KZQ-HO-iWj">
                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                     <font key="font" metaFont="system"/>
                                 </buttonCell>
@@ -69,7 +69,7 @@
                                         <constraints>
                                             <constraint firstAttribute="width" secondItem="TVM-DT-2yo" secondAttribute="height" multiplier="19:16" id="oKb-iw-6S1"/>
                                         </constraints>
-                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCPreviousTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="ykW-vZ-DAm" customClass="VLCTintedImageButtonCell">
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCPreviousTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="ykW-vZ-DAm">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
@@ -82,7 +82,7 @@
                                         <constraints>
                                             <constraint firstAttribute="width" secondItem="7QH-jb-QdM" secondAttribute="height" multiplier="19:16" id="isk-o2-kZY"/>
                                         </constraints>
-                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCBackwardTemplate" imagePosition="only" alignment="center" continuous="YES" imageScaling="proportionallyUpOrDown" inset="2" id="kH8-lS-ZyV" customClass="VLCTintedImageButtonCell">
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCBackwardTemplate" imagePosition="only" alignment="center" continuous="YES" imageScaling="proportionallyUpOrDown" inset="2" id="kH8-lS-ZyV">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
@@ -95,7 +95,7 @@
                                         <constraints>
                                             <constraint firstAttribute="width" secondItem="YSL-bH-k6U" secondAttribute="height" multiplier="1:1" constant="6" id="2if-S8-t0u"/>
                                         </constraints>
-                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCPlayTemplate" imagePosition="overlaps" alignment="center" alternateImage="VLCPauseTemplate" imageScaling="proportionallyUpOrDown" inset="2" id="IvT-4x-6Go" customClass="VLCTintedImageButtonCell">
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCPlayTemplate" imagePosition="overlaps" alignment="center" alternateImage="VLCPauseTemplate" imageScaling="proportionallyUpOrDown" inset="2" id="IvT-4x-6Go">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
                                         <constraints>
                                             <constraint firstAttribute="width" secondItem="jSN-hV-r5D" secondAttribute="height" multiplier="19:16" id="m1w-9i-bkp"/>
                                         </constraints>
-                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCForwardTemplate" imagePosition="only" alignment="center" continuous="YES" imageScaling="proportionallyUpOrDown" inset="2" id="i5R-0v-MD5" customClass="VLCTintedImageButtonCell">
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCForwardTemplate" imagePosition="only" alignment="center" continuous="YES" imageScaling="proportionallyUpOrDown" inset="2" id="i5R-0v-MD5">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
                                         <constraints>
                                             <constraint firstAttribute="width" secondItem="2ai-dB-Wpq" secondAttribute="height" multiplier="19:16" id="Itj-7f-YDa"/>
                                         </constraints>
-                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCNextTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="gqA-yG-zOb" customClass="VLCTintedImageButtonCell">
+                                        <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCNextTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="gqA-yG-zOb">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
                                         </buttonCell>
                                 <constraints>
                                     <constraint firstAttribute="width" secondItem="C5K-aX-3aJ" secondAttribute="height" multiplier="1:1" id="VWl-0x-p1I"/>
                                 </constraints>
-                                <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCFullscreenOnTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="0tH-cP-VqB" customClass="VLCTintedImageButtonCell">
+                                <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="VLCFullscreenOnTemplate" imagePosition="only" alignment="center" imageScaling="proportionallyUpOrDown" inset="2" id="0tH-cP-VqB">
                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                     <font key="font" metaFont="system"/>
                                 </buttonCell>
index 183d614..91bc0f1 100644 (file)
                                  "\"https://www.videolan.org/contribute/\"><span style=\" text-decoration: "
                                  "underline; color:#0057ae;\">Help and join us!</span></a>"));
 
-    NSString *fontfamily = (OSX_YOSEMITE_AND_HIGHER) ? @"Helvetica Neue" : @"Lucida Grande";
+    NSString *fontfamily = @"Helvetica Neue";
     NSString *joinUsWithStyle = [NSString stringWithFormat:@"<div style=\"text-align:left;font-family: -apple-system, %@;\">%@</div>",
                                  fontfamily, joinus];
     NSAttributedString *joinus_readytorender = [[NSAttributedString alloc] initWithHTML:[joinUsWithStyle dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:YES] options:[NSDictionary dictionaryWithObject:[NSNumber numberWithInt:NSUTF8StringEncoding] forKey:NSCharacterEncodingDocumentOption] documentAttributes:NULL];
index 4bec1b5..bef08ce 100644 (file)
                 tickFrame.origin.x = mid;
             } else {
                 tickFrame.origin.x = mid - tickThickness;
-                if (OSX_YOSEMITE_AND_HIGHER) {
-                    tickFrame.size.height = cellFrame.size.height - 1;
-                    tickFrame.origin.y = cellFrame.origin.y - 1;
-                }
+                tickFrame.size.height = cellFrame.size.height - 1;
+                tickFrame.origin.y = cellFrame.origin.y - 1;
             }
             tickFrame.size.width = tickThickness;
         }
index ed973de..90036fb 100644 (file)
@@ -59,8 +59,8 @@
 - (IBAction)helpGoHome:(id)sender
 {
     NSString *htmlWithStyle = [NSString
-                               stringWithFormat:@"<style>body { font-family: -apple-system, %@; }</style>%@",
-                               ((OSX_YOSEMITE_AND_HIGHER) ? @"Helvetica Neue" : @"Lucida Grande"), _NS(I_LONGHELP)];
+                               stringWithFormat:@"<style>body { font-family: -apple-system, Helvetica Neue; }</style>%@",
+                               _NS(I_LONGHELP)];
 
     [[helpWebView mainFrame] loadHTMLString:htmlWithStyle
                                     baseURL:[NSURL URLWithString:@"http://videolan.org"]];
diff --git a/modules/gui/macosx/VLCTintedImageButtonCell.h b/modules/gui/macosx/VLCTintedImageButtonCell.h
deleted file mode 100644 (file)
index 78791f9..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*****************************************************************************
- * VLCTintedImageButtonCell.h
- *****************************************************************************
- * Copyright (C) 2017 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Marvin Scholz <epirat07 at gmail dot com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#import <Cocoa/Cocoa.h>
-
-@interface VLCTintedImageButtonCell : NSButtonCell
-
-@property (nonatomic) IBInspectable NSColor *imageTintColor;
-
-@end
diff --git a/modules/gui/macosx/VLCTintedImageButtonCell.m b/modules/gui/macosx/VLCTintedImageButtonCell.m
deleted file mode 100644 (file)
index e440ecc..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*****************************************************************************
- * VLCTintedImageButtonCell.m
- *****************************************************************************
- * Copyright (C) 2017 VLC authors and VideoLAN
- * $Id$
- *
- * Authors: Marvin Scholz <epirat07 at gmail dot com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#import "VLCTintedImageButtonCell.h"
-#import "CompatibilityFixes.h"
-
-@interface VLCTintedImageButtonCell () {
-    NSMutableDictionary *_imageCache;
-}
-@end
-
-
-@implementation VLCTintedImageButtonCell
-
-+ (void)load
-{
-    /* On 10.10+ we do not want custom drawing, therefore we swap out the implementation
-     * of the selectors below with their original implementations.
-     * Just calling super is not enough here, as the button would still draw in a different
-     * way, non vibrant with weird highlighting behaviour.
-     */
-    if (OSX_YOSEMITE_AND_HIGHER) {
-        swapoutOverride([VLCTintedImageButtonCell class], @selector(initWithCoder:));
-        swapoutOverride([VLCTintedImageButtonCell class], @selector(drawImage:withFrame:inView:));
-    }
-}
-
-- (instancetype)initWithCoder:(NSCoder *)coder
-{
-    self = [super initWithCoder:coder];
-    if (self) {
-        _imageCache = [NSMutableDictionary dictionary];
-        _imageTintColor = [NSColor whiteColor];
-    }
-    return self;
-}
-
-- (NSImage *)image:(NSImage*)image tintedWithColor:(NSColor *)tint
-{
-    image = [image copy];
-    [image setTemplate:NO];
-    if (tint) {
-        [image lockFocus];
-        NSRect imageRect = {NSZeroPoint, [image size]};
-        [tint setFill];
-        NSRectFillUsingOperation(imageRect, NSCompositeSourceAtop);
-        [image unlockFocus];
-    }
-    return image;
-}
-
-- (NSImage*)tintedImage:(NSImage*)image
-{
-    NSNumber *key = @((NSInteger)image);
-    if (![_imageCache objectForKey:key]) {
-        NSImage *tintedImg = [self image:image tintedWithColor:_imageTintColor];
-        [_imageCache setObject:tintedImg forKey:key];
-    }
-    return [_imageCache objectForKey:key];
-}
-
-- (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView
-{
-    image = [self tintedImage:image];
-    [super drawImage:image withFrame:frame inView:controlView];
-}
-
-@end
index bb1df42..9a92d5c 100644 (file)
 - (void)addProfile:(id)sender
 {
     /* show panel */
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-#ifdef MAC_OS_X_VERSION_10_10
-    if (OSX_YOSEMITE_AND_HIGHER) {
-        [[_textfieldPanel window] setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]];
-    }
-#endif
-#pragma clang diagnostic pop
+    [[_textfieldPanel window] setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]];
     [_textfieldPanel setTitleString:_NS("Duplicate current profile for a new profile")];
     [_textfieldPanel setSubTitleString:_NS("Enter a name for the new profile:")];
     [_textfieldPanel setCancelButtonString:_NS("Cancel")];
 - (void)removeProfile:(id)sender
 {
     /* show panel */
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpartial-availability"
-#ifdef MAC_OS_X_VERSION_10_10
-    if (OSX_YOSEMITE_AND_HIGHER) {
-        [[_popupPanel window] setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]];
-    }
-#endif
-#pragma clang diagnostic pop
+    [[_popupPanel window] setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameVibrantDark]];
     [_popupPanel setTitleString:_NS("Remove a preset")];
     [_popupPanel setSubTitleString:_NS("Select the preset you would like to remove:")];
     [_popupPanel setOkButtonString:_NS("Remove")];
index d8537d7..7683c43 100644 (file)
@@ -544,8 +544,6 @@ modules/gui/macosx/VLCTimeField.h
 modules/gui/macosx/VLCTimeField.m
 modules/gui/macosx/VLCTimeSelectionPanelController.h
 modules/gui/macosx/VLCTimeSelectionPanelController.m
-modules/gui/macosx/VLCTintedImageButtonCell.h
-modules/gui/macosx/VLCTintedImageButtonCell.m
 modules/gui/macosx/VLCTrackSynchronizationWindowController.h
 modules/gui/macosx/VLCTrackSynchronizationWindowController.m
 modules/gui/macosx/VLCUIWidgets.h