Permalink
Browse files

Updated to the latest version from maccode

  • Loading branch information...
1 parent 31406dd commit e2aa0f3342f6df3070b0b0a477226cac809920fe @dparnell committed Jun 13, 2009
Showing with 6,391 additions and 2,432 deletions.
  1. +1 −0 .gitignore
  2. +26 −0 English.lproj/PSMTabBarInspector.nib/classes.nib
  3. +0 −1,400 English.lproj/PSMTabBarInspector.nib/designable.nib
  4. +16 −0 English.lproj/PSMTabBarInspector.nib/info.nib
  5. BIN English.lproj/PSMTabBarInspector.nib/keyedobjects.nib
  6. BIN English.lproj/PSMTabBarInspector.nib/objects.nib
  7. +160 −30 PSMTabBar.xcodeproj/project.pbxproj
  8. +2 −0 PSMTabBar_Prefix.pch
  9. BIN images/32x32_log.png
  10. BIN images/32x32cancel.png
  11. BIN images/AdiumGradient.png
  12. BIN images/AquaTabCloseDirty_Front.png
  13. BIN images/AquaTabCloseDirty_Front_Pressed.png
  14. BIN images/AquaTabCloseDirty_Front_Rollover.png
  15. BIN images/AquaTabClose_Front.png
  16. BIN images/AquaTabClose_Front_Pressed.png
  17. BIN images/AquaTabClose_Front_Rollover.png
  18. BIN images/AquaTabNew.png
  19. BIN images/AquaTabNewPressed.png
  20. BIN images/AquaTabNewRollover.png
  21. BIN images/AquaTabsBackground.png
  22. BIN images/AquaTabsDown.png
  23. BIN images/AquaTabsDownGraphite.png
  24. BIN images/AquaTabsDownNonKey.png
  25. BIN images/AquaTabsSeparator.png
  26. BIN images/AquaTabsSeparatorDown.png
  27. BIN images/Folder.png
  28. BIN images/Globe.png
  29. BIN images/TabClose_Dirty.png
  30. BIN images/TabClose_Dirty_Pressed.png
  31. BIN images/TabClose_Dirty_Rollover.png
  32. BIN images/TabClose_Front.png
  33. BIN images/TabClose_Front_Pressed.png
  34. BIN images/TabClose_Front_Rollover.png
  35. BIN images/TabControlRep.png
  36. BIN images/TabIcon.png
  37. BIN images/TabNewMetal.png
  38. BIN images/TabNewMetalPressed.png
  39. BIN images/TabNewMetalRollover.png
  40. BIN images/Warning.png
  41. BIN images/largeImage.png
  42. BIN images/mater_large.jpg
  43. BIN images/mcqueen_large.jpg
  44. BIN images/overflowImage.png
  45. BIN images/overflowImagePressed.png
  46. BIN images/pi.png
  47. BIN images/sally_large.jpg
  48. +1 −0 source/AppController.m
  49. +3 −2 source/FakeModel.h
  50. +23 −5 source/FakeModel.m
  51. +5 −0 source/Framework_Prefix.pch
  52. +23 −0 source/NSBezierPath_AMShading.h
  53. +127 −0 source/NSBezierPath_AMShading.m
  54. +12 −0 source/NSString_AITruncation.h
  55. +34 −0 source/NSString_AITruncation.m
  56. +39 −0 source/PSMAdiumTabStyle.h
  57. +1,056 −0 source/PSMAdiumTabStyle.m
  58. +6 −0 source/PSMAquaTabStyle.h
  59. +117 −59 source/PSMAquaTabStyle.m
  60. +8 −0 source/PSMMetalTabStyle.h
  61. +245 −119 source/PSMMetalTabStyle.m
  62. +7 −0 source/PSMOverflowPopUpButton.h
  63. +81 −9 source/PSMOverflowPopUpButton.m
  64. +7 −0 source/PSMProgressIndicator.m
  65. +91 −15 source/PSMRolloverButton.m
  66. +16 −2 source/PSMTabBarCell.h
  67. +181 −42 source/PSMTabBarCell.m
  68. +134 −18 source/PSMTabBarControl.h
  69. +1,339 −559 source/PSMTabBarControl.m
  70. +5 −0 source/PSMTabBarControlInspector.h
  71. +34 −23 source/PSMTabBarControlInspector.m
  72. +2 −0 source/PSMTabBarControl_Prefix.pch
  73. +33 −0 source/PSMTabBarController.h
  74. +665 −0 source/PSMTabBarController.m
  75. +20 −4 source/PSMTabDragAssistant.h
  76. +532 −83 source/PSMTabDragAssistant.m
  77. +20 −0 source/PSMTabDragView.h
  78. +68 −0 source/PSMTabDragView.m
  79. +20 −0 source/PSMTabDragWindow.h
  80. +51 −0 source/PSMTabDragWindow.m
  81. +33 −0 source/PSMTabDragWindowController.h
  82. +119 −0 source/PSMTabDragWindowController.m
  83. +7 −2 source/PSMTabStyle.h
  84. +30 −0 source/PSMUnifiedTabStyle.h
  85. +599 −0 source/PSMUnifiedTabStyle.m
  86. +28 −1 source/WindowController.h
  87. +365 −59 source/WindowController.m
