Changeset 5220

Show
Ignore:
Timestamp:
02/06/08 07:47:22 (5 months ago)
Author:
morris
Message:

Separate generic data model to TunaKit?.framework, and support plugins using this framework

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • Tuna/trunk/TNDocument.m

    r5218 r5220  
    2828 
    2929#import "TNDocument.h" 
     30#import "TNMainController.h" 
    3031#import "TNParser.h" 
    3132#import "TNSessionController.h" 
     
    8081 
    8182- (BOOL)loadDataRepresentation:(NSData *)data ofType:(NSString *)type { 
     83        NSEnumerator    *enumerator; 
     84        TNParser                *parser = NULL; 
     85        Class                   class; 
     86         
    8287        _string = [[NSString alloc] initWithData:data encoding:NSISOLatin1StringEncoding]; 
    8388         
     
    8590                return NO; 
    8691         
    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        enumerator = [[[TNMainController mainController] parserClasses] objectEnumerator]; 
     93         
     94        while((class = [enumerator nextObject])) { 
     95                if([class handlesString:_string]) { 
     96                        parser = [[[class alloc] initWithString:_string] autorelease]; 
     97                         
     98                        break; 
     99                } 
     100        } 
     101         
     102        _tree = [[parser parsedTree] retain]; 
    91103         
    92104        if(_tree) 
  • Tuna/trunk/TNMainController.h

    r5218 r5220  
    3030        IBOutlet NSPanel                                *_findPanel; 
    3131        IBOutlet NSTextField                    *_findTextField; 
     32         
     33        NSMutableArray                                  *_parserClasses; 
    3234} 
     35 
     36+ (TNMainController *)mainController; 
     37 
     38- (NSArray *)parserClasses; 
    3339 
    3440- (IBAction)newDocument:(id)sender; 
  • Tuna/trunk/TNMainController.m

    r5218 r5220  
    2828 
    2929#import "TNMainController.h" 
     30#import "TNPerlParser.h" 
    3031#import "TNProfilerController.h" 
    3132#import "TNSessionController.h" 
    3233 
     34static TNMainController                         *TNSharedMainController; 
     35 
    3336@implementation TNMainController 
     37 
     38+ (TNMainController *)mainController { 
     39        return TNSharedMainController; 
     40} 
     41 
     42 
     43 
     44- (void)awakeFromNib { 
     45        NSEnumerator    *enumerator; 
     46        NSBundle                *bundle; 
     47        NSString                *path, *name; 
     48        Class                   class; 
     49         
     50        TNSharedMainController = self; 
     51         
     52        _parserClasses = [[NSMutableArray alloc] init]; 
     53        [_parserClasses addObject:[TNPerlParser class]]; 
     54         
     55        path = [[NSBundle mainBundle] builtInPlugInsPath]; 
     56        enumerator = [[[NSFileManager defaultManager] directoryContentsAtPath:path] objectEnumerator]; 
     57         
     58        while((name = [enumerator nextObject])) { 
     59                if([[name pathExtension] isEqualToString:@"tunaPlugin"]) { 
     60                        bundle = [NSBundle bundleWithPath:[path stringByAppendingPathComponent:name]]; 
     61                         
     62                        if([bundle load]) { 
     63                                class = NSClassFromString([[bundle infoDictionary] objectForKey:@"TNParserClass"]); 
     64                                 
     65                                if(class) 
     66                                        [_parserClasses addObject:class]; 
     67                        } 
     68                } 
     69        } 
     70} 
     71 
     72 
    3473 
    3574- (BOOL)validateMenuItem:(NSMenuItem *)item { 
     
    4281         
    4382        return YES; 
     83} 
     84 
     85 
     86 
     87#pragma mark - 
     88 
     89- (NSArray *)parserClasses { 
     90        return _parserClasses; 
    4491} 
    4592 
  • Tuna/trunk/TNSessionController.m

    r5218 r5220  
    2727 */ 
    2828 
    29 #import "TNFunction.h" 
    30 #import "TNNode.h" 
     29#import "TNPerlNode.h" 
     30#import "TNPerlTree.h" 
    3131#import "TNSessionController.h" 
    32 #import "TNTree.h" 
    3332 
    3433@interface TNSessionController(Private) 
  • Tuna/trunk/Tuna.xcodeproj/project.pbxproj

    r5207 r5220  
    2020                        productName = Distribution; 
    2121                }; 
    22                 A54D70DD08636C7700441C97 /* Wired Additions */ = { 
     22                A54D70DD08636C7700441C97 /* WiredAdditions */ = { 
    2323                        isa = PBXAggregateTarget; 
    24                         buildConfigurationList = A54D711E08636C9700441C97 /* Build configuration list for PBXAggregateTarget "Wired Additions" */; 
     24                        buildConfigurationList = A54D711E08636C9700441C97 /* Build configuration list for PBXAggregateTarget "WiredAdditions" */; 
    2525                        buildPhases = ( 
    2626                                A54D70DC08636C7700441C97 /* Run Script (Wired Additions) */, 
     
    2828                        dependencies = ( 
    2929                        ); 
    30                         name = "Wired Additions"
     30                        name = WiredAdditions
    3131                        productName = "Wired Additions"; 
    3232                }; 
     
    5959                A57F87420833F60500DEFE69 /* TNProfilerController.m in Sources */ = {isa = PBXBuildFile; fileRef = A57F87400833F60500DEFE69 /* TNProfilerController.m */; }; 
    6060                A57F87780833F75A00DEFE69 /* Profiler.nib in Resources */ = {isa = PBXBuildFile; fileRef = A57F87760833F75A00DEFE69 /* Profiler.nib */; }; 
    61                 A57F87E00833FE4C00DEFE69 /* TNParser.m in Sources */ = {isa = PBXBuildFile; fileRef = A57F87DE0833FE4C00DEFE69 /* TNParser.m */; }; 
    62                 A57F893008353E1E00DEFE69 /* TNTree.m in Sources */ = {isa = PBXBuildFile; fileRef = A57F892E08353E1E00DEFE69 /* TNTree.m */; }; 
    6361                A57F8977083541AC00DEFE69 /* TNSettings.m in Sources */ = {isa = PBXBuildFile; fileRef = A57F8975083541AC00DEFE69 /* TNSettings.m */; }; 
    6462                A59346A80CCEC021009A8245 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = A59346A60CCEC021009A8245 /* Credits.rtf */; }; 
     
    6664                A5941CDA0832A4DB0006A7D7 /* Session.nib in Resources */ = {isa = PBXBuildFile; fileRef = A5941CD80832A4DB0006A7D7 /* Session.nib */; }; 
    6765                A5941D2A0832A7E20006A7D7 /* TNSessionController.m in Sources */ = {isa = PBXBuildFile; fileRef = A5941D290832A7E20006A7D7 /* TNSessionController.m */; }; 
    68                 A5941DF00832B3510006A7D7 /* TNFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = A5941DEF0832B3510006A7D7 /* TNFunction.m */; }; 
    69                 A5941E0E0832B4E30006A7D7 /* TNNode.m in Sources */ = {isa = PBXBuildFile; fileRef = A5941E0D0832B4E30006A7D7 /* TNNode.m */; }; 
     66                A5EAE7DF0D596BFD0007C0A1 /* TNNode.m in Sources */ = {isa = PBXBuildFile; fileRef = A5941E0D0832B4E30006A7D7 /* TNNode.m */; }; 
     67                A5EAE7E00D596BFD0007C0A1 /* TNParser.m in Sources */ = {isa = PBXBuildFile; fileRef = A57F87DE0833FE4C00DEFE69 /* TNParser.m */; }; 
     68                A5EAE7E10D596BFD0007C0A1 /* TNFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = A5941DEF0832B3510006A7D7 /* TNFunction.m */; }; 
     69                A5EAE7E20D596BFD0007C0A1 /* TNTree.m in Sources */ = {isa = PBXBuildFile; fileRef = A57F892E08353E1E00DEFE69 /* TNTree.m */; }; 
     70                A5EAE7E30D596C050007C0A1 /* TNNode.h in Headers */ = {isa = PBXBuildFile; fileRef = A5941E0C0832B4E30006A7D7 /* TNNode.h */; settings = {ATTRIBUTES = (Public, ); }; }; 
     71                A5EAE7E40D596C050007C0A1 /* TNParser.h in Headers */ = {isa = PBXBuildFile; fileRef = A57F87DD0833FE4C00DEFE69 /* TNParser.h */; settings = {ATTRIBUTES = (Public, ); }; }; 
     72                A5EAE7E50D596C050007C0A1 /* TNFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = A5941DEE0832B3500006A7D7 /* TNFunction.h */; settings = {ATTRIBUTES = (Public, ); }; }; 
     73                A5EAE7E60D596C050007C0A1 /* TNTree.h in Headers */ = {isa = PBXBuildFile; fileRef = A57F892D08353E1E00DEFE69 /* TNTree.h */; settings = {ATTRIBUTES = (Public, ); }; }; 
     74                A5EAE7E90D596C360007C0A1 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1058C7A1FEA54F0111CA2CBB /* Cocoa.framework */; }; 
     75                A5EAE8610D596D730007C0A1 /* WiredAdditions.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5643B9F0A26040900ADF4F5 /* WiredAdditions.framework */; }; 
     76                A5EAE8B10D596E910007C0A1 /* TunaKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A5EAE6BF0D5969F60007C0A1 /* TunaKit.framework */; }; 
     77                A5EAE9010D5970550007C0A1 /* TunaKit.h in Headers */ = {isa = PBXBuildFile; fileRef = A5EAE9000D5970540007C0A1 /* TunaKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; 
     78                A5EAEA630D598B660007C0A1 /* TNPerlTree.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EAEA5B0D598B660007C0A1 /* TNPerlTree.m */; }; 
     79                A5EAEA640D598B660007C0A1 /* TNPerlParser.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EAEA5E0D598B660007C0A1 /* TNPerlParser.m */; }; 
     80                A5EAEA650D598B660007C0A1 /* TNPerlFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EAEA5F0D598B660007C0A1 /* TNPerlFunction.m */; }; 
     81                A5EAEA660D598B660007C0A1 /* TNPerlNode.m in Sources */ = {isa = PBXBuildFile; fileRef = A5EAEA620D598B660007C0A1 /* TNPerlNode.m */; }; 
    7082/* End PBXBuildFile section */ 
    7183 
     
    8395                        proxyType = 1; 
    8496                        remoteGlobalIDString = A54D70DD08636C7700441C97; 
     97                        remoteInfo = "Wired Additions"; 
     98                }; 
     99                A5EAE8C30D596EC20007C0A1 /* PBXContainerItemProxy */ = { 
     100                        isa = PBXContainerItemProxy; 
     101                        containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; 
     102                        proxyType = 1; 
     103                        remoteGlobalIDString = A5EAE6BE0D5969F60007C0A1 /* TunaKit */; 
     104                        remoteInfo = TunaKit; 
     105                }; 
     106                A5EAE8C50D596ECF0007C0A1 /* PBXContainerItemProxy */ = { 
     107                        isa = PBXContainerItemProxy; 
     108                        containerPortal = 29B97313FDCFA39411CA2CEA /* Project object */; 
     109                        proxyType = 1; 
     110                        remoteGlobalIDString = A54D70DD08636C7700441C97 /* Wired Additions */; 
    85111                        remoteInfo = "Wired Additions"; 
    86112                }; 
     
    126152                A57F87400833F60500DEFE69 /* TNProfilerController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNProfilerController.m; sourceTree = "<group>"; }; 
    127153                A57F87770833F75A00DEFE69 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/Profiler.nib; sourceTree = "<group>"; }; 
    128                 A57F87DD0833FE4C00DEFE69 /* TNParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNParser.h; sourceTree = "<group>"; }; 
    129                 A57F87DE0833FE4C00DEFE69 /* TNParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNParser.m; sourceTree = "<group>"; }; 
    130                 A57F892D08353E1E00DEFE69 /* TNTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNTree.h; sourceTree = "<group>"; }; 
    131                 A57F892E08353E1E00DEFE69 /* TNTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNTree.m; sourceTree = "<group>"; }; 
     154                A57F87DD0833FE4C00DEFE69 /* TNParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TNParser.h; path = TunaKit/TNParser.h; sourceTree = "<group>"; }; 
     155                A57F87DE0833FE4C00DEFE69 /* TNParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TNParser.m; path = TunaKit/TNParser.m; sourceTree = "<group>"; }; 
     156                A57F892D08353E1E00DEFE69 /* TNTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TNTree.h; path = TunaKit/TNTree.h; sourceTree = "<group>"; }; 
     157                A57F892E08353E1E00DEFE69 /* TNTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TNTree.m; path = TunaKit/TNTree.m; sourceTree = "<group>"; }; 
    132158                A57F8974083541AC00DEFE69 /* TNSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNSettings.h; sourceTree = "<group>"; }; 
    133159                A57F8975083541AC00DEFE69 /* TNSettings.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNSettings.m; sourceTree = "<group>"; }; 
     
    138164                A5941D280832A7E20006A7D7 /* TNSessionController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNSessionController.h; sourceTree = "<group>"; }; 
    139165                A5941D290832A7E20006A7D7 /* TNSessionController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNSessionController.m; sourceTree = "<group>"; }; 
    140                 A5941DEE0832B3500006A7D7 /* TNFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNFunction.h; sourceTree = "<group>"; }; 
    141                 A5941DEF0832B3510006A7D7 /* TNFunction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNFunction.m; sourceTree = "<group>"; }; 
    142                 A5941E0C0832B4E30006A7D7 /* TNNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNNode.h; sourceTree = "<group>"; }; 
    143                 A5941E0D0832B4E30006A7D7 /* TNNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNNode.m; sourceTree = "<group>"; }; 
     166                A5941DEE0832B3500006A7D7 /* TNFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TNFunction.h; path = TunaKit/TNFunction.h; sourceTree = "<group>"; }; 
     167                A5941DEF0832B3510006A7D7 /* TNFunction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TNFunction.m; path = TunaKit/TNFunction.m; sourceTree = "<group>"; }; 
     168                A5941E0C0832B4E30006A7D7 /* TNNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TNNode.h; path = TunaKit/TNNode.h; sourceTree = "<group>"; }; 
     169                A5941E0D0832B4E30006A7D7 /* TNNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TNNode.m; path = TunaKit/TNNode.m; sourceTree = "<group>"; }; 
    144170                A5C48E060B870A7F007C7F1A /* WiredAdditions */ = {isa = PBXFileReference; lastKnownFileType = folder; path = WiredAdditions; sourceTree = "<group>"; }; 
     171                A5EAE6BF0D5969F60007C0A1 /* TunaKit.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = TunaKit.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 
     172                A5EAE73B0D596B5B0007C0A1 /* prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prefix.pch; path = TunaKit/prefix.pch; sourceTree = "<group>"; }; 
     173                A5EAE73C0D596B5B0007C0A1 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = TunaKit/Info.plist; sourceTree = "<group>"; }; 
     174                A5EAE73D0D596B5B0007C0A1 /* TunaKit.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = TunaKit.xcconfig; path = TunaKit/TunaKit.xcconfig; sourceTree = "<group>"; }; 
     175                A5EAE9000D5970540007C0A1 /* TunaKit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TunaKit.h; path = TunaKit/TunaKit.h; sourceTree = "<group>"; }; 
     176                A5EAEA5B0D598B660007C0A1 /* TNPerlTree.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNPerlTree.m; sourceTree = "<group>"; }; 
     177                A5EAEA5C0D598B660007C0A1 /* TNPerlFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNPerlFunction.h; sourceTree = "<group>"; }; 
     178                A5EAEA5D0D598B660007C0A1 /* TNPerlParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNPerlParser.h; sourceTree = "<group>"; }; 
     179                A5EAEA5E0D598B660007C0A1 /* TNPerlParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNPerlParser.m; sourceTree = "<group>"; }; 
     180                A5EAEA5F0D598B660007C0A1 /* TNPerlFunction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNPerlFunction.m; sourceTree = "<group>"; }; 
     181                A5EAEA600D598B660007C0A1 /* TNPerlNode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNPerlNode.h; sourceTree = "<group>"; }; 
     182                A5EAEA610D598B660007C0A1 /* TNPerlTree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TNPerlTree.h; sourceTree = "<group>"; }; 
     183                A5EAEA620D598B660007C0A1 /* TNPerlNode.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TNPerlNode.m; sourceTree = "<group>"; }; 
    145184/* End PBXFileReference section */ 
    146185 
     
    151190                        files = ( 
    152191                                8D11072F0486CEB800E47090 /* Cocoa.framework in Frameworks */, 
     192                                A5EAE8B10D596E910007C0A1 /* TunaKit.framework in Frameworks */, 
    153193                                A5643C0A0A26041300ADF4F5 /* WiredAdditions.framework in Frameworks */, 
     194                        ); 
     195                        runOnlyForDeploymentPostprocessing = 0; 
     196                }; 
     197                A5EAE6BD0D5969F60007C0A1 /* Frameworks */ = { 
     198                        isa = PBXFrameworksBuildPhase; 
     199                        buildActionMask = 2147483647; 
     200                        files = ( 
     201                                A5EAE7E90D596C360007C0A1 /* Cocoa.framework in Frameworks */, 
     202                                A5EAE8610D596D730007C0A1 /* WiredAdditions.framework in Frameworks */, 
    154203                        ); 
    155204                        runOnlyForDeploymentPostprocessing = 0; 
     
    190239                                8D1107320486CEB800E47090 /* Tuna.app */, 
    191240                                A5643B9F0A26040900ADF4F5 /* WiredAdditions.framework */, 
     241                                A5EAE6BF0D5969F60007C0A1 /* TunaKit.framework */, 
    192242                        ); 
    193243                        name = Products; 
     
    197247                        isa = PBXGroup; 
    198248                        children = ( 
    199                                 080E96DDFE201D6D7F000001 /* Classes */, 
    200                                 A5555131083678EA0044855A /* Additions */, 
    201                                 29B97315FDCFA39411CA2CEA /* Other Sources */, 
    202                                 A54D719108636D5400441C97 /* Config */, 
     249                                A5EAE7320D596AE10007C0A1 /* Tuna */, 
     250                                A5EAE7330D596AF60007C0A1 /* TunaKit */, 
    203251                                77CDAD54083A3D5D003BE654 /* Scripts */, 
    204                                 29B97317FDCFA39411CA2CEA /* Resources */, 
    205252                                29B97323FDCFA39411CA2CEA /* Frameworks */, 
    206253                                A57F85B50833E16100DEFE69 /* Subprojects */, 
     
    284331                                A57F86300833EA9700DEFE69 /* TNDocument.m */, 
    285332                                A57F862F0833EA9700DEFE69 /* TNDocument.h */, 
    286                                 A5941E0D0832B4E30006A7D7 /* TNNode.m */, 
    287                                 A5941E0C0832B4E30006A7D7 /* TNNode.h */, 
    288                                 A57F87DE0833FE4C00DEFE69 /* TNParser.m */, 
    289                                 A57F87DD0833FE4C00DEFE69 /* TNParser.h */, 
    290                                 A5941DEF0832B3510006A7D7 /* TNFunction.m */, 
    291                                 A5941DEE0832B3500006A7D7 /* TNFunction.h */, 
    292                                 A57F892E08353E1E00DEFE69 /* TNTree.m */, 
    293                                 A57F892D08353E1E00DEFE69 /* TNTree.h */, 
     333                                A5EAEA5F0D598B660007C0A1 /* TNPerlFunction.m */, 
     334                                A5EAEA5C0D598B660007C0A1 /* TNPerlFunction.h */, 
     335                                A5EAEA620D598B660007C0A1 /* TNPerlNode.m */, 
     336                                A5EAEA600D598B660007C0A1 /* TNPerlNode.h */, 
     337                                A5EAEA5E0D598B660007C0A1 /* TNPerlParser.m */, 
     338                                A5EAEA5D0D598B660007C0A1 /* TNPerlParser.h */, 
     339                                A5EAEA5B0D598B660007C0A1 /* TNPerlTree.m */, 
     340                                A5EAEA610D598B660007C0A1 /* TNPerlTree.h */, 
    294341                        ); 
    295342                        name = "Data Models"; 
     
    318365                        sourceTree = "<group>"; 
    319366                }; 
     367                A5EAE7320D596AE10007C0A1 /* Tuna */ = { 
     368                        isa = PBXGroup; 
     369                        children = ( 
     370                                080E96DDFE201D6D7F000001 /* Classes */, 
     371                                A5555131083678EA0044855A /* Additions */, 
     372                                29B97315FDCFA39411CA2CEA /* Other Sources */, 
     373                                A54D719108636D5400441C97 /* Config */, 
     374                                29B97317FDCFA39411CA2CEA /* Resources */, 
     375                        ); 
     376                        name = Tuna; 
     377                        sourceTree = "<group>"; 
     378                }; 
     379                A5EAE7330D596AF60007C0A1 /* TunaKit */ = { 
     380                        isa = PBXGroup; 
     381                        children = ( 
     382                                A5EAE9000D5970540007C0A1 /* TunaKit.h */, 
     383                                A5EAE7370D596B0F0007C0A1 /* Classes */, 
     384                                A5EAE7380D596B190007C0A1 /* Other Sources */, 
     385                                A5EAE7390D596B230007C0A1 /* Config */, 
     386                                A5EAE73E0D596B630007C0A1 /* Resources */, 
     387                        ); 
     388                        name = TunaKit; 
     389                        sourceTree = "<group>"; 
     390                }; 
     391                A5EAE7370D596B0F0007C0A1 /* Classes */ = { 
     392                        isa = PBXGroup; 
     393                        children = ( 
     394                                A5941DEF0832B3510006A7D7 /* TNFunction.m */, 
     395                                A5941DEE0832B3500006A7D7 /* TNFunction.h */, 
     396                                A5941E0D0832B4E30006A7D7 /* TNNode.m */, 
     397                                A5941E0C0832B4E30006A7D7 /* TNNode.h */, 
     398                                A57F87DE0833FE4C00DEFE69 /* TNParser.m */, 
     399                                A57F87DD0833FE4C00DEFE69 /* TNParser.h */, 
     400                                A57F892E08353E1E00DEFE69 /* TNTree.m */, 
     401                                A57F892D08353E1E00DEFE69 /* TNTree.h */, 
     402                        ); 
     403                        name = Classes; 
     404                        sourceTree = "<group>"; 
     405                }; 
     406                A5EAE7380D596B190007C0A1 /* Other Sources */ = { 
     407                        isa = PBXGroup; 
     408                        children = ( 
     409                                A5EAE73B0D596B5B0007C0A1 /* prefix.pch */, 
     410                        ); 
     411                        name = "Other Sources"; 
     412                        sourceTree = "<group>"; 
     413                }; 
     414                A5EAE7390D596B230007C0A1 /* Config */ = { 
     415                        isa = PBXGroup; 
     416                        children = ( 
     417                                A5EAE73D0D596B5B0007C0A1 /* TunaKit.xcconfig */, 
     418                        ); 
     419                        name = Config; 
     420                        sourceTree = "<group>"; 
     421                }; 
     422                A5EAE73E0D596B630007C0A1 /* Resources */ = { 
     423                        isa = PBXGroup; 
     424                        children = ( 
     425                                A5EAE73C0D596B5B0007C0A1 /* Info.plist */, 
     426                        ); 
     427                        name = Resources; 
     428                        sourceTree = "<group>"; 
     429                }; 
    320430/* End PBXGroup section */ 
     431 
     432/* Begin PBXHeadersBuildPhase section */ 
     433                A5EAE6BA0D5969F60007C0A1 /* Headers */ = { 
     434                        isa = PBXHeadersBuildPhase; 
     435                        buildActionMask = 2147483647; 
     436                        files = ( 
     437                                A5EAE9010D5970550007C0A1 /* TunaKit.h in Headers */, 
     438                                A5EAE7E50D596C050007C0A1 /* TNFunction.h in Headers */, 
     439                                A5EAE7E30D596C050007C0A1 /* TNNode.h in Headers */, 
     440                                A5EAE7E40D596C050007C0A1 /* TNParser.h in Headers */, 
     441                                A5EAE7E60D596C050007C0A1 /* TNTree.h in Headers */, 
     442                        ); 
     443                        runOnlyForDeploymentPostprocessing = 0; 
     444                }; 
     445/* End PBXHeadersBuildPhase section */ 
    321446 
    322447/* Begin PBXNativeTarget section */ 
     
    335460                        dependencies = ( 
    336461                                A5643B990A2603D900ADF4F5 /* PBXTargetDependency */, 
     462                                A5EAE8C40D596EC20007C0A1 /* PBXTargetDependency */, 
    337463                        ); 
    338464                        name = Tuna; 
     
    341467                        productReference = 8D1107320486CEB800E47090 /* Tuna.app */; 
    342468                        productType = "com.apple.product-type.application"; 
     469                }; 
     470                A5EAE6BE0D5969F60007C0A1 /* TunaKit */ = { 
     471                        isa = PBXNativeTarget; 
     472                        buildConfigurationList = A5EAE6C40D5969F60007C0A1 /* Build configuration list for PBXNativeTarget "TunaKit" */; 
     473                        buildPhases = ( 
     474                                A5EAE6BA0D5969F60007C0A1 /* Headers */, 
     475                                A5EAE6BB0D5969F60007C0A1 /* Resources */, 
     476                                A5EAE6BC0D5969F60007C0A1 /* Sources */, 
     477                                A5EAE6BD0D5969F60007C0A1 /* Frameworks */, 
     478                        ); 
     479                        buildRules = ( 
     480                        ); 
     481                        dependencies = ( 
     482                                A5EAE8C60D596ECF0007C0A1 /* PBXTargetDependency */, 
     483                        ); 
     484                        name = TunaKit; 
     485                        productName = TunaKit; 
     486                        productReference = A5EAE6BF0D5969F60007C0A1 /* TunaKit.framework */; 
     487                        productType = "com.apple.product-type.framework"; 
    343488                }; 
    344489/* End PBXNativeTarget section */ 
     
    355500                        targets = ( 
    356501                                8D1107260486CEB800E47090 /* Tuna */, 
    357                                 A54D70DD08636C7700441C97 /* Wired Additions */, 
     502                                A5EAE6BE0D5969F60007C0A1 /* TunaKit */, 
     503                                A54D70DD08636C7700441C97 /* WiredAdditions */, 
    358504                                A5555100083668450044855A /* Localization */, 
    359505                                77E09E3D0839EBE1002A4FE2 /* Distribution */, 
     
    379525                        runOnlyForDeploymentPostprocessing = 0; 
    380526                }; 
     527                A5EAE6BB0D5969F60007C0A1 /* Resources */ = { 
     528                        isa = PBXResourcesBuildPhase; 
     529                        buildActionMask = 2147483647; 
     530                        files = ( 
     531                        ); 
     532                        runOnlyForDeploymentPostprocessing = 0; 
     533                }; 
    381534/* End PBXResourcesBuildPhase section */ 
    382535 
     
    449602                                A57F86320833EA9700DEFE69 /* TNDocument.m in Sources */, 
    450603                                A5941CAF0832A37B0006A7D7 /* TNMainController.m in Sources */, 
    451                                 A5941E0E0832B4E30006A7D7 /* TNNode.m in Sources */, 
    452                                 A57F87E00833FE4C00DEFE69 /* TNParser.m in Sources */, 
    453604                                A57F87420833F60500DEFE69 /* TNProfilerController.m in Sources */, 
    454605                                A5941D2A0832A7E20006A7D7 /* TNSessionController.m in Sources */, 
    455606                                A57F8977083541AC00DEFE69 /* TNSettings.m in Sources */, 
    456                                 A5941DF00832B3510006A7D7 /* TNFunction.m in Sources */, 
    457                                 A57F893008353E1E00DEFE69 /* TNTree.m in Sources */, 
     607                                A5EAEA630D598B660007C0A1 /* TNPerlTree.m in Sources */, 
     608                                A5EAEA640D598B660007C0A1 /* TNPerlParser.m in Sources */, 
     609                                A5EAEA650D598B660007C0A1 /* TNPerlFunction.m in Sources */, 
     610                                A5EAEA660D598B660007C0A1 /* TNPerlNode.m in Sources */, 
     611                        ); 
     612                        runOnlyForDeploymentPostprocessing = 0; 
     613                }; 
     614                A5EAE6BC0D5969F60007C0A1 /* Sources */ = { 
     615                        isa = PBXSourcesBuildPhase; 
     616                        buildActionMask = 2147483647; 
     617                        files = ( 
     618                                A5EAE7E10D596BFD0007C0A1 /* TNFunction.m in Sources */, 
     619                                A5EAE7DF0D596BFD0007C0A1 /* TNNode.m in Sources */, 
     620                                A5EAE7E00D596BFD0007C0A1 /* TNParser.m in Sources */, 
     621                                A5EAE7E20D596BFD0007C0A1 /* TNTree.m in Sources */, 
    458622                        ); 
    459623                        runOnlyForDeploymentPostprocessing = 0; 
     
    469633                A5643B990A2603D900ADF4F5 /* PBXTargetDependency */ = { 
    470634                        isa = PBXTargetDependency; 
    471                         target = A54D70DD08636C7700441C97 /* Wired Additions */; 
     635                        target = A54D70DD08636C7700441C97 /* WiredAdditions */; 
    472636                        targetProxy = A5643B980A2603D900ADF4F5 /* PBXContainerItemProxy */; 
     637                }; 
     638                A5EAE8C40D596EC20007C0A1 /* PBXTargetDependency */ = { 
     639                        isa = PBXTargetDependency; 
     640                        target = A5EAE6BE0D5969F60007C0A1 /* TunaKit */; 
     641                        targetProxy = A5EAE8C30D596EC20007C0A1 /* PBXContainerItemProxy */; 
     642                }; 
     643                A5EAE8C60D596ECF0007C0A1 /* PBXTargetDependency */ = { 
     644                        isa = PBXTargetDependency; 
     645                        target = A54D70DD08636C7700441C97 /* WiredAdditions */; 
     646                        targetProxy = A5EAE8C50D596ECF0007C0A1 /* PBXContainerItemProxy */; 
    473647                }; 
    474648/* End PBXTargetDependency section */ 
     
    728902                        name = Release/Universal; 
    729903                }; 
     904                A5EAE6C10D5969F60007C0A1 /* Debug/Native/32 */ = { 
     905                        isa = XCBuildConfiguration; 
     906                        buildSettings = { 
     907                                DYLIB_COMPATIBILITY_VERSION = 1; 
     908                                DYLIB_CURRENT_VERSION = 1; 
     909                                FRAMEWORK_VERSION = A; 
     910                                GCC_ENABLE_FIX_AND_CONTINUE = YES; 
     911                                GCC_MODEL_TUNING = G5; 
     912                                GCC_PRECOMPILE_PREFIX_HEADER = YES; 
     913                                GCC_PREFIX_HEADER = TunaKit/prefix.pch; 
     914                                INFOPLIST_FILE = TunaKit/Info.plist; 
     915                                INSTALL_PATH = "@executable_path/../Frameworks"; 
     916                                OTHER_LDFLAGS = ( 
     917                                        "-lcrypto", 
     918                                        "-lssl", 
     919                                        "-seg1addr", 
     920                                        0xb0000000, 
     921                                ); 
     922                                PRODUCT_NAME = TunaKit; 
     923                                WRAPPER_EXTENSION = framework; 
     924                        }; 
     925                        name = Debug/Native/32; 
     926                }; 
     927                A5EAE6C20D5969F60007C0A1 /* Test/Universal */ = { 
     928                        isa = XCBuildConfiguration; 
     929                        buildSettings = { 
     930                                DYLIB_COMPATIBILITY_VERSION = 1; 
     931                                DYLIB_CURRENT_VERSION = 1; 
     932                                FRAMEWORK_VERSION = A; 
     933                                GCC_ENABLE_FIX_AND_CONTINUE = YES; 
     934                                GCC_MODEL_TUNING = G5; 
     935                                GCC_PRECOMPILE_PREFIX_HEADER = YES; 
     936                                GCC_PREFIX_HEADER = TunaKit/prefix.pch; 
     937                                INFOPLIST_FILE = TunaKit/Info.plist; 
     938                                INSTALL_PATH = "@executable_path/../Frameworks"; 
     939                                OTHER_LDFLAGS = ( 
     940                                        "-lcrypto", 
     941                                        "-lssl", 
     942                                        "-seg1addr", 
     943                                        0xb0000000, 
     944                                ); 
     945                                PRODUCT_NAME = TunaKit; 
     946                                WRAPPER_EXTENSION = framework; 
     947                        }; 
     948                        name = Test/Universal; 
     949                }; 
     950                A5EAE6C30D5969F60007C0A1 /* Release/Universal */ = { 
     951                        isa = XCBuildConfiguration; 
     952                        buildSettings = { 
     953                                DYLIB_COMPATIBILITY_VERSION = 1; 
     954                                DYLIB_CURRENT_VERSION = 1; 
     955                                FRAMEWORK_VERSION = A; 
     956                                GCC_ENABLE_FIX_AND_CONTINUE = YES; 
     957                                GCC_MODEL_TUNING = G5; 
     958                                GCC_PRECOMPILE_PREFIX_HEADER = YES; 
     959                                GCC_PREFIX_HEADER = TunaKit/prefix.pch; 
     960                                INFOPLIST_FILE = TunaKit/Info.plist; 
     961                                INSTALL_PATH = "@executable_path/../Frameworks"; 
     962                                OTHER_LDFLAGS = ( 
     963                                        "-lcrypto", 
     964                                        "-lssl", 
     965                                        "-seg1addr", 
     966                                        0xb0000000, 
     967                                ); 
     968                                PRODUCT_NAME = TunaKit; 
     969                                WRAPPER_EXTENSION = framework; 
     970                        }; 
     971                        name = Release/Universal; 
     972                }; 
    730973/* End XCBuildConfiguration section */ 
    731974 
     
    7711014                        defaultConfigurationName = Debug/Native/32; 
    7721015                }; 
    773                 A54D711E08636C9700441C97 /* Build configuration list for PBXAggregateTarget "Wired Additions" */ = { 
     1016                A54D711E08636C9700441C97 /* Build configuration list for PBXAggregateTarget "WiredAdditions" */ = { 
    7741017                        isa = XCConfigurationList; 
    7751018                        buildConfigurations = ( 
     
    7811024                        defaultConfigurationName = Debug/Native/32; 
    7821025                }; 
     1026                A5EAE6C40D5969F60007C0A1 /* Build configuration list for PBXNativeTarget "TunaKit" */ = { 
     1027                        isa = XCConfigurationList; 
     1028                        buildConfigurations = ( 
     1029                                A5EAE6C10D5969F60007C0A1 /* Debug/Native/32 */, 
     1030                                A5EAE6C20D5969F60007C0A1 /* Test/Universal */, 
     1031                                A5EAE6C30D5969F60007C0A1 /* Release/Universal */, 
     1032                        ); 
     1033                        defaultConfigurationIsVisible = 0; 
     1034                        defaultConfigurationName = Debug/Native/32; 
     1035                }; 
    7831036/* End XCConfigurationList section */ 
    7841037        }; 
  • Tuna/trunk/TunaKit/TNFunction.h

    r5218 r5220  
    2727 */ 
    2828 
    29 @interface TNFunction : WIObject <NSCopying> { 
     29@interface TNFunction : NSObject <NSCopying> { 
    3030@public 
    3131        NSString                                        *_library; 
     
    4343 
    4444@end 
    45  
    46  
    47 @interface TNObjCFunction : TNFunction 
    48  
    49 @end 
  • Tuna/trunk/TunaKit/TNFunction.m

    r5218 r5220  
    9595 
    9696@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