Show
Ignore:
Timestamp:
04/20/05 19:37:46 (4 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/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