]> git.sesse.net Git - vlc/commitdiff
macosx: removed tabs and fixed whitespacing errors
authorFelix Paul Kühne <fkuehne@videolan.org>
Fri, 24 Feb 2012 17:12:10 +0000 (18:12 +0100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Fri, 24 Feb 2012 17:12:10 +0000 (18:12 +0100)
37 files changed:
modules/access/eyetv.m
modules/access/qtcapture.m
modules/gui/macosx/AppleRemote.h
modules/gui/macosx/AppleRemote.m
modules/gui/macosx/AudioEffects.h
modules/gui/macosx/AudioEffects.m
modules/gui/macosx/CoreInteraction.m
modules/gui/macosx/MainMenu.m
modules/gui/macosx/MainWindow.m
modules/gui/macosx/MainWindowTitle.m
modules/gui/macosx/PXSourceList.h
modules/gui/macosx/PXSourceList.m
modules/gui/macosx/SPInvocationGrabbing.m
modules/gui/macosx/SPMediaKeyTap.h
modules/gui/macosx/SPMediaKeyTap.m
modules/gui/macosx/SideBarItem.h
modules/gui/macosx/SideBarItem.m
modules/gui/macosx/VideoEffects.m
modules/gui/macosx/about.h
modules/gui/macosx/about.m
modules/gui/macosx/applescript.m
modules/gui/macosx/bookmarks.m
modules/gui/macosx/coredialogs.h
modules/gui/macosx/coredialogs.m
modules/gui/macosx/eyetv.m
modules/gui/macosx/fspanel.m
modules/gui/macosx/misc.m
modules/gui/macosx/open.m
modules/gui/macosx/playlist.m
modules/gui/macosx/playlistinfo.m
modules/gui/macosx/prefs.m
modules/gui/macosx/prefs_widgets.m
modules/gui/macosx/simple_prefs.h
modules/gui/macosx/simple_prefs.m
modules/gui/macosx_dialog_provider/VLCLoginPanel.m
modules/gui/minimal_macosx/voutgl.m
modules/video_output/macosx.m

index 51c390bb3492ec707d89ec5a52f215966f17795f..bc02edaf72b6b51e2455a7ac49601e1f0dc87a72 100644 (file)
@@ -251,7 +251,8 @@ static void Close( vlc_object_t *p_this )
  
     msg_Dbg( p_access, "plugin notified" );
 
-       close(p_sys->eyetvSock);
+
+close(p_sys->eyetvSock);
  
     msg_Dbg( p_access, "msg port closed and freed" );
  
@@ -316,7 +317,7 @@ static int Control( access_t *p_access, int i_query, va_list args )
             *pi_64 =
                 INT64_C(1000) * var_InheritInteger( p_access, "live-caching" );
             break;
-        
+
         case ACCESS_SET_PAUSE_STATE:
         case ACCESS_GET_TITLE_INFO:
         case ACCESS_SET_TITLE:
index b2091a853ebce428d5c3b66af03ff91461a4e494..ce41a0d6e72d22b0da849a033e8da9008d7c7db0 100644 (file)
@@ -141,7 +141,8 @@ vlc_module_end ()
 {
     CVImageBufferRef imageBuffer;
     mtime_t pts;
-       void * pixels;
+
+void * pixels;
 
     if(!currentImageBuffer || currentPts == previousPts )
         return 0;
@@ -157,14 +158,14 @@ vlc_module_end ()
                 memcpy( buffer, pixels, CVPixelBufferGetBytesPerRow(imageBuffer) * CVPixelBufferGetHeight(imageBuffer));
             CVPixelBufferUnlockBaseAddress(imageBuffer, 0);
         }
-            
+
     }
     CVBufferRelease(imageBuffer);
 
-       if(pixels)
-               return currentPts;
-       else
-               return 0;
+    if(pixels)
+        return currentPts;
+    else
+        return 0;
 }
 
 @end
index 4cd015b525792f80a4a8c903b51d596603cfc327..ffc33e4cd4e10071921c9203144cca18463394e5 100644 (file)
@@ -74,8 +74,11 @@ enum AppleRemoteEventIdentifier
     kRemoteControl_Switched         =1<<11,
     kRemoteButtonVolume_Plus_Hold   =1<<12,
     kRemoteButtonVolume_Minus_Hold  =1<<13,
-    k2009RemoteButtonPlay                      =1<<14,
-    k2009RemoteButtonFullscreen                =1<<15
+    k2009RemoteButtonPlay
+
+   =1<<14,
+    k2009RemoteButtonFullscreen
+ =1<<15
 };
 typedef enum AppleRemoteEventIdentifier AppleRemoteEventIdentifier;
 
index f8bad4e9e709483fa099f21e67142c4ccf46cdfa..e9300342135619bbdd70120fa0448347fbac03c6 100644 (file)
@@ -116,7 +116,7 @@ static AppleRemote *_o_sharedInstance = nil;
             [cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteButtonPlay_Sleep]     forKey:@"37_33_21_20_2_37_33_21_20_2_"];
             [cookieToButtonMapping setObject:[NSNumber numberWithInt:kRemoteControl_Switched]     forKey:@"42_33_23_21_20_2_33_23_21_20_2_"];
             [cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonPlay]       forKey:@"33_21_20_8_2_33_21_20_8_2_"];
-            [cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonFullscreen] forKey:@"33_21_20_3_2_33_21_20_3_2_"];            
+            [cookieToButtonMapping setObject:[NSNumber numberWithInt:k2009RemoteButtonFullscreen] forKey:@"33_21_20_3_2_33_21_20_3_2_"];
         }
         else
         {
@@ -480,7 +480,7 @@ static AppleRemote* sharedInstance=nil;
         cookieString = [previousRemainingCookieString stringByAppendingString: cookieString];
         NSLog(@"New cookie string is %@", cookieString);
         [previousRemainingCookieString release], previousRemainingCookieString=nil;
-       }*/
+    }*/
     if (cookieString == nil || [cookieString length] == 0) return;
     NSNumber* buttonId = [[self cookieToButtonMapping] objectForKey: cookieString];
     if (buttonId != nil) {
index f63344acdf2934d930c021e5e928fb1bec784234..4ed578788839d3ad7561c457704da213ee1409ba 100644 (file)
@@ -71,7 +71,7 @@
     IBOutlet id o_comp_band7_sld;
     IBOutlet id o_comp_band7_fld;
     IBOutlet id o_comp_band7_lbl;
-    
+
     /* Spatializer */
     IBOutlet id o_spat_enable_ckb;
     IBOutlet id o_spat_reset_btn;
index 1e9e31b8272ffed2be0c6d720c316c89966d97b3..23f3d41c2e346e1ff846038eafd488c5b1fc42e4 100644 (file)
@@ -55,7 +55,7 @@ static VLCAudioEffects *_o_sharedInstance = nil;
         p_intf = VLCIntf;
         _o_sharedInstance = [super init];
     }
-    
+
     return _o_sharedInstance;
 }
 
@@ -83,7 +83,7 @@ static VLCAudioEffects *_o_sharedInstance = nil;
     [o_comp_band5_lbl setStringValue:_NS("Ratio")];
     [o_comp_band6_lbl setStringValue:_NS("Knee radius")];
     [o_comp_band7_lbl setStringValue:_NS("Makeup gain")];
-    
+
     /* Spatializer */
     [o_spat_enable_ckb setTitle:_NS("Enable Spatializer")];
     [o_spat_reset_btn setTitle:_NS("Reset")];
@@ -92,12 +92,12 @@ static VLCAudioEffects *_o_sharedInstance = nil;
     [o_spat_band3_lbl setStringValue:_NS("Wet")];
     [o_spat_band4_lbl setStringValue:_NS("Dry")];
     [o_spat_band5_lbl setStringValue:_NS("Dump")];
-    
+
     /* Filter */
     [o_filter_headPhone_ckb setTitle:_NS("Headphone virtualization")];
     [o_filter_normLevel_ckb setTitle:_NS("Volume normalization")];
     [o_filter_normLevel_lbl setStringValue:_NS("Maximum level")];
-    
+
     /* generic */
     [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"equalizer"]] setLabel:_NS("Equalizer")];
     [[o_tableView tabViewItemAtIndex:[o_tableView indexOfTabViewItemWithIdentifier:@"compressor"]] setLabel:_NS("Compressor")];
@@ -129,8 +129,8 @@ static VLCAudioEffects *_o_sharedInstance = nil;
     if( p_aout )
         psz_tmp = var_GetNonEmptyString( p_aout, "audio-filter" );
     else
-        psz_tmp = config_GetPsz( p_intf, "audio-filter" );        
-    
+        psz_tmp = config_GetPsz( p_intf, "audio-filter" );
+
     if( b_on )
     {
         if(! psz_tmp)
@@ -165,20 +165,20 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
     vlc_object_t *p_object = VLC_OBJECT(getAout());
     if( p_object == NULL )
         p_object = vlc_object_hold(pl_Get( p_custom_intf ));
-    
+
     psz_string = config_GetPsz( p_custom_intf, "audio-filter" );
-    
+
     if(! psz_string )
         psz_string = var_GetNonEmptyString( p_object, "audio-filter" );
-    
+
     vlc_object_release( p_object );
-    
+
     if( !psz_string ) return false;
-    
+
     psz_parser = strstr( psz_string, psz_name );
-    
+
     free( psz_string );
-    
+
     if ( psz_parser )
         return true;
     else
@@ -225,7 +225,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
                          eqz_preset_10b[i].f_amp[7],
                          eqz_preset_10b[i].f_amp[8],
                          eqz_preset_10b[i].f_amp[9] );
-                
+
                 var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT | VLC_VAR_DOINHERIT );
                 var_Create( p_object, "equalizer-bands", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
                 var_SetFloat( p_object, "equalizer-preamp", eqz_preset_10b[i].f_preamp );
@@ -245,17 +245,17 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
     bool b_2p;
     bool b_enabled = GetEqualizerStatus( p_intf, (char *)"equalizer" );
     vlc_object_t *p_object = VLC_OBJECT(getAout());
-    
+
     if( p_object == NULL )
         p_object = vlc_object_hold(pl_Get( p_intf ));
-    
+
     var_Create( p_object, "equalizer-preamp", VLC_VAR_FLOAT |
                VLC_VAR_DOINHERIT );
     var_Create( p_object, "equalizer-bands", VLC_VAR_STRING |
                VLC_VAR_DOINHERIT );
-    
+
     psz_bands = var_GetNonEmptyString( p_object, "equalizer-bands" );
-    
+
     if( psz_bands == NULL )
         psz_bands = strdup( "0 0 0 0 0 0 0 0 0 0" );
 
@@ -263,25 +263,25 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
     f_preamp = config_GetFloat( p_object, "equalizer-preamp" );
 
     vlc_object_release( p_object );
-    
+
     /* Set the preamp slider */
     [o_eq_preamp_sld setFloatValue: f_preamp];
 
     /* Set the bands slider */
     psz_bands_init = psz_bands;
-    
+
     for( int i = 0; i < 10; i++ )
     {
         /* Read dB -20/20 */
         f_band[i] = strtof( psz_bands, &p_next );
         if( !p_next || p_next == psz_bands ) break; /* strtof() failed */
-        
+
         if( !*psz_bands ) break; /* end of line */
         psz_bands = p_next+1;
     }
     free( psz_bands_init );
     [self setBandSlidersValues:f_band];
-    
+
     /* Set the the checkboxes */
     [o_eq_enable_ckb setState: b_enabled];
     [o_eq_twopass_ckb setState: b_2p];
@@ -320,7 +320,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
 - (void)setValue:(float)value forSlider:(int)index
 {
     id slider = [self sliderByIndex:index];
-    
+
     if (slider != nil)
         [slider setFloatValue:value];
 }
@@ -333,10 +333,10 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
 - (IBAction)eq_bandSliderUpdated:(id)sender
 {
     vlc_object_t *p_object = VLC_OBJECT(getAout());
-    
+
     if( p_object == NULL )
         p_object = vlc_object_hold(pl_Get( p_intf ));
-    
+
     const char *psz_values;
     NSString *preset = [NSString stringWithFormat:@"%.1f ", [o_eq_band1_sld floatValue] ];
     preset = [preset stringByAppendingFormat:@"%.1f ", [o_eq_band2_sld floatValue] ];
@@ -529,7 +529,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
     } 
     else
         [o_spat_enable_ckb setState: NSOffState];
-    
+
     [o_spat_band1_sld setFloatValue: config_GetFloat( p_intf, "spatializer-roomsize" )];
     [o_spat_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [o_spat_band1_sld floatValue]]];
     [o_spat_band2_sld setFloatValue: config_GetFloat( p_intf, "spatializer-width" )];
@@ -564,7 +564,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
 
 - (IBAction)spat_enable:(id)sender
 {
-    [self setAudioFilter:"spatializer" on:[sender state]];    
+    [self setAudioFilter:"spatializer" on:[sender state]];
 }
 
 - (IBAction)spat_sliderUpdated:(id)sender
@@ -581,13 +581,13 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
         value = "spatializer-dry";
     else if( sender == o_spat_band5_sld )
         value = "spatializer-damp";
-    
+
     if( p_aout ) {
         var_SetFloat( p_aout, value, [sender floatValue] );
         vlc_object_release( p_aout );
     }
     config_PutFloat( p_intf, value, [sender floatValue] );
-    
+
     if( sender == o_spat_band1_sld )
         [o_spat_band1_fld setStringValue:[NSString localizedStringWithFormat:@"%1.1f", [sender floatValue]]];
     else if( sender == o_spat_band2_sld )
@@ -625,7 +625,7 @@ static bool GetEqualizerStatus( intf_thread_t *p_custom_intf,
 
 - (IBAction)filter_enableVolumeNorm:(id)sender
 {
-    [self setAudioFilter: "normvol" on:[sender state]];    
+    [self setAudioFilter: "normvol" on:[sender state]];
 }
 
 - (IBAction)filter_volNormSliderUpdated:(id)sender
index d773774c9cfd05ea12290f488adec2d1bc11a06f..ccd3181a0a582ff98e810ba3647ec2d9f250fa11 100644 (file)
@@ -55,7 +55,7 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
         _o_sharedInstance = [super init];
         b_lockAspectRatio = YES;
     }
-    
+
     return _o_sharedInstance;
 }
 
@@ -80,14 +80,14 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
 {
     playlist_t * p_playlist = pl_Get( VLCIntf );
     bool empty;
-    
+
     PL_LOCK;
     empty = playlist_IsEmpty( p_playlist );
     PL_UNLOCK;
-    
+
     if( empty )
         [[[VLCMain sharedInstance] open] openFileGeneric];
-    
+
     var_SetInteger( VLCIntf->p_libvlc, "key-action", ACTIONID_PLAY_PAUSE );
 }
 
index d29e47984353db487d9eac158392be890446c3c6..a69053688d883e692f0966badbb03bfc6109c967 100644 (file)
@@ -71,7 +71,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
 - (void)dealloc
 {
     [[NSNotificationCenter defaultCenter] removeObserver: self];
-    
+
     if (b_nib_about_loaded)
         [o_about release];
 
@@ -384,7 +384,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
 - (void)releaseRepresentedObjects:(NSMenu *)the_menu
 {
     if( !p_intf ) return;
-    
+
     NSArray *menuitems_array = [the_menu itemArray];
     NSUInteger menuItemCount = [menuitems_array count];
     for( NSUInteger i=0; i < menuItemCount; i++ )
@@ -878,7 +878,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
     bool b_value;
     playlist_t *p_playlist = pl_Get( VLCIntf );
     b_value = var_GetBool( p_playlist, "random" );
-       [o_mi_random setState: b_value];
+
+    [o_mi_random setState: b_value];
 }
 
 #pragma mark -
@@ -921,10 +922,10 @@ static VLCMainMenu *_o_sharedInstance = nil;
     if( i_type & VLC_VAR_HASCHOICE )
     {
         NSMenu *o_menu = [o_mi submenu];
-        
+
         [self setupVarMenu: o_menu forMenuItem: o_mi target:p_object
                        var:psz_variable selector:pf_callback];
-        
+
         free( text.psz_string );
         return;
     }
@@ -1242,7 +1243,9 @@ static VLCMainMenu *_o_sharedInstance = nil;
     if( [o_title isEqualToString: _NS("Normal Size")] )
     {
         NSMenuItem *item = [[o_mi menu] itemWithTitle:_NS("Teletext")];
-               bool b_telx = p_input && var_GetInteger( p_input, "teletext-es" ) >= 0;
+
+
+bool b_telx = p_input && var_GetInteger( p_input, "teletext-es" ) >= 0;
 
         [[item submenu] setAutoenablesItems:NO];
         for( int k=0; k < [[item submenu] numberOfItems]; k++ )
index 1527003e6fed7a82f48d52428313e55bebda0a38..b22f0abdab5186ab9c29ad0e305bdef14d111ee3 100644 (file)
@@ -228,7 +228,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
         else
         {
             [o_effects_btn setImage: [NSImage imageNamed:@"effects-double-buttons_dark"]];
-            [o_effects_btn setAlternateImage: [NSImage imageNamed:@"effects-double-buttons-pressed_dark"]];            
+            [o_effects_btn setAlternateImage: [NSImage imageNamed:@"effects-double-buttons-pressed_dark"]];
         }
         [o_fullscreen_btn setImage: [NSImage imageNamed:@"fullscreen-double-buttons_dark"]];
         [o_fullscreen_btn setAlternateImage: [NSImage imageNamed:@"fullscreen-double-buttons-pressed_dark"]];
@@ -682,7 +682,8 @@ static VLCMainWindow *_o_sharedInstance = nil;
     bool b_value;
     playlist_t *p_playlist = pl_Get( VLCIntf );
     b_value = var_GetBool( p_playlist, "random" );
-       if(b_value) {
+
+    if(b_value) {
         [o_shuffle_btn setImage: o_shuffle_on_img];
         [o_shuffle_btn setAlternateImage: o_shuffle_on_pressed_img];
     }
@@ -779,16 +780,18 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
 - (BOOL)validateMenuItem:(NSMenuItem *)menuItem
 {
-       SEL s_menuAction = [menuItem action];
-       if ((s_menuAction == @selector(performClose:)) || (s_menuAction == @selector(performMiniaturize:)) || (s_menuAction == @selector(performZoom:)))
-        return YES;
+    SEL s_menuAction = [menuItem action];
 
-       return [super validateMenuItem:menuItem];
+    if ((s_menuAction == @selector(performClose:)) || (s_menuAction == @selector(performMiniaturize:)) || (s_menuAction == @selector(performZoom:)))
+            return YES;
+
+    return [super validateMenuItem:menuItem];
 }
 
 - (BOOL)isMainWindow
 {
-       return YES;
+
+return YES;
 }
 
 - (void)setTitle:(NSString *)title
@@ -1531,7 +1534,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
             [o_nonembedded_window orderOut: self];
         else
             [super orderOut: self];
-        
+
         [self unlockFullscreenAnimation];
         return;
     }
@@ -1934,11 +1937,11 @@ static VLCMainWindow *_o_sharedInstance = nil;
         NSRect winrect;
         CGFloat f_titleBarHeight = [o_titlebar_view frame].size.height;
         winrect = [self frame];
-        
+
         [o_titlebar_view setFrame: NSMakeRect( 0, winrect.size.height - f_titleBarHeight,
                                               winrect.size.width, f_titleBarHeight )];
         [[self contentView] addSubview: o_titlebar_view];
-        
+
         winrect.size.height = winrect.size.height + f_titleBarHeight;
         [self setFrame: winrect display:NO animate:NO];
         winrect = [o_split_view frame];
@@ -1974,41 +1977,37 @@ static VLCMainWindow *_o_sharedInstance = nil;
 /* taken under BSD-new from the PXSourceList sample project, adapted for VLC */
 - (NSUInteger)sourceList:(PXSourceList*)sourceList numberOfChildrenOfItem:(id)item
 {
-       //Works the same way as the NSOutlineView data source: `nil` means a parent item
-       if(item==nil) {
-               return [o_sidebaritems count];
-       }
-       else {
-               return [[item children] count];
-       }
+    //Works the same way as the NSOutlineView data source: `nil` means a parent item
+    if(item==nil)
+        return [o_sidebaritems count];
+    else
+        return [[item children] count];
 }
 
 
 - (id)sourceList:(PXSourceList*)aSourceList child:(NSUInteger)index ofItem:(id)item
 {
     //Works the same way as the NSOutlineView data source: `nil` means a parent item
-       if(item==nil) {
-               return [o_sidebaritems objectAtIndex:index];
-       }
-       else {
-               return [[item children] objectAtIndex:index];
-       }
+    if(item==nil)
+        return [o_sidebaritems objectAtIndex:index];
+    else
+        return [[item children] objectAtIndex:index];
 }
 
 
 - (id)sourceList:(PXSourceList*)aSourceList objectValueForItem:(id)item
 {
-       return [item title];
+    return [item title];
 }
 
 - (void)sourceList:(PXSourceList*)aSourceList setObjectValue:(id)object forItem:(id)item
 {
-       [item setTitle:object];
+    [item setTitle:object];
 }
 
 - (BOOL)sourceList:(PXSourceList*)aSourceList isItemExpandable:(id)item
 {
-       return [item hasChildren];
+    return [item hasChildren];
 }
 
 
@@ -2017,7 +2016,7 @@ static VLCMainWindow *_o_sharedInstance = nil;
     if ([[item identifier] isEqualToString: @"playlist"] || [[item identifier] isEqualToString: @"medialibrary"])
         return YES;
 
-       return [item hasBadge];
+    return [item hasBadge];
 }
 
 
@@ -2042,25 +2041,27 @@ static VLCMainWindow *_o_sharedInstance = nil;
 
         return i_playlist_size;
     }
