diff --git a/runtime/doc/gui_mac.txt b/runtime/doc/gui_mac.txt index a9e733e341..54c2170b44 100644 --- a/runtime/doc/gui_mac.txt +++ b/runtime/doc/gui_mac.txt @@ -277,7 +277,7 @@ KEY VALUE ~ *MMSmoothResize* allow smooth resizing of MacVim window [bool] *MMShareFindPboard* share search text to Find Pasteboard [bool] *MMShowAddTabButton* enable "add tab" button on tabline [bool] -*MMTabMaxWidth* maximum width of a tab [int] +*MMShowTabScrollButtons* enable tab scroll buttons on tabline [bool] *MMTabMinWidth* minimum width of a tab [int] *MMTabOptimumWidth* default width of a tab [int] *MMTextInsetBottom* text area offset in pixels [int] diff --git a/src/MacVim/MMAppController.m b/src/MacVim/MMAppController.m index 9f25be5331..6a2f5efa0c 100644 --- a/src/MacVim/MMAppController.m +++ b/src/MacVim/MMAppController.m @@ -198,28 +198,12 @@ + (void)initialize [NSWindow setAllowsAutomaticWindowTabbing:NO]; } - int tabMinWidthKey; - int tabMaxWidthKey; - int tabOptimumWidthKey; - if (shouldUseYosemiteTabBarStyle()) { - tabMinWidthKey = 120; - tabMaxWidthKey = 0; - tabOptimumWidthKey = 0; - } else { - tabMinWidthKey = 64; - tabMaxWidthKey = 6*64; - tabOptimumWidthKey = 132; - } - NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:NO], MMNoWindowKey, - [NSNumber numberWithInt:tabMinWidthKey], - MMTabMinWidthKey, - [NSNumber numberWithInt:tabMaxWidthKey], - MMTabMaxWidthKey, - [NSNumber numberWithInt:tabOptimumWidthKey], - MMTabOptimumWidthKey, + [NSNumber numberWithInt:120], MMTabMinWidthKey, + [NSNumber numberWithInt:200], MMTabOptimumWidthKey, [NSNumber numberWithBool:YES], MMShowAddTabButtonKey, + [NSNumber numberWithBool:YES], MMShowTabScrollButtonsKey, [NSNumber numberWithInt:2], MMTextInsetLeftKey, [NSNumber numberWithInt:1], MMTextInsetRightKey, [NSNumber numberWithInt:1], MMTextInsetTopKey, diff --git a/src/MacVim/MMFullScreenWindow.h b/src/MacVim/MMFullScreenWindow.h index 4dd870fd58..0e46520000 100644 --- a/src/MacVim/MMFullScreenWindow.h +++ b/src/MacVim/MMFullScreenWindow.h @@ -18,7 +18,6 @@ NSWindow *target; MMVimView *view; NSPoint oldPosition; - NSString *oldTabBarStyle; int options; int state; diff --git a/src/MacVim/MMFullScreenWindow.m b/src/MacVim/MMFullScreenWindow.m index 4c36ffe2d7..21c5514f4f 100644 --- a/src/MacVim/MMFullScreenWindow.m +++ b/src/MacVim/MMFullScreenWindow.m @@ -29,7 +29,6 @@ #import "MMVimView.h" #import "MMWindowController.h" #import "Miscellaneous.h" -#import // These have to be the same as in option.h #define FUOPT_MAXVERT 0x001 @@ -169,12 +168,6 @@ - (void)enterFullScreen // make target's window controller believe that it's now controlling us [[target windowController] setWindow:self]; - oldTabBarStyle = [[view tabBarControl] styleName]; - - NSString *style = - shouldUseYosemiteTabBarStyle() ? (shouldUseMojaveTabBarStyle() ? @"Mojave" : @"Yosemite") : @"Unified"; - [[view tabBarControl] setStyleNamed:style]; - // add text view oldPosition = [view frame].origin; @@ -268,8 +261,6 @@ - (void)leaveFullScreen [self retain]; // NSWindowController releases us once [[self windowController] setWindow:target]; - [[view tabBarControl] setStyleNamed:oldTabBarStyle]; - // fix delegate id delegate = [self delegate]; [self setDelegate:nil]; diff --git a/src/MacVim/MMTabline/MMHoverButton.h b/src/MacVim/MMTabline/MMHoverButton.h new file mode 100644 index 0000000000..df3322b8a9 --- /dev/null +++ b/src/MacVim/MMTabline/MMHoverButton.h @@ -0,0 +1,11 @@ +#import + +// A button that fades in a circular background when hovered. + +@interface MMHoverButton : NSButton + +@property (nonatomic, retain) NSColor *fgColor; + ++ (NSImage *)imageNamed:(NSString *)name; + +@end diff --git a/src/MacVim/MMTabline/MMHoverButton.m b/src/MacVim/MMTabline/MMHoverButton.m new file mode 100644 index 0000000000..c21fe5559f --- /dev/null +++ b/src/MacVim/MMTabline/MMHoverButton.m @@ -0,0 +1,128 @@ +#import "MMHoverButton.h" + +@implementation MMHoverButton +{ + NSTrackingArea *_trackingArea; + NSBox *_circle; +} + ++ (NSImage *)imageNamed:(NSString *)name +{ + CGFloat size = [name isEqualToString:@"CloseTabButton"] ? 15 : 17; + return [NSImage imageWithSize:NSMakeSize(size, size) flipped:NO drawingHandler:^BOOL(NSRect dstRect) { + NSBezierPath *p = [NSBezierPath new]; + if ([name isEqualToString:@"AddTabButton"]) { + [p moveToPoint:NSMakePoint( 8.5, 4.5)]; + [p lineToPoint:NSMakePoint( 8.5, 12.5)]; + [p moveToPoint:NSMakePoint( 4.5, 8.5)]; + [p lineToPoint:NSMakePoint(12.5, 8.5)]; + [p setLineWidth:1.2]; + [p stroke]; + } + else if ([name isEqualToString:@"CloseTabButton"]) { + [p moveToPoint:NSMakePoint( 4.5, 4.5)]; + [p lineToPoint:NSMakePoint(10.5, 10.5)]; + [p moveToPoint:NSMakePoint( 4.5, 10.5)]; + [p lineToPoint:NSMakePoint(10.5, 4.5)]; + [p setLineWidth:1.2]; + [p stroke]; + } + else if ([name isEqualToString:@"ScrollLeftButton"]) { + [p moveToPoint:NSMakePoint( 5.0, 8.5)]; + [p lineToPoint:NSMakePoint(10.0, 4.5)]; + [p lineToPoint:NSMakePoint(10.0, 12.5)]; + [p fill]; + } + else if ([name isEqualToString:@"ScrollRightButton"]) { + [p moveToPoint:NSMakePoint(12.0, 8.5)]; + [p lineToPoint:NSMakePoint( 7.0, 4.5)]; + [p lineToPoint:NSMakePoint( 7.0, 12.5)]; + [p fill]; + } + return YES; + }]; +} + +- (instancetype)initWithFrame:(NSRect)frameRect +{ + self = [super initWithFrame:frameRect]; + if (self) { + self.buttonType = NSButtonTypeMomentaryChange; + self.bordered = NO; + self.imagePosition = NSImageOnly; + + // This view will fade in/out when hovered. + _circle = [NSBox new]; + _circle.boxType = NSBoxCustom; + _circle.borderWidth = 0; + _circle.alphaValue = 0.16; + _circle.fillColor = NSColor.clearColor; + _circle.autoresizingMask = NSViewWidthSizable | NSViewHeightSizable; + _circle.frame = self.bounds; + [self addSubview:_circle positioned:NSWindowBelow relativeTo:nil]; + } + return self; +} + +- (void)setFgColor:(NSColor *)color +{ + _fgColor = color; + self.image = super.image; +} + +- (void)setImage:(NSImage *)image +{ + _circle.cornerRadius = image.size.width / 2.0; + NSColor *fillColor = self.fgColor ?: NSColor.controlTextColor; + super.image = [NSImage imageWithSize:image.size flipped:NO drawingHandler:^BOOL(NSRect dstRect) { + [image drawInRect:dstRect]; + [fillColor set]; + NSRectFillUsingOperation(dstRect, NSCompositingOperationSourceAtop); + return YES; + }]; + self.alternateImage = [NSImage imageWithSize:image.size flipped:NO drawingHandler:^BOOL(NSRect dstRect) { + [[fillColor colorWithAlphaComponent:0.2] set]; + [[NSBezierPath bezierPathWithOvalInRect:dstRect] fill]; + [super.image drawInRect:dstRect]; + return YES; + }]; +} + +- (void)setEnabled:(BOOL)enabled +{ + [super setEnabled:enabled]; + [self evaluateHover]; +} + +- (void)updateTrackingAreas +{ + [self removeTrackingArea:_trackingArea]; + _trackingArea = [[NSTrackingArea alloc] initWithRect:self.bounds options:(NSTrackingMouseEnteredAndExited | NSTrackingActiveInKeyWindow) owner:self userInfo:nil]; + [self addTrackingArea:_trackingArea]; + [self evaluateHover]; + [super updateTrackingAreas]; +} + +- (void)evaluateHover +{ + NSPoint mouseLocation = [self.window mouseLocationOutsideOfEventStream]; + mouseLocation = [self convertPoint:mouseLocation fromView:nil]; + if (NSPointInRect(mouseLocation, self.bounds)) { + if (self.enabled) _circle.animator.fillColor = self.fgColor ?: NSColor.controlTextColor; + else _circle.animator.fillColor = NSColor.clearColor; + } else { + _circle.animator.fillColor = NSColor.clearColor; + } +} + +- (void)mouseEntered:(NSEvent *)event +{ + if (self.enabled) _circle.animator.fillColor = self.fgColor ?: NSColor.controlTextColor; +} + +- (void)mouseExited:(NSEvent *)event +{ + _circle.animator.fillColor = NSColor.clearColor; +} + +@end diff --git a/src/MacVim/MMTabline/MMTab.h b/src/MacVim/MMTabline/MMTab.h new file mode 100644 index 0000000000..f242553329 --- /dev/null +++ b/src/MacVim/MMTabline/MMTab.h @@ -0,0 +1,23 @@ +#import + +// A tab with a close button and title. + +#define MMTabShadowBlurRadius (2) + +typedef enum : NSUInteger { + MMTabStateSelected, + MMTabStateUnselected, + MMTabStateUnselectedHover, +} MMTabState; + +@class MMTabline; + +@interface MMTab : NSView + +@property (nonatomic, copy) NSString *title; +@property (nonatomic, getter=isCloseButtonHidden) BOOL closeButtonHidden; +@property (nonatomic) MMTabState state; + +- (instancetype)initWithFrame:(NSRect)frameRect tabline:(MMTabline *)tabline; + +@end diff --git a/src/MacVim/MMTabline/MMTab.m b/src/MacVim/MMTabline/MMTab.m new file mode 100644 index 0000000000..1efa44aedc --- /dev/null +++ b/src/MacVim/MMTabline/MMTab.m @@ -0,0 +1,163 @@ +#import +#import "MMTab.h" +#import "MMTabline.h" +#import "MMHoverButton.h" + +@interface MMTab () +@property (nonatomic) NSColor *fillColor; +@end + +@implementation MMTab +{ + MMTabline __weak *_tabline; + MMHoverButton *_closeButton; + NSTextField *_titleLabel; + NSShadow *_shadow; +} + ++ (id)defaultAnimationForKey:(NSAnimatablePropertyKey)key +{ + if ([key isEqualToString:@"fillColor"]) return [CABasicAnimation new]; + return [super defaultAnimationForKey:key]; +} + +- (instancetype)initWithFrame:(NSRect)frameRect tabline:(MMTabline *)tabline +{ + self = [super initWithFrame:frameRect]; + if (self) { + _tabline = tabline; + + _closeButton = [MMHoverButton new]; + _closeButton.image = [MMHoverButton imageNamed:@"CloseTabButton"]; + _closeButton.target = self; + _closeButton.action = @selector(closeTab:); + _closeButton.translatesAutoresizingMaskIntoConstraints = NO; + [self addSubview:_closeButton]; + + _titleLabel = [NSTextField new]; + _titleLabel.stringValue = @"[No Name]"; + _titleLabel.font = [NSFont systemFontOfSize:11 weight:NSFontWeightSemibold]; + _titleLabel.textColor = NSColor.controlTextColor; + _titleLabel.editable = NO; + _titleLabel.selectable = NO; + _titleLabel.bordered = NO; + _titleLabel.bezeled = NO; + _titleLabel.drawsBackground = NO; + _titleLabel.cell.lineBreakMode = NSLineBreakByTruncatingTail; + // Title can be compressed smaller than its contents. See centerConstraint + // below where priority is set less than here for compression resistance. + // This breaks centering and allows label to fill all available space. + [_titleLabel setContentCompressionResistancePriority:NSLayoutPriorityFittingSizeCompression+2 forOrientation:NSLayoutConstraintOrientationHorizontal]; + _titleLabel.translatesAutoresizingMaskIntoConstraints = NO; + [self addSubview:_titleLabel]; + + NSDictionary *viewDict = NSDictionaryOfVariableBindings(_closeButton, _titleLabel); + [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:|-9-[_closeButton]-(>=5)-[_titleLabel]-(>=16)-|" options:NSLayoutFormatAlignAllCenterY metrics:nil views:viewDict]]; + [self addConstraint:[NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeCenterY relatedBy:NSLayoutRelationEqual toItem:_titleLabel attribute:NSLayoutAttributeCenterY multiplier:1 constant:0]]; + NSLayoutConstraint *centerConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeCenterX relatedBy:NSLayoutRelationEqual toItem:_titleLabel attribute:NSLayoutAttributeCenterX multiplier:1 constant:0]; + centerConstraint.priority = NSLayoutPriorityFittingSizeCompression+1; + [self addConstraint:centerConstraint]; + + _shadow = [NSShadow new]; + _shadow.shadowColor = [NSColor colorWithWhite:0 alpha:0.3]; + _shadow.shadowBlurRadius = MMTabShadowBlurRadius; + + self.state = MMTabStateUnselected; + } + return self; +} + +- (void)closeTab:(id)sender +{ + [_tabline closeTab:self force:NO layoutImmediately:NO]; +} + +- (NSString *)title +{ + return _titleLabel.stringValue; +} + +- (void)setTitle:(NSString *)title +{ + _titleLabel.stringValue = title; +} + +- (void)setCloseButtonHidden:(BOOL)closeButtonHidden +{ + _closeButtonHidden = closeButtonHidden; + _closeButton.hidden = closeButtonHidden; +} + +- (void)setFillColor:(NSColor *)fillColor +{ + _fillColor = fillColor; + self.needsDisplay = YES; +} + +- (void)setState:(MMTabState)state +{ + // Transitions to and from MMTabStateSelected + // DO NOT animate so that UX feels snappier. + if (state == MMTabStateSelected) { + _closeButton.fgColor = _tabline.tablineSelFgColor; + _titleLabel.textColor = _tabline.tablineSelFgColor; + self.fillColor = _tabline.tablineSelBgColor; + self.shadow = _shadow; + } + else if (state == MMTabStateUnselected) { + if (_state == MMTabStateSelected) { + _closeButton.fgColor = _tabline.tablineFgColor; + _titleLabel.textColor = _tabline.tablineFgColor; + self.fillColor = _tabline.tablineBgColor; + } else { + _closeButton.animator.fgColor = _tabline.tablineFgColor; + _titleLabel.animator.textColor = _tabline.tablineFgColor; + self.animator.fillColor = _tabline.tablineBgColor; + } + self.shadow = nil; + } + else { // state == MMTabStateUnselectedHover + _closeButton.animator.fgColor = _tabline.tablineSelFgColor; + _titleLabel.animator.textColor = _tabline.tablineSelFgColor; + self.animator.fillColor = self.unselectedHoverColor; + self.animator.shadow = _shadow; + } + _state = state; +} + +- (NSColor *)unselectedHoverColor +{ // stackoverflow.com/a/52516863/111418 + NSAppearance *currentAppearance = NSAppearance.currentAppearance; + NSAppearance.currentAppearance = self.effectiveAppearance; + NSColor *c = [_tabline.tablineSelBgColor blendedColorWithFraction:0.6 ofColor:_tabline.tablineBgColor]; + NSAppearance.currentAppearance = currentAppearance; + return c; +} + +- (void)drawRect:(NSRect)dirtyRect +{ + [self.fillColor set]; + CGFloat minX = MMTabShadowBlurRadius; + CGFloat maxX = NSMaxX(self.bounds); + CGFloat maxY = MMTablineHeight; + NSBezierPath *p = [NSBezierPath new]; + [p moveToPoint:NSMakePoint(minX, 0)]; + [p lineToPoint:NSMakePoint(minX + 3.6, maxY - 2.5)]; + [p curveToPoint: NSMakePoint(minX + 6.5, maxY) controlPoint1: NSMakePoint(minX + 3.8, maxY - 1) controlPoint2: NSMakePoint(minX + 5.1, maxY)]; + [p lineToPoint:NSMakePoint(maxX - 6.5 - minX, maxY)]; + [p curveToPoint:NSMakePoint(maxX - 3.6 - minX, maxY - 2.5) controlPoint1: NSMakePoint(maxX - 5.1 - minX, maxY) controlPoint2: NSMakePoint(maxX - 3.8 - minX, maxY - 1)]; + [p lineToPoint:NSMakePoint(maxX - minX, 0)]; + [p closePath]; + // On macOS 11, translate the tab down 0.5pt to provide a thin + // line between the top of the tab and the window's title bar. + // It looks better given the new way macOS 11 draws title bars. + // Older macOS versions don't need this. + if (@available(macOS 11.0, *)) { + NSAffineTransform *transform = [NSAffineTransform new]; + [transform translateXBy:0 yBy:-0.5]; + [p transformUsingAffineTransform:transform]; + } + [p fill]; +} + +@end diff --git a/src/MacVim/MMTabline/MMTabline.h b/src/MacVim/MMTabline/MMTabline.h new file mode 100644 index 0000000000..b71fbf0da1 --- /dev/null +++ b/src/MacVim/MMTabline/MMTabline.h @@ -0,0 +1,47 @@ +#import +#import "MMHoverButton.h" +#import "MMTab.h" + +// A tabline containing one or more tabs. + +#define MMTablineHeight (23) + +@protocol MMTablineDelegate; + +@interface MMTabline : NSView + +@property (nonatomic) NSUInteger selectedTabIndex; +@property (nonatomic) NSUInteger optimumTabWidth; +@property (nonatomic) NSUInteger minimumTabWidth; +@property (nonatomic) BOOL showsAddTabButton; +@property (nonatomic) BOOL showsTabScrollButtons; +@property (nonatomic, readonly) NSUInteger numberOfTabs; +@property (nonatomic, retain, readonly) MMHoverButton *addTabButton; +@property (nonatomic, retain) NSColor *tablineBgColor; +@property (nonatomic, retain) NSColor *tablineFgColor; +@property (nonatomic, retain) NSColor *tablineSelBgColor; +@property (nonatomic, retain) NSColor *tablineSelFgColor; +@property (nonatomic, retain) NSColor *tablineFillFgColor; +@property (nonatomic, weak) id delegate; + +- (NSUInteger)addTabAtEnd; +- (NSUInteger)addTabAfterSelectedTab; +- (NSUInteger)addTabAtIndex:(NSUInteger)index; +- (void)closeTab:(MMTab *)tab force:(BOOL)force layoutImmediately:(BOOL)layoutImmediately; +- (void)selectTabAtIndex:(NSUInteger)index; +- (MMTab *)tabAtIndex:(NSUInteger)index; +- (void)scrollTabToVisibleAtIndex:(NSUInteger)index; +- (void)setTablineSelBackground:(NSColor *)back foreground:(NSColor *)fore; + +@end + +@protocol MMTablineDelegate +@optional + +- (BOOL)tabline:(MMTabline *)tabline shouldSelectTabAtIndex:(NSUInteger)index; +- (BOOL)tabline:(MMTabline *)tabline shouldCloseTabAtIndex:(NSUInteger)index; +- (void)tabline:(MMTabline *)tabline didDragTab:(MMTab *)tab toIndex:(NSUInteger)index; +- (NSDragOperation)tabline:(MMTabline *)tabline draggingEntered:(id )dragInfo forTabAtIndex:(NSUInteger)index; +- (BOOL)tabline:(MMTabline *)tabline performDragOperation:(id )dragInfo forTabAtIndex:(NSUInteger)index; + +@end diff --git a/src/MacVim/MMTabline/MMTabline.m b/src/MacVim/MMTabline/MMTabline.m new file mode 100644 index 0000000000..270b92c293 --- /dev/null +++ b/src/MacVim/MMTabline/MMTabline.m @@ -0,0 +1,692 @@ +#import +#import +#import "MMTabline.h" +#import "Miscellaneous.h" + +typedef struct TabWidth { + CGFloat width; + CGFloat remainder; +} TabWidth; + +const CGFloat OptimumTabWidth = 200; +const CGFloat MinimumTabWidth = 100; +const CGFloat TabOverlap = 6; + +MMHoverButton* MakeHoverButton(MMTabline *tabline, NSString *imageName, NSString *tooltip, SEL action, BOOL continuous) { + MMHoverButton *button = [MMHoverButton new]; + button.image = [MMHoverButton imageNamed:imageName]; + button.translatesAutoresizingMaskIntoConstraints = NO; + button.target = tabline; + button.action = action; + button.continuous = continuous; + [button sizeToFit]; + [button setToolTip:NSLocalizedString(tooltip, @"Tabline button")]; + [tabline addSubview:button]; + return button; +} + +@implementation MMTabline +{ + NSView *_tabsContainer; + NSScrollView *_scrollView; + NSMutableArray *_tabs; + NSTrackingArea *_trackingArea; + NSLayoutConstraint *_tabScrollButtonsLeadingConstraint; + NSLayoutConstraint *_addTabButtonTrailingConstraint; + BOOL _pendingFixupLayout; + MMTab *_selectedTab; + MMTab *_draggedTab; + CGFloat _xOffsetForDrag; + NSInteger _initialDraggedTabIndex; + NSInteger _finalDraggedTabIndex; + MMHoverButton *_leftScrollButton; + MMHoverButton *_rightScrollButton; + id _scrollWheelEventMonitor; +} + +@synthesize tablineBgColor = _tablineBgColor; +@synthesize tablineFgColor = _tablineFgColor; +@synthesize tablineSelBgColor = _tablineSelBgColor; +@synthesize tablineSelFgColor = _tablineSelFgColor; +@synthesize tablineFillFgColor = _tablineFillFgColor; + +- (instancetype)initWithFrame:(NSRect)frameRect +{ + self = [super initWithFrame:frameRect]; + if (self) { + self.wantsLayer = YES; // we use -updateLayer to fill background + + _tabs = [NSMutableArray new]; + _showsAddTabButton = YES; // get from NSUserDefaults + _showsTabScrollButtons = YES; // get from NSUserDefaults + + // This view holds the tab views. + _tabsContainer = [NSView new]; + _tabsContainer.frame = (NSRect){{0, 0}, frameRect.size}; + + _scrollView = [NSScrollView new]; + _scrollView.drawsBackground = NO; + _scrollView.verticalScrollElasticity = NSScrollElasticityNone; + _scrollView.contentView.postsBoundsChangedNotifications = YES; + _scrollView.translatesAutoresizingMaskIntoConstraints = NO; + _scrollView.documentView = _tabsContainer; + [self addSubview:_scrollView]; + + _addTabButton = MakeHoverButton(self, @"AddTabButton", @"New Tab (⌘T)", @selector(addTabAtEnd), NO); + _leftScrollButton = MakeHoverButton(self, @"ScrollLeftButton", @"Scroll Tabs", @selector(scrollLeftOneTab), YES); + _rightScrollButton = MakeHoverButton(self, @"ScrollRightButton", @"Scroll Tabs", @selector(scrollRightOneTab), YES); + + [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[_leftScrollButton][_rightScrollButton]-5-[_scrollView]-5-[_addTabButton]" options:NSLayoutFormatAlignAllCenterY metrics:nil views:NSDictionaryOfVariableBindings(_scrollView, _leftScrollButton, _rightScrollButton, _addTabButton)]]; + [self addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[_scrollView]|" options:0 metrics:nil views:@{@"_scrollView":_scrollView}]]; + + _tabScrollButtonsLeadingConstraint = [NSLayoutConstraint constraintWithItem:_leftScrollButton attribute:NSLayoutAttributeLeading relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeading multiplier:1 constant:5]; + [self addConstraint:_tabScrollButtonsLeadingConstraint]; + + _addTabButtonTrailingConstraint = [NSLayoutConstraint constraintWithItem:self attribute:NSLayoutAttributeTrailing relatedBy:NSLayoutRelationEqual toItem:_addTabButton attribute:NSLayoutAttributeTrailing multiplier:1 constant:5]; + [self addConstraint:_addTabButtonTrailingConstraint]; + + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didScroll:) name:NSViewBoundsDidChangeNotification object:_scrollView.contentView]; + + // Monitor for scroll wheel events so we can scroll the tabline + // horizontally without the user having to hold down SHIFT. + _scrollWheelEventMonitor = [NSEvent addLocalMonitorForEventsMatchingMask:NSEventMaskScrollWheel handler:^NSEvent * _Nullable(NSEvent * _Nonnull event) { + NSPoint location = [_scrollView convertPoint:event.locationInWindow fromView:nil]; + // We want events: + // where the mouse is over the _scrollView + // and where the user is not modifying it with the SHIFT key + // and initiated by the scroll wheel and not the trackpad + if ([_scrollView mouse:location inRect:_scrollView.bounds] + && !event.modifierFlags + && !event.hasPreciseScrollingDeltas) + { + // Create a new scroll wheel event based on the original, + // but set the new deltaX to the original's deltaY. + // stackoverflow.com/a/38991946/111418 + CGEventRef cgEvent = CGEventCreateCopy(event.CGEvent); + CGEventSetIntegerValueField(cgEvent, kCGScrollWheelEventDeltaAxis2, event.scrollingDeltaY); + NSEvent *newEvent = [NSEvent eventWithCGEvent:cgEvent]; + CFRelease(cgEvent); + return newEvent; + } + return event; + }]; + } + return self; +} + +- (void)layout +{ + [super layout]; + [self fixupLayoutWithAnimation:NO]; +} + +- (BOOL)wantsUpdateLayer { return YES; } + +- (void)updateLayer +{ + self.layer.backgroundColor = self.tablineFillFgColor.CGColor; +} + +- (void)viewDidChangeEffectiveAppearance +{ + for (MMTab *tab in _tabs) tab.state = tab.state; +} + +#pragma mark - Accessors + +- (NSUInteger)numberOfTabs +{ + return _tabs.count; +} + +- (NSUInteger)optimumTabWidth +{ + return _optimumTabWidth ?: OptimumTabWidth; +} + +- (NSUInteger)minimumTabWidth +{ + return _minimumTabWidth ?: MinimumTabWidth; +} + +- (void)setShowsAddTabButton:(BOOL)showsAddTabButton +{ + // showsAddTabButton: + // The trailing constraint is a 5pt margin. + // !showsAddTabButton: + // The trailing constraint is a negative margin so the add + // button is clipped out of the right side of the view. The + // amount of negative margin is the width of the button plus + // 5 to account for the margin between the scroll view and + // the button plus the shadow blur radius of each tab (see + // -drawRect: in MMTab.m). + if (_showsAddTabButton != showsAddTabButton) { + _showsAddTabButton = showsAddTabButton; + _addTabButtonTrailingConstraint.constant = showsAddTabButton ? 5 : -(NSWidth(_addTabButton.frame) + 5 + MMTabShadowBlurRadius); + } +} + +- (void)setShowsTabScrollButtons:(BOOL)showsTabScrollButtons +{ + // showsTabScrollButtons: + // The leading constraint is a 5pt margin. + // !showsTabScrollButtons: + // The leading constraint is a negative margin so the scroll + // buttons are clipped out of the left side of the view. The + // amount of the negative margin is the width of each button + // plus 5 to account for the margin between the buttons and + // the scroll view plus the shadow blur radius of each tab + // (see -drawRect: in MMTab.m). + if (_showsTabScrollButtons != showsTabScrollButtons) { + _showsTabScrollButtons = showsTabScrollButtons; + _tabScrollButtonsLeadingConstraint.constant = showsTabScrollButtons ? 5 : -((NSWidth(_leftScrollButton.frame) * 2) + 5 + MMTabShadowBlurRadius); + } +} + +- (NSColor *)tablineBgColor +{ + return _tablineBgColor ?: getCurrentAppearance(self.effectiveAppearance) + ? [NSColor colorWithWhite:0.2 alpha:1] + : [NSColor colorWithWhite:0.8 alpha:1]; +} + +- (void)setTablineBgColor:(NSColor *)color +{ + _tablineBgColor = color; + for (MMTab *tab in _tabs) tab.state = tab.state; +} + +- (NSColor *)tablineFgColor +{ + return _tablineFgColor ?: NSColor.disabledControlTextColor; +} + +- (void)setTablineFgColor:(NSColor *)color +{ + _tablineFgColor = color; + for (MMTab *tab in _tabs) tab.state = tab.state; +} + +- (NSColor *)tablineSelBgColor +{ + return _tablineSelBgColor ?: getCurrentAppearance(self.effectiveAppearance) + ? [NSColor colorWithWhite:0.4 alpha:1] + : NSColor.whiteColor; +} + +- (void)setTablineSelBgColor:(NSColor *)color +{ + _tablineSelBgColor = color; + for (MMTab *tab in _tabs) tab.state = tab.state; +} + +- (NSColor *)tablineSelFgColor +{ + return _tablineSelFgColor ?: NSColor.controlTextColor; +} + +- (void)setTablineSelFgColor:(NSColor *)color +{ + _tablineSelFgColor = color; + _addTabButton.fgColor = color; + _leftScrollButton.fgColor = color; + _rightScrollButton.fgColor = color; + for (MMTab *tab in _tabs) tab.state = tab.state; +} + +- (NSColor *)tablineFillFgColor +{ + return _tablineFillFgColor ?: getCurrentAppearance(self.effectiveAppearance) + ? [NSColor colorWithWhite:0.2 alpha:1] + : [NSColor colorWithWhite:0.8 alpha:1]; +} + +- (void)setTablineFillFgColor:(NSColor *)color +{ + _tablineFillFgColor = color; + self.needsDisplay = YES; +} + +- (NSUInteger)addTabAtEnd +{ + return [self addTabAtIndex:(_tabs.count ? _tabs.count : 0)]; +} + +- (NSUInteger)addTabAfterSelectedTab +{ + return [self addTabAtIndex:(_tabs.count ? _selectedTabIndex + 1 : 0)]; +} + +- (NSUInteger)addTabAtIndex:(NSUInteger)index +{ + if (!self.superview || index > _tabs.count) return NSNotFound; + + TabWidth t = [self tabWidthForTabs:_tabs.count + 1]; + NSRect frame = _tabsContainer.bounds; + frame.size.width = index == _tabs.count ? t.width + t.remainder : t.width; + frame.origin.x = index ? index * (t.width - TabOverlap) : 0; + MMTab *newTab = [[MMTab alloc] initWithFrame:frame tabline:self]; + + [_tabs insertObject:newTab atIndex:index]; + [_tabsContainer addSubview:newTab]; + + [self selectTabAtIndex:index]; + [self fixupLayoutWithAnimation:YES]; + [self fixupCloseButtons]; + /* Let MacVim handle scrolling to selected tab. + [self scrollTabToVisibleAtIndex:_selectedTabIndex]; */ + [self evaluateHoverStateForMouse:[self.window mouseLocationOutsideOfEventStream]]; + + return index; +} + +- (void)closeTab:(MMTab *)tab force:(BOOL)force layoutImmediately:(BOOL)layoutImmediately +{ + NSUInteger index = [_tabs indexOfObject:tab]; + if (!force && [self.delegate respondsToSelector:@selector(tabline:shouldCloseTabAtIndex:)]) { + if (![self.delegate tabline:self shouldCloseTabAtIndex:index]) return; + } + if (index != NSNotFound) { + CGFloat w = NSWidth(tab.frame) - TabOverlap; + [tab removeFromSuperview]; + for (NSUInteger i = index + 1; i < _tabs.count; i++) { + MMTab *tv = _tabs[i]; + NSRect frame = tv.frame; + frame.origin.x -= w; + tv.animator.frame = frame; + } + [_tabs removeObject:tab]; + if (index <= _selectedTabIndex) { + if (index < _selectedTabIndex || index > _tabs.count - 1) { + [self selectTabAtIndex:_selectedTabIndex - 1]; + } + else { + [self selectTabAtIndex:_selectedTabIndex]; + } + } + [self fixupCloseButtons]; + [self evaluateHoverStateForMouse:[self.window mouseLocationOutsideOfEventStream]]; + if (layoutImmediately) [self fixupLayoutWithAnimation:YES]; + else _pendingFixupLayout = YES; + } else { + NSLog(@"CANNOT FIND TAB TO REMOVE"); + } +} + +- (void)selectTabAtIndex:(NSUInteger)index +{ + if (_selectedTabIndex <= _tabs.count - 1) { + _tabs[_selectedTabIndex].state = MMTabStateUnselected; + } + if (index <= _tabs.count - 1) { + _selectedTabIndex = index; + _tabs[_selectedTabIndex].state = MMTabStateSelected; + } + else { + NSLog(@"TRIED TO SELECT OUT OF BOUNDS: %ld/%ld", index, _tabs.count - 1); + } + _selectedTab = _tabs[_selectedTabIndex]; + [self fixupTabZOrder]; +} + +- (MMTab *)tabAtIndex:(NSUInteger)index +{ + if (index >= _tabs.count) { + [NSException raise:NSRangeException format:@"Index (%lu) beyond bounds (%lu)", index, _tabs.count - 1]; + } + return _tabs[index]; +} + +- (void)setTablineSelBackground:(NSColor *)back foreground:(NSColor *)fore +{ + // Reset to default tabline colors if user doesn't want auto-generated ones. + if ([NSUserDefaults.standardUserDefaults boolForKey:@"MMDefaultTablineColors"]) { + self.tablineBgColor = nil; + self.tablineFgColor = nil; + self.tablineSelBgColor = nil; + self.tablineSelFgColor = nil; + self.tablineFillFgColor = nil; + return; + } + + // Set the colors for the tabline based on the default background and + // foreground colors. Calculate brightness according to a formula from + // the W3C that gives brightness as the eye perceives it. Then lighten + // or darken the default colors based on whether brightness is greater + // than 50% to achieve good visual contrast. + // www.w3.org/WAI/ER/WD-AERT/#color-contrast + CGFloat r, g, b, brightness; + [back getRed:&r green:&g blue:&b alpha:NULL]; + brightness = r * 0.299 + g * 0.114 + b * 0.587; + + self.tablineSelBgColor = back; + + self.tablineSelFgColor = (brightness > 0.5) + ? [fore blendedColorWithFraction:0.6 ofColor:NSColor.blackColor] + : [fore blendedColorWithFraction:0.6 ofColor:NSColor.whiteColor]; + + self.tablineBgColor = (brightness > 0.5) + ? [back blendedColorWithFraction:0.12 ofColor:NSColor.blackColor] + : [back blendedColorWithFraction:0.20 ofColor:NSColor.whiteColor]; + + self.tablineFgColor = [self.tablineSelFgColor blendedColorWithFraction:0.5 ofColor:self.tablineBgColor]; + + self.tablineFillFgColor = (brightness > 0.5) + ? [back blendedColorWithFraction:0.25 ofColor:NSColor.blackColor] + : [back blendedColorWithFraction:0.40 ofColor:NSColor.whiteColor]; +} + +#pragma mark - Helpers + +NSComparisonResult SortTabsForZOrder(MMTab *tab1, MMTab *tab2, void *draggedTab) +{ // Z-order, highest to lowest: dragged, selected, hovered, rightmost + if (tab1 == (__bridge MMTab *)draggedTab) return NSOrderedDescending; + if (tab2 == (__bridge MMTab *)draggedTab) return NSOrderedAscending; + if (tab1.state == MMTabStateSelected) return NSOrderedDescending; + if (tab2.state == MMTabStateSelected) return NSOrderedAscending; + if (tab1.state == MMTabStateUnselectedHover) return NSOrderedDescending; + if (tab2.state == MMTabStateUnselectedHover) return NSOrderedAscending; + if (NSMinX(tab1.frame) < NSMinX(tab2.frame)) return NSOrderedAscending; + if (NSMinX(tab1.frame) > NSMinX(tab2.frame)) return NSOrderedDescending; + return NSOrderedSame; +} + +- (TabWidth)tabWidthForTabs:(NSUInteger)numTabs +{ + // Each tab (except the first) overlaps the previous tab by TabOverlap + // points so we add TabOverlap * (numTabs - 1) to account for this. + CGFloat availableWidthForTabs = NSWidth(_scrollView.frame) + TabOverlap * (numTabs - 1); + CGFloat tabWidth = (availableWidthForTabs / numTabs); + if (tabWidth > self.optimumTabWidth) { + return (TabWidth){self.optimumTabWidth, 0}; + } + if (tabWidth < self.minimumTabWidth) { + return (TabWidth){self.minimumTabWidth, 0}; + } + // Round tabWidth down to nearest 0.5 + CGFloat f = floor(tabWidth); + tabWidth = (tabWidth - f < 0.5) ? f : f + 0.5; + return (TabWidth){tabWidth, availableWidthForTabs - tabWidth * numTabs}; +} + +- (void)fixupCloseButtons +{ + if (_tabs.count == 1) { + _tabs.firstObject.closeButtonHidden = YES; + } + else for (MMTab *tab in _tabs) { + tab.closeButtonHidden = NO; + } +} + +- (void)fixupTabZOrder +{ + [_tabsContainer sortSubviewsUsingFunction:SortTabsForZOrder context:(__bridge void *)(_draggedTab)]; +} + +- (void)fixupLayoutWithAnimation:(BOOL)shouldAnimate +{ + if (_tabs.count == 0) return; + + TabWidth t = [self tabWidthForTabs:_tabs.count]; + for (NSInteger i = 0; i < _tabs.count; i++) { + MMTab *tab = _tabs[i]; + if (_draggedTab == tab) continue; + NSRect frame = tab.frame; + frame.size.width = i == _tabs.count - 1 ? t.width + t.remainder : t.width; + frame.origin.x = i ? i * (t.width - TabOverlap) : 0; + if (shouldAnimate) { + [NSAnimationContext runAnimationGroup:^(NSAnimationContext * _Nonnull context) { + context.allowsImplicitAnimation = YES; + tab.animator.frame = frame; + [tab layout]; + }]; + } else tab.frame = frame; + } + // _tabsContainer expands to fit tabs, is at least as wide as _scrollView. + NSRect frame = _tabsContainer.frame; + frame.size.width = t.width * _tabs.count - TabOverlap * (_tabs.count - 1); + frame.size.width = NSWidth(frame) < NSWidth(_scrollView.frame) ? NSWidth(_scrollView.frame) : NSWidth(frame); + if (shouldAnimate) _tabsContainer.animator.frame = frame; + else _tabsContainer.frame = frame; + [self updateTabScrollButtonsEnabledState]; +} + +#pragma mark - Mouse + +- (void)updateTrackingAreas +{ + [self removeTrackingArea:_trackingArea]; + _trackingArea = [[NSTrackingArea alloc] initWithRect:_scrollView.frame options:(NSTrackingMouseEnteredAndExited | NSTrackingMouseMoved | NSTrackingActiveInKeyWindow) owner:self userInfo:nil]; + [self addTrackingArea:_trackingArea]; + [super updateTrackingAreas]; +} + +- (BOOL)mouse:(NSPoint)windowLocation inTab:(MMTab *)tab +{ + // YES if windowLocation is inside _scrollview AND tab. + NSPoint location = [_scrollView convertPoint:windowLocation fromView:nil]; + if ([_scrollView mouse:location inRect:_scrollView.bounds]) { + location = [tab convertPoint:windowLocation fromView:nil]; + return [tab mouse:location inRect:tab.bounds]; + } + return NO; +} + +- (NSUInteger)indexOfTabAtMouse:(NSPoint)windowLocation +{ + for (MMTab *tab in _tabs) + if ([self mouse:windowLocation inTab:tab]) + return [_tabs indexOfObject:tab]; + return NSNotFound; +} + +- (void)evaluateHoverStateForMouse:(NSPoint)locationInWindow +{ + for (MMTab *tab in _tabs) { + if ([self mouse:locationInWindow inTab:tab]) { + if (tab.state == MMTabStateUnselected) { + tab.state = MMTabStateUnselectedHover; + } + } + else if (tab.state == MMTabStateUnselectedHover) { + tab.state = MMTabStateUnselected; + } + } + [self fixupTabZOrder]; +} + +- (void)mouseExited:(NSEvent *)event +{ + for (MMTab *tab in _tabs) { + if (tab.state == MMTabStateUnselectedHover) { + tab.state = MMTabStateUnselected; + } + } + if (_pendingFixupLayout) { + _pendingFixupLayout = NO; + [self fixupLayoutWithAnimation:YES]; + } + [self fixupTabZOrder]; +} + +- (void)mouseMoved:(NSEvent *)event +{ + [self evaluateHoverStateForMouse:event.locationInWindow]; +} + +- (void)mouseDown:(NSEvent *)event +{ + _draggedTab = nil; + _initialDraggedTabIndex = _finalDraggedTabIndex = NSNotFound; + + // Select clicked tab, possibly pending delegate's approval. + for (MMTab *tab in _tabs) { + if ([self mouse:event.locationInWindow inTab:tab]) { + _draggedTab = tab; + if (tab.state != MMTabStateSelected) { + NSUInteger index = [_tabs indexOfObject:tab]; + if ([self.delegate respondsToSelector:@selector(tabline:shouldSelectTabAtIndex:)]) { + if (![self.delegate tabline:self shouldSelectTabAtIndex:index]) break; + } + [self selectTabAtIndex:index]; + } + [self scrollTabToVisibleAtIndex:_selectedTabIndex]; + break; + } + } +} + +- (void)mouseUp:(NSEvent *)event +{ + _draggedTab = nil; + [self fixupLayoutWithAnimation:YES]; + [self fixupTabZOrder]; + if (_finalDraggedTabIndex != NSNotFound) [self scrollTabToVisibleAtIndex:_finalDraggedTabIndex]; + if (_initialDraggedTabIndex != NSNotFound && + _initialDraggedTabIndex != _finalDraggedTabIndex) { + if ([self.delegate respondsToSelector:@selector(tabline:didDragTab:toIndex:)]) { + [self.delegate tabline:self didDragTab:_tabs[_finalDraggedTabIndex] toIndex:_finalDraggedTabIndex]; + } + } +} + +- (void)mouseDragged:(NSEvent *)event +{ + if (!_draggedTab || _tabs.count < 2) return; + NSPoint mouse = [_tabsContainer convertPoint:event.locationInWindow fromView:nil]; + if (_initialDraggedTabIndex == NSNotFound) { + _initialDraggedTabIndex = [_tabs indexOfObject:_draggedTab]; + _xOffsetForDrag = mouse.x - _draggedTab.frame.origin.x; + } + [_tabsContainer autoscroll:event]; + [self fixupTabZOrder]; + [_draggedTab setFrameOrigin:NSMakePoint(mouse.x - _xOffsetForDrag, 0)]; + [_tabs sortWithOptions:NSSortStable usingComparator:^NSComparisonResult(MMTab *t1, MMTab *t2) { + if (NSMinX(t1.frame) <= NSMinX(t2.frame)) return NSOrderedAscending; + if (NSMinX(t1.frame) > NSMinX(t2.frame)) return NSOrderedDescending; + return NSOrderedSame; + }]; + _selectedTabIndex = [_tabs indexOfObject:_selectedTab]; + _finalDraggedTabIndex = [_tabs indexOfObject:_draggedTab]; + [self fixupLayoutWithAnimation:YES]; +} + +#pragma mark - Scroll + +- (void)didScroll:(NSNotification *)note +{ + [self evaluateHoverStateForMouse:[self.window mouseLocationOutsideOfEventStream]]; + [self updateTabScrollButtonsEnabledState]; +} + +- (void)updateTabScrollButtonsEnabledState +{ + // Enable scroll buttons if there is scrollable content + // on either side of _scrollView. + NSRect clipBounds = _scrollView.contentView.bounds; + if (NSWidth(_tabsContainer.frame) <= NSWidth(clipBounds)) { + _leftScrollButton.enabled = NO; + _rightScrollButton.enabled = NO; + } else { + _leftScrollButton.enabled = clipBounds.origin.x > 0; + _rightScrollButton.enabled = clipBounds.origin.x + NSWidth(clipBounds) < NSMaxX(_tabsContainer.frame); + } +} + +- (void)scrollTabToVisibleAtIndex:(NSUInteger)index +{ + if (_tabs.count == 0) return; + + // Get the amount of time elapsed between the previous invocation + // of this method and now. Use this elapsed time to set the animation + // duration such that rapid invocations of this method result in + // faster animations. For example, the user might hold down the tab + // scrolling buttons (causing them to repeatedly fire) or they might + // rapidly click them. + static NSTimeInterval lastTime = 0; + struct timespec t; + clock_gettime(CLOCK_MONOTONIC, &t); + NSTimeInterval currentTime = t.tv_sec + t.tv_nsec * 1.e-9; + NSTimeInterval elapsedTime = currentTime - lastTime; + lastTime = currentTime; + + NSRect tabFrame = _tabs[index].frame; + NSRect clipBounds = _scrollView.contentView.bounds; + // One side or the other of the selected tab is clipped. + if (!NSContainsRect(clipBounds, tabFrame)) { + if (NSMinX(tabFrame) > NSMinX(clipBounds)) { + // Right side of the selected tab is clipped. + clipBounds.origin.x = NSMaxX(tabFrame) - NSWidth(clipBounds); + } else { + // Left side of the selected tab is clipped. + clipBounds.origin.x = tabFrame.origin.x; + } + [NSAnimationContext beginGrouping]; + [NSAnimationContext.currentContext setDuration:elapsedTime < 0.2 ? 0.05 : 0.2]; + _scrollView.contentView.animator.bounds = clipBounds; + [NSAnimationContext endGrouping]; + } +} + +- (void)scrollLeftOneTab +{ + NSRect clipBounds = _scrollView.contentView.bounds; + for (NSInteger i = _tabs.count - 1; i >= 0; i--) { + NSRect tabFrame = _tabs[i].frame; + if (!NSContainsRect(clipBounds, tabFrame)) { + if (NSMinX(tabFrame) < NSMinX(clipBounds)) { + [self scrollTabToVisibleAtIndex:i]; + break; + } + } + } +} + +- (void)scrollRightOneTab +{ + NSRect clipBounds = _scrollView.contentView.bounds; + for (NSUInteger i = 0; i < _tabs.count; i++) { + NSRect tabFrame = _tabs[i].frame; + if (!NSContainsRect(clipBounds, tabFrame)) { + if (NSMaxX(tabFrame) > NSMaxX(clipBounds)) { + [self scrollTabToVisibleAtIndex:i]; + break; + } + } + } +} + + +#pragma mark - Drag and drop + +- (NSDragOperation)draggingEntered:(id)dragInfo +{ + [self evaluateHoverStateForMouse:dragInfo.draggingLocation]; + if (self.delegate && [self.delegate respondsToSelector:@selector(tabline:draggingEntered:forTabAtIndex:)]) { + NSUInteger index = [self indexOfTabAtMouse:dragInfo.draggingLocation]; + return [self.delegate tabline:self draggingEntered:dragInfo forTabAtIndex:index]; + } + return NSDragOperationNone; +} + +- (NSDragOperation)draggingUpdated:(id)dragInfo +{ + return [self draggingEntered:dragInfo]; +} + +- (void)draggingExited:(id)dragInfo +{ + [self evaluateHoverStateForMouse:dragInfo.draggingLocation]; +} + +- (BOOL)performDragOperation:(id)dragInfo +{ + if (self.delegate && [self.delegate respondsToSelector:@selector(tabline:performDragOperation:forTabAtIndex:)]) { + NSUInteger index = [self indexOfTabAtMouse:dragInfo.draggingLocation]; + return [self.delegate tabline:self performDragOperation:dragInfo forTabAtIndex:index]; + } + return NO; +} + +@end diff --git a/src/MacVim/MMVimController.h b/src/MacVim/MMVimController.h index 7a0fc4cd46..a392190454 100644 --- a/src/MacVim/MMVimController.h +++ b/src/MacVim/MMVimController.h @@ -63,7 +63,7 @@ - (void)cleanup; - (void)dropFiles:(NSArray *)filenames forceOpen:(BOOL)force; - (void)file:(NSString *)filename draggedToTabAtIndex:(NSUInteger)tabIndex; -- (void)filesDraggedToTabBar:(NSArray *)filenames; +- (void)filesDraggedToTabline:(NSArray *)filenames; - (void)dropString:(NSString *)string; - (void)appearanceChanged:(int)flag; diff --git a/src/MacVim/MMVimController.m b/src/MacVim/MMVimController.m index 4964b5eb93..562c50bba2 100644 --- a/src/MacVim/MMVimController.m +++ b/src/MacVim/MMVimController.m @@ -375,7 +375,7 @@ - (void)file:(NSString *)filename draggedToTabAtIndex:(NSUInteger)tabIndex // This is called when a file is dragged on top of the tab bar but not a // particular tab (e.g. the new tab button). We will open the file list similar // to drag-and-dropped files. -- (void)filesDraggedToTabBar:(NSArray *)filenames +- (void)filesDraggedToTabline:(NSArray *)filenames { filenames = normalizeFilenames(filenames); ASLogInfo(@"%@", filenames); @@ -691,10 +691,10 @@ - (void)handleMessage:(int)msgid data:(NSData *)data } else if (UpdateTabBarMsgID == msgid) { [windowController updateTabsWithData:data]; } else if (ShowTabBarMsgID == msgid) { - [windowController showTabBar:YES]; + [windowController showTabline:YES]; [self sendMessage:BackingPropertiesChangedMsgID data:nil]; } else if (HideTabBarMsgID == msgid) { - [windowController showTabBar:NO]; + [windowController showTabline:NO]; [self sendMessage:BackingPropertiesChangedMsgID data:nil]; } else if (SetTextDimensionsMsgID == msgid || LiveResizeMsgID == msgid || SetTextDimensionsNoResizeWindowMsgID == msgid || diff --git a/src/MacVim/MMVimView.h b/src/MacVim/MMVimView.h index ba04f90553..843fa3317c 100644 --- a/src/MacVim/MMVimView.h +++ b/src/MacVim/MMVimView.h @@ -12,17 +12,17 @@ -@class PSMTabBarControl; +@class MMTabline; +@class MMTab; @class MMTextView; @class MMScroller; @class MMVimController; @interface MMVimView : NSView { - PSMTabBarControl *tabBarControl; - NSTabView *tabView; + MMTabline *tabline; + MMTab *tabToClose; MMVimController *vimController; - BOOL vimTaskSelectedTab; MMTextView *textView; NSMutableArray *scrollbars; } @@ -40,11 +40,11 @@ - (NSSize)constrainRows:(int *)r columns:(int *)c toSize:(NSSize)size; - (void)setDesiredRows:(int)r columns:(int)c; -- (PSMTabBarControl *)tabBarControl; +- (MMTabline *)tabline; - (IBAction)addNewTab:(id)sender; - (void)updateTabsWithData:(NSData *)data; - (void)selectTabWithIndex:(int)idx; -- (NSTabViewItem *)addNewTabViewItem; +- (MMTab *)addNewTab; - (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type; - (BOOL)destroyScrollbarWithIdentifier:(int32_t)ident; diff --git a/src/MacVim/MMVimView.m b/src/MacVim/MMVimView.m index 6624c5c6db..22f4e9cb72 100644 --- a/src/MacVim/MMVimView.m +++ b/src/MacVim/MMVimView.m @@ -24,7 +24,7 @@ #import "MMVimController.h" #import "MMVimView.h" #import "MMWindowController.h" -#import +#import "MMTabline.h" @@ -50,16 +50,14 @@ - (void)setRange:(NSRange)newRange; @end -@interface MMVimView (Private) +@interface MMVimView (Private) - (BOOL)bottomScrollbarVisible; - (BOOL)leftScrollbarVisible; - (BOOL)rightScrollbarVisible; - (void)placeScrollbars; -- (NSUInteger)representedIndexOfTabViewItem:(NSTabViewItem *)tvi; - (MMScroller *)scrollbarForIdentifier:(int32_t)ident index:(unsigned *)idx; - (NSSize)vimViewSizeForTextViewSize:(NSSize)textViewSize; - (NSRect)textViewRectForVimViewSize:(NSSize)contentSize; -- (NSTabView *)tabView; - (void)frameSizeMayHaveChanged:(BOOL)keepGUISize; @end @@ -109,62 +107,21 @@ - (MMVimView *)initWithFrame:(NSRect)frame [textView setAutoresizingMask:NSViewNotSizable]; [self addSubview:textView]; - // Create the tab view (which is never visible, but the tab bar control - // needs it to function). - tabView = [[NSTabView alloc] initWithFrame:NSZeroRect]; - - // Create the tab bar control (which is responsible for actually - // drawing the tabline and tabs). - NSRect tabFrame = { { 0, frame.size.height - kPSMTabBarControlHeight }, - { frame.size.width, kPSMTabBarControlHeight } }; - tabBarControl = [[PSMTabBarControl alloc] initWithFrame:tabFrame]; - - [tabView setDelegate:tabBarControl]; - - [tabBarControl setTabView:tabView]; - [tabBarControl setDelegate:self]; - [tabBarControl setHidden:YES]; - - if (shouldUseYosemiteTabBarStyle() || shouldUseMojaveTabBarStyle()) { - CGFloat screenWidth = [[NSScreen mainScreen] frame].size.width; - int tabMaxWidth = [ud integerForKey:MMTabMaxWidthKey]; - if (tabMaxWidth == 0) - tabMaxWidth = screenWidth; - int tabOptimumWidth = [ud integerForKey:MMTabOptimumWidthKey]; - if (tabOptimumWidth == 0) - tabOptimumWidth = screenWidth; - - NSString* tabStyleName = shouldUseMojaveTabBarStyle() ? @"Mojave" : @"Yosemite"; - - [tabBarControl setStyleNamed:tabStyleName]; - [tabBarControl setCellMinWidth:[ud integerForKey:MMTabMinWidthKey]]; - [tabBarControl setCellMaxWidth:tabMaxWidth]; - [tabBarControl setCellOptimumWidth:tabOptimumWidth]; - } else { - [tabBarControl setCellMinWidth:[ud integerForKey:MMTabMinWidthKey]]; - [tabBarControl setCellMaxWidth:[ud integerForKey:MMTabMaxWidthKey]]; - [tabBarControl setCellOptimumWidth: - [ud integerForKey:MMTabOptimumWidthKey]]; - } - - [tabBarControl setShowAddTabButton:[ud boolForKey:MMShowAddTabButtonKey]]; - [[tabBarControl addTabButton] setTarget:self]; - [[tabBarControl addTabButton] setAction:@selector(addNewTab:)]; - [tabBarControl setAllowsDragBetweenWindows:NO]; - [tabBarControl registerForDraggedTypes: - [NSArray arrayWithObject:NSFilenamesPboardType]]; - - [tabBarControl setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin]; - - //[tabBarControl setPartnerView:textView]; + // Create the tabline which is responsible for drawing the tabline and tabs. + NSRect tablineFrame = {{0, frame.size.height - MMTablineHeight}, {frame.size.width, MMTablineHeight}}; + tabline = [[MMTabline alloc] initWithFrame:tablineFrame]; + tabline.autoresizingMask = NSViewWidthSizable | NSViewMinYMargin; + tabline.delegate = self; + tabline.hidden = YES; + tabline.showsAddTabButton = [ud boolForKey:MMShowAddTabButtonKey]; + tabline.showsTabScrollButtons = [ud boolForKey:MMShowTabScrollButtonsKey]; + tabline.optimumTabWidth = [ud integerForKey:MMTabOptimumWidthKey]; + tabline.minimumTabWidth = [ud integerForKey:MMTabMinWidthKey]; + tabline.addTabButton.target = self; + tabline.addTabButton.action = @selector(addNewTab:); + [tabline registerForDraggedTypes:@[NSFilenamesPboardType]]; + [self addSubview:tabline]; - // tab bar resizing only works if awakeFromNib is called (that's where - // the NSViewFrameDidChangeNotification callback is installed). Sounds like - // a PSMTabBarControl bug, let's live with it for now. - [tabBarControl awakeFromNib]; - - [self addSubview:tabBarControl]; - return self; } @@ -172,8 +129,7 @@ - (void)dealloc { ASLogDebug(@""); - [tabBarControl release]; tabBarControl = nil; - [tabView release]; tabView = nil; + [tabline release]; [scrollbars release]; scrollbars = nil; // HACK! The text storage is the principal owner of the text system, but we @@ -249,29 +205,18 @@ - (MMTextView *)textView return textView; } -- (PSMTabBarControl *)tabBarControl +- (MMTabline *)tabline { - return tabBarControl; + return tabline; } - (void)cleanup { vimController = nil; - // NOTE! There is a bug in PSMTabBarControl in that it retains the delegate - // so reset the delegate here, otherwise the delegate may never get - // released. - [tabView setDelegate:nil]; - [tabBarControl setDelegate:nil]; - [tabBarControl setTabView:nil]; [[self window] setDelegate:nil]; - // NOTE! There is another bug in PSMTabBarControl where the control is not - // removed as an observer, so remove it here (failing to remove an observer - // may lead to very strange bugs). - [[NSNotificationCenter defaultCenter] removeObserver:tabBarControl]; - - [tabBarControl removeFromSuperviewWithoutNeedingDisplay]; + [tabline removeFromSuperviewWithoutNeedingDisplay]; [textView removeFromSuperviewWithoutNeedingDisplay]; unsigned i, count = [scrollbars count]; @@ -279,8 +224,6 @@ - (void)cleanup MMScroller *sb = [scrollbars objectAtIndex:i]; [sb removeFromSuperviewWithoutNeedingDisplay]; } - - [tabView removeAllTabViewItems]; } - (NSSize)desiredSize @@ -315,16 +258,35 @@ - (void)updateTabsWithData:(NSData *)data const void *p = [data bytes]; const void *end = p + [data length]; int tabIdx = 0; + BOOL didCloseTab = NO; + + // Count how many tabs Vim has and compare to the number MacVim's tabline has. + const void *q = [data bytes]; + int vimNumberOfTabs = 0; + q += sizeof(int); // skip over current tab index + while (q < end) { + int infoCount = *((int*)q); q += sizeof(int); + for (unsigned i = 0; i < infoCount; ++i) { + int length = *((int*)q); q += sizeof(int); + if (length <= 0) continue; + q += length; + if (i == MMTabLabel) ++vimNumberOfTabs; + } + } + // Close the specific tab where the user clicked the close button. + if (tabToClose && vimNumberOfTabs == tabline.numberOfTabs - 1) { + [tabline closeTab:tabToClose force:YES layoutImmediately:NO]; + tabToClose = nil; + didCloseTab = YES; + } // HACK! Current tab is first in the message. This way it is not // necessary to guess which tab should be the selected one (this can be // problematic for instance when new tabs are created). int curtabIdx = *((int*)p); p += sizeof(int); - NSArray *tabViewItems = [[self tabBarControl] representedTabViewItems]; - while (p < end) { - NSTabViewItem *tvi = nil; + MMTab *tv; //int wincount = *((int*)p); p += sizeof(int); int infoCount = *((int*)p); p += sizeof(int); @@ -342,16 +304,14 @@ - (void)updateTabsWithData:(NSData *)data switch (i) { case MMTabLabel: // Set the label of the tab, adding a new tab when needed. - tvi = [[self tabView] numberOfTabViewItems] <= tabIdx - ? [self addNewTabViewItem] - : [tabViewItems objectAtIndex:tabIdx]; - [tvi setLabel:val]; + tv = tabline.numberOfTabs <= tabIdx + ? [self addNewTab] + : [tabline tabAtIndex:tabIdx]; + tv.title = val; ++tabIdx; break; case MMTabToolTip: - if (tvi) - [[self tabBarControl] setToolTip:val - forTabViewItem:tvi]; + if (tv) tv.toolTip = val; break; default: ASLogWarn(@"Unknown tab info for index: %d", i); @@ -361,60 +321,48 @@ - (void)updateTabsWithData:(NSData *)data } } - // Remove unused tabs from the NSTabView. Note that when a tab is closed - // the NSTabView will automatically select another tab, but we want Vim to - // take care of which tab to select so set the vimTaskSelectedTab flag to - // prevent the tab selection message to be passed on to the VimTask. - vimTaskSelectedTab = YES; - int i, count = [[self tabView] numberOfTabViewItems]; + // Remove unused tabs from the tabline. + int i, count = tabline.numberOfTabs; for (i = count-1; i >= tabIdx; --i) { - id tvi = [tabViewItems objectAtIndex:i]; - [[self tabView] removeTabViewItem:tvi]; + MMTab *tv = [tabline tabAtIndex:i]; + [tabline closeTab:tv force:YES layoutImmediately:YES]; } - vimTaskSelectedTab = NO; [self selectTabWithIndex:curtabIdx]; + // It would be better if we could scroll to the selected tab only if it + // reflected user intent. Presumably, the user expects MacVim to scroll + // to the selected tab if they: added a tab, clicked a partially hidden + // tab, or navigated to a tab with a keyboard command. Since we don't + // have this kind of information, we always scroll to selected unless + // the window isn't key or we think the user is in the process of + // closing a tab by clicking its close button. Doing it this way instead + // of using a signal of explicit user intent is probably too aggressive. + if (self.window.isKeyWindow && !tabToClose && !didCloseTab) { + [tabline scrollTabToVisibleAtIndex:curtabIdx]; + } } - (void)selectTabWithIndex:(int)idx { - NSArray *tabViewItems = [[self tabBarControl] representedTabViewItems]; - if (idx < 0 || idx >= [tabViewItems count]) { + if (idx < 0 || idx >= tabline.numberOfTabs) { ASLogWarn(@"No tab with index %d exists.", idx); return; } - // Do not try to select a tab if already selected. - NSTabViewItem *tvi = [tabViewItems objectAtIndex:idx]; - if (tvi != [[self tabView] selectedTabViewItem]) { - vimTaskSelectedTab = YES; - [[self tabView] selectTabViewItem:tvi]; - vimTaskSelectedTab = NO; - + if (idx != tabline.selectedTabIndex) { + [tabline selectTabAtIndex:idx]; // We might need to change the scrollbars that are visible. self.pendingPlaceScrollbars = YES; } } -- (NSTabViewItem *)addNewTabViewItem +- (MMTab *)addNewTab { // NOTE! A newly created tab is not by selected by default; Vim decides // which tab should be selected at all times. However, the AppKit will // automatically select the first tab added to a tab view. - - // The documentation claims initWithIdentifier can be given a nil identifier, but the API itself - // is decorated such that doing so produces a warning, so the tab count is used as identifier. - NSInteger identifier = [[self tabView] numberOfTabViewItems]; - NSTabViewItem *tvi = [[NSTabViewItem alloc] initWithIdentifier:[NSNumber numberWithInt:identifier]]; - - // NOTE: If this is the first tab it will be automatically selected. - vimTaskSelectedTab = YES; - [[self tabView] addTabViewItem:tvi]; - vimTaskSelectedTab = NO; - - [tvi autorelease]; - - return tvi; + NSUInteger index = [tabline addTabAtEnd]; + return [tabline tabAtIndex:index]; } - (void)createScrollbarWithIdentifier:(int32_t)ident type:(int)type @@ -509,6 +457,8 @@ - (void)finishPlaceScrollbars - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore { [textView setDefaultColorsBackground:back foreground:fore]; + + [tabline setTablineSelBackground:back foreground:fore]; CALayer *backedLayer = [self layer]; if (backedLayer) { @@ -528,94 +478,68 @@ - (void)setDefaultColorsBackground:(NSColor *)back foreground:(NSColor *)fore } -// -- PSMTabBarControl delegate ---------------------------------------------- +// -- MMTablineDelegate ---------------------------------------------- -- (BOOL)tabView:(NSTabView *)theTabView shouldSelectTabViewItem: - (NSTabViewItem *)tabViewItem +- (BOOL)tabline:(MMTabline *)tabline shouldSelectTabAtIndex:(NSUInteger)index { - // NOTE: It would be reasonable to think that 'shouldSelect...' implies - // that this message only gets sent when the user clicks the tab. - // Unfortunately it is not so, which is why we need the - // 'vimTaskSelectedTab' flag. - // - // HACK! The selection message should not be propagated to Vim if Vim - // selected the tab (e.g. as opposed the user clicking the tab). The - // delegate method has no way of knowing who initiated the selection so a - // flag is set when Vim initiated the selection. - if (!vimTaskSelectedTab) { - // Propagate the selection message to Vim. - NSUInteger idx = [self representedIndexOfTabViewItem:tabViewItem]; - if (NSNotFound != idx) { - int i = (int)idx; // HACK! Never more than MAXINT tabs?! - NSData *data = [NSData dataWithBytes:&i length:sizeof(int)]; - [vimController sendMessage:SelectTabMsgID data:data]; - } + // Propagate the selection message to Vim. + if (NSNotFound != index) { + int i = (int)index; // HACK! Never more than MAXINT tabs?! + NSData *data = [NSData dataWithBytes:&i length:sizeof(int)]; + [vimController sendMessage:SelectTabMsgID data:data]; } - - // Unless Vim selected the tab, return NO, and let Vim decide if the tab - // should get selected or not. - return vimTaskSelectedTab; + // Let Vim decide whether to select the tab or not. + return NO; } -- (BOOL)tabView:(NSTabView *)theTabView shouldCloseTabViewItem: - (NSTabViewItem *)tabViewItem +- (BOOL)tabline:(MMTabline *)tabline shouldCloseTabAtIndex:(NSUInteger)index { + if (index >= 0 && index < tabline.numberOfTabs - 1) { + tabToClose = [tabline tabAtIndex:index]; + } // HACK! This method is only called when the user clicks the close button // on the tab. Instead of letting the tab bar close the tab, we return NO // and pass a message on to Vim to let it handle the closing. - NSUInteger idx = [self representedIndexOfTabViewItem:tabViewItem]; - int i = (int)idx; // HACK! Never more than MAXINT tabs?! + int i = (int)index; // HACK! Never more than MAXINT tabs?! NSData *data = [NSData dataWithBytes:&i length:sizeof(int)]; [vimController sendMessage:CloseTabMsgID data:data]; - return NO; } -- (void)tabView:(NSTabView *)theTabView didDragTabViewItem: - (NSTabViewItem *)tabViewItem toIndex:(int)idx +- (void)tabline:(MMTabline *)tabline didDragTab:(MMTab *)tab toIndex:(NSUInteger)index { NSMutableData *data = [NSMutableData data]; - [data appendBytes:&idx length:sizeof(int)]; - + [data appendBytes:&index length:sizeof(int)]; [vimController sendMessage:DraggedTabMsgID data:data]; } -- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl - draggingEntered:(id )sender - forTabAtIndex:(NSUInteger)tabIndex +- (NSDragOperation)tabline:(MMTabline *)tabline draggingEntered:(id )dragInfo forTabAtIndex:(NSUInteger)index { - NSPasteboard *pb = [sender draggingPasteboard]; - return [[pb types] containsObject:NSFilenamesPboardType] + return [dragInfo.draggingPasteboard.types containsObject:NSFilenamesPboardType] ? NSDragOperationCopy : NSDragOperationNone; } -- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl - performDragOperation:(id )sender - forTabAtIndex:(NSUInteger)tabIndex +- (BOOL)tabline:(MMTabline *)tabline performDragOperation:(id )dragInfo forTabAtIndex:(NSUInteger)index { - NSPasteboard *pb = [sender draggingPasteboard]; - if ([[pb types] containsObject:NSFilenamesPboardType]) { + NSPasteboard *pb = dragInfo.draggingPasteboard; + if ([pb.types containsObject:NSFilenamesPboardType]) { NSArray *filenames = [pb propertyListForType:NSFilenamesPboardType]; - if ([filenames count] == 0) - return NO; - if (tabIndex != NSNotFound) { + if (filenames.count == 0) return NO; + if (index != NSNotFound) { // If dropping on a specific tab, only open one file - [vimController file:[filenames objectAtIndex:0] - draggedToTabAtIndex:tabIndex]; + [vimController file:[filenames objectAtIndex:0] draggedToTabAtIndex:index]; } else { // Files were dropped on empty part of tab bar; open them all - [vimController filesDraggedToTabBar:filenames]; + [vimController filesDraggedToTabline:filenames]; } return YES; - } else { - return NO; } + return NO; } - // -- NSView customization --------------------------------------------------- @@ -847,12 +771,6 @@ - (void)placeScrollbars } } -- (NSUInteger)representedIndexOfTabViewItem:(NSTabViewItem *)tvi -{ - NSArray *tabViewItems = [[self tabBarControl] representedTabViewItems]; - return [tabViewItems indexOfObject:tvi]; -} - - (MMScroller *)scrollbarForIdentifier:(int32_t)ident index:(unsigned *)idx { unsigned i, count = [scrollbars count]; @@ -876,8 +794,8 @@ - (NSSize)vimViewSizeForTextViewSize:(NSSize)textViewSize CGFloat scrollerWidth = [NSScroller scrollerWidth]; #endif - if (![[self tabBarControl] isHidden]) - size.height += [[self tabBarControl] frame].size.height; + if (!tabline.isHidden) + size.height += NSHeight(tabline.frame); if ([self bottomScrollbarVisible]) size.height += scrollerWidth; @@ -898,8 +816,8 @@ - (NSRect)textViewRectForVimViewSize:(NSSize)contentSize CGFloat scrollerWidth = [NSScroller scrollerWidth]; #endif - if (![[self tabBarControl] isHidden]) - rect.size.height -= [[self tabBarControl] frame].size.height; + if (!tabline.isHidden) + rect.size.height -= NSHeight(tabline.frame); if ([self bottomScrollbarVisible]) { rect.size.height -= scrollerWidth; @@ -915,11 +833,6 @@ - (NSRect)textViewRectForVimViewSize:(NSSize)contentSize return rect; } -- (NSTabView *)tabView -{ - return tabView; -} - - (void)frameSizeMayHaveChanged:(BOOL)keepGUISize { // NOTE: Whenever a call is made that may have changed the frame size we diff --git a/src/MacVim/MMWindow.m b/src/MacVim/MMWindow.m index 5fa0a02e4d..4d3fccbef8 100644 --- a/src/MacVim/MMWindow.m +++ b/src/MacVim/MMWindow.m @@ -79,6 +79,7 @@ - (id)initWithContentRect:(NSRect)rect tablineSeparator = [[NSBox alloc] initWithFrame:tabSepRect]; [tablineSeparator setBoxType:NSBoxSeparator]; + [tablineSeparator setFillColor:NSColor.secondaryLabelColor]; [tablineSeparator setHidden:YES]; [tablineSeparator setAutoresizingMask:NSViewWidthSizable|NSViewMinYMargin]; diff --git a/src/MacVim/MMWindowController.h b/src/MacVim/MMWindowController.h index ce39161a4d..b227a3345d 100644 --- a/src/MacVim/MMWindowController.h +++ b/src/MacVim/MMWindowController.h @@ -84,7 +84,7 @@ - (void)setWideFont:(NSFont *)font; - (void)refreshFonts; - (void)processInputQueueDidFinish; -- (void)showTabBar:(BOOL)on; +- (void)showTabline:(BOOL)on; - (void)showToolbar:(BOOL)on size:(int)size mode:(int)mode; - (void)setMouseShape:(int)shape; - (void)adjustLinespace:(int)linespace; diff --git a/src/MacVim/MMWindowController.m b/src/MacVim/MMWindowController.m index 0ba41998e8..9bedc947a4 100644 --- a/src/MacVim/MMWindowController.m +++ b/src/MacVim/MMWindowController.m @@ -71,7 +71,6 @@ #import "MMWindow.h" #import "MMWindowController.h" #import "Miscellaneous.h" -#import // These have to be the same as in option.h @@ -96,8 +95,6 @@ - (BOOL)maximizeWindow:(int)options; - (void)applicationDidChangeScreenParameters:(NSNotification *)notification; - (void)enterNativeFullScreen; - (void)processAfterWindowPresentedQueue; -+ (NSString *)tabBarStyleForUnified; -+ (NSString *)tabBarStyleForMetal; @end @@ -315,7 +312,7 @@ - (void)openWindow // presentWindow: but must carefully check dependencies on 'setupDone' // flag. - [self addNewTabViewItem]; + [vimView addNewTab]; setupDone = YES; } @@ -421,7 +418,7 @@ - (void)setTextDimensionsWithRows:(int)rows columns:(int)cols isLive:(BOOL)live // for example if 'showtabline=2'). // TODO: Store window pixel dimensions instead of rows/columns? int autosaveRows = rows; - if (![[vimView tabBarControl] isHidden]) + if (![[vimView tabline] isHidden]) ++autosaveRows; NSUserDefaults *ud = [NSUserDefaults standardUserDefaults]; @@ -819,9 +816,9 @@ - (void)processInputQueueDidFinish } } -- (void)showTabBar:(BOOL)on +- (void)showTabline:(BOOL)on { - [[vimView tabBarControl] setHidden:!on]; + [[vimView tabline] setHidden:!on]; [self updateTablineSeparator]; shouldMaximizeWindow = YES; } @@ -1699,7 +1696,7 @@ - (BOOL)askBackendForStarRegister:(NSPasteboard *)pb - (void)updateTablineSeparator { - BOOL tabBarVisible = ![[vimView tabBarControl] isHidden]; + BOOL tablineVisible = ![[vimView tabline] isHidden]; BOOL toolbarHidden = [decoratedWindow toolbar] == nil; BOOL windowTextured = ([decoratedWindow styleMask] & NSWindowStyleMaskTexturedBackground) != 0; @@ -1710,7 +1707,7 @@ - (void)updateTablineSeparator // modern macOS versions. hideSeparator = YES; } else { - if (fullScreenEnabled || tabBarVisible) + if (fullScreenEnabled || tablineVisible) hideSeparator = YES; else hideSeparator = toolbarHidden && !windowTextured; @@ -1913,15 +1910,5 @@ - (void)processAfterWindowPresentedQueue [afterWindowPresentedQueue release]; afterWindowPresentedQueue = nil; } -+ (NSString *)tabBarStyleForUnified -{ - return shouldUseYosemiteTabBarStyle() ? (shouldUseMojaveTabBarStyle() ? @"Mojave" : @"Yosemite") : @"Unified"; -} - -+ (NSString *)tabBarStyleForMetal -{ - return shouldUseYosemiteTabBarStyle() ? (shouldUseMojaveTabBarStyle() ? @"Mojave" : @"Yosemite") : @"Metal"; -} - @end // MMWindowController (Private) diff --git a/src/MacVim/MacVim.xcodeproj/project.pbxproj b/src/MacVim/MacVim.xcodeproj/project.pbxproj index cfd4205671..e87f4475e3 100644 --- a/src/MacVim/MacVim.xcodeproj/project.pbxproj +++ b/src/MacVim/MacVim.xcodeproj/project.pbxproj @@ -22,7 +22,6 @@ 1D384A0E100D671700D3C22F /* KeyBinding.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1D384A0D100D671700D3C22F /* KeyBinding.plist */; }; 1D44972211FCA9B400B0630F /* MMCoreTextView+ToolTip.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */; }; 1D493D580C5247BF00AB718C /* Vim in Copy Executables */ = {isa = PBXBuildFile; fileRef = 1D493D570C5247BF00AB718C /* Vim */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; - 1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */; }; 1D80591F0E1185EA001699D1 /* Miscellaneous.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D80591D0E1185EA001699D1 /* Miscellaneous.m */; }; 1D80FBD40CBBD3B700102A1C /* MMFullScreenWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D80FBD00CBBD3B700102A1C /* MMFullScreenWindow.m */; }; @@ -61,7 +60,6 @@ 1DE8CC620C5E2AAD003F56E3 /* Actions.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1DE8CC610C5E2AAD003F56E3 /* Actions.plist */; }; 1DE9B9500D341AB8008FEDD4 /* MMWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = 1DE9B94E0D341AB8008FEDD4 /* MMWindow.m */; }; 1DED78600C6DE43D0079945F /* vimrc in Copy Vim Runtime Files */ = {isa = PBXBuildFile; fileRef = 1DED785F0C6DE43D0079945F /* vimrc */; }; - 1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */; }; 52818B031C1C08CE00F59085 /* QLStephen.qlgenerator in Copy QuickLookPlugin */ = {isa = PBXBuildFile; fileRef = 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; }; 528DA66A1426D4F9003380F1 /* macvim-askpass in Copy Scripts */ = {isa = PBXBuildFile; fileRef = 528DA6691426D4EB003380F1 /* macvim-askpass */; }; 52A364731C4A5789005757EC /* Sparkle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52A364721C4A5789005757EC /* Sparkle.framework */; settings = {ATTRIBUTES = (Weak, ); }; }; @@ -72,23 +70,13 @@ 907FF7512521BCE200BADACB /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF74F2521BCE200BADACB /* MainMenu.xib */; }; 907FF7542521BDA600BADACB /* Preferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF7522521BDA600BADACB /* Preferences.xib */; }; 907FF7572521BDC300BADACB /* FindAndReplace.xib in Resources */ = {isa = PBXBuildFile; fileRef = 907FF7552521BDC200BADACB /* FindAndReplace.xib */; }; + 925B55D5254B604A006B047E /* MMHoverButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 925B55D1254B604A006B047E /* MMHoverButton.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; + 925B55D7254B61AC006B047E /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 925B55D6254B61AB006B047E /* QuartzCore.framework */; }; + 92C6F6E825587E1C007AE21E /* MMTab.m in Sources */ = {isa = PBXBuildFile; fileRef = 92C6F6E325587E1C007AE21E /* MMTab.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; + 92C6F6E925587E1C007AE21E /* MMTabline.m in Sources */ = {isa = PBXBuildFile; fileRef = 92C6F6E525587E1C007AE21E /* MMTabline.m */; settings = {COMPILER_FLAGS = "-fobjc-arc"; }; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 1D493DB80C52533B00AB718C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 53DF68FD067E5B5A0090B5B0; - remoteInfo = PSMTabBarControlFramework; - }; - 1D493DCC0C5254A400AB718C /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 53DF68FC067E5B5A0090B5B0; - remoteInfo = PSMTabBarControlFramework; - }; 52818AFE1C1C075300F59085 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */; @@ -124,7 +112,6 @@ dstSubfolderSpec = 10; files = ( 52A364761C4A57C1005757EC /* Sparkle.framework in Copy Frameworks */, - 1D493DBA0C52534300AB718C /* PSMTabBarControl.framework in Copy Frameworks */, ); name = "Copy Frameworks"; runOnlyForDeploymentPostprocessing = 0; @@ -192,7 +179,6 @@ 1D384A0D100D671700D3C22F /* KeyBinding.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = KeyBinding.plist; sourceTree = ""; }; 1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "MMCoreTextView+ToolTip.m"; sourceTree = ""; }; 1D493D570C5247BF00AB718C /* Vim */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.executable"; name = Vim; path = ../Vim; sourceTree = SOURCE_ROOT; }; - 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = PSMTabBarControl.xcodeproj; path = PSMTabBarControl/PSMTabBarControl.xcodeproj; sourceTree = ""; }; 1D6008890E96A0B2003763F0 /* MMFindReplaceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMFindReplaceController.h; sourceTree = ""; }; 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMFindReplaceController.m; sourceTree = ""; }; 1D80591D0E1185EA001699D1 /* Miscellaneous.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Miscellaneous.m; sourceTree = ""; }; @@ -445,6 +431,13 @@ 95241CF925749CC7001E3711 /* errors.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = errors.h; path = ../errors.h; sourceTree = ""; }; 95241CFA25749CC7001E3711 /* textobject.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = textobject.c; path = ../textobject.c; sourceTree = ""; }; 95241CFB25749D4A001E3711 /* os_macosx.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = os_macosx.m; path = ../os_macosx.m; sourceTree = ""; }; + 925B55CD254B604A006B047E /* MMHoverButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMHoverButton.h; sourceTree = ""; }; + 925B55D1254B604A006B047E /* MMHoverButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMHoverButton.m; sourceTree = ""; }; + 925B55D6254B61AB006B047E /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = System/Library/Frameworks/QuartzCore.framework; sourceTree = SDKROOT; }; + 92C6F6E325587E1C007AE21E /* MMTab.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTab.m; sourceTree = ""; }; + 92C6F6E525587E1C007AE21E /* MMTabline.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MMTabline.m; sourceTree = ""; }; + 92C6F6E625587E1C007AE21E /* MMTabline.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTabline.h; sourceTree = ""; }; + 92C6F6E725587E1C007AE21E /* MMTab.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MMTab.h; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -452,7 +445,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 1DFE25A50C527BC4003000F7 /* PSMTabBarControl.framework in Frameworks */, + 925B55D7254B61AC006B047E /* QuartzCore.framework in Frameworks */, 8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 1D8B5A53104AF9FF002E59D5 /* Carbon.framework in Frameworks */, 52A364731C4A5789005757EC /* Sparkle.framework in Frameworks */, @@ -465,6 +458,7 @@ 080E96DDFE201D6D7F000001 /* MacVim Source */ = { isa = PBXGroup; children = ( + 925B55CB254B604A006B047E /* MMTabline */, 1D44972111FCA9B400B0630F /* MMCoreTextView+ToolTip.m */, 1D6008890E96A0B2003763F0 /* MMFindReplaceController.h */, 1D60088A0E96A0B2003763F0 /* MMFindReplaceController.m */, @@ -546,14 +540,6 @@ name = Executables; sourceTree = ""; }; - 1D493DB40C52533B00AB718C /* Products */ = { - isa = PBXGroup; - children = ( - 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */, - ); - name = Products; - sourceTree = ""; - }; 1DE602460C587F760055263D /* Vim Resources */ = { isa = PBXGroup; children = ( @@ -634,9 +620,9 @@ 29B97323FDCFA39411CA2CEA /* Frameworks */ = { isa = PBXGroup; children = ( + 925B55D6254B61AB006B047E /* QuartzCore.framework */, 52A364721C4A5789005757EC /* Sparkle.framework */, 1D8B5A52104AF9FF002E59D5 /* Carbon.framework */, - 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */, 1058C7A0FEA54F0111CA2CBB /* Linked Frameworks */, 1058C7A2FEA54F0111CA2CBB /* Other Frameworks */, ); @@ -846,6 +832,19 @@ name = MacVim; sourceTree = ""; }; + 925B55CB254B604A006B047E /* MMTabline */ = { + isa = PBXGroup; + children = ( + 925B55CD254B604A006B047E /* MMHoverButton.h */, + 925B55D1254B604A006B047E /* MMHoverButton.m */, + 92C6F6E725587E1C007AE21E /* MMTab.h */, + 92C6F6E325587E1C007AE21E /* MMTab.m */, + 92C6F6E625587E1C007AE21E /* MMTabline.h */, + 92C6F6E525587E1C007AE21E /* MMTabline.m */, + ); + path = MMTabline; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -869,7 +868,6 @@ buildRules = ( ); dependencies = ( - 1D493DCD0C5254A400AB718C /* PBXTargetDependency */, 52818B011C1C084100F59085 /* PBXTargetDependency */, ); name = MacVim; @@ -918,10 +916,6 @@ mainGroup = 29B97314FDCFA39411CA2CEA /* MacVim */; projectDirPath = ""; projectReferences = ( - { - ProductGroup = 1D493DB40C52533B00AB718C /* Products */; - ProjectRef = 1D493DB30C52533B00AB718C /* PSMTabBarControl.xcodeproj */; - }, { ProductGroup = 52818AFB1C1C075300F59085 /* Products */; ProjectRef = 52818AFA1C1C075300F59085 /* QuickLookStephen.xcodeproj */; @@ -935,13 +929,6 @@ /* End PBXProject section */ /* Begin PBXReferenceProxy section */ - 1D493DB90C52533B00AB718C /* PSMTabBarControl.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = PSMTabBarControl.framework; - remoteRef = 1D493DB80C52533B00AB718C /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; 52818AFF1C1C075300F59085 /* QLStephen.qlgenerator */ = { isa = PBXReferenceProxy; fileType = wrapper.cfbundle; @@ -1047,7 +1034,6 @@ }; 90C052E1251E889500E2D81E /* Copy vimtutor */ = { isa = PBXShellScriptBuildPhase; - alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -1074,6 +1060,7 @@ files = ( 8D11072D0486CEB800E47090 /* main.m in Sources */, 1D1474980C56703C0038FA2B /* MacVim.m in Sources */, + 925B55D5254B604A006B047E /* MMHoverButton.m in Sources */, 1D1474A00C5673AE0038FA2B /* MMAppController.m in Sources */, 1D1474AA0C5677450038FA2B /* MMTextStorage.m in Sources */, 1D1474B00C5678370038FA2B /* MMTextView.m in Sources */, @@ -1090,18 +1077,15 @@ 1D145C7F0E5227CE00691AA0 /* MMTextViewHelper.m in Sources */, 1D60088B0E96A0B2003763F0 /* MMFindReplaceController.m in Sources */, 1DE63FFB0E71820F00959BDB /* MMCoreTextView.m in Sources */, + 92C6F6E825587E1C007AE21E /* MMTab.m in Sources */, 1D44972211FCA9B400B0630F /* MMCoreTextView+ToolTip.m in Sources */, + 92C6F6E925587E1C007AE21E /* MMTabline.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - 1D493DCD0C5254A400AB718C /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = PSMTabBarControlFramework; - targetProxy = 1D493DCC0C5254A400AB718C /* PBXContainerItemProxy */; - }; 52818B011C1C084100F59085 /* PBXTargetDependency */ = { isa = PBXTargetDependency; name = QuickLookStephen; diff --git a/src/MacVim/Miscellaneous.h b/src/MacVim/Miscellaneous.h index 0a76dd141f..f8419cca34 100644 --- a/src/MacVim/Miscellaneous.h +++ b/src/MacVim/Miscellaneous.h @@ -22,6 +22,7 @@ extern NSString *MMTabMinWidthKey; extern NSString *MMTabMaxWidthKey; extern NSString *MMTabOptimumWidthKey; extern NSString *MMShowAddTabButtonKey; +extern NSString *MMShowTabScrollButtonsKey; extern NSString *MMTextInsetLeftKey; extern NSString *MMTextInsetRightKey; extern NSString *MMTextInsetTopKey; @@ -140,11 +141,6 @@ enum { @end -@interface NSTabView (MMExtras) -- (void)removeAllTabViewItems; -@end - - @interface NSNumber (MMExtras) // HACK to allow font size to be changed via menu (bound to Cmd+/Cmd-) - (NSInteger)tag; @@ -169,7 +165,4 @@ NSString *normalizeFilename(NSString *filename); NSArray *normalizeFilenames(NSArray *filenames); -BOOL shouldUseYosemiteTabBarStyle(); -BOOL shouldUseMojaveTabBarStyle(); - int getCurrentAppearance(NSAppearance *appearance); diff --git a/src/MacVim/Miscellaneous.m b/src/MacVim/Miscellaneous.m index ecbd37bc21..f6a463a8cf 100644 --- a/src/MacVim/Miscellaneous.m +++ b/src/MacVim/Miscellaneous.m @@ -18,6 +18,7 @@ NSString *MMTabMaxWidthKey = @"MMTabMaxWidth"; NSString *MMTabOptimumWidthKey = @"MMTabOptimumWidth"; NSString *MMShowAddTabButtonKey = @"MMShowAddTabButton"; +NSString *MMShowTabScrollButtonsKey = @"MMShowTabScrollButtons"; NSString *MMTextInsetLeftKey = @"MMTextInsetLeft"; NSString *MMTextInsetRightKey = @"MMTextInsetRight"; NSString *MMTextInsetTopKey = @"MMTextInsetTop"; @@ -225,23 +226,6 @@ - (NSToolbarItem *)itemWithItemIdentifier:(NSString *)identifier -@implementation NSTabView (MMExtras) - -- (void)removeAllTabViewItems -{ - NSArray *existingItems = [self tabViewItems]; - NSEnumerator *e = [existingItems objectEnumerator]; - NSTabViewItem *item; - while ((item = [e nextObject])) { - [self removeTabViewItem:item]; - } -} - -@end // NSTabView (MMExtras) - - - - @implementation NSNumber (MMExtras) // HACK to allow font size to be changed via menu (bound to Cmd+/Cmd-) @@ -312,22 +296,6 @@ - (NSInteger)tag - BOOL -shouldUseYosemiteTabBarStyle() -{ - return floor(NSAppKitVersionNumber) >= NSAppKitVersionNumber10_10; -} - BOOL -shouldUseMojaveTabBarStyle() -{ -#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 - if (@available(macos 10.14, *)) { - return true; - } -#endif - return false; -} - int getCurrentAppearance(NSAppearance *appearance){ int flag = 0; // for macOS 10.13 or earlier always return 0; diff --git a/src/MacVim/PSMTabBarControl/English.lproj/InfoPlist.strings b/src/MacVim/PSMTabBarControl/English.lproj/InfoPlist.strings deleted file mode 100644 index 0bf04f0d2c..0000000000 Binary files a/src/MacVim/PSMTabBarControl/English.lproj/InfoPlist.strings and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/classes.nib b/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/classes.nib deleted file mode 100644 index 2e3f46075b..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/classes.nib +++ /dev/null @@ -1,24 +0,0 @@ -{ - IBClasses = ( - { - ACTIONS = {newWindow = id; }; - CLASS = AppController; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - {CLASS = FakeModel; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = {addNewTab = id; closeTab = id; }; - CLASS = FirstResponder; - LANGUAGE = ObjC; - SUPERCLASS = NSObject; - }, - { - CLASS = PSMTabBarControl; - LANGUAGE = ObjC; - OUTLETS = {delegate = id; partnerView = id; style = id; tabView = NSTabView; }; - SUPERCLASS = NSControl; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/info.nib b/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/info.nib deleted file mode 100644 index c7f7c64d43..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/info.nib +++ /dev/null @@ -1,21 +0,0 @@ - - - - - IBDocumentLocation - 135 107 356 240 0 0 1680 1028 - IBEditorPositions - - 29 - 130 357 371 44 0 0 1680 1028 - - IBFramework Version - 443.0 - IBOpenObjects - - 29 - - IBSystem Version - 8H14 - - diff --git a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/keyedobjects.nib b/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/keyedobjects.nib deleted file mode 100644 index 3481421857..0000000000 Binary files a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/keyedobjects.nib and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/objects.nib b/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/objects.nib deleted file mode 100644 index bda1534dc4..0000000000 Binary files a/src/MacVim/PSMTabBarControl/English.lproj/MainMenu.nib/objects.nib and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/classes.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/classes.nib deleted file mode 100644 index 659b73a0ee..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/classes.nib +++ /dev/null @@ -1,22 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - CLASS = PSMTabBarControlInspector; - LANGUAGE = ObjC; - OUTLETS = { - "_allowsDragBetweenWindows" = NSButton; - "_canCloseOnlyTab" = NSButton; - "_cellMaxWidth" = NSTextField; - "_cellMinWidth" = NSTextField; - "_cellOptimumWidth" = NSTextField; - "_hideForSingleTab" = NSButton; - "_showAddTab" = NSButton; - "_sizeToFit" = NSButton; - "_stylePopUp" = NSPopUpButton; - }; - SUPERCLASS = IBInspector; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/info.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/info.nib deleted file mode 100644 index bf503dd361..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBDocumentLocation - 83 72 356 240 0 0 1680 1028 - IBFramework Version - 446.1 - IBOpenObjects - - 3 - - IBSystem Version - 8I127 - - diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/keyedobjects.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/keyedobjects.nib deleted file mode 100644 index 2def97d1d3..0000000000 Binary files a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/keyedobjects.nib and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/objects.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/objects.nib deleted file mode 100644 index 9a89923a6c..0000000000 Binary files a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlInspector.nib/objects.nib and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/classes.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/classes.nib deleted file mode 100644 index 4752228596..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/classes.nib +++ /dev/null @@ -1,28 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - {CLASS = PSMAquaTabStyle; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - {CLASS = PSMMetalTabStyle; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - {CLASS = PSMOverflowPopUpButton; LANGUAGE = ObjC; SUPERCLASS = NSPopUpButton; }, - { - CLASS = PSMProgressIndicator; - LANGUAGE = ObjC; - SUPERCLASS = NSProgressIndicator; - }, - {CLASS = PSMRolloverButton; LANGUAGE = ObjC; SUPERCLASS = NSButton; }, - {CLASS = PSMTabBarCell; LANGUAGE = ObjC; SUPERCLASS = NSActionCell; }, - { - CLASS = PSMTabBarControl; - LANGUAGE = ObjC; - OUTLETS = {delegate = id; partnerView = id; style = id; tabView = NSTabView; }; - SUPERCLASS = NSControl; - }, - { - CLASS = PSMTabBarControlPalette; - LANGUAGE = ObjC; - OUTLETS = {repImage = NSImageView; }; - SUPERCLASS = IBPalette; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/info.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/info.nib deleted file mode 100644 index 866500bb2a..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/info.nib +++ /dev/null @@ -1,16 +0,0 @@ - - - - - IBDocumentLocation - 83 142 356 240 0 0 1680 1028 - IBFramework Version - 443.0 - IBOpenObjects - - 2 - - IBSystem Version - 8H14 - - diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/keyedobjects.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/keyedobjects.nib deleted file mode 100644 index 635e6d8d17..0000000000 Binary files a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/keyedobjects.nib and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/objects.nib b/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/objects.nib deleted file mode 100644 index c0988d7f17..0000000000 Binary files a/src/MacVim/PSMTabBarControl/English.lproj/PSMTabBarControlPalette.nib/objects.nib and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/English.lproj/Window.nib/classes.nib b/src/MacVim/PSMTabBarControl/English.lproj/Window.nib/classes.nib deleted file mode 100644 index 92723a5894..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/Window.nib/classes.nib +++ /dev/null @@ -1,38 +0,0 @@ -{ - IBClasses = ( - {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; }, - { - ACTIONS = { - addNewTab = id; - closeTab = id; - configAddTabButton = id; - configCanCloseOnlyTab = id; - configHideForSingleTab = id; - configStyle = id; - configTabMaxWidth = id; - configTabMinWidth = id; - configTabOptimumWidth = id; - configTabSizeToFit = id; - isProcessingAction = id; - setIconNamed = id; - setObjectCount = id; - setTabLabel = id; - stopProcessing = id; - toggleToolbar = id; - }; - CLASS = WindowController; - LANGUAGE = ObjC; - OUTLETS = { - drawer = NSDrawer; - iconButton = NSPopUpButton; - isProcessingButton = NSButton; - objectCounterField = NSTextField; - tabBar = PSMTabBarControl; - tabField = NSTextField; - tabView = NSTabView; - }; - SUPERCLASS = NSWindowController; - } - ); - IBVersion = 1; -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/English.lproj/Window.nib/info.nib b/src/MacVim/PSMTabBarControl/English.lproj/Window.nib/info.nib deleted file mode 100644 index 38889a9c1f..0000000000 --- a/src/MacVim/PSMTabBarControl/English.lproj/Window.nib/info.nib +++ /dev/null @@ -1,25 +0,0 @@ - - - - - IBDocumentLocation - 35 49 356 240 0 0 1024 746 - IBEditorPositions - - 18 - 271 466 481 64 0 0 1024 746 - 20 - 400 254 224 482 0 0 1024 746 - - IBFramework Version - 446.1 - IBOpenObjects - - 18 - 20 - 5 - - IBSystem Version - 8J135 - - diff --git a/src/MacVim/PSMTabBarControl/English.lproj/Window.nib/keyedobjects.nib b/src/MacVim/PSMTabBarControl/English.lproj/Window.nib/keyedobjects.nib deleted file mode 100644 index d5228b2338..0000000000 Binary files a/src/MacVim/PSMTabBarControl/English.lproj/Window.nib/keyedobjects.nib and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/Info.plist b/src/MacVim/PSMTabBarControl/Info.plist deleted file mode 100644 index 1f2810bd63..0000000000 --- a/src/MacVim/PSMTabBarControl/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - PSMTabBarControl - CFBundleIconFile - - CFBundleIdentifier - com.positivespinmedia.PSMTabBarControl - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - BNDL - CFBundleSignature - PSM1 - CFBundleVersion - 1.1 - - diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/Contents.json deleted file mode 100644 index da4a164c91..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/Contents.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - } -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActive.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActive.colorset/Contents.json deleted file mode 100644 index 5fb7af753e..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActive.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "189", - "alpha" : "1.000", - "blue" : "188", - "green" : "189" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "40", - "alpha" : "1.000", - "blue" : "42", - "green" : "40" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveHighlight.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveHighlight.colorset/Contents.json deleted file mode 100644 index 2eb1b33a04..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveHighlight.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "168", - "alpha" : "1.000", - "blue" : "168", - "green" : "168" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "36", - "alpha" : "1.000", - "blue" : "39", - "green" : "37" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveSelected.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveSelected.colorset/Contents.json deleted file mode 100644 index 48860afed4..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundActiveSelected.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "209", - "alpha" : "1.000", - "blue" : "208", - "green" : "209" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "54", - "alpha" : "1.000", - "blue" : "57", - "green" : "55" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactive.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactive.colorset/Contents.json deleted file mode 100644 index d0a9f160ae..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactive.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "221", - "alpha" : "1.000", - "blue" : "221", - "green" : "221" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "30", - "alpha" : "1.000", - "blue" : "33", - "green" : "31" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveHighlight.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveHighlight.colorset/Contents.json deleted file mode 100644 index 5141105908..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveHighlight.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "198", - "alpha" : "1.000", - "blue" : "198", - "green" : "198" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "27", - "alpha" : "1.000", - "blue" : "30", - "green" : "28" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveSelected.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveSelected.colorset/Contents.json deleted file mode 100644 index a75643d03c..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBackgroundInactiveSelected.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "246", - "alpha" : "1.000", - "blue" : "246", - "green" : "246" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "43", - "alpha" : "1.000", - "blue" : "47", - "green" : "45" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderActive.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderActive.colorset/Contents.json deleted file mode 100644 index de2f835b0a..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderActive.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "169", - "alpha" : "1.000", - "blue" : "169", - "green" : "169" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "96", - "alpha" : "1.000", - "blue" : "99", - "green" : "97" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderInactive.colorset/Contents.json b/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderInactive.colorset/Contents.json deleted file mode 100644 index 498a74c360..0000000000 --- a/src/MacVim/PSMTabBarControl/Media.xcassets/MojaveTabBorderInactive.colorset/Contents.json +++ /dev/null @@ -1,38 +0,0 @@ -{ - "info" : { - "version" : 1, - "author" : "xcode" - }, - "colors" : [ - { - "idiom" : "universal", - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "210", - "alpha" : "1.000", - "blue" : "210", - "green" : "210" - } - } - }, - { - "idiom" : "universal", - "appearances" : [ - { - "appearance" : "luminosity", - "value" : "dark" - } - ], - "color" : { - "color-space" : "srgb", - "components" : { - "red" : "73", - "alpha" : "1.000", - "blue" : "77", - "green" : "74" - } - } - } - ] -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/PSMTabBarControl.ibclassdescription b/src/MacVim/PSMTabBarControl/PSMTabBarControl.ibclassdescription deleted file mode 100755 index 89959b3847..0000000000 --- a/src/MacVim/PSMTabBarControl/PSMTabBarControl.ibclassdescription +++ /dev/null @@ -1,7 +0,0 @@ -{ - PSMTabBarControl = { - SuperClass = NSControl; - Attributes = { - }; - }; -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj b/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj deleted file mode 100644 index 21c3f7f560..0000000000 --- a/src/MacVim/PSMTabBarControl/PSMTabBarControl.xcodeproj/project.pbxproj +++ /dev/null @@ -1,731 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXAggregateTarget section */ - 53DF6901067E5B8E0090B5B0 /* All */ = { - isa = PBXAggregateTarget; - buildConfigurationList = C056398708A954F8003078D8 /* Build configuration list for PBXAggregateTarget "All" */; - buildPhases = ( - ); - dependencies = ( - 53DF6905067E5B930090B5B0 /* PBXTargetDependency */, - ); - name = All; - productName = All; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 13F8B89007B43554008AE28D /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD92D38A0106425D02CA0E72 /* Cocoa.framework */; }; - 523897F415BDA9AC00498A53 /* TabClose_Front_Pressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897EE15BDA9AC00498A53 /* TabClose_Front_Pressed@2x.png */; }; - 523897F515BDA9AC00498A53 /* TabClose_Front_Rollover@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897EF15BDA9AC00498A53 /* TabClose_Front_Rollover@2x.png */; }; - 523897F615BDA9AC00498A53 /* TabClose_Front@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897F015BDA9AC00498A53 /* TabClose_Front@2x.png */; }; - 523897F715BDA9AC00498A53 /* TabNewMetal@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897F115BDA9AC00498A53 /* TabNewMetal@2x.png */; }; - 523897F815BDA9AC00498A53 /* TabNewMetalPressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897F215BDA9AC00498A53 /* TabNewMetalPressed@2x.png */; }; - 523897F915BDA9AC00498A53 /* TabNewMetalRollover@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 523897F315BDA9AC00498A53 /* TabNewMetalRollover@2x.png */; }; - 52A57C0F15BBA230003EC59C /* TabClose_Front.png in Resources */ = {isa = PBXBuildFile; fileRef = 52A57C0C15BBA230003EC59C /* TabClose_Front.png */; }; - 52A57C1015BBA230003EC59C /* TabClose_Front_Pressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 52A57C0D15BBA230003EC59C /* TabClose_Front_Pressed.png */; }; - 52A57C1115BBA230003EC59C /* TabClose_Front_Rollover.png in Resources */ = {isa = PBXBuildFile; fileRef = 52A57C0E15BBA230003EC59C /* TabClose_Front_Rollover.png */; }; - 52C0B9B415BDB7A9000C268F /* overflowImage@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 52C0B9B215BDB7A9000C268F /* overflowImage@2x.png */; }; - 52C0B9B515BDB7A9000C268F /* overflowImagePressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 52C0B9B315BDB7A9000C268F /* overflowImagePressed@2x.png */; }; - 52C268D015BDB72B0012FECA /* overflowImage.png in Resources */ = {isa = PBXBuildFile; fileRef = 52C268CE15BDB72B0012FECA /* overflowImage.png */; }; - 52C268D115BDB72B0012FECA /* overflowImagePressed.png in Resources */ = {isa = PBXBuildFile; fileRef = 52C268CF15BDB72B0012FECA /* overflowImagePressed.png */; }; - 52FAFCCF1C30F4B500C6E613 /* TabNewYosemite.png in Resources */ = {isa = PBXBuildFile; fileRef = 52FAFCCD1C30F4B500C6E613 /* TabNewYosemite.png */; }; - 52FAFCD01C30F4B500C6E613 /* TabNewYosemite@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 52FAFCCE1C30F4B500C6E613 /* TabNewYosemite@2x.png */; }; - 52FAFCD31C30F4DF00C6E613 /* PSMYosemiteTabStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 52FAFCD11C30F4DF00C6E613 /* PSMYosemiteTabStyle.h */; }; - 52FAFCD41C30F4DF00C6E613 /* PSMYosemiteTabStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 52FAFCD21C30F4DF00C6E613 /* PSMYosemiteTabStyle.m */; }; - 546DEAF1067F63070098DCC4 /* PSMTabBarControl.m in Sources */ = {isa = PBXBuildFile; fileRef = 0259C576FE90428111CA0C5A /* PSMTabBarControl.m */; }; - 546DEAF2067F630E0098DCC4 /* PSMTabBarControl.h in Headers */ = {isa = PBXBuildFile; fileRef = 0259C57AFE90428111CA0C5A /* PSMTabBarControl.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 90AD234F21A969C100CEF036 /* PSMMojaveTabStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = 90AD234D21A969C100CEF036 /* PSMMojaveTabStyle.h */; }; - 90AD235021A969C100CEF036 /* PSMMojaveTabStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = 90AD234E21A969C100CEF036 /* PSMMojaveTabStyle.m */; }; - 90DE16CC21A955EE004F0124 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 90DE16CB21A955EE004F0124 /* Media.xcassets */; }; - A2082A9009EAEB34009AC8BE /* PSMTabDragAssistant.h in Headers */ = {isa = PBXBuildFile; fileRef = A2082A8D09EAEB33009AC8BE /* PSMTabDragAssistant.h */; }; - A2082A9109EAEB34009AC8BE /* PSMTabDragAssistant.m in Sources */ = {isa = PBXBuildFile; fileRef = A2082A8E09EAEB33009AC8BE /* PSMTabDragAssistant.m */; }; - A2129BB209AEB58F00724E6C /* PSMProgressIndicator.h in Headers */ = {isa = PBXBuildFile; fileRef = A2129BAF09AEB58F00724E6C /* PSMProgressIndicator.h */; }; - A2129BB309AEB58F00724E6C /* PSMProgressIndicator.m in Sources */ = {isa = PBXBuildFile; fileRef = A2129BB009AEB58F00724E6C /* PSMProgressIndicator.m */; }; - A251BE850959A1B90058BC7F /* PSMOverflowPopUpButton.h in Headers */ = {isa = PBXBuildFile; fileRef = A251BE810959A1B90058BC7F /* PSMOverflowPopUpButton.h */; }; - A251BE860959A1B90058BC7F /* PSMOverflowPopUpButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A251BE820959A1B90058BC7F /* PSMOverflowPopUpButton.m */; }; - A251BE870959A1B90058BC7F /* PSMTabBarCell.h in Headers */ = {isa = PBXBuildFile; fileRef = A251BE830959A1B90058BC7F /* PSMTabBarCell.h */; }; - A251BE880959A1B90058BC7F /* PSMTabBarCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A251BE840959A1B90058BC7F /* PSMTabBarCell.m */; }; - A268E80409A9822A00E082AA /* AquaTabNew.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7F809A9822900E082AA /* AquaTabNew.png */; }; - A268E80509A9822A00E082AA /* AquaTabNewPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7F909A9822900E082AA /* AquaTabNewPressed.png */; }; - A268E80609A9822A00E082AA /* AquaTabNewRollover.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7FA09A9822900E082AA /* AquaTabNewRollover.png */; }; - A268E80709A9822A00E082AA /* TabNewMetal.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7FB09A9822900E082AA /* TabNewMetal.png */; }; - A268E80809A9822A00E082AA /* TabNewMetalPressed.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7FC09A9822900E082AA /* TabNewMetalPressed.png */; }; - A268E80909A9822A00E082AA /* TabNewMetalRollover.png in Resources */ = {isa = PBXBuildFile; fileRef = A268E7FD09A9822900E082AA /* TabNewMetalRollover.png */; }; - A268EA6209A9831800E082AA /* PSMRolloverButton.h in Headers */ = {isa = PBXBuildFile; fileRef = A268EA5F09A9831800E082AA /* PSMRolloverButton.h */; }; - A268EA6309A9831800E082AA /* PSMRolloverButton.m in Sources */ = {isa = PBXBuildFile; fileRef = A268EA6009A9831800E082AA /* PSMRolloverButton.m */; }; - A27E47850A28EE76007BA395 /* TabIcon.tif in Resources */ = {isa = PBXBuildFile; fileRef = A20822F00959F6AA00C5F5A4 /* TabIcon.tif */; }; - A27E47880A28EE7C007BA395 /* TabControlRep.tif in Resources */ = {isa = PBXBuildFile; fileRef = A20822EF0959F6AA00C5F5A4 /* TabControlRep.tif */; }; - A2C0D99509AF870000ED379C /* pi.png in Resources */ = {isa = PBXBuildFile; fileRef = A2C0D99309AF870000ED379C /* pi.png */; }; - A2D32EDC09A634C900EC8662 /* PSMTabStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D32EDA09A634C900EC8662 /* PSMTabStyle.h */; }; - A2D32EF709A63BF700EC8662 /* AquaTabClose_Front_Pressed.tif in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF009A63BF700EC8662 /* AquaTabClose_Front_Pressed.tif */; }; - A2D32EF809A63BF700EC8662 /* AquaTabClose_Front_Rollover.tif in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF109A63BF700EC8662 /* AquaTabClose_Front_Rollover.tif */; }; - A2D32EF909A63BF700EC8662 /* AquaTabClose_Front.tif in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF209A63BF700EC8662 /* AquaTabClose_Front.tif */; }; - A2D32EFA09A63BF700EC8662 /* AquaTabsBackground.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF309A63BF700EC8662 /* AquaTabsBackground.png */; }; - A2D32EFB09A63BF700EC8662 /* AquaTabsDown.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF409A63BF700EC8662 /* AquaTabsDown.png */; }; - A2D32EFC09A63BF700EC8662 /* AquaTabsSeparator.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF509A63BF700EC8662 /* AquaTabsSeparator.png */; }; - A2D32EFD09A63BF700EC8662 /* AquaTabsSeparatorDown.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D32EF609A63BF700EC8662 /* AquaTabsSeparatorDown.png */; }; - A2D32F0009A63D7A00EC8662 /* PSMMetalTabStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D32EFE09A63D7A00EC8662 /* PSMMetalTabStyle.h */; }; - A2D32F0109A63D7A00EC8662 /* PSMMetalTabStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = A2D32EFF09A63D7A00EC8662 /* PSMMetalTabStyle.m */; }; - A2D3317C09A68B7500EC8662 /* AquaTabsDownGraphite.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D3317A09A68B7500EC8662 /* AquaTabsDownGraphite.png */; }; - A2D3317D09A68B7500EC8662 /* AquaTabsDownNonKey.png in Resources */ = {isa = PBXBuildFile; fileRef = A2D3317B09A68B7500EC8662 /* AquaTabsDownNonKey.png */; }; - A2D98B0A0A2B432C0064C6F8 /* PSMUnifiedTabStyle.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D98B070A2B432C0064C6F8 /* PSMUnifiedTabStyle.h */; }; - A2D98B0B0A2B432C0064C6F8 /* PSMUnifiedTabStyle.m in Sources */ = {isa = PBXBuildFile; fileRef = A2D98B080A2B432C0064C6F8 /* PSMUnifiedTabStyle.m */; }; - A2D98B120A2B43FA0064C6F8 /* NSBezierPath_AMShading.h in Headers */ = {isa = PBXBuildFile; fileRef = A2D98B0F0A2B43FA0064C6F8 /* NSBezierPath_AMShading.h */; }; - A2D98B130A2B43FA0064C6F8 /* NSBezierPath_AMShading.m in Sources */ = {isa = PBXBuildFile; fileRef = A2D98B100A2B43FA0064C6F8 /* NSBezierPath_AMShading.m */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 53DF6904067E5B930090B5B0 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 0259C573FE90428111CA0C5A /* Project object */; - proxyType = 1; - remoteGlobalIDString = 53DF68FC067E5B5A0090B5B0; - remoteInfo = PSMTabBarControlFramework; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXFileReference section */ - 0259C576FE90428111CA0C5A /* PSMTabBarControl.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMTabBarControl.m; path = source/PSMTabBarControl.m; sourceTree = ""; }; - 0259C577FE90428111CA0C5A /* PSMTabBarControlInspector.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMTabBarControlInspector.m; path = source/PSMTabBarControlInspector.m; sourceTree = ""; }; - 0259C578FE90428111CA0C5A /* PSMTabBarControlPalette.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMTabBarControlPalette.m; path = source/PSMTabBarControlPalette.m; sourceTree = ""; }; - 0259C57AFE90428111CA0C5A /* PSMTabBarControl.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMTabBarControl.h; path = source/PSMTabBarControl.h; sourceTree = ""; }; - 0259C57BFE90428111CA0C5A /* PSMTabBarControlInspector.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMTabBarControlInspector.h; path = source/PSMTabBarControlInspector.h; sourceTree = ""; }; - 0259C57CFE90428111CA0C5A /* PSMTabBarControlPalette.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMTabBarControlPalette.h; path = source/PSMTabBarControlPalette.h; sourceTree = ""; }; - 0259C57FFE90428111CA0C5A /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/PSMTabBarControlInspector.nib; sourceTree = ""; }; - 0259C581FE90428111CA0C5A /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/PSMTabBarControlPalette.nib; sourceTree = ""; }; - 0259C583FE90428111CA0C5A /* palette.table */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xml; path = palette.table; sourceTree = ""; }; - 13EB9DBD07DE0F1E00EB933A /* InterfaceBuilder.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = InterfaceBuilder.framework; path = /System/Library/Frameworks/InterfaceBuilder.framework; sourceTree = ""; }; - 13F8B88807B434F6008AE28D /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = ""; }; - 13F8B88A07B434F6008AE28D /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = ""; }; - 32DBCF980370C29C00C91783 /* PSMTabBarControl_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMTabBarControl_Prefix.pch; path = source/PSMTabBarControl_Prefix.pch; sourceTree = ""; }; - 523897EE15BDA9AC00498A53 /* TabClose_Front_Pressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabClose_Front_Pressed@2x.png"; path = "images/TabClose_Front_Pressed@2x.png"; sourceTree = ""; }; - 523897EF15BDA9AC00498A53 /* TabClose_Front_Rollover@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabClose_Front_Rollover@2x.png"; path = "images/TabClose_Front_Rollover@2x.png"; sourceTree = ""; }; - 523897F015BDA9AC00498A53 /* TabClose_Front@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabClose_Front@2x.png"; path = "images/TabClose_Front@2x.png"; sourceTree = ""; }; - 523897F115BDA9AC00498A53 /* TabNewMetal@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabNewMetal@2x.png"; path = "images/TabNewMetal@2x.png"; sourceTree = ""; }; - 523897F215BDA9AC00498A53 /* TabNewMetalPressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabNewMetalPressed@2x.png"; path = "images/TabNewMetalPressed@2x.png"; sourceTree = ""; }; - 523897F315BDA9AC00498A53 /* TabNewMetalRollover@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabNewMetalRollover@2x.png"; path = "images/TabNewMetalRollover@2x.png"; sourceTree = ""; }; - 52A57C0C15BBA230003EC59C /* TabClose_Front.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabClose_Front.png; path = images/TabClose_Front.png; sourceTree = ""; }; - 52A57C0D15BBA230003EC59C /* TabClose_Front_Pressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabClose_Front_Pressed.png; path = images/TabClose_Front_Pressed.png; sourceTree = ""; }; - 52A57C0E15BBA230003EC59C /* TabClose_Front_Rollover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabClose_Front_Rollover.png; path = images/TabClose_Front_Rollover.png; sourceTree = ""; }; - 52C0B9B215BDB7A9000C268F /* overflowImage@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "overflowImage@2x.png"; path = "images/overflowImage@2x.png"; sourceTree = ""; }; - 52C0B9B315BDB7A9000C268F /* overflowImagePressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "overflowImagePressed@2x.png"; path = "images/overflowImagePressed@2x.png"; sourceTree = ""; }; - 52C268CE15BDB72B0012FECA /* overflowImage.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = overflowImage.png; path = images/overflowImage.png; sourceTree = ""; }; - 52C268CF15BDB72B0012FECA /* overflowImagePressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = overflowImagePressed.png; path = images/overflowImagePressed.png; sourceTree = ""; }; - 52FAFCCD1C30F4B500C6E613 /* TabNewYosemite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabNewYosemite.png; path = images/TabNewYosemite.png; sourceTree = ""; }; - 52FAFCCE1C30F4B500C6E613 /* TabNewYosemite@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "TabNewYosemite@2x.png"; path = "images/TabNewYosemite@2x.png"; sourceTree = ""; }; - 52FAFCD11C30F4DF00C6E613 /* PSMYosemiteTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMYosemiteTabStyle.h; path = source/PSMYosemiteTabStyle.h; sourceTree = ""; }; - 52FAFCD21C30F4DF00C6E613 /* PSMYosemiteTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PSMYosemiteTabStyle.m; path = source/PSMYosemiteTabStyle.m; sourceTree = ""; }; - 53DF68FD067E5B5A0090B5B0 /* PSMTabBarControl.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = PSMTabBarControl.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 53DF68FE067E5B5A0090B5B0 /* PSMTabBarControlFramework-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PSMTabBarControlFramework-Info.plist"; sourceTree = ""; }; - 54D33B2806778E3300C9C163 /* PSMTabBarControl.ibclassdescription */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PSMTabBarControl.ibclassdescription; sourceTree = ""; }; - 8D1AC9730486D14A00FE50C9 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = ""; }; - 8D1AC97B0486D23100FE50C9 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - 90AD234D21A969C100CEF036 /* PSMMojaveTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMMojaveTabStyle.h; path = source/PSMMojaveTabStyle.h; sourceTree = ""; }; - 90AD234E21A969C100CEF036 /* PSMMojaveTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PSMMojaveTabStyle.m; path = source/PSMMojaveTabStyle.m; sourceTree = ""; }; - 90DE16CB21A955EE004F0124 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = ""; }; - A2072A2409ABD88600304BCB /* Folder.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = Folder.tif; path = images/Folder.tif; sourceTree = ""; }; - A2072A2509ABD88600304BCB /* Globe.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = Globe.tiff; path = images/Globe.tiff; sourceTree = ""; }; - A2072B5C09AC1FA500304BCB /* Warning.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Warning.png; path = images/Warning.png; sourceTree = ""; }; - A20822EF0959F6AA00C5F5A4 /* TabControlRep.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = TabControlRep.tif; path = images/TabControlRep.tif; sourceTree = ""; }; - A20822F00959F6AA00C5F5A4 /* TabIcon.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = TabIcon.tif; path = images/TabIcon.tif; sourceTree = ""; }; - A2082A8D09EAEB33009AC8BE /* PSMTabDragAssistant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMTabDragAssistant.h; path = source/PSMTabDragAssistant.h; sourceTree = ""; }; - A2082A8E09EAEB33009AC8BE /* PSMTabDragAssistant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PSMTabDragAssistant.m; path = source/PSMTabDragAssistant.m; sourceTree = ""; wrapsLines = 0; }; - A2129BAF09AEB58F00724E6C /* PSMProgressIndicator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMProgressIndicator.h; path = source/PSMProgressIndicator.h; sourceTree = ""; }; - A2129BB009AEB58F00724E6C /* PSMProgressIndicator.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PSMProgressIndicator.m; path = source/PSMProgressIndicator.m; sourceTree = ""; }; - A246FB040A2BD6F9005BDF7B /* PSMTabBarControlDoc.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html.documentation; name = PSMTabBarControlDoc.html; path = documentation/PSMTabBarControlDoc.html; sourceTree = ""; }; - A251BE810959A1B90058BC7F /* PSMOverflowPopUpButton.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 30; name = PSMOverflowPopUpButton.h; path = source/PSMOverflowPopUpButton.h; sourceTree = ""; }; - A251BE820959A1B90058BC7F /* PSMOverflowPopUpButton.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMOverflowPopUpButton.m; path = source/PSMOverflowPopUpButton.m; sourceTree = ""; }; - A251BE830959A1B90058BC7F /* PSMTabBarCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMTabBarCell.h; path = source/PSMTabBarCell.h; sourceTree = ""; }; - A251BE840959A1B90058BC7F /* PSMTabBarCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMTabBarCell.m; path = source/PSMTabBarCell.m; sourceTree = ""; }; - A251BE890959A1EA0058BC7F /* AppController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = AppController.h; path = source/AppController.h; sourceTree = ""; }; - A251BE8A0959A1EA0058BC7F /* AppController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = AppController.m; path = source/AppController.m; sourceTree = ""; }; - A251BE8B0959A1EA0058BC7F /* FakeModel.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FakeModel.h; path = source/FakeModel.h; sourceTree = ""; }; - A251BE8C0959A1EA0058BC7F /* FakeModel.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = FakeModel.m; path = source/FakeModel.m; sourceTree = ""; }; - A251BE8D0959A1EA0058BC7F /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = main.m; path = source/main.m; sourceTree = ""; }; - A251BE8F0959A23A0058BC7F /* 32x32cancel.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = 32x32cancel.png; path = images/32x32cancel.png; sourceTree = ""; }; - A251BE9B0959A2530058BC7F /* ReadMe.rtfd */ = {isa = PBXFileReference; lastKnownFileType = wrapper.rtfd; path = ReadMe.rtfd; sourceTree = ""; }; - A251BEA20959BB5B0058BC7F /* TabBarControlDemo-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TabBarControlDemo-Info.plist"; sourceTree = ""; }; - A251BEC30959BC0E0058BC7F /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/MainMenu.nib; sourceTree = ""; }; - A268E7F809A9822900E082AA /* AquaTabNew.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabNew.png; path = images/AquaTabNew.png; sourceTree = ""; }; - A268E7F909A9822900E082AA /* AquaTabNewPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabNewPressed.png; path = images/AquaTabNewPressed.png; sourceTree = ""; }; - A268E7FA09A9822900E082AA /* AquaTabNewRollover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabNewRollover.png; path = images/AquaTabNewRollover.png; sourceTree = ""; }; - A268E7FB09A9822900E082AA /* TabNewMetal.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabNewMetal.png; path = images/TabNewMetal.png; sourceTree = ""; }; - A268E7FC09A9822900E082AA /* TabNewMetalPressed.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabNewMetalPressed.png; path = images/TabNewMetalPressed.png; sourceTree = ""; }; - A268E7FD09A9822900E082AA /* TabNewMetalRollover.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = TabNewMetalRollover.png; path = images/TabNewMetalRollover.png; sourceTree = ""; }; - A268EA5F09A9831800E082AA /* PSMRolloverButton.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMRolloverButton.h; path = source/PSMRolloverButton.h; sourceTree = ""; }; - A268EA6009A9831800E082AA /* PSMRolloverButton.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMRolloverButton.m; path = source/PSMRolloverButton.m; sourceTree = ""; }; - A269361009A778770006911E /* 32x32_log.tiff */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = 32x32_log.tiff; path = images/32x32_log.tiff; sourceTree = ""; }; - A2A711BA09E5AE1E00D0089B /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Window.nib; sourceTree = ""; }; - A2A711BD09E5BF0500D0089B /* WindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WindowController.h; path = source/WindowController.h; sourceTree = ""; }; - A2A711BE09E5BF0500D0089B /* WindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = WindowController.m; path = source/WindowController.m; sourceTree = ""; }; - A2C0D99309AF870000ED379C /* pi.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = pi.png; path = images/pi.png; sourceTree = ""; }; - A2D32EDA09A634C900EC8662 /* PSMTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMTabStyle.h; path = source/PSMTabStyle.h; sourceTree = ""; }; - A2D32EF009A63BF700EC8662 /* AquaTabClose_Front_Pressed.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = AquaTabClose_Front_Pressed.tif; path = images/AquaTabClose_Front_Pressed.tif; sourceTree = ""; }; - A2D32EF109A63BF700EC8662 /* AquaTabClose_Front_Rollover.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = AquaTabClose_Front_Rollover.tif; path = images/AquaTabClose_Front_Rollover.tif; sourceTree = ""; }; - A2D32EF209A63BF700EC8662 /* AquaTabClose_Front.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = AquaTabClose_Front.tif; path = images/AquaTabClose_Front.tif; sourceTree = ""; }; - A2D32EF309A63BF700EC8662 /* AquaTabsBackground.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsBackground.png; path = images/AquaTabsBackground.png; sourceTree = ""; }; - A2D32EF409A63BF700EC8662 /* AquaTabsDown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsDown.png; path = images/AquaTabsDown.png; sourceTree = ""; }; - A2D32EF509A63BF700EC8662 /* AquaTabsSeparator.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsSeparator.png; path = images/AquaTabsSeparator.png; sourceTree = ""; }; - A2D32EF609A63BF700EC8662 /* AquaTabsSeparatorDown.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsSeparatorDown.png; path = images/AquaTabsSeparatorDown.png; sourceTree = ""; }; - A2D32EFE09A63D7A00EC8662 /* PSMMetalTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PSMMetalTabStyle.h; path = source/PSMMetalTabStyle.h; sourceTree = ""; }; - A2D32EFF09A63D7A00EC8662 /* PSMMetalTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PSMMetalTabStyle.m; path = source/PSMMetalTabStyle.m; sourceTree = ""; }; - A2D3317A09A68B7500EC8662 /* AquaTabsDownGraphite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsDownGraphite.png; path = images/AquaTabsDownGraphite.png; sourceTree = ""; }; - A2D3317B09A68B7500EC8662 /* AquaTabsDownNonKey.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = AquaTabsDownNonKey.png; path = images/AquaTabsDownNonKey.png; sourceTree = ""; }; - A2D98B070A2B432C0064C6F8 /* PSMUnifiedTabStyle.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PSMUnifiedTabStyle.h; path = source/PSMUnifiedTabStyle.h; sourceTree = ""; }; - A2D98B080A2B432C0064C6F8 /* PSMUnifiedTabStyle.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PSMUnifiedTabStyle.m; path = source/PSMUnifiedTabStyle.m; sourceTree = ""; }; - A2D98B0F0A2B43FA0064C6F8 /* NSBezierPath_AMShading.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NSBezierPath_AMShading.h; path = source/NSBezierPath_AMShading.h; sourceTree = ""; }; - A2D98B100A2B43FA0064C6F8 /* NSBezierPath_AMShading.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = NSBezierPath_AMShading.m; path = source/NSBezierPath_AMShading.m; sourceTree = ""; }; - DD92D38A0106425D02CA0E72 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 53DF68FB067E5B5A0090B5B0 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 13F8B89007B43554008AE28D /* Cocoa.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 0259C574FE90428111CA0C5A /* PSMTabBarControl */ = { - isa = PBXGroup; - children = ( - A251BE9B0959A2530058BC7F /* ReadMe.rtfd */, - A246FADE0A2BD446005BDF7B /* Documentation */, - 32DBCF9E0370C38000C91783 /* Palette */, - 54D33B2C06778E4400C9C163 /* Framework */, - A251BE590959A0550058BC7F /* Demo App */, - 0259C582FE90428111CA0C5A /* Resources */, - 1ED78706FE9D4A0611CA0C5A /* Products */, - 2E58F364FFB232C311CA0CBA /* Frameworks */, - ); - name = PSMTabBarControl; - sourceTree = ""; - }; - 0259C582FE90428111CA0C5A /* Resources */ = { - isa = PBXGroup; - children = ( - 90DE16CB21A955EE004F0124 /* Media.xcassets */, - A251BEC20959BC0E0058BC7F /* MainMenu.nib */, - A251BE8E0959A21A0058BC7F /* Images */, - 8D1AC9730486D14A00FE50C9 /* Info.plist */, - 53DF68FE067E5B5A0090B5B0 /* PSMTabBarControlFramework-Info.plist */, - A251BEA20959BB5B0058BC7F /* TabBarControlDemo-Info.plist */, - 8D1AC97F0486D23B00FE50C9 /* InfoPlist.strings */, - A2A711B909E5AE1E00D0089B /* Window.nib */, - ); - name = Resources; - sourceTree = ""; - }; - 131E8FE8067F80F40006E0CE /* Resources */ = { - isa = PBXGroup; - children = ( - A20822EF0959F6AA00C5F5A4 /* TabControlRep.tif */, - A20822F00959F6AA00C5F5A4 /* TabIcon.tif */, - 0259C57EFE90428111CA0C5A /* PSMTabBarControlInspector.nib */, - 0259C580FE90428111CA0C5A /* PSMTabBarControlPalette.nib */, - ); - name = Resources; - sourceTree = ""; - }; - 13F8B6FD07B43410008AE28D /* Linked Frameworks */ = { - isa = PBXGroup; - children = ( - 13EB9DBD07DE0F1E00EB933A /* InterfaceBuilder.framework */, - DD92D38A0106425D02CA0E72 /* Cocoa.framework */, - ); - name = "Linked Frameworks"; - sourceTree = ""; - }; - 13F8B70407B43425008AE28D /* Other Frameworks */ = { - isa = PBXGroup; - children = ( - 13F8B88807B434F6008AE28D /* AppKit.framework */, - 13F8B88A07B434F6008AE28D /* Foundation.framework */, - ); - name = "Other Frameworks"; - sourceTree = ""; - }; - 1ED78706FE9D4A0611CA0C5A /* Products */ = { - isa = PBXGroup; - children = ( - 53DF68FD067E5B5A0090B5B0 /* PSMTabBarControl.framework */, - ); - name = Products; - sourceTree = ""; - }; - 2E58F364FFB232C311CA0CBA /* Frameworks */ = { - isa = PBXGroup; - children = ( - 13F8B6FD07B43410008AE28D /* Linked Frameworks */, - 13F8B70407B43425008AE28D /* Other Frameworks */, - ); - name = Frameworks; - sourceTree = ""; - }; - 32DBCF9E0370C38000C91783 /* Palette */ = { - isa = PBXGroup; - children = ( - 54D33B2406778DD400C9C163 /* Undo Support */, - 54D33B2506778DF000C9C163 /* Classes */, - 32DBCF9F0370C38200C91783 /* Other Sources */, - 131E8FE8067F80F40006E0CE /* Resources */, - 0259C583FE90428111CA0C5A /* palette.table */, - ); - name = Palette; - sourceTree = ""; - }; - 32DBCF9F0370C38200C91783 /* Other Sources */ = { - isa = PBXGroup; - children = ( - 32DBCF980370C29C00C91783 /* PSMTabBarControl_Prefix.pch */, - ); - name = "Other Sources"; - sourceTree = ""; - }; - 54D33B2406778DD400C9C163 /* Undo Support */ = { - isa = PBXGroup; - children = ( - 54D33B2806778E3300C9C163 /* PSMTabBarControl.ibclassdescription */, - ); - name = "Undo Support"; - sourceTree = ""; - }; - 54D33B2506778DF000C9C163 /* Classes */ = { - isa = PBXGroup; - children = ( - 0259C57BFE90428111CA0C5A /* PSMTabBarControlInspector.h */, - 0259C577FE90428111CA0C5A /* PSMTabBarControlInspector.m */, - 0259C57CFE90428111CA0C5A /* PSMTabBarControlPalette.h */, - 0259C578FE90428111CA0C5A /* PSMTabBarControlPalette.m */, - ); - name = Classes; - sourceTree = ""; - }; - 54D33B2C06778E4400C9C163 /* Framework */ = { - isa = PBXGroup; - children = ( - 90AD234D21A969C100CEF036 /* PSMMojaveTabStyle.h */, - 90AD234E21A969C100CEF036 /* PSMMojaveTabStyle.m */, - 0259C57AFE90428111CA0C5A /* PSMTabBarControl.h */, - 0259C576FE90428111CA0C5A /* PSMTabBarControl.m */, - A251BE830959A1B90058BC7F /* PSMTabBarCell.h */, - A251BE840959A1B90058BC7F /* PSMTabBarCell.m */, - A2D32EDA09A634C900EC8662 /* PSMTabStyle.h */, - A2D32EFE09A63D7A00EC8662 /* PSMMetalTabStyle.h */, - A2D32EFF09A63D7A00EC8662 /* PSMMetalTabStyle.m */, - A2D98B070A2B432C0064C6F8 /* PSMUnifiedTabStyle.h */, - A2D98B080A2B432C0064C6F8 /* PSMUnifiedTabStyle.m */, - 52FAFCD11C30F4DF00C6E613 /* PSMYosemiteTabStyle.h */, - 52FAFCD21C30F4DF00C6E613 /* PSMYosemiteTabStyle.m */, - A268EA5F09A9831800E082AA /* PSMRolloverButton.h */, - A268EA6009A9831800E082AA /* PSMRolloverButton.m */, - A251BE810959A1B90058BC7F /* PSMOverflowPopUpButton.h */, - A251BE820959A1B90058BC7F /* PSMOverflowPopUpButton.m */, - A2129BAF09AEB58F00724E6C /* PSMProgressIndicator.h */, - A2129BB009AEB58F00724E6C /* PSMProgressIndicator.m */, - A2082A8D09EAEB33009AC8BE /* PSMTabDragAssistant.h */, - A2082A8E09EAEB33009AC8BE /* PSMTabDragAssistant.m */, - A2D98B0F0A2B43FA0064C6F8 /* NSBezierPath_AMShading.h */, - A2D98B100A2B43FA0064C6F8 /* NSBezierPath_AMShading.m */, - ); - name = Framework; - sourceTree = ""; - }; - A246FADE0A2BD446005BDF7B /* Documentation */ = { - isa = PBXGroup; - children = ( - A246FB040A2BD6F9005BDF7B /* PSMTabBarControlDoc.html */, - ); - name = Documentation; - sourceTree = ""; - }; - A251BE590959A0550058BC7F /* Demo App */ = { - isa = PBXGroup; - children = ( - A251BE890959A1EA0058BC7F /* AppController.h */, - A251BE8A0959A1EA0058BC7F /* AppController.m */, - A2A711BD09E5BF0500D0089B /* WindowController.h */, - A2A711BE09E5BF0500D0089B /* WindowController.m */, - A251BE8B0959A1EA0058BC7F /* FakeModel.h */, - A251BE8C0959A1EA0058BC7F /* FakeModel.m */, - A251BE8D0959A1EA0058BC7F /* main.m */, - ); - name = "Demo App"; - sourceTree = ""; - }; - A251BE8E0959A21A0058BC7F /* Images */ = { - isa = PBXGroup; - children = ( - A2C0D99309AF870000ED379C /* pi.png */, - A2072B5C09AC1FA500304BCB /* Warning.png */, - A2072A2409ABD88600304BCB /* Folder.tif */, - A2072A2509ABD88600304BCB /* Globe.tiff */, - A268E7F809A9822900E082AA /* AquaTabNew.png */, - A268E7F909A9822900E082AA /* AquaTabNewPressed.png */, - A268E7FA09A9822900E082AA /* AquaTabNewRollover.png */, - A268E7FB09A9822900E082AA /* TabNewMetal.png */, - 523897F115BDA9AC00498A53 /* TabNewMetal@2x.png */, - A268E7FC09A9822900E082AA /* TabNewMetalPressed.png */, - 523897F215BDA9AC00498A53 /* TabNewMetalPressed@2x.png */, - A268E7FD09A9822900E082AA /* TabNewMetalRollover.png */, - 523897F315BDA9AC00498A53 /* TabNewMetalRollover@2x.png */, - A269361009A778770006911E /* 32x32_log.tiff */, - A2D3317A09A68B7500EC8662 /* AquaTabsDownGraphite.png */, - A2D3317B09A68B7500EC8662 /* AquaTabsDownNonKey.png */, - A2D32EF009A63BF700EC8662 /* AquaTabClose_Front_Pressed.tif */, - A2D32EF109A63BF700EC8662 /* AquaTabClose_Front_Rollover.tif */, - A2D32EF209A63BF700EC8662 /* AquaTabClose_Front.tif */, - A2D32EF309A63BF700EC8662 /* AquaTabsBackground.png */, - A2D32EF409A63BF700EC8662 /* AquaTabsDown.png */, - A2D32EF509A63BF700EC8662 /* AquaTabsSeparator.png */, - A2D32EF609A63BF700EC8662 /* AquaTabsSeparatorDown.png */, - A251BE8F0959A23A0058BC7F /* 32x32cancel.png */, - 52C268CE15BDB72B0012FECA /* overflowImage.png */, - 52C0B9B215BDB7A9000C268F /* overflowImage@2x.png */, - 52C268CF15BDB72B0012FECA /* overflowImagePressed.png */, - 52C0B9B315BDB7A9000C268F /* overflowImagePressed@2x.png */, - 52A57C0C15BBA230003EC59C /* TabClose_Front.png */, - 523897F015BDA9AC00498A53 /* TabClose_Front@2x.png */, - 52A57C0D15BBA230003EC59C /* TabClose_Front_Pressed.png */, - 523897EE15BDA9AC00498A53 /* TabClose_Front_Pressed@2x.png */, - 52A57C0E15BBA230003EC59C /* TabClose_Front_Rollover.png */, - 523897EF15BDA9AC00498A53 /* TabClose_Front_Rollover@2x.png */, - 52FAFCCD1C30F4B500C6E613 /* TabNewYosemite.png */, - 52FAFCCE1C30F4B500C6E613 /* TabNewYosemite@2x.png */, - ); - name = Images; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 53DF68F8067E5B5A0090B5B0 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 546DEAF2067F630E0098DCC4 /* PSMTabBarControl.h in Headers */, - A251BE850959A1B90058BC7F /* PSMOverflowPopUpButton.h in Headers */, - A251BE870959A1B90058BC7F /* PSMTabBarCell.h in Headers */, - 52FAFCD31C30F4DF00C6E613 /* PSMYosemiteTabStyle.h in Headers */, - A2D32EDC09A634C900EC8662 /* PSMTabStyle.h in Headers */, - A2D32F0009A63D7A00EC8662 /* PSMMetalTabStyle.h in Headers */, - A268EA6209A9831800E082AA /* PSMRolloverButton.h in Headers */, - A2129BB209AEB58F00724E6C /* PSMProgressIndicator.h in Headers */, - A2082A9009EAEB34009AC8BE /* PSMTabDragAssistant.h in Headers */, - A2D98B0A0A2B432C0064C6F8 /* PSMUnifiedTabStyle.h in Headers */, - A2D98B120A2B43FA0064C6F8 /* NSBezierPath_AMShading.h in Headers */, - 90AD234F21A969C100CEF036 /* PSMMojaveTabStyle.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 53DF68FC067E5B5A0090B5B0 /* PSMTabBarControlFramework */ = { - isa = PBXNativeTarget; - buildConfigurationList = C056397F08A954F8003078D8 /* Build configuration list for PBXNativeTarget "PSMTabBarControlFramework" */; - buildPhases = ( - 53DF68F8067E5B5A0090B5B0 /* Headers */, - 53DF68F9067E5B5A0090B5B0 /* Resources */, - 53DF68FA067E5B5A0090B5B0 /* Sources */, - 53DF68FB067E5B5A0090B5B0 /* Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = PSMTabBarControlFramework; - productName = PSMTabBarControlFramework; - productReference = 53DF68FD067E5B5A0090B5B0 /* PSMTabBarControl.framework */; - productType = "com.apple.product-type.framework"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 0259C573FE90428111CA0C5A /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 0710; - }; - buildConfigurationList = C056398B08A954F8003078D8 /* Build configuration list for PBXProject "PSMTabBarControl" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; - hasScannedForEncodings = 1; - knownRegions = ( - en, - ); - mainGroup = 0259C574FE90428111CA0C5A /* PSMTabBarControl */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 53DF68FC067E5B5A0090B5B0 /* PSMTabBarControlFramework */, - 53DF6901067E5B8E0090B5B0 /* All */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 53DF68F9067E5B5A0090B5B0 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A2D32EF709A63BF700EC8662 /* AquaTabClose_Front_Pressed.tif in Resources */, - A2D32EF809A63BF700EC8662 /* AquaTabClose_Front_Rollover.tif in Resources */, - A2D32EF909A63BF700EC8662 /* AquaTabClose_Front.tif in Resources */, - A2D32EFA09A63BF700EC8662 /* AquaTabsBackground.png in Resources */, - A2D32EFB09A63BF700EC8662 /* AquaTabsDown.png in Resources */, - A2D32EFC09A63BF700EC8662 /* AquaTabsSeparator.png in Resources */, - A2D32EFD09A63BF700EC8662 /* AquaTabsSeparatorDown.png in Resources */, - A2D3317C09A68B7500EC8662 /* AquaTabsDownGraphite.png in Resources */, - A2D3317D09A68B7500EC8662 /* AquaTabsDownNonKey.png in Resources */, - A268E80409A9822A00E082AA /* AquaTabNew.png in Resources */, - A268E80509A9822A00E082AA /* AquaTabNewPressed.png in Resources */, - A268E80609A9822A00E082AA /* AquaTabNewRollover.png in Resources */, - A268E80709A9822A00E082AA /* TabNewMetal.png in Resources */, - A268E80809A9822A00E082AA /* TabNewMetalPressed.png in Resources */, - A268E80909A9822A00E082AA /* TabNewMetalRollover.png in Resources */, - A2C0D99509AF870000ED379C /* pi.png in Resources */, - A27E47850A28EE76007BA395 /* TabIcon.tif in Resources */, - A27E47880A28EE7C007BA395 /* TabControlRep.tif in Resources */, - 52A57C0F15BBA230003EC59C /* TabClose_Front.png in Resources */, - 52A57C1015BBA230003EC59C /* TabClose_Front_Pressed.png in Resources */, - 90DE16CC21A955EE004F0124 /* Media.xcassets in Resources */, - 52A57C1115BBA230003EC59C /* TabClose_Front_Rollover.png in Resources */, - 52FAFCCF1C30F4B500C6E613 /* TabNewYosemite.png in Resources */, - 523897F415BDA9AC00498A53 /* TabClose_Front_Pressed@2x.png in Resources */, - 523897F515BDA9AC00498A53 /* TabClose_Front_Rollover@2x.png in Resources */, - 52FAFCD01C30F4B500C6E613 /* TabNewYosemite@2x.png in Resources */, - 523897F615BDA9AC00498A53 /* TabClose_Front@2x.png in Resources */, - 523897F715BDA9AC00498A53 /* TabNewMetal@2x.png in Resources */, - 523897F815BDA9AC00498A53 /* TabNewMetalPressed@2x.png in Resources */, - 523897F915BDA9AC00498A53 /* TabNewMetalRollover@2x.png in Resources */, - 52C268D015BDB72B0012FECA /* overflowImage.png in Resources */, - 52C268D115BDB72B0012FECA /* overflowImagePressed.png in Resources */, - 52C0B9B415BDB7A9000C268F /* overflowImage@2x.png in Resources */, - 52C0B9B515BDB7A9000C268F /* overflowImagePressed@2x.png in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 53DF68FA067E5B5A0090B5B0 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 546DEAF1067F63070098DCC4 /* PSMTabBarControl.m in Sources */, - A251BE860959A1B90058BC7F /* PSMOverflowPopUpButton.m in Sources */, - A251BE880959A1B90058BC7F /* PSMTabBarCell.m in Sources */, - A2D32F0109A63D7A00EC8662 /* PSMMetalTabStyle.m in Sources */, - A268EA6309A9831800E082AA /* PSMRolloverButton.m in Sources */, - A2129BB309AEB58F00724E6C /* PSMProgressIndicator.m in Sources */, - 90AD235021A969C100CEF036 /* PSMMojaveTabStyle.m in Sources */, - A2082A9109EAEB34009AC8BE /* PSMTabDragAssistant.m in Sources */, - 52FAFCD41C30F4DF00C6E613 /* PSMYosemiteTabStyle.m in Sources */, - A2D98B0B0A2B432C0064C6F8 /* PSMUnifiedTabStyle.m in Sources */, - A2D98B130A2B43FA0064C6F8 /* NSBezierPath_AMShading.m in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 53DF6905067E5B930090B5B0 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 53DF68FC067E5B5A0090B5B0 /* PSMTabBarControlFramework */; - targetProxy = 53DF6904067E5B930090B5B0 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin PBXVariantGroup section */ - 0259C57EFE90428111CA0C5A /* PSMTabBarControlInspector.nib */ = { - isa = PBXVariantGroup; - children = ( - 0259C57FFE90428111CA0C5A /* English */, - ); - name = PSMTabBarControlInspector.nib; - sourceTree = ""; - }; - 0259C580FE90428111CA0C5A /* PSMTabBarControlPalette.nib */ = { - isa = PBXVariantGroup; - children = ( - 0259C581FE90428111CA0C5A /* English */, - ); - name = PSMTabBarControlPalette.nib; - sourceTree = ""; - }; - 8D1AC97F0486D23B00FE50C9 /* InfoPlist.strings */ = { - isa = PBXVariantGroup; - children = ( - 8D1AC97B0486D23100FE50C9 /* English */, - ); - name = InfoPlist.strings; - sourceTree = ""; - }; - A251BEC20959BC0E0058BC7F /* MainMenu.nib */ = { - isa = PBXVariantGroup; - children = ( - A251BEC30959BC0E0058BC7F /* English */, - ); - name = MainMenu.nib; - sourceTree = ""; - }; - A2A711B909E5AE1E00D0089B /* Window.nib */ = { - isa = PBXVariantGroup; - children = ( - A2A711BA09E5AE1E00D0089B /* English */, - ); - name = Window.nib; - sourceTree = ""; - }; -/* End PBXVariantGroup section */ - -/* Begin XCBuildConfiguration section */ - C056398008A954F8003078D8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - COPY_PHASE_STRIP = NO; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - GCC_VERSION = ""; - INFOPLIST_FILE = "PSMTabBarControlFramework-Info.plist"; - INSTALL_PATH = "@executable_path/../Frameworks"; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.positivespinmedia.PSMTabBarControlFramework; - PRODUCT_NAME = PSMTabBarControl; - SYMROOT = ../build; - ZERO_LINK = NO; - }; - name = Debug; - }; - C056398108A954F8003078D8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - GCC_PRECOMPILE_PREFIX_HEADER = YES; - GCC_PREFIX_HEADER = "$(SYSTEM_LIBRARY_DIR)/Frameworks/AppKit.framework/Headers/AppKit.h"; - GCC_VERSION = ""; - INFOPLIST_FILE = "PSMTabBarControlFramework-Info.plist"; - INSTALL_PATH = "@executable_path/../Frameworks"; - ONLY_ACTIVE_ARCH = YES; - OTHER_LDFLAGS = ""; - PRODUCT_BUNDLE_IDENTIFIER = com.positivespinmedia.PSMTabBarControlFramework; - PRODUCT_NAME = PSMTabBarControl; - SYMROOT = ../build; - }; - name = Release; - }; - C056398808A954F8003078D8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COPY_PHASE_STRIP = NO; - GCC_DYNAMIC_NO_PIC = NO; - GCC_ENABLE_FIX_AND_CONTINUE = YES; - GCC_MODEL_TUNING = G5; - GCC_OPTIMIZATION_LEVEL = 0; - PRODUCT_NAME = All; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - ZERO_LINK = YES; - }; - name = Debug; - }; - C056398908A954F8003078D8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_GENERATE_DEBUGGING_SYMBOLS = NO; - GCC_MODEL_TUNING = G5; - PRODUCT_NAME = All; - WARNING_CFLAGS = ( - "-Wmost", - "-Wno-four-char-constants", - "-Wno-unknown-pragmas", - ); - }; - name = Release; - }; - C056398C08A954F8003078D8 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ENABLE_TESTABILITY = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; - SYMROOT = ../build; - }; - name = Debug; - }; - C056398D08A954F8003078D8 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - ONLY_ACTIVE_ARCH = YES; - PREBINDING = NO; - SYMROOT = ../build; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - C056397F08A954F8003078D8 /* Build configuration list for PBXNativeTarget "PSMTabBarControlFramework" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C056398008A954F8003078D8 /* Debug */, - C056398108A954F8003078D8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C056398708A954F8003078D8 /* Build configuration list for PBXAggregateTarget "All" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C056398808A954F8003078D8 /* Debug */, - C056398908A954F8003078D8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - C056398B08A954F8003078D8 /* Build configuration list for PBXProject "PSMTabBarControl" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - C056398C08A954F8003078D8 /* Debug */, - C056398D08A954F8003078D8 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 0259C573FE90428111CA0C5A /* Project object */; -} diff --git a/src/MacVim/PSMTabBarControl/PSMTabBarControlFramework-Info.plist b/src/MacVim/PSMTabBarControl/PSMTabBarControlFramework-Info.plist deleted file mode 100644 index 3e49e9a9d0..0000000000 --- a/src/MacVim/PSMTabBarControl/PSMTabBarControlFramework-Info.plist +++ /dev/null @@ -1,22 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - PSMTabBarControl - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleSignature - PSM1 - CFBundleVersion - 1.1 - NSPrincipalClass - PSMTabBarControl - - diff --git a/src/MacVim/PSMTabBarControl/PSMTabBarControl_Prefix.pch b/src/MacVim/PSMTabBarControl/PSMTabBarControl_Prefix.pch deleted file mode 100644 index 65df9ffedb..0000000000 --- a/src/MacVim/PSMTabBarControl/PSMTabBarControl_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'PSMTabBarControl' target in the 'PSMTabBarControl' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/src/MacVim/PSMTabBarControl/ReadMe.rtfd/TXT.rtf b/src/MacVim/PSMTabBarControl/ReadMe.rtfd/TXT.rtf deleted file mode 100644 index acd9372a24..0000000000 --- a/src/MacVim/PSMTabBarControl/ReadMe.rtfd/TXT.rtf +++ /dev/null @@ -1,186 +0,0 @@ -{\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf380 -{\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fswiss\fcharset77 Helvetica-Oblique; -\f3\fnil\fcharset77 Monaco;} -{\colortbl;\red255\green255\blue255;\red118\green15\blue80;\red0\green0\blue255;\red35\green110\blue37; -} -{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc2\leveljcn2\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid0\'02\'05.;}{\levelnumbers\'01;}}{\listname ;}\listid1}} -{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}} -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc\pardirnatural - -\f0\b\fs24 \cf0 \ -PSMTabBarControl (and related classes)\ - -\f1\b0 developed by John Pannell, Positive Spin Media\ -\ -as seen in the super-cool app...\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc\pardirnatural -\cf0 {{\NeXTGraphic startpage.gif \width7200 \height2820 -}¬}\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\qc\pardirnatural -\cf0 \ -\ -\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural\pardirnatural -\cf0 This source code and all related materials are released under the BSD license, which is explained at the end of this document, along with some other legalese. I've made my best effort to make everything bug free, but please let me know of any bugs found or suggestions you have: johnp@positivespinmedia.com.\ -\ - -\f0\b Purpose -\f1\b0 \ -\ -PSMTabBarControl seeks to provide developers with a high-quality, easy to use GUI to manage an NSTabView (or subclasses) in a manner similar to Safari's tabbed browsing implementation. It attempts to add a few features as well. Here's what you get:\ -\ - -\f0\b The look: -\f1\b0 a control/cell architecture that draws the expected tab appearance below a toolbar or similar view. Included styles work consistently in Aqua, Metal, or customized metal variations by basing fills on the window's background color. Includes drawing of a close button, and rollover states for the close button and tab cell. Also provides pop-up button and menu when tabs overflow available space, and support for individual tab progress indicators, icons, and object counters. Tabs can be drawn sized to fit the string content of the label, or uniformly sized.\ -\ - -\f0\b The functionality: -\f1\b0 Close button removes tabs, click on a tab cell selects. Indicators start, stop, and hide if things are hooked up correctly.\ -\ - -\f0\b Extras: -\f1\b0 Supports multi-window drag-and-drop reordering of the tabs with aqua-licious animation.\ -\ - -\f0\b Files -\f1\b0 \ -\ -Your project will need the files in the "Framework" folder of the project. The actual framework packages these (and some images) up nicely for you, if desired. Please look over the "TabBarControlDemo" target of the source code project to see exactly what is needed to get everything to build. Building and playing with the demo is also a good way to get a feel for the features provided by these classes.\ -\ - -\f0\b Usage -\f1\b0 \ -\ -Simply drag a custom view object from the views palette in IB, read the PSMTabBarControl class into IB, and set the view's custom class to PSMTabBarControl. Then connect the control's tabview outlet to the tab view being controlled, and make the control the delegate of the tab view. You can also connect the control's "partner view" outlet to another view that will resize in response to the hide/show behavior of the control.\ -\ -Alternately, you can build the Palette subproject and add the built IB palette to Interface Builder. In this case, creating and configuring an instance is as easy and drag, drop, and a few clicks. A demo movie and the built palette are available in a separate download from my website: http://www.positivespinmedia.com/dev/PSMTabBarControl.html\ -\ - -\f2\i Please read the PSMTabBarControlDoc.html file in the documentation folder of this project. It provides an Apple-ish page describing the interface and usage of this object. -\f1\i0 \ -\ - -\f0\b Patterns of Use -\f1\b0 \ -\ -There are a few random notes I can think of for usage guidelines...\ -\ -- You may see a line between the toolbar and the control in your app; it is part of the toolbar. In Tiger, you can eliminate the appearance of this line:\ -\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f3\fs20 \cf0 \CocoaLigature0 SInt32 MacVersion;\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural -\cf2 if\cf0 (Gestalt(gestaltSystemVersion, &MacVersion) == noErr)\{\ - \cf2 if\cf0 (MacVersion >= \cf3 0x1040\cf0 )\{\ - \cf4 // this call is Tiger only\cf0 \ - [toolbar setShowsBaselineSeparator:\cf2 NO\cf0 ];\ - \}\ -\}\ -\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f1\fs24 \cf0 - In general, there is no reason for your app objects to communicate (outside of configuration) with the PSMTabBarControl at all. Changes made to the NSTabView instance programmatically should be directed at the NSTabView instance itself, and the control will update to reflect the changes made.\ -\ -- Your app might want to receive tab view delegate notifications in order to perform some actions. No problem, simply make the desired object the delegate of the PSMTabBarControl instance... it passes along all tab view notifications. Note that it uses these notifications to make changes itself - read the source code to make sure you aren't tripping over something.\ -\ -- The control creates bindings between each cell's progress indicator and the represented NSTabViewItem's identifier object, if it can. In my app design, I set an instance of NSObjectController as the NSTabViewItem's identifier, and then bind to the "isProcessing" key of the controller's content object. All of this can be seen in the source of the demo app...\ -\ -- The control can be set to hide itself when there is only a single tab, and can also be told to hide/show on demand. It can animate to appear and disappear, and will resize something to compensate for the missing window real estate. By default, it will resize the window, but you can also connect the "partnerView" outlet in IB to specify another view to resize to take up the missing space. Note that this takes some attention to sizing springs and wires to get right, and complex views may need a container view to achieve the desired effect.\ -\ -- The control can be configured to draw an attractive "Add Tab" button at the end of the tab cells. Unfortunately, the button is all looks and no brains - it has no idea what your app wants to do when adding a tab. If you configure your app to show the add tab button, you need to hook up the add tab button to the proper target with the proper selector. Something like this will do nicely in your app controller's awakeFromNib:\ -\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f3\fs20 \cf4 // hook up add tab button\cf0 \ -[[tabBar addTabButton] setTarget:\cf2 self\cf0 ];\ -[[tabBar addTabButton] setAction:\cf2 @selector\cf0 (addNewTab:)]; -\f1\fs24 \ -\ -- The tabs have some sizing options: You can specify the minimum width, maximum width, and optimum width, as well as spcifying if the tabs should size to fit their label or not. The sizing bahavior of the tabs is as follows: If "size to fit" is specified, then tabs will be generated to fit the label, but will never exceed the specified max or min widths. Once the end of the control is reached, the overflow menu will appear as tabs are added; the last tab will squeeze in if it can, or the remaining tabs will stretch to occupy the full control. If "size to fit" is not specified, then all successive tabs will appear at the optimum width. Once the end of the control is reached, adding new tabs will cause all tabs to shrink to accomodate, until the minumum width is reached, and then the overflow menu will be used; max width is ignored in this case. Hopefully that all makes sense :-)\ -\ -- PSMTabBarControl will load the existing tabs from the tabView outlet at startup. However, many of the advanced features (icon display, progress indicator, object count) rely on binding to a controller that is likely not set up in IB. Solution? Nuke the existing tabs in the NSTabView and add new ones, configured the way you like. The demo app does this in the awakeFromNib: method of the app controller.\ -\ -- As a design choice, I elected to keep a cell object around until its tab was closed, instead of "churning" cell objects in each update cycle. Each cell keeps its NSTabViewItem as its representedObject and maintains reference that way, rather than by any index. As a result of this, drag-and-drop reordering of tabs does not change the underlying NSTabView instance at all. All that to say: don't rely on numerical indices if communicating with both the control and the tab view - the indices may not correlate if the user moved some tabs around (and remember - you shouldn't need to communicate with the control anyway :-). The Shiira Project, from which I gained much insight and inspiration from for this UI element, elected to scrap and rebuild the array of cells each time through the update cycle, and rely on indices to correlate between cells and NSTabViewItems. I felt the representedObject route was cleaner, and preferred not to churn objects.\ -\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f0\b \cf0 Improvements? -\f1\b0 \ -\ -Pipe up if you think of something you'd like to see; here's my current list:\ -\ -- "Pop-up" tabs - like pop-up folders in the finder, in case you want to drag to a destination in another tab.\ -- Support for the -\f3\fs22 \CocoaLigature1 NSUnifiedTitleAndToolbarWindowMask -\f1\fs24 \CocoaLigature0 "unified" window appearance. (Help! I really searched around to try to make this work... the color pattern of the title and toolbar seem to be top secret! The new "unified" style is an excellent replication of a unified look, but isn't "built from" the unified appearance like the metal is.)\ -- During multi-window drag, having a "drag window/image" that shows the represented view getting moved to the other window.\ -- During multi-window drag, support for dragging out solo tabs to consolidate in another window, removing the source window in the process.\ -- Support vertical as well as horizontal alignment.\ -\ - -\f0\b Version History -\f1\b0 \ -\ -Version 1.3 (May 29, 2006)\ -- new feature: Unified tab style, compliments of Keith Blount\ -- new feature: allow multi-window drag config option (again from Keith).\ -- fixed bug: Palette installation/usage instructions were wrong.\ -- enhancement: exposed the -\f3\fs20 representedTabViewItems -\f1\fs24 method, which can be used to retrieve the order of the tabs as displayed in the control, since the underlying NSTabView does not get reordered during drag and drop rearrangement.\ -\ -Version 1.2 (April 20, 2006)\ -- new feature: multi-window drag and drop support.\ -- bug fixed: zombie issue with tabView:didCloseTabViewItem\ -- bugs fixed: some drawing issues around the progress indicators in tabs, and the add tab button.\ -- enhancement: the hide/show animation has been improved with less "flickering" of progress indicators during the hide and show.\ -\ -Version 1.1.2 (April 5, 2006)\ -- fixed bug: tabs of non-integer width resulted in occasional anti-aliased drawing issues of dividers between tabs in the Metal style (Thanks, Kent).\ -- added feature: delegate can now respond to -tabView:shouldCloseTabViewItem: and -tabView:willCloseTabViewItem:, and -tabView:didCloseTabViewItem: messages, so your app can take care of any needed setup/cleanup for these actions.\ -- fixed bug: tab close buttons now show down state when pressed down.\ -\ -Version 1.1.1 (March 16, 2006)\ -- fixed bug: Palette inspector would not reflect state of previously instantiated control. This has been fixed (Thanks, Guillaume).\ -- enhancement: Overflow button now highlights when mouse down (Thanks, Kent).\ -- fixed bug: when set to not close a solo tab, the close button would be hidden for the tab, but could still be closed if you clicked the tab in the right location. This has been fixed (Thanks, malcom).\ -\ -Version 1.1 (March 10, 2006)\ -- Bound the "title" of the cell to the "label" of the source tabview item. Just in case you wanted to change the label on the tab during the running of your application.\ -- PSMTabBarCell factored to support new tab "styles", or appearances in drawing. Now supported are the existing "Metal" style and a new "Aqua" style. Many thanks to David Smith, Seth Willits, and Chris Forsythe for their contributions!\ -- Control can be configured to "Hide for single tab", so it doesn't appear unless there are more than a single tab view present. Features animated show/hide behavior (that can be called anytime, and is called automatically in the case that a single tab exists). The show/hide behavior can also be set up to resize either the window (default) or a selected "partner view" to compensate for the lost height of the tab bar.\ -- Control can be configured for "Can close only tab" behavior. If set to NO, no close button will appear on a lone tab.\ -- Cells can be set to "size to fit", or given uniform min/max/optimum sizes.\ -- Added support for display of an icon and an object count, if the proper app design pattern is followed.\ -- Sweet animated drag-and-drop drawing!\ -- A few drawing bugs surrounding the progress indicators in cells were squished.\ -- New documentation, in case you found this read me a little pithy.\ -\ -Version 1.0 (December 2005)\ -Initial release of safari-like tab implementation.\ -\ - -\f0\b The standard disavowal of this beautiful mess -\f1\b0 \ -\ -I should note that portions of this source code were inspired by the Shiira project's implementation of Safari-style tabs. While I made some different design decisions, the drawing and some other aspects are only slight modifications of their excellent work. As such, I note their copyright under their BSD licence:\ -\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f3\fs20 \cf4 Portions of this software Copyright 2004 The Shiira Project. All rights reserved.\ -\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\tx10560\tx11520\tx12480\tx13440\tx14400\tx15360\tx16320\tx17280\tx18240\tx19200\tx20160\tx21120\tx22080\tx23040\tx24000\tx24960\tx25920\tx26880\tx27840\tx28800\tx29760\tx30720\tx31680\tx32640\tx33600\tx34560\tx35520\tx36480\tx37440\tx38400\tx39360\tx40320\tx41280\tx42240\tx43200\tx44160\tx45120\tx46080\tx47040\tx48000\tx48960\tx49920\tx50880\tx51840\tx52800\tx53760\tx54720\tx55680\tx56640\tx57600\tx58560\tx59520\tx60480\tx61440\tx62400\tx63360\tx64320\tx65280\tx66240\tx67200\tx68160\tx69120\tx70080\tx71040\tx72000\tx72960\tx73920\tx74880\tx75840\tx76800\tx77760\tx78720\tx79680\tx80640\tx81600\tx82560\tx83520\tx84480\tx85440\tx86400\tx87360\tx88320\tx89280\tx90240\tx91200\tx92160\tx93120\tx94080\tx95040\tx96000\ql\qnatural\pardirnatural - -\f1\fs24 \cf0 Check them out at: http://hmdt-web.net/shiira/\ -\ -This source code is provided under BSD license, the conditions of which are listed below. I hope you'll make note somewhere in your about window or ReadMe stating the sweet coding goodness of Positive Spin Media and link to the fascinating and informative website at www.positivespinmedia.com\ -\ -\pard\pardeftab720\sa320\ql\qnatural -\cf0 \CocoaLigature1 Copyright (c) 2005, Positive Spin Media\uc0\u8232 All rights reserved.\ -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\ -\pard\tx220\tx720\pardeftab720\li720\fi-720\ql\qnatural -\ls1\ilvl0\cf0 {\listtext \'a5 }Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\ -{\listtext \'a5 }Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\ -{\listtext \'a5 }Neither the name of Positive Spin Media nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\ - \ -\pard\pardeftab720\sa320\ql\qnatural -\cf0 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\CocoaLigature0 \ -} \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/ReadMe.rtfd/startpage.gif b/src/MacVim/PSMTabBarControl/ReadMe.rtfd/startpage.gif deleted file mode 100644 index 8707a77ab0..0000000000 Binary files a/src/MacVim/PSMTabBarControl/ReadMe.rtfd/startpage.gif and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/TabBarControlDemo-Info.plist b/src/MacVim/PSMTabBarControl/TabBarControlDemo-Info.plist deleted file mode 100644 index 673218b406..0000000000 --- a/src/MacVim/PSMTabBarControl/TabBarControlDemo-Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIdentifier - com.positivespinmedia.TabBarControlDemo - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - APPL - CFBundleSignature - ???? - CFBundleVersion - 1.1 - NSMainNibFile - MainMenu - NSPrincipalClass - NSApplication - - diff --git a/src/MacVim/PSMTabBarControl/documentation/PSMTabBarControlDoc.html b/src/MacVim/PSMTabBarControl/documentation/PSMTabBarControlDoc.html deleted file mode 100644 index fa8b99009a..0000000000 --- a/src/MacVim/PSMTabBarControl/documentation/PSMTabBarControlDoc.html +++ /dev/null @@ -1,301 +0,0 @@ - - - - - PSMTabBarControl - Safari-style Tabs (Objective-C) - - - - - - - - -

PSMTabBarControl

- - - -
Inherits from
Conforms to
Declared in
PSMTabBarControl.h
-

Class Description

- -

PSMTabBarControl provides a user interface for the management of tabbed views that has an appearance similar to Apple's Safari web browser.

-

Internally, PSMTabBarControl uses a custom cell class and supporting style objects to implement its user interface.

-

Currently, this object supports "Aqua" and "Metal" tab styles to present an appearance consistent with the rest of your application. Numerous configuration options exist to customize behavior, as outlined below. PSMTabBarControl instances require a few specific connections with other application objects to perform properly at runtime:

-
    -
  • The control's "tabView" outlet must be connected to the desired NSTabView instance in Interface Builder, or set programmatically with the setTabView: method.
  • -
  • The "delegate" outlet of the NSTabView being controlled must be connected to the instance of PSMTabBarControl, either programmatically or in IB.
  • -
  • Optionally, you may connect the control's "partnerView" outlet to a view that will be resized to compensate when PSMTabBarControl changes size due to hide/show behavior. If no connection is made, PSMTabBarControl will resize the window in response to hide/show messages.
  • -
-

A PSMTabBarControl instance should occupy the width of the window, and should be precisely 22 pixels in height. It should be resizable in width, but not height. It can be placed at the top or botton of the window (or anywhere in between, if desired).

-

Outside of configuring it, your application should have little interaction with this class. The presented tabs will change in conjunction with changes your application makes in the NSTabView being controlled.

- -

A Usage Pattern

- -

PSMTabBarControl becomes even more powerful if your application design matches an expected pattern: the control attempts to bind a number of tab attributes to the NSTabViewItem's identifier object if possible. These visible attributes include a progress indicator, an icon, and an object counter. Additionally, the control binds each tab's title to the label of the represented NSTabViewItem.

- -

Taking advantage of these features requires no glue code on your part, but it does require providing a particular object graph. Here's the basics...

- -
  • For each tab that is created, your application should have a model object that keeps the state of model attributes: isProcessing (a BOOL), objectCount (an int), and icon (an NSImage). You can pick and choose any number of these to support, or none, at your option. -
  • Your application should create an NSObjectController to control your model (the model object is the "content" of the NSObjectController instance). -
  • When you create new tabs (via the NSTabView interface), you should set the object controller instance to be the identifier object of the newly created NSTabViewItem object.
- -

The demo application included with this project illustrates a very quick way to accomplish these goals. If this pattern is followed, PSMTabBarControl will take care of the rest.

- - -

Methods by Task

-

Setting needed connections

-
– setTabView:

Specifies the instance of NSTabView to be controlled.

- -
– tabView

Returns the instance of NSTabView being controlled.

- -

Setting optional connections

-
– setPartnerView:

Specifies a view that will resize to compensate for control size changes in response to hide and show messages.

- -
– partnerView

Returns the instance of a view that will resize to compensate for control size changes in response to hide and show messages.

- -
– setDelegate:

Specifies an object that will receive delegate messages as passed through from the NSTabView instance.

- -
– delegate:

Returns the specified delegate object.

- -

Control configuration

-
– canCloseOnlyTab

Returns YES if the user is allowed to close a tab when it is the only tab left, NO otherwise.

- -
– setCanCloseOnlyTab:

Controls whether the receiver will present a close button for a single tab in a tab bar.

- -
– styleName

Returns the name of the current drawing style. "Aqua", "Metal", and "Unified" are the currently supported options.

- -
– setStyleNamed:

Specifies the style in which the tabs and control are drawn. "Aqua", "Metal", and "Unified" are the currently supported options.

- -
– hideForSingleTab

Returns YES if the control will hide if there is only one tab left, NO otherwise.

- -
– setHideForSingleTab:

Controls whether the receiver will hide when the user closes all but a single tab in a tab bar.

- -
– showAddTabButton

Returns YES if the control will display a small "add tab" button at the rightmost end of the tabs, NO otherwise.

- -
– setShowAddTabButton:

Controls whether the receiver will will display a small "add tab" button at the rightmost end of the tabs.

- -
– cellMinWidth

Returns the minimum width (in pixels) that a tab will be allowed to occupy.

- -
– setCellMinWidth:

Specifies the maximum width (in pixels) that a tab will be allowed to occupy.

- -
– cellMaxWidth

Returns the maximum width (in pixels) that a tab will be allowed to occupy.

- -
– setCellMaxWidth:

Specifies the maximum width (in pixels) that a tab will be allowed to occupy.

- -
– cellOptimumWidth

Returns the default width (in pixels) that a tab will be allowed to occupy when tabs are drawn with uniform size.

- -
– setCellMaxWidth:

Specifies the default width (in pixels) that a tab will be allowed to occupy when tabs are drawn with uniform size.

- -
– sizeCellsToFit

Returns YES if the control will make the tabs sized to fit the content of the tab, NO otherwise.

- -
– setSizeCellsToFit:

Controls whether the receiver will make the tabs sized to fit the content of the tab.

- -
– allowsDragBetweenWindows

Returns YES if the control allows a user to drag a tab to another instance of this control, NO otherwise.

- -
– setAllowsDragBetweenWindows:

Controls whether the receiver will allow a user to drag a tab to another instance of this control.

- -

Internal UI components

-
– addTabButton

Returns an instance of an NSButton subclass that is used to present the "add tab" button. If "showAddTabButton" is YES, developers must use this method to access the button and specify a target and action for the button.

- -
– overflowPopUpButton

Returns an instance of an NSPopUpButton subclass that is used to present the overflow menu (which shows when there are more tabs than can fit across the control).

- -
– representedTabViewItems

Returns an array of the NSTabViewItems represented by the tabs in the control. Useful if you want to archive the order of the tabs between runs of your program.

- -

Visibility

-
– hideTabBar:animate:

If desired, obejcts can tell the tab bar to hide (reduce in size to a single pixel line spanning the window) or show, and optionally whether to animate this effect or not.

- -

Instance Methods

- -

addTabButton

-

Returns an instance of an NSButton subclass that is used to present the "add tab" button. If "showAddTabButton" is YES, developers must use this method to access the button and specify a target and action for the button.

- (PSMRolloverButton *)addTabButton;

-
Discussion

If you have configured the control to show the add tab button, you must use this method to access the button and set the target and action for it. Example:

[[tabBar addTabButton] setTarget:self];
-[[tabBar addTabButton] setAction:@selector(addNewTab:)];

-
See Also
- -

allowsDragBetweenWindows

-

Returns YES if the control allows a user to drag a tab to another instance of this control, NO otherwise.

- (BOOL)allowsDragBetweenWindows

-
Discussion

The default is YES.

-
See Also
- -

canCloseOnlyTab

-

Returns YES if the receiver has been configured to allow users to close a single remaining tab.

- (BOOL)canCloseOnlyTab

-
Discussion

The default is NO.

-
See Also
- -

cellMaxWidth

-

Returns the maximum width (in pixels) that a tab will be allowed to occupy.

- (int)cellMaxWidth

-
Discussion

The cellMaxWidth value applies to both uniformly sized tabs, and tabs that are sized to fit. No tab will be drawn wider than the specified value.

-
See Also
- -

cellMinWidth

-

Returns the minimum width (in pixels) that a tab will be allowed to occupy.

- (int)cellMinWidth

-
Discussion

The cellMinWidth value applies only to uniformly sized tabs. No tab will be drawn smaller than the specified value. Size-to-fit tabs ignore this value, and are made just small enough to fit their content.

-
See Also
- -

cellOptimumWidth

-

Returns the width (in pixels) that a tab will be made to occupy if the tabs are uniformly sized.

- (int)cellOptimumWidth

-
Discussion

The cellOptimumWidth value applies only to uniformly sized tabs. All tabs will be drawn at the specified value. Size-to-fit tabs ignore this value, and are made just small enough to fit their content.

-
See Also
- -

delegate

-

Returns the object that will be sent passed-through NSTabView delegate messages.

- (id)delegate

-
See Also
- -

hideForSingleTab

-

Returns YES if the receiver has been configured to hide if there is a single remaining tab.

- (BOOL)hideForSingleTab

-
Discussion

The default is NO.

-
See Also
- -

hideTabBar:animate:

-

If desired, obejcts can tell the tab bar to hide (reduce in size to a single pixel line spanning the window) or show, and optionally whether to animate this effect or not.

- (void)hideTabBar:(BOOL)hide animate:(BOOL)animate

-
Discussion

If hide is YES the control will shrink to a single pixel line spanning the window; otherwise the control will expand to its normal appearance. If animate is YES, the shrinking and expanding will happen in a visible animation; otherwise the transition will be instant. There is no effect if the control is already in the specified state.

- -

overflowPopUpButton

-

Returns an instance of an NSPopUpButton subclass that is used to present the overflow menu.

- (PSMOverflowPopUpButton *)overflowPopUpButton;

-
Discussion

This method could be used to modify the button or menu if desired.

- -

partnerView

-

Returns the object that will be resized to compensate for the changing size of the control during hide/show behavior.

- (id)partnerView

-
Discussion

If a partnerView has not been specified, the window will be resized during hide/show.

-
See Also
- -

representedTabViewItems

-

Returns an array of NSTabViewItems, ordered according to the display order of the tabs in the control.

- (NSMutableArray *)representedTabViewItems;

-
Discussion

This method could be used archive the order of the tabs between application runs. When the user reorders tabs via drag and drop, the represented NSTabView does not change order.

- -

setAllowsDragBetweenWindows

-

If set to YES, the receiver is configured to allow users to drag a tab to an instance of PSMTabBarControl in another window.

- (void)setAllowsDragBetweenWindows:(BOOL)value

-
Discussion

The default is YES.

-
See Also
- -

setCanCloseOnlyTab:

-

If set to YES, the receiver is configured to allow users to close a single remaining tab.

- (void)setCanCloseOnlyTab:(BOOL)value

-
Discussion

The default is NO.

-
See Also
- -

setCellMaxWidth:

-

Specifies the maximum width (in pixels) that a tab will be allowed to occupy.

- (void)setCellMaxWidth:(int)value

-
Discussion

No tab will be drawn any wider than the specified value.

-
See Also
- -

setCellMinWidth:

-

Specifies the minimum width (in pixels) that a tab will be allowed to occupy.

- (void)setCellMinWidth:(int)value

-
Discussion

No tab will be drawn any smaller than the specified value. This value is ignored when drawing in size-to-fit; tabs are made just small enough to fit their content.

-
See Also
- -

setCellOptimumWidth:

-

Specifies the width (in pixels) that a tab will occupy when tabs are uniformly sized.

- (void)setCellOptimumWidth:(int)value

-
Discussion

This value is ignored when drawing in size-to-fit; tabs are made just small enough to fit their content.

-
See Also
- -

setDelegate:

-

Specifies an object that will receive delegate messages as passed through from the NSTabView instance.

- (void)setDelegate:(id)object

-
See Also
- -

setHideForSingleTab:

-

If set to YES, the receiver is configured to hide when there is a single remaining tab.

- (void)setHideForSingleTab:(BOOL)value

-
Discussion

The default is NO.

-
See Also
- -

setPartnerView:

-

Specifies a view that will resize to compensate for control size changes in response to hide and show messages.

- (void)setPartnerView:(id)view

-
Discussion

if nil, the control will resize the window in response to hide/show messages.

-
See Also
- -

setStyleNamed:

-

Specifies the style in which the tabs and control are drawn.

- (void)setStyleNamed:(NSString *)name

-
Discussion

"Aqua" and "Metal" are the currently supported options.

-
See Also
- -

setShowAddTabButton:

-

Controls whether the receiver will will display a small "add tab" button at the rightmost end of the tabs.

- (void)setShowAddTabButton:(BOOL)value

-
Discussion

Default is NO.

-
See Also
- -

setSizeCellsToFit:

-

Controls whether the receiver will make the tabs sized to fit the content of the tab.

- (void)setSizeCellsToFit:(BOOL)value

-
Discussion

Default is NO.

-
See Also
- -

setTabView:

-

Specifies the instance of NSTabView to be controlled.

- (void)setTabView:(NSTabView *)view

-
Discussion

This class will not function properly without this outlet being set.

-
See Also
- -

sizeCellsToFit

-

Returns YES if the control will make the tabs sized to fit the content of the tab, NO otherwise.

-

Discussion

The default is NO.

-
See Also
- -

styleName:

-

Returns the name of the current drawing style.

- (NSString *)styleName

-
Discussion

"Aqua" and "Metal" are the currently supported options.

-
See Also
- -

tabView:

-

Returns the instance of NSTabView being controlled.

- (NSTabView *)tabView

-
Discussion

This class will not function properly if this object is nil.

-
See Also
- -

Delegate Methods

- -

You application controller can keep track of activity from the tab view and the user via the following delegate methods.

- -

tabView:shouldCloseTabViewItem:

-

Sent when a user clicks the close button on a tab.

- (BOOL)tabView:(NSTabView *)tabView shouldCloseTabViewItem:(NSTabViewItem *)tabViewItem

-
Discussion

If you return NO, the tab will not be closed. Please make sure to alert the user as to why with a sheet or dialog.

- -

tabView:willCloseTabViewItem:

-

Sent when tab is about to be closed.

- (void)tabView:(NSTabView *)tabView willCloseTabViewItem:(NSTabViewItem *)tabViewItem

-
Discussion

This presents you with an opportunity to clean up the application objects/events/sessions represented by the tab.

- -

tabView:didCloseTabViewItem:

-

Sent after a tab has been closed.

- (void)tabView:(NSTabView *)tabView didCloseTabViewItem:(NSTabViewItem *)tabViewItem

-
Discussion

This presents you with an opportunity to clean up the application objects/events/sessions represented by the tab. Don't go trying to modify the tabViewItem - it is about to be released, and has already been removed from the tabView!

- -

tabView:didSelectTabViewItem:

-

Informs the delegate that tabView has selected tabViewItem.

- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem

- -

tabView:shouldSelectTabViewItem:

-

Invoked just before tabViewItem in tabView is selected.

- (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem

-
Discussion

The delegate can return NO to prevent selection of specific tabs.

- -

tabView:willSelectTabViewItem:

-

Informs the delegate that tabView is about to select tabViewItem.

- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem

- -

tabViewDidChangeNumberOfTabViewItems:

-

Informs the delegate that the number of tab view items in tabView has changed.

- (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)tabView

- - - - - - \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/documentation/frameset_styles.css b/src/MacVim/PSMTabBarControl/documentation/frameset_styles.css deleted file mode 100644 index 298e192a89..0000000000 --- a/src/MacVim/PSMTabBarControl/documentation/frameset_styles.css +++ /dev/null @@ -1,943 +0,0 @@ -/* link classes */ -A:link { COLOR: #0000FF; TEXT-DECORATION: none; } -A:link:hover { COLOR: #FF6600; TEXT-DECORATION: underline; } -A:active { COLOR: #FF6600; TEXT-DECORATION: underline; } - -/* apple.com site does not explicitly define visited link properties, but we do here */ -A:visited { COLOR: #0000AA; TEXT-DECORATION: none; } -A:visited:hover { COLOR: #FF6600; TEXT-DECORATION: underline; } - -/* used to convert otherCodeCharacters to code, thus saving character space in HTML for smaller file sizes */ -tt { - FONT-SIZE: 11px; FONT-FAMILY: monaco, courier, monospace; } - -/* redefine preformated text and code blocks */ -PRE { - FONT-SIZE: 11px; FONT-FAMILY: monaco, courier, monospace; margin-top: 5px; margin-bottom: 10px;} -CODE { - FONT-SIZE: 11px; FONT-FAMILY: monaco, courier, monospace; } - - -/* JavaScript toc frame */ -.jtoc_closed { background-color: #e9e9e9; } -.jtoc_open { background-color: #FFFFFF; padding-bottom: 10px; } -.jtoc_open_top_line {border-top: 1px solid #CCC; background-color: #fff; padding-bottom: 10px;} -.jtoc_open_bottom_line {border-bottom: 1px solid #CCC; background-color: #fff; padding-bottom: 10px;} -.jtoc_open_both_lines {border-bottom: 1px solid #CCC; border-top: 1px solid #CCC; background-color: #fff; padding-bottom: 10px;} - -/* frameset: toc frame */ -.toc_contents_text { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-weight: bold; padding-top: 4px 0; - color: #0000FF; -} -.toc_contents_text_open { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; - background: #FFFFFF; color: #0000FF; -} -.low_level_text { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 11px; padding: 4px 5px 4px 5px - color: #0000FF; -} - -#toc_contents_title { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 16px; color: #FFFFFF; font-weight: bold; -} -.toc_contents_heading { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-weight: bold; -} - -/* Special TOC heading for Help books only */ -.toc_contents_help_heading { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 14px; color: #330099; font-weight: bold; -} - -/* frameset: toc frame styles WEB AS. used for any document that uses the disclosure model for TOC like conceptural and procedural C documents*/ -#toc { - padding: 0 0 0 0; -} - -#toc p.download { - padding: 5px 10px; - margin: 0; - font-weight: normal; font-size: 11px; -} - -#toc_PDFbottomborder { - padding-top: 5px; - border-bottom: 1px solid #CCC; -} - - -#toc h2 { - margin: 0; - padding: 10px; - font-size: 15px; font-weight: bold; - border-bottom: 0px solid; -} - -#toc h3 { - margin: 6px 5px 0 10px; - font-size: 13px; font-weight: bold; color: black; -} - -#toc h4 { - font-size: 11px; font-weight: bold; color: black; - margin: -5px 0px 0 14px; -} - -#toc_staticbox { - padding: 0 0 0 0; - border: 1px solid #919699; - background: #e9e9e9; -} - -#toc ul { - list-style: none outside; - margin-left: 20px; margin-bottom: -2px; - padding: 0px; -} - -#toc ul ul{ - list-style: none outside; - margin-left: 10px; margin-bottom: -2px; - padding: 0px; -} - -#toc li a { - margin-left: 5px; - display: block; - padding: 0px 5px 0px 5px; -} - -#toc li a.location { - font-weight: bold; color: #000; - text-decoration: none; -} - -#toc li{ - font-weight: normal; font-size: 11px; - padding: 0px 5px 0px 0px; - list-style-type: none; background: url(../Images/bullet.gif) no-repeat 0px .5em; - } - -#toc li li a { - margin-left: 0px; -} - - -#toc ul ul li { - background: url(../Images/dash.gif) no-repeat 0px .6em; -} - -#toc ul ul ul li { - background: url(../Images/sm_bullet.gif) no-repeat 0px .5em; -} - -#toc li.open { - border-top: 1px solid #CCC; border-bottom: 1px solid #CCC; background-color: #fff; -} - -#toc .open ul { - background-color: #fff; -} - -li img { - margin-left: 0px; -} -/*#toc li.open { background: #FFF;}*/ - - -/* frameset: toc frame styles WEB AS. used for any document that uses the static model for TOC topics documents*/ - -#topicstoc { - padding: 0px 0px 0px; -} - - -#topicstoc p.download { - border-bottom: 1px solid #CCC; - padding: 5px 10px; - margin: 0px; - font-weight: normal; font-size: 11px; -} - -#topicstoc h2 { - margin: 0; - padding: 10px; - font-size: 15px; font-weight: bold; - border-bottom: 0px solid; -} - -#topicstoc h3 { - margin: 6px 5px 0 10px; - font-size: 13px; font-weight: bold; color: black; -} - -#topicstoc h4 { - font-size: 11px; font-weight: bold; color: black; - margin: 2px 0px 0px 14px; -} - -#topicstoc ul { - list-style: none outside; - margin-left: 13px; margin-bottom: -2px; - padding: 0px; -} - - -#topicstoc ul ul{ - list-style: none outside; - margin-left: 10px; margin-bottom: -2px; - padding: 0px; -} - -#topicstoc li{ - font-weight: normal; font-size: 12px; - padding: 0px 5px 2px 10px; - list-style-type: none; background: url(../Images/bullet.gif) no-repeat 0px .5em; -} - -#topicstoc li.intro { - font-weight: normal; - padding: 0px 0px; - list-style-type: none; background: none; -} - -#topicstoc li a { - display: block; - padding: 0px 5px 0px 0px; -} - -#topicstoc li a.location { - font-weight: bold; color: #000; - text-decoration: none; -} - -#topicstoc li.intro a { - margin-left: -5px; - display: block; -} - - -img.toplevel { float: left; } - - - -/* frameset: content frame */ -BODY { - margin-top: 0; - color: #000; - font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } - -/* frameset: H1,H2,H3,H4,H5,Head for code voice */ - -h1 { - margin-top: 1em; - margin-bottom: 25px; - font: bold 30px lucida grande, geneva, helvetica, arial, sans-serif; - color: #000; - } -h2 { - margin-top: 2.5em; - font-size: 24px; - color: #000; - padding-bottom: 2px; border-bottom: 1px solid black; - } -h3 { - margin-top: 2em; - margin-bottom: .5em; - font-size: 19px; - color: #000; - } -h3.tight { - margin-top: 3em; - margin-bottom: -.25em; - font-size: 19px; - color: #000; - } -h4 { - margin-top: 2em; - margin-bottom: .5em; - font-size: 15px; - color: #000; - } -h5 { - margin: 20 0 0 0; - padding: 0; - font-size: 13px; - color: #000; - } -.mach4{ - margin-top: 40; - margin-bottom: 0; - padding-top: 0; - font: bold 16px lucida grande, geneva, helvetica, arial, sans-serif; - color: #000; - } -.mach5{ - margin: 30 0 -9 0; - font: bold 13px lucida grande, geneva, helvetica, arial, sans-serif; - color: #000; - } -h5.tight{ - margin: 1.5em 0 2px 0; - font: bold 13px lucida grande, geneva, helvetica, arial, sans-serif; - color: #000; - } - - -.code_head{ - FONT-SIZE: 18px; FONT-FAMILY: monaco, courier, monospace; font-weight: bold; -} -p { - margin-top: 0px; margin-bottom: 10px; font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } -p.spaceabove { - margin-top: 13px; margin-bottom: 10px; font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } -p.spaceabovemethod { - font: 11px monaco, courier, monospace; margin-top: 13px; margin-bottom: 10px; -} -h3.tight + p { - margin-top: 13px; margin-bottom: 10px; font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } -h3.tight + p.spaceabovemethod { - font: 11px monaco, courier, monospace; margin-top: 13px; margin-bottom: 10px; -} -.content_text{ - margin-top: 0px; margin-bottom: 10px; font: 12px lucida grande, geneva, helvetica, arial, sans-serif; -} -p.blockquote{ - padding-left: 50pt; - padding-right: 50pt; - } -ul.availability { - list-style-type: none; - margin: 0 0 -10px 0; - } -.availability li { - margin: 2px 0 0 -6px; - } - -/* frameset: content frame bold style for text*/ -b{ - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-weight: bold; -} - -/* Used for text that is sligtly larger than bold text like lables and captions*/ -.content_text_label{ - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; -} - -/* frameset: content frame italic style for text*/ -i{ - font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 12px; font-style: italic; -} - -/* Used for reference heads in ProcedualC and AppleScript Language*/ -.content_ref_head{ - font-family: lucida grande, geneva, helvetica, arial, sans-serif; - font-size: 16px; font-weight: bold; margin-top: 50px; padding-bottom: 4px; border-bottom: 1px solid black - } - -.content_ref_head_code{ - font-family: monaco, courier, monospace; - font-size: 16px; font-weight: bold; margin-top: 50px; padding-bottom: 4px; border-bottom: 1px solid black - } - -/* frameset: page title */ -.page_title{ - font-family: lucida grande, geneva, helvetica, arial, sans-serif; - font-size: 34px; - font-weight: bold; - color: #000000; - padding-top: 10px; - } - -/* frameset: Unordered List */ - -ul.spaceabove { - list-style: square outside; - margin: 0 0 0 30px; - padding: 7 0 12px 6px; - } - -ul { - list-style: square outside; - margin: 0 0 0 30px; - padding: 0 0 12px 6px; - } - -li { - margin-top: 7px; - } - - -li p { - margin-top: 8px; - } - -ul ul { - list-style: circle outside; - margin: 6 0 0 30px; - padding: 0 0 12px 6px; - } -ul.3head { - list-style: square outside; - margin: 0 0 0 20px; - padding: 0 0 0px 0px; - } - - -/* alternate mappings for 2nd level bulleted list that are still in testing phase*/ -.nested li { - list-style-image: url(../Images/openbullet.gif); - list-style-position: outside; - } - -ul.nested { - list-style: none; - margin: 6 0 0 30px; - } - -ol { - list-style-type: decimal; - list-style-position: outside; - margin: 0 0 0 30px; - padding: 0 0 12px 6px; - } - -ol ol { - list-style-type: lower-alpha; - list-style-position: outside; - margin: 7 0 0 30px; - padding: 0 0 12px 10px; - } - -ul.simple-spaceabove { - list-style-type: none; - margin: 5 0 0 20px; - } -.simple-spaceabove li { - margin-top: 1px; - } - -ul.simple { - list-style-type: none; - margin: 0 0 0 30px; - } -.simple li { - margin-top: -1px; - } - -dl.table-display { - clear: both; - width: auto; - margin: 0; - padding: 0px; - } - -.table-display dt { - width: 8em; - float: left; - margin: 0 0 0 0; - padding: .1em; - } - -/* commented backslash hack for mac-ie5 \*/ -dt { clear: both; } - - -.table-display dd { - float: left; - width: 80%; - margin: 0 0 0 0; - padding: .1em; - display: block; - } - -.clear { - clear: both; - } -dl.termdef { - margin-top: 0px; - margin-bottom: 10px; } -.termdef dt { - margin-top: 0px; } -.termdef dd { - margin-left: 15px; - margin-top: 1px; - margin-bottom: 6px; } -.termdef p{ - margin-left: 15px; - margin-top: -1px; - margin-bottom: 6px; } -h3.tight + dl.termdef { - margin-top: 13px; - margin-bottom: 10px; } - -/* frameset: list items */ -/* Everything in a list item is wrapped in an element now. */ -/* First para in a list item should be inline, others should be block. */ -li>p { display: inline } -li>p+p { display: block } - - -/* frameset: Index styles for docs */ -/* frameset: Index styles for alpah listing */ -.index_alpa{ - font-size: 18px; padding-bottom: 5px; margin: 25px 0 15px; border-bottom: 1px solid #91969C; } - -/* frameset: Index styles for singal and page range entries */ -.libindex{ -font-size: 12px; padding: 0 3px; background-color: #FFFFFF; margin: 0 3px; } - - - -/* frameset: mini navigation style (Hide/Show TOC & next/prev) */ -.mini_nav_text { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; - font-size: 9px; - font-weight: normal; -} - -.breadcrumb { - font-family: lucida grande, geneva, helvetica, arial, sans-serif; - font-size: 10px; - font-weight: normal; - margin-left: 10px; - margin-top: 8px; -} - -/* ADC header/footer mappings for Getting Started */ -/* header */ -#adcnavheader td { - font: 10px lucida grande, geneva, helvetica, arial, sans-serif; - } - -#adcnavheader input { - margin: 0 3px 0 0; - padding: 0; - } - -#adcnavheader .textpadding { - padding-top: 2px; - vertical-align: middle; - } - -#adcnavheader .searchbutton { - border: 0; - } - -#adcnavheader h6 { - margin: 0; - padding: 0; - font: normal 12px lucida grande, geneva, helvetica, arial, sans-serif; - color: #000; -} - -#adcnavheader form { - margin: 0; -} - - -/* footer */ -#footer td, #footer p { - font-size: 10px; - } - - -/* Getting Started styles */ - -/* font definitions */ - -/* keep ".gettingstarted pre, code" above ".gettingstarted h1" below otherwise, -the main h1 tag above will be used instead of".gettingstarted h1" */ -.gettingstarted pre, code { - font: 11px Monaco, Courier, monospace; - } - -/* Added this style since the ADC template was trying to do this with a graphic (Note: their h2 -attached to the image tag is only used by search engines; their h2 does not function if the -graphic is missing).--DA */ -.gettingstarted h2 { - margin: 0; - margin-bottom: 15px; - padding: 0px; - font: bold 32px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - color: #000; - } - -.gettingstarted h3 { - margin: 0 0 5px 0; - padding: 0px; - font: bold 16px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - color: #000; - } - -.gettingstarted p + .gettingstarted h3 { - margin-top: 20px; - } - -.gettingstarted ol + .gettingstarted h3 { - margin-top: 20px; - } - -.gettingstarted ul + .gettingstarted h3 { - margin-top: 20px; - } - -.gettingstarted h4 { - margin: 0px; - padding: 0px; - font: bold 12px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - color: #000; - } - -.gettingstarted h4 + .gettingstarted table { - margin-top: 10px; - } - -.gettingstarted p { - margin-top: 0; - margin-bottom: 10px; - padding: 0; - font: 12px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - color: #000; - } - -.gettingstarted th { - font-weight: bold; - text-align: left; - } - - -/* list definitions */ -.gettingstarted ul { - font: 12px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - padding-left: 10px; - margin-top: 0; - margin-left: 10px; - margin-bottom: 10px; - list-style-type: none; - } - -.gettingstarted li { - margin-top: 3px; - } - - -.gettingstarted ul li { - list-style: square outside; - margin: 0 0 0 30px; - padding: 0 0 4px 0; - } - -.gettingstarted ul ul { - margin-left: 20px; - } - -.gettingstarted ol { - font: 12px 'Lucida Grande', Geneva, Verdana, Arial, Helvetica, sans-serif; - margin-top: 0; - margin-left: 1.5em; - margin-bottom: 10px; - padding-left: 1.5em; - } - -.gettingstarted ul.inline, .gettingstarted ol.inline, .gettingstarted p.inline { - margin-top: -7px; - } - -/* table styles */ -caption.tablecaption { - margin-bottom: 5px; - text-align: left; -} -.sourcecodebox { - border: 1px solid #c7cfd5; - background: #f1f5f9; - margin: 20px 0; - } - -div.tableholder { - margin-top: 20px; - margin-bottom: 20px; - } - -p.tableholder { - margin-bottom: 7px; - font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } - -.graybox { - border-top: 1px solid #919699; - border-left: 1px solid #919699; - } - -.graybox th { - padding: 4px 8px 4px 8px; - background: #E2E2E2; - font-size: 12px; - border-bottom: 1px solid #919699; - border-right: 1px solid #919699; - } -.graybox th p { - font-weight: bold; - margin-bottom: 0px; - } - -.graybox td { - padding: 8px; - font-size: 12px; - text-align: left; - vertical-align: top; - border-bottom: 1px solid #919699; - border-right: 1px solid #919699; - } -.graybox td p { - margin-bottom: 0px; - } -.graybox td p + p { - margin-top: 5px; - } -.graybox td p + p + p { - margin-top: 5px; - } - - -/* footnote definitions */ -.footnote h4, .footnote p { - color: #76797C; - font-size: 11px; - } - -.gettingstarted .footnote { - font-size: 11px; - color: #76797C; - } - - -.notebox { - border: 1px solid #a1a5a9; - background-color: #f7f7f7; - margin: 20px 0; - padding: 0px 8px 1px 9px; - text-align: left; - } -.notebox p { - font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - margin-top: 7px; - margin-bottom: 0px; - } -.importantbox { - border: 1px solid #111; - background-color: #e8e8e8; - margin: 20px 0; - padding: 0px 8px 1px 9px; - text-align: left; - } -.importantbox p { - font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - margin-top: 7px; - margin-bottom: 0px; - } -.warningbox { - border: 1px solid #000; - background-color: #fff; - margin: 20px 0; - padding: 8px; - text-align: left; - } -.warningicon { - background-color: transparent; - padding-right: 10px; - float: left; - } -.warningbox p { - border-style: none; - font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - margin: -8px 0 -8px 30px; - } -div.codesample { - margin: 20px 0; - } -.codesample pre { - font-size: 11px; - font-family: monaco, courier, monospace; - margin: -1px 4px -3px 6px; - white-space: pre; - } -.codesample span { - margin-right: 8px; - float: right; - } -p.codesample { - margin-top: 20px; margin-bottom: -15px; font: 12px lucida grande, geneva, helvetica, arial, sans-serif; - } - - -/* Controller Layer Bindings styles */ - -.class_binding_block { - } - -.binding_category_block { - margin-left: 1em - } - -.binding_category_name { - font-size: 24px; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-weight: bold; line-height: 35px; padding-bottom: 1px; border-top: 2px solid black - } - -.binding_block { - margin-left: 2em - } - -.binding_name { - font-size: 18px; font-family: monaco, courier, monospace; font-weight: 400; margin-top: 10px; margin-bottom: 12px; border-bottom: 1px solid #69f - } - -.bindings_tablehead { font-size: 14px; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-weight: bold; position: relative; top: -5px; margin-left: -20px - } - -.placeholder_options_block { - margin-left: 2em - } - -.availabilityList { - border: none; - margin-top: 5px; - margin-bottom: 0px; - font-size: 12px; - text-align: left; - } - -.availabilityItem { - margin-top: -15px; - margin-bottom: 15px; - padding-left: 78px; - } - - -.metadata_attributes_name { - font-size: 24px; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-weight: bold; padding-top: 5px; margin-bottom: -10px; border-top: 2px solid black - } - -.metadata_attribute_name { - font-size: 18px; font-family: monaco, courier, monospace; font-weight: 400; margin-top: 10px; padding-bottom: 2px; - } - - -/* Spec Sheet Info Box */ -/* Used in AppKit Obj-C, Appkit Java, Foundation Obj-C, and Foundation Java References */ - -.spec_sheet_info_box { margin-left: 1em } - -/* This builds a table */ -.specbox { - border-top: 1px solid #919699; - border-left: 1px solid #919699; - border-right: 1px solid #919699; - margin-bottom: 10px; - } - -.specbox td { - padding: 8px; - font-size: 12px; - text-align: left; - vertical-align: top; - border-bottom: 1px solid #919699; - } - -/* This alternates colors in up to six table rows (light blue for odd, white for even)*/ - -.specbox tr { - background: #F0F5F9; -} - -.specbox tr + tr { - background: #FFFFFF; -} - -.specbox tr + tr + tr { - background: #F0F5F9; -} - -.specbox tr + tr + tr + tr { - background: #FFFFFF; -} - -.specbox tr + tr + tr +tr + tr { - background: #F0F5F9; -} - -.specbox tr + tr + tr + tr + tr + tr { - background: #FFFFFF; -} - -/* informal protocol subtitling */ - -.protocol_subtitle { - margin-top: -25px; - margin-bottom: 25px; - font-size: 13px; -} - -/* HeaderDoc headings */ - -.hd_tocAccess { - margin-left: 16px; - margin-top: 3px; - display: block; - font-weight: bold; -} -.hd_tocAccessSpace { - display: block; - font-size: 8px; -} - -.hd_tocGroup { - margin-left: 8px; - margin-top: 5px; - display: block; - font-style: italic; -} -.hd_tocGroupSpace { - display: block; - font-size: 8px; -} - -/* "Collection page" mappings */ - -.forums { margin-bottom: 5px;} -.forums b, -.forums a:link, -.forums a:visited { color: #017; font-family: lucida grande, geneva, helvetica, arial, sans-serif; font-size: 11px; font-weight: bold; line-height: 13px;} -.forums a:hover { color: #00F; text-decoration: underline; font-weight: bold;} -.collection { margin-bottom: 5px;} -.collection h3, -.collection a:link, -.collection a:visited { font-size: 13px; color: #76797C; padding-bottom: 2px; border-bottom: 1px dotted #a1a5a9; margin-bottom: 0px; margin-right: 3px;} -.collection a:hover { color: #00F; text-decoration: underline; font-weight: bold;} - -.collection_title { width: 100%; - background-color: #7E91A4; - padding: 15px; - padding-right: 15px; - padding-bottom: 2px; - padding-left: 15px; - } - -.collection_title a:link, -.collection_title a:visited { color: #E8F3FD; } - -h1.collections { - margin-top: 0px; - margin-bottom: 25px; - font: bold 30px lucida grande, geneva, helvetica, arial, sans-serif; - color: #ffffff; - text-align: center; } - - \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/images/32x32_log.tiff b/src/MacVim/PSMTabBarControl/images/32x32_log.tiff deleted file mode 100644 index 86cdfb5111..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/32x32_log.tiff and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/32x32cancel.png b/src/MacVim/PSMTabBarControl/images/32x32cancel.png deleted file mode 100644 index 9646722bbf..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/32x32cancel.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabClose_Front.tif b/src/MacVim/PSMTabBarControl/images/AquaTabClose_Front.tif deleted file mode 100644 index a221ac7467..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabClose_Front.tif and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabClose_Front_Pressed.tif b/src/MacVim/PSMTabBarControl/images/AquaTabClose_Front_Pressed.tif deleted file mode 100644 index 104799dd60..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabClose_Front_Pressed.tif and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabClose_Front_Rollover.tif b/src/MacVim/PSMTabBarControl/images/AquaTabClose_Front_Rollover.tif deleted file mode 100644 index cd86fa5c21..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabClose_Front_Rollover.tif and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabNew.png b/src/MacVim/PSMTabBarControl/images/AquaTabNew.png deleted file mode 100644 index 843b3c386d..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabNew.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabNewPressed.png b/src/MacVim/PSMTabBarControl/images/AquaTabNewPressed.png deleted file mode 100644 index 469438d234..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabNewPressed.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabNewRollover.png b/src/MacVim/PSMTabBarControl/images/AquaTabNewRollover.png deleted file mode 100644 index f728511795..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabNewRollover.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabsBackground.png b/src/MacVim/PSMTabBarControl/images/AquaTabsBackground.png deleted file mode 100644 index 456ca6172d..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabsBackground.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabsDown.png b/src/MacVim/PSMTabBarControl/images/AquaTabsDown.png deleted file mode 100644 index 2db28ae1f4..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabsDown.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabsDownGraphite.png b/src/MacVim/PSMTabBarControl/images/AquaTabsDownGraphite.png deleted file mode 100644 index 787520e9fd..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabsDownGraphite.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabsDownNonKey.png b/src/MacVim/PSMTabBarControl/images/AquaTabsDownNonKey.png deleted file mode 100644 index 34a57ff639..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabsDownNonKey.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabsSeparator.png b/src/MacVim/PSMTabBarControl/images/AquaTabsSeparator.png deleted file mode 100644 index f7cc1d0f99..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabsSeparator.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/AquaTabsSeparatorDown.png b/src/MacVim/PSMTabBarControl/images/AquaTabsSeparatorDown.png deleted file mode 100644 index 79dbf2a199..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/AquaTabsSeparatorDown.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/Folder.tif b/src/MacVim/PSMTabBarControl/images/Folder.tif deleted file mode 100644 index 4d4cc0bbce..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/Folder.tif and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/Globe.tiff b/src/MacVim/PSMTabBarControl/images/Globe.tiff deleted file mode 100644 index 3c893505eb..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/Globe.tiff and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabClose_Front.png b/src/MacVim/PSMTabBarControl/images/TabClose_Front.png deleted file mode 100644 index 5277930420..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabClose_Front.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabClose_Front@2x.png b/src/MacVim/PSMTabBarControl/images/TabClose_Front@2x.png deleted file mode 100644 index 3dd8be0353..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabClose_Front@2x.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed.png b/src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed.png deleted file mode 100644 index 3c2328b9a1..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed@2x.png b/src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed@2x.png deleted file mode 100644 index e4d539f719..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabClose_Front_Pressed@2x.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabClose_Front_Rollover.png b/src/MacVim/PSMTabBarControl/images/TabClose_Front_Rollover.png deleted file mode 100644 index ca59735574..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabClose_Front_Rollover.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabClose_Front_Rollover@2x.png b/src/MacVim/PSMTabBarControl/images/TabClose_Front_Rollover@2x.png deleted file mode 100644 index 342855eaa6..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabClose_Front_Rollover@2x.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabControlRep.tif b/src/MacVim/PSMTabBarControl/images/TabControlRep.tif deleted file mode 100644 index 6ad0f4042a..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabControlRep.tif and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabIcon.tif b/src/MacVim/PSMTabBarControl/images/TabIcon.tif deleted file mode 100644 index 55e08f117e..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabIcon.tif and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabNewMetal.png b/src/MacVim/PSMTabBarControl/images/TabNewMetal.png deleted file mode 100644 index 5b8301845a..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabNewMetal.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabNewMetal@2x.png b/src/MacVim/PSMTabBarControl/images/TabNewMetal@2x.png deleted file mode 100644 index aab821b3cc..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabNewMetal@2x.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabNewMetalPressed.png b/src/MacVim/PSMTabBarControl/images/TabNewMetalPressed.png deleted file mode 100644 index b18f6d4cfe..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabNewMetalPressed.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabNewMetalPressed@2x.png b/src/MacVim/PSMTabBarControl/images/TabNewMetalPressed@2x.png deleted file mode 100644 index f652e91723..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabNewMetalPressed@2x.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabNewMetalRollover.png b/src/MacVim/PSMTabBarControl/images/TabNewMetalRollover.png deleted file mode 100644 index 083f00ae7d..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabNewMetalRollover.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabNewMetalRollover@2x.png b/src/MacVim/PSMTabBarControl/images/TabNewMetalRollover@2x.png deleted file mode 100644 index 1afa4ad7be..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabNewMetalRollover@2x.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabNewYosemite.png b/src/MacVim/PSMTabBarControl/images/TabNewYosemite.png deleted file mode 100644 index a85cf21369..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabNewYosemite.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/TabNewYosemite@2x.png b/src/MacVim/PSMTabBarControl/images/TabNewYosemite@2x.png deleted file mode 100644 index 9f2b024011..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/TabNewYosemite@2x.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/Warning.png b/src/MacVim/PSMTabBarControl/images/Warning.png deleted file mode 100644 index c847e492e0..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/Warning.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/overflowImage.png b/src/MacVim/PSMTabBarControl/images/overflowImage.png deleted file mode 100644 index 6078cca731..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/overflowImage.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/overflowImage@2x.png b/src/MacVim/PSMTabBarControl/images/overflowImage@2x.png deleted file mode 100644 index c92c1740c8..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/overflowImage@2x.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/overflowImagePressed.png b/src/MacVim/PSMTabBarControl/images/overflowImagePressed.png deleted file mode 100644 index 56bcd8b7e1..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/overflowImagePressed.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/overflowImagePressed@2x.png b/src/MacVim/PSMTabBarControl/images/overflowImagePressed@2x.png deleted file mode 100644 index 341b1d77cc..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/overflowImagePressed@2x.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/images/pi.png b/src/MacVim/PSMTabBarControl/images/pi.png deleted file mode 100644 index e3ff079452..0000000000 Binary files a/src/MacVim/PSMTabBarControl/images/pi.png and /dev/null differ diff --git a/src/MacVim/PSMTabBarControl/palette.table b/src/MacVim/PSMTabBarControl/palette.table deleted file mode 100644 index e3053e3d08..0000000000 --- a/src/MacVim/PSMTabBarControl/palette.table +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - Class PSMTabBarControlPalette - - - NibFile PSMTabBarControlPalette - - - Icon TabIcon.tif - - - ToolTips PSMTabBarControl - - - ExportClasses - - PSMTabBarControl - PSMTabBarCell - PSMAquaTabStyle - PSMMetalTabStyle - PSMRolloverButton - PSMProgressIndcator - PSMOverflowPopUpButton - - - - ExportImages - - TabControlRep.tif - TabIcon.tif - - - - ExportSounds - - - - - diff --git a/src/MacVim/PSMTabBarControl/source/AppController.h b/src/MacVim/PSMTabBarControl/source/AppController.h deleted file mode 100644 index 532e91da64..0000000000 --- a/src/MacVim/PSMTabBarControl/source/AppController.h +++ /dev/null @@ -1,17 +0,0 @@ -// -// AppController.h -// PSMTabBarControl -// -// Created by John Pannell on 12/19/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import - -@interface AppController : NSObject { - -} - -- (IBAction)newWindow:(id)sender; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/AppController.m b/src/MacVim/PSMTabBarControl/source/AppController.m deleted file mode 100644 index 16dfd30c44..0000000000 --- a/src/MacVim/PSMTabBarControl/source/AppController.m +++ /dev/null @@ -1,30 +0,0 @@ -// -// AppController.m -// TabBarControl -// -// Created by John Pannell on 12/19/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import "AppController.h" -#import "WindowController.h" - -@implementation AppController - -- (void)awakeFromNib -{ - [self newWindow:self]; - [self newWindow:self]; - NSRect frontFrame = [[NSApp keyWindow] frame]; - frontFrame.origin.x += 400; - [[NSApp keyWindow] setFrame:frontFrame display:YES]; -} - -- (IBAction)newWindow:(id)sender -{ - // put up a window - WindowController *newWindow = [[WindowController alloc] initWithWindowNibName:@"Window"]; - [newWindow showWindow:self]; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/FakeModel.h b/src/MacVim/PSMTabBarControl/source/FakeModel.h deleted file mode 100644 index aeece3f530..0000000000 --- a/src/MacVim/PSMTabBarControl/source/FakeModel.h +++ /dev/null @@ -1,34 +0,0 @@ -// -// FakeModel.h -// TabBarControl -// -// Created by John Pannell on 12/19/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import - - -@interface FakeModel : NSObject { - BOOL _isProcessing; - NSImage *_icon; - NSString *_iconName; - NSObjectController *controller; - int _objectCount; -} - -// creation/destruction -- (id)init; - -// accessors -- (BOOL)isProcessing; -- (void)setIsProcessing:(BOOL)value; -- (NSImage *)icon; -- (void)setIcon:(NSImage *)icon; -- (NSString *)iconName; -- (void)setIconName:(NSString *)iconName; -- (int)objectCount; -- (void)setObjectCount:(int)value; -- (NSObjectController *)controller; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/FakeModel.m b/src/MacVim/PSMTabBarControl/source/FakeModel.m deleted file mode 100644 index dee72ec085..0000000000 --- a/src/MacVim/PSMTabBarControl/source/FakeModel.m +++ /dev/null @@ -1,77 +0,0 @@ -// -// FakeModel.m -// TabBarControl -// -// Created by John Pannell on 12/19/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import "FakeModel.h" - - -@implementation FakeModel - -- (id)init -{ - if(self == [super init]){ - _isProcessing = YES; - _icon = nil; - _iconName = nil; - _objectCount = 2; - controller = [[NSObjectController alloc] initWithContent:self]; - } - return self; -} - - -// accessors -- (BOOL)isProcessing -{ - return _isProcessing; -} - -- (void)setIsProcessing:(BOOL)value -{ - _isProcessing = value; -} - -- (NSImage *)icon -{ - return _icon; -} - -- (void)setIcon:(NSImage *)icon -{ - [icon retain]; - [_icon release]; - _icon = icon; -} - -- (NSString *)iconName -{ - return _iconName; -} - -- (void)setIconName:(NSString *)iconName -{ - [iconName retain]; - [_iconName release]; - _iconName = iconName; -} - -- (int)objectCount -{ - return _objectCount; -} - -- (void)setObjectCount:(int)value -{ - _objectCount = value; -} - -- (NSObjectController *)controller -{ - return controller; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.h b/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.h deleted file mode 100644 index 9c6c335fbe..0000000000 --- a/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// NSBezierPath_AMShading.h -// ------------------------ -// -// Created by Andreas on 2005-06-01. -// Copyright 2005 Andreas Mayer. All rights reserved. -// -// based on http://www.cocoadev.com/index.pl?GradientFill - - -#import - - -@interface NSBezierPath (AMShading) - -- (void)customHorizontalFillWithCallbacks:(CGFunctionCallbacks)functionCallbacks firstColor:(NSColor *)firstColor secondColor:(NSColor *)secondColor; - -- (void)linearGradientFillWithStartColor:(NSColor *)startColor endColor:(NSColor *)endColor; - -- (void)bilinearGradientFillWithOuterColor:(NSColor *)outerColor innerColor:(NSColor *)innerColor; - - -@end diff --git a/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.m b/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.m deleted file mode 100644 index ed80e76beb..0000000000 --- a/src/MacVim/PSMTabBarControl/source/NSBezierPath_AMShading.m +++ /dev/null @@ -1,178 +0,0 @@ -// -// NSBezierPath_AMShading.m -// ------------------------ -// -// Created by Andreas on 2005-06-01. -// Copyright 2005 Andreas Mayer. All rights reserved. -// - -#import "NSBezierPath_AMShading.h" - -// CGFloat was introduced in OS X 10.5 -#ifndef CGFLOAT_DEFINED - typedef float CGFloat; -# define CGFLOAT_MIN FLT_MIN -# define CGFLOAT_MAX FLT_MAX -# define CGFLOAT_IS_DOUBLE 0 -# define CGFLOAT_DEFINED 1 -#endif - - -@implementation NSBezierPath (AMShading) - -static void linearShadedColor(void *info, const CGFloat *in, CGFloat *out) -{ - CGFloat *colors = info; - *out++ = colors[0] + *in * colors[8]; - *out++ = colors[1] + *in * colors[9]; - *out++ = colors[2] + *in * colors[10]; - *out++ = colors[3] + *in * colors[11]; -} - -static void bilinearShadedColor(void *info, const CGFloat *in, CGFloat *out) -{ - CGFloat *colors = info; - CGFloat factor = (*in)*2.0; - if (*in > 0.5) { - factor = 2-factor; - } - *out++ = colors[0] + factor * colors[8]; - *out++ = colors[1] + factor * colors[9]; - *out++ = colors[2] + factor * colors[10]; - *out++ = colors[3] + factor * colors[11]; -} - -- (void)linearGradientFillWithStartColor:(NSColor *)startColor endColor:(NSColor *)endColor -{ - /* - CGColorSpaceRef colorspace; - CGShadingRef shading; - CGPoint startPoint = {0, 0}; - CGPoint endPoint = {0, 0}; - CGFunctionRef function; - CGFloat colors[12]; // pointer to color values - - // get my context - CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; - - NSColor *deviceDependentStartColor = [startColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]; - NSColor *deviceDependentEndColor = [endColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]; - - // set up colors for gradient - colors[0] = [deviceDependentStartColor redComponent]; - colors[1] = [deviceDependentStartColor greenComponent]; - colors[2] = [deviceDependentStartColor blueComponent]; - colors[3] = [deviceDependentStartColor alphaComponent]; - - colors[4] = [deviceDependentEndColor redComponent]; - colors[5] = [deviceDependentEndColor greenComponent]; - colors[6] = [deviceDependentEndColor blueComponent]; - colors[7] = [deviceDependentEndColor alphaComponent]; - - // difference between start and end color for each color components - colors[8] = (colors[4]-colors[0]); - colors[9] = (colors[5]-colors[1]); - colors[10] = (colors[6]-colors[2]); - colors[11] = (colors[7]-colors[3]); - - // draw gradient - colorspace = CGColorSpaceCreateDeviceRGB(); - - size_t components = 1 + CGColorSpaceGetNumberOfComponents(colorspace); - static const CGFloat domain[2] = {0.0, 1.0}; - static const CGFloat range[10] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1}; - static const CGFunctionCallbacks callbacks = {0, &shadedColor, NULL}; - - // Create a CGFunctionRef that describes a function taking 1 input and kChannelsPerColor outputs. - function = CGFunctionCreate(colors, 1, domain, components, range, &callbacks); - - startPoint.x=0; - startPoint.y=[self bounds].origin.y; - endPoint.x=0; - endPoint.y=NSMaxY([self bounds]); - - shading = CGShadingCreateAxial(colorspace, startPoint, endPoint, function, NO, NO); - - CGContextSaveGState(currentContext); - [self addClip]; - CGContextDrawShading(currentContext, shading); - CGContextRestoreGState(currentContext); - - CGShadingRelease(shading); - CGFunctionRelease(function); - CGColorSpaceRelease(colorspace); - */ - - static const CGFunctionCallbacks callbacks = {0, &linearShadedColor, NULL}; - - [self customHorizontalFillWithCallbacks:callbacks firstColor:startColor secondColor:endColor]; -}; - -- (void)bilinearGradientFillWithOuterColor:(NSColor *)outerColor innerColor:(NSColor *)innerColor -{ - static const CGFunctionCallbacks callbacks = {0, &bilinearShadedColor, NULL}; - - [self customHorizontalFillWithCallbacks:callbacks firstColor:innerColor secondColor:outerColor]; -} - -- (void)customHorizontalFillWithCallbacks:(CGFunctionCallbacks)functionCallbacks firstColor:(NSColor *)firstColor secondColor:(NSColor *)secondColor -{ - CGColorSpaceRef colorspace; - CGShadingRef shading; - CGPoint startPoint = {0, 0}; - CGPoint endPoint = {0, 0}; - CGFunctionRef function; - CGFloat colors[12]; // pointer to color values - - // get my context - CGContextRef currentContext = (CGContextRef)[[NSGraphicsContext currentContext] graphicsPort]; - - NSColor *deviceDependentFirstColor = [firstColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]; - NSColor *deviceDependentSecondColor = [secondColor colorUsingColorSpaceName:NSDeviceRGBColorSpace]; - - // set up colors for gradient - colors[0] = [deviceDependentFirstColor redComponent]; - colors[1] = [deviceDependentFirstColor greenComponent]; - colors[2] = [deviceDependentFirstColor blueComponent]; - colors[3] = [deviceDependentFirstColor alphaComponent]; - - colors[4] = [deviceDependentSecondColor redComponent]; - colors[5] = [deviceDependentSecondColor greenComponent]; - colors[6] = [deviceDependentSecondColor blueComponent]; - colors[7] = [deviceDependentSecondColor alphaComponent]; - - // difference between start and end color for each color components - colors[8] = (colors[4]-colors[0]); - colors[9] = (colors[5]-colors[1]); - colors[10] = (colors[6]-colors[2]); - colors[11] = (colors[7]-colors[3]); - - // draw gradient - colorspace = CGColorSpaceCreateDeviceRGB(); - size_t components = 1 + CGColorSpaceGetNumberOfComponents(colorspace); - static const CGFloat domain[2] = {0.0, 1.0}; - static const CGFloat range[10] = {0, 1, 0, 1, 0, 1, 0, 1, 0, 1}; - //static const CGFunctionCallbacks callbacks = {0, &bilinearShadedColor, NULL}; - - // Create a CGFunctionRef that describes a function taking 1 input and kChannelsPerColor outputs. - function = CGFunctionCreate(colors, 1, domain, components, range, &functionCallbacks); - - startPoint.x=0; - startPoint.y=[self bounds].origin.y; - endPoint.x=0; - endPoint.y=NSMaxY([self bounds]); - - shading = CGShadingCreateAxial(colorspace, startPoint, endPoint, function, NO, NO); - - CGContextSaveGState(currentContext); - [self addClip]; - CGContextDrawShading(currentContext, shading); - CGContextRestoreGState(currentContext); - - CGShadingRelease(shading); - CGFunctionRelease(function); - CGColorSpaceRelease(colorspace); -} - - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.h b/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.h deleted file mode 100644 index 20bf7e0bfd..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// PSMMetalTabStyle.h -// PSMTabBarControl -// -// Created by John Pannell on 2/17/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import -#import "PSMTabStyle.h" - -@interface PSMMetalTabStyle : NSObject { - NSImage *metalCloseButton; - NSImage *metalCloseButtonDown; - NSImage *metalCloseButtonOver; - NSImage *_addTabButtonImage; - NSImage *_addTabButtonPressedImage; - NSImage *_addTabButtonRolloverImage; - NSMutableParagraphStyle *truncatingTailParagraphStyle; - NSMutableParagraphStyle *centeredParagraphStyle; -} - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; - -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.m b/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.m deleted file mode 100644 index fc1c5fae89..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMMetalTabStyle.m +++ /dev/null @@ -1,531 +0,0 @@ -// -// PSMMetalTabStyle.m -// PSMTabBarControl -// -// Created by John Pannell on 2/17/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import "PSMMetalTabStyle.h" -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" - -#define kPSMMetalObjectCounterRadius 7.0 -#define kPSMMetalCounterMinWidth 20 - -// NSDrawWindowBackground() is broken for borderless windows, see -// http://lists.apple.com/archives/cocoa-dev/2006/Feb/msg00130.html -void MyNSDrawWindowBackground(NSRect rect) -{ - [[NSColor controlColor] set]; - NSRectFill( rect ); -} - -@implementation PSMMetalTabStyle - -- (NSString *)name -{ - return @"Metal"; -} - -#pragma mark - -#pragma mark Creation/Destruction - -- (id) init -{ - //NSLog(@"PSMMetalTabStyle init"); - - if((self = [super init])) - { - - metalCloseButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front"]]; - //NSLog(@"metalCloseButton=%@ path=%@", metalCloseButton, - // [[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front"]); - metalCloseButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front_Pressed"]]; - metalCloseButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front_Rollover"]]; - - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetal"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetalPressed"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetalRollover"]]; - } - return self; -} - -- (void)dealloc -{ - [metalCloseButton release]; - [metalCloseButtonDown release]; - [metalCloseButtonOver release]; - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - - [truncatingTailParagraphStyle release]; - [centeredParagraphStyle release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Control Specific - -- (float)leftMarginForTabBarControl -{ - return 10.0f; -} - -- (float)rightMarginForTabBarControl -{ - return 24.0f; -} - -#pragma mark - -#pragma mark Add Tab Button - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonPressedImage; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonRolloverImage; -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect) closeButtonRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasCloseButton] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [metalCloseButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 2.0; - - if([cell state] == NSOnState){ - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - result.origin.x += [metalCloseButton size].width + kPSMTabBarCellPadding; - - if([cell state] == NSOnState){ - result.origin.y += 1; - } - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell state] == NSOnState){ - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - float countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMMetalObjectCounterRadius - 6.0); - if(countWidth < kPSMMetalCounterMinWidth) - countWidth = kPSMMetalCounterMinWidth; - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMMetalObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - - return result; -} - - -- (float)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [metalCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (float)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [metalCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSFontManager *fm = [NSFontManager sharedFontManager]; - NSNumberFormatter *nf = [[[NSNumberFormatter alloc] init] autorelease]; - [nf setLocalizesFormat:YES]; - [nf setFormat:@"0"]; - [nf setHasThousandSeparators:YES]; - NSString *contents = [nf stringFromNumber:[NSNumber numberWithInt:[cell count]]]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[fm convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[[NSColor whiteColor] colorWithAlphaComponent:0.85] range:range]; - - return attrStr; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString *contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[NSFont boldSystemFontOfSize:11.0] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[[NSColor textColor] colorWithAlphaComponent:0.75] range:range]; - - // Add shadow attribute - NSShadow* shadow; - shadow = [[[NSShadow alloc] init] autorelease]; - float shadowAlpha; - if(([cell state] == NSOnState) || [cell isHighlighted]){ - shadowAlpha = 0.8; - } else { - shadowAlpha = 0.5; - } - [shadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0 alpha:shadowAlpha]]; - [shadow setShadowOffset:NSMakeSize(0, -1)]; - [shadow setShadowBlurRadius:1.0]; - [attrStr addAttribute:NSShadowAttributeName value:shadow range:range]; - - // Paragraph Style for Truncating Long Text - if (!truncatingTailParagraphStyle) { - truncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [truncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; - [truncatingTailParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:truncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark ---- drawing ---- - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - NSColor * lineColor = nil; - NSBezierPath* bezier = [NSBezierPath bezierPath]; - lineColor = [NSColor darkGrayColor]; - - if ([cell state] == NSOnState) { - // selected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height-2.5); - aRect.size.height -= 0.5; - - // background - MyNSDrawWindowBackground(aRect); - - aRect.size.height+=0.5; - - // frame - aRect.origin.x += 0.5; - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y+aRect.size.height-1.5)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+1.5, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width-1.5, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y+aRect.size.height-1.5)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y)]; - if([[cell controlView] frame].size.height < 2){ - // special case of hidden control; need line across top of cell - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y+0.5)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y+0.5)]; - } - [bezier stroke]; - } else { - - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - aRect.origin.y += 0.5; - aRect.origin.x += 1.5; - aRect.size.width -= 1; - - // rollover - if ([cell isHighlighted]) { - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositingOperationSourceAtop); - } - - aRect.origin.x -= 1; - aRect.size.width += 1; - - // frame - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y)]; - if(!([cell tabState] & PSMTab_RightIsSelectedMask)){ - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y + aRect.size.height)]; - } - [bezier stroke]; - } - - [self drawInteriorWithTabCell:cell inView:[cell controlView]]; -} - - - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - float labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage * closeButton = nil; - - closeButton = metalCloseButton; - if ([cell closeButtonOver]) closeButton = metalCloseButtonOver; - if ([cell closeButtonPressed]) closeButton = metalCloseButtonDown; - - closeButtonSize = [closeButton size]; - [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; - } - -#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best. - // icon - if([cell hasIcon]){ - NSRect iconRect = [self iconRectForTabCell:cell]; - NSImage *icon = [[[[cell representedObject] identifier] content] icon]; - if ([controlView isFlipped]) { - iconRect.origin.y = cellFrame.size.height - iconRect.origin.y; - } - [icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0]; - - // scoot label over - labelPosition += iconRect.size.width + kPSMTabBarCellPadding; - } -#endif - - // object counter - if([cell count] > 0){ - [[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - if([cell state] == NSOnState) - myRect.origin.y -= 1.0; - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - labelRect.size.height = cellFrame.size.height; - labelRect.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if([cell state] == NSOnState){ - labelRect.origin.y -= 1; - } - - if(![[cell indicator] isHidden]) - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - - if([cell count] > 0) - labelRect.size.width -= ([self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding); - - // label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - MyNSDrawWindowBackground(rect); - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set]; - 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)]; - - // no tab view == not connected - if(![bar tabView]){ - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [centeredParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [attrStr drawInRect:labelRect]; - return; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - if(![cell isInOverflowMenu]){ - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - //[super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:metalCloseButton forKey:@"metalCloseButton"]; - [aCoder encodeObject:metalCloseButtonDown forKey:@"metalCloseButtonDown"]; - [aCoder encodeObject:metalCloseButtonOver forKey:@"metalCloseButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - // self = [super initWithCoder:aDecoder]; - //if (self) { - if ([aDecoder allowsKeyedCoding]) { - metalCloseButton = [[aDecoder decodeObjectForKey:@"metalCloseButton"] retain]; - metalCloseButtonDown = [[aDecoder decodeObjectForKey:@"metalCloseButtonDown"] retain]; - metalCloseButtonOver = [[aDecoder decodeObjectForKey:@"metalCloseButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - } - //} - return self; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.h b/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.h deleted file mode 100644 index 9151648d94..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.h +++ /dev/null @@ -1,35 +0,0 @@ -// -// PSMMojaveTabStyle.h -// PSMTabBarControl -// -// This file is copied from PSMYosemiteTabStyle to allow for modifications to -// adapt to Mojave-specific functionality such as Dark Mode without needing to -// pollute the implementation of Yosemite tab style. -// -// - -#if defined(MAC_OS_X_VERSION_10_14) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 -#define HAS_MOJAVE_TAB_STYLE 1 - -#import -#import "PSMTabStyle.h" - -@interface PSMMojaveTabStyle : NSObject { - NSImage *closeButton; - NSImage *closeButtonDown; - NSImage *closeButtonOver; - NSImage *closeButtonOverDark; - NSImage *_addTabButtonImage; - NSMutableParagraphStyle *truncatingTailParagraphStyle; - NSMutableParagraphStyle *centeredParagraphStyle; -} - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; - -- (void)styleAddTabButton:(PSMRolloverButton *)addTabButton; - -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - -@end -#endif diff --git a/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.m b/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.m deleted file mode 100644 index b6194330e2..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMMojaveTabStyle.m +++ /dev/null @@ -1,562 +0,0 @@ -// -// PSMMojaveTabStyle.m -// PSMTabBarControl -// -// This file is copied from PSMYosemiteTabStyle to allow for modifications to -// adapt to Mojave-specific functionality such as Dark Mode without needing to -// pollute the implementation of Yosemite tab style. -// -// - -#import "PSMMojaveTabStyle.h" - -#if HAS_MOJAVE_TAB_STYLE - -#define kPSMMetalObjectCounterRadius 7.0 -#define kPSMMetalCounterMinWidth 20 - -void MojaveNSDrawWindowBackground(NSRect rect, NSColor *color) -{ - [color set]; - NSRectFill( rect ); -} - -@implementation PSMMojaveTabStyle - -- (void)dealloc -{ - [closeButton release]; - [closeButtonDown release]; - [closeButtonOver release]; - [closeButtonOverDark release]; - [_addTabButtonImage release]; - - [truncatingTailParagraphStyle release]; - [centeredParagraphStyle release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Initializers - -- (id)init -{ - self = [super init]; - if (!self) return nil; - - closeButton = [[self createCloseButtonImage:16.0 color:[NSColor secondaryLabelColor] backgroundColor:nil] retain]; - closeButtonDown = [[self createCloseButtonImage:16.0 color:[NSColor secondaryLabelColor] backgroundColor:[NSColor grayColor]] retain]; - closeButtonOver = [[self createCloseButtonImage:16.0 color:[NSColor secondaryLabelColor] backgroundColor:[NSColor grayColor]] retain]; - closeButtonOverDark = [[self createCloseButtonImage:16.0 color:[NSColor secondaryLabelColor] backgroundColor:[NSColor darkGrayColor]] retain]; - - _addTabButtonImage = [[NSImage imageNamed:NSImageNameAddTemplate] retain]; - - return self; -} - -- (NSString *)name -{ - return @"Mojave"; -} - -#pragma mark - -#pragma mark Control Specific - -- (float)leftMarginForTabBarControl -{ - return -1.0f; -} - -- (float)rightMarginForTabBarControl -{ - return 24.0f; -} - -#pragma mark - -#pragma mark Add Tab Button - -- (void)styleAddTabButton:(PSMRolloverButton *)addTabButton -{ - NSImage *newButtonImage = [self addTabButtonImage]; - if (newButtonImage) { - [addTabButton setUsualImage:newButtonImage]; - [addTabButton setAlternateImage:newButtonImage]; - [addTabButton setRolloverImage:newButtonImage]; - } - [addTabButton setButtonType:NSMomentaryLightButton]; -} - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonImage;; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonImage; -} - -- (NSColor *)backgroundColor:(PSMTabBarCell *)cell isKeyWindow:(BOOL)isKeyWindow isSelected:(BOOL)isSelected -{ - NSColor *backgroundColor; - - BOOL isHighlight = [cell isHighlighted]; - - if (isKeyWindow) { - if (isSelected) { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundActiveSelected" bundle:[PSMTabBarControl bundle]]; - } else if (isHighlight) { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundActiveHighlight" bundle:[PSMTabBarControl bundle]]; - } else { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundActive" bundle:[PSMTabBarControl bundle]]; - } - } else { - if (isSelected) { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundInactiveSelected" bundle:[PSMTabBarControl bundle]]; - } else if (isHighlight) { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundInactiveHighlight" bundle:[PSMTabBarControl bundle]]; - } else { - backgroundColor = [NSColor colorNamed:@"MojaveTabBackgroundInactive" bundle:[PSMTabBarControl bundle]]; - } - } - - return backgroundColor; -} - -- (NSColor *)borderColor:(BOOL)isKeyWindow -{ - if (isKeyWindow) { - return [NSColor colorNamed:@"MojaveTabBorderActive" bundle:[PSMTabBarControl bundle]]; - } else { - return [NSColor colorNamed:@"MojaveTabBorderInactive" bundle:[PSMTabBarControl bundle]]; - } -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect) closeButtonRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasCloseButton] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [closeButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = (cellFrame.size.height - result.size.height) / 2; - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - result.origin.x += [closeButton size].width + kPSMTabBarCellPadding; - - if([cell state] == NSControlStateValueOn){ - result.origin.y += 1; - } - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell state] == NSControlStateValueOn){ - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - float countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMMetalObjectCounterRadius - 6.0); - if(countWidth < kPSMMetalCounterMinWidth) - countWidth = kPSMMetalCounterMinWidth; - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMMetalObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - - return result; -} - - -- (float)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [closeButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (float)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [closeButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSFontManager *fm = [NSFontManager sharedFontManager]; - NSNumberFormatter *nf = [[[NSNumberFormatter alloc] init] autorelease]; - [nf setLocalizesFormat:YES]; - [nf setFormat:@"0"]; - [nf setHasThousandSeparators:YES]; - NSString *contents = [nf stringFromNumber:[NSNumber numberWithInt:[cell count]]]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[fm convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[[NSColor whiteColor] colorWithAlphaComponent:0.85] range:range]; - - return attrStr; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString *contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - - PSMTabBarControl *bar = (PSMTabBarControl *)cell.controlView; - BOOL isKeyWindow = [bar.window isKeyWindow]; - - CGFloat textAlpha; - if ([cell state] == NSControlStateValueOn) { - textAlpha = (isKeyWindow) ? 1.0f : 0.5f; - } else { - textAlpha = (isKeyWindow) ? 0.5f : 0.25f; - } - NSColor *textColor = [[NSColor textColor] colorWithAlphaComponent:textAlpha]; - - [attrStr addAttribute:NSForegroundColorAttributeName value:textColor range:range]; - - // Paragraph Style for Truncating Long Text - if (!truncatingTailParagraphStyle) { - truncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [truncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingHead]; - [truncatingTailParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:truncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark ---- drawing ---- - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - PSMTabBarControl *bar = (PSMTabBarControl *)cell.controlView; - BOOL isKeyWindow = [bar.window isKeyWindow]; - - NSRect cellFrame = [cell frame]; - NSColor * lineColor = nil; - NSBezierPath* bezier = [NSBezierPath bezierPath]; - lineColor = [self borderColor:isKeyWindow]; - - if ([cell state] == NSControlStateValueOn) { - // selected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - - // background - MojaveNSDrawWindowBackground(aRect, [self backgroundColor:cell isKeyWindow:isKeyWindow isSelected:YES]); - - aRect.size.height -= 1.0f; - aRect.origin.y += 0.5f; - // frame - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y+aRect.size.height)]; - [bezier stroke]; - } else { - - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - - aRect.origin.x += 0.5; - - // background - MojaveNSDrawWindowBackground(aRect, [self backgroundColor:cell isKeyWindow:isKeyWindow isSelected:NO]); - - // frame - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y)]; - if(!([cell tabState] & PSMTab_RightIsSelectedMask)){ - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y + aRect.size.height)]; - } - [bezier stroke]; - } - - [self drawInteriorWithTabCell:cell inView:[cell controlView]]; -} - -- (NSImage *)createCloseButtonImage:(CGFloat)size color:(NSColor *)color backgroundColor:(NSColor *)backgroundColor -{ - NSImage *result = [NSImage imageWithSize:NSMakeSize(size,size) flipped:YES drawingHandler:^BOOL(NSRect dstRect) { - if (backgroundColor) { - NSBezierPath *bezier = [NSBezierPath bezierPathWithRoundedRect:dstRect - xRadius:2.0 - yRadius:2.0]; - [backgroundColor set]; - [bezier fill]; - } - - NSBezierPath *bezier = NSBezierPath.bezierPath; - - [color set]; - [bezier moveToPoint:NSMakePoint(NSMinX(dstRect)+4.5, NSMinY(dstRect)+4.5)]; - [bezier lineToPoint:NSMakePoint(NSMaxX(dstRect)-4.5, NSMaxY(dstRect)-4.5)]; - [bezier moveToPoint:NSMakePoint(NSMaxX(dstRect)-4.5, NSMinY(dstRect)+4.5)]; - [bezier lineToPoint:NSMakePoint(NSMinX(dstRect)+4.5, NSMaxY(dstRect)-4.5)]; - [bezier stroke]; - - return YES; - }]; - - return result; -} - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - float labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage *button = nil; - - if ([cell isHighlighted]) { - button = closeButton; - } - if ([cell closeButtonOver]) { - NSAppearanceName appearanceName = [controlView.effectiveAppearance bestMatchFromAppearancesWithNames:@[NSAppearanceNameAqua, NSAppearanceNameAccessibilityHighContrastAqua, NSAppearanceNameDarkAqua, NSAppearanceNameAccessibilityHighContrastDarkAqua]]; - - if ([appearanceName isEqualToString:NSAppearanceNameDarkAqua] || [appearanceName isEqualToString:NSAppearanceNameAccessibilityHighContrastDarkAqua]) { - button = closeButtonOverDark; - } else { - button = closeButtonOver; - } - } - if ([cell closeButtonPressed]) button = closeButtonDown; - - closeButtonSize = [button size]; - [button drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil]; - } - - // object counter - if([cell count] > 0){ - [[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - labelRect.size.height = cellFrame.size.height; - labelRect.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - - if([cell count] > 0) - labelRect.size.width -= ([self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding); - - // label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - BOOL isKeyWindow = [bar.window isKeyWindow]; - MojaveNSDrawWindowBackground(rect, [self backgroundColor:nil isKeyWindow:isKeyWindow isSelected:NO]); - - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.0] set]; - NSRectFillUsingOperation(rect, NSCompositingOperationSourceAtop); - [[self borderColor:isKeyWindow] 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)]; - - // no tab view == not connected - if(![bar tabView]){ - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [centeredParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [attrStr drawInRect:labelRect]; - return; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - if(![cell isInOverflowMenu]){ - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:closeButton forKey:@"metalCloseButton"]; - [aCoder encodeObject:closeButtonDown forKey:@"metalCloseButtonDown"]; - [aCoder encodeObject:closeButtonOver forKey:@"metalCloseButtonOver"]; - [aCoder encodeObject:closeButtonOverDark forKey:@"metalCloseButtonOverDark"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - if ([aDecoder allowsKeyedCoding]) { - closeButton = [[aDecoder decodeObjectForKey:@"metalCloseButton"] retain]; - closeButtonDown = [[aDecoder decodeObjectForKey:@"metalCloseButtonDown"] retain]; - closeButtonOver = [[aDecoder decodeObjectForKey:@"metalCloseButtonOver"] retain]; - closeButtonOverDark = [[aDecoder decodeObjectForKey:@"metalCloseButtonOverDark"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - } - - return self; -} - -@end - -#endif diff --git a/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.h b/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.h deleted file mode 100644 index 1ee16bdcb2..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// PSMOverflowPopUpButton.h -// PSMTabBarControl -// -// Created by John Pannell on 11/4/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import - - -@interface PSMOverflowPopUpButton : NSPopUpButton { - NSImage *_PSMTabBarOverflowPopUpImage; - NSImage *_PSMTabBarOverflowDownPopUpImage; - BOOL _down; -} - -// archiving -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.m b/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.m deleted file mode 100644 index 2b36b745e2..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMOverflowPopUpButton.m +++ /dev/null @@ -1,90 +0,0 @@ -// -// PSMOverflowPopUpButton.m -// PSMTabBarControl -// -// Created by John Pannell on 11/4/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import "PSMOverflowPopUpButton.h" -#import "PSMTabBarControl.h" - -@implementation PSMOverflowPopUpButton - -- (id)initWithFrame:(NSRect)frameRect pullsDown:(BOOL)flag -{ - self=[super initWithFrame:frameRect pullsDown:YES]; - if (self) { - [self setBezelStyle:NSRegularSquareBezelStyle]; - [self setBordered:NO]; - [self setTitle:@""]; - [self setPreferredEdge:NSMaxXEdge]; - _PSMTabBarOverflowPopUpImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"overflowImage"]]; - _PSMTabBarOverflowDownPopUpImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"overflowImagePressed"]]; - } - return self; -} - -- (void)dealloc -{ - [_PSMTabBarOverflowPopUpImage release]; - [_PSMTabBarOverflowDownPopUpImage release]; - [super dealloc]; -} - -- (void)drawRect:(NSRect)rect -{ - if(_PSMTabBarOverflowPopUpImage == nil){ - [super drawRect:rect]; - return; - } - - NSImage *image = (_down) ? _PSMTabBarOverflowDownPopUpImage : _PSMTabBarOverflowPopUpImage; - NSSize imageSize = [image size]; - NSRect bounds = [self bounds]; - NSPoint drawPoint = NSMakePoint(NSMidX(bounds) - (imageSize.width * 0.5f), - NSMidY(bounds) - (imageSize.height * 0.5f)); - [image drawAtPoint:drawPoint - fromRect:NSZeroRect - operation:NSCompositingOperationSourceOver - fraction:1.0f]; -} - -- (void)mouseDown:(NSEvent *)event -{ - _down = YES; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(notificationReceived:) name:NSMenuDidEndTrackingNotification object:[self menu]]; - [self setNeedsDisplay:YES]; - [super mouseDown:event]; -} - -- (void)notificationReceived:(NSNotification *)notification -{ - _down = NO; - [self setNeedsDisplay:YES]; - [[NSNotificationCenter defaultCenter] removeObserver:self]; -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:_PSMTabBarOverflowPopUpImage forKey:@"PSMTabBarOverflowPopUpImage"]; - [aCoder encodeObject:_PSMTabBarOverflowDownPopUpImage forKey:@"PSMTabBarOverflowDownPopUpImage"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self) { - if ([aDecoder allowsKeyedCoding]) { - _PSMTabBarOverflowPopUpImage = [[aDecoder decodeObjectForKey:@"PSMTabBarOverflowPopUpImage"] retain]; - _PSMTabBarOverflowDownPopUpImage = [[aDecoder decodeObjectForKey:@"PSMTabBarOverflowDownPopUpImage"] retain]; - } - } - return self; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.h b/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.h deleted file mode 100644 index 8f56bd73ae..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// PSMProgressIndicator.h -// PSMTabBarControl -// -// Created by John Pannell on 2/23/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import -#import "PSMTabBarControl.h" - - -@interface PSMProgressIndicator : NSProgressIndicator { - -} - -@end - -@interface PSMTabBarControl (LayoutPlease) - -- (void)update; - -@end \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.m b/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.m deleted file mode 100644 index d3046d518a..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMProgressIndicator.m +++ /dev/null @@ -1,20 +0,0 @@ -// -// PSMProgressIndicator.m -// PSMTabBarControl -// -// Created by John Pannell on 2/23/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import "PSMProgressIndicator.h" - -@implementation PSMProgressIndicator - -// overrides to make tab bar control re-layout things if status changes -- (void)setHidden:(BOOL)flag -{ - [super setHidden:flag]; - [(PSMTabBarControl *)[self superview] update]; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.h b/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.h deleted file mode 100644 index d78b47c272..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.h +++ /dev/null @@ -1,29 +0,0 @@ -// -// PSMOverflowPopUpButton.h -// NetScrape -// -// Created by John Pannell on 8/4/04. -// Copyright 2004 Positive Spin Media. All rights reserved. -// - -#import - -@interface PSMRolloverButton : NSButton -{ - NSImage *_rolloverImage; - NSImage *_usualImage; - NSTrackingRectTag _myTrackingRectTag; -} - -// the regular image -- (void)setUsualImage:(NSImage *)newImage; -- (NSImage *)usualImage; - -// the rollover image -- (void)setRolloverImage:(NSImage *)newImage; -- (NSImage *)rolloverImage; - -// tracking rect for mouse events -- (void)addTrackingRect; -- (void)removeTrackingRect; -@end \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.m b/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.m deleted file mode 100644 index 10fed285a0..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMRolloverButton.m +++ /dev/null @@ -1,115 +0,0 @@ -// -// PSMOverflowPopUpButton.m -// NetScrape -// -// Created by John Pannell on 8/4/04. -// Copyright 2004 Positive Spin Media. All rights reserved. -// - -#import "PSMRolloverButton.h" - -@implementation PSMRolloverButton - -- (void)dealloc -{ - [_usualImage release]; - [_rolloverImage release]; - - [super dealloc]; -} - -// the regular image -- (void)setUsualImage:(NSImage *)newImage -{ - [newImage retain]; - [_usualImage release]; - _usualImage = newImage; - [self setImage:_usualImage]; -} - -- (NSImage *)usualImage -{ - return _usualImage; -} - -- (void)setRolloverImage:(NSImage *)newImage -{ - [newImage retain]; - [_rolloverImage release]; - _rolloverImage = newImage; -} - -- (NSImage *)rolloverImage -{ - return _rolloverImage; -} - -- (void)addTrackingRect -{ - // assign a tracking rect to watch for mouse enter/exit - _myTrackingRectTag = [self addTrackingRect:[self bounds] owner:self userData:nil assumeInside:NO]; -} - -- (void)removeTrackingRect -{ - [self removeTrackingRect:_myTrackingRectTag]; -} - -// override for rollover effect -- (void)mouseEntered:(NSEvent *)theEvent; -{ - // set rollover image - [self setImage:_rolloverImage]; - [self setNeedsDisplay]; - [[self superview] setNeedsDisplay:YES]; // eliminates a drawing artifact -} - -- (void)mouseExited:(NSEvent *)theEvent; -{ - // restore usual image - [self setImage:_usualImage]; - [self setNeedsDisplay]; - [[self superview] setNeedsDisplay:YES]; // eliminates a drawing artifact -} - -- (void)mouseDown:(NSEvent *)theEvent -{ - // eliminates drawing artifact - [[NSRunLoop currentRunLoop] performSelector:@selector(display) target:[self superview] argument:nil order:1 modes:[NSArray arrayWithObjects:@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode", nil]]; - [super mouseDown:theEvent]; -} - -- (void)resetCursorRects -{ - // called when the button rect has been changed - [self removeTrackingRect]; - [self addTrackingRect]; - [[self superview] setNeedsDisplay:YES]; // eliminates a drawing artifact -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:_rolloverImage forKey:@"rolloverImage"]; - [aCoder encodeObject:_usualImage forKey:@"usualImage"]; - [aCoder encodeInt:_myTrackingRectTag forKey:@"myTrackingRectTag"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self) { - if ([aDecoder allowsKeyedCoding]) { - _rolloverImage = [[aDecoder decodeObjectForKey:@"rolloverImage"] retain]; - _usualImage = [[aDecoder decodeObjectForKey:@"usualImage"] retain]; - _myTrackingRectTag = [aDecoder decodeIntForKey:@"myTrackingRectTag"]; - } - } - return self; -} - - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.h b/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.h deleted file mode 100644 index 4c28ffc831..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.h +++ /dev/null @@ -1,105 +0,0 @@ -// -// PSMTabBarCell.h -// PSMTabBarControl -// -// Created by John Pannell on 10/13/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import -#import "PSMTabBarControl.h" - -@class PSMTabBarControl; -@class PSMProgressIndicator; - -@interface PSMTabBarCell : NSActionCell { - // sizing - NSRect _frame; - NSSize _stringSize; - int _currentStep; - BOOL _isPlaceholder; - - // state - int _tabState; - NSTrackingRectTag _closeButtonTrackingTag; // left side tracking, if dragging - NSTrackingRectTag _cellTrackingTag; // right side tracking, if dragging - BOOL _closeButtonOver; - BOOL _closeButtonPressed; - PSMProgressIndicator *_indicator; - BOOL _isInOverflowMenu; - BOOL _hasCloseButton; - BOOL _isCloseButtonSuppressed; - BOOL _hasIcon; - int _count; - 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 -- (NSTrackingRectTag)closeButtonTrackingTag; -- (void)setCloseButtonTrackingTag:(NSTrackingRectTag)tag; -- (NSTrackingRectTag)cellTrackingTag; -- (void)setCellTrackingTag:(NSTrackingRectTag)tag; -- (float)width; -- (NSRect)frame; -- (void)setFrame:(NSRect)rect; -- (void)setStringValue:(NSString *)aString; -- (NSSize)stringSize; -- (NSAttributedString *)attributedStringValue; -- (int)tabState; -- (void)setTabState:(int)state; -- (NSProgressIndicator *)indicator; -- (BOOL)isInOverflowMenu; -- (void)setIsInOverflowMenu:(BOOL)value; -- (BOOL)closeButtonPressed; -- (void)setCloseButtonPressed:(BOOL)value; -- (BOOL)closeButtonOver; -- (void)setCloseButtonOver:(BOOL)value; -- (BOOL)hasCloseButton; -- (void)setHasCloseButton:(BOOL)set; -- (void)setCloseButtonSuppressed:(BOOL)suppress; -- (BOOL)isCloseButtonSuppressed; -- (BOOL)hasIcon; -- (void)setHasIcon:(BOOL)value; -- (int)count; -- (void)setCount:(int)value; -- (BOOL)isPlaceholder; -- (void)setIsPlaceholder:(BOOL)value; -- (int)currentStep; -- (void)setCurrentStep:(int)value; -- (NSString *)toolTip; -- (void)setToolTip:(NSString *)tip; - -// component attributes -- (NSRect)indicatorRectForFrame:(NSRect)cellFrame; -- (NSRect)closeButtonRectForFrame:(NSRect)cellFrame; -- (float)minimumWidthOfCell; -- (float)desiredWidthOfCell; - -// drawing -- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView; - -// tracking the mouse -- (void)mouseEntered:(NSEvent *)theEvent; -- (void)mouseExited:(NSEvent *)theEvent; - -// drag support -- (NSImage*)dragImageForRect:(NSRect)cellFrame; - -// archiving -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - -@end - -@interface PSMTabBarControl (CellAccessors) - -- (id)psmTabStyle; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.m b/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.m deleted file mode 100644 index 9642ba704b..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarCell.m +++ /dev/null @@ -1,404 +0,0 @@ -// -// PSMTabBarCell.m -// PSMTabBarControl -// -// Created by John Pannell on 10/13/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" -#import "PSMTabStyle.h" -#import "PSMProgressIndicator.h" -#import "PSMTabDragAssistant.h" - - -@implementation PSMTabBarCell -@dynamic controlView; - -#pragma mark - -#pragma mark Creation/Destruction -- (id)initWithControlView:(PSMTabBarControl *)controlView -{ - self = [super init]; - if(self){ - self.controlView = controlView; - _closeButtonTrackingTag = 0; - _cellTrackingTag = 0; - _closeButtonOver = NO; - _closeButtonPressed = NO; - _indicator = [[PSMProgressIndicator alloc] initWithFrame:NSMakeRect(0.0,0.0,kPSMTabBarIndicatorWidth,kPSMTabBarIndicatorWidth)]; - [_indicator setStyle:NSProgressIndicatorSpinningStyle]; - [_indicator setAutoresizingMask:NSViewMinYMargin]; - _hasCloseButton = YES; - _isCloseButtonSuppressed = NO; - _count = 0; - _isPlaceholder = NO; - } - return self; -} - -- (id)initPlaceholderWithFrame:(NSRect)frame expanded:(BOOL)value inControlView:(PSMTabBarControl *)controlView -{ - self = [super init]; - if(self){ - self.controlView = controlView; - _isPlaceholder = YES; - if(!value) - frame.size.width = 0.0; - [self setFrame:frame]; - _closeButtonTrackingTag = 0; - _cellTrackingTag = 0; - _closeButtonOver = NO; - _closeButtonPressed = NO; - _indicator = nil; - _hasCloseButton = YES; - _isCloseButtonSuppressed = NO; - _count = 0; - - if(value){ - [self setCurrentStep:(kPSMTabDragAnimationSteps - 1)]; - } else { - [self setCurrentStep:0]; - } - - } - - return self; -} - -- (void)dealloc -{ - [_indicator release]; - [_toolTip release]; - [super dealloc]; -} - -#pragma mark - -#pragma mark Accessors - -- (NSTrackingRectTag)closeButtonTrackingTag -{ - return _closeButtonTrackingTag; -} - -- (void)setCloseButtonTrackingTag:(NSTrackingRectTag)tag -{ - _closeButtonTrackingTag = tag; -} - -- (NSTrackingRectTag)cellTrackingTag -{ - return _cellTrackingTag; -} - -- (void)setCellTrackingTag:(NSTrackingRectTag)tag -{ - _cellTrackingTag = tag; -} - -- (float)width -{ - return _frame.size.width; -} - -- (NSRect)frame -{ - return _frame; -} - -- (void)setFrame:(NSRect)rect -{ - _frame = rect; -} - -- (void)setStringValue:(NSString *)aString -{ - [super setStringValue:aString]; - _stringSize = [[self attributedStringValue] size]; - // need to redisplay now - binding observation was too quick. - [self.controlView update]; -} - -- (NSSize)stringSize -{ - return _stringSize; -} - -- (NSAttributedString *)attributedStringValue -{ - return [[self.controlView psmTabStyle] attributedStringValueForTabCell:self]; -} - -- (int)tabState -{ - return _tabState; -} - -- (void)setTabState:(int)state -{ - _tabState = state; -} - -- (NSProgressIndicator *)indicator -{ - return _indicator; -} - -- (BOOL)isInOverflowMenu -{ - return _isInOverflowMenu; -} - -- (void)setIsInOverflowMenu:(BOOL)value -{ - _isInOverflowMenu = value; -} - -- (BOOL)closeButtonPressed -{ - return _closeButtonPressed; -} - -- (void)setCloseButtonPressed:(BOOL)value -{ - _closeButtonPressed = value; -} - -- (BOOL)closeButtonOver -{ - return _closeButtonOver; -} - -- (void)setCloseButtonOver:(BOOL)value -{ - _closeButtonOver = value; -} - -- (BOOL)hasCloseButton -{ - return _hasCloseButton; -} - -- (void)setHasCloseButton:(BOOL)set; -{ - _hasCloseButton = set; -} - -- (void)setCloseButtonSuppressed:(BOOL)suppress; -{ - _isCloseButtonSuppressed = suppress; -} - -- (BOOL)isCloseButtonSuppressed; -{ - return _isCloseButtonSuppressed; -} - -- (BOOL)hasIcon -{ - return _hasIcon; -} - -- (void)setHasIcon:(BOOL)value -{ - _hasIcon = value; - [self.controlView update]; // binding notice is too fast -} - -- (int)count -{ - return _count; -} - -- (void)setCount:(int)value -{ - _count = value; - [self.controlView update]; // binding notice is too fast -} - -- (BOOL)isPlaceholder -{ - return _isPlaceholder; -} - -- (void)setIsPlaceholder:(BOOL)value; -{ - _isPlaceholder = value; -} - -- (int)currentStep -{ - return _currentStep; -} - -- (void)setCurrentStep:(int)value -{ - if(value < 0) - value = 0; - - if(value > (kPSMTabDragAnimationSteps - 1)) - value = (kPSMTabDragAnimationSteps - 1); - - _currentStep = value; -} - -- (NSString *)toolTip -{ - return _toolTip; -} - -- (void)setToolTip:(NSString *)tip -{ - if (tip != _toolTip) { - [_toolTip release]; - _toolTip = [tip copy]; - } -} - -#pragma mark - -#pragma mark Component Attributes - -- (NSRect)indicatorRectForFrame:(NSRect)cellFrame -{ - return [[self.controlView psmTabStyle] indicatorRectForTabCell:self]; -} - -- (NSRect)closeButtonRectForFrame:(NSRect)cellFrame -{ - return [[self.controlView psmTabStyle] closeButtonRectForTabCell:self]; -} - -- (float)minimumWidthOfCell -{ - return [[self.controlView psmTabStyle] minimumWidthOfTabCell:self]; -} - -- (float)desiredWidthOfCell -{ - return [[self.controlView psmTabStyle] desiredWidthOfTabCell:self]; -} - -#pragma mark - -#pragma mark Drawing - -- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView -{ - if(_isPlaceholder){ - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.2] set]; - NSRectFillUsingOperation(cellFrame, NSCompositingOperationSourceAtop); - return; - } - - [[self.controlView psmTabStyle] drawTabCell:self]; -} - -#pragma mark - -#pragma mark Tracking - -- (void)mouseEntered:(NSEvent *)theEvent -{ - // check for which tag - if([theEvent trackingNumber] == _closeButtonTrackingTag){ - _closeButtonOver = YES; - } - if([theEvent trackingNumber] == _cellTrackingTag){ - [self setHighlighted:YES]; - } - [self.controlView setNeedsDisplay]; -} - -- (void)mouseExited:(NSEvent *)theEvent -{ - // check for which tag - if([theEvent trackingNumber] == _closeButtonTrackingTag){ - _closeButtonOver = NO; - } - if([theEvent trackingNumber] == _cellTrackingTag){ - [self setHighlighted:NO]; - } - [self.controlView setNeedsDisplay]; -} - -#pragma mark - -#pragma mark Drag Support - -- (NSImage*)dragImageForRect:(NSRect)cellFrame -{ - if(([self state] == NSOnState) && ([[self.controlView styleName] isEqualToString:@"Metal"])) - cellFrame.size.width += 1.0; - [self.controlView lockFocus]; - - NSBitmapImageRep *rep = [[self controlView] bitmapImageRepForCachingDisplayInRect:cellFrame]; - [[self controlView] cacheDisplayInRect:cellFrame toBitmapImageRep:rep]; - - [self.controlView unlockFocus]; - NSImage *image = [[[NSImage alloc] initWithSize:[rep size]] autorelease]; - [image addRepresentation:rep]; - NSImage *returnImage = [[[NSImage alloc] initWithSize:[rep size]] autorelease]; - [returnImage lockFocus]; - [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"]]; - [returnImage lockFocus]; - NSPoint indicatorPoint = NSMakePoint([self frame].size.width - MARGIN_X - kPSMTabBarIndicatorWidth, MARGIN_Y); - 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]; - [pi release]; - } - return returnImage; -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder { - [super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeRect:_frame forKey:@"frame"]; - [aCoder encodeSize:_stringSize forKey:@"stringSize"]; - [aCoder encodeInt:_currentStep forKey:@"currentStep"]; - [aCoder encodeBool:_isPlaceholder forKey:@"isPlaceholder"]; - [aCoder encodeInt:_tabState forKey:@"tabState"]; - [aCoder encodeInt:_closeButtonTrackingTag forKey:@"closeButtonTrackingTag"]; - [aCoder encodeInt:_cellTrackingTag forKey:@"cellTrackingTag"]; - [aCoder encodeBool:_closeButtonOver forKey:@"closeButtonOver"]; - [aCoder encodeBool:_closeButtonPressed forKey:@"closeButtonPressed"]; - [aCoder encodeObject:_indicator forKey:@"indicator"]; - [aCoder encodeBool:_isInOverflowMenu forKey:@"isInOverflowMenu"]; - [aCoder encodeBool:_hasCloseButton forKey:@"hasCloseButton"]; - [aCoder encodeBool:_isCloseButtonSuppressed forKey:@"isCloseButtonSuppressed"]; - [aCoder encodeBool:_hasIcon forKey:@"hasIcon"]; - [aCoder encodeInt:_count forKey:@"count"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - self = [super initWithCoder:aDecoder]; - if (self) { - if ([aDecoder allowsKeyedCoding]) { - _frame = [aDecoder decodeRectForKey:@"frame"]; - NSLog(@"decoding cell"); - _stringSize = [aDecoder decodeSizeForKey:@"stringSize"]; - _currentStep = [aDecoder decodeIntForKey:@"currentStep"]; - _isPlaceholder = [aDecoder decodeBoolForKey:@"isPlaceholder"]; - _tabState = [aDecoder decodeIntForKey:@"tabState"]; - _closeButtonTrackingTag = [aDecoder decodeIntForKey:@"closeButtonTrackingTag"]; - _cellTrackingTag = [aDecoder decodeIntForKey:@"cellTrackingTag"]; - _closeButtonOver = [aDecoder decodeBoolForKey:@"closeButtonOver"]; - _closeButtonPressed = [aDecoder decodeBoolForKey:@"closeButtonPressed"]; - _indicator = [[aDecoder decodeObjectForKey:@"indicator"] retain]; - _isInOverflowMenu = [aDecoder decodeBoolForKey:@"isInOverflowMenu"]; - _hasCloseButton = [aDecoder decodeBoolForKey:@"hasCloseButton"]; - _isCloseButtonSuppressed = [aDecoder decodeBoolForKey:@"isCloseButtonSuppressed"]; - _hasIcon = [aDecoder decodeBoolForKey:@"hasIcon"]; - _count = [aDecoder decodeIntForKey:@"count"]; - } - } - return self; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h deleted file mode 100644 index 4b320f4c8d..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.h +++ /dev/null @@ -1,155 +0,0 @@ -// -// PSMTabBarControl.h -// PSMTabBarControl -// -// Created by John Pannell on 10/13/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -/* - This view provides a control interface to manage a regular NSTabView. It looks and works like the tabbed browsing interface of many popular browsers. - */ - -#import - -#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 -# define kPSMTabBarControlHeight 22 -#endif -// internal cell border -#define MARGIN_X 6 -#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_10 -# define MARGIN_Y 5 -#else -# define MARGIN_Y 3 -#endif -// padding between objects -#define kPSMTabBarCellPadding 4 -// fixed size objects -#define kPSMMinimumTitleWidth 30 -#define kPSMTabBarIndicatorWidth 16.0 -#define kPSMTabBarIconWidth 16.0 -#define kPSMHideAnimationSteps 2.0 - -@class PSMOverflowPopUpButton; -@class PSMRolloverButton; -@class PSMTabBarCell; -@protocol PSMTabStyle; - -enum { - PSMTab_SelectedMask = 1 << 1, - PSMTab_LeftIsSelectedMask = 1 << 2, - PSMTab_RightIsSelectedMask = 1 << 3, - PSMTab_PositionLeftMask = 1 << 4, - PSMTab_PositionMiddleMask = 1 << 5, - PSMTab_PositionRightMask = 1 << 6, - PSMTab_PositionSingleMask = 1 << 7 -}; - -@interface PSMTabBarControl : NSControl -#if (MAC_OS_X_VERSION_MAX_ALLOWED >= 1060) - // 10.6 has turned delegate messages into formal protocols - -#endif -{ - - // control basics - NSMutableArray *_cells; // the cells that draw the tabs - IBOutlet NSTabView *tabView; // the tab view being navigated - PSMOverflowPopUpButton *_overflowPopUpButton; // for too many tabs - PSMRolloverButton *_addTabButton; - - // drawing style - id style; - BOOL _canCloseOnlyTab; - BOOL _hideForSingleTab; - BOOL _showAddTabButton; - BOOL _sizeCellsToFit; - - // cell width - int _cellMinWidth; - int _cellMaxWidth; - int _cellOptimumWidth; - - // animation for hide/show - int _currentStep; - BOOL _isHidden; - BOOL _hideIndicators; - IBOutlet id partnerView; // gets resized when hide/show - BOOL _awakenedFromNib; - - // drag and drop - NSEvent *_lastMouseDownEvent; // keep this for dragging reference - BOOL _allowsDragBetweenWindows; - BOOL _delegateHandlingDrag; - NSDragOperation _delegateInitialDragOperation; - - // MVC help - IBOutlet id delegate; -} - -// control characteristics -+ (NSBundle *)bundle; - -// control configuration -- (BOOL)canCloseOnlyTab; -- (void)setCanCloseOnlyTab:(BOOL)value; -- (NSString *)styleName; -- (void)setStyleNamed:(NSString *)name; -- (BOOL)hideForSingleTab; -- (void)setHideForSingleTab:(BOOL)value; -- (BOOL)showAddTabButton; -- (void)setShowAddTabButton:(BOOL)value; -- (int)cellMinWidth; -- (void)setCellMinWidth:(int)value; -- (int)cellMaxWidth; -- (void)setCellMaxWidth:(int)value; -- (int)cellOptimumWidth; -- (void)setCellOptimumWidth:(int)value; -- (BOOL)sizeCellsToFit; -- (void)setSizeCellsToFit:(BOOL)value; -- (BOOL)allowsDragBetweenWindows; -- (void)setAllowsDragBetweenWindows:(BOOL)flag; - -// tool tips -- (void)setToolTip:(NSString *)value forTabViewItem:(NSTabViewItem *)tvi; - -// accessors -- (NSTabView *)tabView; -- (void)setTabView:(NSTabView *)view; -- (id)delegate; -- (void)setDelegate:(id)object; -- (id)partnerView; -- (void)setPartnerView:(id)view; - -// the buttons -- (PSMRolloverButton *)addTabButton; -- (PSMOverflowPopUpButton *)overflowPopUpButton; -- (NSMutableArray *)representedTabViewItems; - -// special effects -- (void)hideTabBar:(BOOL)hide animate:(BOOL)animate; - -@end - - -@interface NSObject (TabBarControlDelegateMethods) -- (BOOL)tabView:(NSTabView *)aTabView shouldCloseTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)aTabView willCloseTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)aTabView didCloseTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)aTabView didDragTabViewItem:(NSTabViewItem *)tabViewItem toIndex:(int)idx; - -- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingEntered:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -- (NSDragOperation)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingUpdated:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -- (void)tabBarControl:(PSMTabBarControl *)theTabBarControl draggingExited:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl prepareForDragOperation:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -- (BOOL)tabBarControl:(PSMTabBarControl *)theTabBarControl performDragOperation:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -- (void)tabBarControl:(PSMTabBarControl *)theTabBarControl concludeDragOperation:(id )sender forTabAtIndex:(NSUInteger)tabIndex; -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m deleted file mode 100644 index e782b0a03c..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl.m +++ /dev/null @@ -1,1484 +0,0 @@ -// -// PSMTabBarControl.m -// PSMTabBarControl -// -// Created by John Pannell on 10/13/05. -// Copyright 2005 Positive Spin Media. All rights reserved. -// - -#import "PSMTabBarControl.h" -#import "PSMTabBarCell.h" -#import "PSMOverflowPopUpButton.h" -#import "PSMRolloverButton.h" -#import "PSMTabStyle.h" -#import "PSMMetalTabStyle.h" -#import "PSMMojaveTabStyle.h" -#import "PSMUnifiedTabStyle.h" -#import "PSMYosemiteTabStyle.h" -#import "PSMTabDragAssistant.h" - -@interface PSMTabBarControl (Private) -// characteristics -- (float)availableCellWidth; -- (NSRect)genericCellRect; - - // constructor/destructor -- (void)initAddedProperties; -- (void)dealloc; - - // accessors -- (NSEvent *)lastMouseDownEvent; -- (void)setLastMouseDownEvent:(NSEvent *)event; - - // contents -- (void)addTabViewItem:(NSTabViewItem *)item; -- (void)removeTabForCell:(PSMTabBarCell *)cell; - - // draw -- (void)update; - - // actions -- (void)overflowMenuAction:(id)sender; -- (void)closeTabClick:(id)sender; -- (void)tabClick:(id)sender; -- (void)tabNothing:(id)sender; -- (void)frameDidChange:(NSNotification *)notification; -- (void)windowDidMove:(NSNotification *)aNotification; -- (void)windowStatusDidChange:(NSNotification *)notification; - - // NSTabView delegate -- (void)tabView:(NSTabView *)tabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem; -- (BOOL)tabView:(NSTabView *)tabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)tabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)tabView; - - // archiving -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - - // convenience -- (id)cellForPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame; -- (NSUInteger)indexOfCellAtPoint:(NSPoint)point; -- (NSUInteger)indexOfCellAtPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame; -- (PSMTabBarCell *)lastVisibleTab; -- (int)numberOfVisibleTabs; - -@end - -@implementation PSMTabBarControl -#pragma mark - -#pragma mark Characteristics -+ (NSBundle *)bundle; -{ - static NSBundle *bundle = nil; - if (!bundle) bundle = [NSBundle bundleForClass:[PSMTabBarControl class]]; - return bundle; -} - -- (float)availableCellWidth -{ - float width = [self frame].size.width; - width = width - [style leftMarginForTabBarControl] - [style rightMarginForTabBarControl]; - return width; -} - -- (NSRect)genericCellRect -{ - NSRect aRect=[self frame]; - aRect.origin.x = [style leftMarginForTabBarControl]; - aRect.origin.y = 0.0; - aRect.size.width = [self availableCellWidth]; - aRect.size.height = kPSMTabBarControlHeight; - return aRect; -} - -#pragma mark - -#pragma mark Constructor/destructor - -- (void)initAddedProperties -{ - _cells = [[NSMutableArray alloc] initWithCapacity:10]; - - // default config - _allowsDragBetweenWindows = YES; - _delegateHandlingDrag = NO; - _canCloseOnlyTab = NO; - _showAddTabButton = NO; - _hideForSingleTab = NO; - _sizeCellsToFit = NO; - _isHidden = NO; - _hideIndicators = NO; - _awakenedFromNib = NO; - _cellMinWidth = 100; - _cellMaxWidth = 280; - _cellOptimumWidth = 130; - style = [[PSMMetalTabStyle alloc] init]; - - // the overflow button/menu - NSRect overflowButtonRect = NSMakeRect([self frame].size.width - [style rightMarginForTabBarControl] + 1, 0, [style rightMarginForTabBarControl] - 1, [self frame].size.height); - _overflowPopUpButton = [[PSMOverflowPopUpButton alloc] initWithFrame:overflowButtonRect pullsDown:YES]; - if(_overflowPopUpButton){ - // configure - [_overflowPopUpButton setAutoresizingMask:NSViewNotSizable|NSViewMinXMargin]; - } - - // new tab button - NSRect addTabButtonRect = NSMakeRect([self frame].size.width - [style rightMarginForTabBarControl] + 1, 3.0, 16.0, 16.0); - _addTabButton = [[PSMRolloverButton alloc] initWithFrame:addTabButtonRect]; - if(_addTabButton){ - NSImage *newButtonImage = [style addTabButtonImage]; - if(newButtonImage) - [_addTabButton setUsualImage:newButtonImage]; - newButtonImage = [style addTabButtonPressedImage]; - if(newButtonImage) - [_addTabButton setAlternateImage:newButtonImage]; - newButtonImage = [style addTabButtonRolloverImage]; - if(newButtonImage) - [_addTabButton setRolloverImage:newButtonImage]; - [_addTabButton setTitle:@""]; - [_addTabButton setImagePosition:NSImageOnly]; - [_addTabButton setButtonType:NSMomentaryChangeButton]; - [_addTabButton setBordered:NO]; - [_addTabButton setBezelStyle:NSShadowlessSquareBezelStyle]; - if(_showAddTabButton){ - [_addTabButton setHidden:NO]; - } else { - [_addTabButton setHidden:YES]; - } - [_addTabButton setNeedsDisplay:YES]; - } -} - -- (id)initWithFrame:(NSRect)frame -{ - self = [super initWithFrame:frame]; - if (self) { - // Initialization - [self initAddedProperties]; - [self registerForDraggedTypes:[NSArray arrayWithObjects: @"PSMTabBarControlItemPBType", nil]]; - } - [self setTarget:self]; - return self; -} - -- (void)dealloc -{ - [_overflowPopUpButton release]; - [_cells release]; - [tabView release]; - [_addTabButton release]; - [partnerView release]; - [_lastMouseDownEvent release]; - [style release]; - [delegate release]; - - [self unregisterDraggedTypes]; - - [super dealloc]; -} - -- (void)awakeFromNib -{ - // build cells from existing tab view items - NSArray *existingItems = [tabView tabViewItems]; - NSEnumerator *e = [existingItems objectEnumerator]; - NSTabViewItem *item; - while(item = [e nextObject]){ - if(![[self representedTabViewItems] containsObject:item]) - [self addTabViewItem:item]; - } - - // resize - [self setPostsFrameChangedNotifications:YES]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(frameDidChange:) name:NSViewFrameDidChangeNotification object:self]; - - // window status - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowStatusDidChange:) name:NSWindowDidBecomeKeyNotification object:[self window]]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowStatusDidChange:) name:NSWindowDidResignKeyNotification object:[self window]]; - [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(windowDidMove:) name:NSWindowDidMoveNotification object:[self window]]; -} - - -#pragma mark - -#pragma mark Accessors - -- (NSMutableArray *)cells -{ - return _cells; -} - -- (NSEvent *)lastMouseDownEvent -{ - return _lastMouseDownEvent; -} - -- (void)setLastMouseDownEvent:(NSEvent *)event -{ - [event retain]; - [_lastMouseDownEvent release]; - _lastMouseDownEvent = event; -} - -- (id)delegate -{ - return delegate; -} - -- (void)setDelegate:(id)object -{ - [object retain]; - [delegate release]; - delegate = object; -} - -- (NSTabView *)tabView -{ - return tabView; -} - -- (void)setTabView:(NSTabView *)view -{ - [view retain]; - [tabView release]; - tabView = view; -} - -- (id)psmTabStyle -{ - return style; -} - -- (NSString *)styleName -{ - return [style name]; -} - -- (void)setStyleNamed:(NSString *)name -{ - [style release]; - if([name isEqualToString:@"Unified"]){ - style = [[PSMUnifiedTabStyle alloc] init]; - } else if([name isEqualToString:@"Yosemite"]){ - style = [[PSMYosemiteTabStyle alloc] init]; -#if HAS_MOJAVE_TAB_STYLE - } else if([name isEqualToString:@"Mojave"]){ - style = [[PSMMojaveTabStyle alloc] init]; -#endif - } else { - style = [[PSMMetalTabStyle alloc] init]; - } - - // restyle add tab button - if(_addTabButton){ - if ([style respondsToSelector:@selector(styleAddTabButton:)]) { - [style performSelector:@selector(styleAddTabButton:) withObject:_addTabButton]; - } else { - NSImage *newButtonImage = [style addTabButtonImage]; - if(newButtonImage) - [_addTabButton setUsualImage:newButtonImage]; - newButtonImage = [style addTabButtonPressedImage]; - if(newButtonImage) - [_addTabButton setAlternateImage:newButtonImage]; - newButtonImage = [style addTabButtonRolloverImage]; - if(newButtonImage) - [_addTabButton setRolloverImage:newButtonImage]; - } - } - - [self update]; -} - -- (BOOL)canCloseOnlyTab -{ - return _canCloseOnlyTab; -} - -- (void)setCanCloseOnlyTab:(BOOL)value -{ - _canCloseOnlyTab = value; - if ([_cells count] == 1) { - [self update]; - } -} - -- (BOOL)allowsDragBetweenWindows -{ - return _allowsDragBetweenWindows; -} - -- (void)setAllowsDragBetweenWindows:(BOOL)flag -{ - _allowsDragBetweenWindows = flag; -} - -- (BOOL)hideForSingleTab -{ - return _hideForSingleTab; -} - -- (void)setHideForSingleTab:(BOOL)value -{ - _hideForSingleTab = value; - [self update]; -} - -- (BOOL)showAddTabButton -{ - return _showAddTabButton; -} - -- (void)setShowAddTabButton:(BOOL)value -{ - _showAddTabButton = value; - [self update]; -} - -- (int)cellMinWidth -{ - return _cellMinWidth; -} - -- (void)setCellMinWidth:(int)value -{ - _cellMinWidth = value; - [self update]; -} - -- (int)cellMaxWidth -{ - return _cellMaxWidth; -} - -- (void)setCellMaxWidth:(int)value -{ - _cellMaxWidth = value; - [self update]; -} - -- (int)cellOptimumWidth -{ - return _cellOptimumWidth; -} - -- (void)setCellOptimumWidth:(int)value -{ - _cellOptimumWidth = value; - [self update]; -} - -- (BOOL)sizeCellsToFit -{ - return _sizeCellsToFit; -} - -- (void)setSizeCellsToFit:(BOOL)value -{ - _sizeCellsToFit = value; - [self update]; -} - -- (PSMRolloverButton *)addTabButton -{ - return _addTabButton; -} - -- (PSMOverflowPopUpButton *)overflowPopUpButton -{ - return _overflowPopUpButton; -} - -#pragma mark - -#pragma mark Tool tips - -- (void)setToolTip:(NSString *)value forTabViewItem:(NSTabViewItem *)tvi -{ - int i, cellCount = [_cells count]; - for (i = 0; i < cellCount; i++) { - PSMTabBarCell *cell = [_cells objectAtIndex:i]; - if ([cell representedObject] == tvi) - [cell setToolTip:value]; - } - - [self update]; -} - - -#pragma mark - -#pragma mark Functionality -- (void)addTabViewItem:(NSTabViewItem *)item -{ - // create cell - PSMTabBarCell *cell = [[PSMTabBarCell alloc] initWithControlView:self]; - [cell setRepresentedObject:item]; - // bind the indicator to the represented object's status (if it exists) - [[cell indicator] setHidden:YES]; - if([item identifier] != nil){ - if([[item identifier] respondsToSelector:@selector(content)]){ - if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(isProcessing)]){ - NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary]; - [bindingOptions setObject:NSNegateBooleanTransformerName forKey:@"NSValueTransformerName"]; - [[cell indicator] bind:@"animate" toObject:[item identifier] withKeyPath:@"selection.isProcessing" options:nil]; - [[cell indicator] bind:@"hidden" toObject:[item identifier] withKeyPath:@"selection.isProcessing" options:bindingOptions]; - [[item identifier] addObserver:self forKeyPath:@"selection.isProcessing" options:0 context:nil]; - } - } - } - - // bind for the existence of an icon - [cell setHasIcon:NO]; - if([item identifier] != nil){ - if([[item identifier] respondsToSelector:@selector(content)]){ - if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(icon)]){ - NSMutableDictionary *bindingOptions = [NSMutableDictionary dictionary]; - [bindingOptions setObject:NSIsNotNilTransformerName forKey:@"NSValueTransformerName"]; - [cell bind:@"hasIcon" toObject:[item identifier] withKeyPath:@"selection.icon" options:bindingOptions]; - [[item identifier] addObserver:self forKeyPath:@"selection.icon" options:0 context:nil]; - } - } - } - - // bind for the existence of a counter - [cell setCount:0]; - if([item identifier] != nil){ - if([[item identifier] respondsToSelector:@selector(content)]){ - if([[[[cell representedObject] identifier] performSelector:@selector(content)] respondsToSelector:@selector(objectCount)]){ - [cell bind:@"count" toObject:[item identifier] withKeyPath:@"selection.objectCount" options:nil]; - [[item identifier] addObserver:self forKeyPath:@"selection.objectCount" options:0 context:nil]; - } - } - } - - // bind my string value to the label on the represented tab - [cell bind:@"title" toObject:item withKeyPath:@"label" options:nil]; - - // add to collection - [_cells addObject:cell]; - [cell release]; - if([_cells count] == [tabView numberOfTabViewItems]){ - [self update]; // don't update unless all are accounted for! - } -} - -- (void)removeTabForCell:(PSMTabBarCell *)cell -{ - // unbind - [[cell indicator] unbind:@"animate"]; - [[cell indicator] unbind:@"hidden"]; - [cell unbind:@"hasIcon"]; - [cell unbind:@"title"]; - [cell unbind:@"count"]; - - // remove indicator - if([[self subviews] containsObject:[cell indicator]]){ - [[cell indicator] removeFromSuperview]; - } - // remove tracking - [[NSNotificationCenter defaultCenter] removeObserver:cell]; - if([cell closeButtonTrackingTag] != 0){ - [self removeTrackingRect:[cell closeButtonTrackingTag]]; - } - if([cell cellTrackingTag] != 0){ - [self removeTrackingRect:[cell cellTrackingTag]]; - } - - // pull from collection - [_cells removeObject:cell]; - - [self update]; -} - -- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context -{ - // the progress indicator, label, icon, or count has changed - must redraw - [self update]; -} - -#pragma mark - -#pragma mark Hide/Show - -- (void)hideTabBar:(BOOL)hide animate:(BOOL)animate -{ - if(!_awakenedFromNib) - return; - if(_isHidden && hide) - return; - if(!_isHidden && !hide) - return; - - [[self subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)]; - _hideIndicators = YES; - - NSTimer *animationTimer; - _isHidden = hide; - _currentStep = 0; - if(!animate) - _currentStep = (int)kPSMHideAnimationSteps; - - float partnerOriginalHeight, partnerOriginalY, myOriginalHeight, myOriginalY, partnerTargetHeight, partnerTargetY, myTargetHeight, myTargetY; - - // current (original) values - myOriginalHeight = [self frame].size.height; - myOriginalY = [self frame].origin.y; - if(partnerView){ - partnerOriginalHeight = [partnerView frame].size.height; - partnerOriginalY = [partnerView frame].origin.y; - } else { - partnerOriginalHeight = [[self window] frame].size.height; - partnerOriginalY = [[self window] frame].origin.y; - } - - // target values for partner - if(partnerView){ - // above or below me? - if((myOriginalY - 22) > partnerOriginalY){ - // partner is below me - if(_isHidden){ - // I'm shrinking - myTargetY = myOriginalY + 21; - myTargetHeight = myOriginalHeight - 21; - partnerTargetY = partnerOriginalY; - partnerTargetHeight = partnerOriginalHeight + 21; - } else { - // I'm growing - myTargetY = myOriginalY - 21; - myTargetHeight = myOriginalHeight + 21; - partnerTargetY = partnerOriginalY; - partnerTargetHeight = partnerOriginalHeight - 21; - } - } else { - // partner is above me - if(_isHidden){ - // I'm shrinking - myTargetY = myOriginalY; - myTargetHeight = myOriginalHeight - 21; - partnerTargetY = partnerOriginalY - 21; - partnerTargetHeight = partnerOriginalHeight + 21; - } else { - // I'm growing - myTargetY = myOriginalY; - myTargetHeight = myOriginalHeight + 21; - partnerTargetY = partnerOriginalY + 21; - partnerTargetHeight = partnerOriginalHeight - 21; - } - } - } else { - // for window movement - if(_isHidden){ - // I'm shrinking - myTargetY = myOriginalY; - myTargetHeight = myOriginalHeight - 21; - partnerTargetY = partnerOriginalY + 21; - partnerTargetHeight = partnerOriginalHeight - 21; - } else { - // I'm growing - myTargetY = myOriginalY; - myTargetHeight = myOriginalHeight + 21; - partnerTargetY = partnerOriginalY - 21; - partnerTargetHeight = partnerOriginalHeight + 21; - } - } - - NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithFloat:myOriginalY], @"myOriginalY", [NSNumber numberWithFloat:partnerOriginalY], @"partnerOriginalY", [NSNumber numberWithFloat:myOriginalHeight], @"myOriginalHeight", [NSNumber numberWithFloat:partnerOriginalHeight], @"partnerOriginalHeight", [NSNumber numberWithFloat:myTargetY], @"myTargetY", [NSNumber numberWithFloat:partnerTargetY], @"partnerTargetY", [NSNumber numberWithFloat:myTargetHeight], @"myTargetHeight", [NSNumber numberWithFloat:partnerTargetHeight], @"partnerTargetHeight", nil]; - animationTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0/20.0) target:self selector:@selector(animateShowHide:) userInfo:userInfo repeats:YES]; -} - -- (void)animateShowHide:(NSTimer *)timer -{ - // moves the frame of the tab bar and window (or partner view) linearly to hide or show the tab bar - NSRect myFrame = [self frame]; - float myCurrentY = ([[[timer userInfo] objectForKey:@"myOriginalY"] floatValue] + (([[[timer userInfo] objectForKey:@"myTargetY"] floatValue] - [[[timer userInfo] objectForKey:@"myOriginalY"] floatValue]) * (_currentStep/kPSMHideAnimationSteps))); - float myCurrentHeight = ([[[timer userInfo] objectForKey:@"myOriginalHeight"] floatValue] + (([[[timer userInfo] objectForKey:@"myTargetHeight"] floatValue] - [[[timer userInfo] objectForKey:@"myOriginalHeight"] floatValue]) * (_currentStep/kPSMHideAnimationSteps))); - float partnerCurrentY = ([[[timer userInfo] objectForKey:@"partnerOriginalY"] floatValue] + (([[[timer userInfo] objectForKey:@"partnerTargetY"] floatValue] - [[[timer userInfo] objectForKey:@"partnerOriginalY"] floatValue]) * (_currentStep/kPSMHideAnimationSteps))); - float partnerCurrentHeight = ([[[timer userInfo] objectForKey:@"partnerOriginalHeight"] floatValue] + (([[[timer userInfo] objectForKey:@"partnerTargetHeight"] floatValue] - [[[timer userInfo] objectForKey:@"partnerOriginalHeight"] floatValue]) * (_currentStep/kPSMHideAnimationSteps))); - - NSRect myNewFrame = NSMakeRect(myFrame.origin.x, myCurrentY, myFrame.size.width, myCurrentHeight); - - if(partnerView){ - // resize self and view - [partnerView setFrame:NSMakeRect([partnerView frame].origin.x, partnerCurrentY, [partnerView frame].size.width, partnerCurrentHeight)]; - [partnerView setNeedsDisplay:YES]; - [self setFrame:myNewFrame]; - } else { - // resize self and window - [[self window] setFrame:NSMakeRect([[self window] frame].origin.x, partnerCurrentY, [[self window] frame].size.width, partnerCurrentHeight) display:YES]; - [self setFrame:myNewFrame]; - } - - // next - _currentStep++; - if(_currentStep == kPSMHideAnimationSteps + 1){ - [timer invalidate]; - [self viewDidEndLiveResize]; - _hideIndicators = NO; - [self update]; - } - [[self window] display]; -} - -- (id)partnerView -{ - return partnerView; -} - -- (void)setPartnerView:(id)view -{ - [partnerView release]; - [view retain]; - partnerView = view; -} - -#pragma mark - -#pragma mark Drawing - -- (BOOL)isFlipped -{ - return YES; -} - -- (void)drawRect:(NSRect)rect -{ - [style drawTabBar:self inRect:rect]; -} - -- (void)update -{ - // abandon hope, all ye who enter here :-) - // this method handles all of the cell layout, and is called when something changes to require the refresh. This method is not called during drag and drop; see the PSMTabDragAssistant's calculateDragAnimationForTabBar: method, which does layout in that case. - - // make sure all of our tabs are accounted for before updating - if ([tabView numberOfTabViewItems] != [_cells count]) { - return; - } - - // hide/show? (these return if already in desired state) - if((_hideForSingleTab) && ([_cells count] <= 1)){ - [self hideTabBar:YES animate:YES]; - } else { - [self hideTabBar:NO animate:YES]; - } - - // size all cells appropriately and create tracking rects - // nuke old tracking rects - int i, cellCount = [_cells count]; - for(i = 0; i < cellCount; i++){ - id cell = [_cells objectAtIndex:i]; - [[NSNotificationCenter defaultCenter] removeObserver:cell]; - if([cell closeButtonTrackingTag] != 0){ - [self removeTrackingRect:[cell closeButtonTrackingTag]]; - } - if([cell cellTrackingTag] != 0){ - [self removeTrackingRect:[cell cellTrackingTag]]; - } - } - - // nuke old tool tips - [self removeAllToolTips]; - - // calculate number of cells to fit in control and cell widths - float availableWidth = [self availableCellWidth]; - NSMutableArray *newWidths = [NSMutableArray arrayWithCapacity:cellCount]; - int numberOfVisibleCells = 1; - float totalOccupiedWidth = 0.0; - NSMenu *overflowMenu = nil; - for(i = 0; i < cellCount; i++){ - PSMTabBarCell *cell = [_cells objectAtIndex:i]; - float width; - - // supress close button? - if (cellCount == 1 && [self canCloseOnlyTab] == NO) { - [cell setCloseButtonSuppressed:YES]; - } else { - [cell setCloseButtonSuppressed:NO]; - } - - // Determine cell width - if(_sizeCellsToFit){ - width = [cell desiredWidthOfCell]; - if (width > _cellMaxWidth) { - width = _cellMaxWidth; - } - } else { - width = _cellOptimumWidth; - } - - // too much? - totalOccupiedWidth += width; - if (totalOccupiedWidth >= availableWidth) { - numberOfVisibleCells = i; - if(_sizeCellsToFit){ - int neededWidth = width - (totalOccupiedWidth - availableWidth); - // can I squeeze it in without violating min cell width? - int widthIfAllMin = (numberOfVisibleCells + 1) * _cellMinWidth; - - if ((width + widthIfAllMin) <= availableWidth) { - // squeeze - distribute needed sacrifice among all cells - int q; - for(q = (i - 1); q >= 0; q--){ - int desiredReduction = (int)neededWidth/(q+1); - if(([[newWidths objectAtIndex:q] floatValue] - desiredReduction) < _cellMinWidth){ - int actualReduction = (int)[[newWidths objectAtIndex:q] floatValue] - _cellMinWidth; - [newWidths replaceObjectAtIndex:q withObject:[NSNumber numberWithFloat:_cellMinWidth]]; - neededWidth -= actualReduction; - } else { - int newCellWidth = (int)[[newWidths objectAtIndex:q] floatValue] - desiredReduction; - [newWidths replaceObjectAtIndex:q withObject:[NSNumber numberWithFloat:newCellWidth]]; - neededWidth -= desiredReduction; - } - } - // one cell left! - int thisWidth = width - neededWidth; - [newWidths addObject:[NSNumber numberWithFloat:thisWidth]]; - numberOfVisibleCells++; - } else { - // stretch - distribute leftover room among cells - int leftoverWidth = availableWidth - totalOccupiedWidth + width; - int q; - for(q = (i - 1); q >= 0; q--){ - int desiredAddition = (int)leftoverWidth/(q+1); - int newCellWidth = (int)[[newWidths objectAtIndex:q] floatValue] + desiredAddition; - [newWidths replaceObjectAtIndex:q withObject:[NSNumber numberWithFloat:newCellWidth]]; - leftoverWidth -= desiredAddition; - } - } - break; // done assigning widths; remaining cells go in overflow menu - } else { - int revisedWidth = availableWidth/(i + 1); - if(revisedWidth >= _cellMinWidth){ - int q; - totalOccupiedWidth = 0; - for(q = 0; q < [newWidths count]; q++){ - [newWidths replaceObjectAtIndex:q withObject:[NSNumber numberWithFloat:revisedWidth]]; - totalOccupiedWidth += revisedWidth; - } - // just squeezed this one in... - [newWidths addObject:[NSNumber numberWithFloat:revisedWidth]]; - totalOccupiedWidth += revisedWidth; - numberOfVisibleCells++; - } else { - // couldn't fit that last one... - break; - } - } - } else { - numberOfVisibleCells = cellCount; - [newWidths addObject:[NSNumber numberWithFloat:width]]; - } - } - - // Set up cells with frames and rects - NSRect cellRect = [self genericCellRect]; - for(i = 0; i < cellCount; i++){ - PSMTabBarCell *cell = [_cells objectAtIndex:i]; - NSTabViewItem *tvi = [cell representedObject]; - int tabState = 0; - if (i < numberOfVisibleCells) { - // set cell frame - cellRect.size.width = [[newWidths objectAtIndex:i] floatValue]; - [cell setFrame:cellRect]; - NSTrackingRectTag tag; - - // close button tracking rect - if ([cell hasCloseButton]) { - tag = [self addTrackingRect:[cell closeButtonRectForFrame:cellRect] owner:cell userData:nil assumeInside:NO]; - [cell setCloseButtonTrackingTag:tag]; - } - - // entire tab tracking rect - tag = [self addTrackingRect:cellRect owner:cell userData:nil assumeInside:NO]; - [cell setCellTrackingTag:tag]; - [cell setEnabled:YES]; - - // add tool tip - NSString *tt = [cell toolTip]; - if (tt && [tt length] > 0) - [self addToolTipRect:cellRect owner:tt userData:NULL]; - - // selected? set tab states... - if([tvi isEqualTo:[tabView selectedTabViewItem]]){ - [cell setState:NSOnState]; - tabState |= PSMTab_SelectedMask; - // previous cell - if(i > 0){ - [[_cells objectAtIndex:i-1] setTabState:([(PSMTabBarCell *)[_cells objectAtIndex:i-1] tabState] | PSMTab_RightIsSelectedMask)]; - } - // next cell - see below - } else { - [cell setState:NSOffState]; - // see if prev cell was selected - if(i > 0){ - if([[_cells objectAtIndex:i-1] state] == NSOnState){ - tabState |= PSMTab_LeftIsSelectedMask; - } - } - } - // more tab states - if(cellCount == 1){ - tabState |= PSMTab_PositionLeftMask | PSMTab_PositionRightMask | PSMTab_PositionSingleMask; - } else if(i == 0){ - tabState |= PSMTab_PositionLeftMask; - } else if(i-1 == cellCount){ - tabState |= PSMTab_PositionRightMask; - } - [cell setTabState:tabState]; - [cell setIsInOverflowMenu:NO]; - - // indicator - if(![[cell indicator] isHidden] && !_hideIndicators){ - [[cell indicator] setFrame:[cell indicatorRectForFrame:cellRect]]; - if(![[self subviews] containsObject:[cell indicator]]){ - [self addSubview:[cell indicator]]; - [[cell indicator] startAnimation:self]; - } - } - - // next... - cellRect.origin.x += [[newWidths objectAtIndex:i] floatValue]; - - } else { - // set up menu items - NSMenuItem *menuItem; - if(overflowMenu == nil){ - overflowMenu = [[[NSMenu alloc] initWithTitle:@"TITLE"] autorelease]; - [overflowMenu insertItemWithTitle:@"FIRST" action:nil keyEquivalent:@"" atIndex:0]; // Because the overflowPupUpButton is a pull down menu - } - menuItem = [[[NSMenuItem alloc] initWithTitle:[[cell attributedStringValue] string] action:@selector(overflowMenuAction:) keyEquivalent:@""] autorelease]; - [menuItem setTarget:self]; - [menuItem setRepresentedObject:tvi]; - [cell setIsInOverflowMenu:YES]; - [[cell indicator] removeFromSuperview]; - if ([tvi isEqualTo:[tabView selectedTabViewItem]]) - [menuItem setState:NSOnState]; - if([cell hasIcon]) - [menuItem setImage:[[[tvi identifier] content] icon]]; - if([cell count] > 0) - [menuItem setTitle:[[menuItem title] stringByAppendingFormat:@" (%d)",[cell count]]]; - [overflowMenu addItem:menuItem]; - } - } - - - // Overflow menu - cellRect.origin.y = 0; - cellRect.size.height = kPSMTabBarControlHeight; - cellRect.size.width = [style rightMarginForTabBarControl]; - if (overflowMenu) { - cellRect.origin.x = [self frame].size.width - [style rightMarginForTabBarControl] + 1; - if(![[self subviews] containsObject:_overflowPopUpButton]){ - [self addSubview:_overflowPopUpButton]; - } - [_overflowPopUpButton setFrame:cellRect]; - [_overflowPopUpButton setMenu:overflowMenu]; - if ([_overflowPopUpButton isHidden]) [_overflowPopUpButton setHidden:NO]; - } else { - if (![_overflowPopUpButton isHidden]) [_overflowPopUpButton setHidden:YES]; - } - - // add tab button - if(!overflowMenu && _showAddTabButton){ - if(![[self subviews] containsObject:_addTabButton]) - [self addSubview:_addTabButton]; - if([_addTabButton isHidden] && _showAddTabButton) - [_addTabButton setHidden:NO]; - cellRect.size = [_addTabButton frame].size; - cellRect.origin.y = MARGIN_Y; - cellRect.origin.x += 2; - [_addTabButton setImage:[style addTabButtonImage]]; - [_addTabButton setFrame:cellRect]; - [_addTabButton setNeedsDisplay:YES]; - } else { - [_addTabButton setHidden:YES]; - [_addTabButton setNeedsDisplay:YES]; - } - - [self setNeedsDisplay:YES]; -} - -#pragma mark - -#pragma mark Mouse Tracking - -- (BOOL)mouseDownCanMoveWindow -{ - return NO; -} - -- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent -{ - return YES; -} - -- (void)mouseDown:(NSEvent *)theEvent -{ - // keep for dragging - [self setLastMouseDownEvent:theEvent]; - // what cell? - NSPoint mousePt = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - NSRect cellFrame; - PSMTabBarCell *cell = [self cellForPoint:mousePt cellFrame:&cellFrame]; - if(cell){ -#if 0 - NSRect iconRect = [cell closeButtonRectForFrame:cellFrame]; - if(NSMouseInRect(mousePt, iconRect,[self isFlipped])){ - [cell setCloseButtonPressed:YES]; - } else { - [cell setCloseButtonPressed:NO]; - } - [self setNeedsDisplay:YES]; -#else - // HACK! Let the tabs react on the mouse down instead of mouse up - NSRect iconRect = [cell closeButtonRectForFrame:cellFrame]; - if((NSMouseInRect(mousePt, iconRect,[self isFlipped]))){ - //[self performSelector:@selector(closeTabClick:) withObject:cell]; - [self closeTabClick:cell]; - } else if(NSMouseInRect(mousePt, cellFrame,[self isFlipped])){ - //[self performSelector:@selector(tabClick:) withObject:cell]; - [self tabClick:cell]; - } else { - //[self performSelector:@selector(tabNothing:) withObject:cell]; - [self tabNothing:cell]; - } -#endif - } -} - -- (void)mouseDragged:(NSEvent *)theEvent -{ - if([self lastMouseDownEvent] == nil){ - return; - } - - if ([_cells count] < 2) { - return; - } - - NSRect cellFrame; - NSPoint trackingStartPoint = [self convertPoint:[[self lastMouseDownEvent] locationInWindow] fromView:nil]; - PSMTabBarCell *cell = [self cellForPoint:trackingStartPoint cellFrame:&cellFrame]; - if (!cell) - return; - - NSPoint currentPoint = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - float dx = fabs(currentPoint.x - trackingStartPoint.x); - float dy = fabs(currentPoint.y - trackingStartPoint.y); - float distance = sqrt(dx * dx + dy * dy); - if (distance < 10) - return; - - if(![[PSMTabDragAssistant sharedDragAssistant] isDragging]) { - [[PSMTabDragAssistant sharedDragAssistant] startDraggingCell:cell fromTabBar:self withMouseDownEvent:[self lastMouseDownEvent]]; - } -} - -- (void)mouseUp:(NSEvent *)theEvent -{ -#if 0 // HACK! Tabs react on mouse down instead of mouse up - // what cell? - NSPoint mousePt = [self convertPoint:[theEvent locationInWindow] fromView:nil]; - NSRect cellFrame, mouseDownCellFrame; - PSMTabBarCell *cell = [self cellForPoint:mousePt cellFrame:&cellFrame]; - PSMTabBarCell *mouseDownCell = [self cellForPoint:[self convertPoint:[[self lastMouseDownEvent] locationInWindow] fromView:nil] cellFrame:&mouseDownCellFrame]; - if(cell){ - NSRect iconRect = [mouseDownCell closeButtonRectForFrame:mouseDownCellFrame]; - if((NSMouseInRect(mousePt, iconRect,[self isFlipped])) && [mouseDownCell closeButtonPressed]){ - [self performSelector:@selector(closeTabClick:) withObject:cell]; - } else if(NSMouseInRect(mousePt, mouseDownCellFrame,[self isFlipped])){ - [mouseDownCell setCloseButtonPressed:NO]; - [self performSelector:@selector(tabClick:) withObject:cell]; - } else { - [mouseDownCell setCloseButtonPressed:NO]; - [self performSelector:@selector(tabNothing:) withObject:cell]; - } - } -#endif -} - -#pragma mark - -#pragma mark Drag and Drop - -- (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent *)theEvent -{ - return YES; -} - -// NSDraggingSource -- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal -{ - return (isLocal ? NSDragOperationMove : NSDragOperationNone); -} - -- (BOOL)ignoreModifierKeysWhileDragging -{ - return YES; -} - -- (void)draggedImage:(NSImage *)anImage endedAt:(NSPoint)aPoint operation:(NSDragOperation)operation -{ - [[PSMTabDragAssistant sharedDragAssistant] draggedImageEndedAt:aPoint operation:operation]; -} - -// NSDraggingDestination -- (NSDragOperation)draggingEntered:(id )sender -{ - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - _delegateHandlingDrag = NO; - if([[[sender draggingPasteboard] types] indexOfObject:@"PSMTabBarControlItemPBType"] != NSNotFound) { - - if ([sender draggingSource] != self && ![self allowsDragBetweenWindows]) - return NSDragOperationNone; - - [[PSMTabDragAssistant sharedDragAssistant] draggingEnteredTabBar:self atPoint:point]; - return NSDragOperationMove; - } else if (delegate && [delegate respondsToSelector:@selector(tabBarControl:draggingEntered:forTabAtIndex:)]) { - NSDragOperation op = [delegate tabBarControl:self draggingEntered:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - _delegateHandlingDrag = (op != NSDragOperationNone); - _delegateInitialDragOperation = op; - return op; - } - - return NSDragOperationNone; -} - -- (NSDragOperation)draggingUpdated:(id )sender -{ - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - if ([[[sender draggingPasteboard] types] indexOfObject:@"PSMTabBarControlItemPBType"] != NSNotFound) { - - if ([sender draggingSource] != self && ![self allowsDragBetweenWindows]) - return NSDragOperationNone; - - [[PSMTabDragAssistant sharedDragAssistant] draggingUpdatedInTabBar:self atPoint:point]; - return NSDragOperationMove; - } else if (_delegateHandlingDrag) { - if ([delegate respondsToSelector:@selector(tabBarControl:draggingUpdated:forTabAtIndex:)]) - return [delegate tabBarControl:self draggingUpdated:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - else - return _delegateInitialDragOperation; - } - - return NSDragOperationNone; -} - -- (void)draggingExited:(id )sender -{ - if (!_delegateHandlingDrag) { - [[PSMTabDragAssistant sharedDragAssistant] draggingExitedTabBar:self]; - } else if ([delegate respondsToSelector:@selector(tabBarControl:draggingExited:forTabAtIndex:)]) { - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - [delegate tabBarControl:self draggingExited:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - } -} - -- (BOOL)prepareForDragOperation:(id )sender -{ - if (_delegateHandlingDrag && [delegate respondsToSelector:@selector(tabBarControl:prepareForDragOperation:forTabAtIndex:)]) { - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - return [delegate tabBarControl:self prepareForDragOperation:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - } - - return YES; -} - -- (BOOL)performDragOperation:(id )sender -{ - if (!_delegateHandlingDrag) { -#if 1 - // HACK! Used below. - NSTabViewItem *tvi = [[[PSMTabDragAssistant sharedDragAssistant] draggedCell] representedObject]; -#endif - - [[PSMTabDragAssistant sharedDragAssistant] performDragOperation]; - -#if 1 - // HACK! Notify the delegate that a tab was dragged to a new position. - if (delegate && [delegate respondsToSelector:@selector(tabView:didDragTabViewItem:toIndex:)]) { - NSUInteger idx = [[self representedTabViewItems] indexOfObject:tvi]; - if (NSNotFound != idx) { - [delegate tabView:[self tabView] didDragTabViewItem:tvi toIndex:idx]; - } - } -#endif - } else { - if ([delegate respondsToSelector:@selector(tabBarControl:performDragOperation:forTabAtIndex:)]) { - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - return [delegate tabBarControl:self performDragOperation:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - } else { - return NO; - } - } - - return YES; -} - -- (void)concludeDragOperation:(id )sender -{ - if (_delegateHandlingDrag && [delegate respondsToSelector:@selector(tabBarControl:concludeDragOperation:forTabAtIndex:)]) { - NSPoint point = [self convertPoint:[sender draggingLocation] fromView:nil]; - [delegate tabBarControl:self concludeDragOperation:sender forTabAtIndex:[self indexOfCellAtPoint:point]]; - } -} - -#pragma mark - -#pragma mark Actions - -- (void)overflowMenuAction:(id)sender -{ - [tabView selectTabViewItem:[sender representedObject]]; - [self update]; -} - -- (void)closeTabClick:(id)sender -{ - [sender retain]; - if(([_cells count] == 1) && (![self canCloseOnlyTab])) - return; - - if(([self delegate]) && ([[self delegate] respondsToSelector:@selector(tabView:shouldCloseTabViewItem:)])){ - if(![[self delegate] tabView:tabView shouldCloseTabViewItem:[sender representedObject]]){ - // fix mouse downed close button - [sender setCloseButtonPressed:NO]; - return; - } - } - - if(([self delegate]) && ([[self delegate] respondsToSelector:@selector(tabView:willCloseTabViewItem:)])){ - [[self delegate] tabView:tabView willCloseTabViewItem:[sender representedObject]]; - } - - [[sender representedObject] retain]; - [tabView removeTabViewItem:[sender representedObject]]; - - if(([self delegate]) && ([[self delegate] respondsToSelector:@selector(tabView:didCloseTabViewItem:)])){ - [[self delegate] tabView:tabView didCloseTabViewItem:[sender representedObject]]; - } - [[sender representedObject] release]; - [sender release]; -} - -- (void)tabClick:(id)sender -{ - [tabView selectTabViewItem:[sender representedObject]]; - [self update]; -} - -- (void)tabNothing:(id)sender -{ - [self update]; // takes care of highlighting based on state -} - -- (void)frameDidChange:(NSNotification *)notification -{ - [self update]; - // trying to address the drawing artifacts for the progress indicators - hackery follows - // this one fixes the "blanking" effect when the control hides and shows itself - NSEnumerator *e = [_cells objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - [[cell indicator] stopAnimation:self]; - [[cell indicator] startAnimation:self]; - } - [self setNeedsDisplay:YES]; -} - -- (void)viewWillStartLiveResize -{ - NSEnumerator *e = [_cells objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - [[cell indicator] stopAnimation:self]; - } - [self setNeedsDisplay:YES]; -} - --(void)viewDidEndLiveResize -{ - NSEnumerator *e = [_cells objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - [[cell indicator] startAnimation:self]; - } - [self setNeedsDisplay:YES]; -} - -- (void)windowDidMove:(NSNotification *)aNotification -{ - [self setNeedsDisplay:YES]; -} - -- (void)windowStatusDidChange:(NSNotification *)notification -{ - // hide? must readjust things if I'm not supposed to be showing - // this block of code only runs when the app launches - if(_hideForSingleTab && ([_cells count] <= 1) && !_awakenedFromNib){ - // must adjust frames now before display - NSRect myFrame = [self frame]; - if(partnerView){ - NSRect partnerFrame = [partnerView frame]; - // above or below me? - if(([self frame].origin.y - 22) > [partnerView frame].origin.y){ - // partner is below me - [self setFrame:NSMakeRect(myFrame.origin.x, myFrame.origin.y + 21, myFrame.size.width, myFrame.size.height - 21)]; - [partnerView setFrame:NSMakeRect(partnerFrame.origin.x, partnerFrame.origin.y, partnerFrame.size.width, partnerFrame.size.height + 21)]; - } else { - // partner is above me - [self setFrame:NSMakeRect(myFrame.origin.x, myFrame.origin.y, myFrame.size.width, myFrame.size.height - 21)]; - [partnerView setFrame:NSMakeRect(partnerFrame.origin.x, partnerFrame.origin.y - 21, partnerFrame.size.width, partnerFrame.size.height + 21)]; - } - [partnerView setNeedsDisplay:YES]; - [self setNeedsDisplay:YES]; - } else { - // for window movement - NSRect windowFrame = [[self window] frame]; - [[self window] setFrame:NSMakeRect(windowFrame.origin.x, windowFrame.origin.y + 21, windowFrame.size.width, windowFrame.size.height - 21) display:YES]; - [self setFrame:NSMakeRect(myFrame.origin.x, myFrame.origin.y, myFrame.size.width, myFrame.size.height - 21)]; - } - _isHidden = YES; - [self setNeedsDisplay:YES]; - //[[self window] display]; - } - _awakenedFromNib = YES; - [self update]; -} - -#pragma mark - -#pragma mark NSTabView Delegate - -- (void)tabView:(NSTabView *)aTabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem -{ - // here's a weird one - this message is sent before the "tabViewDidChangeNumberOfTabViewItems" - // message, thus I can end up updating when there are no cells, if no tabs were (yet) present - if([_cells count] > 0){ - [self update]; - } - if([self delegate]){ - if([[self delegate] respondsToSelector:@selector(tabView:didSelectTabViewItem:)]){ - [[self delegate] performSelector:@selector(tabView:didSelectTabViewItem:) withObject:aTabView withObject:tabViewItem]; - } - } -} - -- (BOOL)tabView:(NSTabView *)aTabView shouldSelectTabViewItem:(NSTabViewItem *)tabViewItem -{ - if([self delegate]){ - if([[self delegate] respondsToSelector:@selector(tabView:shouldSelectTabViewItem:)]){ - // This is an ugly hack. tabView:shouldSelectTabViewItem: returns - // a BOOL and performSelector: assumes that it returns an id. - return nil != [[self delegate] performSelector:@selector(tabView:shouldSelectTabViewItem:) withObject:aTabView withObject:tabViewItem]; - } else { - return YES; - } - } else { - return YES; - } -} -- (void)tabView:(NSTabView *)aTabView willSelectTabViewItem:(NSTabViewItem *)tabViewItem -{ - if([self delegate]){ - if([[self delegate] respondsToSelector:@selector(tabView:willSelectTabViewItem:)]){ - [[self delegate] performSelector:@selector(tabView:willSelectTabViewItem:) withObject:aTabView withObject:tabViewItem]; - } - } -} - -- (void)tabViewDidChangeNumberOfTabViewItems:(NSTabView *)aTabView -{ - NSArray *tabItems = [tabView tabViewItems]; - // go through cells, remove any whose representedObjects are not in [tabView tabViewItems] - NSEnumerator *e = [_cells objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - if(![tabItems containsObject:[cell representedObject]]){ - [self removeTabForCell:cell]; - } - } - - // go through tab view items, add cell for any not present - NSMutableArray *cellItems = [self representedTabViewItems]; - NSEnumerator *ex = [tabItems objectEnumerator]; - NSTabViewItem *item; - while(item = [ex nextObject]){ - if(![cellItems containsObject:item]){ - [self addTabViewItem:item]; - } - } - -#if 0 - // HACK! Make sure '_cells' is ordered the same as 'tabItems'. - NSMutableArray *temp = [[NSMutableArray alloc] initWithArray:_cells]; - e = [_cells objectEnumerator]; - int count = [temp count]; - while ((cell = [e nextObject])) { - int idx = [tabItems indexOfObject:[cell representedObject]]; - if (NSNotFound != idx && idx < count) { - [temp replaceObjectAtIndex:idx withObject:cell]; - } - } - - [_cells release]; - _cells = temp; - - if ([_cells count] == [tabView numberOfTabViewItems]) { - [self update]; // don't update unless all are accounted for! - } -#endif - - // pass along for other delegate responses - if([self delegate]){ - if([[self delegate] respondsToSelector:@selector(tabViewDidChangeNumberOfTabViewItems:)]){ - [[self delegate] performSelector:@selector(tabViewDidChangeNumberOfTabViewItems:) withObject:aTabView]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - [super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:_cells forKey:@"PSMcells"]; - [aCoder encodeObject:tabView forKey:@"PSMtabView"]; - [aCoder encodeObject:_overflowPopUpButton forKey:@"PSMoverflowPopUpButton"]; - [aCoder encodeObject:_addTabButton forKey:@"PSMaddTabButton"]; - [aCoder encodeObject:style forKey:@"PSMstyle"]; - [aCoder encodeBool:_canCloseOnlyTab forKey:@"PSMcanCloseOnlyTab"]; - [aCoder encodeBool:_hideForSingleTab forKey:@"PSMhideForSingleTab"]; - [aCoder encodeBool:_showAddTabButton forKey:@"PSMshowAddTabButton"]; - [aCoder encodeBool:_sizeCellsToFit forKey:@"PSMsizeCellsToFit"]; - [aCoder encodeInt:_cellMinWidth forKey:@"PSMcellMinWidth"]; - [aCoder encodeInt:_cellMaxWidth forKey:@"PSMcellMaxWidth"]; - [aCoder encodeInt:_cellOptimumWidth forKey:@"PSMcellOptimumWidth"]; - [aCoder encodeInt:_currentStep forKey:@"PSMcurrentStep"]; - [aCoder encodeBool:_isHidden forKey:@"PSMisHidden"]; - [aCoder encodeBool:_hideIndicators forKey:@"PSMhideIndicators"]; - [aCoder encodeObject:partnerView forKey:@"PSMpartnerView"]; - [aCoder encodeBool:_awakenedFromNib forKey:@"PSMawakenedFromNib"]; - [aCoder encodeObject:_lastMouseDownEvent forKey:@"PSMlastMouseDownEvent"]; - [aCoder encodeObject:delegate forKey:@"PSMdelegate"]; - - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - self = [super initWithCoder:aDecoder]; - if (self) { - if ([aDecoder allowsKeyedCoding]) { - _cells = [[aDecoder decodeObjectForKey:@"PSMcells"] retain]; - tabView = [[aDecoder decodeObjectForKey:@"PSMtabView"] retain]; - _overflowPopUpButton = [[aDecoder decodeObjectForKey:@"PSMoverflowPopUpButton"] retain]; - _addTabButton = [[aDecoder decodeObjectForKey:@"PSMaddTabButton"] retain]; - style = [[aDecoder decodeObjectForKey:@"PSMstyle"] retain]; - _canCloseOnlyTab = [aDecoder decodeBoolForKey:@"PSMcanCloseOnlyTab"]; - _hideForSingleTab = [aDecoder decodeBoolForKey:@"PSMhideForSingleTab"]; - _showAddTabButton = [aDecoder decodeBoolForKey:@"PSMshowAddTabButton"]; - _sizeCellsToFit = [aDecoder decodeBoolForKey:@"PSMsizeCellsToFit"]; - _cellMinWidth = [aDecoder decodeIntForKey:@"PSMcellMinWidth"]; - _cellMaxWidth = [aDecoder decodeIntForKey:@"PSMcellMaxWidth"]; - _cellOptimumWidth = [aDecoder decodeIntForKey:@"PSMcellOptimumWidth"]; - _currentStep = [aDecoder decodeIntForKey:@"PSMcurrentStep"]; - _isHidden = [aDecoder decodeBoolForKey:@"PSMisHidden"]; - _hideIndicators = [aDecoder decodeBoolForKey:@"PSMhideIndicators"]; - partnerView = [[aDecoder decodeObjectForKey:@"PSMpartnerView"] retain]; - _awakenedFromNib = [aDecoder decodeBoolForKey:@"PSMawakenedFromNib"]; - _lastMouseDownEvent = [[aDecoder decodeObjectForKey:@"PSMlastMouseDownEvent"] retain]; - delegate = [[aDecoder decodeObjectForKey:@"PSMdelegate"] retain]; - } - } - return self; -} - -#pragma mark - -#pragma mark IB Palette - -- (NSSize)minimumFrameSizeFromKnobPosition:(int)position -{ - return NSMakeSize(100.0, 22.0); -} - -- (NSSize)maximumFrameSizeFromKnobPosition:(int)knobPosition -{ - return NSMakeSize(10000.0, 22.0); -} - -- (void)placeView:(NSRect)newFrame -{ - // this is called any time the view is resized in IB - [self setFrame:newFrame]; - [self update]; -} - -#pragma mark - -#pragma mark Convenience - -- (NSMutableArray *)representedTabViewItems -{ - NSMutableArray *temp = [NSMutableArray arrayWithCapacity:[_cells count]]; - NSEnumerator *e = [_cells objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - [temp addObject:[cell representedObject]]; - } - return temp; -} - -- (id)cellForPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame -{ - NSUInteger i = [self indexOfCellAtPoint:point cellFrame:outFrame]; - if (i == NSNotFound) - return nil; - PSMTabBarCell *cell = [_cells objectAtIndex:i]; - return cell; -} - -- (NSUInteger)indexOfCellAtPoint:(NSPoint)point -{ - return [self indexOfCellAtPoint:point cellFrame:NULL]; -} - -- (NSUInteger)indexOfCellAtPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame -{ - NSRect aRect = [self genericCellRect]; - - if(!NSPointInRect(point,aRect)){ - return NSNotFound; - } - - NSUInteger i, cnt = [_cells count]; - for(i = 0; i < cnt; i++){ - PSMTabBarCell *cell = [_cells objectAtIndex:i]; - float width = [cell width]; - aRect.size.width = width; - - if(NSPointInRect(point, aRect)){ - if(outFrame){ - *outFrame = aRect; - } - return i; - } - aRect.origin.x += width; - } - return NSNotFound; -} - -- (PSMTabBarCell *)lastVisibleTab -{ - int i, cellCount = [_cells count]; - for(i = 0; i < cellCount; i++){ - if([[_cells objectAtIndex:i] isInOverflowMenu]) - return [_cells objectAtIndex:(i-1)]; - } - return [_cells objectAtIndex:(cellCount - 1)]; -} - -- (int)numberOfVisibleTabs -{ - int i, cellCount = [_cells count]; - for(i = 0; i < cellCount; i++){ - if([[_cells objectAtIndex:i] isInOverflowMenu]) - return i+1; - } - return cellCount; -} - - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.h b/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.h deleted file mode 100644 index ba5d684b90..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.h +++ /dev/null @@ -1,23 +0,0 @@ -// -// PSMTabBarControlInspector.h -// PSMTabBarControl -// -// Created by John Pannell on 12/21/05. -// Copyright Positive Spin Media 2005. All rights reserved. -// - -#import - -@interface PSMTabBarControlInspector : IBInspector -{ - IBOutlet NSPopUpButton *_stylePopUp; - IBOutlet NSButton *_canCloseOnlyTab; - IBOutlet NSButton *_hideForSingleTab; - IBOutlet NSButton *_showAddTab; - IBOutlet NSTextField *_cellMinWidth; - IBOutlet NSTextField *_cellMaxWidth; - IBOutlet NSTextField *_cellOptimumWidth; - IBOutlet NSButton *_sizeToFit; - IBOutlet NSButton *_allowsDragBetweenWindows; -} -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.m b/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.m deleted file mode 100644 index d9c5b91c4f..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlInspector.m +++ /dev/null @@ -1,99 +0,0 @@ -// -// PSMTabBarControlInspector.m -// PSMTabBarControl -// -// Created by John Pannell on 12/21/05. -// Copyright Positive Spin Media 2005 . All rights reserved. -// - -#import "PSMTabBarControlInspector.h" -#import "PSMTabBarControl.h" - -#define kPSMStyleTag 0 -#define kPSMCanCloseOnlyTabTag 1 -#define kPSMHideForSingleTabTag 2 -#define kPSMShowAddTabTag 3 -#define kPSMMinWidthTag 4 -#define kPSMMaxWidthTag 5 -#define kPSMOptimumWidthTag 6 -#define kPSMSizeToFitTag 7 -#define kPSMAllowsDragBetweenWindows 8 - -@implementation PSMTabBarControlInspector - -- (id)init -{ - self = [super init]; - [NSBundle loadNibNamed:@"PSMTabBarControlInspector" owner:self]; - return self; -} - -- (void)ok:(id)sender -{ - if([sender tag] == kPSMStyleTag){ - [[self object] setStyleNamed:[sender titleOfSelectedItem]]; - - } else if([sender tag] == kPSMCanCloseOnlyTabTag){ - [[self object] setCanCloseOnlyTab:[sender state]]; - - } else if([sender tag] == kPSMHideForSingleTabTag){ - [[self object] setHideForSingleTab:[sender state]]; - - } else if([sender tag] == kPSMShowAddTabTag){ - [[self object] setShowAddTabButton:[sender state]]; - - } else if([sender tag] == kPSMMinWidthTag){ - if([[self object] cellOptimumWidth] < [sender intValue]){ - [[self object] setCellMinWidth:[[self object] cellOptimumWidth]]; - [sender setIntValue:[[self object] cellOptimumWidth]]; - } else { - [[self object] setCellMinWidth:[sender intValue]]; - } - - } else if([sender tag] == kPSMMaxWidthTag){ - if([[self object] cellOptimumWidth] > [sender intValue]){ - [[self object] setCellMaxWidth:[[self object] cellOptimumWidth]]; - [sender setIntValue:[[self object] cellOptimumWidth]]; - } else { - [[self object] setCellMaxWidth:[sender intValue]]; - } - - } else if([sender tag] == kPSMOptimumWidthTag){ - if([[self object] cellMaxWidth] < [sender intValue]){ - [[self object] setCellOptimumWidth:[[self object] cellMaxWidth]]; - [sender setIntValue:[[self object] cellMaxWidth]]; - } else if([[self object] cellMinWidth] > [sender intValue]){ - [[self object] setCellOptimumWidth:[[self object] cellMinWidth]]; - [sender setIntValue:[[self object] cellMinWidth]]; - } else { - [[self object] setCellOptimumWidth:[sender intValue]]; - } - - } else if([sender tag] == kPSMSizeToFitTag){ - [[self object] setSizeCellsToFit:[sender state]]; - - } else if([sender tag] == kPSMAllowsDragBetweenWindows){ - [[self object] setAllowsDragBetweenWindows:[sender state]]; - - } - - - [super ok:sender]; -} - -- (void)revert:(id)sender -{ - [_stylePopUp selectItemWithTitle:[[self object] styleName]]; - [_canCloseOnlyTab setState:[[self object] canCloseOnlyTab]]; - [_hideForSingleTab setState:[[self object] hideForSingleTab]]; - [_showAddTab setState:[[self object] showAddTabButton]]; - [_cellMinWidth setIntValue:[[self object] cellMinWidth]]; - [_cellMaxWidth setIntValue:[[self object] cellMaxWidth]]; - [_cellOptimumWidth setIntValue:[[self object] cellOptimumWidth]]; - [_sizeToFit setState:[[self object] sizeCellsToFit]]; - [_allowsDragBetweenWindows setState:[[self object] allowsDragBetweenWindows]]; - - [super revert:sender]; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.h b/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.h deleted file mode 100644 index 0feb9ad9d0..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.h +++ /dev/null @@ -1,21 +0,0 @@ -// -// PSMTabBarControlPalette.h -// PSMTabBarControl -// -// Created by John Pannell on 12/21/05. -// Copyright Positive Spin Media 2005 . All rights reserved. -// - -#import -#import "PSMTabBarControl.h" - -@interface PSMTabBarControlPalette : IBPalette -{ - IBOutlet NSImageView *repImage; - PSMTabBarControl *_customControl; -} -@end - -@interface PSMTabBarControl (PSMTabBarControlPaletteInspector) -- (NSString *)inspectorClassName; -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.m b/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.m deleted file mode 100644 index bb5851aa18..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControlPalette.m +++ /dev/null @@ -1,35 +0,0 @@ -// -// PSMTabBarControlPalette.m -// PSMTabBarControl -// -// Created by John Pannell on 12/21/05. -// Copyright Positive Spin Media 2005 . All rights reserved. -// - -#import "PSMTabBarControlPalette.h" - -@implementation PSMTabBarControlPalette - -- (void)finishInstantiate -{ - // associate representative image with actual control - _customControl = [[PSMTabBarControl alloc] initWithFrame:NSMakeRect(0,0,180,22)]; - [self associateObject:_customControl ofType:IBViewPboardType withView:repImage]; -} - -- (void)dealloc -{ - [_customControl release]; - [super dealloc]; -} - -@end - -@implementation PSMTabBarControl (PSMTabBarControlPaletteInspector) - -- (NSString *)inspectorClassName -{ - return @"PSMTabBarControlInspector"; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl_Prefix.pch b/src/MacVim/PSMTabBarControl/source/PSMTabBarControl_Prefix.pch deleted file mode 100644 index 65df9ffedb..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabBarControl_Prefix.pch +++ /dev/null @@ -1,8 +0,0 @@ -// -// Prefix header for all source files of the 'PSMTabBarControl' target in the 'PSMTabBarControl' project -// - -#ifdef __OBJC__ - #import - #import -#endif diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.h b/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.h deleted file mode 100644 index 8c756c7233..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.h +++ /dev/null @@ -1,84 +0,0 @@ -// -// PSMTabDragAssistant.h -// PSMTabBarControl -// -// Created by John Pannell on 4/10/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -/* - This class is a sigleton that manages the details of a tab drag and drop. The details were beginning to overwhelm me when keeping all of this in the control and cells :-) - */ - -#import -#import "PSMTabBarControl.h" -@class PSMTabBarCell; -@class PSMTabDragWindow; - -#define kPSMTabDragAnimationSteps 8 -#define PI 3.1417 - -@interface PSMTabDragAssistant : NSObject { - PSMTabBarControl *_sourceTabBar; - PSMTabBarControl *_destinationTabBar; - NSMutableSet *_participatingTabBars; - PSMTabBarCell *_draggedCell; - int _draggedCellIndex; // for snap back - BOOL _isDragging; - - // Animation - NSTimer *_animationTimer; - NSMutableArray *_sineCurveWidths; - NSPoint _currentMouseLoc; - PSMTabBarCell *_targetCell; -} - -// Creation/destruction -+ (PSMTabDragAssistant *)sharedDragAssistant; - -// Accessors -- (PSMTabBarControl *)sourceTabBar; -- (void)setSourceTabBar:(PSMTabBarControl *)tabBar; -- (PSMTabBarControl *)destinationTabBar; -- (void)setDestinationTabBar:(PSMTabBarControl *)tabBar; -- (PSMTabBarCell *)draggedCell; -- (void)setDraggedCell:(PSMTabBarCell *)cell; -- (int)draggedCellIndex; -- (void)setDraggedCellIndex:(int)value; -- (BOOL)isDragging; -- (void)setIsDragging:(BOOL)value; -- (NSPoint)currentMouseLoc; -- (void)setCurrentMouseLoc:(NSPoint)point; -- (PSMTabBarCell *)targetCell; -- (void)setTargetCell:(PSMTabBarCell *)cell; - -// Functionality -- (void)startDraggingCell:(PSMTabBarCell *)cell fromTabBar:(PSMTabBarControl *)control withMouseDownEvent:(NSEvent *)event; -- (void)draggingEnteredTabBar:(PSMTabBarControl *)control atPoint:(NSPoint)mouseLoc; -- (void)draggingUpdatedInTabBar:(PSMTabBarControl *)control atPoint:(NSPoint)mouseLoc; -- (void)draggingExitedTabBar:(PSMTabBarControl *)control; -- (void)performDragOperation; -- (void)draggedImageEndedAt:(NSPoint)aPoint operation:(NSDragOperation)operation; -- (void)finishDrag; - -// Animation -- (void)animateDrag:(NSTimer *)timer; -- (void)calculateDragAnimationForTabBar:(PSMTabBarControl *)control; - -// Placeholder -- (void)distributePlaceholdersInTabBar:(PSMTabBarControl *)control withDraggedCell:(PSMTabBarCell *)cell; -- (void)distributePlaceholdersInTabBar:(PSMTabBarControl *)control; -- (void)removeAllPlaceholdersFromTabBar:(PSMTabBarControl *)control; - -@end - -@interface PSMTabBarControl (DragAccessors) - -- (id)psmTabStyle; -- (NSMutableArray *)cells; -- (void)setControlView:(id)view; -- (id)cellForPoint:(NSPoint)point cellFrame:(NSRectPointer)outFrame; -- (PSMTabBarCell *)lastVisibleTab; -- (int)numberOfVisibleTabs; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.m b/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.m deleted file mode 100644 index 9adee1c281..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabDragAssistant.m +++ /dev/null @@ -1,439 +0,0 @@ -// -// PSMTabDragAssistant.m -// PSMTabBarControl -// -// Created by John Pannell on 4/10/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import "PSMTabDragAssistant.h" -#import "PSMTabBarCell.h" -#import "PSMTabStyle.h" - - -@implementation PSMTabDragAssistant - -static PSMTabDragAssistant *sharedDragAssistant = nil; - -#pragma mark - -#pragma mark Creation/Destruction - -+ (PSMTabDragAssistant *)sharedDragAssistant -{ - if (!sharedDragAssistant){ - sharedDragAssistant = [[PSMTabDragAssistant alloc] init]; - } - - return sharedDragAssistant; -} - -- (id)init -{ - if(self = [super init]){ - _sourceTabBar = nil; - _destinationTabBar = nil; - _participatingTabBars = [[NSMutableSet alloc] init]; - _draggedCell = nil; - _animationTimer = nil; - _sineCurveWidths = [[NSMutableArray alloc] initWithCapacity:kPSMTabDragAnimationSteps]; - _targetCell = nil; - _isDragging = NO; - } - - return self; -} - -- (void)dealloc -{ - [_sourceTabBar release]; - [_destinationTabBar release]; - [_participatingTabBars release]; - [_draggedCell release]; - [_animationTimer release]; - [_sineCurveWidths release]; - [_targetCell release]; - [super dealloc]; -} - -#pragma mark - -#pragma mark Accessors - -- (PSMTabBarControl *)sourceTabBar -{ - return _sourceTabBar; -} - -- (void)setSourceTabBar:(PSMTabBarControl *)tabBar -{ - [tabBar retain]; - [_sourceTabBar release]; - _sourceTabBar = tabBar; -} - -- (PSMTabBarControl *)destinationTabBar -{ - return _destinationTabBar; -} - -- (void)setDestinationTabBar:(PSMTabBarControl *)tabBar -{ - [tabBar retain]; - [_destinationTabBar release]; - _destinationTabBar = tabBar; -} - -- (PSMTabBarCell *)draggedCell -{ - return _draggedCell; -} - -- (void)setDraggedCell:(PSMTabBarCell *)cell -{ - [cell retain]; - [_draggedCell release]; - _draggedCell = cell; -} - -- (int)draggedCellIndex -{ - return _draggedCellIndex; -} - -- (void)setDraggedCellIndex:(int)value -{ - _draggedCellIndex = value; -} - -- (BOOL)isDragging -{ - return _isDragging; -} - -- (void)setIsDragging:(BOOL)value -{ - _isDragging = value; -} - -- (NSPoint)currentMouseLoc -{ - return _currentMouseLoc; -} - -- (void)setCurrentMouseLoc:(NSPoint)point -{ - _currentMouseLoc = point; -} - -- (PSMTabBarCell *)targetCell -{ - return _targetCell; -} - -- (void)setTargetCell:(PSMTabBarCell *)cell -{ - [cell retain]; - [_targetCell release]; - _targetCell = cell; -} - -#pragma mark - -#pragma mark Functionality - -- (void)startDraggingCell:(PSMTabBarCell *)cell fromTabBar:(PSMTabBarControl *)control withMouseDownEvent:(NSEvent *)event -{ - [self setIsDragging:YES]; - [self setSourceTabBar:control]; - [self setDestinationTabBar:control]; - [_participatingTabBars addObject:control]; - [self setDraggedCell:cell]; - [self setDraggedCellIndex:[[control cells] indexOfObject:cell]]; - - NSRect cellFrame = [cell frame]; - // list of widths for animation - int i; - float cellWidth = cellFrame.size.width; - for(i = 0; i < kPSMTabDragAnimationSteps; i++){ - int thisWidth; - thisWidth = (int)(cellWidth - ((cellWidth/2.0) + ((sin((PI/2.0) + ((float)i/(float)kPSMTabDragAnimationSteps)*PI) * cellWidth) / 2.0))); - [_sineCurveWidths addObject:[NSNumber numberWithInt:thisWidth]]; - } - - // hide UI buttons - [[control overflowPopUpButton] setHidden:YES]; - [[control addTabButton] setHidden:YES]; - - [[NSCursor closedHandCursor] set]; - - NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; - NSImage *dragImage = [cell dragImageForRect:cellFrame]; - [[cell indicator] removeFromSuperview]; - [self distributePlaceholdersInTabBar:control withDraggedCell:cell]; - - if([control isFlipped]){ - cellFrame.origin.y += cellFrame.size.height; - } - [cell setHighlighted:NO]; - NSSize offset = NSZeroSize; - [pboard declareTypes:[NSArray arrayWithObjects:@"PSMTabBarControlItemPBType", nil] owner: nil]; - [pboard setString:[[NSNumber numberWithInt:[[control cells] indexOfObject:cell]] stringValue] forType:@"PSMTabBarControlItemPBType"]; - _animationTimer = [NSTimer scheduledTimerWithTimeInterval:(1.0/30.0) target:self selector:@selector(animateDrag:) userInfo:nil repeats:YES]; - [control dragImage:dragImage at:cellFrame.origin offset:offset event:event pasteboard:pboard source:control slideBack:YES]; -} - -- (void)draggingEnteredTabBar:(PSMTabBarControl *)control atPoint:(NSPoint)mouseLoc -{ - [self setDestinationTabBar:control]; - [self setCurrentMouseLoc:mouseLoc]; - // hide UI buttons - [[control overflowPopUpButton] setHidden:YES]; - [[control addTabButton] setHidden:YES]; - if(![[[control cells] objectAtIndex:0] isPlaceholder]) - [self distributePlaceholdersInTabBar:control]; - [_participatingTabBars addObject:control]; -} - -- (void)draggingUpdatedInTabBar:(PSMTabBarControl *)control atPoint:(NSPoint)mouseLoc -{ - if([self destinationTabBar] != control) - [self setDestinationTabBar:control]; - [self setCurrentMouseLoc:mouseLoc]; -} - -- (void)draggingExitedTabBar:(PSMTabBarControl *)control -{ - [self setDestinationTabBar:nil]; - [self setCurrentMouseLoc:NSMakePoint(-1.0, -1.0)]; -} - -- (void)performDragOperation -{ -#if 1 - // move cell - [[[self destinationTabBar] cells] replaceObjectAtIndex:[[[self destinationTabBar] cells] indexOfObject:[self targetCell]] withObject:[self draggedCell]]; - [[self draggedCell] setControlView:[self destinationTabBar]]; - // move actual NSTabViewItem - if([self sourceTabBar] != [self destinationTabBar]){ - [[[self sourceTabBar] tabView] removeTabViewItem:[[self draggedCell] representedObject]]; - [[[self destinationTabBar] tabView] addTabViewItem:[[self draggedCell] representedObject]]; - } - [self finishDrag]; -#else - unsigned idx = [[[self destinationTabBar] cells] indexOfObject:[self targetCell]]; - - // move cell - [[[self destinationTabBar] cells] replaceObjectAtIndex:idx withObject:[self draggedCell]]; - [[self draggedCell] setControlView:[self destinationTabBar]]; - // move actual NSTabViewItem - if([self sourceTabBar] != [self destinationTabBar]){ - [[[self sourceTabBar] tabView] removeTabViewItem:[[self draggedCell] representedObject]]; - idx = [[[self destinationTabBar] cells] indexOfObject:[self draggedCell]]; - NSLog(@"Inserting at index %d", idx); - [[[self destinationTabBar] tabView] insertTabViewItem:[[self draggedCell] representedObject] atIndex:idx]; - } - [self finishDrag]; -#endif -} - -- (void)draggedImageEndedAt:(NSPoint)aPoint operation:(NSDragOperation)operation -{ - if([self isDragging]){ // means there was not a successful drop (performDragOperation) - // put cell back - [[[self sourceTabBar] cells] insertObject:[self draggedCell] atIndex:[self draggedCellIndex]]; - [self finishDrag]; - } -} - -- (void)finishDrag -{ - [self setIsDragging:NO]; - [self removeAllPlaceholdersFromTabBar:[self sourceTabBar]]; - [self setSourceTabBar:nil]; - [self setDestinationTabBar:nil]; - NSEnumerator *e = [_participatingTabBars objectEnumerator]; - PSMTabBarControl *tabBar; - while(tabBar = [e nextObject]){ - [self removeAllPlaceholdersFromTabBar:tabBar]; - } - [_participatingTabBars removeAllObjects]; - [self setDraggedCell:nil]; - [_animationTimer invalidate]; - _animationTimer = nil; - [_sineCurveWidths removeAllObjects]; - [self setTargetCell:nil]; -} - -#pragma mark - -#pragma mark Animation - -- (void)animateDrag:(NSTimer *)timer -{ - NSEnumerator *e = [_participatingTabBars objectEnumerator]; - PSMTabBarControl *tabBar; - while(tabBar = [e nextObject]){ - [self calculateDragAnimationForTabBar:tabBar]; - [[NSRunLoop currentRunLoop] performSelector:@selector(display) target:tabBar argument:nil order:1 modes:[NSArray arrayWithObjects:@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode", nil]]; - } -} - -- (void)calculateDragAnimationForTabBar:(PSMTabBarControl *)control -{ - BOOL removeFlag = YES; - NSMutableArray *cells = [control cells]; - int i, cellCount = [cells count]; - float xPos = [[control psmTabStyle] leftMarginForTabBarControl]; - - // identify target cell - // mouse at beginning of tabs - NSPoint mouseLoc = [self currentMouseLoc]; - if([self destinationTabBar] == control){ - removeFlag = NO; - if(mouseLoc.x < [[control psmTabStyle] leftMarginForTabBarControl]){ - [self setTargetCell:[cells objectAtIndex:0]]; - goto layout; - } - - NSRect overCellRect; - PSMTabBarCell *overCell = [control cellForPoint:mouseLoc cellFrame:&overCellRect]; - if(overCell){ - // mouse among cells - placeholder - if([overCell isPlaceholder]){ - [self setTargetCell:overCell]; - goto layout; - } - - // non-placeholders - if(mouseLoc.x < (overCellRect.origin.x + (overCellRect.size.width / 2.0))){ - // mouse on left side of cell - [self setTargetCell:[cells objectAtIndex:([cells indexOfObject:overCell] - 1)]]; - goto layout; - } else { - // mouse on right side of cell - [self setTargetCell:[cells objectAtIndex:([cells indexOfObject:overCell] + 1)]]; - goto layout; - } - } else { - // out at end - must find proper cell (could be more in overflow menu) - [self setTargetCell:[control lastVisibleTab]]; - goto layout; - } - } else { - [self setTargetCell:nil]; - } - -layout: - for(i = 0; i < cellCount; i++){ - PSMTabBarCell *cell = [cells objectAtIndex:i]; - NSRect newRect = [cell frame]; - if(![cell isInOverflowMenu]){ - if([cell isPlaceholder]){ - if(cell == [self targetCell]){ - [cell setCurrentStep:([cell currentStep] + 1)]; - } else { - [cell setCurrentStep:([cell currentStep] - 1)]; - if([cell currentStep] > 0){ - removeFlag = NO; - } - } - newRect.size.width = [[_sineCurveWidths objectAtIndex:[cell currentStep]] intValue]; - } - } else { - break; - } - newRect.origin.x = xPos; - [cell setFrame:newRect]; - if([cell indicator]) - [[cell indicator] setFrame:[[control psmTabStyle] indicatorRectForTabCell:cell]]; - xPos += newRect.size.width; - } - if(removeFlag){ - [_participatingTabBars removeObject:control]; - [self removeAllPlaceholdersFromTabBar:control]; - } -} - -#pragma mark - -#pragma mark Placeholders - -- (void)distributePlaceholdersInTabBar:(PSMTabBarControl *)control withDraggedCell:(PSMTabBarCell *)cell -{ - // called upon first drag - must distribute placeholders - [self distributePlaceholdersInTabBar:control]; - // replace dragged cell with a placeholder, and clean up surrounding cells - int cellIndex = [[control cells] indexOfObject:cell]; - PSMTabBarCell *pc = [[[PSMTabBarCell alloc] initPlaceholderWithFrame:[[self draggedCell] frame] expanded:YES inControlView:control] autorelease]; - [[control cells] replaceObjectAtIndex:cellIndex withObject:pc]; - [[control cells] removeObjectAtIndex:(cellIndex + 1)]; - [[control cells] removeObjectAtIndex:(cellIndex - 1)]; - return; -} - -- (void)distributePlaceholdersInTabBar:(PSMTabBarControl *)control -{ - int i, numVisibleTabs = [control numberOfVisibleTabs]; - for(i = 0; i < numVisibleTabs; i++){ - PSMTabBarCell *pc = [[[PSMTabBarCell alloc] initPlaceholderWithFrame:[[self draggedCell] frame] expanded:NO inControlView:control] autorelease]; - [[control cells] insertObject:pc atIndex:(2 * i)]; - } - if(numVisibleTabs > 0){ - PSMTabBarCell *pc = [[[PSMTabBarCell alloc] initPlaceholderWithFrame:[[self draggedCell] frame] expanded:NO inControlView:control] autorelease]; - if([[control cells] count] > (2 * numVisibleTabs)){ - [[control cells] insertObject:pc atIndex:(2 * numVisibleTabs)]; - } else { - [[control cells] addObject:pc]; - } - } -} - -- (void)removeAllPlaceholdersFromTabBar:(PSMTabBarControl *)control -{ - int i, cellCount = [[control cells] count]; - for(i = (cellCount - 1); i >= 0; i--){ - PSMTabBarCell *cell = [[control cells] objectAtIndex:i]; - if([cell isPlaceholder]) - [[control cells] removeObject:cell]; - } - // redraw - [[NSRunLoop currentRunLoop] performSelector:@selector(update) target:control argument:nil order:1 modes:[NSArray arrayWithObjects:@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode", nil]]; - [[NSRunLoop currentRunLoop] performSelector:@selector(display) target:control argument:nil order:1 modes:[NSArray arrayWithObjects:@"NSEventTrackingRunLoopMode", @"NSDefaultRunLoopMode", nil]]; -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder { - //[super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:_sourceTabBar forKey:@"sourceTabBar"]; - [aCoder encodeObject:_destinationTabBar forKey:@"destinationTabBar"]; - [aCoder encodeObject:_participatingTabBars forKey:@"participatingTabBars"]; - [aCoder encodeObject:_draggedCell forKey:@"draggedCell"]; - [aCoder encodeInt:_draggedCellIndex forKey:@"draggedCellIndex"]; - [aCoder encodeBool:_isDragging forKey:@"isDragging"]; - [aCoder encodeObject:_animationTimer forKey:@"animationTimer"]; - [aCoder encodeObject:_sineCurveWidths forKey:@"sineCurveWidths"]; - [aCoder encodePoint:_currentMouseLoc forKey:@"currentMouseLoc"]; - [aCoder encodeObject:_targetCell forKey:@"targetCell"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder { - //self = [super initWithCoder:aDecoder]; - //if (self) { - if ([aDecoder allowsKeyedCoding]) { - _sourceTabBar = [[aDecoder decodeObjectForKey:@"sourceTabBar"] retain]; - _destinationTabBar = [[aDecoder decodeObjectForKey:@"destinationTabBar"] retain]; - _participatingTabBars = [[aDecoder decodeObjectForKey:@"participatingTabBars"] retain]; - _draggedCell = [[aDecoder decodeObjectForKey:@"draggedCell"] retain]; - _draggedCellIndex = [aDecoder decodeIntForKey:@"draggedCellIndex"]; - _isDragging = [aDecoder decodeBoolForKey:@"isDragging"]; - _animationTimer = [[aDecoder decodeObjectForKey:@"animationTimer"] retain]; - _sineCurveWidths = [[aDecoder decodeObjectForKey:@"sineCurveWidths"] retain]; - _currentMouseLoc = [aDecoder decodePointForKey:@"currentMouseLoc"]; - _targetCell = [[aDecoder decodeObjectForKey:@"targetCell"] retain]; - } - //} - return self; -} - - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMTabStyle.h b/src/MacVim/PSMTabBarControl/source/PSMTabStyle.h deleted file mode 100644 index eedf7b7712..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMTabStyle.h +++ /dev/null @@ -1,52 +0,0 @@ -// -// PSMTabStyle.h -// PSMTabBarControl -// -// Created by John Pannell on 2/17/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -/* -Protocol to be observed by all style delegate objects. These objects handle the drawing responsibilities for PSMTabBarCell; once the control has been assigned a style, the background and cells draw consistent with that style. Design pattern and implementation by David Smith, Seth Willits, and Chris Forsythe, all touch up and errors by John P. :-) -*/ - -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" - -@protocol PSMTabStyle - -// identity -- (NSString *)name; - -// control specific parameters -- (float)leftMarginForTabBarControl; -- (float)rightMarginForTabBarControl; - -// add tab button -- (NSImage *)addTabButtonImage; -- (NSImage *)addTabButtonPressedImage; -- (NSImage *)addTabButtonRolloverImage; - -// cell specific parameters -- (NSRect)closeButtonRectForTabCell:(PSMTabBarCell *)cell; -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell; -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell; -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell; -- (float)minimumWidthOfTabCell:(PSMTabBarCell *)cell; -- (float)desiredWidthOfTabCell:(PSMTabBarCell *)cell; - -// cell values -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell; -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell; - -// drawing -- (void)drawTabCell:(PSMTabBarCell *)cell; -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect; - -@end - -@interface PSMTabBarControl (StyleAccessors) - -- (NSMutableArray *)cells; - -@end \ No newline at end of file diff --git a/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.h b/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.h deleted file mode 100644 index 871f713c52..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.h +++ /dev/null @@ -1,26 +0,0 @@ -// -// PSMUnifiedTabStyle.h -// -------------------- -// -// Created by Keith Blount on 30/04/2006. -// Copyright 2006 __MyCompanyName__. All rights reserved. -// - -#import -#import "PSMTabStyle.h" - -@interface PSMUnifiedTabStyle : NSObject -{ - NSImage *unifiedCloseButton; - NSImage *unifiedCloseButtonDown; - NSImage *unifiedCloseButtonOver; - NSImage *_addTabButtonImage; - NSImage *_addTabButtonPressedImage; - NSImage *_addTabButtonRolloverImage; - NSMutableParagraphStyle *truncatingTailParagraphStyle; - NSMutableParagraphStyle *centeredParagraphStyle; - - float leftMargin; -} -- (void)setLeftMarginForTabBarControl:(float)margin; -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.m b/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.m deleted file mode 100644 index 56a60d3fab..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMUnifiedTabStyle.m +++ /dev/null @@ -1,525 +0,0 @@ -// -// PSMUnifiedTabStyle.m -// -------------------- -// -// Created by Keith Blount on 30/04/2006. -// Copyright 2006 __MyCompanyName__. All rights reserved. -// - -#import "PSMUnifiedTabStyle.h" -#import "PSMTabBarCell.h" -#import "PSMTabBarControl.h" -#import "NSBezierPath_AMShading.h" - -#define kPSMUnifiedObjectCounterRadius 7.0 -#define kPSMUnifiedCounterMinWidth 20 - -@interface PSMUnifiedTabStyle (Private) -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; -@end - -@implementation PSMUnifiedTabStyle - -- (NSString *)name -{ - return @"Unified"; -} - -#pragma mark - -#pragma mark Creation/Destruction - -- (id) init -{ - if((self = [super init])) - { - unifiedCloseButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front"]]; - unifiedCloseButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Pressed"]]; - unifiedCloseButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabClose_Front_Rollover"]]; - - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNew"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewPressed"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"AquaTabNewRollover"]]; - - leftMargin = 5.0; - } - return self; -} - -- (void)dealloc -{ - [unifiedCloseButton release]; - [unifiedCloseButtonDown release]; - [unifiedCloseButtonOver release]; - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - [truncatingTailParagraphStyle release]; - [centeredParagraphStyle release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Control Specific - -- (void)setLeftMarginForTabBarControl:(float)margin -{ - leftMargin = margin; -} - -- (float)leftMarginForTabBarControl -{ - return leftMargin; -} - -- (float)rightMarginForTabBarControl -{ - return 24.0f; -} - -#pragma mark - -#pragma mark Add Tab Button - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonPressedImage; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonRolloverImage; -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect) closeButtonRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasCloseButton] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [unifiedCloseButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - result.origin.x += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y - 1.0; - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - float countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMUnifiedObjectCounterRadius - 6.0); - if(countWidth < kPSMUnifiedCounterMinWidth) - countWidth = kPSMUnifiedCounterMinWidth; - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMUnifiedObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - - return result; -} - - -- (float)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (float)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [unifiedCloseButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSFontManager *fm = [NSFontManager sharedFontManager]; - NSNumberFormatter *nf = [[[NSNumberFormatter alloc] init] autorelease]; - [nf setLocalizesFormat:YES]; - [nf setFormat:@"0"]; - [nf setHasThousandSeparators:YES]; - NSString *contents = [nf stringFromNumber:[NSNumber numberWithInt:[cell count]]]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[fm convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[[NSColor whiteColor] colorWithAlphaComponent:0.85] range:range]; - - return attrStr; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString * contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - - // Paragraph Style for Truncating Long Text - if (!truncatingTailParagraphStyle) { - truncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [truncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:truncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark ---- drawing ---- - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - NSColor * lineColor = nil; - NSBezierPath* bezier = [NSBezierPath bezierPath]; - lineColor = [NSColor colorWithCalibratedWhite:0.576 alpha:1.0]; - - if ([cell state] == NSOnState) - { - // selected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x+0.5, cellFrame.origin.y-0.5, cellFrame.size.width-1.0, cellFrame.size.height); - aRect.size.height -= 0.5; - - aRect.size.height+=0.5; - - // frame - float radius = MIN(6.0, 0.5f * MIN(NSWidth(aRect), NSHeight(aRect))); - NSRect rect = NSInsetRect(aRect, radius, radius); - - [bezier appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(rect), NSMinY(rect)) radius:radius startAngle:180.0 endAngle:270.0]; - - [bezier appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(rect), NSMinY(rect)) radius:radius startAngle:270.0 endAngle:360.0]; - - NSPoint cornerPoint = NSMakePoint(NSMaxX(aRect), NSMaxY(aRect)); - [bezier appendBezierPathWithPoints:&cornerPoint count:1]; - - cornerPoint = NSMakePoint(NSMinX(aRect), NSMaxY(aRect)); - [bezier appendBezierPathWithPoints:&cornerPoint count:1]; - - [bezier closePath]; - - //[[NSColor windowBackgroundColor] set]; - //[bezier fill]; - [bezier linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.99 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.941 alpha:1.0]]; - - [lineColor set]; - [bezier stroke]; - } - else - { - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - aRect.origin.y += 0.5; - aRect.origin.x += 1.5; - aRect.size.width -= 1; - - aRect.origin.x -= 1; - aRect.size.width += 1; - - // rollover - if ([cell isHighlighted]) - { - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositingOperationSourceAtop); - } - - // frame - - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y-0.5)]; - if(!([cell tabState] & PSMTab_RightIsSelectedMask)){ - [bezier lineToPoint:NSMakePoint(NSMaxX(aRect), NSMaxY(aRect))]; - } - - [bezier stroke]; - - // Create a thin lighter line next to the dividing line for a bezel effect - if(!([cell tabState] & PSMTab_RightIsSelectedMask)){ - [[[NSColor whiteColor] colorWithAlphaComponent:0.5] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(NSMaxX(aRect)+1.0, aRect.origin.y-0.5) - toPoint:NSMakePoint(NSMaxX(aRect)+1.0, NSMaxY(aRect)-2.5)]; - } - - // If this is the leftmost tab, we want to draw a line on the left, too - if ([cell tabState] & PSMTab_PositionLeftMask) - { - [lineColor set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(aRect.origin.x,aRect.origin.y-0.5) - toPoint:NSMakePoint(aRect.origin.x,NSMaxY(aRect)-2.5)]; - [[[NSColor whiteColor] colorWithAlphaComponent:0.5] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(aRect.origin.x+1.0,aRect.origin.y-0.5) - toPoint:NSMakePoint(aRect.origin.x+1.0,NSMaxY(aRect)-2.5)]; - } - } - - [self drawInteriorWithTabCell:cell inView:[cell controlView]]; -} - - - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - float labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage * closeButton = nil; - - closeButton = unifiedCloseButton; - if ([cell closeButtonOver]) closeButton = unifiedCloseButtonOver; - if ([cell closeButtonPressed]) closeButton = unifiedCloseButtonDown; - - closeButtonSize = [closeButton size]; - [closeButton drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil]; - - // scoot label over - labelPosition += closeButtonSize.width + kPSMTabBarCellPadding; - } - -#if 0 // MacVim: disable this code. It is unused and calling 'content' on the represented object's identifier seems dangerous at best. - // icon - if([cell hasIcon]){ - NSRect iconRect = [self iconRectForTabCell:cell]; - NSImage *icon = [[[[cell representedObject] identifier] content] icon]; - if ([controlView isFlipped]) { - iconRect.origin.y = cellFrame.size.height - iconRect.origin.y; - } - [icon compositeToPoint:iconRect.origin operation:NSCompositeSourceOver fraction:1.0]; - - // scoot label over - labelPosition += iconRect.size.width + kPSMTabBarCellPadding; - } -#endif - - // object counter - if([cell count] > 0){ - [[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - myRect.origin.y -= 1.0; - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMUnifiedObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMUnifiedObjectCounterRadius, myRect.origin.y + kPSMUnifiedObjectCounterRadius) radius:kPSMUnifiedObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMUnifiedObjectCounterRadius, myRect.origin.y + kPSMUnifiedObjectCounterRadius) radius:kPSMUnifiedObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - NSSize s = [[cell attributedStringValue] size]; - labelRect.origin.y = cellFrame.origin.y + (cellFrame.size.height-s.height)/2.0 - 1.0; - labelRect.size.height = s.height; - - if(![[cell indicator] isHidden]) - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - - if([cell count] > 0) - labelRect.size.width -= ([self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding); - - // label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - NSRect gradientRect = rect; - gradientRect.size.height -= 1.0; - NSBezierPath *path = [NSBezierPath bezierPathWithRect:gradientRect]; - [path linearGradientFillWithStartColor:[NSColor colorWithCalibratedWhite:0.918 alpha:1.0] - endColor:[NSColor colorWithCalibratedWhite:0.843 alpha:1.0]]; - [[NSColor colorWithCalibratedWhite:0.576 alpha:1.0] set]; - [NSBezierPath strokeLineFromPoint:NSMakePoint(rect.origin.x,NSMaxY(rect)-0.5) - toPoint:NSMakePoint(NSMaxX(rect),NSMaxY(rect)-0.5)]; - - // no tab view == not connected - if(![bar tabView]){ - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [centeredParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [attrStr drawInRect:labelRect]; - return; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - if(![cell isInOverflowMenu]){ - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - //[super encodeWithCoder:aCoder]; - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:unifiedCloseButton forKey:@"unifiedCloseButton"]; - [aCoder encodeObject:unifiedCloseButtonDown forKey:@"unifiedCloseButtonDown"]; - [aCoder encodeObject:unifiedCloseButtonOver forKey:@"unifiedCloseButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - // self = [super initWithCoder:aDecoder]; - //if (self) { - if ([aDecoder allowsKeyedCoding]) { - unifiedCloseButton = [[aDecoder decodeObjectForKey:@"unifiedCloseButton"] retain]; - unifiedCloseButtonDown = [[aDecoder decodeObjectForKey:@"unifiedCloseButtonDown"] retain]; - unifiedCloseButtonOver = [[aDecoder decodeObjectForKey:@"unifiedCloseButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - } - //} - return self; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.h b/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.h deleted file mode 100644 index 2f3581132f..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.h +++ /dev/null @@ -1,28 +0,0 @@ -// -// PSMYosemiteTabStyle.h -// PSMTabBarControl -// -// Created by Christoffer Winterkvist on 25/08/14. -// -// - -#import -#import "PSMTabStyle.h" - -@interface PSMYosemiteTabStyle : NSObject { - NSImage *closeButton; - NSImage *closeButtonDown; - NSImage *closeButtonOver; - NSImage *_addTabButtonImage; - NSImage *_addTabButtonPressedImage; - NSImage *_addTabButtonRolloverImage; - NSMutableParagraphStyle *truncatingTailParagraphStyle; - NSMutableParagraphStyle *centeredParagraphStyle; -} - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView; - -- (void)encodeWithCoder:(NSCoder *)aCoder; -- (id)initWithCoder:(NSCoder *)aDecoder; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.m b/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.m deleted file mode 100644 index 0997cc00bb..0000000000 --- a/src/MacVim/PSMTabBarControl/source/PSMYosemiteTabStyle.m +++ /dev/null @@ -1,499 +0,0 @@ -// -// PSMYosemiteTabStyle.m -// PSMTabBarControl -// -// Created by Christoffer Winterkvist on 25/08/14. -// -// - -#import "PSMYosemiteTabStyle.h" - -#define kPSMMetalObjectCounterRadius 7.0 -#define kPSMMetalCounterMinWidth 20 - -void YosemiteNSDrawWindowBackground(NSRect rect, NSColor *color) -{ - [color set]; - NSRectFill( rect ); -} - -@implementation PSMYosemiteTabStyle - -- (void)dealloc -{ - [closeButton release]; - [closeButtonDown release]; - [closeButtonOver release]; - [_addTabButtonImage release]; - [_addTabButtonPressedImage release]; - [_addTabButtonRolloverImage release]; - - [truncatingTailParagraphStyle release]; - [centeredParagraphStyle release]; - - [super dealloc]; -} - -#pragma mark - -#pragma mark Initializers - -- (id)init -{ - self = [super init]; - if (!self) return nil; - - closeButton = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front"]]; - //NSLog(@"closeButton=%@ path=%@", metalCloseButton, - // [[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front"]); - closeButtonDown = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front_Pressed"]]; - closeButtonOver = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabClose_Front_Rollover"]]; - - _addTabButtonImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetal"]]; - _addTabButtonPressedImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetalPressed"]]; - _addTabButtonRolloverImage = [[NSImage alloc] initByReferencingFile:[[PSMTabBarControl bundle] pathForImageResource:@"TabNewMetalRollover"]]; - - return self; -} - -- (NSString *)name -{ - return @"Yosemite"; -} - -#pragma mark - -#pragma mark Control Specific - -- (float)leftMarginForTabBarControl -{ - return -1.0f; -} - -- (float)rightMarginForTabBarControl -{ - return 24.0f; -} - -#pragma mark - -#pragma mark Add Tab Button - -- (NSImage *)addTabButtonImage -{ - return _addTabButtonImage; -} - -- (NSImage *)addTabButtonPressedImage -{ - return _addTabButtonPressedImage; -} - -- (NSImage *)addTabButtonRolloverImage -{ - return _addTabButtonRolloverImage; -} - -- (NSColor *)backgroundColor:(BOOL)isKeyWindow -{ - NSColor *backgroundColor; - if (isKeyWindow) { - backgroundColor = [NSColor colorWithCalibratedHue:0.000 saturation:0.000 brightness:0.875 alpha:1]; - } else { - backgroundColor = [NSColor colorWithCalibratedHue:0.000 saturation:0.000 brightness:0.957 alpha:1]; - } - - return backgroundColor; -} - -- (NSColor *)borderColor -{ - return [NSColor colorWithCalibratedHue:0.000 saturation:0.000 brightness:0.678 alpha:1]; -} - -#pragma mark - -#pragma mark Cell Specific - -- (NSRect) closeButtonRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasCloseButton] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = [closeButton size]; - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 2.0; - - return result; -} - -- (NSRect)iconRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell hasIcon] == NO) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIconWidth, kPSMTabBarIconWidth); - result.origin.x = cellFrame.origin.x + MARGIN_X; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - result.origin.x += [closeButton size].width + kPSMTabBarCellPadding; - - if([cell state] == NSOnState){ - result.origin.y += 1; - } - - return result; -} - -- (NSRect)indicatorRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([[cell indicator] isHidden]) { - return NSZeroRect; - } - - NSRect result; - result.size = NSMakeSize(kPSMTabBarIndicatorWidth, kPSMTabBarIndicatorWidth); - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - kPSMTabBarIndicatorWidth; - result.origin.y = cellFrame.origin.y + MARGIN_Y; - - if([cell state] == NSOnState){ - result.origin.y -= 1; - } - - return result; -} - -- (NSRect)objectCounterRectForTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - - if ([cell count] == 0) { - return NSZeroRect; - } - - float countWidth = [[self attributedObjectCountValueForTabCell:cell] size].width; - countWidth += (2 * kPSMMetalObjectCounterRadius - 6.0); - if(countWidth < kPSMMetalCounterMinWidth) - countWidth = kPSMMetalCounterMinWidth; - - NSRect result; - result.size = NSMakeSize(countWidth, 2 * kPSMMetalObjectCounterRadius); // temp - result.origin.x = cellFrame.origin.x + cellFrame.size.width - MARGIN_X - result.size.width; - result.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - result.origin.x -= kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding; - - return result; -} - - -- (float)minimumWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [closeButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += kPSMMinimumTitleWidth; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -- (float)desiredWidthOfTabCell:(PSMTabBarCell *)cell -{ - float resultWidth = 0.0; - - // left margin - resultWidth = MARGIN_X; - - // close button? - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) - resultWidth += [closeButton size].width + kPSMTabBarCellPadding; - - // icon? - if([cell hasIcon]) - resultWidth += kPSMTabBarIconWidth + kPSMTabBarCellPadding; - - // the label - resultWidth += [[cell attributedStringValue] size].width; - - // object counter? - if([cell count] > 0) - resultWidth += [self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding; - - // indicator? - if ([[cell indicator] isHidden] == NO) - resultWidth += kPSMTabBarCellPadding + kPSMTabBarIndicatorWidth; - - // right margin - resultWidth += MARGIN_X; - - return ceil(resultWidth); -} - -#pragma mark - -#pragma mark Cell Values - -- (NSAttributedString *)attributedObjectCountValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSFontManager *fm = [NSFontManager sharedFontManager]; - NSNumberFormatter *nf = [[[NSNumberFormatter alloc] init] autorelease]; - [nf setLocalizesFormat:YES]; - [nf setFormat:@"0"]; - [nf setHasThousandSeparators:YES]; - NSString *contents = [nf stringFromNumber:[NSNumber numberWithInt:[cell count]]]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[fm convertFont:[NSFont fontWithName:@"Helvetica" size:11.0] toHaveTrait:NSBoldFontMask] range:range]; - [attrStr addAttribute:NSForegroundColorAttributeName value:[[NSColor whiteColor] colorWithAlphaComponent:0.85] range:range]; - - return attrStr; -} - -- (NSAttributedString *)attributedStringValueForTabCell:(PSMTabBarCell *)cell -{ - NSMutableAttributedString *attrStr; - NSString *contents = [cell stringValue]; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - - // Add font attribute - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - - PSMTabBarControl *bar = (PSMTabBarControl *)cell.controlView; - BOOL isKeyWindow = [bar.window isKeyWindow]; - - CGFloat textAlpha; - if ([cell state] == NSOnState) { - textAlpha = (isKeyWindow) ? 1.0f : 0.5f; - } else { - textAlpha = (isKeyWindow) ? 0.5f : 0.25f; - } - NSColor *textColor = [[NSColor textColor] colorWithAlphaComponent:textAlpha]; - - [attrStr addAttribute:NSForegroundColorAttributeName value:textColor range:range]; - - // Paragraph Style for Truncating Long Text - if (!truncatingTailParagraphStyle) { - truncatingTailParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [truncatingTailParagraphStyle setLineBreakMode:NSLineBreakByTruncatingHead]; - [truncatingTailParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:truncatingTailParagraphStyle range:range]; - - return attrStr; -} - -#pragma mark - -#pragma mark ---- drawing ---- - -- (void)drawTabCell:(PSMTabBarCell *)cell -{ - NSRect cellFrame = [cell frame]; - NSColor * lineColor = nil; - NSBezierPath* bezier = [NSBezierPath bezierPath]; - lineColor = [self borderColor]; - - if ([cell state] == NSOnState) { - // selected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - - PSMTabBarControl *bar = (PSMTabBarControl *)cell.controlView; - BOOL isKeyWindow = [bar.window isKeyWindow]; - - // background - YosemiteNSDrawWindowBackground(aRect, [self backgroundColor:isKeyWindow]); - - aRect.size.height -= 1.0f; - aRect.origin.y += 0.5f; - // frame - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y+aRect.size.height)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x+aRect.size.width, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier stroke]; - } else { - - // unselected tab - NSRect aRect = NSMakeRect(cellFrame.origin.x, cellFrame.origin.y, cellFrame.size.width, cellFrame.size.height); - - aRect.origin.x += 0.5; - - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; - NSRectFillUsingOperation(aRect, NSCompositingOperationSourceAtop); - - // frame - [lineColor set]; - [bezier moveToPoint:NSMakePoint(aRect.origin.x, aRect.origin.y)]; - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y)]; - if(!([cell tabState] & PSMTab_RightIsSelectedMask)){ - [bezier lineToPoint:NSMakePoint(aRect.origin.x + aRect.size.width, aRect.origin.y + aRect.size.height)]; - } - [bezier stroke]; - } - - [self drawInteriorWithTabCell:cell inView:[cell controlView]]; -} - - - -- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView -{ - NSRect cellFrame = [cell frame]; - float labelPosition = cellFrame.origin.x + MARGIN_X; - - // close button - if ([cell hasCloseButton] && ![cell isCloseButtonSuppressed]) { - NSSize closeButtonSize = NSZeroSize; - NSRect closeButtonRect = [cell closeButtonRectForFrame:cellFrame]; - NSImage *button = nil; - - if ([cell isHighlighted]) button = closeButton; - if ([cell closeButtonOver]) button = closeButtonOver; - if ([cell closeButtonPressed]) button = closeButtonDown; - - closeButtonSize = [button size]; - [button drawInRect:closeButtonRect fromRect:NSZeroRect operation:NSCompositingOperationSourceOver fraction:1.0 respectFlipped:YES hints:nil]; - } - - // object counter - if([cell count] > 0){ - [[NSColor colorWithCalibratedWhite:0.3 alpha:0.6] set]; - NSBezierPath *path = [NSBezierPath bezierPath]; - NSRect myRect = [self objectCounterRectForTabCell:cell]; - [path moveToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path lineToPoint:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + myRect.size.width - kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:270.0 endAngle:90.0]; - [path lineToPoint:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + myRect.size.height)]; - [path appendBezierPathWithArcWithCenter:NSMakePoint(myRect.origin.x + kPSMMetalObjectCounterRadius, myRect.origin.y + kPSMMetalObjectCounterRadius) radius:kPSMMetalObjectCounterRadius startAngle:90.0 endAngle:270.0]; - [path fill]; - - // draw attributed string centered in area - NSRect counterStringRect; - NSAttributedString *counterString = [self attributedObjectCountValueForTabCell:cell]; - counterStringRect.size = [counterString size]; - counterStringRect.origin.x = myRect.origin.x + ((myRect.size.width - counterStringRect.size.width) / 2.0) + 0.25; - counterStringRect.origin.y = myRect.origin.y + ((myRect.size.height - counterStringRect.size.height) / 2.0) + 0.5; - [counterString drawInRect:counterStringRect]; - } - - // label rect - NSRect labelRect; - labelRect.origin.x = labelPosition; - labelRect.size.width = cellFrame.size.width - (labelRect.origin.x - cellFrame.origin.x) - kPSMTabBarCellPadding; - labelRect.size.height = cellFrame.size.height; - labelRect.origin.y = cellFrame.origin.y + MARGIN_Y + 1.0; - - if(![[cell indicator] isHidden]) - labelRect.size.width -= (kPSMTabBarIndicatorWidth + kPSMTabBarCellPadding); - - if([cell count] > 0) - labelRect.size.width -= ([self objectCounterRectForTabCell:cell].size.width + kPSMTabBarCellPadding); - - // label - [[cell attributedStringValue] drawInRect:labelRect]; -} - -- (void)drawTabBar:(PSMTabBarControl *)bar inRect:(NSRect)rect -{ - BOOL isKeyWindow = [bar.window isKeyWindow]; - YosemiteNSDrawWindowBackground(rect, [self backgroundColor:isKeyWindow]); - - [[NSColor colorWithCalibratedWhite:0.0 alpha:0.0] set]; - 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)]; - - // no tab view == not connected - if(![bar tabView]){ - NSRect labelRect = rect; - labelRect.size.height -= 4.0; - labelRect.origin.y += 4.0; - NSMutableAttributedString *attrStr; - NSString *contents = @"PSMTabBarControl"; - attrStr = [[[NSMutableAttributedString alloc] initWithString:contents] autorelease]; - NSRange range = NSMakeRange(0, [contents length]); - [attrStr addAttribute:NSFontAttributeName value:[NSFont systemFontOfSize:11.0] range:range]; - if (!centeredParagraphStyle) { - centeredParagraphStyle = [[[NSParagraphStyle defaultParagraphStyle] mutableCopy] retain]; - [centeredParagraphStyle setAlignment:NSTextAlignmentCenter]; - } - [attrStr addAttribute:NSParagraphStyleAttributeName value:centeredParagraphStyle range:range]; - [attrStr drawInRect:labelRect]; - return; - } - - // draw cells - NSEnumerator *e = [[bar cells] objectEnumerator]; - PSMTabBarCell *cell; - while(cell = [e nextObject]){ - if(![cell isInOverflowMenu]){ - [cell drawWithFrame:[cell frame] inView:bar]; - } - } -} - -#pragma mark - -#pragma mark Archiving - -- (void)encodeWithCoder:(NSCoder *)aCoder -{ - if ([aCoder allowsKeyedCoding]) { - [aCoder encodeObject:closeButton forKey:@"metalCloseButton"]; - [aCoder encodeObject:closeButtonDown forKey:@"metalCloseButtonDown"]; - [aCoder encodeObject:closeButtonOver forKey:@"metalCloseButtonOver"]; - [aCoder encodeObject:_addTabButtonImage forKey:@"addTabButtonImage"]; - [aCoder encodeObject:_addTabButtonPressedImage forKey:@"addTabButtonPressedImage"]; - [aCoder encodeObject:_addTabButtonRolloverImage forKey:@"addTabButtonRolloverImage"]; - } -} - -- (id)initWithCoder:(NSCoder *)aDecoder -{ - if ([aDecoder allowsKeyedCoding]) { - closeButton = [[aDecoder decodeObjectForKey:@"metalCloseButton"] retain]; - closeButtonDown = [[aDecoder decodeObjectForKey:@"metalCloseButtonDown"] retain]; - closeButtonOver = [[aDecoder decodeObjectForKey:@"metalCloseButtonOver"] retain]; - _addTabButtonImage = [[aDecoder decodeObjectForKey:@"addTabButtonImage"] retain]; - _addTabButtonPressedImage = [[aDecoder decodeObjectForKey:@"addTabButtonPressedImage"] retain]; - _addTabButtonRolloverImage = [[aDecoder decodeObjectForKey:@"addTabButtonRolloverImage"] retain]; - } - - return self; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/WindowController.h b/src/MacVim/PSMTabBarControl/source/WindowController.h deleted file mode 100644 index ae655b8bea..0000000000 --- a/src/MacVim/PSMTabBarControl/source/WindowController.h +++ /dev/null @@ -1,58 +0,0 @@ -// -// WindowController.h -// PSMTabBarControl -// -// Created by John Pannell on 4/6/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import -@class PSMTabBarControl; - -@interface WindowController : NSWindowController { - IBOutlet NSTabView *tabView; - IBOutlet NSTextField *tabField; - IBOutlet NSDrawer *drawer; - - IBOutlet PSMTabBarControl *tabBar; - - IBOutlet NSButton *isProcessingButton; - IBOutlet NSTextField *objectCounterField; - IBOutlet NSPopUpButton *iconButton; -} - -// UI -- (IBAction)addNewTab:(id)sender; -- (IBAction)closeTab:(id)sender; -- (IBAction)stopProcessing:(id)sender; -- (IBAction)setIconNamed:(id)sender; -- (IBAction)setObjectCount:(id)sender; -- (IBAction)setTabLabel:(id)sender; - -// Actions -- (IBAction)isProcessingAction:(id)sender; - -// tab bar config -- (void)configStyle:(id)sender; -- (void)configCanCloseOnlyTab:(id)sender; -- (void)configHideForSingleTab:(id)sender; -- (void)configAddTabButton:(id)sender; -- (void)configTabMinWidth:(id)sender; -- (void)configTabMaxWidth:(id)sender; -- (void)configTabOptimumWidth:(id)sender; -- (void)configTabSizeToFit:(id)sender; - -// delegate -- (void)tabView:(NSTabView *)aTabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem; -- (BOOL)tabView:(NSTabView *)aTabView shouldCloseTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)aTabView willCloseTabViewItem:(NSTabViewItem *)tabViewItem; -- (void)tabView:(NSTabView *)aTabView didCloseTabViewItem:(NSTabViewItem *)tabViewItem; - -// toolbar -- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag; -- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar; -- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar; -- (IBAction)toggleToolbar:(id)sender; -- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem; - -@end diff --git a/src/MacVim/PSMTabBarControl/source/WindowController.m b/src/MacVim/PSMTabBarControl/source/WindowController.m deleted file mode 100644 index 07414dbdcf..0000000000 --- a/src/MacVim/PSMTabBarControl/source/WindowController.m +++ /dev/null @@ -1,280 +0,0 @@ -// -// WindowController.m -// PSMTabBarControl -// -// Created by John Pannell on 4/6/06. -// Copyright 2006 Positive Spin Media. All rights reserved. -// - -#import "WindowController.h" -#import "FakeModel.h" -#import "PSMTabBarControl.h" - -@implementation WindowController - -- (void)awakeFromNib -{ - // toolbar - NSToolbar *toolbar = [[NSToolbar alloc] initWithIdentifier:@"DemoToolbar"]; - [toolbar setDelegate:self]; - [toolbar setAllowsUserCustomization:YES]; - [toolbar setAutosavesConfiguration:YES]; - /*SInt32 MacVersion; - if (Gestalt(gestaltSystemVersion, &MacVersion) == noErr){ - if (MacVersion >= 0x1040){ - // this call is Tiger only - [toolbar setShowsBaselineSeparator:NO]; - } - }*/ - [[self window] setToolbar:toolbar]; - - // hook up add tab button - [[tabBar addTabButton] setTarget:self]; - [[tabBar addTabButton] setAction:@selector(addNewTab:)]; - - // remove any tabs present in the nib - NSArray *existingItems = [tabView tabViewItems]; - NSEnumerator *e = [existingItems objectEnumerator]; - NSTabViewItem *item; - while(item = [e nextObject]){ - [tabView removeTabViewItem:item]; - } - - [self addNewTab:self]; - [self addNewTab:self]; - [self addNewTab:self]; - [[tabView tabViewItemAtIndex:0] setLabel:@"Tab"]; - [[tabView tabViewItemAtIndex:1] setLabel:@"Bar"]; - [[tabView tabViewItemAtIndex:2] setLabel:@"Control"]; - - // open drawer - //[drawer toggle:self]; -} - -- (IBAction)addNewTab:(id)sender -{ - FakeModel *newModel = [[FakeModel alloc] init]; - NSTabViewItem *newItem = [[[NSTabViewItem alloc] initWithIdentifier:[newModel controller]] autorelease]; - [newItem setLabel:@"Untitled"]; - [tabView addTabViewItem:newItem]; - [tabView selectTabViewItem:newItem]; // this is optional, but expected behavior - [newModel release]; -} - -- (IBAction)closeTab:(id)sender -{ - [tabView removeTabViewItem:[tabView selectedTabViewItem]]; -} - -- (void)stopProcessing:(id)sender -{ - [[[tabView selectedTabViewItem] identifier] setValue:[NSNumber numberWithBool:NO] forKeyPath:@"selection.isProcessing"]; -} - -- (void)setIconNamed:(id)sender -{ - NSString *iconName = [sender titleOfSelectedItem]; - if([iconName isEqualToString:@"None"]){ - [[[tabView selectedTabViewItem] identifier] setValue:nil forKeyPath:@"selection.icon"]; - [[[tabView selectedTabViewItem] identifier] setValue:@"None" forKeyPath:@"selection.iconName"]; - } else { - NSImage *newIcon = [NSImage imageNamed:iconName]; - [[[tabView selectedTabViewItem] identifier] setValue:newIcon forKeyPath:@"selection.icon"]; - [[[tabView selectedTabViewItem] identifier] setValue:iconName forKeyPath:@"selection.iconName"]; - } -} - -- (void)setObjectCount:(id)sender -{ - [[[tabView selectedTabViewItem] identifier] setValue:[NSNumber numberWithInt:[sender intValue]] forKeyPath:@"selection.objectCount"]; -} - -- (IBAction)isProcessingAction:(id)sender -{ - [[[tabView selectedTabViewItem] identifier] setValue:[NSNumber numberWithBool:[sender state]] forKeyPath:@"selection.isProcessing"]; -} - -- (IBAction)setTabLabel:(id)sender -{ - [[tabView selectedTabViewItem] setLabel:[sender stringValue]]; -} - -- (BOOL)validateMenuItem:(id )menuItem -{ - if([menuItem action] == @selector(closeTab:)){ - if(![tabBar canCloseOnlyTab] && ([tabView numberOfTabViewItems] <= 1)){ - return NO; - } - } - return YES; -} - -#pragma mark - -#pragma mark ---- tab bar config ---- - -- (void)configStyle:(id)sender -{ - [tabBar setStyleNamed:[sender titleOfSelectedItem]]; -} - -- (void)configCanCloseOnlyTab:(id)sender -{ - [tabBar setCanCloseOnlyTab:[sender state]]; -} - -- (void)configHideForSingleTab:(id)sender -{ - [tabBar setHideForSingleTab:[sender state]]; -} - -- (void)configAddTabButton:(id)sender -{ - [tabBar setShowAddTabButton:[sender state]]; -} - -- (void)configTabMinWidth:(id)sender -{ - if([tabBar cellOptimumWidth] < [sender intValue]){ - [tabBar setCellMinWidth:[tabBar cellOptimumWidth]]; - [sender setIntValue:[tabBar cellOptimumWidth]]; - return; - } - - [tabBar setCellMinWidth:[sender intValue]]; -} - -- (void)configTabMaxWidth:(id)sender -{ - if([tabBar cellOptimumWidth] > [sender intValue]){ - [tabBar setCellMaxWidth:[tabBar cellOptimumWidth]]; - [sender setIntValue:[tabBar cellOptimumWidth]]; - return; - } - - [tabBar setCellMaxWidth:[sender intValue]]; -} - -- (void)configTabOptimumWidth:(id)sender -{ - if([tabBar cellMaxWidth] < [sender intValue]){ - [tabBar setCellOptimumWidth:[tabBar cellMaxWidth]]; - [sender setIntValue:[tabBar cellMaxWidth]]; - return; - } - - if([tabBar cellMinWidth] > [sender intValue]){ - [tabBar setCellOptimumWidth:[tabBar cellMinWidth]]; - [sender setIntValue:[tabBar cellMinWidth]]; - return; - } - - [tabBar setCellOptimumWidth:[sender intValue]]; -} - -- (void)configTabSizeToFit:(id)sender -{ - [tabBar setSizeCellsToFit:[sender state]]; -} - -#pragma mark - -#pragma mark ---- delegate ---- - -- (void)tabView:(NSTabView *)aTabView didSelectTabViewItem:(NSTabViewItem *)tabViewItem -{ - // need to update bound values to match the selected tab - if([[tabViewItem identifier] respondsToSelector:@selector(content)]){ - if([[[tabViewItem identifier] content] respondsToSelector:@selector(objectCount)]){ - [objectCounterField setIntValue:[[[tabViewItem identifier] content] objectCount]]; - } - } - if([[tabViewItem identifier] respondsToSelector:@selector(content)]){ - if([[[tabViewItem identifier] content] respondsToSelector:@selector(isProcessing)]){ - [isProcessingButton setState:[[[tabViewItem identifier] content] isProcessing]]; - } - } - if([[tabViewItem identifier] respondsToSelector:@selector(content)]){ - if([[[tabViewItem identifier] content] respondsToSelector:@selector(iconName)]){ - NSString *newName = [[[tabViewItem identifier] content] iconName]; - if(newName){ - [iconButton selectItem:[[iconButton menu] itemWithTitle:newName]]; - } else { - [iconButton selectItem:[[iconButton menu] itemWithTitle:@"None"]]; - } - } - } -} - -- (BOOL)tabView:(NSTabView *)aTabView shouldCloseTabViewItem:(NSTabViewItem *)tabViewItem -{ - if([[tabViewItem label] isEqualToString:@"Drake"]){ - NSAlert *drakeAlert = [NSAlert alertWithMessageText:@"No Way!" defaultButton:@"OK" alternateButton:nil otherButton:nil informativeTextWithFormat:@"I refuse to close a tab named \"Drake\""]; - [drakeAlert beginSheetModalForWindow:[NSApp keyWindow] modalDelegate:nil didEndSelector:nil contextInfo:nil]; - return NO; - } - return YES; -} - -- (void)tabView:(NSTabView *)aTabView willCloseTabViewItem:(NSTabViewItem *)tabViewItem -{ - NSLog(@"willCloseTabViewItem: %@", [tabViewItem label]); -} - -- (void)tabView:(NSTabView *)aTabView didCloseTabViewItem:(NSTabViewItem *)tabViewItem -{ - NSLog(@"didCloseTabViewItem: %@", [tabViewItem label]); -} - -#pragma mark - -#pragma mark ---- toolbar ---- - -- (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag -{ - NSToolbarItem *item = [[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier]; - - if([itemIdentifier isEqualToString:@"TabField"]){ - [item setPaletteLabel:@"Tab Label"]; - [item setLabel:@"Tab Label"]; - [item setView:tabField]; - [item setMinSize:NSMakeSize(100, [tabField frame].size.height)]; - [item setMaxSize:NSMakeSize(500, [tabField frame].size.height)]; - - } else if([itemIdentifier isEqualToString:@"DrawerItem"]){ - [item setPaletteLabel:@"Configuration"]; - [item setLabel:@"Configuration"]; - [item setToolTip:@"Configuration"]; - [item setImage:[NSImage imageNamed:@"32x32_log"]]; - [item setTarget:drawer]; - [item setAction:@selector(toggle:)]; - - } - - return [item autorelease]; -} - -- (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar -{ - return [NSArray arrayWithObjects:@"TabField", - NSToolbarFlexibleSpaceItemIdentifier, - @"DrawerItem", - nil]; -} - -- (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar -{ - return [NSArray arrayWithObjects:@"TabField", - NSToolbarFlexibleSpaceItemIdentifier, - @"DrawerItem", - nil]; -} - -- (IBAction)toggleToolbar:(id)sender -{ - [[[self window] toolbar] setVisible:![[[self window] toolbar] isVisible]]; -} - -- (BOOL)validateToolbarItem:(NSToolbarItem *)theItem -{ - return YES; -} - -@end diff --git a/src/MacVim/PSMTabBarControl/source/main.m b/src/MacVim/PSMTabBarControl/source/main.m deleted file mode 100644 index bcdabbe7b0..0000000000 --- a/src/MacVim/PSMTabBarControl/source/main.m +++ /dev/null @@ -1,14 +0,0 @@ -// -// main.m -// TabBarControl -// -// Created by John Pannell on 12/18/05. -// Copyright Positive Spin Media 2005. All rights reserved. -// - -#import - -int main(int argc, char *argv[]) -{ - return NSApplicationMain(argc, (const char **) argv); -} diff --git a/src/MacVim/PSMTabBarControl/version.plist b/src/MacVim/PSMTabBarControl/version.plist deleted file mode 100644 index df8c3dc7d1..0000000000 --- a/src/MacVim/PSMTabBarControl/version.plist +++ /dev/null @@ -1,16 +0,0 @@ - - - - - BuildVersion - 92 - CFBundleVersion - 1.0 - ProductBuildVersion - 7K571 - ProjectName - NibPBTemplates - SourceVersion - 1200000 - -