Browse files

fixes for many (not all) endian problems when running native on intel

git-svn-id: https://resknife.svn.sourceforge.net/svnroot/resknife/trunk/ResKnife@135 25122d23-1bc7-42f3-9251-2040de679093
  • Loading branch information...
1 parent 3c92b7b commit e1f6dcd35d506f8a4e6a9769714aab99a04bbe2c nickshanks committed Aug 30, 2010
Showing with 260 additions and 158 deletions.
  1. +1 −1 Carbon/Classes/Application.cpp
  2. +1 −1 Carbon/Classes/Asynchronous.cpp
  3. +14 −5 Cocoa/Categories/NSOutlineView-SelectedItems.m
  4. +2 −2 Cocoa/Categories/NSString-FSSpec.m
  5. +57 −43 Cocoa/Classes/ApplicationDelegate.m
  6. +8 −6 Cocoa/Classes/InfoWindowController.m
  7. +32 −14 Cocoa/Classes/ResourceDocument.mm
  8. BIN Cocoa/English.lproj/InfoPlist.strings
  9. +6 −24 Cocoa/Info.plist
  10. +1 −1 Cocoa/Plug-Ins/Hex Editor/HexWindowController.mm
  11. +6 −0 Cocoa/Plug-Ins/ResKnifePluginProtocol.h
  12. +3 −1 Cocoa/Plug-Ins/ResKnifeResourceProtocol.h
  13. +5 −3 Cocoa/Plug-Ins/Template Editor/ElementDBYT.m
  14. +8 −3 Cocoa/Plug-Ins/Template Editor/ElementDLLG.m
  15. +8 −3 Cocoa/Plug-Ins/Template Editor/ElementDLNG.m
  16. +8 −3 Cocoa/Plug-Ins/Template Editor/ElementDWRD.m
  17. +5 −3 Cocoa/Plug-Ins/Template Editor/ElementOCNT.m
  18. +20 −8 Cocoa/Plug-Ins/Template Editor/ElementPSTR.m
  19. +5 −3 Cocoa/Plug-Ins/Template Editor/ElementUBYT.m
  20. +8 −3 Cocoa/Plug-Ins/Template Editor/ElementULLG.m
  21. +8 −3 Cocoa/Plug-Ins/Template Editor/ElementULNG.m
  22. +8 −3 Cocoa/Plug-Ins/Template Editor/ElementUWRD.m
  23. +5 −4 Cocoa/Plug-Ins/Template Editor/English.lproj/Localizable.strings
  24. +2 −2 Cocoa/Plug-Ins/Template Editor/Info.plist
  25. +3 −3 Cocoa/Plug-Ins/Template Editor/TemplateStream.h
  26. +4 −3 Cocoa/Plug-Ins/Template Editor/TemplateWindowController.m
  27. +1 −1 Cocoa/Resources/ResKnife.scriptSuite
  28. +1 −1 Hex Editor/Classes/Initalisation.cpp
  29. +1 −1 PICT Editor/Classes/Initalisation.cpp
  30. +1 −1 README.txt
  31. +19 −9 ResKnife.xcodeproj/project.pbxproj
  32. +9 −0 TODO.txt
