Remove code required when building with the 10.9 and 10.10 SDK

We only support building with the 10.11 and 10.12 SDK, so this code is no longer required.

Also added MAC_OS_X_VERSION_10_10 comments around 10.10 API that we conditionally use. This is just to make it easier to find it when bumping the minimum OS requirement.
This commit is contained in:
Allan Odgaard
2016-10-01 09:44:08 +02:00
parent 22d16a3b76
commit 95fc7c8b3e
5 changed files with 4 additions and 22 deletions

View File

@@ -14,8 +14,3 @@ PUBLIC extern NSUInteger const OakMoveNoActionReturn;
PUBLIC NSUInteger OakPerformTableViewActionFromKeyEvent (NSTableView* tableView, NSEvent* event);
PUBLIC NSUInteger OakPerformTableViewActionFromSelector (NSTableView* tableView, SEL selector);
#if !defined(MAC_OS_X_VERSION_10_10) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10)
PUBLIC extern NSString *const *const pNSAccessibilitySharedFocusElementsAttribute;
#define NSAccessibilitySharedFocusElementsAttribute (*pNSAccessibilitySharedFocusElementsAttribute)
#endif

View File

@@ -167,15 +167,3 @@ NSUInteger OakPerformTableViewActionFromSelector (NSTableView* tableView, SEL se
[helper doCommandBySelector:selector];
return helper.returnCode;
}
// ======================
#if !defined(MAC_OS_X_VERSION_10_10) || (MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_10)
// 10.9 and 10.10 SDKs don't define NSAppKitVersionNumber10_9 (nor *_10)
// literal value taken of 1265 from https://developer.apple.com/library/prerelease/mac/releasenotes/AppKit/RN-AppKit/index.html
#ifndef NSAppKitVersionNumber10_9
#define NSAppKitVersionNumber10_9 1265
#endif
NSString *const _NSAccessibilitySharedFocusElementsAttribute = @"AXSharedFocusElements";
NSString *const *const pNSAccessibilitySharedFocusElementsAttribute = (floor(NSAppKitVersionNumber) <= NSAppKitVersionNumber10_9) ? nil : &_NSAccessibilitySharedFocusElementsAttribute;
#endif

View File

@@ -630,7 +630,7 @@ static std::vector<bundles::item_ptr> relevant_items_in_scope (scope::context_t
[_keyEquivalentView bind:NSValueBinding toObject:self withKeyPath:@"keyEquivalentString" options:nil];
[_keyEquivalentView addObserver:self forKeyPath:@"recording" options:NSKeyValueObservingOptionNew context:kRecordingBinding];
if(nil != &NSAccessibilitySharedFocusElementsAttribute)
if(nil != &NSAccessibilitySharedFocusElementsAttribute) // MAC_OS_X_VERSION_10_10
[_keyEquivalentView accessibilitySetOverrideValue:@[ self.tableView ] forAttribute:NSAccessibilitySharedFocusElementsAttribute];
}
return _keyEquivalentView;

View File

@@ -141,7 +141,7 @@ static void* kFirstResponderBinding = &kFirstResponderBinding;
tableView.target = self;
tableView.dataSource = self;
tableView.delegate = self;
if(nil != &NSAccessibilitySharedFocusElementsAttribute)
if(nil != &NSAccessibilitySharedFocusElementsAttribute) // MAC_OS_X_VERSION_10_10
[_searchField.cell accessibilitySetOverrideValue:@[tableView] forAttribute:NSAccessibilitySharedFocusElementsAttribute];
_tableView = tableView;
@@ -274,7 +274,7 @@ static void* kFirstResponderBinding = &kFirstResponderBinding;
[self updateFilterString:_filterString];
// see http://lists.apple.com/archives/accessibility-dev/2014/Aug/msg00024.html
if(nil != &NSAccessibilitySharedFocusElementsAttribute)
if(nil != &NSAccessibilitySharedFocusElementsAttribute) // MAC_OS_X_VERSION_10_10
NSAccessibilityPostNotification(_tableView, NSAccessibilitySelectedRowsChangedNotification);
}

View File

@@ -165,9 +165,8 @@ static NSString* CreateSpacedString(NSUInteger length)
@implementation OakLinkedSearchField
+ (void)initialize
{
// MAC_OS_X_VERSION_10_10
if((nil == &NSAccessibilitySharedFocusElementsAttribute) && (self == OakLinkedSearchField.class))
{
[OakLinkedSearchField setCellClass:[OakLinkedSearchFieldCell class]];
}
}
@end