diff --git a/Cocoa/Classes/InfoWindowController.m b/Cocoa/Classes/InfoWindowController.m index a8ca81f..e88fa49 100644 --- a/Cocoa/Classes/InfoWindowController.m +++ b/Cocoa/Classes/InfoWindowController.m @@ -69,7 +69,7 @@ FSRef *fileRef = (FSRef *) NewPtrClear(sizeof(FSRef)); if(fileRef && [currentDocument fileName]) { - OSStatus error = FSPathMakeRef([[currentDocument fileName] fileSystemRepresentation], fileRef, nil); + OSStatus error = FSPathMakeRef((unsigned char *)[[currentDocument fileName] fileSystemRepresentation], fileRef, nil); if(!error) FSGetForkSizes(fileRef, &dataLogicalSize, &rsrcLogicalSize); } if(fileRef) DisposePtr((Ptr) fileRef); diff --git a/Cocoa/Classes/OutlineViewDelegate.m b/Cocoa/Classes/OutlineViewDelegate.m index a1df4ac..be7fdd6 100644 --- a/Cocoa/Classes/OutlineViewDelegate.m +++ b/Cocoa/Classes/OutlineViewDelegate.m @@ -99,7 +99,7 @@ int compareResourcesDescending(Resource *r1, Resource *r2, void *context) @pending remove setting of the cell formatter when that capability is in interface builder */ -- (void)outlineView:(NSOutlineView *)outlineView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item +- (void)outlineView:(NSOutlineView *)olView willDisplayCell:(id)cell forTableColumn:(NSTableColumn *)tableColumn item:(id)item { Resource *resource = (Resource *)item; NSString *identifier = [tableColumn identifier]; @@ -161,7 +161,7 @@ int compareResourcesDescending(Resource *r1, Resource *r2, void *context) // draw alternating blue/white backgrounds (if pre-10.3) if(NSAppKitVersionNumber < 700.0) { - int row = [outlineView rowForItem:item]; + int row = [olView rowForItem:item]; if(row % 2) [cell setBackgroundColor:[NSColor colorWithCalibratedRed:0.93 green:0.95 blue:1.0 alpha:1.0]]; else [cell setBackgroundColor:[NSColor whiteColor]]; [cell setDrawsBackground:YES]; diff --git a/Cocoa/Classes/Resource.m b/Cocoa/Classes/Resource.m index a311e5e..6bf78c7 100644 --- a/Cocoa/Classes/Resource.m +++ b/Cocoa/Classes/Resource.m @@ -90,7 +90,7 @@ NSString *RKResourcePboardType = @"RKResourcePboardType"; return [NSArray arrayWithArray:array]; } -+ (Resource *)resourceOfType:(NSString *)typeValue withName:(NSString *)nameValue inDocument:(NSDocument *)searchDoc ++ (id)resourceOfType:(NSString *)typeValue withName:(NSString *)nameValue inDocument:(NSDocument *)searchDoc { NSDocument *doc; NSEnumerator *enumerator = [[[NSDocumentController sharedDocumentController] documents] objectEnumerator]; @@ -106,7 +106,7 @@ NSString *RKResourcePboardType = @"RKResourcePboardType"; return nil; } -+ (Resource *)resourceOfType:(NSString *)typeValue andID:(NSNumber *)resIDValue inDocument:(NSDocument *)searchDoc ++ (id)resourceOfType:(NSString *)typeValue andID:(NSNumber *)resIDValue inDocument:(NSDocument *)searchDoc { NSDocument *doc; NSEnumerator *enumerator = [[[NSDocumentController sharedDocumentController] documents] objectEnumerator]; @@ -177,7 +177,7 @@ NSString *RKResourcePboardType = @"RKResourcePboardType"; [[NSNotificationCenter defaultCenter] postNotificationName:ResourceDidChangeNotification object:self]; } -- (ResourceDocument *)document +- (NSDocument *)document { return [Resource documentForResource:self]; } diff --git a/Cocoa/Classes/ResourceDataSource.mm b/Cocoa/Classes/ResourceDataSource.mm index 4625bc3..64b5cc7 100644 --- a/Cocoa/Classes/ResourceDataSource.mm +++ b/Cocoa/Classes/ResourceDataSource.mm @@ -222,11 +222,11 @@ extern NSString *RKResourcePboardType; @method outlineView:validateDrop:proposedItem:proposedChildIndex: @abstract Called when the user is hovering with a drop over our outline view. */ -- (NSDragOperation)outlineView:(NSOutlineView *)outlineView validateDrop:(id )info proposedItem:(id)item proposedChildIndex:(int)childIndex +- (NSDragOperation)outlineView:(NSOutlineView *)olView validateDrop:(id )info proposedItem:(id)item proposedChildIndex:(int)childIndex { - if([info draggingSource] != outlineView) + if([info draggingSource] != olView) { - [outlineView setDropItem:nil dropChildIndex:NSOutlineViewDropOnItemIndex]; + [olView setDropItem:nil dropChildIndex:NSOutlineViewDropOnItemIndex]; return NSDragOperationCopy; } else return NSDragOperationNone; diff --git a/Cocoa/Classes/ResourceDocument.mm b/Cocoa/Classes/ResourceDocument.mm index 1a36afe..a9950fd 100644 --- a/Cocoa/Classes/ResourceDocument.mm +++ b/Cocoa/Classes/ResourceDocument.mm @@ -180,7 +180,7 @@ extern NSString *RKResourcePboardType; } // tidy up loose ends - if(fileRefNum) FSClose(fileRefNum); + if(fileRefNum) FSCloseFork(fileRefNum); DisposePtr((Ptr) fileRef); return succeeded; } @@ -276,14 +276,14 @@ extern NSString *RKResourcePboardType; // create the resource & add it to the array NSString *name = [[NSString alloc] initWithBytes:&nameStr[1] length:nameStr[0] encoding:NSMacOSRomanStringEncoding]; - NSString *type = [[NSString alloc] initWithBytes:(char *) &swappedType length:4 encoding:NSMacOSRomanStringEncoding]; + NSString *resType = [[NSString alloc] initWithBytes:(char *) &swappedType length:4 encoding:NSMacOSRomanStringEncoding]; NSNumber *resID = [NSNumber numberWithShort:resIDShort]; NSNumber *attributes = [NSNumber numberWithShort:attrsShort]; NSData *data = [NSData dataWithBytes:*resourceHandle length:sizeLong]; - Resource *resource = [Resource resourceOfType:type andID:resID withName:name andAttributes:attributes data:data]; + Resource *resource = [Resource resourceOfType:resType andID:resID withName:name andAttributes:attributes data:data]; [resources addObject:resource]; // array retains resource [name release]; - [type release]; + [resType release]; HUnlock(resourceHandle); ReleaseResource(resourceHandle); @@ -346,7 +346,7 @@ extern NSString *RKResourcePboardType; succeeded = [self writeResourceMap:fileRefNum]; // tidy up loose ends - if(fileRefNum) FSClose(fileRefNum); + if(fileRefNum) FSCloseFork(fileRefNum); DisposePtr((Ptr) fileRef); // update info window @@ -383,7 +383,7 @@ extern NSString *RKResourcePboardType; error = FSOpenFork(fileRef, [[resource representedFork] length], (UniChar *) uniname, fsWrPerm, &forkRefNum); if(!error && forkRefNum) error = FSWriteFork(forkRefNum, fsFromStart, 0, [[resource data] length], [[resource data] bytes], NULL); - if(forkRefNum) FSClose(forkRefNum); + if(forkRefNum) FSCloseFork(forkRefNum); } DisposePtr((Ptr) fileRef); return YES; @@ -977,7 +977,7 @@ static NSString *RKExportItemIdentifier = @"com.nickshanks.resknife.toolbar.exp [[self undoManager] registerUndoWithTarget:resource selector:@selector(setResID:) object:[[[resource resID] copy] autorelease]]; if([[resource name] length] == 0) [[self undoManager] setActionName:NSLocalizedString(@"ID Change", nil)]; - else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"ID Change for Ò%@Ó", nil), [resource name]]]; + else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"ID Change for '%@'", nil), [resource name]]]; } - (void)resourceTypeWillChange:(NSNotification *)notification @@ -987,7 +987,7 @@ static NSString *RKExportItemIdentifier = @"com.nickshanks.resknife.toolbar.exp [[self undoManager] registerUndoWithTarget:resource selector:@selector(setType:) object:[[[resource type] copy] autorelease]]; if([[resource name] length] == 0) [[self undoManager] setActionName:NSLocalizedString(@"Type Change", nil)]; - else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Type Change for Ò%@Ó", nil), [resource name]]]; + else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Type Change for '%@'", nil), [resource name]]]; } - (void)resourceAttributesWillChange:(NSNotification *)notification @@ -997,7 +997,7 @@ static NSString *RKExportItemIdentifier = @"com.nickshanks.resknife.toolbar.exp [[self undoManager] registerUndoWithTarget:resource selector:@selector(setAttributes:) object:[[[resource attributes] copy] autorelease]]; if([[resource name] length] == 0) [[self undoManager] setActionName:NSLocalizedString(@"Attributes Change", nil)]; - else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Attributes Change for Ò%@Ó", nil), [resource name]]]; + else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Attributes Change for '%@'", nil), [resource name]]]; } - (void)resourceDataDidChange:(NSNotification *)notification @@ -1106,7 +1106,7 @@ static NSString *RKExportItemIdentifier = @"com.nickshanks.resknife.toolbar.exp [dataSource removeResource:resource]; if([[resource name] length] == 0) [[self undoManager] setActionName:NSLocalizedString(@"Delete Resource", nil)]; - else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Delete Resource Ò%@Ó", nil), [resource name]]]; + else [[self undoManager] setActionName:[NSString stringWithFormat:NSLocalizedString(@"Delete Resource '%@'", nil), [resource name]]]; } [[self undoManager] endUndoGrouping]; diff --git a/ResKnife.xcodeproj/project.pbxproj b/ResKnife.xcodeproj/project.pbxproj index 9b72c0e..bb83e8c 100644 --- a/ResKnife.xcodeproj/project.pbxproj +++ b/ResKnife.xcodeproj/project.pbxproj @@ -608,7 +608,7 @@ F5B5883F0156D40B01000001 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/PrefsWindow.nib; sourceTree = ""; }; F5B588410156D40B01000001 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ResourceDocument.nib; sourceTree = ""; }; F5B588430156D40B01000001 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; }; - F5B588450156D40B01000001 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; lineEnding = 0; name = English; path = English.lproj/Localizable.strings; sourceTree = ""; }; + F5B588450156D40B01000001 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; lineEnding = 0; name = English; path = English.lproj/Localizable.strings; sourceTree = ""; }; F5B588460156D40B01000001 /* ResKnife.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = ResKnife.icns; sourceTree = ""; }; F5B588470156D40B01000001 /* Resource file.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "Resource file.icns"; sourceTree = ""; }; F5B588480156D40B01000001 /* Icon file.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "Icon file.icns"; sourceTree = ""; };