-       return [item badgeValue];
+
+    return [item badgeValue];
 }
 
 
 - (BOOL)sourceList:(PXSourceList*)aSourceList itemHasIcon:(id)item
 {
-       return [item hasIcon];
+    return [item hasIcon];
 }
 
 
 - (NSImage*)sourceList:(PXSourceList*)aSourceList iconForItem:(id)item
 {
-       return [item icon];
+    return [item icon];
 }
 
 - (NSMenu*)sourceList:(PXSourceList*)aSourceList menuForEvent:(NSEvent*)theEvent item:(id)item
 {
-       if ([theEvent type] == NSRightMouseDown || ([theEvent type] == NSLeftMouseDown && ([theEvent modifierFlags] & NSControlKeyMask) == NSControlKeyMask)) {
-               if (item != nil)
+    if ([theEvent type] == NSRightMouseDown || ([theEvent type] == NSLeftMouseDown && ([theEvent modifierFlags] & NSControlKeyMask) == NSControlKeyMask))
+    {
+        if (item != nil)
         {
             NSMenu * m;
             if ([item sdtype] > 0)
@@ -2076,8 +2077,9 @@ static VLCMainWindow *_o_sharedInstance = nil;
             }
             return [m autorelease];
         }
-       }
-       return nil;
+    }
+
+    return nil;
 }
 
 - (IBAction)sdmenuhandler:(id)sender
@@ -2109,10 +2111,12 @@ static VLCMainWindow *_o_sharedInstance = nil;
 - (void)sourceListSelectionDidChange:(NSNotification *)notification
 {
     playlist_t * p_playlist = pl_Get( VLCIntf );
-       NSIndexSet *selectedIndexes = [o_sidebar_view selectedRowIndexes];
+
+    NSIndexSet *selectedIndexes = [o_sidebar_view selectedRowIndexes];
     id item = [o_sidebar_view itemAtRow:[selectedIndexes firstIndex]];
 
-       //Set the label text to represent the new selection
+
+    //Set the label text to represent the new selection
     if ([item sdtype] > -1 && [[item identifier] length] > 0)
     {
         BOOL sd_loaded = playlist_IsServicesDiscoveryLoaded( p_playlist, [[item identifier] UTF8String] );
index fa2c4e8df3a05ec7c4b12e08a4f3fd105f301609..a737a42eb10a277e172658d3181d811079819c4d 100644 (file)
             o_yellow_on_img = [[NSImage imageNamed:@"lion-window-minimize-on-graphite"] retain];
             o_green_img = [[NSImage imageNamed:@"lion-window-zoom-graphite"] retain];
             o_green_over_img = [[NSImage imageNamed:@"lion-window-zoom-over-graphite"] retain];
-            o_green_on_img = [[NSImage imageNamed:@"lion-window-zoom-on-graphite"] retain];            
+            o_green_on_img = [[NSImage imageNamed:@"lion-window-zoom-on-graphite"] retain];
         }
     } else {
         if( [NSColor currentControlTint] == NSBlueControlTint )
             o_yellow_on_img = [[NSImage imageNamed:@"snowleo-window-minimize-on-graphite"] retain];
             o_green_img = [[NSImage imageNamed:@"snowleo-window-zoom-graphite"] retain];
             o_green_over_img = [[NSImage imageNamed:@"snowleo-window-zoom-over-graphite"] retain];
-            o_green_on_img = [[NSImage imageNamed:@"snowleo-window-zoom-on-graphite"] retain];            
+            o_green_on_img = [[NSImage imageNamed:@"snowleo-window-zoom-on-graphite"] retain];
         }
     }
 }
 - (NSArray*)accessibilityAttributeNames {
     NSArray *theAttributeNames = [super accessibilityAttributeNames];
     id theControlView = [self controlView];
-    return ([theControlView respondsToSelector: @selector(extendedAccessibilityAttributeNames:)] ? [theControlView extendedAccessibilityAttributeNames: theAttributeNames] : theAttributeNames);       // ask the cell's control view (i.e., the button) for additional attribute values
+    return ([theControlView respondsToSelector: @selector(extendedAccessibilityAttributeNames:)] ? [theControlView extendedAccessibilityAttributeNames: theAttributeNames] : theAttributeNames); // ask the cell's control view (i.e., the button) for additional attribute values
 }
 
 - (id)accessibilityAttributeValue: (NSString*)theAttributeName {
     if ([theControlView respondsToSelector: @selector(extendedAccessibilityAttributeValue:)]) {
         id theValue = [theControlView extendedAccessibilityAttributeValue: theAttributeName];
         if (theValue) {
-            return theValue;   // if this is an extended attribute value we added, return that -- otherwise, fall back to super's implementation
+            return theValue; // if this is an extended attribute value we added, return that -- otherwise, fall back to super's implementation
         }
     }
     return [super accessibilityAttributeValue: theAttributeName];
     if ([theControlView respondsToSelector: @selector(extendedAccessibilityIsAttributeSettable:)]) {
         NSNumber *theValue = [theControlView extendedAccessibilityIsAttributeSettable: theAttributeName];
         if (theValue) {
-            return [theValue boolValue];       // same basic strategy we use in -accessibilityAttributeValue:
+            return [theValue boolValue]; // same basic strategy we use in -accessibilityAttributeValue:
         }
     }
     return [super accessibilityIsAttributeSettable: theAttributeName];
 }
 
 - (NSArray*)extendedAccessibilityAttributeNames: (NSArray*)theAttributeNames {
-    return ([theAttributeNames containsObject: NSAccessibilitySubroleAttribute] ? theAttributeNames : [theAttributeNames arrayByAddingObject: NSAccessibilitySubroleAttribute]);       // run-of-the-mill button cells don't usually have a Subrole attribute, so we add that attribute
+    return ([theAttributeNames containsObject: NSAccessibilitySubroleAttribute] ? theAttributeNames : [theAttributeNames arrayByAddingObject: NSAccessibilitySubroleAttribute]); // run-of-the-mill button cells don't usually have a Subrole attribute, so we add that attribute
 }
 
 - (id)extendedAccessibilityAttributeValue: (NSString*)theAttributeName {
 }
 
 - (NSNumber*)extendedAccessibilityIsAttributeSettable: (NSString*)theAttributeName {
-    return ([theAttributeName isEqualToString: NSAccessibilitySubroleAttribute] ? [NSNumber numberWithBool: NO] : nil);        // make the Subrole attribute we added non-settable
+    return ([theAttributeName isEqualToString: NSAccessibilitySubroleAttribute] ? [NSNumber numberWithBool: NO] : nil); // make the Subrole attribute we added non-settable
 }
 
 - (void)accessibilityPerformAction: (NSString*)theActionName {
index 416dfe009abcb978b28600bbc3d79b83f809f9bc..d892dfaf123ac3c59d8a62fa4b0ef683fa0df8fb 100644 (file)
 
 @interface PXSourceList: NSOutlineView <NSOutlineViewDelegate, NSOutlineViewDataSource>
 {
-       id <PXSourceListDelegate> _secondaryDelegate;           //Used to store the publicly visible delegate
-       id <PXSourceListDataSource> _secondaryDataSource;       //Used to store the publicly visible data source
-       
-       NSSize _iconSize;                                                                       //The size of icons in the Source List. Defaults to 16x16
+    id <PXSourceListDelegate> _secondaryDelegate; //Used to store the publicly visible delegate
+    id <PXSourceListDataSource> _secondaryDataSource; //Used to store the publicly visible data source
+
+    NSSize _iconSize; //The size of icons in the Source List. Defaults to 16x16
 }
-       
+
 @property (nonatomic) NSSize iconSize;
-       
+
 @property (assign) id<PXSourceListDataSource> dataSource;
 @property (assign) id<PXSourceListDelegate> delegate;
 
-- (NSUInteger)numberOfGroups;                                                  //Returns the number of groups in the Source List
-- (BOOL)isGroupItem:(id)item;                                                  //Returns whether `item` is a group
-- (BOOL)isGroupAlwaysExpanded:(id)group;                               //Returns whether `group` is displayed as always expanded
+- (NSUInteger)numberOfGroups; //Returns the number of groups in the Source List
+- (BOOL)isGroupItem:(id)item; //Returns whether `item` is a group
+- (BOOL)isGroupAlwaysExpanded:(id)group; //Returns whether `group` is displayed as always expanded
 
-- (BOOL)itemHasBadge:(id)item;                                                 //Returns whether `item` has a badge
-- (NSInteger)badgeValueForItem:(id)item;                               //Returns the badge value for `item`
+- (BOOL)itemHasBadge:(id)item; //Returns whether `item` has a badge
+- (NSInteger)badgeValueForItem:(id)item; //Returns the badge value for `item`
 
 @end
 
index 58192adbc4fcaacf61e1b5802c7f11aec549fc7e..9846a3ca8027004333d6d8acaf9dc49d3fd0c2ab 100644 (file)
 #import "SideBarItem.h"
 
 //Layout constants
-#define MIN_BADGE_WIDTH                                                        22.0            //The minimum badge width for each item (default 22.0)
-#define BADGE_HEIGHT                                                   14.0            //The badge height for each item (default 14.0)
-#define BADGE_MARGIN                                                   5.0                     //The spacing between the badge and the cell for that row
-#define ROW_RIGHT_MARGIN                                               5.0                     //The spacing between the right edge of the badge and the edge of the table column
-#define ICON_SPACING                                                   2.0                     //The spacing between the icon and it's adjacent cell
-#define DISCLOSURE_TRIANGLE_SPACE                              18.0            //The indentation reserved for disclosure triangles for non-group items
+#define MIN_BADGE_WIDTH     22.0            //The minimum badge width for each item (default 22.0)
+#define BADGE_HEIGHT        14.0            //The badge height for each item (default 14.0)
+#define BADGE_MARGIN        5.0             //The spacing between the badge and the cell for that row
+#define ROW_RIGHT_MARGIN    5.0             //The spacing between the right edge of the badge and the edge of the table column
+#define ICON_SPACING        2.0             //The spacing between the icon and it's adjacent cell
+#define DISCLOSURE_TRIANGLE_SPACE   18.0    //The indentation reserved for disclosure triangles for non-group items
 
 //Drawing constants
-#define BADGE_BACKGROUND_COLOR                                 [NSColor colorWithCalibratedRed:(152/255.0) green:(168/255.0) blue:(202/255.0) alpha:1]
-#define BADGE_HIDDEN_BACKGROUND_COLOR                  [NSColor colorWithDeviceWhite:(180/255.0) alpha:1]
-#define BADGE_SELECTED_TEXT_COLOR                              [NSColor keyboardFocusIndicatorColor]
-#define BADGE_SELECTED_UNFOCUSED_TEXT_COLOR            [NSColor colorWithCalibratedRed:(153/255.0) green:(169/255.0) blue:(203/255.0) alpha:1]
-#define BADGE_SELECTED_HIDDEN_TEXT_COLOR               [NSColor colorWithCalibratedWhite:(170/255.0) alpha:1]
-#define BADGE_FONT                                                             [NSFont boldSystemFontOfSize:11]
+#define BADGE_BACKGROUND_COLOR              [NSColor colorWithCalibratedRed:(152/255.0) green:(168/255.0) blue:(202/255.0) alpha:1]
+#define BADGE_HIDDEN_BACKGROUND_COLOR       [NSColor colorWithDeviceWhite:(180/255.0) alpha:1]
+#define BADGE_SELECTED_TEXT_COLOR           [NSColor keyboardFocusIndicatorColor]
+#define BADGE_SELECTED_UNFOCUSED_TEXT_COLOR [NSColor colorWithCalibratedRed:(153/255.0) green:(169/255.0) blue:(203/255.0) alpha:1]
+#define BADGE_SELECTED_HIDDEN_TEXT_COLOR    [NSColor colorWithCalibratedWhite:(170/255.0) alpha:1]
+#define BADGE_FONT                          [NSFont boldSystemFontOfSize:11]
 
 //Delegate notification constants
 NSString * const PXSLSelectionIsChangingNotification = @"PXSourceListSelectionIsChanging";
@@ -55,43 +55,42 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
 #pragma mark Init/Dealloc/Finalize
 
 - (id)initWithCoder:(NSCoder*)decoder
-{      
-       if(self=[super initWithCoder:decoder])
-       {
-               [self setDelegate:(id<PXSourceListDelegate>)[super delegate]];
-               [super setDelegate:self];
-               
-               [self setDataSource:(id<PXSourceListDataSource>)[super dataSource]];
-               [super setDataSource:self];
-               
-               _iconSize = NSMakeSize(16,16);
-       }
-       
-       return self;
+{
+    if(self=[super initWithCoder:decoder])
+    {
+        [self setDelegate:(id<PXSourceListDelegate>)[super delegate]];
+        [super setDelegate:self];
+        [self setDataSource:(id<PXSourceListDataSource>)[super dataSource]];
+        [super setDataSource:self];
+
+        _iconSize = NSMakeSize(16,16);
+    }
+
+    return self;
 }
 
 - (void)dealloc
 {
-       //Remove ourselves as the delegate and data source to be safe
-       [super setDataSource:nil];
-       [super setDelegate:nil];
-       
-       //Unregister the delegate from receiving notifications
-       [[NSNotificationCenter defaultCenter] removeObserver:_secondaryDelegate name:nil object:self];
-       
-       [super dealloc];
+    //Remove ourselves as the delegate and data source to be safe
+    [super setDataSource:nil];
+    [super setDelegate:nil];
+
+    //Unregister the delegate from receiving notifications
+    [[NSNotificationCenter defaultCenter] removeObserver:_secondaryDelegate name:nil object:self];
+
+    [super dealloc];
 }
 
 - (void)finalize
 {
-       //Remove ourselves as the delegate and data source to be safe
-       [super setDataSource:nil];
-       [super setDelegate:nil];
-       
-       //Unregister the delegate from receiving notifications
-       [[NSNotificationCenter defaultCenter] removeObserver:_secondaryDelegate name:nil object:self];
-       
-       [super finalize];
+    //Remove ourselves as the delegate and data source to be safe
+    [super setDataSource:nil];
+    [super setDelegate:nil];
+
+    //Unregister the delegate from receiving notifications
+    [[NSNotificationCenter defaultCenter] removeObserver:_secondaryDelegate name:nil object:self];
+
+    [super finalize];
 }
 
 #pragma mark -
@@ -99,48 +98,39 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
 
 - (void)setDelegate:(id<PXSourceListDelegate>)aDelegate
 {
-       //Unregister the old delegate from receiving notifications
-       [[NSNotificationCenter defaultCenter] removeObserver:_secondaryDelegate name:nil object:self];
-       
-       _secondaryDelegate = aDelegate;
-       
-       //Register the new delegate to receive notifications
-       [self registerDelegateToReceiveNotification:PXSLSelectionIsChangingNotification
-                                                                  withSelector:@selector(sourceListSelectionIsChanging:)];
-       [self registerDelegateToReceiveNotification:PXSLSelectionDidChangeNotification
-                                                                  withSelector:@selector(sourceListSelectionDidChange:)];
-       [self registerDelegateToReceiveNotification:PXSLItemWillExpandNotification
-                                                                  withSelector:@selector(sourceListItemWillExpand:)];
-       [self registerDelegateToReceiveNotification:PXSLItemDidExpandNotification
-                                                                  withSelector:@selector(sourceListItemDidExpand:)];
-       [self registerDelegateToReceiveNotification:PXSLItemWillCollapseNotification
-                                                                  withSelector:@selector(sourceListItemWillCollapse:)];
-       [self registerDelegateToReceiveNotification:PXSLItemDidCollapseNotification
-                                                                  withSelector:@selector(sourceListItemDidCollapse:)];
-       [self registerDelegateToReceiveNotification:PXSLDeleteKeyPressedOnRowsNotification
-                                                                  withSelector:@selector(sourceListDeleteKeyPressedOnRows:)];
+    //Unregister the old delegate from receiving notifications
+    [[NSNotificationCenter defaultCenter] removeObserver:_secondaryDelegate name:nil object:self];
+
+    _secondaryDelegate = aDelegate;
+    //Register the new delegate to receive notifications
+    [self registerDelegateToReceiveNotification:PXSLSelectionIsChangingNotification withSelector:@selector(sourceListSelectionIsChanging:)];
+    [self registerDelegateToReceiveNotification:PXSLSelectionDidChangeNotification withSelector:@selector(sourceListSelectionDidChange:)];
+    [self registerDelegateToReceiveNotification:PXSLItemWillExpandNotification withSelector:@selector(sourceListItemWillExpand:)];
+    [self registerDelegateToReceiveNotification:PXSLItemDidExpandNotification withSelector:@selector(sourceListItemDidExpand:)];
+    [self registerDelegateToReceiveNotification:PXSLItemWillCollapseNotification withSelector:@selector(sourceListItemWillCollapse:)];
+    [self registerDelegateToReceiveNotification:PXSLItemDidCollapseNotification withSelector:@selector(sourceListItemDidCollapse:)];
+    [self registerDelegateToReceiveNotification:PXSLDeleteKeyPressedOnRowsNotification withSelector:@selector(sourceListDeleteKeyPressedOnRows:)];
 }
 
 
 - (void)setDataSource:(id<PXSourceListDataSource>)aDataSource
 {
-       _secondaryDataSource = aDataSource;
-       
-       [self reloadData];
+    _secondaryDataSource = aDataSource;
+
+    [self reloadData];
 }
 
 - (void)setIconSize:(NSSize)newIconSize
 {
-       _iconSize = newIconSize;
-       
-       CGFloat rowHeight = [self rowHeight];
-       
-       //Make sure icon height does not exceed row height; if so constrain, keeping width and height in proportion
-       if(_iconSize.height>rowHeight)
-       {
-               _iconSize.width = _iconSize.width * (rowHeight/_iconSize.height);
-               _iconSize.height = rowHeight;
-       }
+    _iconSize = newIconSize;
+    CGFloat rowHeight = [self rowHeight];
+
+    //Make sure icon height does not exceed row height; if so constrain, keeping width and height in proportion
+    if(_iconSize.height>rowHeight)
+    {
+        _iconSize.width = _iconSize.width * (rowHeight/_iconSize.height);
+        _iconSize.height = rowHeight;
+    }
 }
 
 #pragma mark -
@@ -148,114 +138,112 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
 
 - (void)reloadData
 {
-       [super reloadData];
-       
-       //Expand items that are displayed as always expanded
-       if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)] &&
-          [_secondaryDelegate respondsToSelector:@selector(sourceList:isGroupAlwaysExpanded:)])
-       {
-               for(NSUInteger i=0;i<[self numberOfGroups];i++)
-               {
-                       id item = [_secondaryDataSource sourceList:self child:i ofItem:nil];
-                       
-                       if([self isGroupAlwaysExpanded:item]) {
-                               [self expandItem:item expandChildren:NO];
-                       }
-               }
-               
-       }
-       
-       //If there are selected rows and the item hierarchy has changed, make sure a Group row isn't
-       //selected
-       if([self numberOfSelectedRows]>0) {
-               NSIndexSet *selectedIndexes = [self selectedRowIndexes];
-               NSUInteger firstSelectedRow = [selectedIndexes firstIndex];
-               
-               //Is a group item selected?
-               if([self isGroupItem:[self itemAtRow:firstSelectedRow]]) {
-                       //Work backwards to find the first non-group row
-                       BOOL foundRow = NO;
-                       for(NSUInteger i=firstSelectedRow;i>0;i--)
-                       {
-                               if(![self isGroupItem:[self itemAtRow:i]]) {
-                                       [self selectRowIndexes:[NSIndexSet indexSetWithIndex:i] byExtendingSelection:NO];
-                                       foundRow = YES;
-                                       break;
-                               }
-                       }
-                       
-                       //If there is no non-group row preceding the currently selected group item, remove the selection
-                       //from the Source List
-                       if(!foundRow) {
-                               [self deselectAll:self];
-                       }
-               }
-       }
-       else if(![self allowsEmptySelection]&&[self numberOfSelectedRows]==0)
-       {
-               //Select the first non-group row if no rows are selected, and empty selection is disallowed
-               for(NSUInteger i=0;i<[self numberOfRows];i++)
-               {
-                       if(![self isGroupItem:[self itemAtRow:i]]) {
-                               [self selectRowIndexes:[NSIndexSet indexSetWithIndex:i] byExtendingSelection:NO];
-                               break;
-                       }
-               }
-       }
+    [super reloadData];
+
+    //Expand items that are displayed as always expanded
+    if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)] &&
+       [_secondaryDelegate respondsToSelector:@selector(sourceList:isGroupAlwaysExpanded:)])
+    {
+        for(NSUInteger i=0;i<[self numberOfGroups];i++)
+        {
+            id item = [_secondaryDataSource sourceList:self child:i ofItem:nil];
+
+            if([self isGroupAlwaysExpanded:item]) {
+                [self expandItem:item expandChildren:NO];
+            }
+        }
+    }
+
+    //If there are selected rows and the item hierarchy has changed, make sure a Group row isn't
+    //selected
+    if([self numberOfSelectedRows]>0) {
+        NSIndexSet *selectedIndexes = [self selectedRowIndexes];
+        NSUInteger firstSelectedRow = [selectedIndexes firstIndex];
+
+        //Is a group item selected?
+        if([self isGroupItem:[self itemAtRow:firstSelectedRow]]) {
+            //Work backwards to find the first non-group row
+            BOOL foundRow = NO;
+            for(NSUInteger i=firstSelectedRow;i>0;i--)
+            {
+                if(![self isGroupItem:[self itemAtRow:i]]) {
+                    [self selectRowIndexes:[NSIndexSet indexSetWithIndex:i] byExtendingSelection:NO];
+                    foundRow = YES;
+                    break;
+                }
+            }
+
+            //If there is no non-group row preceding the currently selected group item, remove the selection
+            //from the Source List
+            if(!foundRow) {
+                [self deselectAll:self];
+            }
+        }
+    }
+    else if(![self allowsEmptySelection]&&[self numberOfSelectedRows]==0)
+    {
+        //Select the first non-group row if no rows are selected, and empty selection is disallowed
+        for(NSUInteger i=0;i<[self numberOfRows];i++)
+        {
+            if(![self isGroupItem:[self itemAtRow:i]]) {
+                [self selectRowIndexes:[NSIndexSet indexSetWithIndex:i] byExtendingSelection:NO];
+                break;
+            }
+        }
+    }
 }
 
 - (NSUInteger)numberOfGroups
