Class $SBWidgetApplicationIcon;
@interface NSDictionary (WinterBoard)
-- (UIColor *) colorForKey:(NSString *)key;
-- (BOOL) boolForKey:(NSString *)key;
+- (UIColor *) wb$colorForKey:(NSString *)key;
+- (BOOL) wb$boolForKey:(NSString *)key;
@end
@implementation NSDictionary (WinterBoard)
-- (UIColor *) colorForKey:(NSString *)key {
+- (UIColor *) wb$colorForKey:(NSString *)key {
NSString *value = [self objectForKey:key];
if (value == nil)
return nil;
return nil;
}
-- (BOOL) boolForKey:(NSString *)key {
+- (BOOL) wb$boolForKey:(NSString *)key {
if (NSString *value = [self objectForKey:key])
return [value boolValue];
return false;
@end
+static BOOL (*_GSFontGetUseLegacyFontMetrics)();
+#define $GSFontGetUseLegacyFontMetrics() \
+ (_GSFontGetUseLegacyFontMetrics == NULL ? YES : _GSFontGetUseLegacyFontMetrics())
+
bool Debug_ = false;
bool Engineer_ = false;
}
MSHook(UIImage *, SBApplicationIcon$icon, SBApplicationIcon *self, SEL sel) {
- if (![Info_ boolForKey:@"ComposeStoreIcons"])
+ if (![Info_ wb$boolForKey:@"ComposeStoreIcons"])
if (NSString *path = $pathForIcon$([self application]))
return [UIImage imageWithContentsOfFile:path];
return _SBApplicationIcon$icon(self, sel);
CGSize datesize = [(NSString *)date sizeWithStyle:datestyle forWidth:(width + leeway)];
CGSize daysize = [(NSString *)day sizeWithStyle:daystyle forWidth:(width + leeway)];
+ unsigned base($GSFontGetUseLegacyFontMetrics() ? 71 : 70);
+
[(NSString *)date drawAtPoint:CGPointMake(
- (width + 1 - datesize.width) / 2, (71 - datesize.height) / 2
+ (width + 1 - datesize.width) / 2, (base - datesize.height) / 2
) withStyle:datestyle];
[(NSString *)day drawAtPoint:CGPointMake(
if (NSNumber *number = [Info_ objectForKey:@"NavigationBarStyle"])
style = [number intValue];
- if (UIColor *color = [Info_ colorForKey:@"NavigationBarTint"])
+ if (UIColor *color = [Info_ wb$colorForKey:@"NavigationBarTint"])
tint = color;
return [self wb$initWithFrame:frame withBarStyle:style withTintColor:tint];
MSHook(void, SBIconLabel$setInDock$, SBIconLabel *self, SEL sel, BOOL docked) {
id &_label(MSHookIvar<id>(self, "_label"));
- if (![Info_ boolForKey:@"UndockedIconLabels"])
+ if (![Info_ wb$boolForKey:@"UndockedIconLabels"])
docked = true;
if (_label != nil && [_label respondsToSelector:@selector(setInDock:)])
[_label setInDock:docked];
NSLog(@"WB:Notice: WinterBoard");
+ _GSFontGetUseLegacyFontMetrics = reinterpret_cast<BOOL (*)()>(dlsym(RTLD_DEFAULT, "GSFontGetUseLegacyFontMetrics"));
+
struct nlist nl[8];
memset(nl, 0, sizeof(nl));