Class $SBUIController;
Class $SBWidgetApplicationIcon;
+static bool IsWild_;
+
@interface NSDictionary (WinterBoard)
- (UIColor *) wb$colorForKey:(NSString *)key;
- (BOOL) wb$boolForKey:(NSString *)key;
return _SBApplicationIcon$icon(self, sel);
}
+MSHook(UIImage *, SBApplicationIcon$generateIconImage$, SBApplicationIcon *self, SEL sel, int type) {
+ if (type == 2)
+ if (![Info_ wb$boolForKey:@"ComposeStoreIcons"])
+ if (NSString *path = $pathForIcon$([self application]))
+ if (UIImage *image = [UIImage imageWithContentsOfFile:path])
+ return [image _imageScaledToProportion:1.2 interpolationQuality:5];
+ return _SBApplicationIcon$generateIconImage$(self, sel, type);
+}
+
MSHook(UIImage *, SBWidgetApplicationIcon$icon, SBWidgetApplicationIcon *self, SEL sel) {
if (Debug_)
NSLog(@"WB:Debug:Widget(%@:%@)", [self displayIdentifier], [self displayName]);
CFRelease(formatter);
- UIDevice *device([UIDevice currentDevice]);
- bool isWild([device respondsToSelector:@selector(isWildcat)] && [device isWildcat]);
-
NSString *datestyle([@""
"font-family: Helvetica; "
"font-weight: bold; "
"color: #333333; "
"alpha: 1.0; "
- "" stringByAppendingString:(isWild
+ "" stringByAppendingString:(IsWild_
? @"font-size: 54px; "
: @"font-size: 39px; "
)]);
"font-weight: bold; "
"color: white; "
"text-shadow: rgba(0, 0, 0, 0.2) -1px -1px 2px; "
- "" stringByAppendingString:(isWild
+ "" stringByAppendingString:(IsWild_
? @"font-size: 11px; "
: @"font-size: 9px; "
)]);
CGSize datesize = [(NSString *)date sizeWithStyle:datestyle forWidth:(width + leeway)];
CGSize daysize = [(NSString *)day sizeWithStyle:daystyle forWidth:(width + leeway)];
- unsigned base(isWild ? 89 : 70);
+ unsigned base(IsWild_ ? 89 : 70);
if ($GSFontGetUseLegacyFontMetrics())
base = base + 1;
) withStyle:datestyle];
[(NSString *)day drawAtPoint:CGPointMake(
- (width + 1 - daysize.width) / 2, ((isWild ? 18 : 16) - daysize.height) / 2
+ (width + 1 - daysize.width) / 2, ((IsWild_ ? 18 : 16) - daysize.height) / 2
) withStyle:daystyle];
CFRelease(date);
}
static NSArray *Wallpapers_;
+static bool Papered_;
static NSString *WallpaperFile_;
static UIImageView *WallpaperImage_;
static UIWebDocumentView *WallpaperPage_;
if (self == nil)
return nil;
+ if (Papered_) {
+ UIWindow *&_wallpaperView(MSHookIvar<UIWindow *>(self, "_wallpaperView"));
+ if (&_wallpaperView != NULL) {
+ [_wallpaperView removeFromSuperview];
+ [_wallpaperView release];
+ _wallpaperView = nil;
+ }
+ }
+
UIWindow *&_window(MSHookIvar<UIWindow *>(self, "_window"));
UIView *&_contentLayer(MSHookIvar<UIView *>(self, "_contentLayer"));
UIView *&_contentView(MSHookIvar<UIView *>(self, "_contentView"));
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];
+ UIView *indirect;
+ if (!SummerBoard_ || !IsWild_)
+ indirect = content;
+ else {
+ CGRect bounds([content bounds]);
+ indirect = [[[UIView alloc] initWithFrame:bounds] autorelease];
+ [content addSubview:indirect];
+ [indirect zoomToScale:2.4];
+ }
+
_release(WallpaperFile_);
_release(WallpaperImage_);
_release(WallpaperPage_);
AVQueue *queue([controller_ queue]);
- UIView *video([[[UIView alloc] initWithFrame:[content bounds]] autorelease]);
+ UIView *video([[[UIView alloc] initWithFrame:[indirect bounds]] autorelease]);
[controller_ setLayer:[video _layer]];
AVItem *item([[[AVItem alloc] initWithPath:mp4 error:&error] autorelease]);
controller.movieControlMode = MPMovieControlModeHidden;
[controller play];
#else
- MPVideoView *video = [[[$MPVideoView alloc] initWithFrame:[content bounds]] autorelease];
+ MPVideoView *video = [[[$MPVideoView alloc] initWithFrame:[indirect bounds]] autorelease];
[video setMovieWithPath:mp4];
[video setRepeatMode:1];
[video setRepeatGap:-1];
[video playFromBeginning];;
#endif
- [content addSubview:video];
+ [indirect addSubview:video];
}
NSString *png = [theme stringByAppendingPathComponent:@"Wallpaper.png"];
WallpaperImage_ = [[UIImageView alloc] initWithImage:image];
if (NSNumber *number = [Info_ objectForKey:@"WallpaperAlpha"])
[WallpaperImage_ setAlpha:[number floatValue]];
- [content addSubview:WallpaperImage_];
+ [indirect addSubview:WallpaperImage_];
}
NSString *html = [theme stringByAppendingPathComponent:@"Wallpaper.html"];
if ([Manager_ fileExistsAtPath:html]) {
- CGRect bounds = [content bounds];
+ CGRect bounds = [indirect bounds];
UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
[view setAutoresizes:true];
[view setDrawsBackground:NO];
[[view webView] setDrawsBackground:NO];
- [content addSubview:view];
+ [indirect addSubview:view];
}
}
NSString *theme = [themes_ objectAtIndex:(e - i - 1)];
NSString *html = [theme stringByAppendingPathComponent:@"Widget.html"];
if ([Manager_ fileExistsAtPath:html]) {
- CGRect bounds = [content bounds];
+ CGRect bounds = [indirect bounds];
UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
[view setAutoresizes:true];
[view setDrawsBackground:NO];
[[view webView] setDrawsBackground:NO];
- [content addSubview:view];
+ [indirect addSubview:view];
}
}
NSString *label(MSHookIvar<NSString *>(self, "_label"));
- UIDevice *device([UIDevice currentDevice]);
- bool isWild([device respondsToSelector:@selector(isWildcat)] && [device isWildcat]);
-
NSString *style = [NSString stringWithFormat:@""
"font-family: Helvetica; "
"font-weight: bold; "
"color: %@; %@"
- "", (docked || !SummerBoard_ ? @"white" : @"#b3b3b3"), (isWild
+ "", (docked || !SummerBoard_ ? @"white" : @"#b3b3b3"), (IsWild_
? @"font-size: 12px; "
: @"font-size: 11px; "
)];
- if (isWild)
+ if (IsWild_)
style = [style stringByAppendingString:@"text-shadow: rgba(0, 0, 0, 0.5) 0px 1px 0px; "];
else if (docked)
style = [style stringByAppendingString:@"text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px; "];
if (SummerBoard_) {
WBRename(SBApplication, pathForIcon, pathForIcon);
WBRename(SBApplicationIcon, icon, icon);
+ WBRename(SBApplicationIcon, generateIconImage:, generateIconImage$);
}
WBRename(SBBookmarkIcon, icon, icon);
}
Wallpapers_ = [[NSArray arrayWithObjects:@"Wallpaper.mp4", @"Wallpaper.png", @"Wallpaper.jpg", @"Wallpaper.html", nil] retain];
+ Papered_ = $getTheme$(Wallpapers_) != nil;
+
+ UIDevice *device([UIDevice currentDevice]);
+ IsWild_ = [device respondsToSelector:@selector(isWildcat)] && [device isWildcat];
if ([Info_ objectForKey:@"UndockedIconLabels"] == nil)
[Info_ setObject:[NSNumber numberWithBool:(
- $getTheme$(Wallpapers_) == nil ||
+ Papered_ ||
[Info_ objectForKey:@"DockedIconLabelStyle"] != nil ||
[Info_ objectForKey:@"UndockedIconLabelStyle"] != nil
)] forKey:@"UndockedIconLabels"];