Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikita Nemkin2019-04-04 10:24:35 -0400
committerNikita Nemkin2019-05-17 07:30:03 -0400
commitd9e0e6eefdc3147775d0ff2f742216c49c86c98b (patch)
tree4ba4bd11babdeb5dc8ac4d0906c690208379f0fd /bundles/org.eclipse.swt/Eclipse SWT PI
parent921c87a1d289df2674e164e2b2a85c054d366aa6 (diff)
downloadeclipse.platform.swt-d9e0e6eefdc3147775d0ff2f742216c49c86c98b.tar.gz
eclipse.platform.swt-d9e0e6eefdc3147775d0ff2f742216c49c86c98b.tar.xz
eclipse.platform.swt-d9e0e6eefdc3147775d0ff2f742216c49c86c98b.zip
Bug 547191 - [Cocoa] Remove support code for macOS 10.9 and earlier
* Remove code blocks guarded by OS.VERSION/OS.VERSION_MMB < 10.10. * Retire OS.VERSION and rename OS.VERSION_MMB to OS.VERSION. This also fixes gestaltSystemVersion warning on startup. Change-Id: I02614dc5c72c70ae0d0d7c57f23ec2cafd3d0cce Signed-off-by: Nikita Nemkin <nikita@nemkin.ru>
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT PI')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java27
1 files changed, 9 insertions, 18 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
index 3a4f2eec4a..cd774929e0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java
@@ -21,26 +21,17 @@ public class OS extends C {
Library.loadLibrary("swt-pi"); //$NON-NLS-1$
}
- /**
- * NOTE: For new code, use {@link #VERSION_MMB} and {@link #VERSION_MMB(int, int, int)}
- */
public static final int VERSION;
- public static final int VERSION_MMB;
static {
- int [] response = new int [1];
- OS.Gestalt (OS.gestaltSystemVersion, response);
- VERSION = response [0] & 0xffff;
- OS.Gestalt (OS.gestaltSystemVersionMajor, response);
- int major = response [0];
- OS.Gestalt (OS.gestaltSystemVersionMinor, response);
- int minor = response [0];
- OS.Gestalt (OS.gestaltSystemVersionBugFix, response);
- int bugFix = response [0];
- VERSION_MMB = VERSION_MMB (major, minor, bugFix);
+ int [] major = new int [1], minor = new int [1], bugfix = new int [1];
+ OS.Gestalt (OS.gestaltSystemVersionMajor, major);
+ OS.Gestalt (OS.gestaltSystemVersionMinor, minor);
+ OS.Gestalt (OS.gestaltSystemVersionBugFix, bugfix);
+ VERSION = VERSION (major [0], minor [0], bugfix [0]);
}
- public static int VERSION_MMB (int major, int minor, int bugFix) {
- return (major << 16) + (minor << 8) + bugFix;
+ public static int VERSION (int major, int minor, int bugfix) {
+ return (major << 16) + (minor << 8) + bugfix;
}
/*
@@ -221,7 +212,7 @@ public class OS extends C {
OS.objc_msgSend(NSApplication.sharedApplication().id, sel_appAppearanceChanged, isDarkTheme ? 1 : 0);
}
public static boolean isAppDarkAppearance() {
- if (OS.VERSION_MMB >= OS.VERSION_MMB(10, 14, 0)) {
+ if (OS.VERSION >= OS.VERSION(10, 14, 0)) {
NSAppearance currentAppearance = NSAppearance.currentAppearance();
if (currentAppearance != null) {
return "NSAppearanceNameDarkAqua".equals(currentAppearance.name().getString());
@@ -230,7 +221,7 @@ public class OS extends C {
return false;
}
public static boolean isSystemDarkAppearance() {
- if (OS.VERSION_MMB >= OS.VERSION_MMB(10, 14, 0)) {
+ if (OS.VERSION >= OS.VERSION(10, 14, 0)) {
NSString osxMode = NSUserDefaults.standardUserDefaults ().stringForKey (NSString.stringWith ("AppleInterfaceStyle"));
return osxMode != null && "Dark".equals (osxMode.getString ());
}

Back to the top