}
// }}}
// $pathForFile$inBundle$() {{{
-static NSString *$pathForFile$inBundle$(NSString *file, NSString *identifier, NSString *folder, bool ui, bool use) {
+static NSString *$pathForFile$inBundle$(NSString *file, NSString *identifier, NSString *folder, bool use) {
NSMutableArray *names = [NSMutableArray arrayWithCapacity:8];
if (identifier != nil)
if ([base hasSuffix:@"~ipad"])
[names addObject:[NSString stringWithFormat:@"Folders/%@.%@/%@", [base substringWithRange:NSMakeRange(0, [base length] - 5)], [folder pathExtension], file]];
}
- if (ui)
- [names addObject:[NSString stringWithFormat:@"UIImages/%@", file]];
#define remapResourceName(oldname, newname) \
else if ([file isEqualToString:(oldname)]) \
bool summer(SpringBoard_ && SummerBoard_);
if (identifier == nil);
+ else if ([identifier isEqualToString:@"com.apple.UIKit"])
+ [names addObject:[NSString stringWithFormat:@"UIImages/%@", file]];
else if ([identifier isEqualToString:@"com.apple.chatkit"])
[names addObject:[NSString stringWithFormat:@"Bundles/com.apple.MobileSMS/%@", file]];
else if ([identifier isEqualToString:@"com.apple.calculator"])
return nil;
}
-static NSString *$pathForFile$inBundle$(NSString *file, NSBundle *bundle, bool ui, bool use) {
- return $pathForFile$inBundle$(file, [bundle bundleIdentifier], [[bundle bundlePath] lastPathComponent], ui, use);
+static NSString *$pathForFile$inBundle$(NSString *file, NSBundle *bundle, bool use) {
+ return $pathForFile$inBundle$(file, [bundle bundleIdentifier], [[bundle bundlePath] lastPathComponent], use);
}
// }}}
if ([file hasPrefix:prefix]) {
NSUInteger length([prefix length]);
if (length != [file length])
- if (NSString *path = $pathForFile$inBundle$([file substringFromIndex:(length + 1)], bundle, false, false))
+ if (NSString *path = $pathForFile$inBundle$([file substringFromIndex:(length + 1)], bundle, false))
return path;
}
}
NSBundle *bundle = [NSBundle mainBundle];
if (Debug_)
NSLog(@"WB:Debug: _UIApplicationImageWithName(\"%@\", %@)", name, bundle);
- if (NSString *path = $pathForFile$inBundle$(name, bundle, false, false))
+ if (NSString *path = $pathForFile$inBundle$(name, bundle, false))
return CachedImageAtPath(path);
return __UIApplicationImageWithName(name);
}
return MSOldCall(resource, type);
if (Debug_)
NSLog(@"WB:Debug: [NSBundle(%@) pathForResource:\"%@\"]", [self bundleIdentifier], file);
- if (NSString *path = $pathForFile$inBundle$(file, self, false, false))
+ if (NSString *path = $pathForFile$inBundle$(file, self, false))
return path;
return MSOldCall(resource, type);
}
return value;
} else if (NSString *path = $pathForFile$inBundle$([NSString stringWithFormat:@"%@.lproj/%@.strings",
language, file
- ], self, false, false)) {
+ ], self, false)) {
if ((strings = [[NSDictionary alloc] initWithContentsOfFile:path]) != nil) {
[Strings_ setObject:[strings autorelease] forKey:name];
goto strings;
static UIImage *WBCacheUIImage(const Original_ &original, NSString *name, NSString *key) {
if ([name rangeOfString:@"."].location == NSNotFound)
name = [name stringByAppendingString:@".png"];
- UIImage *image(WBCacheImage(original, [=](){ return $pathForFile$inBundle$(name, _UIKitBundle(), true, true); }, key));
+ UIImage *image(WBCacheImage(original, [=](){ return $pathForFile$inBundle$(name, _UIKitBundle(), true); }, key));
if (image != nil && UIDebug_) {
NSString *path([@"/tmp/UIImages/" stringByAppendingString:name]);
if (![Manager_ fileExistsAtPath:path])
NSEnumerator *enumerator([*names keyEnumerator]);
while (NSString *name = [enumerator nextObject]) {
NSString *png([name stringByAppendingString:@".png"]);
- if (NSString *themed = $pathForFile$inBundle$(png, bundle, false, true)) {
+ if (NSString *themed = $pathForFile$inBundle$(png, bundle, true)) {
NSUInteger index([[*names objectForKey:name] intValue]);
UIImage *image($getImage$(themed));
CGImageRef cg([image CGImage]);