Class $SBUIController;
Class $SBWidgetApplicationIcon;
+static bool IsWild_;
+
@interface NSDictionary (WinterBoard)
- (UIColor *) wb$colorForKey:(NSString *)key;
- (BOOL) wb$boolForKey:(NSString *)key;
#define $GSFontGetUseLegacyFontMetrics() \
(_GSFontGetUseLegacyFontMetrics == NULL ? YES : _GSFontGetUseLegacyFontMetrics())
-bool Debug_ = false;
-bool Engineer_ = false;
-bool SummerBoard_ = true;
+static bool Debug_ = false;
+static bool Engineer_ = false;
+static bool SummerBoard_ = true;
+static bool SpringBoard_;
static UIImage *(*_UIApplicationImageWithName)(NSString *name);
static UIImage *(*_UIImageAtPath)(NSString *name, NSBundle *path);
else if ([file isEqualToString:oldname]) \
[names addObject:[NSString stringWithFormat:@"%@.png", newname]]; \
+ bool summer(SpringBoard_ && SummerBoard_);
+
if (identifier == nil);
else if ([identifier isEqualToString:@"com.apple.chatkit"])
[names addObject:[NSString stringWithFormat:@"Bundles/com.apple.MobileSMS/%@", file]];
else if ([identifier isEqualToString:@"com.apple.calculator"])
[names addObject:[NSString stringWithFormat:@"Files/Applications/Calculator.app/%@", file]];
- else if (![identifier isEqualToString:@"com.apple.springboard"] || !SummerBoard_);
+ else if (!summer);
remapResourceName(@"FSO_BG.png", @"StatusBar")
remapResourceName(@"SBDockBG.png", @"Dock")
remapResourceName(@"SBWeatherCelsius.png", @"Icons/Weather")
if (NSString *path = $getTheme$(names))
return path;
+
return nil;
}
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]);
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], cache, orientation);
+
+ NSString *themed([name wb$themedPath]);
+
+ if (false && SpringBoard_ && SummerBoard_ && themed == name) {
+ if ([name isEqualToString:@"/System/Library/CoreServices/SpringBoard.app/SBDockBGT-Portrait.png"])
+ if (NSString *path = $getTheme$([NSArray arrayWithObject:@"Dock.png"])) {
+ UIImage *image([UIImage imageWithContentsOfFile:path]);
+ CGImageRef ref([[image _imageScaledToProportion:2.4 interpolationQuality:5] imageRef]);
+ CGImageRetain(ref);
+ return ref;
+ }
+ }
+
+ return __UIImageRefAtPath(themed, cache, orientation);
}
/*MSHook(UIImage *, _UIImageAtPath, NSString *name, NSBundle *bundle) {
CFRelease(formatter);
- NSString *datestyle(@""
+ NSString *datestyle([@""
"font-family: Helvetica; "
"font-weight: bold; "
- "font-size: 39px; "
"color: #333333; "
"alpha: 1.0; "
- "");
+ "" stringByAppendingString:(IsWild_
+ ? @"font-size: 54px; "
+ : @"font-size: 39px; "
+ )]);
- NSString *daystyle(@""
+ NSString *daystyle([@""
"font-family: Helvetica; "
"font-weight: bold; "
- "font-size: 9px; "
"color: white; "
"text-shadow: rgba(0, 0, 0, 0.2) -1px -1px 2px; "
- "");
+ "" stringByAppendingString:(IsWild_
+ ? @"font-size: 11px; "
+ : @"font-size: 9px; "
+ )]);
if (NSString *style = [Info_ objectForKey:@"CalendarIconDateStyle"])
datestyle = [datestyle stringByAppendingString:style];
CGSize datesize = [(NSString *)date sizeWithStyle:datestyle forWidth:(width + leeway)];
CGSize daysize = [(NSString *)day sizeWithStyle:daystyle forWidth:(width + leeway)];
- unsigned base($GSFontGetUseLegacyFontMetrics() ? 71 : 70);
+ unsigned base(IsWild_ ? 89 : 70);
+ if ($GSFontGetUseLegacyFontMetrics())
+ base = base + 1;
[(NSString *)date drawAtPoint:CGPointMake(
(width + 1 - datesize.width) / 2, (base - datesize.height) / 2
) withStyle:datestyle];
[(NSString *)day drawAtPoint:CGPointMake(
- (width + 1 - daysize.width) / 2, (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]);
+ bounds.origin.y = -30;
+ 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 *style = [NSString stringWithFormat:@""
"font-family: Helvetica; "
"font-weight: bold; "
- "font-size: 11px; "
- "color: %@; "
- "", docked ? @"white" : @"#b3b3b3"];
-
- if (docked)
+ "color: %@; %@"
+ "", (docked || !SummerBoard_ ? @"white" : @"#b3b3b3"), (IsWild_
+ ? @"font-size: 12px; "
+ : @"font-size: 11px; "
+ )];
+
+ 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; "];
bool ellipsis(false);
NSLog(@"WB:Debug: GSFontCreateWithName(\"%s\", %f)", name, size);
if (NSString *font = [Info_ objectForKey:[NSString stringWithFormat:@"FontName-%s", name]])
name = [font UTF8String];
+ //if (NSString *scale = [Info_ objectForKey:[NSString stringWithFormat:@"FontScale-%s", name]])
+ // size *= [scale floatValue];
return _GSFontCreateWithName(name, traits, size);
}
bool sms($getTheme$([NSArray arrayWithObjects:@"SMSBackground.png", @"SMSBackground.jpg", nil]) != nil);
+ SpringBoard_ = [identifier isEqualToString:@"com.apple.springboard"];
+
if ([NSBundle bundleWithIdentifier:@"com.apple.chatkit"])
if (sms) {
$CKMessageCell = objc_getClass("CKMessageCell");
_TranscriptController$loadView = MSHookMessage(mSMSMessageTranscriptController, @selector(loadView), &$TranscriptController$loadView);
}
}
- } else if ([identifier isEqualToString:@"com.apple.springboard"]) {
+ } else if (SpringBoard_) {
CFNotificationCenterAddObserver(
CFNotificationCenterGetDarwinNotifyCenter(),
NULL, &ChangeWallpaper, (CFStringRef) @"com.saurik.winterboard.lockbackground", NULL, 0
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"];