Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #946 from s4y/xcode-11-build
Fix building with Xcode 11
  • Loading branch information
ychin committed Oct 6, 2019
2 parents 8eea335 + 6a534f5 commit b72b455
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/MacVim/MacVim.xcodeproj/project.pbxproj
Expand Up @@ -157,7 +157,7 @@
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 6;
dstSubfolderSpec = 7;
files = (
528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */,
);
Expand Down
4 changes: 2 additions & 2 deletions src/MacVim/PSMTabBarControl/source/PSMTabBarCell.h
Expand Up @@ -34,14 +34,14 @@
NSString *_toolTip;
}

@property(assign) PSMTabBarControl* controlView;

// creation/destruction
- (id)initWithControlView:(PSMTabBarControl *)controlView;
- (id)initPlaceholderWithFrame:(NSRect)frame expanded:(BOOL)value inControlView:(PSMTabBarControl *)controlView;
- (void)dealloc;

// accessors
- (id)controlView;
- (void)setControlView:(id)view;
- (NSTrackingRectTag)closeButtonTrackingTag;
- (void)setCloseButtonTrackingTag:(NSTrackingRectTag)tag;
- (NSTrackingRectTag)cellTrackingTag;
Expand Down
46 changes: 18 additions & 28 deletions src/MacVim/PSMTabBarControl/source/PSMTabBarCell.m
Expand Up @@ -14,14 +14,15 @@


@implementation PSMTabBarCell
@dynamic controlView;

#pragma mark -
#pragma mark Creation/Destruction
- (id)initWithControlView:(PSMTabBarControl *)controlView
{
self = [super init];
if(self){
_controlView = controlView;
self.controlView = controlView;
_closeButtonTrackingTag = 0;
_cellTrackingTag = 0;
_closeButtonOver = NO;
Expand All @@ -41,7 +42,7 @@ - (id)initPlaceholderWithFrame:(NSRect)frame expanded:(BOOL)value inControlView:
{
self = [super init];
if(self){
_controlView = controlView;
self.controlView = controlView;
_isPlaceholder = YES;
if(!value)
frame.size.width = 0.0;
Expand Down Expand Up @@ -76,17 +77,6 @@ - (void)dealloc
#pragma mark -
#pragma mark Accessors

- (id)controlView
{
return _controlView;
}

- (void)setControlView:(id)view
{
// no retain release pattern, as this simply switches a tab to another view.
_controlView = view;
}

- (NSTrackingRectTag)closeButtonTrackingTag
{
return _closeButtonTrackingTag;
Expand Down Expand Up @@ -127,7 +117,7 @@ - (void)setStringValue:(NSString *)aString
[super setStringValue:aString];
_stringSize = [[self attributedStringValue] size];
// need to redisplay now - binding observation was too quick.
[_controlView update];
[self.controlView update];
}

- (NSSize)stringSize
Expand All @@ -137,7 +127,7 @@ - (NSSize)stringSize

- (NSAttributedString *)attributedStringValue
{
return [[_controlView psmTabStyle] attributedStringValueForTabCell:self];
return [[self.controlView psmTabStyle] attributedStringValueForTabCell:self];
}

- (int)tabState
Expand Down Expand Up @@ -213,7 +203,7 @@ - (BOOL)hasIcon
- (void)setHasIcon:(BOOL)value
{
_hasIcon = value;
[_controlView update]; // binding notice is too fast
[self.controlView update]; // binding notice is too fast
}

- (int)count
Expand All @@ -224,7 +214,7 @@ - (int)count
- (void)setCount:(int)value
{
_count = value;
[_controlView update]; // binding notice is too fast
[self.controlView update]; // binding notice is too fast
}

- (BOOL)isPlaceholder
Expand Down Expand Up @@ -271,22 +261,22 @@ - (void)setToolTip:(NSString *)tip

- (NSRect)indicatorRectForFrame:(NSRect)cellFrame
{
return [[_controlView psmTabStyle] indicatorRectForTabCell:self];
return [[self.controlView psmTabStyle] indicatorRectForTabCell:self];
}

- (NSRect)closeButtonRectForFrame:(NSRect)cellFrame
{
return [[_controlView psmTabStyle] closeButtonRectForTabCell:self];
return [[self.controlView psmTabStyle] closeButtonRectForTabCell:self];
}

- (float)minimumWidthOfCell
{
return [[_controlView psmTabStyle] minimumWidthOfTabCell:self];
return [[self.controlView psmTabStyle] minimumWidthOfTabCell:self];
}

- (float)desiredWidthOfCell
{
return [[_controlView psmTabStyle] desiredWidthOfTabCell:self];
return [[self.controlView psmTabStyle] desiredWidthOfTabCell:self];
}

#pragma mark -
Expand All @@ -300,7 +290,7 @@ - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
return;
}

[[_controlView psmTabStyle] drawTabCell:self];
[[self.controlView psmTabStyle] drawTabCell:self];
}

#pragma mark -
Expand All @@ -315,7 +305,7 @@ - (void)mouseEntered:(NSEvent *)theEvent
if([theEvent trackingNumber] == _cellTrackingTag){
[self setHighlighted:YES];
}
[_controlView setNeedsDisplay];
[self.controlView setNeedsDisplay];
}

- (void)mouseExited:(NSEvent *)theEvent
Expand All @@ -327,22 +317,22 @@ - (void)mouseExited:(NSEvent *)theEvent
if([theEvent trackingNumber] == _cellTrackingTag){
[self setHighlighted:NO];
}
[_controlView setNeedsDisplay];
[self.controlView setNeedsDisplay];
}

