]> git.saurik.com Git - winterboard.git/commitdiff
Fix iOS 6 calendar labels (half-fixing on iOS 7).
authorJay Freeman (saurik) <saurik@saurik.com>
Sat, 11 Jan 2014 03:27:06 +0000 (19:27 -0800)
committerJay Freeman (saurik) <saurik@saurik.com>
Sat, 11 Jan 2014 03:27:34 +0000 (19:27 -0800)
Library.mm

index 42fd396a1ba020c2b4ec5ffccb4c8e621c5345d3..aab45a28fb0052d38b4288a58d2288d8e9a205bb 100644 (file)
@@ -771,21 +771,21 @@ static NSString *WBColorMarkup() {
 
 extern "C" NSString *NSStringFromCGPoint(CGPoint rect);
 
-MSInstanceMessageHook5(CGSize, NSString, drawAtPoint,forWidth,withFont,lineBreakMode,letterSpacing, CGPoint, point, CGFloat, width, UIFont *, font, UILineBreakMode, mode, CGFloat, spacing) {
-    //NSLog(@"XXX: @\"%@\" %@ %g \"%@\" %u %g", self, NSStringFromCGPoint(point), width, font, mode, spacing);
+MSInstanceMessage6(CGSize, NSString, drawAtPoint,forWidth,withFont,lineBreakMode,letterSpacing,includeEmoji, CGPoint, point, CGFloat, width, UIFont *, font, UILineBreakMode, mode, CGFloat, spacing, BOOL, emoji) {
+    //NSLog(@"XXX: @\"%@\" %@ %g \"%@\" %u %g %u", self, NSStringFromCGPoint(point), width, font, mode, spacing, emoji);
 
     WBStringDrawingState *state(stringDrawingState_);
     if (state == NULL)
-        return MSOldCall(point, width, font, mode, spacing);
+        return MSOldCall(point, width, font, mode, spacing, emoji);
 
     if (state->count_ != 0 && --state->count_ == 0)
         stringDrawingState_ = state->next_;
     if (state->info_ == nil)
-        return MSOldCall(point, width, font, mode, spacing);
+        return MSOldCall(point, width, font, mode, spacing, emoji);
 
     NSString *info([Info_ objectForKey:state->info_]);
     if (info == nil)
-        return MSOldCall(point, width, font, mode, spacing);
+        return MSOldCall(point, width, font, mode, spacing, emoji);
 
     NSString *base(state->base_ ?: @"");
     NSString *extra([NSString stringWithFormat:@"letter-spacing: %gpx", spacing]);
@@ -2385,6 +2385,11 @@ MSInitialize {
 
         WBHookSymbol(image, _UIImageWithDeviceSpecificName);
         MSHookFunction(_UIImageWithDeviceSpecificName, MSHake(_UIImageWithDeviceSpecificName));
+
+        SEL includeEmoji(@selector(_legacy_drawAtPoint:forWidth:withFont:lineBreakMode:letterSpacing:includeEmoji:));
+        if (![@"" respondsToSelector:includeEmoji])
+            includeEmoji = @selector(drawAtPoint:forWidth:withFont:lineBreakMode:letterSpacing:includeEmoji:);
+        MSHookMessage($NSString, includeEmoji, MSHake(NSString$drawAtPoint$forWidth$withFont$lineBreakMode$letterSpacing$includeEmoji$));
     }
     // }}}