3737#import " MMWindow.h"
3838
3939
40- static NSString *MMDefaultToolbarImageName = @" Attention" ;
40+ static NSString * const MMDefaultToolbarImageName = @" Attention" ;
4141static int MMAlertTextFieldHeight = 22 ;
4242
43- static const NSString * const MMToolbarMenuName = @" ToolBar" ;
44- static const NSString * const MMTouchbarMenuName = @" TouchBar" ;
45- static const NSString * const MMPopUpMenuPrefix = @" PopUp" ;
46- static const NSString * const MMUserPopUpMenuPrefix = @" ]" ;
43+ static NSString * const MMToolbarMenuName = @" ToolBar" ;
44+ static NSString * const MMTouchbarMenuName = @" TouchBar" ;
45+ static NSString * const MMPopUpMenuPrefix = @" PopUp" ;
46+ static NSString * const MMUserPopUpMenuPrefix = @" ]" ;
4747
4848// NOTE: By default a message sent to the backend will be dropped if it cannot
4949// be delivered instantly; otherwise there is a possibility that MacVim will
@@ -138,6 +138,7 @@ - (void)addToolbarItemToDictionaryWithLabel:(NSString *)title
138138- (void )addToolbarItemWithLabel : (NSString *)label
139139 tip : (NSString *)tip icon : (NSString *)icon
140140 atIndex : (int )idx ;
141+ #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_12_2
141142- (void )addTouchbarItemWithLabel : (NSString *)label
142143 icon : (NSString *)icon
143144 tip : (NSString *)tip
@@ -151,6 +152,7 @@ - (void)updateTouchbarItemLabel:(NSString *)label
151152- (BOOL )touchBarItemForDescriptor : (NSArray *)desc
152153 touchBar : (MMTouchBarInfo **)touchBarPtr
153154 touchBarItem : (MMTouchBarItemInfo **)touchBarItemPtr ;
155+ #endif
154156- (void )popupMenuWithDescriptor : (NSArray *)desc
155157 atRow : (NSNumber *)row
156158 column : (NSNumber *)col ;
@@ -1109,10 +1111,12 @@ - (void)alertDidEnd:(MMAlert *)alert code:(int)code context:(void *)context
11091111 pid, identifier, ex);
11101112 }
11111113}
1114+
11121115+ (bool ) hasPopupPrefix : (NSString *) menuName
11131116{
11141117 return [menuName hasPrefix: MMPopUpMenuPrefix] || [menuName hasPrefix: MMUserPopUpMenuPrefix];
11151118}
1119+
11161120- (NSMenuItem *)menuItemForDescriptor : (NSArray *)desc
11171121{
11181122 if (!(desc && [desc count ] > 0 )) return nil ;
0 commit comments