From 44aa4549a259e95f894c9af75e49fbcc4d17090c Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 4 Jun 2009 06:18:11 +0000 Subject: [PATCH] Various fixes for 2.x and BigBoss. --- Library.mm | 35 +++++++++++++++++++++++------------ control | 2 +- 2 files changed, 24 insertions(+), 13 deletions(-) diff --git a/Library.mm b/Library.mm index 9242b67..35500a9 100644 --- a/Library.mm +++ b/Library.mm @@ -280,7 +280,6 @@ static NSString *$pathForIcon$(SBApplication *self) { path = [path stringByDeletingLastPathComponent]; if (path == nil || [path length] == 0 || [path isEqualToString:@"/"]) return nil; - return [NSBundle mainBundle]; NSBundle *bundle([Bundles_ objectForKey:path]); if (reinterpret_cast(bundle) == [NSNull null]) @@ -292,7 +291,7 @@ static NSString *$pathForIcon$(SBApplication *self) { bundle = [NSBundle wb$bundleWithFile:path]; if (Debug_) NSLog(@"WB:Debug:PathBundle(%@, %@)", path, bundle); - //[Bundles_ setObject:(bundle == nil ? [NSNull null] : reinterpret_cast(bundle)) forKey:path]; + [Bundles_ setObject:(bundle == nil ? [NSNull null] : reinterpret_cast(bundle)) forKey:path]; } return bundle; @@ -311,7 +310,6 @@ static NSString *$pathForIcon$(SBApplication *self) { NSLog(@"WB:Debug:Bypass(\"%@\")", self); if (NSBundle *bundle = [NSBundle wb$bundleWithFile:self]) { - return self; NSString *file([self stringByResolvingSymlinksInPath]); NSString *prefix([[bundle bundlePath] stringByResolvingSymlinksInPath]); if ([file hasPrefix:prefix]) { @@ -417,7 +415,7 @@ static UIImage *CachedImageAtPath(NSString *path) { MSHook(CGImageRef, _UIImageRefAtPath, NSString *name, bool cache, UIImageOrientation *orientation) { if (Debug_) NSLog(@"WB:Debug: _UIImageRefAtPath(\"%@\", %s)", name, cache ? "true" : "false"); - return __UIImageRefAtPath(([name wb$themedPath], name), cache, orientation); + return __UIImageRefAtPath([name wb$themedPath], cache, orientation); } /*MSHook(UIImage *, _UIImageAtPath, NSString *name, NSBundle *bundle) { @@ -501,7 +499,7 @@ MSHook(void, SBCalendarIconContentsView$drawRect$, SBCalendarIconContentsView *s CFDateFormatterSetFormat(formatter, (CFStringRef) [bundle localizedStringForKey:@"CALENDAR_ICON_DAY_NUMBER_FORMAT" value:@"" table:@"SpringBoard"]); CFStringRef date(CFDateFormatterCreateStringWithDate(NULL, formatter, now)); - CFDateFormatterSetFormat(formatter, (CFStringRef) [bundle localizedStringForKey:@"CALENDAR_ICON_DAY_NAME_FORMAT" value:@"" table:@"SpringBoard"]); + CFDateFormatterSetFormat(formatter, (CFStringRef) [bundle localizedStringForKey:@"CALENDAR_ICON_DAY_NAME_FORMAT" value:@"cccc" table:@"SpringBoard"]); CFStringRef day(CFDateFormatterCreateStringWithDate(NULL, formatter, now)); CFRelease(now); @@ -627,12 +625,21 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) { return nil; UIWindow *&_window(MSHookIvar(self, "_window")); + UIView *&_contentLayer(MSHookIvar(self, "_contentLayer")); UIView *&_contentView(MSHookIvar(self, "_contentView")); - UIView *content([[[UIView alloc] initWithFrame:[_contentView frame]] autorelease]); - [content setBackgroundColor:[_contentView backgroundColor]]; - [_contentView setBackgroundColor:[UIColor clearColor]]; - [_contentView setFrame:[content bounds]]; + UIView *layer; + if (&_contentLayer != NULL) + layer = _contentLayer; + else if (&_contentView != NULL) + layer = _contentView; + else + layer = nil; + + UIView *content([[[UIView alloc] initWithFrame:[layer frame]] autorelease]); + [content setBackgroundColor:[layer backgroundColor]]; + [layer setBackgroundColor:[UIColor clearColor]]; + [layer setFrame:[content bounds]]; [_window setContentView:content]; _release(WallpaperFile_); @@ -654,7 +661,7 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) { AVQueue *queue([controller_ queue]); - UIView *video([[[UIView alloc] initWithFrame:[_contentView bounds]] autorelease]); + UIView *video([[[UIView alloc] initWithFrame:[content bounds]] autorelease]); [controller_ setLayer:[video _layer]]; AVItem *item([[[AVItem alloc] initWithPath:mp4 error:&error] autorelease]); @@ -667,7 +674,7 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) { controller.movieControlMode = MPMovieControlModeHidden; [controller play]; #else - MPVideoView *video = [[[$MPVideoView alloc] initWithFrame:[_contentView bounds]] autorelease]; + MPVideoView *video = [[[$MPVideoView alloc] initWithFrame:[content bounds]] autorelease]; [video setMovieWithPath:mp4]; [video setRepeatMode:1]; [video setRepeatGap:-1]; @@ -738,7 +745,7 @@ MSHook(id, SBUIController$init, SBUIController *self, SEL sel) { } } - [content addSubview:_contentView]; + [content addSubview:layer]; DumpHierarchy(_window); return self; @@ -804,6 +811,10 @@ extern "C" NSString *UIStyleStringFromColor(CGColorRef);*/ return self; } +- (NSString *) description { + return time_; +} + WBDelegate(time_) - (CGSize) drawAtPoint:(CGPoint)point forWidth:(float)width withFont:(UIFont *)font lineBreakMode:(int)mode { diff --git a/control b/control index 0e2f5c9..326fcbc 100644 --- a/control +++ b/control @@ -3,7 +3,7 @@ Priority: optional Section: System Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.2920-1 +Version: 0.9.2922-1 Description: more powerful, open-source SummerBoard Name: WinterBoard Depends: mobilesubstrate (>= 0.9.2660-1), killall -- 2.45.2