mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Suppress warnings for Xcode 8
This commit is contained in:
@@ -75,8 +75,8 @@ static DBPrefsWindowController *_sharedPrefsWindowController = nil;
|
||||
// If the developer attached a window to this controller
|
||||
// in Interface Builder, it gets replaced with this one.
|
||||
NSPanel *window = [[[NSPanel alloc] initWithContentRect:NSMakeRect(0,0,1000,1000)
|
||||
styleMask:(NSTitledWindowMask |
|
||||
NSClosableWindowMask)
|
||||
styleMask:(NSWindowStyleMaskTitled |
|
||||
NSWindowStyleMaskClosable)
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:YES] autorelease];
|
||||
[window setHidesOnDeactivate:NO];
|
||||
|
||||
@@ -518,7 +518,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
|
||||
if (modifiedBuffers) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
[alert setAlertStyle:NSWarningAlertStyle];
|
||||
[alert setAlertStyle:NSAlertStyleWarning];
|
||||
[alert addButtonWithTitle:NSLocalizedString(@"Quit",
|
||||
@"Dialog button")];
|
||||
[alert addButtonWithTitle:NSLocalizedString(@"Cancel",
|
||||
@@ -548,7 +548,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
|
||||
if (numWindows > 1 || numTabs > 1) {
|
||||
NSAlert *alert = [[NSAlert alloc] init];
|
||||
[alert setAlertStyle:NSWarningAlertStyle];
|
||||
[alert setAlertStyle:NSAlertStyleWarning];
|
||||
[alert addButtonWithTitle:NSLocalizedString(@"Quit",
|
||||
@"Dialog button")];
|
||||
[alert addButtonWithTitle:NSLocalizedString(@"Cancel",
|
||||
@@ -1582,7 +1582,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
}
|
||||
|
||||
[alert setInformativeText:text];
|
||||
[alert setAlertStyle:NSWarningAlertStyle];
|
||||
[alert setAlertStyle:NSAlertStyleWarning];
|
||||
|
||||
[alert runModal];
|
||||
[alert release];
|
||||
@@ -1751,7 +1751,7 @@ fsEventCallback(ConstFSEventStreamRef streamRef,
|
||||
@"Unknown URL Scheme dialog, text"),
|
||||
[url host]]];
|
||||
|
||||
[alert setAlertStyle:NSWarningAlertStyle];
|
||||
[alert setAlertStyle:NSAlertStyleWarning];
|
||||
[alert runModal];
|
||||
[alert release];
|
||||
}
|
||||
|
||||
@@ -3179,7 +3179,7 @@ static int eventModifierFlagsToVimModMask(int modifierFlags)
|
||||
modMask |= MOD_MASK_CTRL;
|
||||
if (modifierFlags & NSAlternateKeyMask)
|
||||
modMask |= MOD_MASK_ALT;
|
||||
if (modifierFlags & NSCommandKeyMask)
|
||||
if (modifierFlags & NSEventModifierFlagCommand)
|
||||
modMask |= MOD_MASK_CMD;
|
||||
|
||||
return modMask;
|
||||
|
||||
@@ -163,7 +163,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
ASLogDebug(@"MACMETA key, don't interpret it");
|
||||
string = unmod;
|
||||
} else if (imState && (flags & NSControlKeyMask)
|
||||
&& !(flags & (NSAlternateKeyMask|NSCommandKeyMask))
|
||||
&& !(flags & (NSAlternateKeyMask|NSEventModifierFlagCommand))
|
||||
&& [unmod length] == 1
|
||||
&& ([unmod characterAtIndex:0] == '6' ||
|
||||
[unmod characterAtIndex:0] == '^')) {
|
||||
@@ -180,7 +180,7 @@ KeyboardInputSourcesEqual(TISInputSourceRef a, TISInputSourceRef b)
|
||||
[textView interpretKeyEvents:[NSArray arrayWithObject:event]];
|
||||
if (interpretKeyEventsSwallowedKey)
|
||||
string = nil;
|
||||
else if (flags & NSCommandKeyMask) {
|
||||
else if (flags & NSEventModifierFlagCommand) {
|
||||
// HACK! When Command is held we have to more or less guess whether
|
||||
// we should use characters or charactersIgnoringModifiers. The
|
||||
// following heuristic seems to work but it may have to change.
|
||||
|
||||
@@ -1328,7 +1328,7 @@ static BOOL isUnsafeMessage(int msgid);
|
||||
pt = [[windowController window] mouseLocationOutsideOfEventStream];
|
||||
}
|
||||
|
||||
NSEvent *event = [NSEvent mouseEventWithType:NSRightMouseDown
|
||||
NSEvent *event = [NSEvent mouseEventWithType:NSEventTypeRightMouseDown
|
||||
location:pt
|
||||
modifierFlags:0
|
||||
timestamp:0
|
||||
|
||||
@@ -197,11 +197,11 @@ enum {
|
||||
// weird behind the window resize throbber, so emulate the look of an
|
||||
// NSScrollView in the bottom right corner.
|
||||
if (![[self window] showsResizeIndicator] // XXX: make this a flag
|
||||
|| !([[self window] styleMask] & NSTexturedBackgroundWindowMask))
|
||||
|| !([[self window] styleMask] & NSWindowStyleMaskTexturedBackground))
|
||||
return;
|
||||
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
|
||||
int sw = [NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy];
|
||||
int sw = [NSScroller scrollerWidthForControlSize:NSControlSizeRegular scrollerStyle:NSScrollerStyleLegacy];
|
||||
#else
|
||||
int sw = [NSScroller scrollerWidth];
|
||||
#endif
|
||||
@@ -704,7 +704,7 @@ enum {
|
||||
|
||||
NSRect rect;
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
|
||||
CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy];
|
||||
CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:NSControlSizeRegular scrollerStyle:NSScrollerStyleLegacy];
|
||||
#else
|
||||
CGFloat scrollerWidth = [NSScroller scrollerWidth];
|
||||
#endif
|
||||
@@ -818,7 +818,7 @@ enum {
|
||||
{
|
||||
NSSize size = textViewSize;
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
|
||||
CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy];
|
||||
CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:NSControlSizeRegular scrollerStyle:NSScrollerStyleLegacy];
|
||||
#else
|
||||
CGFloat scrollerWidth = [NSScroller scrollerWidth];
|
||||
#endif
|
||||
@@ -840,7 +840,7 @@ enum {
|
||||
{
|
||||
NSRect rect = { {0, 0}, {contentSize.width, contentSize.height} };
|
||||
#if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_7)
|
||||
CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:NSRegularControlSize scrollerStyle:NSScrollerStyleLegacy];
|
||||
CGFloat scrollerWidth = [NSScroller scrollerWidthForControlSize:NSControlSizeRegular scrollerStyle:NSScrollerStyleLegacy];
|
||||
#else
|
||||
CGFloat scrollerWidth = [NSScroller scrollerWidth];
|
||||
#endif
|
||||
|
||||
@@ -127,15 +127,15 @@
|
||||
|
||||
- (id)initWithVimController:(MMVimController *)controller
|
||||
{
|
||||
unsigned styleMask = NSTitledWindowMask | NSClosableWindowMask
|
||||
| NSMiniaturizableWindowMask | NSResizableWindowMask
|
||||
| NSUnifiedTitleAndToolbarWindowMask
|
||||
| NSTexturedBackgroundWindowMask;
|
||||
unsigned styleMask = NSWindowStyleMaskTitled | NSWindowStyleMaskClosable
|
||||
| NSWindowStyleMaskMiniaturizable | NSWindowStyleMaskResizable
|
||||
| NSWindowStyleMaskUnifiedTitleAndToolbar
|
||||
| NSWindowStyleMaskTexturedBackground;
|
||||
|
||||
if ([[NSUserDefaults standardUserDefaults]
|
||||
boolForKey:MMNoTitleBarWindowKey]) {
|
||||
// No title bar setting
|
||||
styleMask &= ~NSTitledWindowMask;
|
||||
styleMask &= ~NSWindowStyleMaskTitled;
|
||||
}
|
||||
|
||||
// NOTE: The content rect is only used the very first time MacVim is
|
||||
@@ -175,7 +175,7 @@
|
||||
[win setDelegate:self];
|
||||
[win setInitialFirstResponder:[vimView textView]];
|
||||
|
||||
if ([win styleMask] & NSTexturedBackgroundWindowMask) {
|
||||
if ([win styleMask] & NSWindowStyleMaskTexturedBackground) {
|
||||
// On Leopard, we want to have a textured window to have nice
|
||||
// looking tabs. But the textured window look implies rounded
|
||||
// corners, which looks really weird -- disable them. This is a
|
||||
@@ -1066,8 +1066,8 @@
|
||||
|
||||
// Decide whether too zoom horizontally or not (always zoom vertically).
|
||||
NSEvent *event = [NSApp currentEvent];
|
||||
BOOL cmdLeftClick = [event type] == NSLeftMouseUp &&
|
||||
[event modifierFlags] & NSCommandKeyMask;
|
||||
BOOL cmdLeftClick = [event type] == NSEventTypeLeftMouseUp &&
|
||||
[event modifierFlags] & NSEventModifierFlagCommand;
|
||||
BOOL zoomBoth = [[NSUserDefaults standardUserDefaults]
|
||||
boolForKey:MMZoomBothKey];
|
||||
zoomBoth = (zoomBoth && !cmdLeftClick) || (!zoomBoth && cmdLeftClick);
|
||||
@@ -1179,7 +1179,7 @@
|
||||
[context setDuration:0.5*duration];
|
||||
[[window animator] setAlphaValue:0];
|
||||
} completionHandler:^{
|
||||
[window setStyleMask:([window styleMask] | NSFullScreenWindowMask)];
|
||||
[window setStyleMask:([window styleMask] | NSWindowStyleMaskFullScreen)];
|
||||
NSString *tabBarStyle = [[self class] tabBarStyleForUnified];
|
||||
[[vimView tabBarControl] setStyleNamed:tabBarStyle];
|
||||
[self updateTablineSeparator];
|
||||
@@ -1244,7 +1244,7 @@
|
||||
|
||||
fullScreenEnabled = NO;
|
||||
[window setAlphaValue:1];
|
||||
[window setStyleMask:([window styleMask] & ~NSFullScreenWindowMask)];
|
||||
[window setStyleMask:([window styleMask] & ~NSWindowStyleMaskFullScreen)];
|
||||
NSString *tabBarStyle = [[self class] tabBarStyleForMetal];
|
||||
[[vimView tabBarControl] setStyleNamed:tabBarStyle];
|
||||
[self updateTablineSeparator];
|
||||
@@ -1275,7 +1275,7 @@
|
||||
[context setDuration:0.5*duration];
|
||||
[[window animator] setAlphaValue:0];
|
||||
} completionHandler:^{
|
||||
[window setStyleMask:([window styleMask] & ~NSFullScreenWindowMask)];
|
||||
[window setStyleMask:([window styleMask] & ~NSWindowStyleMaskFullScreen)];
|
||||
NSString *tabBarStyle = [[self class] tabBarStyleForMetal];
|
||||
[[vimView tabBarControl] setStyleNamed:tabBarStyle];
|
||||
[self updateTablineSeparator];
|
||||
@@ -1323,7 +1323,7 @@
|
||||
|
||||
fullScreenEnabled = YES;
|
||||
[window setAlphaValue:1];
|
||||
[window setStyleMask:([window styleMask] | NSFullScreenWindowMask)];
|
||||
[window setStyleMask:([window styleMask] | NSWindowStyleMaskFullScreen)];
|
||||
NSString *tabBarStyle = [[self class] tabBarStyleForUnified];
|
||||
[[vimView tabBarControl] setStyleNamed:tabBarStyle];
|
||||
[self updateTablineSeparator];
|
||||
@@ -1513,7 +1513,7 @@
|
||||
BOOL tabBarVisible = ![[vimView tabBarControl] isHidden];
|
||||
BOOL toolbarHidden = [decoratedWindow toolbar] == nil;
|
||||
BOOL windowTextured = ([decoratedWindow styleMask] &
|
||||
NSTexturedBackgroundWindowMask) != 0;
|
||||
NSWindowStyleMaskTexturedBackground) != 0;
|
||||
BOOL hideSeparator = NO;
|
||||
|
||||
if (fullScreenEnabled || tabBarVisible)
|
||||
|
||||
+57
-10
@@ -9,8 +9,6 @@
|
||||
*/
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
#import <asl.h>
|
||||
|
||||
|
||||
// Taken from /usr/include/AvailabilityMacros.h
|
||||
#ifndef MAC_OS_X_VERSION_10_7
|
||||
@@ -28,6 +26,9 @@
|
||||
#ifndef MAC_OS_X_VERSION_10_11
|
||||
# define MAC_OS_X_VERSION_10_11 101100
|
||||
#endif
|
||||
#ifndef MAC_OS_X_VERSION_10_12
|
||||
# define MAC_OS_X_VERSION_10_12 101200
|
||||
#endif
|
||||
|
||||
// Needed for pre-10.11 SDK
|
||||
#ifndef NSAppKitVersionNumber10_10
|
||||
@@ -37,6 +38,29 @@
|
||||
# define NSAppKitVersionNumber10_10_Max 1349
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||
// Deprecated constants in 10.12 SDK
|
||||
# define NSAlertStyleWarning NSWarningAlertStyle
|
||||
# define NSControlSizeRegular NSRegularControlSize
|
||||
# define NSEventModifierFlagCommand NSCommandKeyMask
|
||||
# define NSEventTypeLeftMouseUp NSLeftMouseUp
|
||||
# define NSEventTypeRightMouseDown NSRightMouseDown
|
||||
# define NSWindowStyleMaskClosable NSClosableWindowMask
|
||||
# define NSWindowStyleMaskFullScreen NSFullScreenWindowMask
|
||||
# define NSWindowStyleMaskMiniaturizable NSMiniaturizableWindowMask
|
||||
# define NSWindowStyleMaskResizable NSResizableWindowMask
|
||||
# define NSWindowStyleMaskTexturedBackground NSTexturedBackgroundWindowMask
|
||||
# define NSWindowStyleMaskTitled NSTitledWindowMask
|
||||
# define NSWindowStyleMaskUnifiedTitleAndToolbar NSUnifiedTitleAndToolbarWindowMask
|
||||
#endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||
# import <asl.h>
|
||||
# define MM_USE_ASL
|
||||
#else
|
||||
# import <os/log.h>
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// This is the protocol MMBackend implements.
|
||||
@@ -360,7 +384,10 @@ extern int ASLogLevel;
|
||||
|
||||
void ASLInit();
|
||||
|
||||
#define ASLog(level, fmt, ...) \
|
||||
#if defined(MM_USE_ASL)
|
||||
|
||||
# define MM_ASL_LEVEL_DEFAULT ASL_LEVEL_NOTICE
|
||||
# define ASLog(level, fmt, ...) \
|
||||
if (level <= ASLogLevel) { \
|
||||
asl_log(NULL, NULL, level, "%s@%d: %s", \
|
||||
__PRETTY_FUNCTION__, __LINE__, \
|
||||
@@ -369,10 +396,30 @@ void ASLInit();
|
||||
|
||||
// Note: These macros are used like ASLogErr(@"text num=%d", 42). Objective-C
|
||||
// style specifiers (%@) are supported.
|
||||
#define ASLogCrit(fmt, ...) ASLog(ASL_LEVEL_CRIT, fmt, ##__VA_ARGS__)
|
||||
#define ASLogErr(fmt, ...) ASLog(ASL_LEVEL_ERR, fmt, ##__VA_ARGS__)
|
||||
#define ASLogWarn(fmt, ...) ASLog(ASL_LEVEL_WARNING, fmt, ##__VA_ARGS__)
|
||||
#define ASLogNotice(fmt, ...) ASLog(ASL_LEVEL_NOTICE, fmt, ##__VA_ARGS__)
|
||||
#define ASLogInfo(fmt, ...) ASLog(ASL_LEVEL_INFO, fmt, ##__VA_ARGS__)
|
||||
#define ASLogDebug(fmt, ...) ASLog(ASL_LEVEL_DEBUG, fmt, ##__VA_ARGS__)
|
||||
#define ASLogTmp(fmt, ...) ASLog(ASL_LEVEL_NOTICE, fmt, ##__VA_ARGS__)
|
||||
# define ASLogCrit(fmt, ...) ASLog(ASL_LEVEL_CRIT, fmt, ##__VA_ARGS__)
|
||||
# define ASLogErr(fmt, ...) ASLog(ASL_LEVEL_ERR, fmt, ##__VA_ARGS__)
|
||||
# define ASLogWarn(fmt, ...) ASLog(ASL_LEVEL_WARNING, fmt, ##__VA_ARGS__)
|
||||
# define ASLogNotice(fmt, ...) ASLog(ASL_LEVEL_NOTICE, fmt, ##__VA_ARGS__)
|
||||
# define ASLogInfo(fmt, ...) ASLog(ASL_LEVEL_INFO, fmt, ##__VA_ARGS__)
|
||||
# define ASLogDebug(fmt, ...) ASLog(ASL_LEVEL_DEBUG, fmt, ##__VA_ARGS__)
|
||||
# define ASLogTmp(fmt, ...) ASLog(ASL_LEVEL_NOTICE, fmt, ##__VA_ARGS__)
|
||||
|
||||
#else
|
||||
|
||||
# define MM_ASL_LEVEL_DEFAULT OS_LOG_TYPE_DEFAULT
|
||||
# define ASLog(level, fmt, ...) \
|
||||
if (level <= ASLogLevel) { \
|
||||
os_log_with_type(OS_LOG_DEFAULT, level, "%s@%d: %s", \
|
||||
__PRETTY_FUNCTION__, __LINE__, \
|
||||
[[NSString stringWithFormat:fmt, ##__VA_ARGS__] UTF8String]); \
|
||||
}
|
||||
|
||||
# define ASLogCrit(fmt, ...) ASLog(OS_LOG_TYPE_FAULT, fmt, ##__VA_ARGS__)
|
||||
# define ASLogErr(fmt, ...) ASLog(OS_LOG_TYPE_ERROR, fmt, ##__VA_ARGS__)
|
||||
# define ASLogWarn(fmt, ...) ASLog(OS_LOG_TYPE_DEFAULT, fmt, ##__VA_ARGS__)
|
||||
# define ASLogNotice(fmt, ...) ASLog(OS_LOG_TYPE_DEFAULT, fmt, ##__VA_ARGS__)
|
||||
# define ASLogInfo(fmt, ...) ASLog(OS_LOG_TYPE_INFO, fmt, ##__VA_ARGS__)
|
||||
# define ASLogDebug(fmt, ...) ASLog(OS_LOG_TYPE_DEBUG, fmt, ##__VA_ARGS__)
|
||||
# define ASLogTmp(fmt, ...) ASLog(OS_LOG_TYPE_DEFAULT, fmt, ##__VA_ARGS__)
|
||||
|
||||
#endif
|
||||
|
||||
+19
-3
@@ -124,7 +124,7 @@ NSString *MMRendererKey = @"MMRenderer";
|
||||
// Vim find pasteboard type (string contains Vim regex patterns)
|
||||
NSString *VimFindPboardType = @"VimFindPboardType";
|
||||
|
||||
int ASLogLevel = ASL_LEVEL_NOTICE;
|
||||
int ASLogLevel = MM_ASL_LEVEL_DEFAULT;
|
||||
|
||||
|
||||
|
||||
@@ -378,12 +378,27 @@ ASLInit()
|
||||
if (logLevelObj) {
|
||||
int logLevel = [logLevelObj intValue];
|
||||
if (logLevel < 0) logLevel = 0;
|
||||
#if defined(MM_USE_ASL)
|
||||
if (logLevel > ASL_LEVEL_DEBUG) logLevel = ASL_LEVEL_DEBUG;
|
||||
|
||||
ASLogLevel = logLevel;
|
||||
asl_set_filter(NULL, ASL_FILTER_MASK_UPTO(logLevel));
|
||||
#else
|
||||
switch (logLevel) {
|
||||
case 0: case 1: case 2:
|
||||
logLevel = OS_LOG_TYPE_FAULT; break;
|
||||
case 3:
|
||||
logLevel = OS_LOG_TYPE_ERROR; break;
|
||||
case 4: case 5:
|
||||
logLevel = OS_LOG_TYPE_DEFAULT; break;
|
||||
case 6:
|
||||
logLevel = OS_LOG_TYPE_INFO; break;
|
||||
default:
|
||||
logLevel = OS_LOG_TYPE_DEBUG; break;
|
||||
}
|
||||
#endif
|
||||
ASLogLevel = logLevel;
|
||||
}
|
||||
|
||||
#if defined(MM_USE_ASL)
|
||||
// Allow for changing whether a copy of each log should be sent to stderr
|
||||
// (this defaults to NO if this key is missing in the user defaults
|
||||
// database). The above filter mask is applied to logs going to stderr,
|
||||
@@ -391,4 +406,5 @@ ASLInit()
|
||||
BOOL logToStdErr = [ud boolForKey:MMLogToStdErrKey];
|
||||
if (logToStdErr)
|
||||
asl_add_log_file(NULL, 2); // The file descriptor for stderr is 2
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ showHiddenFilesView()
|
||||
[button setAction:@selector(hiddenFilesButtonToggled:)];
|
||||
|
||||
// Use the regular control size (checkbox is a bit smaller without this)
|
||||
NSControlSize buttonSize = NSRegularControlSize;
|
||||
NSControlSize buttonSize = NSControlSizeRegular;
|
||||
float fontSize = [NSFont systemFontSizeForControlSize:buttonSize];
|
||||
NSCell *theCell = [button cell];
|
||||
NSFont *theFont = [NSFont fontWithName:[[theCell font] fontName]
|
||||
|
||||
@@ -303,7 +303,7 @@ void MyNSDrawWindowBackground(NSRect rect)
|
||||
if (!truncatingTailParagraphStyle) {
|
||||
truncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain];
|
||||
[truncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail];
|
||||
[truncatingTailParagraphStyle setAlignment:NSCenterTextAlignment];
|
||||
[truncatingTailParagraphStyle setAlignment:NSTextAlignmentCenter];
|
||||
}
|
||||
[attrStr addAttribute:NSParagraphStyleAttributeName value:truncatingTailParagraphStyle range:range];
|
||||
|
||||
@@ -356,7 +356,7 @@ void MyNSDrawWindowBackground(NSRect rect)
|
||||
// rollover
|
||||
if ([cell isHighlighted]) {
|
||||
[[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set];
|
||||
NSRectFillUsingOperation(aRect, NSCompositeSourceAtop);
|
||||
NSRectFillUsingOperation(aRect, NSCompositingOperationSourceAtop);
|
||||
}
|
||||
|
||||
aRect.origin.x -= 1;
|
||||
@@ -393,7 +393,7 @@ void MyNSDrawWindowBackground(NSRect rect)
|
||||
if ([cell closeButtonPressed]) closeButton = metalCloseButtonDown;
|
||||
|
||||
closeButtonSize = [closeButton size];
|
||||
[closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil];
|
||||
[closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil];
|
||||
|
||||
// scoot label over
|
||||
labelPosition += closeButtonSize.width + kPSMTabBarCellPadding;
|
||||
@@ -462,7 +462,7 @@ void MyNSDrawWindowBackground(NSRect rect)
|
||||
{
|
||||
MyNSDrawWindowBackground(rect);
|
||||
[[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set];
|
||||
NSRectFillUsingOperation(rect, NSCompositeSourceAtop);
|
||||
NSRectFillUsingOperation(rect, NSCompositingOperationSourceAtop);
|
||||
[[NSColor darkGrayColor] set];
|
||||
[NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,rect.origin.y+0.5) toPoint:NSMakePoint(rect.origin.x+rect.size.width,rect.origin.y+0.5)];
|
||||
[NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,rect.origin.y+rect.size.height-0.5) toPoint:NSMakePoint(rect.origin.x+rect.size.width,rect.origin.y+rect.size.height-0.5)];
|
||||
@@ -479,7 +479,7 @@ void MyNSDrawWindowBackground(NSRect rect)
|
||||
[attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range];
|
||||
if (!centeredParagraphStyle) {
|
||||
centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain];
|
||||
[centeredParagraphStyle setAlignment:NSCenterTextAlignment];
|
||||
[centeredParagraphStyle setAlignment:NSTextAlignmentCenter];
|
||||
}
|
||||
[attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range];
|
||||
[attrStr drawInRect:labelRect];
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
NSMidY(bounds) - (imageSize.height * 0.5f));
|
||||
[image drawAtPoint:drawPoint
|
||||
fromRect:NSZeroRect
|
||||
operation:NSCompositeSourceOver
|
||||
operation:NSCompositingOperationSourceOver
|
||||
fraction:1.0f];
|
||||
}
|
||||
|
||||
|
||||
@@ -296,7 +296,7 @@
|
||||
{
|
||||
if(_isPlaceholder){
|
||||
[[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set];
|
||||
NSRectFillUsingOperation(cellFrame, NSCompositeSourceAtop);
|
||||
NSRectFillUsingOperation(cellFrame, NSCompositingOperationSourceAtop);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -344,7 +344,7 @@
|
||||
[image addRepresentation:rep];
|
||||
NSImage *returnImage = [[[NSImage alloc] initWithSize:[rep size]] autorelease];
|
||||
[returnImage lockFocus];
|
||||
[image drawAtPoint:NSMakePoint(0.0, 0.0) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:0.7];
|
||||
[image drawAtPoint:NSMakePoint(0.0, 0.0) fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:0.7];
|
||||
[returnImage unlockFocus];
|
||||
if(![[self indicator] isHidden]){
|
||||
NSImage *pi = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"pi"]];
|
||||
@@ -352,7 +352,7 @@
|
||||
NSPoint indicatorPoint = NSMakePoint([self frame].size.width - MARGIN_X - kPSMTabBarIndicatorWidth, MARGIN_Y);
|
||||
if(([self state] == NSOnState) && ([[_controlView styleName] isEqualToString:@"Metal"]))
|
||||
indicatorPoint.y += 1.0;
|
||||
[pi drawAtPoint:indicatorPoint fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:0.7];
|
||||
[pi drawAtPoint:indicatorPoint fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:0.7];
|
||||
[returnImage unlockFocus];
|
||||
[pi release];
|
||||
}
|
||||
|
||||
@@ -12,6 +12,12 @@
|
||||
|
||||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
#if !defined(MAC_OS_X_VERSION_10_12) || \
|
||||
MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_12
|
||||
# define NSCompositingOperationSourceOver NSCompositeSourceOver
|
||||
# define NSCompositingOperationSourceAtop NSCompositeSourceAtop
|
||||
# define NSTextAlignmentCenter NSCenterTextAlignment
|
||||
#endif
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10
|
||||
# define kPSMTabBarControlHeight 25
|
||||
#else
|
||||
|
||||
@@ -336,7 +336,7 @@
|
||||
if ([cell isHighlighted])
|
||||
{
|
||||
[[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set];
|
||||
NSRectFillUsingOperation(aRect, NSCompositeSourceAtop);
|
||||
NSRectFillUsingOperation(aRect, NSCompositingOperationSourceAtop);
|
||||
}
|
||||
|
||||
// frame
|
||||
@@ -389,7 +389,7 @@
|
||||
if ([cell closeButtonPressed]) closeButton = unifiedCloseButtonDown;
|
||||
|
||||
closeButtonSize = [closeButton size];
|
||||
[closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil];
|
||||
[closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil];
|
||||
|
||||
// scoot label over
|
||||
labelPosition += closeButtonSize.width + kPSMTabBarCellPadding;
|
||||
@@ -473,7 +473,7 @@
|
||||
[attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range];
|
||||
if (!centeredParagraphStyle) {
|
||||
centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain];
|
||||
[centeredParagraphStyle setAlignment:NSCenterTextAlignment];
|
||||
[centeredParagraphStyle setAlignment:NSTextAlignmentCenter];
|
||||
}
|
||||
[attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range];
|
||||
[attrStr drawInRect:labelRect];
|
||||
|
||||
@@ -308,7 +308,7 @@ void YosemiteNSDrawWindowBackground(NSRect rect, NSColor *color)
|
||||
if (!truncatingTailParagraphStyle) {
|
||||
truncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain];
|
||||
[truncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingHead];
|
||||
[truncatingTailParagraphStyle setAlignment:NSCenterTextAlignment];
|
||||
[truncatingTailParagraphStyle setAlignment:NSTextAlignmentCenter];
|
||||
}
|
||||
[attrStr addAttribute:NSParagraphStyleAttributeName value:truncatingTailParagraphStyle range:range];
|
||||
|
||||
@@ -353,7 +353,7 @@ void YosemiteNSDrawWindowBackground(NSRect rect, NSColor *color)
|
||||
aRect.origin.x += 0.5;
|
||||
|
||||
[[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set];
|
||||
NSRectFillUsingOperation(aRect, NSCompositeSourceAtop);
|
||||
NSRectFillUsingOperation(aRect, NSCompositingOperationSourceAtop);
|
||||
|
||||
// frame
|
||||
[lineColor set];
|
||||
@@ -385,7 +385,7 @@ void YosemiteNSDrawWindowBackground(NSRect rect, NSColor *color)
|
||||
if ([cell closeButtonPressed]) button = closeButtonDown;
|
||||
|
||||
closeButtonSize = [button size];
|
||||
[button drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0 respectFlipped:YES hints:nil];
|
||||
[button drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil];
|
||||
}
|
||||
|
||||
// object counter
|
||||
@@ -432,7 +432,7 @@ void YosemiteNSDrawWindowBackground(NSRect rect, NSColor *color)
|
||||
YosemiteNSDrawWindowBackground(rect, [self backgroundColor:isKeyWindow]);
|
||||
|
||||
[[NSColor colorWithCalibratedWhite:0.0 alpha:0.0] set];
|
||||
NSRectFillUsingOperation(rect, NSCompositeSourceAtop);
|
||||
NSRectFillUsingOperation(rect, NSCompositingOperationSourceAtop);
|
||||
[[self borderColor] set];
|
||||
[NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,rect.origin.y+0.5) toPoint:NSMakePoint(rect.origin.x+rect.size.width,rect.origin.y+0.5)];
|
||||
[NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,rect.origin.y+rect.size.height-0.5) toPoint:NSMakePoint(rect.origin.x+rect.size.width,rect.origin.y+rect.size.height-0.5)];
|
||||
@@ -449,7 +449,7 @@ void YosemiteNSDrawWindowBackground(NSRect rect, NSColor *color)
|
||||
[attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range];
|
||||
if (!centeredParagraphStyle) {
|
||||
centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain];
|
||||
[centeredParagraphStyle setAlignment:NSCenterTextAlignment];
|
||||
[centeredParagraphStyle setAlignment:NSTextAlignmentCenter];
|
||||
}
|
||||
[attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range];
|
||||
[attrStr drawInRect:labelRect];
|
||||
|
||||
@@ -1508,7 +1508,7 @@ gui_mch_dialog(
|
||||
gui_macvim_force_flush();
|
||||
|
||||
int style = NSInformationalAlertStyle;
|
||||
if (VIM_WARNING == type) style = NSWarningAlertStyle;
|
||||
if (VIM_WARNING == type) style = NSAlertStyleWarning;
|
||||
else if (VIM_ERROR == type) style = NSCriticalAlertStyle;
|
||||
|
||||
NSMutableDictionary *attr = [NSMutableDictionary
|
||||
@@ -2253,7 +2253,7 @@ static int vimModMaskToEventModifierFlags(int mods)
|
||||
if (mods & MOD_MASK_ALT)
|
||||
flags |= NSAlternateKeyMask;
|
||||
if (mods & MOD_MASK_CMD)
|
||||
flags |= NSCommandKeyMask;
|
||||
flags |= NSEventModifierFlagCommand;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -124,6 +124,7 @@
|
||||
#endif
|
||||
#ifdef RUBY19_OR_LATER
|
||||
# ifdef FEAT_GUI_MACVIM
|
||||
# undef SIZEOF_TIME_T
|
||||
# include <Ruby/ruby/encoding.h>
|
||||
# else
|
||||
# include <ruby/encoding.h>
|
||||
|
||||
Reference in New Issue
Block a user