mirror of
https://github.com/nickshanks/ResKnife.git
synced 2024-12-22 02:29:56 +00:00
Bug fixes
This commit is contained in:
parent
bc2c081e61
commit
7b6cbbc706
@ -57,7 +57,7 @@
|
|||||||
[[attributesMatrix cellAtRow:purgableBox column:0] setState:[[selectedResource attributes] shortValue] & resPurgeable];
|
[[attributesMatrix cellAtRow:purgableBox column:0] setState:[[selectedResource attributes] shortValue] & resPurgeable];
|
||||||
[[attributesMatrix cellAtRow:systemHeapBox column:0] setState:[[selectedResource attributes] shortValue] & resSysHeap];
|
[[attributesMatrix cellAtRow:systemHeapBox column:0] setState:[[selectedResource attributes] shortValue] & resSysHeap];
|
||||||
}
|
}
|
||||||
else
|
else if( currentDocument != nil )
|
||||||
{
|
{
|
||||||
// get sizes of forks as they are on disk
|
// get sizes of forks as they are on disk
|
||||||
UInt64 dataLogicalSize = 0, rsrcLogicalSize = 0;
|
UInt64 dataLogicalSize = 0, rsrcLogicalSize = 0;
|
||||||
@ -73,8 +73,8 @@
|
|||||||
[[self window] setTitle:@"Document Info"];
|
[[self window] setTitle:@"Document Info"];
|
||||||
[iconView setImage:[NSImage imageNamed:@"Resource file"]];
|
[iconView setImage:[NSImage imageNamed:@"Resource file"]];
|
||||||
[nameView setStringValue:[currentDocument fileName]? [[currentDocument fileName] lastPathComponent]:[currentDocument displayName]];
|
[nameView setStringValue:[currentDocument fileName]? [[currentDocument fileName] lastPathComponent]:[currentDocument displayName]];
|
||||||
[[filePropertyForm cellAtIndex:0] setStringValue:[currentDocument creator]];
|
[[filePropertyForm cellAtIndex:0] setStringValue:@"hi:)"/*[currentDocument creator]*/];
|
||||||
[[filePropertyForm cellAtIndex:1] setStringValue:[currentDocument type]];
|
[[filePropertyForm cellAtIndex:1] setStringValue:@"helo"/*[currentDocument type]*/];
|
||||||
// [[filePropertyForm cellAtIndex:2] setObjectValue:[NSNumber numberWithUnsignedLongLong:dataLogicalSize]];
|
// [[filePropertyForm cellAtIndex:2] setObjectValue:[NSNumber numberWithUnsignedLongLong:dataLogicalSize]];
|
||||||
// [[filePropertyForm cellAtIndex:3] setObjectValue:[NSNumber numberWithUnsignedLongLong:rsrcLogicalSize]];
|
// [[filePropertyForm cellAtIndex:3] setObjectValue:[NSNumber numberWithUnsignedLongLong:rsrcLogicalSize]];
|
||||||
[[filePropertyForm cellAtIndex:2] setStringValue:[[NSNumber numberWithUnsignedLongLong:dataLogicalSize] description]];
|
[[filePropertyForm cellAtIndex:2] setStringValue:[[NSNumber numberWithUnsignedLongLong:dataLogicalSize] description]];
|
||||||
@ -91,7 +91,9 @@
|
|||||||
currentDocument = [controller document];
|
currentDocument = [controller document];
|
||||||
else currentDocument = nil;
|
else currentDocument = nil;
|
||||||
|
|
||||||
selectedResource = [[currentDocument outlineView] selectedItem];
|
if( currentDocument )
|
||||||
|
selectedResource = [[currentDocument outlineView] selectedItem];
|
||||||
|
else selectedResource = [controller resource];
|
||||||
[self updateInfoWindow];
|
[self updateInfoWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -299,8 +299,7 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
|
|||||||
// opens resource in template using TMPL resource with name templateName
|
// opens resource in template using TMPL resource with name templateName
|
||||||
NSBundle *templateEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"Template Editor.plugin"]];
|
NSBundle *templateEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"Template Editor.plugin"]];
|
||||||
|
|
||||||
// bug: this only checks the CURRENT DOCUMENT for template resources
|
// bug: this checks EVERY DOCUMENT for template resources (might not be desired)
|
||||||
// Resource *tmpl = [dataSource resourceOfType:@"TMPL" withName:[resource type]];
|
|
||||||
Resource *tmpl = [Resource resourceOfType:@"TMPL" withName:[resource type] inDocument:nil];
|
Resource *tmpl = [Resource resourceOfType:@"TMPL" withName:[resource type] inDocument:nil];
|
||||||
|
|
||||||
// open the resources, passing in the template to use
|
// open the resources, passing in the template to use
|
||||||
@ -320,7 +319,7 @@ static NSString *RKShowInfoItemIdentifier = @"com.nickshanks.resknife.toolbar.sh
|
|||||||
NSBundle *hexEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"Hexadecimal Editor.plugin"]];
|
NSBundle *hexEditor = [NSBundle bundleWithPath:[[[NSBundle mainBundle] builtInPlugInsPath] stringByAppendingPathComponent:@"Hexadecimal Editor.plugin"]];
|
||||||
// bug: I alloc a plug instance here, but have no idea where I should dealloc it, perhaps the plug ought to call [self autorelease] when it's last window is closed?
|
// bug: I alloc a plug instance here, but have no idea where I should dealloc it, perhaps the plug ought to call [self autorelease] when it's last window is closed?
|
||||||
|
|
||||||
[(id <ResKnifePluginProtocol>)[[hexEditor principalClass] alloc] initWithResource:resource];
|
NSWindowController *plugController = [(id <ResKnifePluginProtocol>)[[hexEditor principalClass] alloc] initWithResource:resource];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)playSound:(id)sender
|
- (IBAction)playSound:(id)sender
|
||||||
|
4
Cocoa/English.lproj/InfoWindow.nib/info.nib
generated
4
Cocoa/English.lproj/InfoWindow.nib/info.nib
generated
@ -5,12 +5,12 @@
|
|||||||
<key>IBDocumentLocation</key>
|
<key>IBDocumentLocation</key>
|
||||||
<string>142 473 384 240 0 0 1024 746 </string>
|
<string>142 473 384 240 0 0 1024 746 </string>
|
||||||
<key>IBFramework Version</key>
|
<key>IBFramework Version</key>
|
||||||
<string>248.0</string>
|
<string>263.2</string>
|
||||||
<key>IBOpenObjects</key>
|
<key>IBOpenObjects</key>
|
||||||
<array>
|
<array>
|
||||||
<integer>50</integer>
|
<integer>50</integer>
|
||||||
</array>
|
</array>
|
||||||
<key>IBSystem Version</key>
|
<key>IBSystem Version</key>
|
||||||
<string>5Q45</string>
|
<string>5Q125</string>
|
||||||
</dict>
|
</dict>
|
||||||
</plist>
|
</plist>
|
||||||
|
BIN
Cocoa/English.lproj/InfoWindow.nib/objects.nib
generated
BIN
Cocoa/English.lproj/InfoWindow.nib/objects.nib
generated
Binary file not shown.
@ -3,13 +3,9 @@
|
|||||||
<plist version="0.9">
|
<plist version="0.9">
|
||||||
<dict>
|
<dict>
|
||||||
<key>IBDocumentLocation</key>
|
<key>IBDocumentLocation</key>
|
||||||
<string>279 92 422 584 0 0 1152 848 </string>
|
<string>539 135 422 584 0 0 1280 1002 </string>
|
||||||
<key>IBFramework Version</key>
|
<key>IBFramework Version</key>
|
||||||
<string>263.2</string>
|
<string>263.2</string>
|
||||||
<key>IBOpenObjects</key>
|
|
||||||
<array>
|
|
||||||
<integer>6</integer>
|
|
||||||
</array>
|
|
||||||
<key>IBSystem Version</key>
|
<key>IBSystem Version</key>
|
||||||
<string>5Q125</string>
|
<string>5Q125</string>
|
||||||
</dict>
|
</dict>
|
||||||
|
Binary file not shown.
@ -142,6 +142,7 @@
|
|||||||
selection = [[self delegate] asciiRangeFromByteRange:byteSelection];
|
selection = [[self delegate] asciiRangeFromByteRange:byteSelection];
|
||||||
[self setSelectedRange:selection];
|
[self setSelectedRange:selection];
|
||||||
[data release];
|
[data release];
|
||||||
|
NSLog(@"undo manager %@", [[self window] undoManager]);
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction)deleteBackward:(id)sender
|
- (IBAction)deleteBackward:(id)sender
|
||||||
|
@ -13,6 +13,7 @@
|
|||||||
IBOutlet NSTextView *offset;
|
IBOutlet NSTextView *offset;
|
||||||
IBOutlet NSTextField *message;
|
IBOutlet NSTextField *message;
|
||||||
|
|
||||||
|
NSUndoManager *hexUndo;
|
||||||
id <ResKnifeResourceProtocol> resource;
|
id <ResKnifeResourceProtocol> resource;
|
||||||
int bytesPerRow;
|
int bytesPerRow;
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
// one instance of your principal class will be created for every resource the user wants to edit (similar to Windows apps)
|
// one instance of your principal class will be created for every resource the user wants to edit (similar to Windows apps)
|
||||||
resource = [newResource retain];
|
resource = [newResource retain];
|
||||||
bytesPerRow = 16;
|
bytesPerRow = 16;
|
||||||
|
hexUndo = [[NSUndoManager alloc] init];
|
||||||
|
|
||||||
// load the window from the nib file and set it's title
|
// load the window from the nib file and set it's title
|
||||||
[self window]; // implicitly loads nib
|
[self window]; // implicitly loads nib
|
||||||
@ -178,4 +179,10 @@
|
|||||||
return bytesPerRow;
|
return bytesPerRow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSUndoManager *)windowWillReturnUndoManager:(NSWindow *)sender
|
||||||
|
{
|
||||||
|
NSLog(@"returning undo manager %@", hexUndo);
|
||||||
|
return hexUndo;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
@ -13,7 +13,7 @@ typedef struct RLEPixelData
|
|||||||
short reserved1;
|
short reserved1;
|
||||||
short reserved2;
|
short reserved2;
|
||||||
short reserved3;
|
short reserved3;
|
||||||
char tokens[]; // the RLE token data (variable size array)
|
char tokens[1]; // the RLE token data (variable size array)
|
||||||
} RLEPixelData;
|
} RLEPixelData;
|
||||||
|
|
||||||
#define kRLEResourceHeaderSize (sizeof(RLEPixelData) - 1)
|
#define kRLEResourceHeaderSize (sizeof(RLEPixelData) - 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user