View
@@ -3,3 +3,4 @@ _darcs
*.mode1v3
*.pbxuser
.DS_Store
+.svn

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Binary file not shown.
Binary file not shown.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -2,6 +2,8 @@
// Prefix header for all source files of the 'PSMTabBar' target in the 'PSMTabBar' project.
//
+#include <Carbon/Carbon.h>
+
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#import <InterfaceBuilderKit/InterfaceBuilderKit.h>
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
Diff not rendered.
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
Diff not rendered.
View
Diff not rendered.
View
Diff not rendered.
View
@@ -25,6 +25,7 @@ - (IBAction)newWindow:(id)sender
// put up a window
WindowController *newWindow = [[WindowController alloc] initWithWindowNibName:@"Window"];
[newWindow showWindow:self];
+ [newWindow addDefaultTabs];
}
@end
View
@@ -13,8 +13,8 @@
BOOL _isProcessing;
NSImage *_icon;
NSString *_iconName;
- NSObjectController *controller;
int _objectCount;
+ BOOL _isEdited;
}
// creation/destruction
@@ -29,6 +29,7 @@
- (void)setIconName:(NSString *)iconName;
- (int)objectCount;
- (void)setObjectCount:(int)value;
-- (NSObjectController *)controller;
+- (BOOL)isEdited;
+- (void)setIsEdited:(BOOL)value;
@end
View
@@ -13,12 +13,12 @@ @implementation FakeModel
- (id)init
{
- if(self == [super init]){
- _isProcessing = YES;
+ if ( (self == [super init]) ) {
+ _isProcessing = NO;
_icon = nil;
_iconName = nil;
_objectCount = 2;
- controller = [[NSObjectController alloc] initWithContent:self];
+ _isEdited = NO;
}
return self;
}
@@ -69,9 +69,27 @@ - (void)setObjectCount:(int)value
_objectCount = value;
}
-- (NSObjectController *)controller
+- (BOOL)isEdited
{
- return controller;
+ return _isEdited;
+}
+
+- (void)setIsEdited:(BOOL)value
+{
+ _isEdited = value;
+}
+
+
+- (NSImage *)largeImage
+{
+ return [NSImage imageNamed:@"largeImage"];
+}
+
+- (void)setLargeImage:(NSImage *)icon
+{
+ [icon retain];
+ [_icon release];
+ _icon = icon;
}
@end
@@ -0,0 +1,5 @@
+#include <Carbon/Carbon.h>
+
+#ifdef __OBJC__
+# import <Cocoa/Cocoa.h>
+#endif
@@ -0,0 +1,23 @@
+//
+// 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 <Cocoa/Cocoa.h>
+
+@interface NSBezierPath (AMShading)
+
+- (void)customHorizontalFillWithCallbacks:(CGFunctionCallbacks)functionCallbacks firstColor:(NSColor *)firstColor secondColor:(NSColor *)secondColor;
+- (void)customVerticalFillWithCallbacks:(CGFunctionCallbacks)functionCallbacks firstColor:(NSColor *)firstColor secondColor:(NSColor *)secondColor;
+
+- (void)linearGradientFillWithStartColor:(NSColor *)startColor endColor:(NSColor *)endColor;
+- (void)linearVerticalGradientFillWithStartColor:(NSColor *)startColor endColor:(NSColor *)endColor;
+
+- (void)bilinearGradientFillWithOuterColor:(NSColor *)outerColor innerColor:(NSColor *)innerColor;
+
+@end
@@ -0,0 +1,127 @@
+//
+// NSBezierPath_AMShading.m
+// ------------------------
+//
+// Created by Andreas on 2005-06-01.
+// Copyright 2005 Andreas Mayer. All rights reserved.
+//
+
+#import "NSBezierPath_AMShading.h"
+
+
+@implementation NSBezierPath (AMShading)
+
+static void linearShadedColor(void *info, const float *in, float *out)
+{
+ float *colors = (float *)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 float *in, float *out)
+{
+ float *colors = (float *)info;
+ float 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
+{
+ static const CGFunctionCallbacks callbacks = {0, &linearShadedColor, NULL};
+
+ [self customHorizontalFillWithCallbacks:callbacks firstColor:startColor secondColor:endColor];
+}
+
+- (void)linearVerticalGradientFillWithStartColor:(NSColor *)startColor endColor:(NSColor *)endColor
+{
+ static const CGFunctionCallbacks callbacks = {0, &linearShadedColor, NULL};
+
+ [self customVerticalFillWithCallbacks: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)customFillWithCallbacks:(CGFunctionCallbacks)functionCallbacks firstColor:(NSColor *)firstColor secondColor:(NSColor *)secondColor startPoint:(CGPoint)startPoint endPoint:(CGPoint)endPoint
+{
+ CGColorSpaceRef colorspace;
+ CGShadingRef shading;
+ CGFunctionRef function;
+ float 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 float domain[2] = {0.0, 1.0};
+ static const float 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);
+
+ shading = CGShadingCreateAxial(colorspace, startPoint, endPoint, function, NO, NO);
+
+ CGContextSaveGState(currentContext);
+ [self addClip];
+ CGContextDrawShading(currentContext, shading);
+ CGContextRestoreGState(currentContext);
+
+ CGShadingRelease(shading);
+ CGFunctionRelease(function);
+ CGColorSpaceRelease(colorspace);
+}
+
+- (void)customHorizontalFillWithCallbacks:(CGFunctionCallbacks)functionCallbacks firstColor:(NSColor *)firstColor secondColor:(NSColor *)secondColor
+{
+ [self customFillWithCallbacks:functionCallbacks
+ firstColor:firstColor
+ secondColor:secondColor
+ startPoint:CGPointMake(0, NSMinY([self bounds]))
+ endPoint:CGPointMake(0, NSMaxY([self bounds]))];
+}
+
+- (void)customVerticalFillWithCallbacks:(CGFunctionCallbacks)functionCallbacks firstColor:(NSColor *)firstColor secondColor:(NSColor *)secondColor
+{
+ [self customFillWithCallbacks:functionCallbacks
+ firstColor:firstColor
+ secondColor:secondColor
+ startPoint:CGPointMake(NSMinX([self bounds]), 0)
+ endPoint:CGPointMake(NSMaxX([self bounds]), 0)];
+}
+
+@end
@@ -0,0 +1,12 @@
+//
+// NSString_AITruncation.h
+// PSMTabBarControl
+//
+// Created by Evan Schoenberg on 7/14/07.
+//
+
+#import <Cocoa/Cocoa.h>
+
+@interface NSString (AITruncation)
+- (NSString *)stringWithEllipsisByTruncatingToLength:(unsigned int)length;
+@end
@@ -0,0 +1,34 @@
+//
+// NSString_AITruncation.m
+// PSMTabBarControl
+//
+// Created by Evan Schoenberg on 7/14/07.
+// From Adium, which is licensed under the GPL. Used in PSMTabBarControl with permission.
+// The contents of this remain licensed under the GPL.
+//
+
+#import "NSString_AITruncation.h"
+
+@implementation NSString (AITruncation)
+
++ (id)ellipsis
+{
+ return [NSString stringWithUTF8String:"\xE2\x80\xA6"];
+}
+
+- (NSString *)stringWithEllipsisByTruncatingToLength:(unsigned int)length
+{
+ NSString *returnString;
+
+ if (length < [self length]) {
+ //Truncate and append the ellipsis
+ returnString = [[self substringToIndex:length-1] stringByAppendingString:[NSString ellipsis]];
+ } else {
+ //We don't need to truncate, so don't append an ellipsis
+ returnString = [[self copy] autorelease];
+ }
+
+ return returnString;
+}
+
+@end
View
@@ -0,0 +1,39 @@
+//
+// PSMAdiumTabStyle.h
+// PSMTabBarControl
+//
+// Created by Kent Sutherland on 5/26/06.
+// Copyright 2006 Kent Sutherland. All rights reserved.
+//
+
+#import <Cocoa/Cocoa.h>
+#import "PSMTabStyle.h"
+
+@interface PSMAdiumTabStyle : NSObject <PSMTabStyle>
+{
+ NSImage *_closeButton, *_closeButtonDown, *_closeButtonOver;
+ NSImage *_closeDirtyButton, *_closeDirtyButtonDown, *_closeDirtyButtonOver;
+ NSImage *_addTabButtonImage, *_addTabButtonPressedImage, *_addTabButtonRolloverImage;
+ NSImage *_gradientImage;
+
+ NSDictionary *_objectCountStringAttributes;
+
+ PSMTabBarOrientation orientation;
+ PSMTabBarControl *tabBar;
+
+ BOOL _drawsUnified, _drawsRight;
+}
+
+- (void)loadImages;
+
+- (BOOL)drawsUnified;
+- (void)setDrawsUnified:(BOOL)value;
+- (BOOL)drawsRight;
+- (void)setDrawsRight:(BOOL)value;
+
+- (void)drawInteriorWithTabCell:(PSMTabBarCell *)cell inView:(NSView*)controlView;
+
+- (void)encodeWithCoder:(NSCoder *)aCoder;
+- (id)initWithCoder:(NSCoder *)aDecoder;
+
+@end
Oops, something went wrong.

0 comments on commit e2aa0f3

Please sign in to comment.