Changeset 2558

Show
Ignore:
Timestamp:
04/20/05 19:37:46 (3 years ago)
Author:
eridius
Message:

Remove all trailing whitespace from lines
Remove indentation on blank lines

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/AICustomTabCell.h

    r2041 r2558  
    2727    BOOL                                                                highlighted; 
    2828    BOOL                                                                allowsInactiveTabClosing; 
    29      
     29 
    3030    BOOL                                                                trackingClose; 
    3131    BOOL                                                                hoveringClose; 
    32      
     32 
    3333    NSTrackingRectTag                                   trackingTag; 
    3434    NSTrackingRectTag                                   closeTrackingTag; 
    3535    NSTrackingRectTag                                   toolTipTag; 
    36      
     36 
    3737        NSAttributedString                                      *attributedLabel; 
    3838    NSTabViewItem<AICustomTabViewItem>  *tabViewItem; 
    3939    NSRect                                                              frame; 
    40          
     40 
    4141        AICustomTabsView                                        *view; 
    4242} 
  • trunk/AICustomTabCell.m

    r2054 r2558  
    5858{ 
    5959    static BOOL haveLoadedImages = NO; 
    60      
     60 
    6161    [super init]; 
    62          
     62 
    6363    //Share these images between all AICustomTabCell instances 
    6464    if(!haveLoadedImages){ 
     
    6666                tabFrontMiddle = [[NSImage imageNamed:@"aquaTabMiddle"] retain]; 
    6767                tabFrontRight = [[NSImage imageNamed:@"aquaTabRight"] retain]; 
    68                  
     68 
    6969                tabCloseFront = [[NSImage imageNamed:@"aquaTabClose"] retain]; 
    7070                tabCloseBack = [[NSImage imageNamed:@"aquaTabCloseBack"] retain]; 
     
    7474                leftCapSize = [tabFrontLeft size]; 
    7575                rightCapSize = [tabFrontRight size]; 
    76                  
     76 
    7777        haveLoadedImages = YES; 
    7878    } 
    79          
     79 
    8080    tabViewItem = [inTabViewItem retain]; 
    8181        view = inView; 
     
    8888    closeTrackingTag = 0; 
    8989        toolTipTag = 0; 
    90          
     90 
    9191    return(self); 
    9292} 
     
    106106        int width = leftCapSize.width + [[self attributedLabel] size].width + rightCapSize.width + 
    107107        (TAB_CLOSE_LEFTPAD + [[tabViewItem icon] size].width + TAB_CLOSE_RIGHTPAD) + TAB_RIGHT_PAD; 
    108          
     108 
    109109    return( NSMakeSize((width > TAB_MIN_WIDTH ? width : TAB_MIN_WIDTH), leftCapSize.height) ); 
    110110} 
     
    115115    int tabWidth = [tab size].width; 
    116116    int ourWidth = [self size].width; 
    117          
     117 
    118118    if(tabWidth > ourWidth){ 
    119119        return(NSOrderedAscending); 
    120          
     120 
    121121    }else if(tabWidth < ourWidth){ 
    122122        return(NSOrderedDescending); 
    123          
     123 
    124124    }else{ 
    125125        return(NSOrderedSame); 
    126          
     126 
    127127    } 
    128128} 
     
    152152        NSSize  imageSize = [[tabViewItem icon] size]; 
    153153        int             centerY = (frame.size.height - imageSize.height) / 2.0; 
    154          
     154 
    155155        return(NSMakeRect(frame.origin.x + leftCapSize.width + TAB_CLOSE_LEFTPAD, 
    156156                                          frame.origin.y + centerY + TAB_CLOSE_Y_OFFSET, 
     
    226226    NSSize      labelSize; 
    227227        NSPoint destPoint; 
    228      
     228 
    229229    //Pre-calc some dimensions 
    230230    labelSize = [tabViewItem sizeOfLabel:NO]; 
     
    232232    middleRightEdge = (rect.origin.x + rect.size.width - rightCapSize.width); 
    233233    middleLeftEdge = (rect.origin.x + leftCapSize.width); 
    234          
     234 
    235235    //Background 
    236236    if(selected && !ignoreSelection){ 
    237237        //Draw the left cap 
    238238        [tabFrontLeft compositeToPoint:NSMakePoint(rect.origin.x, rect.origin.y) operation:NSCompositeSourceOver]; 
    239                  
     239 
    240240        //Draw the middle 
    241241        sourceRect = NSMakeRect(0, 0, [tabFrontMiddle size].width, [tabFrontMiddle size].height); 
    242242        destRect = NSMakeRect(middleLeftEdge, rect.origin.y, sourceRect.size.width, sourceRect.size.height); 
    243                  
     243 
    244244        while(destRect.origin.x < middleRightEdge){ 
    245245            if((destRect.origin.x + destRect.size.width) > middleRightEdge){ 
     
    249249            destRect.origin.x += destRect.size.width; 
    250250        } 
    251                  
     251 
    252252        //Draw the right cap 
    253253        [tabFrontRight compositeToPoint:NSMakePoint(middleRightEdge, rect.origin.y) operation:NSCompositeSourceOver]; 
    254                  
     254 
    255255    }else if(highlighted){ 
    256256        [[NSColor colorWithCalibratedWhite:0.0 alpha:0.1] set]; 
    257257        [NSBezierPath fillRect:NSMakeRect(rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)]; 
    258258    } 
    259          
     259 
    260260        //We'll display our close icon if the user is hovering.  Otherwise, we display the tab specified icon 
    261261        NSImage *leftIcon = [tabViewItem icon]; 
    262         if((hoveringClose && (selected || allowsInactiveTabClosing || ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask ))) || !leftIcon){          
     262        if((hoveringClose && (selected || allowsInactiveTabClosing || ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask ))) || !leftIcon){ 
    263263                if(hoveringClose){ 
    264264                        leftIcon = (trackingClose ? tabCloseFrontPressed : tabCloseFrontRollover); 
     
    278278        rect.origin.x += offsetX; 
    279279        rect.size.width -= offsetX + TAB_RIGHT_PAD; 
    280          
     280 
    281281        //Draw our label 
    282282        destRect = NSMakeRect(rect.origin.x, 
     
    285285                                                  rect.size.height - ((rect.size.height - labelSize.height) / 2.0)); 
    286286    if(TAB_SELECTED_HIGHER && !ignoreSelection && selected) destRect.origin.y += 1.0; 
    287         [[self attributedLabel] drawInRect:destRect];   
     287        [[self attributedLabel] drawInRect:destRect]; 
    288288} 
    289289 
     
    292292{ 
    293293        NSString        *label = [tabViewItem label]; 
    294          
     294 
    295295        if(![label isEqualToString:[attributedLabel string]] || wasEnabled != [tabViewItem isEnabled] ){ 
    296296                wasEnabled = [tabViewItem isEnabled]; 
     
    299299                [paragraphStyle setAlignment:NSCenterTextAlignment]; 
    300300                [paragraphStyle setLineBreakMode:NSLineBreakByTruncatingTail]; 
    301                  
     301 
    302302                //Update the attributed string 
    303303                [attributedLabel release]; 
     
    309309                                nil]]; 
    310310        } 
    311          
     311 
    312312        return(attributedLabel); 
    313313} 
     
    324324                           assumeInside:NSPointInRect(cursorLocation, trackRect)]; 
    325325    [self setHighlighted:NSPointInRect(cursorLocation, trackRect)]; 
    326          
     326 
    327327    closeTrackingTag = [view addTrackingRect:[self _closeButtonRect] 
    328328                                       owner:self 
     
    349349//              [[tabViewItem tabView] selectTabViewItem:tabViewItem]; 
    350350//      } 
    351          
     351 
    352352    //Set ourself (or our close button) as hovered 
    353353    if((allowsInactiveTabClosing || selected || ( [[[NSApplication sharedApplication] currentEvent] modifierFlags] & NSCommandKeyMask )) && 
     
    378378           (SHOW_CLOSE_BUTTON_FOR_SINGLE_TAB || [[tabViewItem tabView] numberOfTabViewItems] != 1) && 
    379379           NSPointInRect([controlView convertPoint:[theEvent locationInWindow] fromView:nil], [self _closeButtonRect])){ 
    380                  
     380 
    381381        [self trackMouse:theEvent inRect:[self _closeButtonRect] ofView:controlView untilMouseUp:YES]; 
    382382        return(YES); 
    383                  
     383 
    384384    }else{ 
    385385        return(NO); 
    386                  
     386 
    387387    } 
    388388} 
     
    394394    hoveringClose = YES; 
    395395    [controlView setNeedsDisplayInRect:[self _closeButtonRect]]; 
    396          
     396 
    397397    return(YES); 
    398398} 
     
    402402{ 
    403403    BOOL        hovering = NSPointInRect(currentPoint, [self _closeButtonRect]); 
    404          
     404 
    405405    if(hoveringClose != hovering){ 
    406406        hoveringClose = hovering; 
    407407        [controlView setNeedsDisplayInRect:[self _closeButtonRect]]; 
    408408    } 
    409      
     409 
    410410    return(YES); 
    411411} 
     
    415415{ 
    416416    BOOL        hovering = NSPointInRect(stopPoint, [self _closeButtonRect]); 
    417          
     417 
    418418        //Closes all the other tabs in the current window if option is held down (And we have more than one tab) 
    419419        if(hovering && ([[[controlView window] currentEvent] modifierFlags] & NSAlternateKeyMask) && [[tabViewItem tabView] numberOfTabViewItems] > 1){ 
     
    422422        [(AICustomTabsView *)controlView closeTab:self]; 
    423423    } 
    424          
     424 
    425425    hoveringClose = NO; 
    426426    trackingClose = NO; 
  • trunk/AICustomTabDragWindow.h

    r1823 r2558  
    1717        ESFloater                       *dragWindowFloater; 
    1818        BOOL                            fullWindow; 
    19          
     19 
    2020        BOOL                            useFancyAnimations; 
    2121} 
  • trunk/AICustomTabDragWindow.m

    r2046 r2558  
    3131{ 
    3232        [super init]; 
    33          
     33 
    3434        floaterTabImage = [[self dragTabImageForTabCell:inTabCell inCustomTabsView:inTabView] retain]; 
    3535        floaterWindowImage = [[self dragWindowImageForWindow:[inTabView window] customTabsView:inTabView tabCell:inTabCell] retain]; 
    3636        useFancyAnimations = ( floaterWindowImage ? YES : NO ); 
    37          
     37 
    3838        if(useFancyAnimations){ 
    3939                //Create a floating window for our tab 
    4040                dragTabFloater = [ESFloater floaterWithImage:floaterTabImage styleMask:NSBorderlessWindowMask title:nil]; 
    4141                [dragTabFloater setMaxOpacity:1.0]; 
    42                  
     42 
    4343                //Create a floating window for the stand-alone window our tab would produce 
    4444                dragWindowFloater = [ESFloater floaterWithImage:floaterWindowImage styleMask:NSTitledWindowMask title:[[inTabView window] title]]; 
    4545                [dragWindowFloater setMaxOpacity:(transparent ? 0.75 : 1.00)]; 
    4646        } 
    47                  
     47 
    4848        return(self); 
    4949} 
     
    6262    [dragTabFloater close:nil]; 
    6363    [dragWindowFloater close:nil]; 
    64          
     64 
    6565        [super dealloc]; 
    6666} 
     
    8585        } 
    8686} 
    87          
    88          
     87 
     88 
    8989//Tab Imaging ---------------------------------------------------------------------------------------------------------- 
    9090#pragma mark Drag Images 
     
    9393{ 
    9494    NSImage     *dragTabImage = nil; 
    95      
     95 
    9696    if([customTabsView canDraw]){ 
    9797        dragTabImage = [[[NSImage alloc] init] autorelease]; 
    9898        [customTabsView lockFocus]; 
    9999        [dragTabImage addRepresentation:[[[NSBitmapImageRep alloc] initWithFocusedViewRect:[tabCell frame]] autorelease]]; 
    100         [customTabsView unlockFocus];     
     100        [customTabsView unlockFocus]; 
    101101    } 
    102          
     102 
    103103    return(dragTabImage); 
    104104} 
     
    109109    NSView      *contentView = [[tabCell tabViewItem]  view]; 
    110110    NSImage     *dragWindowImage = nil; 
    111     NSImage     *contentImage, *tabImage;     
     111    NSImage     *contentImage, *tabImage; 
    112112    NSPoint     insertPoint; 
    113          
     113 
    114114    if([customTabsView canDraw] && [contentView canDraw]){ 
    115115        //Get an image of the tab 
     
    118118        [tabImage addRepresentation:[[[NSBitmapImageRep alloc] initWithFocusedViewRect:[tabCell frame]] autorelease]]; 
    119119        [customTabsView unlockFocus]; 
    120          
     120 
    121121        //Get an image of the tabView content view 
    122122        contentImage = [[[NSImage alloc] init] autorelease]; 
     
    124124        [contentImage addRepresentation:[[[NSBitmapImageRep alloc] initWithFocusedViewRect:[contentView frame]] autorelease]]; 
    125125        [contentView unlockFocus]; 
    126          
     126 
    127127        //Create a drag image the size of the window 
    128128        dragWindowImage = [[[NSImage alloc] initWithSize:[[window contentView] frame].size] autorelease]; 
    129129        [dragWindowImage setBackgroundColor:[NSColor clearColor]]; 
    130130        [dragWindowImage lockFocus]; 
    131          
     131 
    132132        //Draw the tabbar and tab 
    133133        [customTabsView drawBackgroundInRect:[customTabsView frame] withFrame:[customTabsView frame] selectedTabRect:NSMakeRect(0,0,0,0)]; 
     
    135135        insertPoint.x += CUSTOM_TABS_INDENT; //Line the tab up a bit more realistically 
    136136        [tabImage compositeToPoint:insertPoint operation:NSCompositeCopy]; 
    137          
     137 
    138138        //Draw the content 
    139139                NSPoint frameOrigin = [[[tabCell tabViewItem] tabView] frame].origin; 
    140140        [contentImage compositeToPoint:NSMakePoint(frameOrigin.x + CONTENT_OFFSET_X, frameOrigin.y) operation:NSCompositeCopy]; 
    141          
     141 
    142142        [dragWindowImage unlockFocus]; 
    143143    } 
    144      
     144 
    145145    return(dragWindowImage); 
    146146} 
  • trunk/AICustomTabDragging.m

    r2039 r2558  
    3838        destTabBar = nil; 
    3939        tabDragWindow = nil; 
    40          
     40 
    4141        return(self); 
    4242} 
     
    8686    NSPoint                     startPoint; 
    8787    BOOL                        sourceWindowWillHide; 
    88      
     88 
    8989        //Post the dragging will begin notification 
    9090        [[NSNotificationCenter defaultCenter] postNotificationName:AICustomTabDragWillBegin object:self]; 
    91          
     91 
    9292        //Setup 
    9393        [destTabBar release]; destTabBar = nil; 
     
    9595        dragTabCell = [inTabCell retain]; 
    9696        selectTabAfterDrag = shouldSelect; 
    97          
     97 
    9898        //Determine if the source window will hide as a result of this drag 
    9999        sourceWindowWillHide = ([sourceTabBar removingLastTabHidesWindow] && [sourceTabBar numberOfTabViewItems] == 1); 
     
    101101                destTabBar = [sourceView retain]; 
    102102        } 
    103          
     103 
    104104        //Adjust the drag offset so the cursor is atleast always touching the tab drag image 
    105105        int width = [inTabCell frame].size.width; 
    106106        int height = [inTabCell frame].size.height; 
    107          
     107 
    108108        dragOffset = NSMakeSize([inTabCell frame].origin.x - clickLocation.x, [inTabCell frame].origin.y - clickLocation.y); 
    109109        if(dragOffset.width > width) dragOffset.width = width; 
     
    111111        if(dragOffset.height > height) dragOffset.height = height; 
    112112        if(dragOffset.height < -height) dragOffset.height = -height; 
    113          
     113 
    114114        //Create the drag window for our custom drag tracking 
    115115        tabDragWindow = [AICustomTabDragWindow dragWindowForCustomTabView:sourceView 
     
    117117                                                                                                                  transparent:!([sourceTabBar removingLastTabHidesWindow])]; 
    118118        [tabDragWindow setDisplayingFullWindow:sourceWindowWillHide animate:NO]; 
    119          
     119 
    120120        //Position the drag window 
    121121        startPoint = [[inEvent window] convertBaseToScreen:[inEvent locationInWindow]]; 
    122122        startPoint = NSMakePoint(startPoint.x + dragOffset.width, startPoint.y + dragOffset.height); 
    123123        [tabDragWindow moveToPoint:startPoint]; 
    124          
     124 
    125125        //Hide the source window 
    126126        if(sourceWindowWillHide){ 
    127127                [[sourceTabBar window] setAlphaValue:0.0]; 
    128128        } 
    129          
     129 
    130130        //Perform the drag 
    131131        pboard = [NSPasteboard pasteboardWithName:NSDragPboard]; 
     
    139139                                                 source:self 
    140140                                          slideBack:NO]; 
    141          
     141 
    142142        //Sneaky Bug Fix --- 
    143143        //After dropping a tab into a tab bar, the tabbar's cursor tracking is rebuilt.  Unfortunately, since the floating 
    144         //window (With an image of the tab) used for dragging is still over the tab bar, any cursor rects we attempt to  
     144        //window (With an image of the tab) used for dragging is still over the tab bar, any cursor rects we attempt to 
    145145        //install below it will not work.  A sneaky solution to this is to remember the destination tab bar of the drag, 
    146146        //and reset it's cursor tracking again, after the drag window has closed. 
     
    150150                [_destinationOfLastDrag release]; _destinationOfLastDrag= nil; 
    151151        } 
    152          
     152 
    153153} 
    154154 
    155155//End a drag 
    156156- (void)acceptDragIntoTabView:(AICustomTabsView *)destTabView atIndex:(int)destIndex 
    157 {       
     157{ 
    158158        if(destTabView == sourceTabBar){ 
    159159                //Tab re-arranging we handle internally 
     
    170170                } 
    171171        } 
    172          
     172 
    173173        //Remember the dest tab bar so we can reset cursor tracking (see dragTabCell:fromCustomTabsView:withEvent:) 
    174174        _destinationOfLastDrag = [destTabBar retain]; 
     
    192192{ 
    193193        [tabDragWindow setDisplayingFullWindow:(!destTabBar) animate:YES]; 
    194          
     194 
    195195    if(!destTabBar){ 
    196196        [tabDragWindow moveToPoint:screenPoint]; 
     
    200200//Invoked in the dragging source as the drag ends 
    201201- (void)draggedImage:(NSImage *)image endedAt:(NSPoint)screenPoint operation:(NSDragOperation)operation 
    202 {       
     202{ 
    203203        if(operation == NSDragOperationNone){ //when dropped on the screen 
    204204                //Sneaky Bug Fix --- 
     
    208208                //we can assume it's a tab bar the system failed to send a draggingExited event, and send it ourself. 
    209209                if(destTabBar) [destTabBar draggingExited:nil]; 
    210                  
     210 
    211211                screenPoint.x -= CUSTOM_TABS_INDENT; 
    212212        if([[sourceTabBar delegate] respondsToSelector:@selector(customTabView:didMoveTabViewItem:toCustomTabView:index:screenPoint:)]){ 
     
    214214        } 
    215215    } 
    216          
     216 
    217217    //Cleanup drag 
    218218        [self cleanupDrag]; 
     
    230230        [dragTabCell release]; dragTabCell = nil; 
    231231        [destTabBar release]; destTabBar = nil; 
    232         [sourceTabBar release]; sourceTabBar = nil;             
     232        [sourceTabBar release]; sourceTabBar = nil; 
    233233} 
    234234 
  • trunk/AICustomTabsView.h

    r2039 r2558  
    4040        BOOL                            trackingCursor;                         //Tracking rects are installed 
    4141        BOOL                            ignoreTabNumberChange;          //Ignore tab count changes, used for re-arranging 
    42          
     42 
    4343        //Tab Dragging 
    4444    BOOL                removingLastTabHidesWindow;     //Removing the last tab hides our window 
    4545        int                             tabGapWidth;                            //Gap in our tabs 
    4646        int                             tabGapIndex;                            //Location of the gap 
    47     NSPoint                             lastClickLocation;                      //Last click location                   
     47    NSPoint                             lastClickLocation;                      //Last click location 
    4848    NSTimer             *arrangeCellTimer;                      //Timer for tab animations 
    49          
     49 
    5050        //Guarded.  Access these using the internal accessors 
    5151    NSMutableArray              *tabCellArray; 
    5252    AICustomTabCell             *selectedCustomTabCell; 
    53          
     53 
    5454        // 
    5555        AICustomTabCell     *dragCell; 
  • trunk/AICustomTabsView.m

    r2039 r2558  
    3333- (id)initWithFrame:(NSRect)frameRect; 
    3434 
    35 //Positioning  
     35//Positioning 
    3636- (void)arrangeTabs; 
    3737- (void)smoothlyArrangeTabs; 
     
    109109{ 
    110110    delegate = inDelegate; 
    111      
     111 
    112112    //Update our accepted drag types 
    113113    [self unregisterDraggedTypes]; 
     
    134134    NSEnumerator                *enumerator; 
    135135    AICustomTabCell             *tabCell; 
    136      
     136 
    137137    //Save the value 
    138138    allowsInactiveTabClosing = inValue; 
    139      
     139 
    140140    //Pass it onto our tabs 
    141141    enumerator = [tabCellArray objectEnumerator]; 
    142     while((tabCell = [enumerator nextObject])){             
     142    while((tabCell = [enumerator nextObject])){ 
    143143                [tabCell setAllowsInactiveTabClosing:allowsInactiveTabClosing]; 
    144144    } 
     
    203203                NSEnumerator    *enumerator = [tabCellArray objectEnumerator]; 
    204204                AICustomTabCell *tabCell; 
    205                  
     205 
    206206                while(tabCell = [enumerator nextObject]){ 
    207207                        if(tabCell != targetCell){ 
     
    221221                //Ignore the 'shouldSelect' choice if this cell is already selected 
    222222                if(tabViewItem == [tabView selectedTabViewItem]) shouldSelect = YES; 
    223                  
     223 
    224224                //Move the tab cell 
    225225                int     currentIndex = [tabCellArray indexOfObject:tabCell]; 
    226226                int     newIndex = index; 
    227                  
     227 
    228228                //Account for shifting 
    229229                if(currentIndex < newIndex) newIndex--; 
    230                  
     230 
    231231                //Move via a remove and add :( 
    232232                [tabCell retain]; 
     
    234234                [tabCellArray insertObject:tabCell atIndex:newIndex]; 
    235235                [tabCell release]; 
    236                  
     236 
    237237                //Move the tab 
    238238                ignoreTabNumberChange = YES; 
     
    243243                [tabViewItem release]; 
    244244                ignoreTabNumberChange = NO; 
    245                  
     245 
    246246                //Inform our delegate of the re-order 
    247247                if([delegate respondsToSelector:@selector(customTabViewDidChangeOrderOfTabViewItems:)]){ 
    248248                        [delegate customTabViewDidChangeOrderOfTabViewItems:self]; 
    249249                } 
    250                  
     250 
    251251                //Smoothly animate into place 
    252252                if(animate){ 
     
    256256                } 
    257257        } 
    258          
     258 
    259259        if(shouldSelect) [tabView selectTabViewItem:tabViewItem]; 
    260260} 
     
    265265    NSEnumerator        *enumerator; 
    266266    AICustomTabCell     *tabCell; 
    267          
     267 
    268268    enumerator = [tabCellArray objectEnumerator]; 
    269269    while((tabCell = [enumerator nextObject])){ 
    270270                if(tabCell != dragCell && NSPointInRect(clickLocation, [tabCell frame])) break; 
    271271    } 
    272          
     272 
    273273    return(tabCell); 
    274274} 
     
    280280    NSEnumerator        *enumerator = [tabCellArray objectEnumerator]; 
    281281    AICustomTabCell     *tabCell; 
    282      
     282 
    283283    while((tabCell = [enumerator nextObject])){ 
    284284                if(tabCell != dragCell) totalWidth += [tabCell size].width + CUSTOM_TABS_GAP; 
    285285    } 
    286      
     286 
    287287    return(totalWidth); 
    288288} 
     
    294294    AICustomTabCell     *tabCell; 
    295295    NSTabViewItem       *selectedTab = [inTabView selectedTabViewItem]; 
    296          
     296 
    297297    //Set old cell for a redisplay 
    298298    [self setNeedsDisplayInRect:NSInsetRect([selectedCustomTabCell frame], -(CUSTOM_TABS_GAP * 2), 0)]; 
    299          
     299 
    300300    //Record the new selected tab cell, and correctly set it as selected 
    301301    enumerator = [tabCellArray objectEnumerator]; 
     
    308308        } 
    309309    } 
    310          
     310 
    311311    //Redisplay new cell 
    312312    [self setNeedsDisplayInRect:NSInsetRect([selectedCustomTabCell frame], -(CUSTOM_TABS_GAP * 2), 0)]; 
    313          
     313 
    314314    //Inform our delegate of the selection change 
    315315    if([delegate respondsToSelector:@selector(customTabView:didSelectTabViewItem:)]){ 
     
    323323        if(!ignoreTabNumberChange){ 
    324324                //Reset our tab list 
    325                 [self rebuildTabCells];         
    326                  
     325                [self rebuildTabCells]; 
     326 
    327327                //Inform our delegate of the tab count change 
    328328                if([delegate respondsToSelector:@selector(customTabViewDidChangeNumberOfTabViewItems:)]){ 
     
    347347    [tabCellArray release]; tabCellArray = [[NSMutableArray alloc] init]; 
    348348        selectedCustomTabCell = nil; 
    349          
     349 
    350350        //Create a tab cell for each tabViewItem 
    351351        int     loop; 
     
    353353                NSTabViewItem           *tabViewItem = [tabView tabViewItemAtIndex:loop]; 
    354354                AICustomTabCell         *tabCell; 
    355                  
     355 
    356356                //Create a new tab cell 
    357357                tabCell = [AICustomTabCell customTabForTabViewItem:tabViewItem customTabsView:self]; 
    358358                [tabCell setSelected:(tabViewItem == [tabView selectedTabViewItem])]; 
    359359                [tabCell setAllowsInactiveTabClosing:allowsInactiveTabClosing]; 
    360                  
     360 
    361361                //Update our direct reference to the selected cell 
    362362                if(tabViewItem == [tabView selectedTabViewItem]){ 
    363363                        selectedCustomTabCell = tabCell; 
    364364                } 
    365                  
     365 
    366366                //Add the tab cell to our array 
    367367                [tabCellArray addObject:tabCell]; 
    368368        } 
    369          
     369 
    370370        [self arrangeTabs]; 
    371371        [self startCursorTracking]; 
     
    376376        NSEnumerator    *enumerator = [tabCellArray objectEnumerator]; 
    377377        AICustomTabCell *tabCell; 
    378          
     378 
    379379        while((tabCell = [enumerator nextObject]) && [tabCell tabViewItem] != tabViewItem); 
    380          
     380 
    381381        return(tabCell); 
    382382} 
     
    404404        tabGapWidth = width; 
    405405        tabGapIndex = index; 
    406          
    407         if(!arrangeCellTimer){ //Ignore the request if animation is already occuring        
    408                 arrangeCellTimer = [[NSTimer scheduledTimerWithTimeInterval:(1.0/CUSTOM_TABS_FPS)  
    409                                                                                                                          target:self  
    410                                                                                                                    selector:@selector(_arrangeCellTimer:)  
    411                                                                                                                    userInfo:nil  
     406 
     407        if(!arrangeCellTimer){ //Ignore the request if animation is already occuring 
     408                arrangeCellTimer = [[NSTimer scheduledTimerWithTimeInterval:(1.0/CUSTOM_TABS_FPS) 
     409                                                                                                                         target:self 
     410                                                                                                                   selector:@selector(_arrangeCellTimer:) 
     411                                                                                                                   userInfo:nil 
    412412                                                                                                                        repeats:YES] retain]; 
    413413                [self _arrangeCellsAbsolute:NO]; 
     
    417417//Animation timer.  Continue arranging cells until they are in the correct position 
    418418- (void)_arrangeCellTimer:(NSTimer *)inTimer 
    419 {     
     419{ 
    420420    if([self _arrangeCellsAbsolute:NO]){ 
    421421        [arrangeCellTimer invalidate]; [arrangeCellTimer release]; arrangeCellTimer = nil; 
     
    473473                        NSSize  size; 
    474474                        NSPoint origin; 
    475                          
     475 
    476476                        //Make a gap to signify that the dragged cell can be dropped here 
    477477                        if(index == tabGapIndex) xLocation += tabGapWidth; 
    478                          
     478 
    479479                        //Get the object's size 
    480480                        size = [tabCell size]; 
    481                          
     481 
    482482                        //If this tab is > next biggest, use the 'reduced' width calculated above 
    483483                        if(size.width > reduceThreshold){ 
    484484                &