]> git.saurik.com Git - winterboard.git/blobdiff - WBMarkup.mm
Commit most of the new layout I'd been working on.
[winterboard.git] / WBMarkup.mm
index dc6f9e5c229317fc2ad981d51f62c432bcbd4be6..ff7c98ab9b3f1aeede4a00988c498c372357da0d 100644 (file)
@@ -2,6 +2,8 @@
 
 #include <substrate.h>
 
+MSClassHook(UIWebDocumentView)
+
 @class WKView;
 
 extern "C" void WebThreadLock();
@@ -61,6 +63,10 @@ static void (*WKViewDisplayRect$)(WKView *, CGRect);
 - (void) setContentView:(WebView *)view;
 @end
 
+@interface UIWebDocumentView : NSObject
+- (WebView *) webView;
+@end
+
 static WBMarkup *SharedMarkup_;
 
 @implementation WBMarkup
@@ -93,9 +99,11 @@ static WBMarkup *SharedMarkup_;
     if ((self = [super init]) != nil) {
         WebThreadLock();
 
-        SharedMarkup_ = self;
+        if ($UIWebDocumentView == Nil)
+            view_ = [[WebView alloc] initWithFrame:CGRectMake(0, 0, 640, 5000)];
+        else
+            view_ = [[[$UIWebDocumentView alloc] initWithFrame:CGRectMake(0, 0, 640, 5000)] webView];
 
-        view_ = [[WebView alloc] initWithFrame:CGRectMake(0, 0, 640, 5000)];
         [view_ setDrawsBackground:NO];
 
         WebPreferences *preferences([[WebPreferences alloc] initWithIdentifier:@"com.apple.webkit.webmarkup"]);