#pragma mark -
#pragma mark Drag Support

- (NSImage*)dragImageForRect:(NSRect)cellFrame
{
if(([self state] == NSOnState) && ([[_controlView styleName] isEqualToString:@"Metal"]))
if(([self state] == NSOnState) && ([[self.controlView styleName] isEqualToString:@"Metal"]))
cellFrame.size.width += 1.0;
[_controlView lockFocus];
[self.controlView lockFocus];

NSBitmapImageRep *rep = [[self controlView] bitmapImageRepForCachingDisplayInRect:cellFrame];
[[self controlView] cacheDisplayInRect:cellFrame toBitmapImageRep:rep];

[_controlView unlockFocus];
[self.controlView unlockFocus];
NSImage *image = [[[NSImage alloc] initWithSize:[rep size]] autorelease];
[image addRepresentation:rep];
NSImage *returnImage = [[[NSImage alloc] initWithSize:[rep size]] autorelease];
Expand All @@ -353,7 +343,7 @@ - (NSImage*)dragImageForRect:(NSRect)cellFrame
NSImage *pi = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"pi"]];
[returnImage lockFocus];
NSPoint indicatorPoint = NSMakePoint([self frame].size.width - MARGIN_X - kPSMTabBarIndicatorWidth, MARGIN_Y);
if(([self state] == NSOnState) && ([[_controlView styleName] isEqualToString:@"Metal"]))
if(([self state] == NSOnState) && ([[self.controlView styleName] isEqualToString:@"Metal"]))
indicatorPoint.y += 1.0;
[pi drawAtPoint:indicatorPoint fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:0.7];
[returnImage unlockFocus];
Expand Down
2 changes: 1 addition & 1 deletion src/MacVim/gvimrc
Expand Up @@ -37,7 +37,7 @@ endif
set printexpr=system('open\ -a\ Preview\ '.v:fname_in)\ +\ v:shell_error

" askpass
let $SSH_ASKPASS = simplify($VIM . '/../../MacOS') . '/macvim-askpass'
let $SSH_ASKPASS = simplify($VIM . '/../../Resources') . '/macvim-askpass'
let $SUDO_ASKPASS = $SSH_ASKPASS


Expand Down

0 comments on commit b72b455

Please sign in to comment.