-{      
-       if([_secondaryDataSource respondsToSelector:@selector(sourceList:numberOfChildrenOfItem:)]) {
-               return [_secondaryDataSource sourceList:self numberOfChildrenOfItem:nil];
-       }
-       
-       return 0;
+{
+    if([_secondaryDataSource respondsToSelector:@selector(sourceList:numberOfChildrenOfItem:)]) {
+        return [_secondaryDataSource sourceList:self numberOfChildrenOfItem:nil];
+    }
+    return 0;
 }
 
 
 - (BOOL)isGroupItem:(id)item
 {
-       //Groups are defined as root items (at level 0)
-       return 0==[self levelForItem:item];
+    //Groups are defined as root items (at level 0)
+    return 0==[self levelForItem:item];
 }
 
 
 - (BOOL)isGroupAlwaysExpanded:(id)group
 {
-       //Make sure that the item IS a group to prevent unwanted queries sent to the data source
-       if([self isGroupItem:group]) {
-               //Query the data source
-               if([_secondaryDelegate respondsToSelector:@selector(sourceList:isGroupAlwaysExpanded:)]) {
-                       return [_secondaryDelegate sourceList:self isGroupAlwaysExpanded:group];
-               }
-       }
-       
-       return NO;
+    //Make sure that the item IS a group to prevent unwanted queries sent to the data source
+    if([self isGroupItem:group]) {
+        //Query the data source
+        if([_secondaryDelegate respondsToSelector:@selector(sourceList:isGroupAlwaysExpanded:)]) {
+            return [_secondaryDelegate sourceList:self isGroupAlwaysExpanded:group];
+        }
+    }
+
+    return NO;
 }
 
 
 - (BOOL)itemHasBadge:(id)item
 {
-       if([_secondaryDataSource respondsToSelector:@selector(sourceList:itemHasBadge:)]) {
-               return [_secondaryDataSource sourceList:self itemHasBadge:item];
-       }
-       
-       return NO;
+    if([_secondaryDataSource respondsToSelector:@selector(sourceList:itemHasBadge:)]) {
+        return [_secondaryDataSource sourceList:self itemHasBadge:item];
+    }
+
+    return NO;
 }
 
 - (NSInteger)badgeValueForItem:(id)item
-{      
-       //Make sure that the item has a badge
-       if(![self itemHasBadge:item]) {
-               return NSNotFound;
-       }
-       
-       if([_secondaryDataSource respondsToSelector:@selector(sourceList:badgeValueForItem:)]) {
-               return [_secondaryDataSource sourceList:self badgeValueForItem:item];
-       }
-       
-       return NSNotFound;
+{
+    //Make sure that the item has a badge
+    if(![self itemHasBadge:item]) {
+        return NSNotFound;
+    }
+
+    if([_secondaryDataSource respondsToSelector:@selector(sourceList:badgeValueForItem:)]) {
+        return [_secondaryDataSource sourceList:self badgeValueForItem:item];
+    }
+
+    return NSNotFound;
 }
 
 #pragma mark -
@@ -263,98 +251,91 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
 
 - (void)selectRowIndexes:(NSIndexSet*)indexes byExtendingSelection:(BOOL)extend
 {
-       NSUInteger numberOfIndexes = [indexes count];
-       
-       //Prevent empty selection if we don't want it
-       if(![self allowsEmptySelection]&&0==numberOfIndexes) {
-               return;
-       }
-       
-       //Would use blocks but we're also targeting 10.5...
-       //Get the selected indexes
-       NSUInteger *selectedIndexes = malloc(sizeof(NSUInteger)*numberOfIndexes);
-       [indexes getIndexes:selectedIndexes maxCount:numberOfIndexes inIndexRange:nil];
-       
-       //Loop through the indexes and only add non-group row indexes
-       //Allows selection across groups without selecting the group rows
-       NSMutableIndexSet *newSelectionIndexes = [NSMutableIndexSet indexSet];
-       for(NSInteger i=0;i<numberOfIndexes;i++)
-       {
-               if(![self isGroupItem:[self itemAtRow:selectedIndexes[i]]]) {
-                       [newSelectionIndexes addIndex:selectedIndexes[i]];
-               }
-       }
-       
-       //If there are any non-group rows selected
-       if([newSelectionIndexes count]>0) {
-               [super selectRowIndexes:newSelectionIndexes byExtendingSelection:extend];
-       }
-       
-       //C memory management... *sigh*
-       free(selectedIndexes);
+    NSUInteger numberOfIndexes = [indexes count];
+
+    //Prevent empty selection if we don't want it
+    if(![self allowsEmptySelection]&&0==numberOfIndexes) {
+        return;
+    }
+
+    //Would use blocks but we're also targeting 10.5...
+    //Get the selected indexes
+    NSUInteger *selectedIndexes = malloc(sizeof(NSUInteger)*numberOfIndexes);
+    [indexes getIndexes:selectedIndexes maxCount:numberOfIndexes inIndexRange:nil];
+
+    //Loop through the indexes and only add non-group row indexes
+    //Allows selection across groups without selecting the group rows
+    NSMutableIndexSet *newSelectionIndexes = [NSMutableIndexSet indexSet];
+    for(NSInteger i=0;i<numberOfIndexes;i++)
+    {
+        if(![self isGroupItem:[self itemAtRow:selectedIndexes[i]]]) {
+            [newSelectionIndexes addIndex:selectedIndexes[i]];
+        }
+    }
+
+    //If there are any non-group rows selected
+    if([newSelectionIndexes count]>0) {
+        [super selectRowIndexes:newSelectionIndexes byExtendingSelection:extend];
+    }
+
+    //C memory management... *sigh*
+    free(selectedIndexes);
 }
 
 #pragma mark -
 #pragma mark Layout
 
 - (NSRect)frameOfOutlineCellAtRow:(NSInteger)row
-{      
-       //Return a zero-rect if the item is always expanded (a disclosure triangle will not be drawn)
-       if([self isGroupAlwaysExpanded:[self itemAtRow:row]]) {
-               return NSZeroRect;
-       }
-       
-       return [super frameOfOutlineCellAtRow:row];
+{
+    //Return a zero-rect if the item is always expanded (a disclosure triangle will not be drawn)
+    if([self isGroupAlwaysExpanded:[self itemAtRow:row]]) {
+        return NSZeroRect;
+    }
+
+    return [super frameOfOutlineCellAtRow:row];
 }
 
 
 - (NSRect)frameOfCellAtColumn:(NSInteger)column row:(NSInteger)row
 {
-       id item = [self itemAtRow:row];
-       
-       NSCell *cell = [self preparedCellAtColumn:column row:row];
-       NSSize cellSize = [cell cellSize];
-       if (!([cell type] == NSImageCellType) && !([cell type] == NSTextCellType))
-               cellSize = [cell cellSizeForBounds:[super frameOfCellAtColumn:column row:row]];
-       NSRect cellFrame = [super frameOfCellAtColumn:column row:row];
-       
-       NSRect rowRect = [self rectOfRow:row];
-       
-       if([self isGroupItem:item])
-       {       
-               CGFloat minX = NSMinX(cellFrame);
-               
-               //Set the origin x-coord; if there are no children of the group at current, there will still be a 
-               //margin to the left of the cell (in cellFrame), which we don't want
-               if([self isGroupAlwaysExpanded:[self itemAtRow:row]]) {
-                       minX = 7;
-               }
-               
-               return NSMakeRect(minX,
-                                                 NSMidY(cellFrame)-(cellSize.height/2.0),
-                                                 NSWidth(rowRect)-minX,
-                                                 cellSize.height);
-       }
-       else
-       {
-               CGFloat leftIndent = ([self levelForRow:row] -1)*[self indentationPerLevel]+DISCLOSURE_TRIANGLE_SPACE;
-
-               //Calculate space left for a badge if need be
-               CGFloat rightIndent = [self sizeOfBadgeAtRow:row].width+ROW_RIGHT_MARGIN;
-               
-               //Allow space for an icon if need be
-               if(![self isGroupItem:item]&&[_secondaryDataSource respondsToSelector:@selector(sourceList:itemHasIcon:)])
-               {
-                       if([_secondaryDataSource sourceList:self itemHasIcon:item]) {
-                               leftIndent += [self iconSize].width+(ICON_SPACING*2);
-                       }
-               }
-               
-               return NSMakeRect(leftIndent,
-                                                 NSMidY(rowRect)-(cellSize.height/2.0),
-                                                 NSWidth(rowRect)-rightIndent-leftIndent,
-                                                 cellSize.height);
-       }
+    id item = [self itemAtRow:row];
+
+    NSCell *cell = [self preparedCellAtColumn:column row:row];
+    NSSize cellSize = [cell cellSize];
+    if (!([cell type] == NSImageCellType) && !([cell type] == NSTextCellType))
+        cellSize = [cell cellSizeForBounds:[super frameOfCellAtColumn:column row:row]];
+
+    NSRect cellFrame = [super frameOfCellAtColumn:column row:row];
+    NSRect rowRect = [self rectOfRow:row];
+
+    if([self isGroupItem:item])
+    {
+        CGFloat minX = NSMinX(cellFrame);
+
+        //Set the origin x-coord; if there are no children of the group at current, there will still be a
+        //margin to the left of the cell (in cellFrame), which we don't want
+        if([self isGroupAlwaysExpanded:[self itemAtRow:row]]) {
+            minX = 7;
+        }
+
+    return NSMakeRect(minX, NSMidY(cellFrame)-(cellSize.height/2.0), NSWidth(rowRect)-minX, cellSize.height);
+    }
+    else
+    {
+        CGFloat leftIndent = ([self levelForRow:row] -1)*[self indentationPerLevel]+DISCLOSURE_TRIANGLE_SPACE;
+
+        //Calculate space left for a badge if need be
+        CGFloat rightIndent = [self sizeOfBadgeAtRow:row].width+ROW_RIGHT_MARGIN;
+
+        //Allow space for an icon if need be
+        if(![self isGroupItem:item]&&[_secondaryDataSource respondsToSelector:@selector(sourceList:itemHasIcon:)])
+        {
+            if([_secondaryDataSource sourceList:self itemHasIcon:item]) {
+                leftIndent += [self iconSize].width+(ICON_SPACING*2);
+            }
+        }
+    return NSMakeRect(leftIndent, NSMidY(rowRect)-(cellSize.height/2.0), NSWidth(rowRect)-rightIndent-leftIndent, cellSize.height);
+    }
 }
 
 
@@ -362,28 +343,26 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
 //row for the row index passed to the method does not have a badge, then NSZeroSize is returned.
 - (NSSize)sizeOfBadgeAtRow:(NSInteger)rowIndex
 {
-       id rowItem = [self itemAtRow:rowIndex];
-       
-       //Make sure that the item has a badge
-       if(![self itemHasBadge:rowItem]) {
-               return NSZeroSize;
-       }
-       
-       NSAttributedString *badgeAttrString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d", [self badgeValueForItem:rowItem]]
-                                                                                                                                                 attributes:[NSDictionary dictionaryWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName, nil]];
-       
-       NSSize stringSize = [badgeAttrString size];
-       
-       //Calculate the width needed to display the text or the minimum width if it's smaller
-       CGFloat width = stringSize.width+(2*BADGE_MARGIN);
-       
-       if(width<MIN_BADGE_WIDTH) {
-               width = MIN_BADGE_WIDTH;
-       }
-       
-       [badgeAttrString release];
-       
-       return NSMakeSize(width, BADGE_HEIGHT);
+    id rowItem = [self itemAtRow:rowIndex];
+
+    //Make sure that the item has a badge
+    if(![self itemHasBadge:rowItem]) {
+        return NSZeroSize;
+    }
+
+    NSAttributedString *badgeAttrString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d", [self badgeValueForItem:rowItem]] attributes:[NSDictionary dictionaryWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName, nil]];
+    NSSize stringSize = [badgeAttrString size];
+
+    //Calculate the width needed to display the text or the minimum width if it's smaller
+    CGFloat width = stringSize.width+(2*BADGE_MARGIN);
+
+    if(width<MIN_BADGE_WIDTH) {
+        width = MIN_BADGE_WIDTH;
+    }
+
+    [badgeAttrString release];
+
+    return NSMakeSize(width, BADGE_HEIGHT);
 }
 
 
@@ -391,41 +370,32 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
 #pragma mark Drawing
 
 - (void)drawRow:(NSInteger)rowIndex clipRect:(NSRect)clipRect
-{      
-       [super drawRow:rowIndex clipRect:clipRect];
-       
-       id item = [self itemAtRow:rowIndex];
-       
-       //Draw an icon if the item has one
-       if(![self isGroupItem:item]&&[_secondaryDataSource respondsToSelector:@selector(sourceList:itemHasIcon:)])
-       {
-               if([_secondaryDataSource sourceList:self itemHasIcon:item])
-               {
-                       NSRect cellFrame = [self frameOfCellAtColumn:0 row:rowIndex];
-                       NSSize iconSize = [self iconSize];
-                       NSRect iconRect = NSMakeRect(NSMinX(cellFrame)-iconSize.width-ICON_SPACING,
-                                                                                NSMidY(cellFrame)-(iconSize.width/2.0f),
-                                                                                iconSize.width,
-                                                                                iconSize.height);
-                       
-                       if([_secondaryDataSource respondsToSelector:@selector(sourceList:iconForItem:)])
-                       {
-                               NSImage *icon = [_secondaryDataSource sourceList:self iconForItem:item];
-                               
-                               if(icon!=nil)
-                               {
-                                       NSSize actualIconSize = [icon size];
-                                       
-                                       //If the icon is *smaller* than the size retrieved from the -iconSize property, make sure we
-                                       //reduce the size of the rectangle to draw the icon in, so that it is not stretched.
-                                       if((actualIconSize.width<iconSize.width)||(actualIconSize.height<iconSize.height))
-                                       {
-                                               iconRect = NSMakeRect(NSMidX(iconRect)-(actualIconSize.width/2.0f),
-                                                                                         NSMidY(iconRect)-(actualIconSize.height/2.0f),
-                                                                                         actualIconSize.width,
-                                                                                         actualIconSize.height);
-                                       }
-                                       
+{
+    [super drawRow:rowIndex clipRect:clipRect];
+    id item = [self itemAtRow:rowIndex];
+
+    //Draw an icon if the item has one
+    if(![self isGroupItem:item]&&[_secondaryDataSource respondsToSelector:@selector(sourceList:itemHasIcon:)])
+    {
+        if([_secondaryDataSource sourceList:self itemHasIcon:item])
+        {
+            NSRect cellFrame = [self frameOfCellAtColumn:0 row:rowIndex];
+            NSSize iconSize = [self iconSize];
+            NSRect iconRect = NSMakeRect(NSMinX(cellFrame)-iconSize.width-ICON_SPACING, NSMidY(cellFrame)-(iconSize.width/2.0f), iconSize.width, iconSize.height);
+
+            if([_secondaryDataSource respondsToSelector:@selector(sourceList:iconForItem:)])
+            {
+                NSImage *icon = [_secondaryDataSource sourceList:self iconForItem:item];
+                if(icon!=nil)
+                {
+                    NSSize actualIconSize = [icon size];
+                    //If the icon is *smaller* than the size retrieved from the -iconSize property, make sure we
+                    //reduce the size of the rectangle to draw the icon in, so that it is not stretched.
+                    if((actualIconSize.width<iconSize.width)||(actualIconSize.height<iconSize.height))
+                    {
+                        iconRect = NSMakeRect(NSMidX(iconRect)-(actualIconSize.width/2.0f), NSMidY(iconRect)-(actualIconSize.height/2.0f), actualIconSize.width, actualIconSize.height);
+                    }
+
                     //Use 10.6 NSImage drawing if we can
                     if([icon respondsToSelector:@selector(drawInRect:fromRect:operation:fraction:respectFlipped:hints:)]) {
                         [icon drawInRect:iconRect
@@ -441,109 +411,101 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
                                operation:NSCompositeSourceOver
                                 fraction:1];
                     }
-                               }
-                       }
-               }
-       }
-       
-       //Draw the badge if the item has one
-       if([self itemHasBadge:item])
-       {
-               NSRect rowRect = [self rectOfRow:rowIndex];
-               NSSize badgeSize = [self sizeOfBadgeAtRow:rowIndex];
-               
-               NSRect badgeFrame = NSMakeRect(NSMaxX(rowRect)-badgeSize.width-ROW_RIGHT_MARGIN,
-                                                                          NSMidY(rowRect)-(badgeSize.height/2.0),
-                                                                          badgeSize.width,
-                                                                          badgeSize.height);
-               
-               [self drawBadgeForRow:rowIndex inRect:badgeFrame];
-       }
+                }
+            }
+        }
+    }
+
+    //Draw the badge if the item has one
+    if([self itemHasBadge:item])
+    {
+        NSRect rowRect = [self rectOfRow:rowIndex];
+        NSSize badgeSize = [self sizeOfBadgeAtRow:rowIndex];
+
+        NSRect badgeFrame = NSMakeRect(NSMaxX(rowRect)-badgeSize.width-ROW_RIGHT_MARGIN,
+                                       NSMidY(rowRect)-(badgeSize.height/2.0),
+                                       badgeSize.width,
+                                       badgeSize.height);
+        [self drawBadgeForRow:rowIndex inRect:badgeFrame];
+    }
 }
 
 - (void)drawBadgeForRow:(NSInteger)rowIndex inRect:(NSRect)badgeFrame
 {
-       id rowItem = [self itemAtRow:rowIndex];
-       
-       NSBezierPath *badgePath = [NSBezierPath bezierPathWithRoundedRect:badgeFrame
-                                                                                                                         xRadius:(BADGE_HEIGHT/2.0)
-                                                                                                                         yRadius:(BADGE_HEIGHT/2.0)];
-       
-       //Get window and control state to determine colours used
-       BOOL isVisible = [[NSApp mainWindow] isVisible];
-       BOOL isFocused = [[[self window] firstResponder] isEqual:self];
-       NSInteger rowBeingEdited = [self editedRow];
-       
-       //Set the attributes based on the row state
-       NSDictionary *attributes;
-       NSColor *backgroundColor;
-       
-       if([[self selectedRowIndexes] containsIndex:rowIndex])
-       {
-               backgroundColor = [NSColor whiteColor];
-               
-               //Set the text color based on window and control state
-               NSColor *textColor;
-               
-               if(isVisible && (isFocused || rowBeingEdited==rowIndex)) {
-                       textColor = BADGE_SELECTED_TEXT_COLOR;
-               }
-               else if(isVisible && !isFocused) {
-                       textColor = BADGE_SELECTED_UNFOCUSED_TEXT_COLOR;
-               }
-               else {
-                       textColor = BADGE_SELECTED_HIDDEN_TEXT_COLOR;
-               }
-               
-               attributes = [[NSDictionary alloc] initWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName,
-                                         textColor, NSForegroundColorAttributeName, nil];
-       }
-       else
-       {
-               //Set the text colour based on window and control state
-               NSColor *badgeColor = [NSColor whiteColor];
-               
-               if(isVisible) {
-                       //If the data source returns a custom colour..
-                       if([_secondaryDataSource respondsToSelector:@selector(sourceList:badgeBackgroundColorForItem:)]) {
-                               backgroundColor = [_secondaryDataSource sourceList:self badgeBackgroundColorForItem:rowItem];
-                               
-                               if(backgroundColor==nil)
-                                       backgroundColor = BADGE_BACKGROUND_COLOR;
-                       }
-                       else { //Otherwise use the default (purple-blue colour)
-                               backgroundColor = BADGE_BACKGROUND_COLOR;
-                       }
-                       
-                       //If the delegate wants a custom badge text colour..
-                       if([_secondaryDataSource respondsToSelector:@selector(sourceList:badgeTextColorForItem:)]) {
-                               badgeColor = [_secondaryDataSource sourceList:self badgeTextColorForItem:rowItem];
-                               
-                               if(badgeColor==nil)
-                                       badgeColor = [NSColor whiteColor];
-                       }
-               }
-               else { //Gray colour
-                       backgroundColor = BADGE_HIDDEN_BACKGROUND_COLOR;
-               }
-               
-               attributes = [[NSDictionary alloc] initWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName,
-                                         badgeColor, NSForegroundColorAttributeName, nil];
-       }
-       
-       [backgroundColor set];
-       [badgePath fill];
-       
-       //Draw the badge text
-       NSAttributedString *badgeAttrString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d", [self badgeValueForItem:rowItem]] 
-                                                                                                                                                 attributes:attributes];
-       NSSize stringSize = [badgeAttrString size];
-       NSPoint badgeTextPoint = NSMakePoint(NSMidX(badgeFrame)-(stringSize.width/2.0),         //Center in the badge frame
-                                                                                NSMidY(badgeFrame)-(stringSize.height/2.0));   //Center in the badge frame
-       [badgeAttrString drawAtPoint:badgeTextPoint];
-       
-       [attributes release];
-       [badgeAttrString release];
+    id rowItem = [self itemAtRow:rowIndex];
+    NSBezierPath *badgePath = [NSBezierPath bezierPathWithRoundedRect:badgeFrame
+                                                              xRadius:(BADGE_HEIGHT/2.0)
+                                                              yRadius:(BADGE_HEIGHT/2.0)];
+
+    //Get window and control state to determine colours used
+    BOOL isVisible = [[NSApp mainWindow] isVisible];
+    BOOL isFocused = [[[self window] firstResponder] isEqual:self];
+    NSInteger rowBeingEdited = [self editedRow];
+
+    //Set the attributes based on the row state
+    NSDictionary *attributes;
+    NSColor *backgroundColor;
+
+    if([[self selectedRowIndexes] containsIndex:rowIndex])
+    {
+        backgroundColor = [NSColor whiteColor];
+        //Set the text color based on window and control state
+        NSColor *textColor;
+        if(isVisible && (isFocused || rowBeingEdited==rowIndex)) {
+            textColor = BADGE_SELECTED_TEXT_COLOR;
+        }
+        else if(isVisible && !isFocused) {
+            textColor = BADGE_SELECTED_UNFOCUSED_TEXT_COLOR;
+        }
+        else {
+            textColor = BADGE_SELECTED_HIDDEN_TEXT_COLOR;
+        }
+
+        attributes = [[NSDictionary alloc] initWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName, textColor, NSForegroundColorAttributeName, nil];
+    }
+    else
+    {
+        //Set the text colour based on window and control state
+        NSColor *badgeColor = [NSColor whiteColor];
+
+        if(isVisible) {
+            //If the data source returns a custom colour..
+            if([_secondaryDataSource respondsToSelector:@selector(sourceList:badgeBackgroundColorForItem:)]) {
+                backgroundColor = [_secondaryDataSource sourceList:self badgeBackgroundColorForItem:rowItem];
+
+            if(backgroundColor==nil)
+                backgroundColor = BADGE_BACKGROUND_COLOR;
+        }
+        else { //Otherwise use the default (purple-blue colour)
+            backgroundColor = BADGE_BACKGROUND_COLOR;
+        }
+
+        //If the delegate wants a custom badge text colour..
+        if([_secondaryDataSource respondsToSelector:@selector(sourceList:badgeTextColorForItem:)]) {
+            badgeColor = [_secondaryDataSource sourceList:self badgeTextColorForItem:rowItem];
+
+            if(badgeColor==nil)
+                badgeColor = [NSColor whiteColor];
+        }
+    }
+    else { //Gray colour
+        backgroundColor = BADGE_HIDDEN_BACKGROUND_COLOR;
+        }
+    attributes = [[NSDictionary alloc] initWithObjectsAndKeys:BADGE_FONT, NSFontAttributeName, badgeColor, NSForegroundColorAttributeName, nil];
+    }
+
+    [backgroundColor set];
+    [badgePath fill];
+
+    //Draw the badge text
+    NSAttributedString *badgeAttrString = [[NSAttributedString alloc] initWithString:[NSString stringWithFormat:@"%d", [self badgeValueForItem:rowItem]] attributes:attributes];
+
+    NSSize stringSize = [badgeAttrString size];
+    NSPoint badgeTextPoint = NSMakePoint(NSMidX(badgeFrame)-(stringSize.width/2.0), //Center in the badge frame
+                                         NSMidY(badgeFrame)-(stringSize.height/2.0)); //Center in the badge frame
+    [badgeAttrString drawAtPoint:badgeTextPoint];
+    [attributes release];
+    [badgeAttrString release];
 }
 
 #pragma mark -
@@ -551,53 +513,53 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
 
 - (void)keyDown:(NSEvent *)theEvent
 {
-       NSIndexSet *selectedIndexes = [self selectedRowIndexes];
-       
-       NSString *keyCharacters = [theEvent characters];
-       
-       //Make sure we have a selection
-       if([selectedIndexes count]>0)
-       {
-               if([keyCharacters length]>0)
-               {
-                       unichar firstKey = [keyCharacters characterAtIndex:0];
-                       
-                       if(firstKey==NSUpArrowFunctionKey||firstKey==NSDownArrowFunctionKey)
-                       {
-                               //Handle keyboard navigation across groups
-                               if([selectedIndexes count]==1&&!([theEvent modifierFlags] & NSShiftKeyMask))
-                               {
-                                       int delta = firstKey==NSDownArrowFunctionKey?1:-1;      //Search "backwards" if up arrow, "forwards" if down
-                                       NSInteger newRow = [selectedIndexes firstIndex];
-                                       
-                                       //Keep incrementing/decrementing the row until a non-header row is reached
-                                       do {
-                                               newRow+=delta;
-                                               
-                                               //If out of bounds of the number of rows..
-                                               if(newRow<0||newRow==[self numberOfRows])
-                                                       break;
-                                       } while([self isGroupItem:[self itemAtRow:newRow]]);
-                                       
-                                       
-                                       [self selectRowIndexes:[NSIndexSet indexSetWithIndex:newRow] byExtendingSelection:NO];
-                                       return;
-                               }
-                       }
-                       else if(firstKey==NSDeleteCharacter||firstKey==NSBackspaceCharacter)
-                       {       
-                               //Post the notification
-                               [[NSNotificationCenter defaultCenter] postNotificationName:PXSLDeleteKeyPressedOnRowsNotification
-                                                                                                                                       object:self
-                                                                                                                                 userInfo:[NSDictionary dictionaryWithObject:selectedIndexes forKey:@"rows"]];
-                               
-                               return;
-                       }
-               }
-       }
-       
-       //We don't care about it
-       [super keyDown:theEvent];
+    NSIndexSet *selectedIndexes = [self selectedRowIndexes];
+    NSString *keyCharacters = [theEvent characters];
+
+    //Make sure we have a selection
+    if([selectedIndexes count]>0)
+    {
+        if([keyCharacters length]>0)
+        {
+            unichar firstKey = [keyCharacters characterAtIndex:0];
+            if(firstKey==NSUpArrowFunctionKey||firstKey==NSDownArrowFunctionKey)
+            {
+                //Handle keyboard navigation across groups
+                if([selectedIndexes count]==1&&!([theEvent modifierFlags] & NSShiftKeyMask))
+                {
+                    int delta = firstKey==NSDownArrowFunctionKey?1:-1;
+                    //Search "backwards" if up arrow, "forwards" if down
+
+                    NSInteger newRow = [selectedIndexes firstIndex];
+                    //Keep incrementing/decrementing the row until a non-header row is reached
+                    do {
+                        newRow+=delta;
+
+                        //If out of bounds of the number of rows..
+                        if(newRow<0||newRow==[self numberOfRows])
+                            break;
+                    } while([self isGroupItem:[self itemAtRow:newRow]]);
+
+                    [self selectRowIndexes:[NSIndexSet indexSetWithIndex:newRow] byExtendingSelection:NO];
+
+                    return;
+                }
+            }
+            else if(firstKey==NSDeleteCharacter||firstKey==NSBackspaceCharacter)
+            {
+                //Post the notification
+                [[NSNotificationCenter defaultCenter] postNotificationName:PXSLDeleteKeyPressedOnRowsNotification object:self  userInfo:[NSDictionary dictionaryWithObject:selectedIndexes forKey:@"rows"]];
+
+                return;
+
+            }
+
+        }
+
+    }
+
+    //We don't care about it
+    [super keyDown:theEvent];
 }
 
 #pragma mark -
@@ -606,124 +568,128 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
 
 - (NSMenu *)menuForEvent:(NSEvent *)theEvent
 {
-       NSMenu * m = nil;
-       if([_secondaryDelegate respondsToSelector:@selector(sourceList:menuForEvent:item:)]) {
-               NSPoint clickPoint = [self convertPoint:[theEvent locationInWindow] fromView:nil];
-               NSInteger row = [self rowAtPoint:clickPoint];
-               id clickedItem = [self itemAtRow:row];
+    NSMenu * m = nil;
+
+    if([_secondaryDelegate respondsToSelector:@selector(sourceList:menuForEvent:item:)]) {
+        NSPoint clickPoint = [self convertPoint:[theEvent locationInWindow] fromView:nil];
+        NSInteger row = [self rowAtPoint:clickPoint];
+        id clickedItem = [self itemAtRow:row];
+
         if ([clickedItem sdtype] > 0)
             m = [_secondaryDelegate sourceList:self menuForEvent:theEvent item:clickedItem];
         else
             m = [super menuForEvent:theEvent];
-       }
-       if (m == nil) {
-               m = [super menuForEvent:theEvent];
-       }
-       return m;
+    }
+
+    if (m == nil) {
+        m = [super menuForEvent:theEvent];
+    }
+
+    return m;
 }
 
 #pragma mark -
 #pragma mark NSOutlineView Data Source methods
 
 - (NSInteger)outlineView:(NSOutlineView *)outlineView numberOfChildrenOfItem:(id)item
-{      
-       if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)]) {
-               return [_secondaryDataSource sourceList:self numberOfChildrenOfItem:item];
-       }
-       
-       return 0;
+{
+    if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)]) {
+        return [_secondaryDataSource sourceList:self numberOfChildrenOfItem:item];
+    }
+
+    return 0;
 }
 
 
 - (id)outlineView:(NSOutlineView *)outlineView child:(NSInteger)index ofItem:(id)item
