📄 library.mm
字号:
} } for (size_t i(0), e([themes_ count]); i != e; ++i) { NSString *theme = [themes_ objectAtIndex:(e - i - 1)]; NSString *html = [theme stringByAppendingPathComponent:@"Widget.html"]; if ([Manager_ fileExistsAtPath:html]) { CGRect bounds = [self bounds]; UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]); [view setAutoresizes:true]; NSURL *url = [NSURL fileURLWithPath:html]; [view loadRequest:[NSURLRequest requestWithURL:url]]; [[view webView] setDrawsBackground:false]; [view setBackgroundColor:[UIColor clearColor]]; [self addSubview:view]; } } return self;}static void SBSlidingAlertDisplay$updateDesktopImage$(SBSlidingAlertDisplay<WinterBoard> *self, SEL sel, UIImage *image) { NSString *path = $getTheme$([NSArray arrayWithObject:@"LockBackground.html"]); UIView *&_backgroundView(MSHookIvar<UIView *>(self, "_backgroundView")); if (path != nil && _backgroundView != nil) path = nil; [self wb$updateDesktopImage:image]; if (path != nil) { CGRect bounds = [self bounds]; UIWebDocumentView *view([[[UIWebDocumentView alloc] initWithFrame:bounds] autorelease]); [view setAutoresizes:true]; if (WallpaperPage_ != nil) [WallpaperPage_ release]; WallpaperPage_ = [view retain]; if (WallpaperURL_ != nil) [WallpaperURL_ release]; WallpaperURL_ = [[NSURL fileURLWithPath:path] retain]; [WallpaperPage_ loadRequest:[NSURLRequest requestWithURL:WallpaperURL_]]; [[view webView] setDrawsBackground:false]; [view setBackgroundColor:[UIColor clearColor]]; [self insertSubview:view aboveSubview:_backgroundView]; }}/*extern "C" CGColorRef CGGStateGetSystemColor(void *);extern "C" CGColorRef CGGStateGetFillColor(void *);extern "C" CGColorRef CGGStateGetStrokeColor(void *);extern "C" NSString *UIStyleStringFromColor(CGColorRef);*//* WBTimeLabel {{{ */@interface WBTimeLabel : NSProxy { NSString *time_; _transient SBStatusBarTimeView *view_;}- (id) initWithTime:(NSString *)time view:(SBStatusBarTimeView *)view;@end@implementation WBTimeLabel- (void) dealloc { [time_ release]; [super dealloc];}- (id) initWithTime:(NSString *)time view:(SBStatusBarTimeView *)view { time_ = [time retain]; view_ = view; return self;}WBDelegate(time_)- (CGSize) drawAtPoint:(CGPoint)point forWidth:(float)width withFont:(UIFont *)font lineBreakMode:(int)mode { if (NSString *custom = [Info_ objectForKey:@"TimeStyle"]) { BOOL &_mode(MSHookIvar<BOOL>(view_, "_mode"));; [time_ drawAtPoint:point withStyle:[NSString stringWithFormat:@"" "font-family: Helvetica; " "font-weight: bold; " "font-size: 14px; " "color: %@; " "%@", _mode ? @"white" : @"black", custom]]; return CGSizeZero; } return [time_ drawAtPoint:point forWidth:width withFont:font lineBreakMode:mode];}@end/* }}} *//* WBBadgeLabel {{{ */@interface WBBadgeLabel : NSProxy { NSString *badge_;}- (id) initWithBadge:(NSString *)badge;@end@implementation WBBadgeLabel- (void) dealloc { [badge_ release]; [super dealloc];}- (id) initWithBadge:(NSString *)badge { badge_ = [badge retain]; return self;}WBDelegate(badge_)- (CGSize) drawAtPoint:(CGPoint)point forWidth:(float)width withFont:(UIFont *)font lineBreakMode:(int)mode { if (NSString *custom = [Info_ objectForKey:@"BadgeStyle"]) { [badge_ drawAtPoint:point withStyle:[NSString stringWithFormat:@"" "font-family: Helvetica; " "font-weight: bold; " "font-size: 17px; " "color: white; " "%@", custom]]; return CGSizeZero; } return [badge_ drawAtPoint:point forWidth:width withFont:font lineBreakMode:mode];}@end/* }}} */static id SBIconBadge$initWithBadge$(SBIconBadge<WinterBoard> *self, SEL sel, NSString *badge) { if ((self = [self wb$initWithBadge:badge]) != nil) { id &_badge(MSHookIvar<id>(self, "_badge")); if (_badge != nil) if (id label = [[WBBadgeLabel alloc] initWithBadge:[_badge autorelease]]) _badge = label; } return self;}static void SBStatusBarController$setStatusBarMode$orientation$duration$fenceID$animation$(SBStatusBarController<WinterBoard> *self, SEL sel, int mode, int orientation, float duration, int id, int animation) { if (Debug_) NSLog(@"WB:Debug:setStatusBarMode:%d", mode); if (mode < 100) // 104:hidden 105:glowing if (NSNumber *number = [Info_ objectForKey:@"StatusBarMode"]) mode = [number intValue]; return [self wb$setStatusBarMode:mode orientation:orientation duration:duration fenceID:id animation:animation];}static id SBStatusBarContentsView$initWithStatusBar$mode$(SBStatusBarContentsView<WinterBoard> *self, SEL sel, id bar, int mode) { if (NSNumber *number = [Info_ objectForKey:@"StatusBarContentsMode"]) mode = [number intValue]; return [self wb$initWithStatusBar:bar mode:mode];}static NSString *SBStatusBarOperatorNameView$operatorNameStyle(SBStatusBarOperatorNameView<WinterBoard> *self, SEL sel, NSString *name, BOOL full) { NSString *style([self wb$operatorNameStyle]); if (Debug_) NSLog(@"operatorNameStyle= %@", style); if (NSString *custom = [Info_ objectForKey:@"OperatorNameStyle"]) style = [NSString stringWithFormat:@"%@; %@", style, custom]; return style;}static void SBStatusBarOperatorNameView$setOperatorName$fullSize$(SBStatusBarOperatorNameView<WinterBoard> *self, SEL sel, NSString *name, BOOL full) { if (Debug_) NSLog(@"setOperatorName:\"%@\" fullSize:%u", name, full); [self wb$setOperatorName:name fullSize:NO];}static void SBStatusBarTimeView$drawRect$(SBStatusBarTimeView<WinterBoard> *self, SEL sel, CGRect rect) { id &_time(MSHookIvar<id>(self, "_time")); if (_time != nil && [_time class] != [WBTimeLabel class]) object_setInstanceVariable(self, "_time", reinterpret_cast<void *>([[WBTimeLabel alloc] initWithTime:[_time autorelease] view:self])); return [self wb$drawRect:rect];}static void SBIconController$appendIconList$(SBIconController<WinterBoard> *self, SEL sel, SBIconList *list) { if (Debug_) NSLog(@"appendIconList:%@", list); return [self wb$appendIconList:list];}static id SBIconLabel$initWithSize$label$(SBIconLabel<WinterBoard> *self, SEL sel, CGSize size, NSString *label) { self = [self wb$initWithSize:size label:label]; if (self != nil) [self setClipsToBounds:NO]; return self;}static void SBIconLabel$setInDock$(SBIconLabel<WinterBoard> *self, SEL sel, BOOL docked) { id &_label(MSHookIvar<id>(self, "_label")); if (![Info_ boolForKey:@"UndockedIconLabels"]) docked = true; if (_label != nil && [_label respondsToSelector:@selector(setInDock:)]) [_label setInDock:docked]; return [self wb$setInDock:docked];}static NSString *NSBundle$localizedStringForKey$value$table$(NSBundle<WinterBoard> *self, SEL sel, NSString *key, NSString *value, NSString *table) { NSString *identifier = [self bundleIdentifier]; NSLocale *locale = [NSLocale currentLocale]; NSString *language = [locale objectForKey:NSLocaleLanguageCode]; if (Debug_) NSLog(@"WB:Debug:[NSBundle(%@) localizedStringForKey:\"%@\" value:\"%@\" table:\"%@\"] (%@)", identifier, key, value, table, language); NSString *file = table == nil ? @"Localizable" : table; NSString *name = [NSString stringWithFormat:@"%@:%@", identifier, file]; NSDictionary *strings; if ((strings = [Strings_ objectForKey:name]) != nil) { if (static_cast<id>(strings) != [NSNull null]) strings: if (NSString *value = [strings objectForKey:key]) return value; } else if (NSString *path = $pathForFile$inBundle$([NSString stringWithFormat:@"%@.lproj/%@.strings", language, file ], self, false)) { if ((strings = [[NSDictionary alloc] initWithContentsOfFile:path]) != nil) { [Strings_ setObject:[strings autorelease] forKey:name]; goto strings; } else goto null; } else null: [Strings_ setObject:[NSNull null] forKey:name]; return [self wb$localizedStringForKey:key value:value table:table];}@class WebCoreFrameBridge;static CGSize WebCoreFrameBridge$renderedSizeOfNode$constrainedToWidth$(WebCoreFrameBridge<WinterBoard> *self, SEL sel, id node, float width) { if (node == nil) return CGSizeZero; void **core(reinterpret_cast<void **>([node _node])); if (core == NULL || core[6] == NULL) return CGSizeZero; return [self wb$renderedSizeOfNode:node constrainedToWidth:width];}static void SBIconLabel$drawRect$(SBIconLabel<WinterBoard> *self, SEL sel, CGRect rect) { CGRect bounds = [self bounds]; static Ivar drawMoreLegibly = object_getInstanceVariable(self, "_drawMoreLegibly", NULL); BOOL docked; Ivar ivar = object_getInstanceVariable(self, "_inDock", reinterpret_cast<void **>(&docked)); docked = (docked & (ivar_getOffset(ivar) == ivar_getOffset(drawMoreLegibly) ? 0x2 : 0x1)) != 0; NSString *&label(MSHookIvar<NSString *>(self, "_label")); NSString *style = [NSString stringWithFormat:@"" "font-family: Helvetica; " "font-weight: bold; " "font-size: 11px; " "color: %@; " "", docked ? @"white" : @"#b3b3b3"]; if (docked) style = [style stringByAppendingString:@"text-shadow: rgba(0, 0, 0, 0.5) 0px -1px 0px; "]; float max = 75, width = [label sizeWithStyle:style forWidth:320].width; if (width > max) style = [style stringByAppendingString:[NSString stringWithFormat:@"letter-spacing: -%f; ", ((width - max) / ([label length] - 1))]]; if (NSString *custom = [Info_ objectForKey:(docked ? @"DockedIconLabelStyle" : @"UndockedIconLabelStyle")]) style = [style stringByAppendingString:custom]; CGSize size = [label sizeWithStyle:style forWidth:bounds.size.width]; [label drawAtPoint:CGPointMake((bounds.size.width - size.width) / 2, 0) withStyle:style];}void mSMSMessageTranscriptController$loadView(mSMSMessageTranscriptController<WinterBoard> *self, SEL sel) { [self wb$loadView]; if (NSString *path = $getTheme$([NSArray arrayWithObjects:@"SMSBackground.png", @"SMSBackground.jpg", nil])) if (UIImage *image = [[UIImage alloc] wb$initWithContentsOfFile:path]) { [image autorelease]; UIView *&_transcriptLayer(MSHookIvar<UIView *>(self, "_transcriptLayer")); UIView *parent([_transcriptLayer superview]); UIImageView *background([[[UIImageView alloc] initWithImage:image] autorelease]); [parent insertSubview:background belowSubview:_transcriptLayer]; [_transcriptLayer setBackgroundColor:[UIColor clearColor]]; }}extern "C" void FindMappedImages(void);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -