+@interface NSString (WinterBoard)
+- (NSString *) wb_themedPath;
+@end
+
+@implementation NSString (WinterBoard)
+
+- (NSString *) wb_themedPath {
+ NSLog(@"WB:Debug:Bypass(\"%@\")", self);
+ return self;
+}
+
+@end
+
+static NSMutableDictionary *Files_;
+
+#define WBDelegate(delegate) \
+ - (NSMethodSignature*) methodSignatureForSelector:(SEL)sel { \
+ if (Engineer_) \
+ NSLog(@"WB:MS:%s:(%s)", class_getName([self class]), sel_getName(sel)); \
+ if (NSMethodSignature *sig = [delegate methodSignatureForSelector:sel]) \
+ return sig; \
+ NSLog(@"WB:Error: [%s methodSignatureForSelector:(%s)]", class_getName([self class]), sel_getName(sel)); \
+ return nil; \
+ } \
+\
+ - (void) forwardInvocation:(NSInvocation*)inv { \
+ SEL sel = [inv selector]; \
+ if ([delegate respondsToSelector:sel]) \
+ [inv invokeWithTarget:delegate]; \
+ else \
+ NSLog(@"WB:Error: [%s forwardInvocation:(%s)]", class_getName([self class]), sel_getName(sel)); \
+ }
+
+/*@interface WBBundlePath : NSProxy {
+ NSBundle<WinterBoard> *bundle_;
+ NSString *path_;
+}
+
+- (id) initWithBundle:(NSBundle *)bundle path:(NSString *)path;
+
+- (NSString *) wb_themedPath;
+
+@end
+
+@implementation WBBundlePath
+
+- (void) dealloc {
+ [bundle_ release];
+ [path_ release];
+ [super dealloc];
+}
+
+- (id) initWithBundle:(NSBundle *)bundle path:(NSString *)path {
+ bundle_ = [bundle retain];
+ path_ = [path retain];
+ return self;
+}
+
+WBDelegate(path_)
+
+- (NSString *) stringByAppendingPathComponent:(NSString *)component {
+ NSLog(@"WB:Debug:app:%@:%@", path_, component);
+ return [[[WBBundlePath alloc] initWithBundle:bundle_ path:[path_ stringByAppendingPathComponent:component]] autorelease];
+}
+
+- (NSString *) stringByAppendingPathExtension:(NSString *)extension {
+ return [[[WBBundlePath alloc] initWithBundle:bundle_ path:[path_ stringByAppendingPathExtension:extension]] autorelease];
+}
+
+- (const char *) UTF8String {
+ const char *string = [path_ UTF8String];
+ NSLog(@"WB:Debug:UTF=%s", string);
+ return string;
+}
+
+- (NSString *) description {
+ return [path_ description];
+}
+
+- (NSString *) wb_themedPath {
+ return path_;
+ NSString *path = [Files_ objectForKey:path_];
+ if (path == nil) {
+ NSString *path = [bundle_ wb_bundlePath];
+ if (![path_ hasPrefix:path]) {
+ NSLog(@"WB:Error:![@\"%@\" hasPrefix:@\"%@\"]", path_, path);
+ return path_;
+ }
+ path = [path_ substringFromIndex:([path length] + 1)];
+ path = $pathForFile$inBundle$(path, bundle_, false);
+ if (path == nil)
+ path = reinterpret_cast<NSString *>([NSNull null]);
+ [Files_ setObject:path forKey:path_];
+ if (Debug_)
+ NSLog(@"WB:Debug:ThemePath(\"%@\")->\"%@\"", path_, path);
+ }
+ if (reinterpret_cast<id>(path) == [NSNull null])
+ path = path_;
+ NSLog(@"WB:Debug:ThemePath=%@", path);
+ return path;
+}
+
+@end*/
+
+static NSString *NSBundle$bundlePath$(NSBundle<WinterBoard> *self, SEL sel) {
+ //return [[WBBundlePath alloc] initWithBundle:self path:[self wb_bundlePath]];
+ return [self wb_bundlePath];
+}
+