-{      
-       if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)]) {
-               return [_secondaryDataSource sourceList:self child:index ofItem:item];
-       }
-       
-       return nil;
+{
+    if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)]) {
+        return [_secondaryDataSource sourceList:self child:index ofItem:item];
+    }
+
+    return nil;
 }
 
 
 - (BOOL)outlineView:(NSOutlineView *)outlineView isItemExpandable:(id)item
-{      
-       if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)]) {
-               return [_secondaryDataSource sourceList:self isItemExpandable:item];
-       }
-       
-       return NO;
+{
+    if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)]) {
+        return [_secondaryDataSource sourceList:self isItemExpandable:item];
+    }
+
+    return NO;
 }
 
 
 - (id)outlineView:(NSOutlineView *)outlineView objectValueForTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
 {
-       if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)]) {
-               return [_secondaryDataSource sourceList:self objectValueForItem:item];
-       }
-       
-       return nil;
+    if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)]) {
+        return [_secondaryDataSource sourceList:self objectValueForItem:item];
+    }
+
+    return nil;
 }
 
 
 - (void)outlineView:(NSOutlineView *)outlineView setObjectValue:(id)object forTableColumn:(NSTableColumn *)tableColumn byItem:(id)item
-{      
-       if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)]) {
-               [_secondaryDataSource sourceList:self setObjectValue:object forItem:item];
-       }
+{
+    if([_secondaryDataSource conformsToProtocol:@protocol(PXSourceListDataSource)]) {
+        [_secondaryDataSource sourceList:self setObjectValue:object forItem:item];
+    }
 }
 
 
 - (id)outlineView:(NSOutlineView *)outlineView itemForPersistentObject:(id)object
 {
-       if([_secondaryDataSource respondsToSelector:@selector(sourceList:itemForPersistentObject:)]) {
-               return [_secondaryDataSource sourceList:self itemForPersistentObject:object];
-       }
-       
-       return nil;
+    if([_secondaryDataSource respondsToSelector:@selector(sourceList:itemForPersistentObject:)]) {
+        return [_secondaryDataSource sourceList:self itemForPersistentObject:object];
+    }
+
+    return nil;
 }
 
 - (id)outlineView:(NSOutlineView *)outlineView persistentObjectForItem:(id)item
 {
-       if([_secondaryDataSource respondsToSelector:@selector(sourceList:persistentObjectForItem:)]) {
-               return [_secondaryDataSource sourceList:self persistentObjectForItem:item];
-       }
-       
-       return nil;
+    if([_secondaryDataSource respondsToSelector:@selector(sourceList:persistentObjectForItem:)]) {
+        return [_secondaryDataSource sourceList:self persistentObjectForItem:item];
+    }
+
+    return nil;
 }
 
 - (BOOL)outlineView:(NSOutlineView *)outlineView writeItems:(NSArray *)items toPasteboard:(NSPasteboard *)pasteboard
 {
-       if([_secondaryDataSource respondsToSelector:@selector(sourceList:writeItems:toPasteboard:)]) {
-               return [_secondaryDataSource sourceList:self writeItems:items toPasteboard:pasteboard];
-       }
-       
-       return NO;
+    if([_secondaryDataSource respondsToSelector:@selector(sourceList:writeItems:toPasteboard:)]) {
+        return [_secondaryDataSource sourceList:self writeItems:items toPasteboard:pasteboard];
+    }
+
+    return NO;
 }
 
 - (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id <NSDraggingInfo>)info proposedItem:(id)item proposedChildIndex:(NSInteger)index
 {
-       if([_secondaryDataSource respondsToSelector:@selector(sourceList:validateDrop:proposedItem:proposedChildIndex:)]) {
-               return [_secondaryDataSource sourceList:self validateDrop:info proposedItem:item proposedChildIndex:index];
-       }
-       
-       return NSDragOperationNone;
+    if([_secondaryDataSource respondsToSelector:@selector(sourceList:validateDrop:proposedItem:proposedChildIndex:)]) {
+        return [_secondaryDataSource sourceList:self validateDrop:info proposedItem:item proposedChildIndex:index];
+    }
+
+    return NSDragOperationNone;
 }
 
 - (BOOL)outlineView:(NSOutlineView *)outlineView acceptDrop:(id <NSDraggingInfo>)info item:(id)item childIndex:(NSInteger)index
 {
-       if([_secondaryDataSource respondsToSelector:@selector(sourceList:acceptDrop:item:childIndex:)]) {
-               return [_secondaryDataSource sourceList:self acceptDrop:info item:item childIndex:index];
-       }
-       
-       return NO;
+    if([_secondaryDataSource respondsToSelector:@selector(sourceList:acceptDrop:item:childIndex:)]) {
+        return [_secondaryDataSource sourceList:self acceptDrop:info item:item childIndex:index];
+    }
+
+    return NO;
 }
 - (NSArray *)outlineView:(NSOutlineView *)outlineView namesOfPromisedFilesDroppedAtDestination:(NSURL *)dropDestination forDraggedItems:(NSArray *)items
 {
-       if([_secondaryDataSource respondsToSelector:@selector(sourceList:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:)]) {
-               return [_secondaryDataSource sourceList:self namesOfPromisedFilesDroppedAtDestination:dropDestination forDraggedItems:items];
-       }
-       
-       return nil;
+    if([_secondaryDataSource respondsToSelector:@selector(sourceList:namesOfPromisedFilesDroppedAtDestination:forDraggedItems:)]) {
+        return [_secondaryDataSource sourceList:self namesOfPromisedFilesDroppedAtDestination:dropDestination forDraggedItems:items];
+    }
+
+    return nil;
 }
 
 
@@ -732,119 +698,119 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
 
 - (BOOL)outlineView:(NSOutlineView *)outlineView shouldExpandItem:(id)item
 {
-       if([_secondaryDelegate respondsToSelector:@selector(sourceList:shouldExpandItem:)]) {
-               return [_secondaryDelegate sourceList:self shouldExpandItem:item];
-       }
-       
-       return YES;
+    if([_secondaryDelegate respondsToSelector:@selector(sourceList:shouldExpandItem:)]) {
+        return [_secondaryDelegate sourceList:self shouldExpandItem:item];
+    }
+
+    return YES;
 }
 
 - (BOOL)outlineView:(NSOutlineView *)outlineView shouldCollapseItem:(id)item
 {
-       //Make sure the item isn't displayed as always expanded
-       if([self isGroupItem:item])
-       {
-               if([self isGroupAlwaysExpanded:item]) {
-                       return NO;
-               }
-       }
-       
-       if([_secondaryDelegate respondsToSelector:@selector(sourceList:shouldCollapseItem:)]) {
-               return [_secondaryDelegate sourceList:self shouldCollapseItem:item];
-       }
-       
-       return YES;
+    //Make sure the item isn't displayed as always expanded
+    if([self isGroupItem:item])
+    {
+        if([self isGroupAlwaysExpanded:item]) {
+            return NO;
+        }
+    }
+
+    if([_secondaryDelegate respondsToSelector:@selector(sourceList:shouldCollapseItem:)]) {
+        return [_secondaryDelegate sourceList:self shouldCollapseItem:item];
+    }
+
+    return YES;
 }
 
 - (NSCell *)outlineView:(NSOutlineView *)outlineView dataCellForTableColumn:(NSTableColumn *)tableColumn item:(id)item
 {
-       if([_secondaryDelegate respondsToSelector:@selector(sourceList:dataCellForItem:)]) {
-               return [_secondaryDelegate sourceList:self dataCellForItem:item];
-       }
-       
-       NSInteger row = [self rowForItem:item];
-       
-       //Return the default table column
-       return [[[self tableColumns] objectAtIndex:0] dataCellForRow:row];
+    if([_secondaryDelegate respondsToSelector:@selector(sourceList:dataCellForItem:)]) {
+        return [_secondaryDelegate sourceList:self dataCellForItem:item];
+    }
+
+    NSInteger row = [self rowForItem:item];
+
+    //Return the default table column
+    return [[[self tableColumns] objectAtIndex:0] dataCellForRow:row];
 }
 
 - (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
 {
-       if([_secondaryDelegate respondsToSelector:@selector(sourceList:willDisplayCell:forItem:)]) {
-               [_secondaryDelegate sourceList:self willDisplayCell:cell forItem:item];
-       }
+    if([_secondaryDelegate respondsToSelector:@selector(sourceList:willDisplayCell:forItem:)]) {
+        [_secondaryDelegate sourceList:self willDisplayCell:cell forItem:item];
+    }
 }
 
 - (BOOL)outlineView:(NSOutlineView *)outlineView shouldSelectItem:(id)item
-{      
-       //Make sure that the item isn't a group as they can't be selected
-       if(![self isGroupItem:item]) {          
-               if([_secondaryDelegate respondsToSelector:@selector(sourceList:shouldSelectItem:)]) {
-                       return [_secondaryDelegate sourceList:self shouldSelectItem:item];
-               }
-       }
-       else {
-               return NO;
-       }
-       
-       return YES;
+{
+    //Make sure that the item isn't a group as they can't be selected
+    if(![self isGroupItem:item]) {
+        if([_secondaryDelegate respondsToSelector:@selector(sourceList:shouldSelectItem:)]) {
+            return [_secondaryDelegate sourceList:self shouldSelectItem:item];
+        }
+    }
+    else {
+        return NO;
+    }
+
+    return YES;
 }
 
 
 - (NSIndexSet *)outlineView:(NSOutlineView *)outlineView selectionIndexesForProposedSelection:(NSIndexSet *)proposedSelectionIndexes
-{      
-       //The outline view will try to select the first row if -[allowsEmptySelection:] is set to NO – if this is a group row
-       //stop it from doing so and leave it to our implementation of-[reloadData] which will select the first non-group row
-       //for us.
-       if([self numberOfSelectedRows]==0) {
-               if([self isGroupItem:[self itemAtRow:[proposedSelectionIndexes firstIndex]]]) {
-                       return [NSIndexSet indexSet];
-               }
-       }
-       
-       if([_secondaryDelegate respondsToSelector:@selector(sourceList:selectionIndexesForProposedSelection:)]) {
-               return [_secondaryDelegate sourceList:self selectionIndexesForProposedSelection:proposedSelectionIndexes];
-       }
-       
-       //Since we implement this method, something must be returned to the outline view
-       return proposedSelectionIndexes;
+{
+    //The outline view will try to select the first row if -[allowsEmptySelection:] is set to NO – if this is a group row
+    //stop it from doing so and leave it to our implementation of-[reloadData] which will select the first non-group row
+    //for us.
+    if([self numberOfSelectedRows]==0) {
+        if([self isGroupItem:[self itemAtRow:[proposedSelectionIndexes firstIndex]]]) {
+            return [NSIndexSet indexSet];
+        }
+    }
+
+    if([_secondaryDelegate respondsToSelector:@selector(sourceList:selectionIndexesForProposedSelection:)]) {
+        return [_secondaryDelegate sourceList:self selectionIndexesForProposedSelection:proposedSelectionIndexes];
+    }
+
+    //Since we implement this method, something must be returned to the outline view
+        return proposedSelectionIndexes;
 }
 
 - (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableColumn *)tableColumn item:(id)item
 {
-       //Group titles can't be edited
-       if([self isGroupItem:item])
-               return NO;
-       
-       if([_secondaryDelegate respondsToSelector:@selector(sourceList:shouldEditItem:)]) {
-               return [_secondaryDelegate sourceList:self shouldEditItem:item];
-       }
-       
-       return YES;
+    //Group titles can't be edited
+    if([self isGroupItem:item])
+        return NO;
+
+    if([_secondaryDelegate respondsToSelector:@selector(sourceList:shouldEditItem:)]) {
+        return [_secondaryDelegate sourceList:self shouldEditItem:item];
+    }
+
+    return YES;
 }
 
 
 - (BOOL)outlineView:(NSOutlineView *)outlineView shouldTrackCell:(NSCell *)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item
-{      
-       if([_secondaryDelegate respondsToSelector:@selector(sourceList:shouldTrackCell:forItem:)]) {
-               return [_secondaryDelegate sourceList:self shouldTrackCell:cell forItem:item];
-       }
-       
-       return NO;
+{
+    if([_secondaryDelegate respondsToSelector:@selector(sourceList:shouldTrackCell:forItem:)]) {
+        return [_secondaryDelegate sourceList:self shouldTrackCell:cell forItem:item];
+    }
+
+    return NO;
 }
 
 - (CGFloat)outlineView:(NSOutlineView *)outlineView heightOfRowByItem:(id)item
 {
-       if([_secondaryDelegate respondsToSelector:@selector(sourceList:heightOfRowByItem:)]) {
-               return [_secondaryDelegate sourceList:self heightOfRowByItem:item];
-       }       
-       
-       return [self rowHeight];
+    if([_secondaryDelegate respondsToSelector:@selector(sourceList:heightOfRowByItem:)]) {
+        return [_secondaryDelegate sourceList:self heightOfRowByItem:item];
+    }
+
+    return [self rowHeight];
 }
 
 - (BOOL)outlineView:(NSOutlineView *)outlineView isGroupItem:(id)item
 {
-       return [self isGroupItem:item];
+    return [self isGroupItem:item];
 }
 
 #pragma mark -
@@ -853,54 +819,43 @@ NSString * const PXSLDeleteKeyPressedOnRowsNotification = @"PXSourceListDeleteKe
 /* Notification wrappers */
 - (void)outlineViewSelectionIsChanging:(NSNotification *)notification
 {
-       [[NSNotificationCenter defaultCenter] postNotificationName:PXSLSelectionIsChangingNotification object:self];
+    [[NSNotificationCenter defaultCenter] postNotificationName:PXSLSelectionIsChangingNotification object:self];
 }
 
 
 - (void)outlineViewSelectionDidChange:(NSNotification *)notification
 {
-       [[NSNotificationCenter defaultCenter] postNotificationName:PXSLSelectionDidChangeNotification object:self];     
+    [[NSNotificationCenter defaultCenter] postNotificationName:PXSLSelectionDidChangeNotification object:self];
 }
 
 - (void)outlineViewItemWillExpand:(NSNotification *)notification
 {
-       [[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemWillExpandNotification
-                                                                                                               object:self
-                                                                                                         userInfo:[notification userInfo]];
+    [[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemWillExpandNotification object:self userInfo:[notification userInfo]];
 }
 
 - (void)outlineViewItemDidExpand:(NSNotification *)notification
 {
-       [[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemDidExpandNotification
-                                                                                                               object:self
-                                                                                                         userInfo:[notification userInfo]];    
+    [[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemDidExpandNotification object:self userInfo:[notification userInfo]];
 }
 
 - (void)outlineViewItemWillCollapse:(NSNotification *)notification
 {
-       [[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemWillCollapseNotification
-                                                                                                               object:self
-                                                                                                         userInfo:[notification userInfo]];    
+    [[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemWillCollapseNotification object:self userInfo:[notification userInfo]];
 }
 
 - (void)outlineViewItemDidCollapse:(NSNotification *)notification
 {
-       [[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemDidCollapseNotification
-                                                                                                               object:self
-                                                                                                         userInfo:[notification userInfo]];    
+    [[NSNotificationCenter defaultCenter] postNotificationName:PXSLItemDidCollapseNotification object:self userInfo:[notification userInfo]];
 }
 
 - (void)registerDelegateToReceiveNotification:(NSString*)notification withSelector:(SEL)selector
 {
-       NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
-       
-       //Set the delegate as a receiver of the notification if it implements the notification method
-       if([_secondaryDelegate respondsToSelector:selector]) {
-               [defaultCenter addObserver:_secondaryDelegate
-                                                 selector:selector
-                                                         name:notification
-                                                       object:self];
-       }
+    NSNotificationCenter *defaultCenter = [NSNotificationCenter defaultCenter];
+
+    //Set the delegate as a receiver of the notification if it implements the notification method
+    if([_secondaryDelegate respondsToSelector:selector]) {
+        [defaultCenter addObserver:_secondaryDelegate selector:selector name:notification object:self];
+    }
 }
 
 @end
index 2a16eefefaa131d3b2a70c697f4618369bb3fe8a..da5e59f9ac0f5904f20e9be8126194ca2e499520 100644 (file)
 @implementation SPInvocationGrabber
 - (id)initWithObject:(id)obj;
 {
-       return [self initWithObject:obj stacktraceSaving:YES];
+    return [self initWithObject:obj stacktraceSaving:YES];
 }
 
 -(id)initWithObject:(id)obj stacktraceSaving:(BOOL)saveStack;
 {
-       self.object = obj;
+    self.object = obj;
+    if(saveStack)
+        [self saveBacktrace];
 
-       if(saveStack)
-               [self saveBacktrace];
-
-       return self;
+    return self;
 }
+
 -(void)dealloc;
 {
-       free(frameStrings);
-       self.object = nil;
-       self.invocation = nil;
-       [super dealloc];
+    free(frameStrings);
+    self.object = nil;
+    self.invocation = nil;
+
+    [super dealloc];
 }
 @synthesize invocation = _invocation, object = _object;
 
 @synthesize backgroundAfterForward, onMainAfterForward, waitUntilDone;
 - (void)runInBackground;
 {
-       NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
-       @try {
-               [self invoke];
-       }
-       @finally {
-               [pool drain];
-       }
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+    @try {
+        [self invoke];
+    }
+    @finally {
+        [pool drain];
+    }
 }
 
 
 - (void)forwardInvocation:(NSInvocation *)anInvocation {
-       [anInvocation retainArguments];
-       anInvocation.target = _object;
-       self.invocation = anInvocation;
-       
-       if(backgroundAfterForward)
-               [NSThread detachNewThreadSelector:@selector(runInBackground) toTarget:self withObject:nil];
-       else if(onMainAfterForward)
+    [anInvocation retainArguments];
+    anInvocation.target = _object;
+    self.invocation = anInvocation;
+
+    if(backgroundAfterForward)
+        [NSThread detachNewThreadSelector:@selector(runInBackground) toTarget:self withObject:nil];
+    else if(onMainAfterForward)
         [self performSelectorOnMainThread:@selector(invoke) withObject:nil waitUntilDone:waitUntilDone];
 }
+
 - (NSMethodSignature *)methodSignatureForSelector:(SEL)inSelector {
-       NSMethodSignature *signature = [super methodSignatureForSelector:inSelector];
-       if (signature == NULL)
-               signature = [_object methodSignatureForSelector:inSelector];
-    
-       return signature;
+    NSMethodSignature *signature = [super methodSignatureForSelector:inSelector];
+    if (signature == NULL)
+        signature = [_object methodSignatureForSelector:inSelector];
+
+    return signature;
 }
 
 - (void)invoke;
 {
-
-       @try {
-               [_invocation invoke];
-       }
-       @catch (NSException * e) {
-               NSLog(@"SPInvocationGrabber's target raised %@:\n\t%@\nInvocation was originally scheduled at:", e.name, e);
-               [self printBacktrace];
-               printf("\n");
-               [e raise];
-       }
-
-       self.invocation = nil;
-       self.object = nil;
+    @try {
+        [_invocation invoke];
+    }
+
+    @catch (NSException * e) {
+        NSLog(@"SPInvocationGrabber's target raised %@:\n\t%@\nInvocation was originally scheduled at:", e.name, e);
+        [self printBacktrace];
+        printf("\n");
+        [e raise];
+    }
+
+    self.invocation = nil;
+    self.object = nil;
 }
 
 -(void)saveBacktrace;
 {
-  void *backtraceFrames[128];
-  frameCount = backtrace(&backtraceFrames[0], 128);
-  frameStrings = backtrace_symbols(&backtraceFrames[0], frameCount);
+    void *backtraceFrames[128];
+    frameCount = backtrace(&backtraceFrames[0], 128);
+    frameStrings = backtrace_symbols(&backtraceFrames[0], frameCount);
 }
+
 -(void)printBacktrace;
 {
-       for(int x = 3; x < frameCount; x++) {
-               if(frameStrings[x] == NULL) { break; }
-               printf("%s\n", frameStrings[x]);
-       }
+    for(int x = 3; x < frameCount; x++) {
+        if(frameStrings[x] == NULL) { break; }
+        printf("%s\n", frameStrings[x]);
+    }
 }
 @end
 
 @implementation NSObject (SPInvocationGrabbing)
 -(id)grab;
 {
-       return [[[SPInvocationGrabber alloc] initWithObject:self] autorelease];
+    return [[[SPInvocationGrabber alloc] initWithObject:self] autorelease];
 }
+
 -(id)invokeAfter:(NSTimeInterval)delta;
 {
-       id grabber = [self grab];
-       [NSTimer scheduledTimerWithTimeInterval:delta target:grabber selector:@selector(invoke) userInfo:nil repeats:NO];
-       return grabber;
+    id grabber = [self grab];
+    [NSTimer scheduledTimerWithTimeInterval:delta target:grabber selector:@selector(invoke) userInfo:nil repeats:NO];
+    return grabber;
 }
+
 - (id)nextRunloop;
 {
-       return [self invokeAfter:0];
+    return [self invokeAfter:0];
 }
+
 -(id)inBackground;
 {
     SPInvocationGrabber *grabber = [self grab];
-       grabber.backgroundAfterForward = YES;
-       return grabber;
+    grabber.backgroundAfterForward = YES;
+    return grabber;
 }
+
 -(id)onMainAsync:(BOOL)async;
 {
     SPInvocationGrabber *grabber = [self grab];
-       grabber.onMainAfterForward = YES;
+    grabber.onMainAfterForward = YES;
     grabber.waitUntilDone = !async;
-       return grabber;
+    return grabber;
 }
 
 @end
index af512f68661e9962067edb135940ae18657ee63c..8b748a29ed891bfc5483896a30ce91706f927437 100644 (file)
 #define SPSystemDefinedEventMediaKeys 8
 
 @interface SPMediaKeyTap : NSObject {
-       EventHandlerRef _app_switching_ref;
-       EventHandlerRef _app_terminating_ref;
-       CFMachPortRef _eventPort;
-       CFRunLoopSourceRef _eventPortSource;
-       CFRunLoopRef _tapThreadRL;
-       BOOL _shouldInterceptMediaKeyEvents;
-       id _delegate;
-       // The app that is frontmost in this list owns media keys
-       NSMutableArray *_mediaKeyAppList;
+
+EventHandlerRef _app_switching_ref;
+
+EventHandlerRef _app_terminating_ref;
+
+CFMachPortRef _eventPort;
+
+CFRunLoopSourceRef _eventPortSource;
+
+CFRunLoopRef _tapThreadRL;
+
+BOOL _shouldInterceptMediaKeyEvents;
+
+id _delegate;
+
+// The app that is frontmost in this list owns media keys
+
+NSMutableArray *_mediaKeyAppList;
 }
 + (NSArray*)defaultMediaKeyUserBundleIdentifiers;
 
index 5f6063a70237e2b8ef457fa46f357022e9b76e59..4d3da8cfc0fb793bdcb51ef660758c2b84da2c36 100644 (file)
@@ -34,60 +34,60 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
 #pragma mark Setup and teardown
 -(id)initWithDelegate:(id)delegate;
 {
-       _delegate = delegate;
-       [self startWatchingAppSwitching];
-       singleton = self;
-       _mediaKeyAppList = [NSMutableArray new];
-       return self;
+    _delegate = delegate;
+    [self startWatchingAppSwitching];
+    singleton = self;
+    _mediaKeyAppList = [NSMutableArray new];
+    return self;
 }
 -(void)dealloc;
 {
-       [self stopWatchingMediaKeys];
-       [self stopWatchingAppSwitching];
-       [_mediaKeyAppList release];
-       [super dealloc];
+    [self stopWatchingMediaKeys];
+    [self stopWatchingAppSwitching];
+    [_mediaKeyAppList release];
+    [super dealloc];
 }
 
 -(void)startWatchingAppSwitching;
 {
-       // Listen to "app switched" event, so that we don't intercept media keys if we
-       // weren't the last "media key listening" app to be active
-       EventTypeSpec eventType = { kEventClassApplication, kEventAppFrontSwitched };
+    // Listen to "app switched" event, so that we don't intercept media keys if we
+    // weren't the last "media key listening" app to be active
+    EventTypeSpec eventType = { kEventClassApplication, kEventAppFrontSwitched };
     OSStatus err = InstallApplicationEventHandler(NewEventHandlerUPP(appSwitched), 1, &eventType, self, &_app_switching_ref);
-       assert(err == noErr);
-       
-       eventType.eventKind = kEventAppTerminated;
+    assert(err == noErr);
+
+    eventType.eventKind = kEventAppTerminated;
     err = InstallApplicationEventHandler(NewEventHandlerUPP(appTerminated), 1, &eventType, self, &_app_terminating_ref);
-       assert(err == noErr);
+    assert(err == noErr);
 }
 -(void)stopWatchingAppSwitching;
 {
-       if(!_app_switching_ref) return;
-       RemoveEventHandler(_app_switching_ref);
-       _app_switching_ref = NULL;
+    if(!_app_switching_ref) return;
+    RemoveEventHandler(_app_switching_ref);
+    _app_switching_ref = NULL;
 }
 
 -(void)startWatchingMediaKeys;{
-       [self setShouldInterceptMediaKeyEvents:YES];
-       
-       // Add an event tap to intercept the system defined media key events
-       _eventPort = CGEventTapCreate(kCGSessionEventTap,
-                                                                 kCGHeadInsertEventTap,
-                                                                 kCGEventTapOptionDefault,
-                                                                 CGEventMaskBit(NX_SYSDEFINED),
-                                                                 tapEventCallback,
-                                                                 self);
-       assert(_eventPort != NULL);
-       
+    [self setShouldInterceptMediaKeyEvents:YES];
+
+    // Add an event tap to intercept the system defined media key events
+    _eventPort = CGEventTapCreate(kCGSessionEventTap,
+                                  kCGHeadInsertEventTap,
+                                  kCGEventTapOptionDefault,
+                                  CGEventMaskBit(NX_SYSDEFINED),
+                                  tapEventCallback,
+                                  self);
+    assert(_eventPort != NULL);
+
     _eventPortSource = CFMachPortCreateRunLoopSource(kCFAllocatorSystemDefault, _eventPort, 0);
-       assert(_eventPortSource != NULL);
-       
-       // Let's do this in a separate thread so that a slow app doesn't lag the event tap
-       [NSThread detachNewThreadSelector:@selector(eventTapThread) toTarget:self withObject:nil];
+    assert(_eventPortSource != NULL);
+
+    // Let's do this in a separate thread so that a slow app doesn't lag the event tap
+    [NSThread detachNewThreadSelector:@selector(eventTapThread) toTarget:self withObject:nil];
 }
 -(void)stopWatchingMediaKeys;
 {
-       // TODO<nevyn>: Shut down thread, remove event tap port and source
+    // TODO<nevyn>: Shut down thread, remove event tap port and source
 }
 
 #pragma mark -
@@ -95,60 +95,60 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
 
 +(BOOL)usesGlobalMediaKeyTap
 {
-       return YES;
+    return YES;
 #ifdef _DEBUG
-       return NO;
+    return NO;
 #else
-       // XXX(nevyn): MediaKey event tap doesn't work on 10.4, feel free to figure out why if you have the energy.
-       return floor(NSAppKitVersionNumber) >= 949/*NSAppKitVersionNumber10_5*/;
+    // XXX(nevyn): MediaKey event tap doesn't work on 10.4, feel free to figure out why if you have the energy.
+    return floor(NSAppKitVersionNumber) >= 949/*NSAppKitVersionNumber10_5*/;
 #endif
 }
 
 + (NSArray*)defaultMediaKeyUserBundleIdentifiers;
 {
-       return [NSArray arrayWithObjects:
-               @"com.spotify.client",
-               @"com.apple.iTunes",
-               @"com.apple.QuickTimePlayerX",
-               @"com.apple.quicktimeplayer",
-               @"com.apple.iWork.Keynote",
-               @"com.apple.iPhoto",
-               @"org.videolan.vlc",
-               @"com.apple.Aperture",
-               @"com.plexsquared.Plex",
-               @"com.soundcloud.desktop",
-               @"com.macromedia.fireworks", // the tap messes up their mouse input
-               nil
-       ];
+    return [NSArray arrayWithObjects:
+        @"com.spotify.client",
+        @"com.apple.iTunes",
+        @"com.apple.QuickTimePlayerX",
+        @"com.apple.quicktimeplayer",
+        @"com.apple.iWork.Keynote",
+        @"com.apple.iPhoto",
+        @"org.videolan.vlc",
+        @"com.apple.Aperture",
+        @"com.plexsquared.Plex",
+        @"com.soundcloud.desktop",
+        @"com.macromedia.fireworks", // the tap messes up their mouse input
+        nil
+    ];
 }
 
 
 -(BOOL)shouldInterceptMediaKeyEvents;
 {
-       BOOL shouldIntercept = NO;
-       @synchronized(self) {
-               shouldIntercept = _shouldInterceptMediaKeyEvents;
-       }
-       return shouldIntercept;
+    BOOL shouldIntercept = NO;
+    @synchronized(self) {
+        shouldIntercept = _shouldInterceptMediaKeyEvents;
+    }
+    return shouldIntercept;
 }
 
 -(void)pauseTapOnTapThread:(BOOL)yeahno;
 {
-       CGEventTapEnable(self->_eventPort, yeahno);
+    CGEventTapEnable(self->_eventPort, yeahno);
 }
 -(void)setShouldInterceptMediaKeyEvents:(BOOL)newSetting;
 {
-       BOOL oldSetting;
-       @synchronized(self) {
-               oldSetting = _shouldInterceptMediaKeyEvents;
-               _shouldInterceptMediaKeyEvents = newSetting;
-       }
-       if(_tapThreadRL && oldSetting != newSetting) {
-               id grab = [self grab];
-               [grab pauseTapOnTapThread:newSetting];
-               NSTimer *timer = [NSTimer timerWithTimeInterval:0 invocation:[grab invocation] repeats:NO];
-               CFRunLoopAddTimer(_tapThreadRL, (CFRunLoopTimerRef)timer, kCFRunLoopCommonModes);
-       }
+    BOOL oldSetting;
+    @synchronized(self) {
+        oldSetting = _shouldInterceptMediaKeyEvents;
+        _shouldInterceptMediaKeyEvents = newSetting;
+    }
+    if(_tapThreadRL && oldSetting != newSetting) {
+        id grab = [self grab];
+        [grab pauseTapOnTapThread:newSetting];
+        NSTimer *timer = [NSTimer timerWithTimeInterval:0 invocation:[grab invocation] repeats:NO];
+        CFRunLoopAddTimer(_tapThreadRL, (CFRunLoopTimerRef)timer, kCFRunLoopCommonModes);
+    }
 }
 
 #pragma mark 
@@ -159,64 +159,64 @@ static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEv
 
 static CGEventRef tapEventCallback2(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon)
 {
-       SPMediaKeyTap *self = refcon;
+    SPMediaKeyTap *self = refcon;
 
     if(type == kCGEventTapDisabledByTimeout) {
-               NSLog(@"Media key event tap was disabled by timeout");
-               CGEventTapEnable(self->_eventPort, TRUE);
-               return event;
-       } else if(type == kCGEventTapDisabledByUserInput) {
-               // Was disabled manually by -[pauseTapOnTapThread]
-               return event;
-       }
-       NSEvent *nsEvent = nil;
-       @try {
-               nsEvent = [NSEvent eventWithCGEvent:event];
-       }
-       @catch (NSException * e) {
-               NSLog(@"Strange CGEventType: %d: %@", type, e);
-               assert(0);
-               return event;
-       }
-
-       if (type != NX_SYSDEFINED || [nsEvent subtype] != SPSystemDefinedEventMediaKeys)
-               return event;
-
-       int keyCode = (([nsEvent data1] & 0xFFFF0000) >> 16);
-       if (keyCode != NX_KEYTYPE_PLAY && keyCode != NX_KEYTYPE_FAST && keyCode != NX_KEYTYPE_REWIND)
-               return event;
-
-       if (![self shouldInterceptMediaKeyEvents])
-               return event;
-       
-       [nsEvent retain]; // matched in handleAndReleaseMediaKeyEvent:
-       [self performSelectorOnMainThread:@selector(handleAndReleaseMediaKeyEvent:) withObject:nsEvent waitUntilDone:NO];
-       
-       return NULL;
+        NSLog(@"Media key event tap was disabled by timeout");
+        CGEventTapEnable(self->_eventPort, TRUE);
+        return event;
+    } else if(type == kCGEventTapDisabledByUserInput) {
+        // Was disabled manually by -[pauseTapOnTapThread]
+        return event;
+    }
+    NSEvent *nsEvent = nil;
+    @try {
+        nsEvent = [NSEvent eventWithCGEvent:event];
+    }
+    @catch (NSException * e) {
+        NSLog(@"Strange CGEventType: %d: %@", type, e);
+        assert(0);
+        return event;
+    }
+
+    if (type != NX_SYSDEFINED || [nsEvent subtype] != SPSystemDefinedEventMediaKeys)
+        return event;
+
+    int keyCode = (([nsEvent data1] & 0xFFFF0000) >> 16);
+    if (keyCode != NX_KEYTYPE_PLAY && keyCode != NX_KEYTYPE_FAST && keyCode != NX_KEYTYPE_REWIND)
+        return event;
+
+    if (![self shouldInterceptMediaKeyEvents])
+        return event;
+
+    [nsEvent retain]; // matched in handleAndReleaseMediaKeyEvent:
+    [self performSelectorOnMainThread:@selector(handleAndReleaseMediaKeyEvent:) withObject:nsEvent waitUntilDone:NO];
+
+    return NULL;
 }
 
 static CGEventRef tapEventCallback(CGEventTapProxy proxy, CGEventType type, CGEventRef event, void *refcon)
 {
-       NSAutoreleasePool *pool = [NSAutoreleasePool new];
-       CGEventRef ret = tapEventCallback2(proxy, type, event, refcon);
-       [pool drain];
-       return ret;
+    NSAutoreleasePool *pool = [NSAutoreleasePool new];
+    CGEventRef ret = tapEventCallback2(proxy, type, event, refcon);
+    [pool drain];
+    return ret;
 }
 
 
 // event will have been retained in the other thread
 -(void)handleAndReleaseMediaKeyEvent:(NSEvent *)event {
-       [event autorelease];
-       
-       [_delegate mediaKeyTap:self receivedMediaKeyEvent:event];
+    [event autorelease];
+
+    [_delegate mediaKeyTap:self receivedMediaKeyEvent:event];
 }
 
 
 -(void)eventTapThread;
 {
-       _tapThreadRL = CFRunLoopGetCurrent();
-       CFRunLoopAddSource(_tapThreadRL, _eventPortSource, kCFRunLoopCommonModes);
-       CFRunLoopRun();
+    _tapThreadRL = CFRunLoopGetCurrent();
+    CFRunLoopAddSource(_tapThreadRL, _eventPortSource, kCFRunLoopCommonModes);
+    CFRunLoopRun();
 }
 
 #pragma mark Task switching callbacks
@@ -226,83 +226,83 @@ NSString *kMediaKeyUsingBundleIdentifiersDefaultsKey = @"SPApplicationsNeedingMe
 
 -(void)mediaKeyAppListChanged;
 {
-       if([_mediaKeyAppList count] == 0) return;
-       
-       /*NSLog(@"--");
-       int i = 0;
-       for (NSValue *psnv in _mediaKeyAppList) {
-               ProcessSerialNumber psn; [psnv getValue:&psn];
-               NSDictionary *processInfo = [(id)ProcessInformationCopyDictionary(
-                       &psn,
-                       kProcessDictionaryIncludeAllInformationMask
-               ) autorelease];
-               NSString *bundleIdentifier = [processInfo objectForKey:(id)kCFBundleIdentifierKey];
-               NSLog(@"%d: %@", i++, bundleIdentifier);
-       }*/
-       
+    if([_mediaKeyAppList count] == 0) return;
+
+    /*NSLog(@"--");
+    int i = 0;
+    for (NSValue *psnv in _mediaKeyAppList) {
+        ProcessSerialNumber psn; [psnv getValue:&psn];
+        NSDictionary *processInfo = [(id)ProcessInformationCopyDictionary(
+            &psn,
+            kProcessDictionaryIncludeAllInformationMask
+        ) autorelease];
+        NSString *bundleIdentifier = [processInfo objectForKey:(id)kCFBundleIdentifierKey];
+        NSLog(@"%d: %@", i++, bundleIdentifier);
+    }*/
+
     ProcessSerialNumber mySerial, topSerial;
-       GetCurrentProcess(&mySerial);
-       [[_mediaKeyAppList objectAtIndex:0] getValue:&topSerial];
+    GetCurrentProcess(&mySerial);
+    [[_mediaKeyAppList objectAtIndex:0] getValue:&topSerial];
 
-       Boolean same;
-       OSErr err = SameProcess(&mySerial, &topSerial, &same);
-       [self setShouldInterceptMediaKeyEvents:(err == noErr && same)]; 
+    Boolean same;
+    OSErr err = SameProcess(&mySerial, &topSerial, &same);
+    [self setShouldInterceptMediaKeyEvents:(err == noErr && same)];
 
 }
 -(void)appIsNowFrontmost:(ProcessSerialNumber)psn;
 {
-       NSValue *psnv = [NSValue valueWithBytes:&psn objCType:@encode(ProcessSerialNumber)];
-       
-       NSDictionary *processInfo = [(id)ProcessInformationCopyDictionary(
-               &psn,
-               kProcessDictionaryIncludeAllInformationMask
-       ) autorelease];
-       NSString *bundleIdentifier = [processInfo objectForKey:(id)kCFBundleIdentifierKey];
-
-       NSArray *whitelistIdentifiers = [[NSUserDefaults standardUserDefaults] arrayForKey:kMediaKeyUsingBundleIdentifiersDefaultsKey];
-       if(![whitelistIdentifiers containsObject:bundleIdentifier]) return;
-
-       [_mediaKeyAppList removeObject:psnv];
-       [_mediaKeyAppList insertObject:psnv atIndex:0];
-       [self mediaKeyAppListChanged];
+    NSValue *psnv = [NSValue valueWithBytes:&psn objCType:@encode(ProcessSerialNumber)];
+
+    NSDictionary *processInfo = [(id)ProcessInformationCopyDictionary(
+        &psn,
+        kProcessDictionaryIncludeAllInformationMask
+    ) autorelease];
+    NSString *bundleIdentifier = [processInfo objectForKey:(id)kCFBundleIdentifierKey];
+
+    NSArray *whitelistIdentifiers = [[NSUserDefaults standardUserDefaults] arrayForKey:kMediaKeyUsingBundleIdentifiersDefaultsKey];
+    if(![whitelistIdentifiers containsObject:bundleIdentifier]) return;
+
+    [_mediaKeyAppList removeObject:psnv];
+    [_mediaKeyAppList insertObject:psnv atIndex:0];
+    [self mediaKeyAppListChanged];
 }
 -(void)appTerminated:(ProcessSerialNumber)psn;
 {
-       NSValue *psnv = [NSValue valueWithBytes:&psn objCType:@encode(ProcessSerialNumber)];
-       [_mediaKeyAppList removeObject:psnv];
-       [self mediaKeyAppListChanged];
+    NSValue *psnv = [NSValue valueWithBytes:&psn objCType:@encode(ProcessSerialNumber)];
+    [_mediaKeyAppList removeObject:psnv];
+    [self mediaKeyAppListChanged];
 }
 
 static pascal OSStatus appSwitched (EventHandlerCallRef nextHandler, EventRef evt, void* userData)
 {
-       SPMediaKeyTap *self = (id)userData;
+    SPMediaKeyTap *self = (id)userData;
 
     ProcessSerialNumber newSerial;
     GetFrontProcess(&newSerial);
-       
-       [self appIsNowFrontmost:newSerial];
-               
+
+    [self appIsNowFrontmost:newSerial];
+
     return CallNextEventHandler(nextHandler, evt);
 }
 
 static pascal OSStatus appTerminated (EventHandlerCallRef nextHandler, EventRef evt, void* userData)
 {
-       SPMediaKeyTap *self = (id)userData;
-       
-       ProcessSerialNumber deadPSN;
-
-       GetEventParameter(
-               evt, 
-               kEventParamProcessID, 
-               typeProcessSerialNumber, 
-               NULL, 
-               sizeof(deadPSN), 
-               NULL, 
-               &deadPSN
-       );
-
-       
-       [self appTerminated:deadPSN];
+    SPMediaKeyTap *self = (id)userData;
+
+    ProcessSerialNumber deadPSN;
+
+    GetEventParameter(
+        evt,
+        kEventParamProcessID,
+        typeProcessSerialNumber,
+        NULL,
+        sizeof(deadPSN),
+        NULL,
+        &deadPSN
+    );
+
+
+    [self appTerminated:deadPSN];
     return CallNextEventHandler(nextHandler, evt);
 }
 
index c0df2c9fde9f19626da8fe61df631e27c9f454a0..0739d21b1982b8679bdac1bfa11aafa131fc49f6 100644 (file)
   - SourceListItem *child1;
   - SourceListItem *child2;
      - SourceListItem *childOfChild2;
-        - SourceListItem *anotherChildOfChild2;
+
+ - SourceListItem *anotherChildOfChild2;
   - SourceListItem *child3;
  
  */
 
 @interface SideBarItem : NSObject {
-       NSString *title;
-       NSString *identifier;
+
+NSString *title;
+
+NSString *identifier;
     NSString *untranslatedTitle;
-       NSImage *icon;
-       NSInteger badgeValue;
+
+NSImage *icon;
+
+NSInteger badgeValue;
     NSInteger sdtype;
 
-       NSArray *children;
+
+NSArray *children;
 }
 
 @property (nonatomic, copy) NSString *title;
index 180c2c3384ff1432ba2f98ce0a92228a124db87c..61958922a3a13ee114284b388dd99cfb8ea29d4f 100644 (file)
 
 - (id)init
 {
-       if(self=[super init])
-       {
-               badgeValue = -1;        //We don't want a badge value by default
+    if(self=[super init])
+    {
+        badgeValue = -1; //We don't want a badge value by default
         sdtype = -1; //no sd type set
-       }
+    }
 
-       return self;
+    return self;
 }
 
 
 + (id)itemWithTitle:(NSString*)aTitle identifier:(NSString*)anIdentifier
 {
-       SideBarItem *item = [SideBarItem itemWithTitle:aTitle identifier:anIdentifier icon:nil];
+    SideBarItem *item = [SideBarItem itemWithTitle:aTitle identifier:anIdentifier icon:nil];
 
-       return item;
+    return item;
 }
 
 
 + (id)itemWithTitle:(NSString*)aTitle identifier:(NSString*)anIdentifier icon:(NSImage*)anIcon
 {
-       SideBarItem *item = [[[SideBarItem alloc] init] autorelease];
 
-       [item setTitle:aTitle];
-       [item setIdentifier:anIdentifier];
-       [item setIcon:anIcon];
+    SideBarItem *item = [[[SideBarItem alloc] init] autorelease];
 
-       return item;
+    [item setTitle:aTitle];
+    [item setIdentifier:anIdentifier];
+    [item setIcon:anIcon];
+
+    return item;
 }
 
 - (void)dealloc
 {
-       [title release];
-       [identifier release];
-       [icon release];
-       [children release];
+    [title release];
+    [identifier release];
+    [icon release];
+    [children release];
 
-       [super dealloc];
+    [super dealloc];
 }
 
 - (void)finalize
 {
-       title = nil;
-       identifier = nil;
-       icon = nil;
-       children = nil;
+    title = nil;
+    identifier = nil;
+    icon = nil;
+    children = nil;
 
-       [super finalize];
+    [super finalize];
 }
 
 #pragma mark -
 
 - (BOOL)hasBadge
 {
-       return badgeValue!=-1;
+    return badgeValue!=-1;
 }
 
 - (BOOL)hasChildren
 {
-       return [children count]>0;
+    return [children count]>0;
 }
 
 - (BOOL)hasIcon
 {
-       return icon!=nil;
+    return icon!=nil;
 }
 
 @end
index c5f1060acf980e54dfaad3a8d01d84af9bf2b632..88e613070c8fe1e70df0816c959038511478d258 100644 (file)
@@ -46,7 +46,7 @@ static VLCVideoEffects *_o_sharedInstance = nil;
         p_intf = VLCIntf;
         _o_sharedInstance = [super init];
     }
-    
+
     return _o_sharedInstance;
 }
 
index 731c308c1f5c7c754b1e06a1d0e1e8d51601466d..167ef119745e6ea9192804394d8040620471db8a 100644 (file)
@@ -45,7 +45,7 @@
     NSTimeInterval i_start;
     BOOL b_restart;
     BOOL b_isSetUp;
-    
+
     /* generic help window */
     IBOutlet id o_help_window;
     IBOutlet WebView *o_help_web_view; //we may _not_ use id here because of method name collisions
index 374f3473a1ffc8d7fbd9fae0dd24daf5055b71da..8fee9da561616d97215badf3df8d548d9879cb88 100644 (file)
@@ -105,7 +105,7 @@ static VLAboutBox *_o_sharedInstance = nil;
 
         /* Setup the nameversion field */
         [o_name_version_field setStringValue: [NSString stringWithFormat:@"Version %s (%s)", VERSION_MESSAGE, PLATFORM]];
-        
+
         NSMutableArray *tmpArray = [NSMutableArray arrayWithArray: [[NSString stringWithUTF8String: psz_authors]componentsSeparatedByString:@"\n\n"]];
         NSUInteger count = [tmpArray count];
         for( NSUInteger i = 0; i < count; i++ )
@@ -196,7 +196,7 @@ static VLAboutBox *_o_sharedInstance = nil;
 {
     [o_gpl_window setTitle: _NS("License")];
     [o_gpl_field setString: [NSString stringWithUTF8String: psz_license]];
-    
+
     [o_gpl_window center];
     [o_gpl_window makeKeyAndOrderFront: sender];
 }
@@ -213,7 +213,7 @@ static VLAboutBox *_o_sharedInstance = nil;
     [o_help_home_btn setToolTip: _NS("Index")];
 
     [o_help_window makeKeyAndOrderFront: self];
-    
+
     [[o_help_web_view mainFrame] loadHTMLString: _NS(I_LONGHELP)
                                         baseURL: [NSURL URLWithString:@"http://videolan.org"]];
 }
index 9c672f184d4109dbe409e96f91a7036b2f63c008..be40d24640f65bc4332fd2ae572d2b38597b519c 100644 (file)
  *****************************************************************************/
 @implementation NSApplication(ScriptSupport)
 
-- (BOOL) scriptFullscreenMode {    
+- (BOOL) scriptFullscreenMode {
     vout_thread_t * p_vout = getVout();
     if( !p_vout )
         return NO;
index 48037331ce8351851303352c2531a40d734a413c..bf56c0055d910de567e025df022eea44549b5e8b 100644 (file)
@@ -119,10 +119,10 @@ static VLCBookmarks *_o_sharedInstance = nil;
     seekpoint_t bookmark;
 
     if( !input_Control( p_input, INPUT_GET_BOOKMARK, &bookmark ) )
-       {
-               bookmark.psz_name = _("Untitled");
-               input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
-       }
+    {
+        bookmark.psz_name = _("Untitled");
+        input_Control( p_input, INPUT_ADD_BOOKMARK, &bookmark );
+    }
  
     vlc_object_release( p_input );
  
index fda0b8e51ee30b2f9d8965fa92e1e572b6bbe0d1..4a73039dd7a7ef9ad4f1f8ecf62cd622a490077c 100644 (file)
     IBOutlet id o_cleanup_button;
     IBOutlet id o_error_table;
     IBOutlet id o_messages_btn;
-    
+
     NSMutableArray * o_errors;
     NSMutableArray * o_icons;
-    
+
     BOOL b_nib_loaded;
 }
 - (IBAction)cleanupTable:(id)sender;
index 9a0178a2df3169b3f4aabd4e88db94168a90f3d0..384ea8b63f44a27feaded369227034107baefd2b 100644 (file)
@@ -51,7 +51,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
         o_error_panel = [[VLCErrorPanel alloc] init];
         b_progress_cancelled = NO;
     }
-    
+
     return _o_sharedInstance;
 }
 
@@ -108,7 +108,7 @@ static VLCCoreDialogProvider *_o_sharedInstance = nil;
     NSAlert *o_alert;
     NSString *o_yes, *o_no, *o_cancel;
     NSInteger i_returnValue = 0;
-    
+
     if( p_dialog->yes != NULL )
         o_yes = [NSString stringWithUTF8String: p_dialog->yes];
     if( p_dialog->no != NULL )
index 732d368bd3cd5d0b099232692ee2932e9fe77fbe..23ae06671232b02f12d16c22fffcbb08fe7e8d7a 100644 (file)
@@ -51,7 +51,7 @@ static VLCEyeTVController *_o_sharedInstance = nil;
                          object: @"VLCEyeTVSupport"
              suspensionBehavior: NSNotificationSuspensionBehaviorDeliverImmediately];
     }
-    
+
     return _o_sharedInstance;
 }
 
@@ -142,7 +142,7 @@ static VLCEyeTVController *_o_sharedInstance = nil;
                      "end tell"];
         NSLog( @"telling eyetv to switch 1 channel down" );
     }
-    
+
     descriptor = [script executeAndReturnError:&errorDict];
     if( nil == descriptor ) 
     {
index ce8569596fe0c884384a2199be53b3bfdebbc89a..178a717edcb3146251208b0149bdfe08f53bbadc 100644 (file)
         [self mouseExited:NULL];
 
     [self center];
-    
+
     /* get a notification if VLC isn't the active app anymore */
     [[NSNotificationCenter defaultCenter]
     addObserver: self
        selector: @selector(setNonActive:)
            name: NSApplicationDidResignActiveNotification
          object: NSApp];
-    
+
     /* get a notification if VLC is the active app again */
     [[NSNotificationCenter defaultCenter]
     addObserver: self
     NSRect theScreensFrame;
     NSRect theWindowsFrame;
     NSScreen *screen;
-    
+
     /* user-defined screen */
     screen = [NSScreen screenWithDisplayID: (CGDirectDisplayID)i_device];
-    
+
     if (!screen)
     {
         /* invalid preferences or none specified, using main screen */
 
     theScreensFrame = [screen frame];
     theWindowsFrame = [self frame];
-    
+
     if( theScreensFrame.size.width >= 1920 ) //  17" MBP, 24"/27" iMacs, external displays
         b_usingBigScreen = YES;
 
 {
     b_nonActive = YES;
     [self orderOut: self];
-    
+
     /* here's fadeOut, just without visibly fading */
     b_displayed = NO;
     [self setAlphaValue:0.0];
         return;
 
     [self orderFront: nil];
-    
+
     if( [self alphaValue] < 1.0 || b_displayed != YES )
     {
         if (![self fadeTimer])
 {
     /* this will tell the timer to start over again or to start at all */
     b_keptVisible = YES;
-    
+
     /* get us a valid timer */
     if(! b_alreadyCounting )
     {
     [o_fs_volumeSlider setTarget: self];
     [o_fs_volumeSlider setAction: @selector(fsVolumeSliderUpdate:)];
     [self addSubview: o_fs_volumeSlider];
-    
+
     /* time counter and stream title output fields */
     s_rc = [self frame];
     s_rc.origin.x = 98;
     NSRectClip(NSZeroRect);
     [super drawRect:rect];
     [[NSGraphicsContext currentContext] restoreGraphicsState];
-    
+
     NSRect knobRect = [[self cell] knobRectFlipped:NO];
     knobRect.origin.y+=7.5;
     [[[NSColor blackColor] colorWithAlphaComponent:0.6] set];
     NSRectClip(NSZeroRect);
     [super drawRect:rect];
     [[NSGraphicsContext currentContext] restoreGraphicsState];
-    
+
     NSRect knobRect = [[self cell] knobRectFlipped:NO];
     knobRect.origin.y+=6;
     [[[NSColor blackColor] colorWithAlphaComponent:0.6] set];
index ec30358336d62d41416701bc4503e562fe6adceb..75feab7c3b27aefa3948f26356f9bba95a40a8a0 100644 (file)
@@ -107,7 +107,7 @@ static NSMutableArray *blackoutWindows = NULL;
 
 - (CGDirectDisplayID)displayID
 {
-       return (CGDirectDisplayID)[[[self deviceDescription] objectForKey: @"NSScreenNumber"] intValue];
+    return (CGDirectDisplayID)[[[self deviceDescription] objectForKey: @"NSScreenNumber"] intValue];
 }
 
 - (void)blackoutOtherScreens
index 985143f016a794871b5f0ff1b5b8c65629168d87..e9038c81680fbe69b145641653546d4b70fa127a 100644 (file)
@@ -186,9 +186,11 @@ static VLCOpen *_o_sharedMainInstance = nil;
 
     [o_capture_mode_pop removeAllItems];
     [o_capture_mode_pop addItemWithTitle: _NS("Capture Device")];
-       // our screen capture module isn't Lion-compatible, so let's hide it from the user if needed (trac #4799)
-       if( NSAppKitVersionNumber < 1115.2 )
-               [o_capture_mode_pop addItemWithTitle: _NS("Screen")];
+
+    // our screen capture module isn't Lion-compatible, so let's hide it from the user if needed (trac #4799)
+    if( NSAppKitVersionNumber < 1115.2 )
+        [o_capture_mode_pop addItemWithTitle: _NS("Screen")];
+
     [o_capture_mode_pop addItemWithTitle: @"EyeTV"];
     [o_screen_long_lbl setStringValue: _NS("This input allows you to save, stream or display your current screen contents.")];
     [o_screen_fps_lbl setStringValue: _NS("Frames per Second:")];
@@ -212,8 +214,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
     [self qtkvideoDevices];
     [o_qtk_device_pop removeAllItems];
     msg_Dbg( VLCIntf, "Found %lu capture devices", [qtkvideoDevices count] );
-       if([qtkvideoDevices count] >= 1)
-               {
+    
+    if([qtkvideoDevices count] >= 1)
+    {
         if (!qtk_currdevice_uid) {
             qtk_currdevice_uid = [[[QTCaptureDevice defaultInputDeviceWithMediaType: QTMediaTypeVideo] uniqueID]
                                                                 stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
@@ -228,12 +231,11 @@ static VLCOpen *_o_sharedMainInstance = nil;
             }
         }
     }
-       else
-       {
-               [o_qtk_device_pop addItemWithTitle: _NS("None")];
+    else
+    {
+        [o_qtk_device_pop addItemWithTitle: _NS("None")];
         [qtk_currdevice_uid release];
-       }
-
+    }
 
     [self setSubPanel];
 
@@ -275,8 +277,9 @@ static VLCOpen *_o_sharedMainInstance = nil;
     o_specialMediaFolders = [[NSMutableArray alloc] init];
     o_opticalDevices = [[NSMutableArray alloc] init];
     NSWorkspace *sharedWorkspace = [NSWorkspace sharedWorkspace];
-       [[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidMountNotification object:nil];
-       [[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidUnmountNotification object:nil];
+
+    [[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidMountNotification object:nil];
+    [[sharedWorkspace notificationCenter] addObserver:self selector:@selector(scanOpticalMedia:) name:NSWorkspaceDidUnmountNotification object:nil];
     [self performSelector:@selector(scanOpticalMedia:) withObject:nil afterDelay:2.0];
     [self performSelector:@selector(qtkChanged:) withObject:nil afterDelay:2.5];
 
@@ -454,19 +457,19 @@ static VLCOpen *_o_sharedMainInstance = nil;
 
 - (IBAction)qtkChanged:(id)sender
 {
-       NSInteger i_selectedDevice = [o_qtk_device_pop indexOfSelectedItem];
-       if (i_selectedDevice >= ([qtkvideoDevices count] - 1))
-       {
-               NSValue *sizes = [[[[qtkvideoDevices objectAtIndex:i_selectedDevice] formatDescriptions] objectAtIndex: 0] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute];
-
-               [o_capture_width_fld setIntValue: [sizes sizeValue].width];
-               [o_capture_height_fld setIntValue: [sizes sizeValue].height];
-               [o_capture_width_stp setIntValue: [o_capture_width_fld intValue]];
-               [o_capture_height_stp setIntValue: [o_capture_height_fld intValue]];
-               qtk_currdevice_uid = [[(QTCaptureDevice *)[qtkvideoDevices objectAtIndex:i_selectedDevice] uniqueID]
-                                                         stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
-               [self setMRL:[NSString stringWithFormat:@"qtcapture://%@", qtk_currdevice_uid]];
-       }
+    NSInteger i_selectedDevice = [o_qtk_device_pop indexOfSelectedItem];
+
+    if (i_selectedDevice >= ([qtkvideoDevices count] - 1))
+    {
+        NSValue *sizes = [[[[qtkvideoDevices objectAtIndex:i_selectedDevice] formatDescriptions] objectAtIndex: 0] attributeForKey: QTFormatDescriptionVideoEncodedPixelsSizeAttribute];
+        [o_capture_width_fld setIntValue: [sizes sizeValue].width];
+        [o_capture_height_fld setIntValue: [sizes sizeValue].height];
+        [o_capture_width_stp setIntValue: [o_capture_width_fld intValue]];
+        [o_capture_height_stp setIntValue: [o_capture_height_fld intValue]];
+        qtk_currdevice_uid = [[(QTCaptureDevice *)[qtkvideoDevices objectAtIndex:i_selectedDevice] uniqueID] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
+
+        [self setMRL:[NSString stringWithFormat:@"qtcapture://%@", qtk_currdevice_uid]];
+    }
 }
 
 - (void)tabView:(NSTabView *)o_tv didSelectTabViewItem:(NSTabViewItem *)o_tvi
@@ -749,8 +752,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
     GetVolParmsInfoBuffer volumeParms;
     err = FSGetVolumeParms( actualVolume, &volumeParms, sizeof(volumeParms) );
 
-    CFMutableDictionaryRef     matchingDict;
-    io_service_t                       service;
+    CFMutableDictionaryRef matchingDict;
+    io_service_t service;
 
     matchingDict = IOBSDNameMatching(kIOMasterPortDefault, 0, volumeParms.vMDeviceID);
     service = IOServiceGetMatchingService(kIOMasterPortDefault, matchingDict);
@@ -806,7 +809,8 @@ static VLCOpen *_o_sharedMainInstance = nil;
         return;
 
     unsigned int index = [n_index intValue];
-       id o_currentOpticalDevice = [o_opticalDevices objectAtIndex: index];
+
+id o_currentOpticalDevice = [o_opticalDevices objectAtIndex: index];
     char *diskType = [self getVolumeTypeFromMountPath:o_currentOpticalDevice];
 
     if (diskType == kVLCMediaDVD || diskType == kVLCMediaVideoTSFolder)
@@ -1078,7 +1082,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
         if( [[[o_net_mode selectedCell] title] isEqualToString: _NS("Unicast")] )
         {
             int i_port = [o_net_udp_port intValue];
-            
+
             if( [[o_net_udp_protocol_mat selectedCell] tag] == 0 )
                 o_mrl_string = [NSString stringWithString: @"udp://"];
             else
@@ -1094,7 +1098,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
         {
             NSString *o_addr = [o_net_udpm_addr stringValue];
             int i_port = [o_net_udpm_port intValue];
-            
+
             if( [[o_net_udp_protocol_mat selectedCell] tag] == 0 )
                 o_mrl_string = [NSString stringWithFormat: @"udp://@%@", o_addr];
             else
@@ -1112,7 +1116,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
         [NSApp endSheet: o_net_udp_panel];
     }
 }
-    
+
 - (void)openFile
 {
     NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
@@ -1292,7 +1296,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
         msg_Dbg( VLCIntf, "eyetv was launched, no device yet" );
         setEyeTVUnconnected;
     }
-}    
+}
 
 /* little helper method, since this code needs to be run by multiple objects */
 - (void)setupChannelInfo
@@ -1367,7 +1371,7 @@ static VLCOpen *_o_sharedMainInstance = nil;
     [o_file_sub_sheet orderOut:sender];
     [NSApp endSheet: o_file_sub_sheet];
 }
-    
+
 - (IBAction)subFileBrowse:(id)sender
 {
     NSOpenPanel *o_open_panel = [NSOpenPanel openPanel];
index 4f78e0bd7e850c668b571aad56e9e825c1b12add..bd102e05240dc37627ded1ebc9a0fecb9a58a1cc 100644 (file)
     [o_outline_view setAllowsEmptySelection: NO];
     [o_outline_view expandItem: [o_outline_view itemAtRow:0]];
 
-       [o_outline_view_other setTarget: self];
+    [o_outline_view_other setTarget: self];
     [o_outline_view_other setDelegate: self];
     [o_outline_view_other setDataSource: self];
     [o_outline_view_other setAllowsEmptySelection: NO];
     [[o_tc_author headerCell] setStringValue:_NS("Author")];
     [[o_tc_duration headerCell] setStringValue:_NS("Duration")];
 
-       [[o_tc_name_other headerCell] setStringValue:_NS("Name")];
+    [[o_tc_name_other headerCell] setStringValue:_NS("Name")];
     [[o_tc_author_other headerCell] setStringValue:_NS("Author")];
     [[o_tc_duration_other headerCell] setStringValue:_NS("Duration")];
 }
 
 - (void)swapPlaylists:(id)newList
 {
-       if(newList != o_outline_view)
-       {
-               id o_outline_view_temp = o_outline_view;
-               id o_tc_author_temp = o_tc_author;
-               id o_tc_duration_temp = o_tc_duration;
-               id o_tc_name_temp = o_tc_name;
-               o_outline_view = o_outline_view_other;
-               o_tc_author = o_tc_author_other;
-               o_tc_duration = o_tc_duration_other;
-               o_tc_name = o_tc_name_other;
-               o_outline_view_other = o_outline_view_temp;
-               o_tc_author_other = o_tc_author_temp;
-               o_tc_duration_other = o_tc_duration_temp;
-               o_tc_name_other = o_tc_name_temp;
-       }
+    if(newList != o_outline_view)
+    {
+        id o_outline_view_temp = o_outline_view;
+        id o_tc_author_temp = o_tc_author;
+        id o_tc_duration_temp = o_tc_duration;
+        id o_tc_name_temp = o_tc_name;
+        o_outline_view = o_outline_view_other;
+        o_tc_author = o_tc_author_other;
+        o_tc_duration = o_tc_duration_other;
+        o_tc_name = o_tc_name_other;
+        o_outline_view_other = o_outline_view_temp;
+        o_tc_author_other = o_tc_author_temp;
+        o_tc_duration_other = o_tc_duration_temp;
+        o_tc_name_other = o_tc_name_temp;
+    }
 }
 
 - (NSOutlineView *)outlineView
 
 - (void)swapPlaylists:(id)newList
 {
-       if(newList != o_outline_view)
-       {
-               id o_search_field_temp = o_search_field;
-               o_search_field = o_search_field_other;
-               o_search_field_other = o_search_field_temp;
-               [super swapPlaylists:newList];
-               [self playlistUpdated];
-       }
+    if(newList != o_outline_view)
+    {
+        id o_search_field_temp = o_search_field;
+        o_search_field = o_search_field_other;
+        o_search_field_other = o_search_field_temp;
+        [super swapPlaylists:newList];
+        [self playlistUpdated];
+    }
 }
 
 - (void)playlistUpdated
     }
     if( i_row > -1 )
     {
-               [o_outline_view selectRowIndexes:[NSIndexSet indexSetWithIndex:i_row] byExtendingSelection:NO];
+        [o_outline_view selectRowIndexes:[NSIndexSet indexSetWithIndex:i_row] byExtendingSelection:NO];
         [o_outline_view scrollRowToVisible: i_row];
     }
 }
index 5feba0f06d89124399d167696208592d86bb6cf2..de5f0ff9719ec4704178011f2726cddc7b69181f 100644 (file)
@@ -54,7 +54,7 @@ static VLCInfo *_o_sharedInstance = nil;
     else
     {
         _o_sharedInstance = [super init];
-        
+
         if( _o_sharedInstance != nil )
         {
             p_item = NULL;
@@ -156,7 +156,7 @@ static VLCInfo *_o_sharedInstance = nil;
     [o_input_bitrate_txt setStringValue: [NSString stringWithFormat:@"%6.0f kb/s", (float)0]];
     [o_demux_bytes_txt setStringValue: [NSString stringWithFormat:@"%8.0f KiB", (float)0]];
     [o_demux_bitrate_txt setStringValue: [NSString stringWithFormat:@"%6.0f kb/s", (float)0]];
-    
+
     //Initializing Video Variables
     [o_video_decoded_txt setIntValue:0];
     [o_displayed_txt setIntValue:0];
index dc91a3977e5b16a037128041fab1470122b4731c..6b85d24ad3d4ba68314c1292a69b7845a351620b 100644 (file)
@@ -184,7 +184,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
     [o_prefs_view setHasVerticalScroller: YES];
     [o_prefs_view setDrawsBackground: NO];
     [o_prefs_view setDocumentView: o_empty_view];
-       [o_tree selectRowIndexes: [NSIndexSet indexSetWithIndex: 0] byExtendingSelection: NO];
+    [o_tree selectRowIndexes: [NSIndexSet indexSetWithIndex: 0] byExtendingSelection: NO];
 }
 
 - (void)setTitle: (NSString *) o_title_name
@@ -383,7 +383,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
                     }
                 }
             }
-            
+
             if( module_is_main( p_module) && CONFIG_ITEM(configType) )
             {
                 if( categoryItem && [self isSubCategoryGeneral:lastsubcat] )
@@ -600,7 +600,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
     }
 
     assert(view);
-    
+
     int i_lastItem = 0;
     int i_yPos = -2;
     int i_max_label = 0;
index d5f08fdf7eb2d5f93e2b2f923cdcf0b5dddeb762..8926eed70eb8eea05760822d5631e24fb84ce434 100644 (file)
@@ -1557,7 +1557,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
         int i_index;
         i_view_type = CONFIG_ITEM_STRING_LIST;
 
-        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];        
+        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];    
 
         /* add the label */
         if( p_item->psz_text )
@@ -1866,7 +1866,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
     {
         i_view_type = CONFIG_ITEM_RANGED_INTEGER;
 
-        o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];        
+        o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];    
 
         /* add the label */
         if( p_item->psz_text )
@@ -2110,13 +2110,13 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
     if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
         //TODO....
         return nil;
-    
+
     //Fill our array to know how may items we have...
     module_t *p_parser, **p_list;
     size_t i_module_index;
     NSRect mainFrame = [o_parent_view frame];
     NSString *o_labelString, *o_textfieldString, *o_tooltip;
-    
+
     o_modulearray = [[NSMutableArray alloc] initWithCapacity:10];
     /* build a list of available modules */
     p_list = module_list_get( NULL );
@@ -2124,20 +2124,20 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
     {
         int i;
         p_parser = p_list[i_module_index];
-        
+
         if( module_is_main( p_parser ) )
             continue;
-        
+
         unsigned int confsize;
         module_config_t *p_configlist = module_config_get( p_parser, &confsize );
-        
+
         for ( i = 0; i < confsize; i++ )
         {
             unsigned int unused;
             module_config_t *p_config = &p_configlist[i];
             NSString *o_modulelongname, *o_modulename;
             NSNumber *o_moduleenabled = nil;
-            
+
             /* Hack: required subcategory is stored in i_min */
             if( p_config->i_type == CONFIG_SUBCATEGORY &&
                p_config->value.i == _p_item->min.i )
@@ -2146,13 +2146,13 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
                                     module_get_name( p_parser, TRUE )];
                 o_modulename = [NSString stringWithUTF8String:
                                 module_get_object( p_parser )];
-                
+
                 if( _p_item->value.psz &&
                    strstr( _p_item->value.psz, module_get_object( p_parser ) ) )
                     o_moduleenabled = [NSNumber numberWithBool:YES];
                 else
                     o_moduleenabled = [NSNumber numberWithBool:NO];
-                
+
                 [o_modulearray addObject:[NSMutableArray
                                           arrayWithObjects: o_modulename, o_modulelongname,
                                           o_moduleenabled, nil]];
@@ -2161,7 +2161,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
         module_config_free( p_configlist );
     }
     module_list_free( p_list );
-    
+
     mainFrame.size.height = 30 + 20 * [o_modulearray count];
     mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN;
     mainFrame.origin.x = LEFTMARGIN;
@@ -2169,9 +2169,9 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
     if( [super initWithFrame: mainFrame item: _p_item] != nil )
     {
         i_view_type = CONFIG_ITEM_MODULE_LIST;
-        
+
         o_tooltip = [[VLCMain sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
-        
+
         /* add the label */
         if( p_item->psz_text )
             o_labelString = _NS((char *)p_item->psz_text);
@@ -2180,7 +2180,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
         ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString, o_tooltip )
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
-        
+
         /* build the textfield */
         if( p_item->value.psz )
             o_textfieldString = _NS((char *)p_item->value.psz);
@@ -2191,8 +2191,8 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
                       [o_label frame].size.width - 2, o_tooltip, o_textfieldString )
         [o_textfield setAutoresizingMask:NSViewWidthSizable ];
         [self addSubview: o_textfield];
-        
-        
+
+
         {
             NSRect s_rc = mainFrame;
             s_rc.size.height = mainFrame.size.height - 30;
@@ -2203,7 +2203,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
             [o_scrollview setDrawsBackground: NO];
             [o_scrollview setBorderType: NSBezelBorder];
             [o_scrollview setAutohidesScrollers:YES];
-            
+
             NSTableView *o_tableview;
             o_tableview = [[NSTableView alloc] initWithFrame : s_rc];
             [o_tableview setUsesAlternatingRowBackgroundColors:YES];
@@ -2211,7 +2211,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
             /* TODO: find a good way to fix the row height and text size*/
             /* FIXME: support for multiple selection... */
             //    [o_tableview setAllowsMultipleSelection:YES];
-            
+
             NSCell *o_headerCell = [[NSCell alloc] initTextCell:@"Enabled"];
             NSCell *o_dataCell = [[NSButtonCell alloc] init];
             [(NSButtonCell*)o_dataCell setButtonType:NSSwitchButton];
@@ -2223,7 +2223,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
             [o_tableColumn setDataCell: o_dataCell];
             [o_tableColumn setWidth:17];
             [o_tableview addTableColumn: o_tableColumn];
-            
+
             o_headerCell = [[NSCell alloc] initTextCell:@"Module Name"];
             o_dataCell = [[NSTextFieldCell alloc] init];
             [o_dataCell setFont:[NSFont systemFontOfSize:12]];
@@ -2235,7 +2235,7 @@ o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];       \
             [o_tableview addTableColumn: o_tableColumn];
             [o_tableview registerForDraggedTypes:[NSArray arrayWithObjects:
                                                   @"VLC media player module", nil]];
-            
+
             [o_tableview setDataSource:self];
             [o_tableview setTarget: self];
             [o_tableview setAction: @selector(tableChanged:)];
index 60602e068410ac9adbc80bf9ca53f618ca046545..817801cad078e4ab3dd2b0675b7ca0d3804d5971 100644 (file)
     IBOutlet id o_intf_art_txt;
     IBOutlet id o_intf_embedded_ckb;
     IBOutlet id o_intf_fspanel_ckb;
-       IBOutlet id o_intf_appleremote_ckb;
-       IBOutlet id o_intf_mediakeys_ckb;
+
+IBOutlet id o_intf_appleremote_ckb;
+
+IBOutlet id o_intf_mediakeys_ckb;
     IBOutlet id o_intf_lang_pop;
     IBOutlet id o_intf_lang_txt;
     IBOutlet id o_intf_network_box;
index cd00abaa2d3d5e8f3ebee17791a7a4fbaeb52996..8ae369f84f13eb0d5450469c93da7df1f04ff2cd 100644 (file)
@@ -272,8 +272,10 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
     [o_intf_fspanel_ckb setTitle: _NS("Show Fullscreen Controller")];
     [o_intf_lang_txt setStringValue: _NS("Language")];
     [o_intf_network_box setTitle: _NS("Privacy / Network Interaction")];
-       [o_intf_appleremote_ckb setTitle: _NS("Control playback with the Apple Remote")];
-       [o_intf_mediakeys_ckb setTitle: _NS("Control playback with media keys")];
+
+    [o_intf_appleremote_ckb setTitle: _NS("Control playback with the Apple Remote")];
+
+    [o_intf_mediakeys_ckb setTitle: _NS("Control playback with media keys")];
     [o_intf_update_ckb setTitle: _NS("Automatically check for updates")];
     [o_intf_last_update_lbl setStringValue: @""];
     [o_intf_enableGrowl_ckb setTitle: _NS("Enable Growl notifications (on playlist item change)")];
@@ -464,8 +466,10 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
     [self setupButton: o_intf_fspanel_ckb forBoolValue: "macosx-fspanel"];
     [self setupButton: o_intf_nativefullscreen_ckb forBoolValue: "macosx-nativefullscreenmode"];
     [self setupButton: o_intf_embedded_ckb forBoolValue: "embedded-video"];
-       [self setupButton: o_intf_appleremote_ckb forBoolValue: "macosx-appleremote"];
-       [self setupButton: o_intf_mediakeys_ckb forBoolValue: "macosx-mediakeys"];
+
+[self setupButton: o_intf_appleremote_ckb forBoolValue: "macosx-appleremote"];
+
+[self setupButton: o_intf_mediakeys_ckb forBoolValue: "macosx-mediakeys"];
     if( [[SUUpdater sharedUpdater] lastUpdateCheckDate] != NULL )
         [o_intf_last_update_lbl setStringValue: [NSString stringWithFormat: _NS("Last check on: %@"), [[[SUUpdater sharedUpdater] lastUpdateCheckDate] descriptionWithLocale: [[NSUserDefaults standardUserDefaults] dictionaryRepresentation]]]];
     else
@@ -662,9 +666,9 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
     assert( p_main );
     unsigned confsize;
     module_config_t *p_config;
-    
+
     p_config = module_config_get (p_main, &confsize);
-    
+
     for (size_t i = 0; i < confsize; i++)
     {
         module_config_t *p_item = p_config + i;
@@ -815,7 +819,8 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
 
         config_PutInt( p_intf, "macosx-fspanel", [o_intf_fspanel_ckb state] );
         config_PutInt( p_intf, "embedded-video", [o_intf_embedded_ckb state] );
-               config_PutInt( p_intf, "macosx-appleremote", [o_intf_appleremote_ckb state] );
+
+        config_PutInt( p_intf, "macosx-appleremote", [o_intf_appleremote_ckb state] );
         config_PutInt( p_intf, "macosx-mediakeys", [o_intf_mediakeys_ckb state] );
         config_PutInt( p_intf, "macosx-interfacestyle", [o_intf_style_dark_bcell state] );
         config_PutInt( p_intf, "macosx-nativefullscreenmode", [o_intf_nativefullscreen_ckb state] );
@@ -845,11 +850,11 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
             }
         }
 
-               /* activate stuff without restart */
-               if( [o_intf_appleremote_ckb state] == YES )
-                       [[[VLCMain sharedInstance] appleRemoteController] startListening: [VLCMain sharedInstance]];
-               else
-                       [[[VLCMain sharedInstance] appleRemoteController] stopListening: [VLCMain sharedInstance]];
+        /* activate stuff without restart */
+        if( [o_intf_appleremote_ckb state] == YES )
+            [[[VLCMain sharedInstance] appleRemoteController] startListening: [VLCMain sharedInstance]];
+        else
+            [[[VLCMain sharedInstance] appleRemoteController] stopListening: [VLCMain sharedInstance]];
         b_intfSettingChanged = NO;
     }
 
@@ -1320,7 +1325,6 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
             [o_hotkeys_change_taken_lbl setStringValue: [NSString stringWithFormat:
                                                          _NS("This combination is already taken by \"%@\"."),
                                                          [o_hotkeyDescriptions objectAtIndex: i_returnValue2]]];
-        
         else
             [o_hotkeys_change_taken_lbl setStringValue: @""];
 
@@ -1360,7 +1364,8 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
 {
     NSMutableString *tempString = [[[NSMutableString alloc] init] autorelease];
     NSString *keyString = [o_theEvent characters];
-       unichar key = [keyString characterAtIndex:0];
+
+    unichar key = [keyString characterAtIndex:0];
 
     /* modifiers */
     if( [o_theEvent modifierFlags] & NSControlKeyMask )
index 3658665689a74b52bcab382ba9fef1311798d7e1..0ca241f7e155eadfdca8a280bbd4d61c22838a19 100644 (file)
@@ -71,7 +71,7 @@
     [_okayButton setAction:@selector(buttonAction:)];
     [_okayButton setKeyEquivalent:@"\r"] ; // enter key
     [ourContentView addSubview:_okayButton];
-    
+
     s_rc.origin.x = 94;
     s_rc.origin.y = 170;
     s_rc.size.height = 14;
     [_passwordField setEditable:YES];
     [_passwordField setImportsGraphics:NO];
     [ourContentView addSubview:_passwordField];
-    
+
     s_rc.origin.x = 94;
     s_rc.origin.y = 238;
     s_rc.size.height = 17;
index 6daabe3644284994a24cb16a17d5f9f594914899..96792fa399c3cfa376a8f13c4f7412ed7a43f7a6 100644 (file)
@@ -81,14 +81,14 @@ int OpenVideoGL  ( vlc_object_t * p_this )
         p_vout->pf_unlock = cocoaglvoutviewUnlock;
     }
 #else
-       /* Let's use the VLCOpenGLVoutView.m class */
-       p_vout->pf_init   = cocoaglvoutviewInit;
-       p_vout->pf_end    = cocoaglvoutviewEnd;
-       p_vout->pf_manage = cocoaglvoutviewManage;
-       p_vout->pf_control= cocoaglvoutviewControl;
-       p_vout->pf_swap   = cocoaglvoutviewSwap;
-       p_vout->pf_lock   = cocoaglvoutviewLock;
-       p_vout->pf_unlock = cocoaglvoutviewUnlock;
+    /* Let's use the VLCOpenGLVoutView.m class */
+    p_vout->pf_init   = cocoaglvoutviewInit;
+    p_vout->pf_end    = cocoaglvoutviewEnd;
+    p_vout->pf_manage = cocoaglvoutviewManage;
+    p_vout->pf_control= cocoaglvoutviewControl;
+    p_vout->pf_swap   = cocoaglvoutviewSwap;
+    p_vout->pf_lock   = cocoaglvoutviewLock;
+    p_vout->pf_unlock = cocoaglvoutviewUnlock;
 #endif
     p_vout->p_sys->b_got_frame = false;
 
index 97670d9af912253e27face693a35e08a17bff986..c14017285a473d938be49e9c7b21392b8e180256 100644 (file)
@@ -208,8 +208,8 @@ static int Open(vlc_object_t *this)
     const vlc_fourcc_t *subpicture_chromas;
     video_format_t fmt = vd->fmt;
 
-       sys->vgl = vout_display_opengl_New(&vd->fmt, &subpicture_chromas, &sys->gl);
-       if (!sys->vgl)
+    sys->vgl = vout_display_opengl_New(&vd->fmt, &subpicture_chromas, &sys->gl);
+    if (!sys->vgl)
     {
         sys->gl.sys = NULL;
         goto error;
@@ -301,7 +301,8 @@ static void PictureDisplay(vout_display_t *vd, picture_t *pic, subpicture_t *sub
     [sys->glView setVoutFlushing:NO];
     picture_Release (pic);
     sys->has_first_frame = true;
-       (void)subpicture;
+
+    (void)subpicture;
 }
 
 static int Control (vout_display_t *vd, int query, va_list ap)
@@ -697,8 +698,8 @@ static void OpenglSwap(vlc_gl_t *gl)
     NSWindow *window = [self window];
 
     // Remove flashes with splitter view.
-       if ([window respondsToSelector:@selector(disableScreenUpdatesUntilFlush)])
-               [window disableScreenUpdatesUntilFlush];
+    if ([window respondsToSelector:@selector(disableScreenUpdatesUntilFlush)])
+        [window disableScreenUpdatesUntilFlush];
 
     [super renewGState];
 }