adium 3063:3efcc26ae847: Remove the shadow (variables) in AIUtii...
commits at adium.im
commits at adium.im
Thu Dec 24 01:49:36 UTC 2009
details: http://hg.adium.im/adium/rev/3efcc26ae847
revision: 3063:3efcc26ae847
author: Stephen Holt <sholt at adium.im>
date: Wed Dec 23 20:49:30 2009 -0500
Remove the shadow (variables) in AIUtiities.
diffs (849 lines):
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIArrayAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIArrayAdditions.h Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIArrayAdditions.h Wed Dec 23 20:49:30 2009 -0500
@@ -16,5 +16,5 @@
@interface NSMutableArray (ESArrayAdditions)
- (void)addObjectsFromArrayIgnoringDuplicates:(NSArray *)inArray;
- (void)moveObject:(id)object toIndex:(unsigned)newIndex;
-- (void)setObject:(id)object atIndex:(unsigned)index;
+- (void)setObject:(id)object atIndex:(unsigned)idx;
@end
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIArrayAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIArrayAdditions.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIArrayAdditions.m Wed Dec 23 20:49:30 2009 -0500
@@ -117,9 +117,9 @@
//just a better name for an existing NSMutableArray method.
//this makes it uniform in style with -[NSMutableDictionary setObject:forKey:].
-- (void)setObject:(id)object atIndex:(unsigned)index
+- (void)setObject:(id)object atIndex:(unsigned)idx
{
- [self replaceObjectAtIndex:index withObject:object];
+ [self replaceObjectAtIndex:idx withObject:object];
}
@end
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.h Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.h Wed Dec 23 20:49:30 2009 -0500
@@ -231,7 +231,7 @@
* @throws NSInvalidArgumentException \a inString or \a link is \c nil.
* @return An autoreleased \c NSAttributedString.
*/
-+ (NSAttributedString *)attributedStringWithLinkLabel:(NSString *)inString linkDestination:(id)link;
++ (NSAttributedString *)attributedStringWithLinkLabel:(NSString *)inString linkDestination:(id)inLink;
/*! @brief Create a new NSAttributedString containing a hyperlink.
*
@@ -243,6 +243,6 @@
* @throws NSInvalidArgumentException \a inString or \a link is \c nil, or \a linkRange falls outside the extent of \a inString.
* @return An autoreleased \c NSAttributedString.
*/
-+ (NSAttributedString *)attributedStringWithString:(NSString *)inString linkRange:(NSRange)linkRange linkDestination:(id)link;
++ (NSAttributedString *)attributedStringWithString:(NSString *)inString linkRange:(NSRange)linkRange linkDestination:(id)inLink;
@end
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIAttributedStringAdditions.m Wed Dec 23 20:49:30 2009 -0500
@@ -94,7 +94,7 @@
//adjust the colors in the string so they're visible on the background
- (void)adjustColorsToShowOnBackground:(NSColor *)backgroundColor
{
- NSUInteger index = 0;
+ NSUInteger idx = 0;
NSUInteger stringLength = [self length];
CGFloat backgroundBrightness, backgroundSum;
@@ -103,7 +103,7 @@
backgroundBrightness = [backgroundColor brightnessComponent];
backgroundSum = [backgroundColor redComponent] + [backgroundColor greenComponent] + [backgroundColor blueComponent];
//we need to scan each colored "chunk" of the message - and check to make sure it is a "visible" color
- while (index < stringLength) {
+ while (idx < stringLength) {
NSColor *fontColor;
NSRange effectiveRange;
CGFloat brightness, sum;
@@ -111,7 +111,7 @@
BOOL colorChanged = NO;
//--get the font color--
- fontColor = [self attribute:NSForegroundColorAttributeName atIndex:index effectiveRange:&effectiveRange];
+ fontColor = [self attribute:NSForegroundColorAttributeName atIndex:idx effectiveRange:&effectiveRange];
if (fontColor == nil) fontColor = [NSColor blackColor];
fontColor = [fontColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
@@ -149,14 +149,14 @@
[self addAttribute:NSForegroundColorAttributeName value:fontColor range:effectiveRange];
}
- index = effectiveRange.location + effectiveRange.length;
+ idx = effectiveRange.location + effectiveRange.length;
}
}
//adjust the colors in the string so they're visible on the background, adjusting brightness in proportion to the original background
- (void)adjustColorsToShowOnBackgroundRelativeToOriginalBackground:(NSColor *)backgroundColor
{
- NSUInteger index = 0;
+ NSUInteger idx = 0;
NSUInteger stringLength = [self length];
CGFloat backgroundBrightness=0.0f;
NSColor *backColor=nil;
@@ -167,7 +167,7 @@
}
//we need to scan each colored "chunk" of the message - and check to make sure it is a "visible" color
- while (index < stringLength) {
+ while (idx < stringLength) {
NSColor *fontColor;
NSColor *fontBackColor;
@@ -177,12 +177,12 @@
BOOL colorChanged = NO, backgroundIsDark, fontBackIsDark;
//--get the font color--
- fontColor = [self attribute:NSForegroundColorAttributeName atIndex:index effectiveRange:&effectiveRange];
+ fontColor = [self attribute:NSForegroundColorAttributeName atIndex:idx effectiveRange:&effectiveRange];
//--get the background color in this range
- fontBackColor = [self attribute:NSBackgroundColorAttributeName atIndex:index effectiveRange:&backgroundRange];
+ fontBackColor = [self attribute:NSBackgroundColorAttributeName atIndex:idx effectiveRange:&backgroundRange];
if (!fontBackColor) {
//Background coloring
- fontBackColor = [self attribute:AIBodyColorAttributeName atIndex:index effectiveRange:&backgroundRange];
+ fontBackColor = [self attribute:AIBodyColorAttributeName atIndex:idx effectiveRange:&backgroundRange];
if (!fontBackColor) {
fontBackColor = [NSColor whiteColor];
fontBackColor = [fontBackColor colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
@@ -262,7 +262,7 @@
[self addAttribute:NSForegroundColorAttributeName value:fontColor range:effectiveRange];
}
- index = effectiveRange.location + effectiveRange.length;
+ idx = effectiveRange.location + effectiveRange.length;
}
}
@@ -422,33 +422,33 @@
return [[[NSAttributedString alloc] initWithString:inString] autorelease];
}
-+ (NSAttributedString *)attributedStringWithString:(NSString *)inString linkRange:(NSRange)linkRange linkDestination:(id)link
++ (NSAttributedString *)attributedStringWithString:(NSString *)inString linkRange:(NSRange)linkRange linkDestination:(id)inLink
{
NSParameterAssert(inString != nil);
- if ([link isKindOfClass:[NSString class]]) {
- link = [NSURL URLWithString:link];
+ if ([inLink isKindOfClass:[NSString class]]) {
+ inLink = [NSURL URLWithString:inLink];
}
- NSParameterAssert(link != nil);
- NSParameterAssert([link isKindOfClass:[NSURL class]]);
+ NSParameterAssert(inLink != nil);
+ NSParameterAssert([inLink isKindOfClass:[NSURL class]]);
NSMutableAttributedString *attributedString = [[[NSMutableAttributedString alloc] initWithString:inString] autorelease];
//Throws NSInvalidArgumentException if the range is out-of-range.
- [attributedString addAttribute:NSLinkAttributeName value:link range:linkRange];
+ [attributedString addAttribute:NSLinkAttributeName value:inLink range:linkRange];
return attributedString;
}
-+ (NSAttributedString *)attributedStringWithLinkLabel:(NSString *)inString linkDestination:(id)link
++ (NSAttributedString *)attributedStringWithLinkLabel:(NSString *)inString linkDestination:(id)inLink
{
NSParameterAssert(inString != nil);
- if ([link isKindOfClass:[NSString class]]) {
- link = [NSURL URLWithString:link];
+ if ([inLink isKindOfClass:[NSString class]]) {
+ inLink = [NSURL URLWithString:inLink];
}
- NSParameterAssert(link != nil);
- NSParameterAssert([link isKindOfClass:[NSURL class]]);
+ NSParameterAssert(inLink != nil);
+ NSParameterAssert([inLink isKindOfClass:[NSURL class]]);
- NSDictionary *attributes = [NSDictionary dictionaryWithObject:link forKey:NSLinkAttributeName];
+ NSDictionary *attributes = [NSDictionary dictionaryWithObject:inLink forKey:NSLinkAttributeName];
return [[[self alloc] initWithString:inString attributes:attributes] autorelease];
}
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIHostReachabilityMonitor.m
--- a/Frameworks/AIUtilities Framework/Source/AIHostReachabilityMonitor.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIHostReachabilityMonitor.m Wed Dec 23 20:49:30 2009 -0500
@@ -209,11 +209,11 @@
BOOL anyHostsReachable = NO;
// If we have multiple host <-> IP links (AAAA record and an A record), we need to check agreement.
- for (NSUInteger index = 0; index < hosts.count; index++) {
- if (![host isEqualToString:[hosts objectAtIndex:index]])
+ for (NSUInteger idx = 0; idx < hosts.count; idx++) {
+ if (![host isEqualToString:[hosts objectAtIndex:idx]])
continue;
- SCNetworkReachabilityRef otherReachability = (SCNetworkReachabilityRef)[reachabilities objectAtIndex:index];
+ SCNetworkReachabilityRef otherReachability = (SCNetworkReachabilityRef)[reachabilities objectAtIndex:idx];
SCNetworkConnectionFlags flags;
if (SCNetworkReachabilityGetFlags(otherReachability, &flags)
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIImageDrawingAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIImageDrawingAdditions.h Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIImageDrawingAdditions.h Wed Dec 23 20:49:30 2009 -0500
@@ -23,9 +23,9 @@
- (NSImage *)imageByScalingToSize:(NSSize)size fraction:(CGFloat)delta flipImage:(BOOL)flipImage proportionally:(BOOL)proportionally allowAnimation:(BOOL)allowAnimation;
//+ (NSImage *)imageFromGWorld:(GWorldPtr)gWorldPtr;
- (NSRect)drawRoundedInRect:(NSRect)rect radius:(CGFloat)radius;
-- (NSRect)drawRoundedInRect:(NSRect)rect fraction:(CGFloat)fraction radius:(CGFloat)radius;
-- (NSRect)drawRoundedInRect:(NSRect)rect atSize:(NSSize)size position:(IMAGE_POSITION)position fraction:(CGFloat)fraction radius:(CGFloat)radius;
-- (NSRect)drawInRect:(NSRect)rect atSize:(NSSize)size position:(IMAGE_POSITION)position fraction:(CGFloat)fraction;
+- (NSRect)drawRoundedInRect:(NSRect)rect fraction:(CGFloat)inFraction radius:(CGFloat)radius;
+- (NSRect)drawRoundedInRect:(NSRect)rect atSize:(NSSize)size position:(IMAGE_POSITION)position fraction:(CGFloat)inFraction radius:(CGFloat)radius;
+- (NSRect)drawInRect:(NSRect)rect atSize:(NSSize)size position:(IMAGE_POSITION)position fraction:(CGFloat)inFraction;
- (NSRect)rectForDrawingInRect:(NSRect)rect atSize:(NSSize)size position:(IMAGE_POSITION)position;
@end
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIImageDrawingAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageDrawingAdditions.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIImageDrawingAdditions.m Wed Dec 23 20:49:30 2009 -0500
@@ -198,7 +198,7 @@
//Fun drawing toys
//Draw an image, altering and returning the available destination rect
-- (NSRect)drawInRect:(NSRect)rect atSize:(NSSize)size position:(IMAGE_POSITION)position fraction:(CGFloat)fraction
+- (NSRect)drawInRect:(NSRect)rect atSize:(NSSize)size position:(IMAGE_POSITION)position fraction:(CGFloat)inFraction
{
//We use our own size for drawing purposes no matter the passed size to avoid distorting the image via stretching
NSSize ownSize = [self size];
@@ -225,7 +225,7 @@
[self drawInRect:drawRect
fromRect:NSMakeRect(0, 0, ownSize.width, ownSize.height)
operation:NSCompositeSourceOver
- fraction:fraction];
+ fraction:inFraction];
//Shift the origin if needed, and decrease the available destination rect width, by the passed size
//(which may exceed the actual image dimensions)
@@ -297,13 +297,13 @@
}
//Perhaps if you desired to draw it rounded in the tooltip.
-- (NSRect)drawRoundedInRect:(NSRect)rect fraction:(CGFloat)fraction radius:(CGFloat)radius
+- (NSRect)drawRoundedInRect:(NSRect)rect fraction:(CGFloat)inFraction radius:(CGFloat)radius
{
- return [self drawRoundedInRect:rect atSize:NSMakeSize(0,0) position:0 fraction:fraction radius:radius];
+ return [self drawRoundedInRect:rect atSize:NSMakeSize(0,0) position:0 fraction:inFraction radius:radius];
}
//Draw an image, round the corner. Meant to replace the method above.
-- (NSRect)drawRoundedInRect:(NSRect)rect atSize:(NSSize)size position:(IMAGE_POSITION)position fraction:(CGFloat)fraction radius:(CGFloat)radius
+- (NSRect)drawRoundedInRect:(NSRect)rect atSize:(NSSize)size position:(IMAGE_POSITION)position fraction:(CGFloat)inFraction radius:(CGFloat)radius
{
NSRect drawRect;
@@ -337,7 +337,7 @@
[self drawInRect:drawRect
fromRect:NSMakeRect(0, 0, ownSize.width, ownSize.height)
operation:NSCompositeSourceOver
- fraction:fraction];
+ fraction:inFraction];
[NSGraphicsContext restoreGraphicsState];
//Shift the origin if needed, and decrease the available destination rect width, by the passed size
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIImageGridView.h
--- a/Frameworks/AIUtilities Framework/Source/AIImageGridView.h Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIImageGridView.h Wed Dec 23 20:49:30 2009 -0500
@@ -90,7 +90,7 @@
* @param index Index of the image
* @return <tt>NSRect</tt> the image occupies in our grid
*/
-- (NSRect)rectForImageAtIndex:(NSInteger)index;
+- (NSRect)rectForImageAtIndex:(NSInteger)idx;
/*!
* @brief Returns the image present at a point in our grid
@@ -105,7 +105,7 @@
*
* @param index Index of the image
*/
-- (void)setNeedsDisplayOfImageAtIndex:(NSInteger)index;
+- (void)setNeedsDisplayOfImageAtIndex:(NSInteger)idx;
/*!
* @brief Set the selected image
@@ -113,7 +113,7 @@
* Set the currently selected image. The delegate is informed of selection changes.
* @param index Image index to select
*/
-- (void)selectIndex:(NSInteger)index;
+- (void)selectIndex:(NSInteger)idx;
/*!
* @brief Set the selected image, relative to the current one
@@ -149,11 +149,11 @@
//AIImageGridView delegate methods. These are very similar to NSTableView.
@protocol AIImageGridViewDelegate <NSObject>
- (NSUInteger)numberOfImagesInImageGridView:(AIImageGridView *)imageGridView;
-- (NSImage *)imageGridView:(AIImageGridView *)imageGridView imageAtIndex:(NSUInteger)index;
+- (NSImage *)imageGridView:(AIImageGridView *)imageGridView imageAtIndex:(NSUInteger)idx;
@optional
-- (BOOL)imageGridView:(AIImageGridView *)imageGridView shouldSelectIndex:(NSUInteger)index;
+- (BOOL)imageGridView:(AIImageGridView *)imageGridView shouldSelectIndex:(NSUInteger)idx;
- (void)imageGridViewDeleteSelectedImage:(AIImageGridView *)imageGridView;
-- (void)imageGridView:(AIImageGridView *)imageGridView cursorIsHoveringImageAtIndex:(NSUInteger)index;
+- (void)imageGridView:(AIImageGridView *)imageGridView cursorIsHoveringImageAtIndex:(NSUInteger)idx;
//Notifications. These are automatically sent to the delegate.
- (void)imageGridViewSelectionDidChange:(NSNotification *)notification;
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIImageGridView.m
--- a/Frameworks/AIUtilities Framework/Source/AIImageGridView.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIImageGridView.m Wed Dec 23 20:49:30 2009 -0500
@@ -22,7 +22,7 @@
- (void)_initImageGridView;
- (void)_updateGrid;
- (void)_updateGridForNewFrame:(NSRect)newFrame;
-- (void)_setHoveredIndex:(NSInteger)index;
+- (void)_setHoveredIndex:(NSInteger)idx;
@end
@implementation AIImageGridView
@@ -114,18 +114,18 @@
#pragma mark Drawing and sizing
//Redisplay an image in the grid
-- (void)setNeedsDisplayOfImageAtIndex:(NSInteger)index
+- (void)setNeedsDisplayOfImageAtIndex:(NSInteger)idx
{
- if (index >= 0) {
- [self setNeedsDisplayInRect:[self rectForImageAtIndex:index]];
+ if (idx >= 0) {
+ [self setNeedsDisplayInRect:[self rectForImageAtIndex:idx]];
}
}
//Returns the rect for an image in our grid
-- (NSRect)rectForImageAtIndex:(NSInteger)index
+- (NSRect)rectForImageAtIndex:(NSInteger)idx
{
- NSInteger row = index / columns;
- NSInteger column = index % columns;
+ NSInteger row = idx / columns;
+ NSInteger column = idx % columns;
return NSMakeRect(column * (imageSize.width + padding.width) + padding.width,
row * (imageSize.height + padding.height) + padding.height,
@@ -222,22 +222,22 @@
//Sets our selected index to the passed value, restricting it to within the allowable bounds if necessary.
//The delegate will be informed of the new selection and the view will be updated to reflect it.
-- (void)selectIndex:(NSInteger)index
+- (void)selectIndex:(NSInteger)idx
{
NSUInteger numberOfImages = [delegate numberOfImagesInImageGridView:self];
BOOL shouldSelect = YES;
//Restrict the index to our bounds
- while (index < 0) index += numberOfImages;
- while (index > numberOfImages-1) index -= numberOfImages;
+ while (idx < 0) idx += numberOfImages;
+ while (idx > numberOfImages-1) idx -= numberOfImages;
//If the delegate supports it, confirm that this selection should be allowed
if (_respondsToShouldSelect) {
- shouldSelect = [delegate imageGridView:self shouldSelectIndex:index];
+ shouldSelect = [delegate imageGridView:self shouldSelectIndex:idx];
}
//Make the selection change, update our view and notify
- if (shouldSelect && index != selectedIndex) {
+ if (shouldSelect && idx != selectedIndex) {
//Notification: Selection is changing
[[NSNotificationCenter defaultCenter] postNotificationName:AIImageGridViewSelectionIsChangingNotification object:self];
if (_respondsToSelectionIsChanging) {
@@ -246,9 +246,9 @@
//Mark the old and new selections for redraw
[self setNeedsDisplayOfImageAtIndex:selectedIndex];
- [self setNeedsDisplayOfImageAtIndex:index];
+ [self setNeedsDisplayOfImageAtIndex:idx];
- selectedIndex = index;
+ selectedIndex = idx;
[self scrollRectToVisible:NSInsetRect([self rectForImageAtIndex:selectedIndex], -padding.width, -padding.height)];
//Notification: Selection did change
@@ -371,15 +371,15 @@
}
//Set the hovered image index
-- (void)_setHoveredIndex:(NSInteger)index
+- (void)_setHoveredIndex:(NSInteger)idx
{
- if (index != hoveredIndex) {
+ if (idx != hoveredIndex) {
//Mark the old and new hovered image for redraw
[self setNeedsDisplayOfImageAtIndex:hoveredIndex];
- [self setNeedsDisplayOfImageAtIndex:index];
+ [self setNeedsDisplayOfImageAtIndex:idx];
//Make the change and notify our delegate
- hoveredIndex = index;
+ hoveredIndex = idx;
if (_respondsToImageHovered) [delegate imageGridView:self cursorIsHoveringImageAtIndex:hoveredIndex];
}
}
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AILinkTrackingController.m
--- a/Frameworks/AIUtilities Framework/Source/AILinkTrackingController.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AILinkTrackingController.m Wed Dec 23 20:49:30 2009 -0500
@@ -77,16 +77,16 @@
- (void)mouseEntered:(NSEvent *)theEvent
{
NSWindow *window = [theEvent window];
- AIFlexibleLink *link = [theEvent userData];
+ AIFlexibleLink *trackedLink = [theEvent userData];
NSPoint location;
- location = [link trackingRect].origin;
+ location = [trackedLink trackingRect].origin;
location = [controlView convertPoint:location toView:nil];
location = [[theEvent window] convertBaseToScreen:location];
//Ignore the mouse entry if our view is hidden, or our window is non-main
if ([window isMainWindow] && [controlView canDraw]) {
- [self _setMouseOverLink:link
+ [self _setMouseOverLink:trackedLink
atPoint:location];
}
}
@@ -274,7 +274,7 @@
if (linkURL) {
NSRectArray linkRects;
- unsigned index;
+ unsigned idx;
NSUInteger linkCount;
//Get an array of rects that define the location of this link
@@ -282,14 +282,14 @@
withinSelectedCharacterRange:NSMakeRange(NSNotFound, 0)
inTextContainer:textContainer
rectCount:&linkCount];
- for (index = 0; index < linkCount; index++) {
+ for (idx = 0; idx < linkCount; idx++) {
NSRect linkRect;
NSRect visibleLinkRect;
- AIFlexibleLink *link;
+ AIFlexibleLink *trackedLink;
NSTrackingRectTag trackingTag;
//Get the link rect
- linkRect = linkRects[index];
+ linkRect = linkRects[idx];
//Adjust the link rect back to our view's coordinates
linkRect.origin.x += offset.x;
@@ -297,16 +297,16 @@
visibleLinkRect = NSIntersectionRect(linkRect, visibleRect);
//Create a flexible link instance
- link = [[[AIFlexibleLink alloc] initWithTrackingRect:linkRect
+ trackedLink = [[[AIFlexibleLink alloc] initWithTrackingRect:linkRect
url:linkURL
title:[[textStorage string] substringWithRange:scanRange]] autorelease];
if (!linkArray) linkArray = [[NSMutableArray alloc] init];
- [linkArray addObject:link];
+ [linkArray addObject:trackedLink];
//Install a tracking rect for the link (The userData of each tracking rect is the AIFlexibleLink it covers)
- trackingTag = [controlView addTrackingRect:visibleLinkRect owner:self userData:link assumeInside:NO];
- [link setTrackingTag:trackingTag];
+ trackingTag = [controlView addTrackingRect:visibleLinkRect owner:self userData:trackedLink assumeInside:NO];
+ [trackedLink setTrackingTag:trackingTag];
}
}
}
@@ -316,12 +316,12 @@
- (void)_endCursorTracking
{
NSEnumerator *enumerator;
- AIFlexibleLink *link;
+ AIFlexibleLink *trackedLink;
//Remove all existing tracking rects
enumerator = [linkArray objectEnumerator];
- while ((link = [enumerator nextObject])) {
- [controlView removeTrackingRect:[link trackingTag]];
+ while ((trackedLink = [enumerator nextObject])) {
+ [controlView removeTrackingRect:[trackedLink trackingTag]];
}
//Flush the link array
@@ -366,10 +366,10 @@
//Check for the presence of a point in multiple rects
BOOL _mouseInRects(NSPoint aPoint, NSRectArray someRects, NSUInteger arraySize, BOOL flipped)
{
- int index;
+ int idx;
- for (index = 0; index < arraySize; index++) {
- if (NSMouseInRect(aPoint, someRects[index], flipped)) {
+ for (idx = 0; idx < arraySize; idx++) {
+ if (NSMouseInRect(aPoint, someRects[idx], flipped)) {
return YES;
}
}
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIMenuAdditions.h
--- a/Frameworks/AIUtilities Framework/Source/AIMenuAdditions.h Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIMenuAdditions.h Wed Dec 23 20:49:30 2009 -0500
@@ -20,7 +20,7 @@
- (NSMenuItem *)addItemWithTitle:(NSString *)aString target:(id)target action:(SEL)aSelector keyEquivalent:(NSString *)charCode representedObject:(id)object;
- (void)removeAllItems;
- (void)removeAllItemsButFirst;
-- (void)removeAllItemsAfterIndex:(NSInteger)index;
+- (void)removeAllItemsAfterIndex:(NSInteger)idx;
@end
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIMenuAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIMenuAdditions.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIMenuAdditions.m Wed Dec 23 20:49:30 2009 -0500
@@ -68,12 +68,12 @@
}
}
-- (void)removeAllItemsAfterIndex:(NSInteger)index
+- (void)removeAllItemsAfterIndex:(NSInteger)idx
{
- NSParameterAssert(index < self.numberOfItems);
+ NSParameterAssert(idx < self.numberOfItems);
NSInteger count = self.numberOfItems;
- while (--count > index) {
+ while (--count > idx) {
[self removeItemAtIndex:count];
}
}
@@ -125,12 +125,12 @@
- (void)removeKeyEquivalent
{
NSMenu *menu = [self menu];
- NSInteger index = [menu indexOfItem:self];
+ NSInteger idx = [menu indexOfItem:self];
[self retain];
- [menu removeItemAtIndex:index];
+ [menu removeItemAtIndex:idx];
[self setKeyEquivalent:@""];
- [menu insertItem:self atIndex:index];
+ [menu insertItem:self atIndex:idx];
[self release];
}
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIMutableOwnerArray.m
--- a/Frameworks/AIUtilities Framework/Source/AIMutableOwnerArray.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIMutableOwnerArray.m Wed Dec 23 20:49:30 2009 -0500
@@ -130,15 +130,15 @@
if (count != 1 && !valueIsSortedToFront) {
NSNumber *currentMax = [NSNumber numberWithInt:0];
int indexOfMax = 0;
- int index = 0;
+ int idx = 0;
//Find the object with the largest int value
- for (index = 0;index < count;index++) {
- NSNumber *value = [contentArray objectAtIndex:index];
+ for (idx = 0;idx < count;idx++) {
+ NSNumber *value = [contentArray objectAtIndex:idx];
if ([value compare:currentMax] == NSOrderedDescending) {
currentMax = value;
- indexOfMax = index;
+ indexOfMax = idx;
}
}
@@ -162,15 +162,15 @@
if (count != 1 && !valueIsSortedToFront) {
NSInteger currentMax = 0;
int indexOfMax = 0;
- int index = 0;
+ int idx = 0;
//Find the object with the largest int value
- for (index = 0;index < count;index++) {
- NSInteger value = [[contentArray objectAtIndex:index] integerValue];
+ for (idx = 0;idx < count;idx++) {
+ NSInteger value = [[contentArray objectAtIndex:idx] integerValue];
if (value > currentMax) {
currentMax = value;
- indexOfMax = index;
+ indexOfMax = idx;
}
}
@@ -195,15 +195,15 @@
if (count != 1 && !valueIsSortedToFront) {
double currentMax = 0;
int indexOfMax = 0;
- int index = 0;
+ int idx = 0;
//Find the object with the largest double value
- for (index = 0;index < count;index++) {
- double value = [[contentArray objectAtIndex:index] doubleValue];
+ for (idx = 0;idx < count;idx++) {
+ double value = [[contentArray objectAtIndex:idx] doubleValue];
if (value > currentMax) {
currentMax = value;
- indexOfMax = index;
+ indexOfMax = idx;
}
}
@@ -228,15 +228,15 @@
if (count != 1 && !valueIsSortedToFront) {
NSDate *currentMax = nil;
int indexOfMax = 0;
- int index = 0;
+ int idx = 0;
//Find the object with the earliest date
- for (index = 0;index < count;index++) {
- NSDate *value = [contentArray objectAtIndex:index];
+ for (idx = 0;idx < count;idx++) {
+ NSDate *value = [contentArray objectAtIndex:idx];
if (!currentMax || [currentMax timeIntervalSinceDate:value] > 0) {
currentMax = value;
- indexOfMax = index;
+ indexOfMax = idx;
}
}
@@ -258,16 +258,16 @@
if ([priorityArray count] != 1 && !valueIsSortedToFront) {
CGFloat currentMax = Lowest_Priority;
int indexOfMax = 0;
- int index = 0;
+ int idx = 0;
//Find the object with highest priority
for (NSNumber *priority in priorityArray) {
float value = [priority floatValue];
if (value < currentMax) {
currentMax = value;
- indexOfMax = index;
+ indexOfMax = idx;
}
- index++;
+ idx++;
}
//Move the object to the front, so we don't have to find it next time
@@ -293,8 +293,8 @@
- (id)objectWithOwner:(id)inOwner
{
if (ownerArray && contentArray) {
- NSUInteger index = [ownerArray indexOfObject:inOwner];
- if (index != NSNotFound) return [contentArray objectAtIndex:index];
+ NSUInteger idx = [ownerArray indexOfObject:inOwner];
+ if (idx != NSNotFound) return [contentArray objectAtIndex:idx];
}
return nil;
@@ -303,8 +303,8 @@
- (float)priorityOfObjectWithOwner:(id)inOwner
{
if (ownerArray && priorityArray) {
- NSUInteger index = [ownerArray indexOfObject:inOwner];
- if (index != NSNotFound) return [[priorityArray objectAtIndex:index] floatValue];
+ NSUInteger idx = [ownerArray indexOfObject:inOwner];
+ if (idx != NSNotFound) return [[priorityArray objectAtIndex:idx] floatValue];
}
return 0.0f;
}
@@ -312,8 +312,8 @@
- (id)ownerWithObject:(id)inObject
{
if (ownerArray && contentArray) {
- NSUInteger index = [contentArray indexOfObject:inObject];
- if (index != NSNotFound) return [ownerArray objectAtIndex:index];
+ NSUInteger idx = [contentArray indexOfObject:inObject];
+ if (idx != NSNotFound) return [ownerArray objectAtIndex:idx];
}
return nil;
@@ -322,8 +322,8 @@
- (float)priorityOfObject:(id)inObject
{
if (contentArray && priorityArray) {
- NSUInteger index = [contentArray indexOfObject:inObject];
- if (index != NSNotFound) return [[priorityArray objectAtIndex:index] floatValue];
+ NSUInteger idx = [contentArray indexOfObject:inObject];
+ if (idx != NSNotFound) return [[priorityArray objectAtIndex:idx] floatValue];
}
return 0.0f;
}
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIObjectAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIObjectAdditions.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIObjectAdditions.m Wed Dec 23 20:49:30 2009 -0500
@@ -200,17 +200,17 @@
{
NSInvocation *invocation;
va_list args;
- int index = 2;
+ int idx = 2;
invocation = [NSInvocation invocationWithMethodSignature:[self methodSignatureForSelector:aSelector]];
[invocation setSelector:aSelector];
- [invocation setArgument:&argument1 atIndex:index++];
+ [invocation setArgument:&argument1 atIndex:idx++];
va_start(args, argument1);
id anArgument;
while ((anArgument = va_arg(args, id))) {
- [invocation setArgument:&anArgument atIndex:index++];
+ [invocation setArgument:&anArgument atIndex:idx++];
}
va_end(args);
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIPopUpButtonAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AIPopUpButtonAdditions.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIPopUpButtonAdditions.m Wed Dec 23 20:49:30 2009 -0500
@@ -22,9 +22,9 @@
- (BOOL)selectItemWithRepresentedObject:(id)object
{
if ([self numberOfItems] > 0) {
- NSInteger index = [self indexOfItemWithRepresentedObject:object];
- if (index != -1) {
- [self selectItemAtIndex:index];
+ NSInteger idx = [self indexOfItemWithRepresentedObject:object];
+ if (idx != -1) {
+ [self selectItemAtIndex:idx];
return YES;
}
}
@@ -70,9 +70,9 @@
- (BOOL)selectItemWithRepresentedObject:(id)object
{
- NSInteger index = [self indexOfItemWithRepresentedObject:object];
- if (index != NSNotFound) {
- [self selectItemAtIndex:index];
+ NSInteger idx = [self indexOfItemWithRepresentedObject:object];
+ if (idx != NSNotFound) {
+ [self selectItemAtIndex:idx];
return YES;
}
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AIProgressDataUploader.m
--- a/Frameworks/AIUtilities Framework/Source/AIProgressDataUploader.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AIProgressDataUploader.m Wed Dec 23 20:49:30 2009 -0500
@@ -287,13 +287,13 @@
{
UInt8 buffer[BUFFER_SIZE];
- CFIndex read = CFReadStreamRead(stream,
+ CFIndex len = CFReadStreamRead(stream,
buffer,
BUFFER_SIZE);
- if (read) {
+ if (len) {
[returnedData appendBytes:(const void *)buffer
- length:(NSUInteger)read];
+ length:(NSUInteger)len];
}
}
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AISendingTextView.m
--- a/Frameworks/AIUtilities Framework/Source/AISendingTextView.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AISendingTextView.m Wed Dec 23 20:49:30 2009 -0500
@@ -130,11 +130,11 @@
- (void)interpretKeyEvents:(NSArray *)eventArray
{
- NSUInteger index = 0;
+ NSUInteger idx = 0;
NSUInteger numEvents = [eventArray count];
- while (index < numEvents) {
- NSEvent *theEvent = [eventArray objectAtIndex:index];
+ while (idx < numEvents) {
+ NSEvent *theEvent = [eventArray objectAtIndex:idx];
if ([theEvent type] == NSKeyDown) {
unichar lastChar = [[theEvent charactersIgnoringModifiers] lastCharacter];
@@ -152,7 +152,7 @@
}
}
- index++;
+ idx++;
}
[super interpretKeyEvents:eventArray];
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/AITabViewAdditions.m
--- a/Frameworks/AIUtilities Framework/Source/AITabViewAdditions.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/AITabViewAdditions.m Wed Dec 23 20:49:30 2009 -0500
@@ -20,9 +20,9 @@
- (NSTabViewItem *)tabViewItemWithIdentifier:(id)identifier
{
- NSUInteger index = [self indexOfTabViewItemWithIdentifier:identifier];
+ NSUInteger idx = [self indexOfTabViewItemWithIdentifier:identifier];
- return ((index != NSNotFound) ? [self tabViewItemAtIndex:index] : nil);
+ return ((idx != NSNotFound) ? [self tabViewItemAtIndex:idx] : nil);
}
- (NSInteger)indexOfSelectedTabViewItem
diff -r e04a00f58ce6 -r 3efcc26ae847 Frameworks/AIUtilities Framework/Source/JVMarkedScroller.m
--- a/Frameworks/AIUtilities Framework/Source/JVMarkedScroller.m Wed Dec 23 12:42:51 2009 -0500
+++ b/Frameworks/AIUtilities Framework/Source/JVMarkedScroller.m Wed Dec 23 20:49:30 2009 -0500
@@ -55,28 +55,28 @@
unsigned long long start = [startNum unsignedLongLongValue];
unsigned long long stop = [stopNum unsignedLongLongValue];
- NSRect rect = NSZeroRect;
- if( sFlags.isHoriz ) rect = NSMakeRect( start, 0., ( stop - start ), width );
- else rect = NSMakeRect( 0., start, width, ( stop - start ) );
+ NSRect shadesRect = NSZeroRect;
+ if( sFlags.isHoriz ) shadesRect = NSMakeRect( start, 0., ( stop - start ), width );
+ else shadesRect = NSMakeRect( 0., start, width, ( stop - start ) );
- rect.origin = [transform transformPoint:rect.origin];
- rect.size = [transform transformSize:rect.size];
+ shadesRect.origin = [transform transformPoint:shadesRect.origin];
+ shadesRect.size = [transform transformSize:shadesRect.size];
- [shades appendBezierPathWithRect:rect];
+ [shades appendBezierPathWithRect:shadesRect];
}
if( ( [_shades count] % 2 ) == 1 ) {
- NSRect rect = NSZeroRect;
+ NSRect shadesRect = NSZeroRect;
unsigned long long start = [[_shades lastObject] unsignedLongLongValue];
unsigned long long stop = [self contentViewLength];
- if( sFlags.isHoriz ) rect = NSMakeRect( start, 0., ( stop - start ), width );
- else rect = NSMakeRect( 0., start, width, ( stop - start ) );
+ if( sFlags.isHoriz ) shadesRect = NSMakeRect( start, 0., ( stop - start ), width );
+ else shadesRect = NSMakeRect( 0., start, width, ( stop - start ) );
- rect.origin = [transform transformPoint:rect.origin];
- rect.size = [transform transformSize:rect.size];
+ shadesRect.origin = [transform transformPoint:shadesRect.origin];
+ shadesRect.size = [transform transformSize:shadesRect.size];
- [shades appendBezierPathWithRect:NSIntegralRect( rect )];
+ [shades appendBezierPathWithRect:NSIntegralRect( shadesRect )];
}
NSRectClip( NSInsetRect( [self rectForPart:NSScrollerKnobSlot], ( sFlags.isHoriz ? 4. : 3. ), ( sFlags.isHoriz ? 3. : 4. ) ) );
More information about the commits
mailing list