From: Jay Freeman (saurik) Date: Sun, 4 Jan 2009 02:11:47 +0000 (+0000) Subject: Page-specific wallpapers. X-Git-Tag: v0.9.3900~54 X-Git-Url: https://git.saurik.com/winterboard.git/commitdiff_plain/98fe8d526b1e894a1cfef54ba686991015fa0898 Page-specific wallpapers. --- diff --git a/Library.mm b/Library.mm index 6ec4a8d..e46acb6 100644 --- a/Library.mm +++ b/Library.mm @@ -59,6 +59,7 @@ #import #import #import +#import #import #import #import @@ -854,10 +855,48 @@ MSHook(void, SBStatusBarTimeView$drawRect$, SBStatusBarTimeView *self, SEL sel, return _SBStatusBarTimeView$drawRect$(self, sel, rect); } -MSHook(void, SBIconController$appendIconList$, SBIconController *self, SEL sel, SBIconList *list) { - if (Debug_) - NSLog(@"appendIconList:%@", list); - return _SBIconController$appendIconList$(self, sel, list); +@interface UIView (WinterBoard) +- (bool) wb$isImageView; +@end + +@implementation UIView (WinterBoard) + +- (bool) wb$isImageView { + return false; +} + +@end + +@interface UIImageView (WinterBoard) +- (bool) wb$isImageView; +@end + +@implementation UIImageView (WinterBoard) + +- (bool) wb$isImageView { + return true; +} + +@end + +MSHook(void, SBIconController$noteNumberOfIconListsChanged, SBIconController *self, SEL sel) { + SBIconModel *&_iconModel(MSHookIvar(self, "_iconModel")); + NSArray *lists([_iconModel iconLists]); + + for (unsigned i(0), e([lists count]); i != e; ++i) + if (NSString *path = $getTheme$([NSArray arrayWithObject:[NSString stringWithFormat:@"Page%u.png", i]])) { + SBIconList *list([lists objectAtIndex:i]); + NSArray *subviews([list subviews]); + UIImageView *view([subviews count] == 0 ? nil : [subviews objectAtIndex:0]); + if (view == nil || ![view wb$isImageView]) { + view = [[[UIImageView alloc] init] autorelease]; + [list insertSubview:view atIndex:0]; + } + UIImage *image([UIImage imageWithContentsOfFile:path]); + [view setImage:image]; + } + + return _SBIconController$noteNumberOfIconListsChanged(self, sel); } MSHook(id, SBIconLabel$initWithSize$label$, SBIconLabel *self, SEL sel, CGSize size, NSString *label) { @@ -1241,7 +1280,7 @@ extern "C" void WBInitialize() { WBRename(SBCalendarIconContentsView, drawRect:, drawRect$); WBRename(SBContentLayer, initWithSize:, initWithSize$); WBRename(SBIconBadge, initWithBadge:, initWithBadge$); - WBRename(SBIconController, appendIconList:, appendIconList$); + WBRename(SBIconController, noteNumberOfIconListsChanged, noteNumberOfIconListsChanged); WBRename(SBWidgetApplicationIcon, icon, icon); WBRename(SBIconLabel, drawRect:, drawRect$); diff --git a/control b/control index 60953e8..820dd3c 100644 --- a/control +++ b/control @@ -3,7 +3,7 @@ Priority: optional Section: System Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.2693-1 +Version: 0.9.2694-1 Description: more powerful, open-source SummerBoard Name: WinterBoard Depends: mobilesubstrate (>= 0.9.2660-1)