View
2 Carbon/Classes/Application.cpp
@@ -968,7 +968,7 @@ Boolean GotRequiredParams( const AppleEvent *event )
DescType actualType;
Size actualSize;
- // check if we have retreived the required parameters
+ // check if we have retrieved the required parameters
error = AEGetAttributePtr( event, keyMissedKeywordAttr, typeWildCard, &actualType, null, 0, &actualSize );
return error == errAEDescNotFound;
}
View
2 Carbon/Classes/Asynchronous.cpp
@@ -566,7 +566,7 @@ OSErr SHQueueCallback( SndChannel *channel )
// causes a crash if more than one SndPlay call is made on the same channel. Helper
// will never do this on its own, and you shouldn't either. If you want a sound
// channel that you want to send commands to, call SHPlayByHandle with a nil handle,
-// then call SHGetChannel to retreive a pointer to the channel.
+// then call SHGetChannel to retrieve a pointer to the channel.
//
//=======================================================================================
OSErr SHBeginPlayback( SHOutPtr outRec )
View
19 Cocoa/Categories/NSOutlineView-SelectedItems.m
@@ -2,22 +2,31 @@
/* The methods in the following catagory were based upon those in OmniAppKit */
-@implementation NSOutlineView (ResKnifeSelectedItemExtensions)
+@implementation NSOutlineView (RKSelectedItemExtensions)
- (id)selectedItem
{
- if( [self numberOfSelectedRows] != 1 ) return nil;
+ if ([self numberOfSelectedRows] != 1) return nil;
else return [self itemAtRow:[self selectedRow]];
}
- (NSArray *)selectedItems
{
- NSNumber *row;
NSMutableArray *items = [NSMutableArray array];
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_3
+ NSIndexSet *indicies = [self selectedRowIndexes];
+ unsigned int rowIndex = [indicies firstIndex];
+ while (rowIndex != NSNotFound)
+ {
+ [items addObject:[self itemAtRow:rowIndex]];
+ rowIndex = [indicies indexGreaterThanIndex:rowIndex];
+ }
+#else
+ NSNumber *row;
NSEnumerator *enumerator = [self selectedRowEnumerator];
-
- while( row = [enumerator nextObject] )
+ while (row = [enumerator nextObject])
[items addObject:[self itemAtRow:[row intValue]]];
+#endif
return items;
}
View
4 Cocoa/Categories/NSString-FSSpec.m
@@ -6,7 +6,7 @@ - (FSRef *)createFSRef
{
// caller is responsible for disposing of the FSRef (method is a 'create' method)
FSRef *fsRef = (FSRef *) NewPtrClear(sizeof(FSRef));
- OSStatus error = FSPathMakeRef([self fileSystemRepresentation], fsRef, NULL);
+ OSStatus error = FSPathMakeRef((unsigned char *)[self fileSystemRepresentation], fsRef, NULL);
if(error == noErr)
return fsRef;
return NULL;
@@ -17,7 +17,7 @@ - (FSSpec *)createFSSpec
// caller is responsible for disposing of the FSSpec (method is a 'create' method)
FSRef *fsRef = (FSRef *) NewPtrClear(sizeof(FSRef));
FSSpec *fsSpec = (FSSpec *) NewPtrClear(sizeof(FSSpec));
- OSStatus error = FSPathMakeRef([self fileSystemRepresentation], fsRef, NULL);
+ OSStatus error = FSPathMakeRef((unsigned char *)[self fileSystemRepresentation], fsRef, NULL);
if(error == noErr)
{
error = FSGetCatalogInfo(fsRef, kFSCatInfoNone, NULL, NULL, fsSpec, NULL);
View
100 Cocoa/Classes/ApplicationDelegate.m
@@ -65,6 +65,8 @@ - (void)dealloc
- (void)precacheIcons:(NSTimer *)timer
{
// pre-cache a number of common icons (ignores return value, relies on iconForResourceType: to do the actual caching)
+ [self iconForResourceType:@" "];
+ [self iconForResourceType:@"????"];
[self iconForResourceType:@"CODE"];
[self iconForResourceType:@"icns"];
[self iconForResourceType:@"PICT"];
@@ -231,70 +233,82 @@ - (OpenPanelDelegate *)openPanelDelegate
@author Nicholas Shanks
@created 2003-10-24
@abstract Manages the cache of icons used for representing resource types.
-@description This method loads icons for each resource type from a variety of places and caches them for faster access. Your plug-in may be asked to return an icon for any resource type it declares it can edit. To implement this, your plug should respond to the iconForResourceType: selector with the same method signature as this method. The icons can be in any format recognised by NSImage. Alternativly, just leave your icons in "Your.plugin/Contents/Resources/Resource Type Icons/" (or any equivalent localised directory) with a name like "TYPE.tiff" and ResKnife will retreive them automatically.
+@description This method loads icons for each resource type from a variety of places and caches them for faster access. Your plug-in may be asked to return an icon for any resource type it declares it can edit. To implement this, your plug should respond to the iconForResourceType: selector with the same method signature as this method. The icons can be in any format recognised by NSImage. Alternativly, just leave your icons in "Your.plugin/Contents/Resources/Resource Type Icons/" (or any equivalent localised directory) with a name like "TYPE.tiff" and ResKnife will retrieve them automatically.
@pending I don't like the name I chose here for the resource type icons directory. Can anyone think of something better?
*/
- (NSImage *)iconForResourceType:(NSString *)resourceType
{
- // check if we have image in cache already
NSImage *icon = nil;
if([resourceType isEqualToString:@""])
resourceType = nil;
- if(resourceType);
- icon = [[self _icons] valueForKey:resourceType];
- if(!icon)
+ if(resourceType)
{
- NSString *iconPath = nil;
+ // check if we have image in cache already
+ icon = [[self _icons] objectForKey:resourceType]; // valueForKey: raises when the resourceType begins with '@' (e.g. the @GN4 owner resource from Gene!)
- // try to load icon from the default editor for that type
- Class editor = [[RKEditorRegistry defaultRegistry] editorForType:resourceType];
- if(editor && resourceType)
+ if(!icon)
{
- // ask politly for icon
- if([editor respondsToSelector:@selector(iconForResourceType:)])
- icon = [editor iconForResourceType:resourceType];
+ NSString *iconPath = nil;
+
+ // try to load icon from the default editor for that type
+ Class editor = [[RKEditorRegistry defaultRegistry] editorForType:resourceType];
+ if(editor)
+ {
+ // ask politly for icon
+ if([editor respondsToSelector:@selector(iconForResourceType:)])
+ icon = [editor iconForResourceType:resourceType];
+
+ // try getting it myself
+ if(!icon)
+ {
+ iconPath = [[NSBundle bundleForClass:editor] pathForResource:resourceType ofType:nil inDirectory:@"Resource Type Icons"];
+ if(iconPath)
+ icon = [[[NSImage alloc] initWithContentsOfFile:iconPath] autorelease];
+ }
+ }
- // try getting it myself
+ // try to load icon from the ResKnife app bundle itself
if(!icon)
{
- iconPath = [[NSBundle bundleForClass:editor] pathForResource:resourceType ofType:nil inDirectory:@"Resource Type Icons"];
+ iconPath = [[NSBundle mainBundle] pathForResource:resourceType ofType:nil inDirectory:@"Resource Type Icons"];
if(iconPath)
icon = [[[NSImage alloc] initWithContentsOfFile:iconPath] autorelease];
}
- }
-
- // try to load icon from the ResKnife app bundle itself
- if(!icon && resourceType)
- {
- iconPath = [[NSBundle mainBundle] pathForResource:resourceType ofType:nil inDirectory:@"Resource Type Icons"];
- if(iconPath)
- icon = [[[NSImage alloc] initWithContentsOfFile:iconPath] autorelease];
- }
-
- // try to retreive from file system (after first mangling the type through our converter strings file)
- if(!icon && resourceType)
- {
- NSString *fileType = [[NSBundle mainBundle] localizedStringForKey:resourceType value:@"" table:@"Resource Type Mappings"];
- NSRange range = [fileType rangeOfString:@"."];
- if(range.location == NSNotFound)
- icon = [[NSWorkspace sharedWorkspace] iconForFileType:fileType];
- else // a '.' character in a file type means ResKnife should look for a bundle icon with fileType as the bundle's identifier
+
+ // try to retrieve from file system using our resource type to file name extension/bundle identifier code
+ if(!icon)
{
- NSString *bundlePath = [[NSBundle bundleWithIdentifier:fileType] bundlePath];
- if(bundlePath)
- icon = [[NSWorkspace sharedWorkspace] iconForFile:bundlePath];
+ NSString *fileType = [[NSBundle mainBundle] localizedStringForKey:resourceType value:@"" table:@"Resource Type Mappings"];
+ NSRange range = [fileType rangeOfString:@"."];
+ if(range.location == NSNotFound)
+ icon = [[NSWorkspace sharedWorkspace] iconForFileType:fileType];
+ else // a '.' character in a file type means ResKnife should look for a bundle icon with fileType as the bundle's identifier
+ {
+ NSString *bundlePath = [[NSBundle bundleWithIdentifier:fileType] bundlePath];
+ if(bundlePath)
+ icon = [[NSWorkspace sharedWorkspace] iconForFile:bundlePath];
+ }
}
+
+ // TODO: convert to a UTI and try that
+
+ // try to retrieve from file system as an OSType code
+ if(!icon)
+ icon = [[NSWorkspace sharedWorkspace] iconForFileType:[NSString stringWithFormat:@"'%@'", resourceType]];
+
+ // save the newly retrieved icon in the cache
+ if(icon)
+ [[self _icons] setObject:icon forKey:resourceType];
}
-
- // if we still don't have an icon, try to get the generic one - this is what icon represented forks get
- if(!icon)
- icon = [[NSWorkspace sharedWorkspace] iconForFileType:@"????"];
-
- // save the newly retreived icon in the cache
- if(icon && resourceType)
- [[self _icons] setObject:icon forKey:resourceType];
+ }
+ else
+ {
+ // we have no resource type, try to get a generic icon - this is what icon represented forks get
+// if(!icon) icon = [NSImage imageNamed:@"NSMysteryDocument"];
+// if(!icon) icon = [[NSWorkspace sharedWorkspace] iconForFileType:@"' '"];
+ if(!icon) icon = [[NSWorkspace sharedWorkspace] iconForFileType:[NSString stringWithFormat:@"'%@'", @"????"]];
}
// return the cached icon, or nil if none was found
View
14 Cocoa/Classes/InfoWindowController.m
@@ -36,9 +36,9 @@ - (void)windowDidLoad
/*!
@method updateInfoWindow
-@change 2003-11-06 NS: Fixed creator/type handling.
-@change 2003-10-26 NS: Now asks app delegate for icon instead of NSWorkspace.
-@change 2003-10-26 NS: Improved document name & icon display.
+@updated 2003-11-06 NGS: Fixed creator/type handling.
+@updated 2003-10-26 NGS: Now asks app delegate for icon instead of NSWorkspace.
+@updated 2003-10-26 NGS: Improved document name & icon display.
*/
- (void)updateInfoWindow
@@ -48,6 +48,8 @@ - (void)updateInfoWindow
if(selectedResource)
{
+ NSLog(@"selected resource data: %@", [selectedResource data]);
+
// set UI values
[[self window] setTitle:NSLocalizedString(@"Resource Info",nil)];
[nameView setStringValue:[selectedResource name]];
@@ -86,8 +88,8 @@ - (void)updateInfoWindow
[iconView setImage:[NSImage imageNamed:@"Resource file"]];
[nameView setStringValue:[currentDocument displayName]];
}
- [currentDocument creator];
- [[NSString alloc] initWithData:[currentDocument creator] encoding:NSMacOSRomanStringEncoding];
+
+ #warning FIXME: the creator and type codes need to be swapped on intel
[[filePropertyForm cellAtIndex:0] setStringValue:[[[NSString alloc] initWithData:[currentDocument creator] encoding:NSMacOSRomanStringEncoding] autorelease]];
[[filePropertyForm cellAtIndex:1] setStringValue:[[[NSString alloc] initWithData:[currentDocument type] encoding:NSMacOSRomanStringEncoding] autorelease]];
// [[filePropertyForm cellAtIndex:2] setObjectValue:[NSNumber numberWithUnsignedLongLong:dataLogicalSize]];
@@ -101,7 +103,7 @@ - (void)updateInfoWindow
else
{
[iconView setImage:nil];
- [nameView setStringValue:nil];
+ [nameView setStringValue:@""];
[placeholderView setContentView:nil];
}
}
View
46 Cocoa/Classes/ResourceDocument.mm
@@ -250,13 +250,12 @@ -(BOOL)readResourceMap:(SInt16)fileRefNum
for(unsigned short i = 1; i <= Count1Types(); i++)
{
- ResType resType;
- Get1IndType(&resType, i);
- ResType swappedType = EndianS32_NtoB(resType); // Swapped type for use as string (types are treated as numbers by the resource manager and swapped on Intel).
- unsigned short n = Count1Resources(resType);
+ ResType resTypeCode;
+ Get1IndType(&resTypeCode, i);
+ unsigned short n = Count1Resources(resTypeCode);
for(unsigned short j = 1; j <= n; j++)
{
- Handle resourceHandle = Get1IndResource(resType, j);
+ Handle resourceHandle = Get1IndResource(resTypeCode, j);
error = ResError();
if(error != noErr)
{
@@ -267,21 +266,33 @@ -(BOOL)readResourceMap:(SInt16)fileRefNum
Str255 nameStr;
short resIDShort;
- GetResInfo(resourceHandle, &resIDShort, &resType, nameStr);
- long sizeLong = GetResourceSizeOnDisk(resourceHandle);
+ GetResInfo(resourceHandle, &resIDShort, &resTypeCode, nameStr);
+ long sizeLong = GetResourceSizeOnDisk(resourceHandle), badSize = 0;
+ if (sizeLong < 0 || sizeLong > 16777215) // the max size of resource manager file is ~12 MB; I am rounding up to three bytes
+ {
+ // this only happens when opening ResEdit using the x86 binary (not under Rosetta, for example)
+ badSize = sizeLong;
+ sizeLong = EndianS32_BtoL(sizeLong);
+ }
short attrsShort = GetResAttrs(resourceHandle);
HLockHi(resourceHandle);
+#if __LITTLE_ENDIAN__
+ CoreEndianFlipData(kCoreEndianResourceManagerDomain, resTypeCode, resIDShort, *resourceHandle, sizeLong, true);
+#endif
// cool: "The advantage of obtaining a methodÕs implementation and calling it as a function is that you can invoke the implementation multiple times within a loop, or similar C construct, without the overhead of Objective-C messaging."
// create the resource & add it to the array
+ ResType logicalType = EndianS32_NtoB(resTypeCode); // swapped type for use as string (types are treated as numbers by the resource manager and swapped on Intel).
NSString *name = [[NSString alloc] initWithBytes:&nameStr[1] length:nameStr[0] encoding:NSMacOSRomanStringEncoding];
- NSString *resType = [[NSString alloc] initWithBytes:(char *) &swappedType length:4 encoding:NSMacOSRomanStringEncoding];
+ NSString *resType = [[NSString alloc] initWithBytes:(char *) &logicalType 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:resType andID:resID withName:name andAttributes:attributes data:data];
[resources addObject:resource]; // array retains resource
+ if (badSize != 0)
+ NSLog(@"GetResourceSizeOnDisk() reported incorrect size for %@ resource %@ in %@: %li should be %li", resType, resID, [self displayName], badSize, sizeLong);
[name release];
[resType release];
@@ -296,8 +307,8 @@ -(BOOL)readResourceMap:(SInt16)fileRefNum
}
/*!
-@pending Uli's changed this routine - see what I had and unify the two
-@pending Doesn't write correct type/creator info - always ResKnife's!
+@pending Uli has changed this routine - see what I had and unify the two
+@pending Doesn't write correct type/creator info - always ResKnife's!
*/
- (BOOL)writeToFile:(NSString *)fileName ofType:(NSString *)type
@@ -406,32 +417,39 @@ - (BOOL)writeResourceMap:(SInt16)fileRefNum
while(Resource *resource = [enumerator nextObject])
{
Str255 nameStr;
- char resType[5]; // includes null char for getCString:
+ ResType resTypeCode;
+ char resTypeStr[5]; // includes null char for getCString:
short resIDShort;
short attrsShort;
+ long sizeLong;
Handle resourceHandle;
// if the resource represents another fork in the file, skip it
if([resource representedFork] != nil) continue;
+ sizeLong = [[resource data] length];
resIDShort = [[resource resID] shortValue];
attrsShort = [[resource attributes] shortValue];
- resourceHandle = NewHandleClear([[resource data] length]);
+ resourceHandle = NewHandleClear(sizeLong);
// convert unicode name to pascal string
nameStr[0] = [[resource name] lengthOfBytesUsingEncoding:NSMacOSRomanStringEncoding];
BlockMoveData([[resource name] cStringUsingEncoding:NSMacOSRomanStringEncoding], &nameStr[1], nameStr[0]);
// convert type string to ResType
- [[resource type] getCString:resType maxLength:4];
+ [[resource type] getCString:resTypeStr maxLength:4];
+ resTypeCode = CFSwapInt32HostToBig(*(ResType *)resTypeStr);
// convert NSData to resource handle
HLockHi(resourceHandle);
[[resource data] getBytes:*resourceHandle];
+#if __LITTLE_ENDIAN__
+ CoreEndianFlipData(kCoreEndianResourceManagerDomain, resTypeCode, resIDShort, *resourceHandle, sizeLong, false);
+#endif
HUnlock(resourceHandle);
// now that everything's converted, tell the resource manager we want to create this resource
- AddResource(resourceHandle, *(ResType *)resType, resIDShort, nameStr);
+ AddResource(resourceHandle, resTypeCode, resIDShort, nameStr);
if(ResError() == addResFailed)
{
NSLog(@"*Saving failed*; could not add resource ID %@ of type %@ to file.", [resource resID], [resource type]);
View
BIN Cocoa/English.lproj/InfoPlist.strings
Binary file not shown.
View
30 Cocoa/Info.plist
@@ -10,42 +10,24 @@
<key>CFBundleTypeExtensions</key>
<array>
<string>rsrc</string>
+ <string>*</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>Resource file.icns</string>
<key>CFBundleTypeName</key>
- <string>com.apple.resource-map</string>
+ <string>ResourceMap</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>rsrc</string>
<string>RSRC</string>
- </array>
- <key>CFBundleTypeRole</key>
- <string>Editor</string>
- <key>LSItemContentTypes</key>
- <array>
- <string>com.apple.resource-map</string>
- </array>
- <key>NSDocumentClass</key>
- <string>ResourceDocument</string>
- </dict>
- <dict>
- <key>CFBundleTypeExtensions</key>
- <array>
- <string>*</string>
- </array>
- <key>CFBundleTypeOSTypes</key>
- <array>
- <string>****</string>
<string>????</string>
+ <string>****</string>
</array>
- <key>CFBundleTypeName</key>
- <string>public.data</string>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
- <string>public.data</string>
+ <string>com.apple.resource-map</string>
</array>
<key>NSDocumentClass</key>
<string>ResourceDocument</string>
@@ -66,11 +48,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>0.6 beta 4</string>
+ <string>0.6 cvs</string>
<key>CFBundleSignature</key>
<string>ResK</string>
<key>CFBundleVersion</key>
- <string>18</string>
+ <string>19</string>
<key>NSAppleScriptEnabled</key>
<true/>
<key>NSMainNibFile</key>
View
2 Cocoa/Plug-Ins/Hex Editor/HexWindowController.mm
@@ -143,7 +143,7 @@ - (BOOL)windowShouldClose:(id)sender
{
if([[self window] isDocumentEdited])
{
- NSBeginAlertSheet(@"Do you want to keep the changes you made to this resource?", @"Keep", @"DonÕt Keep", @"Cancel", sender, self, @selector(saveSheetDidClose:returnCode:contextInfo:), nil, nil, @"Your changes cannot be saved later if you don't keep them.");
+ NSBeginAlertSheet(@"Do you want to keep the changes you made to this resource?", @"Keep", @"Don't Keep", @"Cancel", sender, self, @selector(saveSheetDidClose:returnCode:contextInfo:), nil, nil, @"Your changes cannot be saved later if you don't keep them.");
return NO;
}
else return YES;
View
6 Cocoa/Plug-Ins/ResKnifePluginProtocol.h
@@ -78,4 +78,10 @@
+ (NSString *)filenameExtensionForFileExport:(id <ResKnifeResourceProtocol>)resource;
+/*!
+@@method iconForResourceType:
+@abstract Returns the icon to be used throughout the UI for any given resource type.
+*/
+- (NSImage *)iconForResourceType:(NSString *)resourceType;
+
@end
View
4 Cocoa/Plug-Ins/ResKnifeResourceProtocol.h
@@ -41,7 +41,7 @@
- (void)setData:(NSData *)newData;
- (NSString *)defaultWindowTitle;
-- (NSDocument *)document;
+- (NSDocument *)document; // Owner of this resource. Useful for looking for resources in same file as yours.
// These methods are used to retrieve resources other than the one you're editing.
// Passing a document of nil will indicate to search in all open documents.
@@ -56,6 +56,8 @@
@end
+
+// See note in Notifications.m about usage of these
extern NSString *ResourceWillChangeNotification;
extern NSString *ResourceNameWillChangeNotification;
extern NSString *ResourceTypeWillChangeNotification;
View
8 Cocoa/Plug-Ins/Template Editor/ElementDBYT.m
@@ -1,5 +1,7 @@
#import "ElementDBYT.h"
+#define SIZE_ON_DISK (1)
+
@implementation ElementDBYT
- (id)copyWithZone:(NSZone *)zone
@@ -11,17 +13,17 @@ - (id)copyWithZone:(NSZone *)zone
- (void)readDataFrom:(TemplateStream *)stream
{
- [stream readAmount:sizeof(value) toBuffer:&value];
+ [stream readAmount:SIZE_ON_DISK toBuffer:&value];
}
- (unsigned int)sizeOnDisk
{
- return sizeof(value);
+ return SIZE_ON_DISK;
}
- (void)writeDataTo:(TemplateStream *)stream
{
- [stream writeAmount:sizeof(value) fromBuffer:&value];
+ [stream writeAmount:SIZE_ON_DISK fromBuffer:&value];
}
- (void)setValue:(SInt8)v
View
11 Cocoa/Plug-Ins/Template Editor/ElementDLLG.m
@@ -1,5 +1,7 @@
#import "ElementDLLG.h"
+#define SIZE_ON_DISK (8)
+
@implementation ElementDLLG
- (id)copyWithZone:(NSZone*)zone
@@ -11,17 +13,20 @@ - (id)copyWithZone:(NSZone*)zone
- (void)readDataFrom:(TemplateStream *)stream
{
- [stream readAmount:sizeof(value) toBuffer:&value];
+ SInt64 tmp;
+ [stream readAmount:SIZE_ON_DISK toBuffer:&tmp];
+ value = CFSwapInt64BigToHost(tmp);
}
- (unsigned int)sizeOnDisk
{
- return sizeof(value);
+ return SIZE_ON_DISK;
}
- (void)writeDataTo:(TemplateStream *)stream
{
- [stream writeAmount:sizeof(value) fromBuffer:&value];
+ SInt64 tmp = CFSwapInt64HostToBig(value);
+ [stream writeAmount:SIZE_ON_DISK fromBuffer:&tmp];
}
- (void)setValue:(SInt64)v
View
11 Cocoa/Plug-Ins/Template Editor/ElementDLNG.m
@@ -1,5 +1,7 @@
#import "ElementDLNG.h"
+#define SIZE_ON_DISK (4)
+
@implementation ElementDLNG
- (id)copyWithZone:(NSZone *)zone
@@ -11,17 +13,20 @@ - (id)copyWithZone:(NSZone *)zone
- (void)readDataFrom:(TemplateStream *)stream
{
- [stream readAmount:sizeof(value) toBuffer:&value];
+ SInt32 tmp;
+ [stream readAmount:SIZE_ON_DISK toBuffer:&tmp];
+ value = CFSwapInt32BigToHost(tmp);
}
- (unsigned int)sizeOnDisk
{
- return sizeof(value);
+ return SIZE_ON_DISK;
}
- (void)writeDataTo:(TemplateStream *)stream
{
- [stream writeAmount:sizeof(value) fromBuffer:&value];
+ SInt32 tmp = CFSwapInt32HostToBig(value);
+ [stream writeAmount:SIZE_ON_DISK fromBuffer:&tmp];
}
- (void)setValue:(SInt32)v
View
11 Cocoa/Plug-Ins/Template Editor/ElementDWRD.m
@@ -1,5 +1,7 @@
#import "ElementDWRD.h"
+#define SIZE_ON_DISK (2)
+
@implementation ElementDWRD
- (id)copyWithZone:(NSZone *)zone
@@ -11,17 +13,20 @@ - (id)copyWithZone:(NSZone *)zone
- (void)readDataFrom:(TemplateStream *)stream
{
- [stream readAmount:sizeof(value) toBuffer:&value];
+ SInt16 tmp;
+ [stream readAmount:SIZE_ON_DISK toBuffer:&tmp];
+ value = CFSwapInt16BigToHost(tmp);
}
- (unsigned int)sizeOnDisk
{
- return sizeof(value);
+ return SIZE_ON_DISK;
}
- (void)writeDataTo:(TemplateStream *)stream
{
- [stream writeAmount:sizeof(value) fromBuffer:&value];
+ SInt16 tmp = CFSwapInt16HostToBig(value);
+ [stream writeAmount:SIZE_ON_DISK fromBuffer:&tmp];
}
- (void)setValue:(SInt16)v
View
8 Cocoa/Plug-Ins/Template Editor/ElementOCNT.m
@@ -19,6 +19,7 @@ - (void)readDataFrom:(TemplateStream *)stream
if ([type isEqualToString:@"LCNT"] || [type isEqualToString:@"LZCT"]) [stream readAmount:4 toBuffer:&value];
else if([type isEqualToString:@"BCNT"] || [type isEqualToString:@"BZCT"]) [stream readAmount:1 toBuffer:(char *)(&value)+3];
else [stream readAmount:2 toBuffer:(short *)(&value)+1];
+ value = CFSwapInt32BigToHost(value);
if([self countFromZero]) value += 1;
}
@@ -32,9 +33,10 @@ - (unsigned int)sizeOnDisk
- (void)writeDataTo:(TemplateStream *)stream
{
if([self countFromZero]) value -= 1;
- if ([type isEqualToString:@"LCNT"] || [type isEqualToString:@"LZCT"]) [stream writeAmount:4 fromBuffer:&value];
- else if([type isEqualToString:@"BCNT"] || [type isEqualToString:@"BZCT"]) [stream writeAmount:1 fromBuffer:(char *)(&value)+3];
- else [stream writeAmount:2 fromBuffer:(short *)(&value)+1];
+ unsigned long tmp = CFSwapInt32HostToBig(value);
+ if ([type isEqualToString:@"LCNT"] || [type isEqualToString:@"LZCT"]) [stream writeAmount:4 fromBuffer:&tmp];
+ else if([type isEqualToString:@"BCNT"] || [type isEqualToString:@"BZCT"]) [stream writeAmount:1 fromBuffer:(char *)(&tmp)+3];
+ else [stream writeAmount:2 fromBuffer:(short *)(&tmp)+1];
if([self countFromZero]) value += 1;
}
View
28 Cocoa/Plug-Ins/Template Editor/ElementPSTR.m
@@ -51,7 +51,11 @@ - (void)readDataFrom:(TemplateStream *)stream
if(_lengthBytes > 0)
{
[stream readAmount:_lengthBytes toBuffer:&length];
+#if __BIG_ENDIAN__
length >>= (4 - _lengthBytes) << 3;
+#else
+ #warning FIXME: This probably doesn't work for WSTR and LSTR on intel machines
+#endif
}
if(_terminatingByte)
length += [stream bytesToNull];
@@ -72,8 +76,8 @@ - (void)readDataFrom:(TemplateStream *)stream
// skip over empty bytes
if(_terminatingByte) [stream advanceAmount:1 pad:NO];
- if(_pad == kPadToOddLength && (length + _lengthBytes) % 2 == 0) [stream advanceAmount:1 pad:NO];
- if(_pad == kPadToEvenLength && (length + _lengthBytes) % 2 == 1) [stream advanceAmount:1 pad:NO];
+ if(_pad == kPadToOddLength && (length + _terminatingByte ? 1:0) % 2 == 0) [stream advanceAmount:1 pad:NO];
+ if(_pad == kPadToEvenLength && (length + _terminatingByte ? 1:0) % 2 == 1) [stream advanceAmount:1 pad:NO];
// alignment unhandled here
}
@@ -97,22 +101,30 @@ - (void)writeDataTo:(TemplateStream *)stream
// write string
UInt32 length = [value length], writeLength;
if(_maxLength && length > _maxLength) length = _maxLength;
+#if __BIG_ENDIAN__
writeLength = length << ((4 - _lengthBytes) << 3);
+#else
+ #warning FIXME: This probably doesn't work for WSTR and LSTR on intel machines
+#endif
if(_lengthBytes)
[stream writeAmount:_lengthBytes fromBuffer:&writeLength];
- #warning FIXME: This code should display a warning saying that the string in the PSTR is not MacOSRoman
- if([value respondsToSelector:@selector(cStringUsingEncoding:)])
+ if ([value canBeConvertedToEncoding:NSMacOSRomanStringEncoding])
{
- const void *buffer = [value cStringUsingEncoding:NSMacOSRomanStringEncoding];
+ const void *buffer = NULL;
+ if([value respondsToSelector:@selector(cStringUsingEncoding:)]) // 10.4
+ buffer = [value cStringUsingEncoding:NSMacOSRomanStringEncoding];
+ else
+ {
+ NSData *data = [value dataUsingEncoding:NSMacOSRomanStringEncoding];
+ buffer = [data bytes];
+ }
if(buffer) [stream writeAmount:length fromBuffer:buffer];
else [stream advanceAmount:length pad:YES];
}
else
{
- const void *buffer = [value cString];
- if(buffer) [stream writeAmount:length fromBuffer:buffer];
- else [stream advanceAmount:length pad:YES];
+ #warning FIXME: This code should display a warning saying that the string in the PSTR is not MacOSRoman
}
// pad to minimum length with spaces
View
8 Cocoa/Plug-Ins/Template Editor/ElementUBYT.m
@@ -1,5 +1,7 @@
#import "ElementUBYT.h"
+#define SIZE_ON_DISK (1)
+
@implementation ElementUBYT
- (id)copyWithZone:(NSZone *)zone
@@ -11,17 +13,17 @@ - (id)copyWithZone:(NSZone *)zone
- (void)readDataFrom:(TemplateStream *)stream
{
- [stream readAmount:sizeof(value) toBuffer:&value];
+ [stream readAmount:SIZE_ON_DISK toBuffer:&value];
}
- (unsigned int)sizeOnDisk
{
- return sizeof(value);
+ return SIZE_ON_DISK;
}
- (void)writeDataTo:(TemplateStream *)stream
{
- [stream writeAmount:sizeof(value) fromBuffer:&value];
+ [stream writeAmount:SIZE_ON_DISK fromBuffer:&value];
}
- (void)setValue:(UInt8)v
View
11 Cocoa/Plug-Ins/Template Editor/ElementULLG.m
@@ -1,5 +1,7 @@
#import "ElementULLG.h"
+#define SIZE_ON_DISK (8)
+
@implementation ElementULLG
- (id)copyWithZone:(NSZone*)zone
@@ -11,17 +13,20 @@ - (id)copyWithZone:(NSZone*)zone
- (void)readDataFrom:(TemplateStream *)stream
{
- [stream readAmount:sizeof(value) toBuffer:&value];
+ UInt64 tmp;
+ [stream readAmount:SIZE_ON_DISK toBuffer:&tmp];
+ value = CFSwapInt64BigToHost(tmp);
}
- (unsigned int)sizeOnDisk
{
- return sizeof(value);
+ return SIZE_ON_DISK;
}
- (void)writeDataTo:(TemplateStream *)stream
{
- [stream writeAmount:sizeof(value) fromBuffer:&value];
+ UInt64 tmp = CFSwapInt64HostToBig(value);
+ [stream writeAmount:SIZE_ON_DISK fromBuffer:&tmp];
}
- (void)setValue:(UInt64)v
View
11 Cocoa/Plug-Ins/Template Editor/ElementULNG.m
@@ -1,5 +1,7 @@
#import "ElementULNG.h"
+#define SIZE_ON_DISK (4)
+
@implementation ElementULNG
- (id)copyWithZone:(NSZone *)zone
@@ -11,17 +13,20 @@ - (id)copyWithZone:(NSZone *)zone
- (void)readDataFrom:(TemplateStream *)stream
{
- [stream readAmount:sizeof(value) toBuffer:&value];
+ UInt32 tmp;
+ [stream readAmount:SIZE_ON_DISK toBuffer:&tmp];
+ value = CFSwapInt32BigToHost(tmp);
}
- (unsigned int)sizeOnDisk
{
- return sizeof(value);
+ return SIZE_ON_DISK;
}
- (void)writeDataTo:(TemplateStream *)stream
{
- [stream writeAmount:sizeof(value) fromBuffer:&value];
+ UInt32 tmp = CFSwapInt32HostToBig(value);
+ [stream writeAmount:SIZE_ON_DISK fromBuffer:&tmp];
}
- (void)setValue:(UInt32)v
View
11 Cocoa/Plug-Ins/Template Editor/ElementUWRD.m
@@ -1,5 +1,7 @@
#import "ElementUWRD.h"
+#define SIZE_ON_DISK (2)
+
@implementation ElementUWRD
- (id)copyWithZone:(NSZone *)zone
@@ -11,17 +13,20 @@ - (id)copyWithZone:(NSZone *)zone
- (void)readDataFrom:(TemplateStream *)stream
{
- [stream readAmount:sizeof(value) toBuffer:&value];
+ UInt16 tmp;
+ [stream readAmount:SIZE_ON_DISK toBuffer:&tmp];
+ value = CFSwapInt16BigToHost(tmp);
}
- (unsigned int)sizeOnDisk
{
- return sizeof(value);
+ return SIZE_ON_DISK;
}
- (void)writeDataTo:(TemplateStream *)stream
{
- [stream writeAmount:sizeof(value) fromBuffer:&value];
+ UInt16 tmp = CFSwapInt16HostToBig(value);
+ [stream writeAmount:SIZE_ON_DISK fromBuffer:&tmp];
}
- (void)setValue:(UInt16)v
View
9 Cocoa/Plug-Ins/Template Editor/English.lproj/Localizable.strings
@@ -5,7 +5,8 @@
"Error: Hex Dump" = "Error: Dumping Hex";
/* Keep changes dialog */
-"Do you want to keep the changes you made to this resource?" = "Do you want to keep the changes you made to this resource?";
-"Keep" = "Keep";
-"Don't Keep" = "Don’t Keep";
-"Your changes cannot be saved later if you don't keep them." = "Your changes cannot be saved later if you don’t keep them.";
+"KeepChangesDialogTitle" = "Do you want to keep the changes you made to this resource?";
+"KeepChangesDialogMessage" = "Your changes cannot be saved later if you don’t keep them.";
+"KeepChangesButton" = "Keep";
+"DiscardChangesButton" = "Discard";
+"CancelButton" = "Cancel";
View
4 Cocoa/Plug-Ins/Template Editor/Info.plist
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
@@ -15,7 +15,7 @@
<key>CFBundleSignature</key>
<string>ResK</string>
<key>CFBundleVersion</key>
- <string>3</string>
+ <string>4</string>
<key>NSPrincipalClass</key>
<string>TemplateWindowController</string>
<key>RKSupportedTypes</key>
View
6 Cocoa/Plug-Ins/Template Editor/TemplateStream.h
@@ -1,6 +1,6 @@
#import <Foundation/Foundation.h>
-@class Element;
+@class Element, ElementOCNT;
@interface TemplateStream : NSObject
{
char *data;
@@ -18,8 +18,8 @@
- (char *)data;
- (unsigned int)bytesToGo;
- (void)setBytesToGo:(unsigned int)b;
-- (Element *)counter;
-- (void)pushCounter:(Element *)c;
+- (ElementOCNT *)counter;
+- (void)pushCounter:(ElementOCNT *)c;
- (void)popCounter;
- (Element *)key;
- (void)pushKey:(Element *)k;
View
7 Cocoa/Plug-Ins/Template Editor/TemplateWindowController.m
@@ -126,7 +126,7 @@ - (void)loadResource
BOOL pushedCounter = NO;
BOOL pushedKey = NO;
if(cc == [ElementOCNT class])
- { [stream pushCounter:clone]; pushedCounter = YES; }
+ { [stream pushCounter:(ElementOCNT *)clone]; pushedCounter = YES; }
if(cc == [ElementKBYT class] ||
cc == [ElementKWRD class] ||
cc == [ElementKLNG class] )
@@ -156,7 +156,8 @@ - (BOOL)windowShouldClose:(id)sender
if([[self window] isDocumentEdited])
{
- NSBeginAlertSheet(NSLocalizedString(@"Do you want to keep the changes you made to this resource?", nil), NSLocalizedString(@"Keep", nil), NSLocalizedString(@"Don't Keep", nil), NSLocalizedString(@"Cancel", nil), sender, self, @selector(saveSheetDidClose:returnCode:contextInfo:), nil, nil, NSLocalizedString(@"Your changes cannot be saved later if you don't keep them.", nil));
+ NSBundle *bundle = [NSBundle bundleForClass:[self class]];
+ NSBeginAlertSheet(NSLocalizedStringFromTableInBundle(@"KeepChangesDialogTitle", nil, bundle, nil), NSLocalizedStringFromTableInBundle(@"KeepChangesButton", nil, bundle, nil), NSLocalizedStringFromTableInBundle(@"DiscardChangesButton", nil, bundle, nil), NSLocalizedStringFromTableInBundle(@"CancelButton", nil, bundle, nil), sender, self, @selector(saveSheetDidClose:returnCode:contextInfo:), nil, nil, NSLocalizedStringFromTableInBundle(@"KeepChangesDialogMessage", nil, bundle, nil));
return NO;
}
else return YES;
@@ -307,7 +308,7 @@ - (BOOL)outlineView:(NSOutlineView *)outlineView shouldEditTableColumn:(NSTableC
#pragma mark -
#pragma mark Menu Management
-// these next five methods are a crude hack - the items ought ot be in the responder chain themselves
+// these next five methods are a crude hack - the items ought to be in the responder chain themselves
- (IBAction)createListEntry:(id)sender;
{
// This works by selecting an item that serves as a template (another LSTB), or knows how to create an item (LSTE) and passing the message on to it.
View
2 Cocoa/Resources/ResKnife.scriptSuite
@@ -28,7 +28,7 @@
<dict>
<key>orderedDocuments</key>
<dict>
- <key>AppleEventCode<</key>
+ <key>AppleEventCode</key>
<string>docu</string>
<key>Type</key>
<string>ResourceDocument</string>
View
2 Hex Editor/Classes/Initalisation.cpp
@@ -1 +1 @@
-#include "Initalisation.h"
+#include "Initalisation.h"
View
2 PICT Editor/Classes/Initalisation.cpp
@@ -1 +1 @@
-#include "Initalisation.h"
+#include "Initalisation.h"
View
2 README.txt
@@ -72,7 +72,7 @@ ResKnife methods, functions, headers, classes, ivars and practically anything el
@abstract
@author
@created
- @change [reverse chronological, i.e. most recent at the top]
+ @updated [reverse chronological, i.e. most recent at the top]
...
@pending [higher priority TODO items should be above lower priority ones]
...
View
28 ResKnife.xcodeproj/project.pbxproj
@@ -7,7 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
- 0E85D4AC10A72953004240C0 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 3D2EE5E204E5C56F00515930 /* Localizable.strings */; };
+ 0EF71540122BD0D0005DF94E /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 0EF7153F122BD0D0005DF94E /* Localizable.strings */; };
E1193609099830D300A3A6EA /* FontDocument.nib in Resources */ = {isa = PBXBuildFile; fileRef = E1193607099830D200A3A6EA /* FontDocument.nib */; };
E119363A099833AE00A3A6EA /* Categories.h in Headers */ = {isa = PBXBuildFile; fileRef = E1193638099833AE00A3A6EA /* Categories.h */; };
E119363B099833AE00A3A6EA /* Categories.mm in Sources */ = {isa = PBXBuildFile; fileRef = E1193639099833AE00A3A6EA /* Categories.mm */; };
@@ -302,7 +302,7 @@
E18BF6AD069FEA1800F076B8 /* ElementOCNT.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D50046F04EF040900F3B64D /* ElementOCNT.h */; };
E18BF6AE069FEA1800F076B8 /* ElementLSTC.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D50047404EF122000F3B64D /* ElementLSTC.h */; };
E18BF6B0069FEA1800F076B8 /* TemplateWindow.nib in Resources */ = {isa = PBXBuildFile; fileRef = 3D0B38B504DEF465005AED5E /* TemplateWindow.nib */; };
- E18BF6B4069FEA1800F076B8 /* TemplateWindowController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 3D0B38B304DEF41E005AED5E /* TemplateWindowController.mm */; };
+ E18BF6B4069FEA1800F076B8 /* TemplateWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D0B38B304DEF41E005AED5E /* TemplateWindowController.m */; };
E18BF6B5069FEA1800F076B8 /* Notifications.m in Sources */ = {isa = PBXBuildFile; fileRef = F5C9ECCE027F474A01A8010C /* Notifications.m */; };
E18BF6B6069FEA1800F076B8 /* Element.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D0933A704DEFEE600DD74B1 /* Element.m */; };
E18BF6B8069FEA1800F076B8 /* TemplateStream.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D0933BF04DF151C00DD74B1 /* TemplateStream.m */; };
@@ -430,9 +430,9 @@
3D0ABFB904E152CA00C85300 /* Read Me.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "Read Me.txt"; sourceTree = "<group>"; };
3D0ABFBC04E172F700C85300 /* README.txt */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; path = README.txt; sourceTree = SOURCE_ROOT; };
3D0B38B204DEF41E005AED5E /* TemplateWindowController.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = TemplateWindowController.h; sourceTree = "<group>"; };
- 3D0B38B304DEF41E005AED5E /* TemplateWindowController.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = TemplateWindowController.mm; sourceTree = "<group>"; };
+ 3D0B38B304DEF41E005AED5E /* TemplateWindowController.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = TemplateWindowController.m; sourceTree = "<group>"; };
3D0B38B604DEF465005AED5E /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/TemplateWindow.nib; sourceTree = "<group>"; };
- 3D2EE5E204E5C56F00515930 /* Localizable.strings */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; path = Localizable.strings; sourceTree = "<group>"; };
+ 3D2EE5E204E5C56F00515930 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
3D35755A04DAEB4300B8225B /* main.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
3D35755C04DAEB6200B8225B /* RKEditorRegistry.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = RKEditorRegistry.h; sourceTree = "<group>"; };
3D35755D04DAEB6200B8225B /* RKEditorRegistry.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; path = RKEditorRegistry.m; sourceTree = "<group>"; };
@@ -607,7 +607,7 @@
F5B5883B0156D40B01000001 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/InfoWindow.nib; sourceTree = "<group>"; };
F5B5883F0156D40B01000001 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/PrefsWindow.nib; sourceTree = "<group>"; };
F5B588410156D40B01000001 /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = English.lproj/ResourceDocument.nib; sourceTree = "<group>"; };
- F5B588430156D40B01000001 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ F5B588430156D40B01000001 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
F5B588450156D40B01000001 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; lineEnding = 0; name = English; path = English.lproj/Localizable.strings; sourceTree = "<group>"; };
F5B588460156D40B01000001 /* ResKnife.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = ResKnife.icns; sourceTree = "<group>"; };
F5B588470156D40B01000001 /* Resource file.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = "Resource file.icns"; sourceTree = "<group>"; };
@@ -881,7 +881,7 @@
children = (
3D0ABFB904E152CA00C85300 /* Read Me.txt */,
3D0B38B204DEF41E005AED5E /* TemplateWindowController.h */,
- 3D0B38B304DEF41E005AED5E /* TemplateWindowController.mm */,
+ 3D0B38B304DEF41E005AED5E /* TemplateWindowController.m */,
3D0933BE04DF151C00DD74B1 /* TemplateStream.h */,
3D0933BF04DF151C00DD74B1 /* TemplateStream.m */,
3D0933A604DEFEE600DD74B1 /* Element.h */,
@@ -890,7 +890,7 @@
E1A984F7099C2D7F00A70612 /* Resources */,
E11937F309991C1100A3A6EA /* Support Resources */,
E18BFA3606A20B7A00F076B8 /* Info.plist */,
- 3D2EE5E204E5C56F00515930 /* Localizable.strings */,
+ 0EF7153F122BD0D0005DF94E /* Localizable.strings */,
);
path = "Template Editor";
sourceTree = "<group>";
@@ -2046,7 +2046,7 @@
files = (
E18BF6B0069FEA1800F076B8 /* TemplateWindow.nib in Resources */,
E1A984FE099C309400A70612 /* DisplayTMPL.png in Resources */,
- 0E85D4AC10A72953004240C0 /* Localizable.strings in Resources */,
+ 0EF71540122BD0D0005DF94E /* Localizable.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@@ -2326,7 +2326,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
- E18BF6B4069FEA1800F076B8 /* TemplateWindowController.mm in Sources */,
+ E18BF6B4069FEA1800F076B8 /* TemplateWindowController.m in Sources */,
E18BF6B5069FEA1800F076B8 /* Notifications.m in Sources */,
E18BF6B6069FEA1800F076B8 /* Element.m in Sources */,
E18BF6B8069FEA1800F076B8 /* TemplateStream.m in Sources */,
@@ -2383,6 +2383,14 @@
/* End PBXTargetDependency section */
/* Begin PBXVariantGroup section */
+ 0EF7153F122BD0D0005DF94E /* Localizable.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 3D2EE5E204E5C56F00515930 /* English */,
+ );
+ name = Localizable.strings;
+ sourceTree = "<group>";
+ };
3D0B38B504DEF465005AED5E /* TemplateWindow.nib */ = {
isa = PBXVariantGroup;
children = (
@@ -3300,6 +3308,8 @@
E13F7F0708F0411100E2A5CB /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
+ ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
+ ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
GCC_VERSION = 4.0;
SDKROOT = /Developer/SDKs/MacOSX10.4u.sdk;
};
View
9 TODO.txt
@@ -6,3 +6,12 @@ Auto-uncollapse list items in template editor when they are created and when a r
Add preference to "Show Resource Fork even if empty."
Add viewers for MooV and PICT.
Modify -[Resource data] and -[Resource setData] to use ResourceManager functions behind the scenes instead of an NSData object. This should fix the problem with new resources not being saved at times.
+
+
+// some old to-dos. don't know if these still apply
+
+-> "Open as Hex" displays "(null)" as the document name. Why?
+-> Changing the type/creator of a file isn't written to disk by ResourceDocument.
+-> Create small versions of the doc icons in Photoshop instead of letting IconComposer use its cheap scaling on them.
+-> Auto-uncollapse list items in template editor when they are created and when a resource is opened.
+-> Template editor should maintain "dirty" flag for resource.

0 comments on commit e1f6dcd

Please sign in to comment.