Changeset 5206
- Timestamp:
- 01/30/08 05:35:03 (5 months ago)
- Files:
-
- Tuna/trunk/English.lproj/MainMenu.nib/classes.nib (modified) (1 diff)
- Tuna/trunk/English.lproj/MainMenu.nib/info.nib (modified) (1 diff)
- Tuna/trunk/English.lproj/MainMenu.nib/keyedobjects.nib (modified) (previous)
- Tuna/trunk/English.lproj/ReleaseNotes.rtf (modified) (4 diffs)
- Tuna/trunk/English.lproj/Session.nib/classes.nib (modified) (1 diff)
- Tuna/trunk/English.lproj/Session.nib/info.nib (modified) (1 diff)
- Tuna/trunk/English.lproj/Session.nib/keyedobjects.nib (modified) (previous)
- Tuna/trunk/Info.plist (modified) (1 diff)
- Tuna/trunk/TNDocument.h (modified) (1 diff)
- Tuna/trunk/TNDocument.m (modified) (2 diffs)
- Tuna/trunk/TNFunction.h (moved) (moved from Tuna/trunk/TNSub.h) (1 diff)
- Tuna/trunk/TNFunction.m (moved) (moved from Tuna/trunk/TNSub.m) (6 diffs)
- Tuna/trunk/TNNode.h (modified) (2 diffs)
- Tuna/trunk/TNNode.m (modified) (29 diffs)
- Tuna/trunk/TNParser.h (modified) (1 diff)
- Tuna/trunk/TNParser.m (modified) (11 diffs)
- Tuna/trunk/TNProfilerController.h (modified) (1 diff)
- Tuna/trunk/TNSessionController.h (modified) (2 diffs)
- Tuna/trunk/TNSessionController.m (modified) (21 diffs)
- Tuna/trunk/TNTree.h (modified) (1 diff)
- Tuna/trunk/TNTree.m (modified) (5 diffs)
- Tuna/trunk/Tuna.xcodeproj/project.pbxproj (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Tuna/trunk/English.lproj/MainMenu.nib/classes.nib
r3931 r5206 1 { 2 IBClasses = ( 3 { 4 ACTIONS = { 5 focusPackage = id; 6 focusSub = id; 7 getInfo = id; 8 removeCallstackWithSub = id; 9 restore = id; 10 restoreAll = id; 11 }; 12 CLASS = FirstResponder; 13 LANGUAGE = ObjC; 14 SUPERCLASS = NSObject; 15 }, 16 { 17 ACTIONS = {manual = id; newDocument = id; }; 18 CLASS = TNMainController; 19 LANGUAGE = ObjC; 20 SUPERCLASS = WIObject; 21 }, 22 { 23 ACTIONS = {orderFrontReleaseNotesWindow = id; }; 24 CLASS = WIApplication; 25 LANGUAGE = ObjC; 26 OUTLETS = {"_releaseNotesTextView" = NSTextView; "_releaseNotesWindow" = NSWindow; }; 27 SUPERCLASS = NSApplication; 28 }, 29 {CLASS = WIObject; LANGUAGE = ObjC; SUPERCLASS = NSObject; } 30 ); 31 IBVersion = 1; 32 } 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 <plist version="1.0"> 4 <dict> 5 <key>IBClasses</key> 6 <array> 7 <dict> 8 <key>ACTIONS</key> 9 <dict> 10 <key>focusLibrary</key> 11 <string>id</string> 12 <key>focusSymbol</key> 13 <string>id</string> 14 <key>getInfo</key> 15 <string>id</string> 16 <key>removeCallstackWithSymbol</key> 17 <string>id</string> 18 <key>restore</key> 19 <string>id</string> 20 <key>restoreAll</key> 21 <string>id</string> 22 </dict> 23 <key>CLASS</key> 24 <string>FirstResponder</string> 25 <key>LANGUAGE</key> 26 <string>ObjC</string> 27 <key>SUPERCLASS</key> 28 <string>NSObject</string> 29 </dict> 30 <dict> 31 <key>ACTIONS</key> 32 <dict> 33 <key>manual</key> 34 <string>id</string> 35 <key>newDocument</key> 36 <string>id</string> 37 </dict> 38 <key>CLASS</key> 39 <string>TNMainController</string> 40 <key>LANGUAGE</key> 41 <string>ObjC</string> 42 <key>SUPERCLASS</key> 43 <string>WIObject</string> 44 </dict> 45 <dict> 46 <key>CLASS</key> 47 <string>WIObject</string> 48 <key>LANGUAGE</key> 49 <string>ObjC</string> 50 <key>SUPERCLASS</key> 51 <string>NSObject</string> 52 </dict> 53 <dict> 54 <key>ACTIONS</key> 55 <dict> 56 <key>orderFrontReleaseNotesWindow</key> 57 <string>id</string> 58 </dict> 59 <key>CLASS</key> 60 <string>WIApplication</string> 61 <key>LANGUAGE</key> 62 <string>ObjC</string> 63 <key>OUTLETS</key> 64 <dict> 65 <key>_releaseNotesTextView</key> 66 <string>NSTextView</string> 67 <key>_releaseNotesWindow</key> 68 <string>NSWindow</string> 69 </dict> 70 <key>SUPERCLASS</key> 71 <string>NSApplication</string> 72 </dict> 73 </array> 74 <key>IBVersion</key> 75 <string>1</string> 76 </dict> 77 </plist> Tuna/trunk/English.lproj/MainMenu.nib/info.nib
r3931 r5206 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 3 <plist version="1.0"> 4 4 <dict> 5 <key>IBDocumentLocation</key>6 <string>578 280 356 240 0 0 1280 1002 </string>7 <key>IBEditorPositions</key>8 <dict>9 <key>29</key>10 <string>721 756 359 44 0 0 1280 1002 </string>11 </dict>12 5 <key>IBFramework Version</key> 13 <string>443.0</string> 6 <string>629</string> 7 <key>IBLastKnownRelativeProjectPath</key> 8 <string>../../Tuna.xcodeproj</string> 9 <key>IBOldestOS</key> 10 <integer>5</integer> 14 11 <key>IBOpenObjects</key> 15 12 <array> 16 <integer>2 9</integer>13 <integer>215</integer> 17 14 </array> 18 15 <key>IBSystem Version</key> 19 <string>8H14</string> 16 <string>9B18</string> 17 <key>targetFramework</key> 18 <string>IBCocoaFramework</string> 20 19 </dict> 21 20 </plist> Tuna/trunk/English.lproj/ReleaseNotes.rtf
r4995 r5206 1 {\rtf1\mac\ansicpg10000\cocoartf824\cocoasubrtf420 2 {\fonttbl\f0\fswiss\fcharset77 Helvetica-Bold;\f1\fswiss\fcharset77 Helvetica;\f2\fnil\fcharset77 Monaco; 3 } 1 {\rtf1\ansi\ansicpg1252\cocoartf949 2 {\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Monaco;} 4 3 {\colortbl;\red255\green255\blue255;\red50\green100\blue255;\red227\green211\blue34;} 5 4 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 6 5 7 6 \f0\b\fs36 \cf2 Tuna 1.0.2 Release Notes 8 \ f1\b0\fs24 \7 \b0\fs24 \ 9 8 \ 10 9 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 11 10 12 \ f0\b\fs28 \cf2 Contact\cf0 \11 \b\fs28 \cf2 Contact\cf0 \ 13 12 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 14 13 15 \ f1\b0\fs24 \cf0 \14 \b0\fs24 \cf0 \ 16 15 Axel Andersson\ 17 16 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural … … 19 18 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 20 19 {\field{\*\fldinst{HYPERLINK "http://www.zankasoftware.com/"}}{\fldrslt \cf0 http://www.zankasoftware.com/}} 21 \ f0\b\fs28 \20 \b\fs28 \ 22 21 \ 23 22 \ 24 23 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 25 24 \cf2 Version History 26 \ f1\b0\fs24 \cf3 \25 \b0\fs24 \cf3 \ 27 26 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 28 27 29 \ f0\b \cf3 \28 \b \cf3 \ 30 29 \cf2 1.0.2 31 \ f1\b0 \cf0 \32 - \30 \b0 \cf0 \ 31 - Stability fixes\ 33 32 34 \ f0\b \cf2 \33 \b \cf2 \ 35 34 1.0.1 36 \ f1\b0 \cf0 \35 \b0 \cf0 \ 37 36 - Performance improvements for opening profiles\ 38 37 - Use proper "\'b5s" time unit\ … … 40 39 \ 41 40 42 \ f0\b \cf2 1.043 \ f1\b0 \cf0 \41 \b \cf2 1.0 42 \b0 \cf0 \ 44 43 - Initial release\ 45 44 \ … … 47 46 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 48 47 49 \ f0\b\fs28 \cf2 License50 \ f1\b0\fs24 \cf0 \48 \b\fs28 \cf2 License 49 \b0\fs24 \cf0 \ 51 50 \ 52 51 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\ql\qnatural 53 52 54 \f 2\fs20 \cf0 Copyright \'a9 2005-2007Axel Andersson\53 \f1\fs20 \cf0 Copyright \'a9 2005-2008 Axel Andersson\ 55 54 All rights reserved.\ 56 55 \ Tuna/trunk/English.lproj/Session.nib/classes.nib
r3409 r5206 1 { 2 IBClasses = ( 3 {CLASS = NSObject; LANGUAGE = ObjC; }, 4 { 5 ACTIONS = {cancelSheet = id; submitSheet = id; }; 6 CLASS = NSWindowController; 7 LANGUAGE = ObjC; 8 SUPERCLASS = NSResponder; 9 }, 10 { 11 ACTIONS = { 12 colorByPackage = id; 13 hideWeight = id; 14 hideWeightPercent = id; 15 statsDisplayMode = id; 16 }; 17 CLASS = TNSessionController; 18 LANGUAGE = ObjC; 19 OUTLETS = { 20 "_dataMiningTextField" = NSTextField; 21 "_frequencyTextField" = NSTextField; 22 "_infoPanel" = NSPanel; 23 "_packageTableColumn" = NSTableColumn; 24 "_selfTableColumn" = NSTableColumn; 25 "_subTableColumn" = NSTableColumn; 26 "_systemTimeTextField" = NSTextField; 27 "_totalTableColumn" = NSTableColumn; 28 "_treeOutlineView" = WIOutlineView; 29 "_userTimeTextField" = NSTextField; 30 "_versionTextField" = NSTextField; 31 "_wallclockTimeTextField" = NSTextField; 32 "_weightTextField" = NSTextField; 33 }; 34 SUPERCLASS = WIWindowController; 35 }, 36 { 37 ACTIONS = {showViewOptions = id; }; 38 CLASS = WIOutlineView; 39 LANGUAGE = ObjC; 40 SUPERCLASS = NSOutlineView; 41 }, 42 { 43 CLASS = WIWindowController; 44 LANGUAGE = ObjC; 45 SUPERCLASS = NSWindowController; 46 } 47 ); 48 IBVersion = 1; 49 } 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 <plist version="1.0"> 4 <dict> 5 <key>IBClasses</key> 6 <array> 7 <dict> 8 <key>ACTIONS</key> 9 <dict> 10 <key>cancelSheet</key> 11 <string>id</string> 12 <key>submitSheet</key> 13 <string>id</string> 14 </dict> 15 <key>CLASS</key> 16 <string>NSWindowController</string> 17 <key>LANGUAGE</key> 18 <string>ObjC</string> 19 <key>SUPERCLASS</key> 20 <string>NSResponder</string> 21 </dict> 22 <dict> 23 <key>CLASS</key> 24 <string>NSObject</string> 25 <key>LANGUAGE</key> 26 <string>ObjC</string> 27 </dict> 28 <dict> 29 <key>ACTIONS</key> 30 <dict> 31 <key>colorByLibrary</key> 32 <string>id</string> 33 <key>colorByPackage</key> 34 <string>id</string> 35 <key>hideWeight</key> 36 <string>id</string> 37 <key>hideWeightPercent</key> 38 <string>id</string> 39 <key>statsDisplayMode</key> 40 <string>id</string> 41 </dict> 42 <key>CLASS</key> 43 <string>TNSessionController</string> 44 <key>LANGUAGE</key> 45 <string>ObjC</string> 46 <key>OUTLETS</key> 47 <dict> 48 <key>_dataMiningTextField</key> 49 <string>NSTextField</string> 50 <key>_libraryTableColumn</key> 51 <string>NSTableColumn</string> 52 <key>_packageTableColumn</key> 53 <string>NSTableColumn</string> 54 <key>_perlFrequencyTextField</key> 55 <string>NSTextField</string> 56 <key>_perlInfoPanel</key> 57 <string>NSPanel</string> 58 <key>_perlSystemTimeTextField</key> 59 <string>NSTextField</string> 60 <key>_perlUserTimeTextField</key> 61 <string>NSTextField</string> 62 <key>_perlVersionTextField</key> 63 <string>NSTextField</string> 64 <key>_perlWallclockTimeTextField</key> 65 <string>NSTextField</string> 66 <key>_selfTableColumn</key> 67 <string>NSTableColumn</string> 68 <key>_subTableColumn</key> 69 <string>NSTableColumn</string> 70 <key>_symbolTableColumn</key> 71 <string>NSTableColumn</string> 72 <key>_totalTableColumn</key> 73 <string>NSTableColumn</string> 74 <key>_treeOutlineView</key> 75 <string>WIOutlineView</string> 76 <key>_weightTextField</key> 77 <string>NSTextField</string> 78 </dict> 79 <key>SUPERCLASS</key> 80 <string>WIWindowController</string> 81 </dict> 82 <dict> 83 <key>CLASS</key> 84 <string>WIWindowController</string> 85 <key>LANGUAGE</key> 86 <string>ObjC</string> 87 <key>SUPERCLASS</key> 88 <string>NSWindowController</string> 89 </dict> 90 <dict> 91 <key>ACTIONS</key> 92 <dict> 93 <key>showViewOptions</key> 94 <string>id</string> 95 </dict> 96 <key>CLASS</key> 97 <string>WIOutlineView</string> 98 <key>LANGUAGE</key> 99 <string>ObjC</string> 100 <key>SUPERCLASS</key> 101 <string>NSOutlineView</string> 102 </dict> 103 </array> 104 <key>IBVersion</key> 105 <string>1</string> 106 </dict> 107 </plist> Tuna/trunk/English.lproj/Session.nib/info.nib
r3409 r5206 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">2 <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 3 <plist version="1.0"> 4 4 <dict> 5 <key>IBDocumentLocation</key>6 <string>541 89 356 240 0 0 1280 1002 </string>7 5 <key>IBFramework Version</key> 8 <string>443.0</string> 6 <string>629</string> 7 <key>IBLastKnownRelativeProjectPath</key> 8 <string>../../Tuna.xcodeproj</string> 9 <key>IBOldestOS</key> 10 <integer>5</integer> 9 11 <key>IBOpenObjects</key> 10 <array> 11 <integer>5</integer> 12 <integer>64</integer> 13 </array> 12 <array/> 14 13 <key>IBSystem Version</key> 15 <string>8F46</string> 14 <string>9B18</string> 15 <key>targetFramework</key> 16 <string>IBCocoaFramework</string> 16 17 </dict> 17 18 </plist> Tuna/trunk/Info.plist
r3931 r5206 11 11 <array> 12 12 <string>out</string> 13 <string>txt</string> 13 14 </array> 14 15 <key>CFBundleTypeIconFile</key> Tuna/trunk/TNDocument.h
r4995 r5206 31 31 @interface TNDocument : NSDocument { 32 32 NSString *_string; 33 TNTree *_tree; 34 35 unsigned int _session; 33 id _tree; 34 NSUInteger _session; 36 35 } 37 36 Tuna/trunk/TNDocument.m
r4995 r5206 30 30 #import "TNParser.h" 31 31 #import "TNSessionController.h" 32 #import "TNTree.h"33 32 34 33 @implementation TNDocument 35 34 36 + ( unsigned int)session {37 static unsigned intsession;35 + (NSUInteger)session { 36 static NSUInteger session; 38 37 39 38 return ++session; … … 86 85 return NO; 87 86 88 if( ![_string hasPrefix:@"#fOrTyTwO"])89 return NO;90 91 _tree = [TNParser parseWithString:_string];87 if([_string hasPrefix:@"#fOrTyTwO"]) 88 _tree = [[TNPerlParser parseString:_string] retain]; 89 else if([_string hasPrefix:@"Start time: "] || [_string hasPrefix:@"200"]) 90 _tree = [[TNObjCParser parseString:_string] retain]; 92 91 93 92 if(_tree) Tuna/trunk/TNFunction.h
r4995 r5206 27 27 */ 28 28 29 @interface TN Sub: WIObject <NSCopying> {29 @interface TNFunction : WIObject <NSCopying> { 30 30 @public 31 NSString *_ package;32 NSString *_ name;31 NSString *_library; 32 NSString *_symbol; 33 33 NSColor *_color; 34 34 } 35 35 36 - (id)initWithLibrary:(NSString *)library symbol:(NSString *)symbol color:(NSColor *)color; 36 37 37 - ( id)initWithPackage:(NSString *)package name:(NSString *)name color:(NSColor *)color;38 - (BOOL)isEqualToFunction:(TNFunction *)function; 38 39 39 - (BOOL)isEqualToSub:(TNSub *)sub; 40 41 - (NSString *)package; 42 - (NSString *)name; 40 - (NSString *)library; 41 - (NSString *)symbol; 43 42 - (NSColor *)color; 44 43 45 44 @end 45 46 47 @interface TNObjCFunction : TNFunction 48 49 @end Tuna/trunk/TNFunction.m
r4995 r5206 27 27 */ 28 28 29 #import "TN Sub.h"29 #import "TNFunction.h" 30 30 31 @implementation TN Sub31 @implementation TNFunction 32 32 33 - (id)initWith Package:(NSString *)package name:(NSString *)namecolor:(NSColor *)color {33 - (id)initWithLibrary:(NSString *)library symbol:(NSString *)symbol color:(NSColor *)color { 34 34 self = [super init]; 35 35 36 _ package = [packageretain];37 _ name = [nameretain];36 _library = [library retain]; 37 _symbol = [symbol retain]; 38 38 _color = [color retain]; 39 39 … … 44 44 45 45 - (void)dealloc { 46 [_ packagerelease];47 [_ namerelease];46 [_library release]; 47 [_symbol release]; 48 48 [_color release]; 49 49 … … 63 63 #pragma mark - 64 64 65 - (BOOL)isEqualToSub:(TNSub *)sub { 66 return (self == sub); 65 - (BOOL)isEqualToFunction:(TNFunction *)function { 66 return ([_library isEqualToString:function->_library] && 67 [_symbol isEqualToString:function->_symbol]); 67 68 } 68 69 … … 70 71 71 72 - (NSString *)description { 72 return [NSSWF:@"%@ ::%@", _package, _name];73 return [NSSWF:@"%@ %@", _library, _symbol]; 73 74 } 74 75 … … 77 78 #pragma mark - 78 79 79 - (NSString *) package{80 return _ package;80 - (NSString *)library { 81 return _library; 81 82 } 82 83 83 84 84 85 85 - (NSString *) name{86 return _ name;86 - (NSString *)symbol { 87 return _symbol; 87 88 } 88 89 … … 94 95 95 96 @end 97 98 99 100 @implementation TNObjCFunction 101 102 - (id)initWithLibrary:(NSString *)library symbol:(NSString *)symbol color:(NSColor *)color { 103 NSString *image, *class, *category, *selector, *method; 104 NSRange range, searchRange; 105 NSUInteger searchLength; 106 BOOL isInstance, isClass; 107 108 // --- scan library image 109 image = [library lastPathComponent]; 110 range = [image rangeOfString:@" (base="]; 111 112 if(range.location != NSNotFound) 113 image = [image substringToIndex:range.location]; 114 115 range = [image rangeOfString:@"\\" options:NSBackwardsSearch]; 116 117 if(range.location != NSNotFound) 118 image = [image substringFromIndex:range.location + 1]; 119 120 range = [image rangeOfString:@":" options:NSBackwardsSearch]; 121 122 if(range.location != NSNotFound) 123 image = [image substringToIndex:range.location]; 124 125 // --- scan Objective-C signature of function 126 method = symbol; 127 isInstance = [symbol hasPrefix:@"_i_"]; 128 isClass = [symbol hasPrefix:@"_c_"]; 129 130 if(isInstance || isClass) { 131 searchRange.location = 3; 132 searchRange.length = [symbol length] - searchRange.location; 133 134 class = category = selector = NULL; 135 136 range = [symbol rangeOfString:@"_" options:0 range:searchRange]; 137 138 if(range.location != NSNotFound) { 139 searchLength = range.location - searchRange.location; 140 141 class = [symbol substringWithRange:NSMakeRange(searchRange.location, searchLength)]; 142 143 searchRange.location += searchLength + range.length; 144 searchRange.length -= searchLength + range.length; 145 } 146 147 range = [symbol rangeOfString:@"_" options:0 range:searchRange]; 148 149 if(range.location != NSNotFound) { 150 searchLength = range.location - searchRange.location; 151 152 if(searchLength) 153 category = [symbol substringWithRange:NSMakeRange(searchRange.location, searchLength)]; 154 155 searchRange.location += searchLength + range.length; 156 searchRange.length -= searchLength + range.length; 157 } 158 159 selector = [[symbol substringFromIndex:searchRange.location] 160 stringByReplacingOccurencesOfString:@"_" withString:@":"]; 161 162 if(class && selector) { 163 category = category ? [NSSWF:@"(%@)", category] : @""; 164 method = [NSSWF:@"%@[%@%@ %@]", isInstance ? @"-" : @"+", class, category, selector]; 165 } 166 } 167 168 return [super initWithLibrary:image symbol:method color:color]; 169 } 170 171 @end Tuna/trunk/TNNode.h
r4995 r5206 27 27 */ 28 28 29 @class TN Sub;29 @class TNFunction; 30 30 31 31 @interface TNNode : WIObject <NSCopying> { 32 32 @public 33 33 NSMutableArray *_children; 34 TNNode *_parent;34 id _parent; 35 35 36 TN Sub *_sub;36 TNFunction *_function; 37 37 38 38 BOOL _leaf; 39 39 40 unsigned int _calls; 41 double _time, _cumulativeTime; 40 NSUInteger _calls; 42 41 double _percent, _cumulativePercent; 43 42 } 44 43 45 46 - (id)initWithParent:(TNNode *)node sub:(TNSub *)sub; 44 - (id)initWithParent:(TNNode *)node function:(TNFunction *)function; 47 45 48 46 - (BOOL)isEqualToNode:(TNNode *)node; 49 47 48 - (NSComparisonResult)compareValue:(TNNode *)node; 49 - (NSComparisonResult)compareCumulativeValue:(TNNode *)node; 50 - (NSComparisonResult)comparePercent:(TNNode *)node; 51 - (NSComparisonResult)compareCumulativePercent:(TNNode *)node; 52 - (NSComparisonResult)compareLibrary:(TNNode *)node; 53 - (NSComparisonResult)compareSymbol:(TNNode *)node; 54 50 55 - (void)addChild:(TNNode *)node; 51 - ( unsigned int)children;52 - (TNNode *)childAtIndex:( unsigned int)index;56 - (NSUInteger)children; 57 - (TNNode *)childAtIndex:(NSUInteger)index; 53 58 - (TNNode *)lastChild; 54 - (TNNode *)childWithSub:(TNSub *)sub; 59 - (id)childWithFunction:(TNFunction *)function; 60 - (id)childWithFunctionIdenticalTo:(TNFunction *)function; 55 61 - (TNNode *)parent; 56 62 - (BOOL)isLeaf; … … 60 66 - (void)sortUsingSelector:(SEL)selector; 61 67 62 - (NSArray *)nodesMatching Package:(NSString *)package;68 - (NSArray *)nodesMatchingLibrary:(NSString *)library; 63 69 - (void)discardNodesWithCumulativePercentLessThan:(double)percent; 64 70 65 - (void)addTime:(double)time;66 71 - (void)refreshPercent; 67 72 68 - (TN Sub *)sub;73 - (TNFunction *)function; 69 74 - (NSColor *)color; 70 - (unsigned int)calls; 71 - (double)time; 72 - (double)cumulativeTime; 75 - (NSUInteger)calls; 73 76 - (double)percent; 74 77 - (double)cumulativePercent; 75 78 76 79 @end 80 81 82 @interface TNPerlNode : TNNode { 83 @public 84 NSTimeInterval _time, _cumulativeTime; 85 } 86 87 - (void)addTime:(double)time; 88 89 - (NSTimeInterval)time; 90 - (NSTimeInterval)cumulativeTime; 91 92 @end 93 94 95 @interface TNObjCNode : TNNode { 96 @public 97 NSUInteger _totalCalls; 98 } 99 100 @end Tuna/trunk/TNNode.m
r4995 r5206 27 27 */ 28 28 29 #import "TNFunction.h" 29 30 #import "TNNode.h" 30 #import "TNSub.h"31 31 32 32 @interface TNNode(Private) … … 34 34 - (void)joinWithNode:(TNNode *)node; 35 35 36 - (void)addNodesMatchingPackage:(NSString *)package toArray:(NSMutableArray *)array; 37 38 - (void)refreshPercentForTotalTime:(double)time; 36 - (void)addNodesMatchingLibrary:(NSString *)library toArray:(NSMutableArray *)array; 39 37 40 38 @end … … 43 41 @implementation TNNode 44 42 45 - (id)initWithParent:(TNNode *)parent sub:(TNSub *)sub{43 - (id)initWithParent:(TNNode *)parent function:(TNFunction *)function { 46 44 self = [super init]; 47 45 48 46 _parent = parent; 49 _ sub = [subretain];47 _function = [function retain]; 50 48 _leaf = YES; 51 49 _calls = 1; … … 57 55 58 56 - (void)dealloc { 59 [_ subrelease];57 [_function release]; 60 58 [_children release]; 61 59 … … 69 67 - (id)copyWithZone:(NSZone *)zone { 70 68 TNNode *node; 71 unsigned inti, count;72 73 node = [[ TNNodeallocWithZone:zone] init];69 NSUInteger i, count; 70 71 node = [[[self class] allocWithZone:zone] init]; 74 72 node->_children = [_children deepMutableCopyWithZone:zone]; 75 73 node->_parent = _parent; … … 80 78 ((TNNode *) [node->_children objectAtIndex:i])->_parent = node; 81 79 82 node->_ sub = [_subcopyWithZone:zone];80 node->_function = [_function copyWithZone:zone]; 83 81 84 82 node->_leaf = _leaf; 85 83 86 84 node->_calls = _calls; 87 node->_time = _time;88 node->_cumulativeTime = _cumulativeTime;89 85 node->_percent = _percent; 90 86 node->_cumulativePercent = _cumulativePercent; … … 98 94 99 95 - (BOOL)isEqualToNode:(TNNode *)node { 100 return [_sub isEqualToSub:node->_sub];96 return (_function == node->_function); 101 97 } 102 98 … … 104 100 105 101 - (NSString *)description { 106 return [NSSWF:@"%.1f%% %.1f%% %@", _percent, _cumulativePercent, _sub]; 107 } 108 109 110 111 - (NSComparisonResult)compareTime:(TNNode *)node { 112 if(_time < node->_time) 113 return NSOrderedAscending; 114 else if(_time > node->_time) 115 return NSOrderedDescending; 116 117 return NSOrderedSame; 118 } 119 120 121 122 - (NSComparisonResult)compareCumulativeTime:(TNNode *)node { 123 if(_cumulativeTime < node->_cumulativeTime) 124 return NSOrderedAscending; 125 else if(_cumulativeTime > node->_cumulativeTime) 126 return NSOrderedDescending; 127 102 return [NSSWF:@"%.1f%% %.1f%% %@", _percent, _cumulativePercent, _function]; 103 } 104 105 106 107 - (NSComparisonResult)compareValue:(TNNode *)node { 108 return NSOrderedSame; 109 } 110 111 112 113 - (NSComparisonResult)compareCumulativeValue:(TNNode *)node { 128 114 return NSOrderedSame; 129 115 } … … 153 139 154 140 155 - (NSComparisonResult)compare Package:(TNNode *)node {156 return [_ sub->_package compare:node->_sub->_packageoptions:NSCaseInsensitiveSearch];157 } 158 159 160 161 - (NSComparisonResult)compareS ub:(TNNode *)node {162 return [_ sub->_name compare:node->_sub->_nameoptions:NSCaseInsensitiveSearch];141 - (NSComparisonResult)compareLibrary:(TNNode *)node {
