MSClassHook(SBAwayView)
MSClassHook(SBBookmarkIcon)
MSClassHook(SBButtonBar)
+MSClassHook(SBCalendarApplicationIcon)
MSClassHook(SBCalendarIconContentsView)
MSClassHook(SBDockIconListView)
MSClassHook(SBIcon)
MSClassHook(SBIconBadge)
+MSClassHook(SBIconBadgeFactory)
MSClassHook(SBIconController)
MSClassHook(SBIconLabel)
MSClassHook(SBIconList)
MSClassHook(SBUIController)
MSClassHook(SBWidgetApplicationIcon)
+extern "C" void WKSetCurrentGraphicsContext(CGContextRef);
+
__attribute__((__constructor__))
static void MSFixClass() {
if ($SBIcon == nil)
}
// }}}
+static struct WBStringDrawingState {
+ WBStringDrawingState *next_;
+ NSString *extra_;
+ NSString *key_;
+} *stringDrawingState_;
+
+MSInstanceMessageHook4(CGSize, NSString, drawAtPoint,forWidth,withFont,lineBreakMode, CGPoint, point, float, width, UIFont *, font, int, mode) {
+ if (stringDrawingState_ == NULL)
+ return MSOldCall(point, width, font, mode);
+
+ NSString *style([[font markupDescription] stringByAppendingString:@";"]);
+
+ if (NSString *extra = stringDrawingState_->extra_)
+ style = [style stringByAppendingString:extra];
+
+ if (stringDrawingState_->key_ != nil)
+ if (NSString *extra = [Info_ objectForKey:stringDrawingState_->key_])
+ style = [style stringByAppendingString:extra];
+
+ stringDrawingState_ = stringDrawingState_->next_;
+
+ [self drawAtPoint:point withStyle:style];
+ return CGSizeZero;
+}
+
+MSInstanceMessageHook2(CGSize, NSString, drawAtPoint,withFont, CGPoint, point, UIFont *, font) {
+ if (stringDrawingState_ == NULL)
+ return MSOldCall(point, font);
+
+ NSString *style([[font markupDescription] stringByAppendingString:@";"]);
+
+ if (NSString *extra = stringDrawingState_->extra_)
+ style = [style stringByAppendingString:extra];
+
+ if (stringDrawingState_->key_ != nil)
+ if (NSString *extra = [Info_ objectForKey:stringDrawingState_->key_])
+ style = [style stringByAppendingString:extra];
+
+ stringDrawingState_ = stringDrawingState_->next_;
+
+ [self drawAtPoint:point withStyle:style];
+ return CGSizeZero;
+}
+
+MSInstanceMessageHook1(UIImage *, SBIconBadgeFactory, checkoutBadgeImageForText, NSString *, text) {
+ WBStringDrawingState badgeState = {NULL, @""
+ "color: white;"
+ , @"BadgeStyle"};
+
+ stringDrawingState_ = &badgeState;
+
+ UIImage *image(MSOldCall(text));
+
+ stringDrawingState_ = NULL;
+ return image;
+}
+
+MSInstanceMessageHook1(UIImage *, SBCalendarApplicationIcon, generateIconImage, int, type) {
+ WBStringDrawingState dayState = {NULL, @""
+ "color: white;"
+ "text-shadow: rgba(0, 0, 0, 0.2) -1px -1px 2px;"
+ , @"CalendarIconDayStyle"};
+
+ WBStringDrawingState dateState = {&dayState, @""
+ "color: #333333;"
+ , @"CalendarIconDateStyle"};
+
+ stringDrawingState_ = &dateState;
+
+ UIImage *image(MSOldCall(type));
+
+ stringDrawingState_ = NULL;
+ return image;
+}
+
MSHook(void, SBCalendarIconContentsView$drawRect$, SBCalendarIconContentsView *self, SEL sel, CGRect rect) {
NSBundle *bundle([NSBundle mainBundle]);
[indirect addSubview:video];
}
- if (NSString *path = $getTheme$([NSArray arrayWithObjects:@"Wallpaper@2x.png", @"Wallpaper@2x.jpg", @"Wallpaper.png", @"Wallpaper.jpg", nil], themes)) {
+ if (NSString *path = $getTheme$($useScale$([NSArray arrayWithObjects:@"Wallpaper.png", @"Wallpaper.jpg", nil]), themes)) {
if (UIImage *image = $getImage$(path)) {
WallpaperFile_ = [path retain];
WallpaperImage_ = [[UIImageView alloc] initWithImage:image];
}
}
- if (NSString *path = $getTheme$([NSArray arrayWithObject:@"Wallpaper@.html"], themes)) {
+ if (NSString *path = $getTheme$([NSArray arrayWithObject:@"Wallpaper.html"], themes)) {
CGRect bounds = [indirect bounds];
UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]);
}
// }}}
-extern "C" void WKSetCurrentGraphicsContext(CGContextRef);
-
static void NSString$drawAtPoint$withStyle$(NSString *self, SEL _cmd, CGPoint point, NSString *style) {
WKSetCurrentGraphicsContext(UIGraphicsGetCurrentContext());
if (style == nil || [style length] == 0)