Revision: 5715
http://skim-app.svn.sourceforge.net/skim-app/?rev=5715&view=rev
Author: hofman
Date: 2009-09-08 16:15:07 +0000 (Tue, 08 Sep 2009)
Log Message:
-----------
use new leopard bezierpath method and remove unused bezierpath methods
Modified Paths:
--------------
trunk/NSBezierPath_BDSKExtensions.h
trunk/NSBezierPath_BDSKExtensions.m
trunk/NSImage_SKExtensions.m
trunk/SKNavigationWindow.m
trunk/SKPDFView.m
trunk/SKRemoteStateWindow.m
Modified: trunk/NSBezierPath_BDSKExtensions.h
===================================================================
--- trunk/NSBezierPath_BDSKExtensions.h 2009-09-08 16:00:12 UTC (rev 5714)
+++ trunk/NSBezierPath_BDSKExtensions.h 2009-09-08 16:15:07 UTC (rev 5715)
@@ -40,33 +40,17 @@
@interface NSBezierPath (BDSKExtensions)
-+ (void)fillRoundRectInRect:(NSRect)rect radius:(CGFloat)radius;
-+ (void)strokeRoundRectInRect:(NSRect)rect radius:(CGFloat)radius;
-+ (NSBezierPath *)bezierPathWithRoundRectInRect:(NSRect)rect
radius:(CGFloat)radius;
+ (void)fillLeftRoundRectInRect:(NSRect)rect radius:(CGFloat)radius;
+ (void)strokeLeftRoundRectInRect:(NSRect)rect radius:(CGFloat)radius;
+ (NSBezierPath *)bezierPathWithLeftRoundRectInRect:(NSRect)rect
radius:(CGFloat)radius;
+ (void)fillRightRoundRectInRect:(NSRect)rect radius:(CGFloat)radius;
+ (void)strokeRightRoundRectInRect:(NSRect)rect radius:(CGFloat)radius;
+ (NSBezierPath *)bezierPathWithRightRoundRectInRect:(NSRect)rect
radius:(CGFloat)radius;
-+ (void)fillTopRoundRectInRect:(NSRect)rect radius:(CGFloat)radius;
-+ (void)strokeTopRoundRectInRect:(NSRect)rect radius:(CGFloat)radius;
-+ (NSBezierPath *)bezierPathWithTopRoundRectInRect:(NSRect)rect
radius:(CGFloat)radius;
-+ (void)fillBottomRoundRectInRect:(NSRect)rect radius:(CGFloat)radius;
-+ (void)strokeBottomRoundRectInRect:(NSRect)rect radius:(CGFloat)radius;
-+ (NSBezierPath *)bezierPathWithBottomRoundRectInRect:(NSRect)rect
radius:(CGFloat)radius;
-+ (void)drawHighlightInRect:(NSRect)rect radius:(CGFloat)radius
lineWidth:(CGFloat)lineWidth color:(NSColor *)color;
-
+ (void)fillHorizontalOvalAroundRect:(NSRect)rect;
+ (void)strokeHorizontalOvalAroundRect:(NSRect)rect;
+ (NSBezierPath*)bezierPathWithHorizontalOvalAroundRect:(NSRect)rect;
-+ (void)fillStarInRect:(NSRect)rect;
-+ (void)fillInvertedStarInRect:(NSRect)rect;
-+ (NSBezierPath *)bezierPathWithStarInRect:(NSRect)rect;
-+ (NSBezierPath *)bezierPathWithInvertedStarInRect:(NSRect)rect;
-
- (NSRect)nonEmptyBounds;
- (NSPoint)associatedPointForElementAtIndex:(NSUInteger)anIndex;
Modified: trunk/NSBezierPath_BDSKExtensions.m
===================================================================
--- trunk/NSBezierPath_BDSKExtensions.m 2009-09-08 16:00:12 UTC (rev 5714)
+++ trunk/NSBezierPath_BDSKExtensions.m 2009-09-08 16:15:07 UTC (rev 5715)
@@ -44,50 +44,6 @@
// code from http://www.cocoadev.com/index.pl?NSBezierPathCategory
// removed UK rect function calls, changed spacing/alignment
-+ (void)fillRoundRectInRect:(NSRect)rect radius:(CGFloat)radius
-{
- NSBezierPath *p = [self bezierPathWithRoundRectInRect:rect radius:radius];
- [p fill];
-}
-
-
-+ (void)strokeRoundRectInRect:(NSRect)rect radius:(CGFloat)radius
-{
- NSBezierPath *p = [self bezierPathWithRoundRectInRect:rect radius:radius];
- [p stroke];
-}
-
-+ (NSBezierPath *)bezierPathWithRoundRectInRect:(NSRect)rect
radius:(CGFloat)radius
-{
- // Make sure radius doesn't exceed a maximum size to avoid artifacts:
- radius = SKMin(radius, 0.5f * SKMin(NSHeight(rect), NSWidth(rect)));
-
- // Make sure silly values simply lead to un-rounded corners:
- if( radius <= 0 )
- return [self bezierPathWithRect:rect];
-
- NSRect innerRect = NSInsetRect(rect, radius, radius); // Make rect with
corners being centers of the corner circles.
- NSBezierPath *path = [self bezierPath];
-
- [path removeAllPoints];
-
- // Now draw our rectangle:
- [path moveToPoint: NSMakePoint(NSMinX(innerRect) - radius,
NSMinY(innerRect))];
-
- // Bottom left (origin):
- [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(innerRect),
NSMinY(innerRect)) radius:radius startAngle:180.0 endAngle:270.0];
- // Bottom edge and bottom right:
- [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(innerRect),
NSMinY(innerRect)) radius:radius startAngle:270.0 endAngle:360.0];
- // Right edge and top right:
- [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(innerRect),
NSMaxY(innerRect)) radius:radius startAngle:0.0 endAngle:90.0 ];
- // Top edge and top left:
- [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(innerRect),
NSMaxY(innerRect)) radius:radius startAngle:90.0 endAngle:180.0];
- // Left edge:
- [path closePath];
-
- return path;
-}
-
+ (void)fillLeftRoundRectInRect:(NSRect)rect radius:(CGFloat)radius
{
NSBezierPath *p = [self bezierPathWithLeftRoundRectInRect:rect
radius:radius];
@@ -174,102 +130,6 @@
return path;
}
-+ (void)fillTopRoundRectInRect:(NSRect)rect radius:(CGFloat)radius
-{
- NSBezierPath *p = [self bezierPathWithTopRoundRectInRect:rect
radius:radius];
- [p fill];
-}
-
-
-+ (void)strokeTopRoundRectInRect:(NSRect)rect radius:(CGFloat)radius
-{
- NSBezierPath *p = [self bezierPathWithTopRoundRectInRect:rect
radius:radius];
- [p stroke];
-}
-
-+ (NSBezierPath *)bezierPathWithTopRoundRectInRect:(NSRect)rect
radius:(CGFloat)radius
-{
- // Make sure radius doesn't exceed a maximum size to avoid artifacts:
- radius = SKMin(radius, SKMin(NSHeight(rect), 0.5f * NSWidth(rect)));
-
- // Make sure silly values simply lead to un-rounded corners:
- if( radius <= 0 )
- return [self bezierPathWithRect:rect];
-
- NSRect ignored, innerRect;
- NSDivideRect(NSInsetRect(rect, radius, 0.0), &ignored, &innerRect, radius,
NSMaxYEdge); // Make rect with corners being centers of the corner circles.
- NSBezierPath *path = [self bezierPath];
-
- [path removeAllPoints];
-
- // Now draw our rectangle:
- [path moveToPoint: NSMakePoint(NSMinX(rect), NSMinY(rect))];
-
- // Bottom edge:
- [path lineToPoint:NSMakePoint(NSMaxX(rect), NSMinY(rect))];
- // Right edge and top right:
- [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(innerRect),
NSMaxY(innerRect)) radius:radius startAngle:0.0 endAngle:90.0 ];
- // Top edge and top left:
- [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(innerRect),
NSMaxY(innerRect)) radius:radius startAngle:90.0 endAngle:180.0];
- // Left edge:
- [path closePath];
-
- return path;
-}
-
-+ (void)fillBottomRoundRectInRect:(NSRect)rect radius:(CGFloat)radius
-{
- NSBezierPath *p = [self bezierPathWithBottomRoundRectInRect:rect
radius:radius];
- [p fill];
-}
-
-
-+ (void)strokeBottomRoundRectInRect:(NSRect)rect radius:(CGFloat)radius
-{
- NSBezierPath *p = [self bezierPathWithBottomRoundRectInRect:rect
radius:radius];
- [p stroke];
-}
-
-+ (NSBezierPath *)bezierPathWithBottomRoundRectInRect:(NSRect)rect
radius:(CGFloat)radius
-{
- // Make sure radius doesn't exceed a maximum size to avoid artifacts:
- radius = SKMin(radius, SKMin(NSHeight(rect), 0.5f * NSWidth(rect)));
-
- // Make sure silly values simply lead to un-rounded corners:
- if( radius <= 0 )
- return [self bezierPathWithRect:rect];
-
- NSRect ignored, innerRect;
- NSDivideRect(NSInsetRect(rect, radius, 0.0), &ignored, &innerRect, radius,
NSMinYEdge); // Make rect with corners being centers of the corner circles.
- NSBezierPath *path = [self bezierPath];
-
- [path removeAllPoints];
-
- // Now draw our rectangle:
- [path moveToPoint: NSMakePoint(NSMaxX(rect), NSMaxY(rect))];
-
- // Top edge:
- [path lineToPoint:NSMakePoint(NSMinX(rect), NSMaxY(rect))];
- // Left edge and bottom left:
- [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMinX(innerRect),
NSMinY(innerRect)) radius:radius startAngle:180.0 endAngle:270.0];
- // Bottom edge and bottom right:
- [path appendBezierPathWithArcWithCenter:NSMakePoint(NSMaxX(innerRect),
NSMinY(innerRect)) radius:radius startAngle:270.0 endAngle:360.0];
- // Left edge:
- [path closePath];
-
- return path;
-}
-
-+ (void)drawHighlightInRect:(NSRect)rect radius:(CGFloat)radius
lineWidth:(CGFloat)lineWidth color:(NSColor *)color
-{
- NSBezierPath *path = [NSBezierPath
bezierPathWithRoundRectInRect:NSInsetRect(rect, 0.5 * lineWidth, 0.5 *
lineWidth) radius:radius];
- [path setLineWidth:lineWidth];
- [[color colorWithAlphaComponent:0.2] setFill];
- [[color colorWithAlphaComponent:0.8] setStroke];
- [path fill];
- [path stroke];
-}
-
+ (void)fillHorizontalOvalAroundRect:(NSRect)rect
{
NSBezierPath *p = [self bezierPathWithHorizontalOvalAroundRect:rect];
@@ -303,50 +163,6 @@
return path;
}
-+ (void)fillStarInRect:(NSRect)rect{
- [[self bezierPathWithStarInRect:rect] fill];
-}
-
-+ (void)fillInvertedStarInRect:(NSRect)rect{
- [[self bezierPathWithInvertedStarInRect:rect] fill];
-}
-
-+ (NSBezierPath *)bezierPathWithStarInRect:(NSRect)rect{
- CGFloat centerX = NSMidX(rect);
- CGFloat centerY = NSMidY(rect);
- CGFloat radiusX = 0.5 * NSWidth(rect);
- CGFloat radiusY = 0.5 * NSHeight(rect);
- NSInteger i = 0;
- NSBezierPath *path = [self bezierPath];
-
- [path removeAllPoints];
-
- [path moveToPoint: NSMakePoint(NSMidX(rect), NSMaxY(rect))];
- while(++i < 5)
- [path lineToPoint:NSMakePoint(centerX + sin(0.8 * M_PI * i) * radiusX,
centerY + cos(0.8 * M_PI * i) * radiusY)];
- [path closePath];
-
- return path;
-}
-
-+ (NSBezierPath *)bezierPathWithInvertedStarInRect:(NSRect)rect{
- CGFloat centerX = NSMidX(rect);
- CGFloat centerY = NSMidY(rect);
- CGFloat radiusX = 0.5 * NSWidth(rect);
- CGFloat radiusY = 0.5 * NSHeight(rect);
- NSInteger i;
- NSBezierPath *path = [self bezierPath];
-
- [path removeAllPoints];
-
- [path moveToPoint:NSMakePoint(NSMidX(rect), NSMinY(rect))];
- for(i = 1; i < 5; i++)
- [path lineToPoint:NSMakePoint(centerX + sinf(0.8 * M_PI * i) *
radiusX, centerY - cosf(0.8 * M_PI * i) * radiusY)];
- [path closePath];
-
- return path;
-}
-
- (NSPoint)associatedPointForElementAtIndex:(NSUInteger)anIndex {
NSPoint points[3];
if (NSCurveToBezierPathElement == [self elementAtIndex:anIndex
associatedPoints:points])
Modified: trunk/NSImage_SKExtensions.m
===================================================================
--- trunk/NSImage_SKExtensions.m 2009-09-08 16:00:12 UTC (rev 5714)
+++ trunk/NSImage_SKExtensions.m 2009-09-08 16:15:07 UTC (rev 5715)
@@ -628,7 +628,7 @@
NSRectFill(NSMakeRect(0.0, 0.0, 27.0, 21.0));
[shadow1 set];
[fgColor set];
- path = [NSBezierPath bezierPathWithRoundRectInRect:NSMakeRect(5.0, 4.0,
17.0, 14.0) radius:2.0];
+ path = [NSBezierPath bezierPathWithRoundedRect:NSMakeRect(5.0, 4.0, 17.0,
14.0) xRadius:2.0 yRadius:2.0];
[path appendBezierPathWithRect:NSMakeRect(7.0, 6.0, 13.0, 10.0)];
[path moveToPoint:NSMakePoint(8.0, 7.0)];
[path lineToPoint:NSMakePoint(11.0, 7.0)];
@@ -659,7 +659,7 @@
NSRectFill(NSMakeRect(0.0, 0.0, 27.0, 21.0));
[shadow1 set];
[fgColor set];
- path = [NSBezierPath bezierPathWithRoundRectInRect:NSMakeRect(5.0, 4.0,
17.0, 14.0) radius:2.0];
+ path = [NSBezierPath bezierPathWithRoundedRect:NSMakeRect(5.0, 4.0, 17.0,
14.0) xRadius:2.0 yRadius:2.0];
[path appendBezierPathWithRect:NSMakeRect(7.0, 6.0, 13.0, 10.0)];
[path moveToPoint:NSMakePoint(11.0, 7.0)];
[path lineToPoint:NSMakePoint(18.5, 11.0)];
Modified: trunk/SKNavigationWindow.m
===================================================================
--- trunk/SKNavigationWindow.m 2009-09-08 16:00:12 UTC (rev 5714)
+++ trunk/SKNavigationWindow.m 2009-09-08 16:15:07 UTC (rev 5715)
@@ -179,11 +179,11 @@
[[NSGraphicsContext currentContext] saveGraphicsState];
rect = NSInsetRect([self bounds], 1.0, 1.0);
[[NSColor colorWithDeviceWhite:0.0 alpha:0.5] set];
- [NSBezierPath fillRoundRectInRect:rect radius:10.0];
+ [[NSBezierPath bezierPathWithRoundedRect:rect xRadius:10.0 yRadius:10.0]
fill];
rect = NSInsetRect([self bounds], 0.5, 0.5);
[[NSColor colorWithDeviceWhite:1.0 alpha:0.2] set];
[NSBezierPath setDefaultLineWidth:1.0];
- [NSBezierPath strokeRoundRectInRect:rect radius:10.0];
+ [[NSBezierPath bezierPathWithRoundedRect:rect xRadius:10.0 yRadius:10.0]
stroke];
[[NSGraphicsContext currentContext] restoreGraphicsState];
}
@@ -538,7 +538,7 @@
[[NSColor colorWithDeviceWhite:1.0 alpha:0.3] setStroke];
}
- NSBezierPath *path = [NSBezierPath bezierPathWithRoundRectInRect:frame
radius:2.0];
+ NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:frame
xRadius:2.0 yRadius:2.0];
[path fill];
[path stroke];
}
@@ -604,7 +604,7 @@
static inline NSBezierPath *zoomButtonPath(NSSize size) {
NSRect bounds = {NSZeroPoint, size};
- NSBezierPath *path = [NSBezierPath
bezierPathWithRoundRectInRect:NSInsetRect(bounds, 15.0, 15.0) radius:3.0];
+ NSBezierPath *path = [NSBezierPath
bezierPathWithRoundedRect:NSInsetRect(bounds, 15.0, 15.0) xRadius:3.0
yRadius:3.0];
CGFloat centerX = NSMidX(bounds), centerY = NSMidY(bounds);
[path appendBezierPath:[NSBezierPath
bezierPathWithRect:NSInsetRect(bounds, 19.0, 19.0)]];
@@ -641,7 +641,7 @@
static inline NSBezierPath *alternateZoomButtonPath(NSSize size) {
NSRect bounds = {NSZeroPoint, size};
- NSBezierPath *path = [NSBezierPath
bezierPathWithRoundRectInRect:NSInsetRect(bounds, 15.0, 15.0) radius:3.0];
+ NSBezierPath *path = [NSBezierPath
bezierPathWithRoundedRect:NSInsetRect(bounds, 15.0, 15.0) xRadius:3.0
yRadius:3.0];
CGFloat centerX = NSMidX(bounds), centerY = NSMidY(bounds);
[path appendBezierPath:[NSBezierPath
bezierPathWithRect:NSInsetRect(bounds, 19.0, 19.0)]];
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2009-09-08 16:00:12 UTC (rev 5714)
+++ trunk/SKPDFView.m 2009-09-08 16:15:07 UTC (rev 5715)
@@ -4046,7 +4046,7 @@
outlineRect = [clipView convertRect:magRect fromView:nil];
[aShadow set];
[color set];
- path = [NSBezierPath bezierPathWithRoundRectInRect:outlineRect
radius:9.5];
+ path = [NSBezierPath bezierPathWithRoundedRect:outlineRect
xRadius:9.5 yRadius:9.5];
[path fill];
[clipView unlockFocus];
@@ -4057,7 +4057,7 @@
[clipView lockFocus];
outlineRect = NSInsetRect(outlineRect, 1.5, 1.5);
[color set];
- path = [NSBezierPath bezierPathWithRoundRectInRect:outlineRect
radius:8.0];
+ path = [NSBezierPath bezierPathWithRoundedRect:outlineRect
xRadius:8.0 yRadius:8.0];
[path setLineWidth:3.0];
[path stroke];
[clipView unlockFocus];
Modified: trunk/SKRemoteStateWindow.m
===================================================================
--- trunk/SKRemoteStateWindow.m 2009-09-08 16:00:12 UTC (rev 5714)
+++ trunk/SKRemoteStateWindow.m 2009-09-08 16:15:07 UTC (rev 5715)
@@ -113,13 +113,13 @@
NSPoint center = SKCenterPoint(bounds);
[[NSColor colorWithCalibratedWhite:0.0 alpha:0.5] setFill];
- [NSBezierPath fillRoundRectInRect:[self bounds] radius:10.0];
+ [[NSBezierPath bezierPathWithRoundedRect:[self bounds] xRadius:10.0
yRadius:10.0] fill];
NSBezierPath *path = nil;
if (remoteState == SKRemoteStateResize) {
- path = [NSBezierPath bezierPathWithRoundRectInRect:NSInsetRect(bounds,
20.0, 20.0) radius:3.0];
+ path = [NSBezierPath bezierPathWithRoundedRect:NSInsetRect(bounds,
20.0, 20.0) xRadius:3.0 yRadius:3.0];
[path appendBezierPath:[NSBezierPath
bezierPathWithRect:NSInsetRect(bounds, 24.0, 24.0)]];
NSBezierPath *arrow = [NSBezierPath bezierPath];
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit