@@ -102,13 +102,6 @@ - (id)initWithItem:(NSTouchBarItem *)item label:(NSString *)label;
102
102
- (void )setTouchBarItem:(NSTouchBarItem *)item;
103
103
- (void )makeChildTouchBar;
104
104
@end
105
-
106
- @interface MMTouchBarButton : NSButton {
107
- NSArray *_desc;
108
- }
109
- - (NSArray *)desc ;
110
- - (void )setDesc : (NSArray *)desc ;
111
- @end
112
105
#endif
113
106
114
107
@interface MMVimController (Private)
@@ -183,7 +176,7 @@ - (id)initWithBackend:(id)backend pid:(int)processIdentifier
183
176
popupMenuItems = [[NSMutableArray alloc ] init ];
184
177
toolbarItemDict = [[NSMutableDictionary alloc ] init ];
185
178
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12_2
186
- if (NSClassFromString ( @" NSTouchBar " )) {
179
+ if (@ available (macos 10.12.2 , * )) {
187
180
touchbarInfo = [[MMTouchBarInfo alloc ] init ];
188
181
}
189
182
#endif
@@ -1221,7 +1214,7 @@ - (void)addMenuWithDescriptor:(NSArray *)desc atIndex:(int)idx
1221
1214
1222
1215
if ([rootName isEqual: MMTouchbarMenuName]) {
1223
1216
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12_2
1224
- if (NSClassFromString ( @" NSTouchBar " )) {
1217
+ if (@ available (macos 10.12.2 , * )) {
1225
1218
if ([desc count ] < 2 ) // Cannot be 1, as we need at least TouchBar.<menu_name>
1226
1219
return ;
1227
1220
if ([desc count ] >= 3 ) // Unfortunately currently Apple does not support nested popover's so we can only do one level nesting
@@ -1305,7 +1298,7 @@ - (void)addMenuItemWithDescriptor:(NSArray *)desc
1305
1298
if ([desc count ] >= 4 ) // Unfortunately currently Apple does not support nested popover's so we can only do one level nesting
1306
1299
return ;
1307
1300
1308
- if (NSClassFromString ( @" NSTouchBar " )) {
1301
+ if (@ available (macos 10.12.2 , * )) {
1309
1302
MMTouchBarInfo *submenuTouchbar = nil ;
1310
1303
if (![self touchBarItemForDescriptor: desc touchBar: &submenuTouchbar touchBarItem: nil ]) {
1311
1304
return ;
@@ -1388,7 +1381,7 @@ - (void)removeMenuItemWithDescriptor:(NSArray *)desc
1388
1381
}
1389
1382
if ([rootName isEqual: MMTouchbarMenuName]){
1390
1383
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12_2
1391
- if (NSClassFromString ( @" NSTouchBar " )) {
1384
+ if (@ available (macos 10.12.2 , * )) {
1392
1385
MMTouchBarInfo *submenuTouchbar = nil ;
1393
1386
if (![self touchBarItemForDescriptor: desc touchBar: &submenuTouchbar touchBarItem: nil ]) {
1394
1387
return ;
@@ -1442,7 +1435,7 @@ - (void)enableMenuItemWithDescriptor:(NSArray *)desc state:(BOOL)on
1442
1435
1443
1436
if ([rootName isEqual: MMTouchbarMenuName]) {
1444
1437
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12_2
1445
- if (NSClassFromString ( @" NSTouchBar " )) {
1438
+ if (@ available (macos 10.12.2 , * )) {
1446
1439
MMTouchBarItemInfo *touchbarItem = nil ;
1447
1440
if (![self touchBarItemForDescriptor: desc touchBar: nil touchBarItem: &touchbarItem]) {
1448
1441
return ;
@@ -1481,7 +1474,7 @@ - (void)updateMenuItemTooltipWithDescriptor:(NSArray *)desc
1481
1474
1482
1475
if ([rootName isEqual: MMTouchbarMenuName]) {
1483
1476
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12_2
1484
- if (NSClassFromString ( @" NSTouchBar " )) {
1477
+ if (@ available (macos 10.12.2 , * )) {
1485
1478
MMTouchBarItemInfo *touchbarItem = nil ;
1486
1479
if (![self touchBarItemForDescriptor: desc touchBar: nil touchBarItem: &touchbarItem]) {
1487
1480
return ;
0 commit comments