return [UIImage imageWithContentsOfFile:path72];
if (NSString *path = $pathForIcon$([self application]))
if (UIImage *image = [UIImage imageWithContentsOfFile:path]) {
- float width;
+ CGFloat width;
if ([$SBIcon respondsToSelector:@selector(defaultIconImageSize)])
width = [$SBIcon defaultIconImageSize].width;
else
static void $drawLabel$(NSString *label, CGRect rect, NSString *style, NSString *custom) {
bool ellipsis(false);
- float max = rect.size.width - 11, width;
+ CGFloat max = rect.size.width - 11, width;
width:
width = [(ellipsis ? [label stringByAppendingString:@"..."] : label) sizeWithStyle:style forWidth:320].width;
if (width > max) {
size_t length([label length]);
- float spacing((width - max) / (length - 1));
+ CGFloat spacing((width - max) / (length - 1));
if (spacing > 1.25) {
ellipsis = true;
if (NSString *style = [Info_ objectForKey:@"CalendarIconDayStyle"])
daystyle = [daystyle stringByAppendingString:style];
- float width([self bounds].size.width);
+ CGFloat width([self bounds].size.width);
float leeway(10);
CGSize datesize = [(NSString *)date sizeWithStyle:datestyle forWidth:(width + leeway)];
CGSize daysize = [(NSString *)day sizeWithStyle:daystyle forWidth:(width + leeway)];
return [[WBMarkup sharedMarkup] drawString:self inRect:rect withStyle:style];
}
-static CGSize NSString$sizeWithStyle$forWidth$(NSString *self, SEL _cmd, NSString *style, float width) {
+static CGSize NSString$sizeWithStyle$forWidth$(NSString *self, SEL _cmd, NSString *style, CGFloat width) {
if (style == nil || [style length] == 0)
style = @"font-family: Helvetica; font-size: 12px";
CGSize size([[WBMarkup sharedMarkup] sizeOfString:self withStyle:style forWidth:width]);
// }}}
// UIKit {{{
if (MSImageRef image = MSGetImageByName("/System/Library/Frameworks/UIKit.framework/UIKit")) {
+#ifdef __LP64__
+ class_addMethod($NSString, @selector(drawAtPoint:withStyle:), (IMP) &NSString$drawAtPoint$withStyle$, "v40@0:8{CGPoint=dd}16@32");
+ class_addMethod($NSString, @selector(drawInRect:withStyle:), (IMP) &NSString$drawInRect$withStyle$, "v56@0:8{CGRect={CGSize=dd}{CGSize=dd}}16@48");
+ class_addMethod($NSString, @selector(sizeWithStyle:forWidth:), (IMP) &NSString$sizeWithStyle$forWidth$, "{CGSize=dd}32@0:8@16d24");
+#else
class_addMethod($NSString, @selector(drawAtPoint:withStyle:), (IMP) &NSString$drawAtPoint$withStyle$, "v20@0:4{CGPoint=ff}8@16");
class_addMethod($NSString, @selector(drawInRect:withStyle:), (IMP) &NSString$drawInRect$withStyle$, "v28@0:4{CGRect={CGSize=ff}{CGSize=ff}}8@24");
class_addMethod($NSString, @selector(sizeWithStyle:forWidth:), (IMP) &NSString$sizeWithStyle$forWidth$, "{CGSize=ff}16@0:4@8f12");
+#endif
WBHookSymbol(image, _UIKitBundle);
WBHookSymbol(image, _UIPackedImageTableGetIdentifierForName);
- (void) setStringDrawingOrigin:(CGPoint)origin;
- (void) clearStringDrawingOrigin;
-- (CGSize) sizeOfMarkup:(NSString *)markup forWidth:(float)width;
-- (CGSize) sizeOfString:(NSString *)string withStyle:(NSString *)style forWidth:(float)width;
+- (CGSize) sizeOfMarkup:(NSString *)markup forWidth:(CGFloat)width;
+- (CGSize) sizeOfString:(NSString *)string withStyle:(NSString *)style forWidth:(CGFloat)width;
- (NSString *) _styleFormatString:(NSString *)style;
-- (void) _setupWithStyle:(NSString *)style width:(float)width height:(float)height;
+- (void) _setupWithStyle:(NSString *)style width:(CGFloat)width height:(CGFloat)height;
- (BOOL) _webPrepareContextForTextDrawing:(BOOL)drawing;
- (void) drawMarkup:(NSString *)markup atPoint:(CGPoint)point;
origin_ = CGPointZero;
}
-- (CGSize) sizeOfMarkup:(NSString *)markup forWidth:(float)width {
+- (CGSize) sizeOfMarkup:(NSString *)markup forWidth:(CGFloat)width {
WebThreadLock();
if (![self _webPrepareContextForTextDrawing:NO])
return [[view_ mainFrame] renderedSizeOfNode:text_ constrainedToWidth:width];
}
-- (CGSize) sizeOfString:(NSString *)string withStyle:(NSString *)style forWidth:(float)width {
+- (CGSize) sizeOfString:(NSString *)string withStyle:(NSString *)style forWidth:(CGFloat)width {
WebThreadLock();
if (![self _webPrepareContextForTextDrawing:NO])
return style;
}
-- (void) _setupWithStyle:(NSString *)style width:(float)width height:(float)height {
+- (void) _setupWithStyle:(NSString *)style width:(CGFloat)width height:(CGFloat)height {
WebThreadLock();
if (style != nil && [style length] != 0)