]> git.saurik.com Git - winterboard.git/blobdiff - Library.mm
Workaround for display:none issue.
[winterboard.git] / Library.mm
index 3dfd3035bda56fcab2b4497b782a8966951cb4c3..34efd272a2c15e20950d98c23a0f55f5fa0ff496 100644 (file)
@@ -129,6 +129,8 @@ void WBInject(const char *classname, const char *oldname, IMP newimp, const char
 /* }}} */
 
 @protocol WinterBoard
+- (CGSize) wb_renderedSizeOfNode:(id)node constrainedToWidth:(float)width;
+- (void *) _node;
 - (void) wb_updateDesktopImage:(UIImage *)image;
 - (UIImage *) wb_defaultDesktopImage;
 - (NSString *) wb_bundlePath;
@@ -786,6 +788,16 @@ static void SBIconLabel$setInDock$(SBIconLabel<WinterBoard> *self, SEL sel, BOOL
     return [self wb_setInDock:docked];
 }
 
+@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];
 
@@ -1019,6 +1031,8 @@ extern "C" void WBInitialize() {
     WBRename(true, "UINavigationBar", @selector(setBarStyle:), (IMP) &UINavigationBar$setBarStyle$);
     WBRename(true, "UIToolbar", @selector(setBarStyle:), (IMP) &UIToolbar$setBarStyle$);
 
+    WBRename(true, "WebCoreFrameBridge", @selector(renderedSizeOfNode:constrainedToWidth:), (IMP) &WebCoreFrameBridge$renderedSizeOfNode$constrainedToWidth$);
+
     WBRename(true, "SBApplication", @selector(pathForIcon), (IMP) &SBApplication$pathForIcon);
     WBRename(true, "SBApplicationIcon", @selector(icon), (IMP) &SBApplicationIcon$icon);
     WBRename(true, "SBBookmarkIcon", @selector(icon), (IMP) &SBBookmarkIcon$icon);