Commit cff6fc15 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: removed tabs and fixed whitespacing errors

parent 58052ea4
......@@ -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:
......
......@@ -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
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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;
......
......@@ -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
......
......@@ -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 );
}
......
......@@ -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++ )
......
......@@ -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] );
......
......@@ -132,7 +132,7 @@
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 )
......@@ -155,7 +155,7 @@
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];
}
}
}
......@@ -262,7 +262,7 @@
- (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 {
......@@ -270,7 +270,7 @@
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];
......@@ -281,7 +281,7 @@
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];
......@@ -375,7 +375,7 @@
}
- (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 {
......@@ -383,7 +383,7 @@
}
- (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 {
......
......@@ -14,23 +14,23 @@
@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
This diff is collapsed.
......@@ -22,117 +22,124 @@
@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;