diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2010-05-02 02:47:21 +0000 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-09-30 07:14:00 +0000 |
commit | 04fe134977f5dba0de222f0011d324894ccfe60f (patch) | |
tree | 5d2727e3c03b65bfb33fdf818dd0c748aaf6f5bb /UICaboodle/BrowserView.mm | |
parent | ef055c6c978a33b6b6d9a0a874dc3723e0af3966 (diff) |
So close to getting landscape working, it hurts :(.
Diffstat (limited to 'UICaboodle/BrowserView.mm')
-rw-r--r-- | UICaboodle/BrowserView.mm | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm index f479dd5..207d382 100644 --- a/UICaboodle/BrowserView.mm +++ b/UICaboodle/BrowserView.mm @@ -12,6 +12,8 @@ extern NSString * const kCAFilterNearest; #define ForSaurik 1 +static bool Wildcat_; + static CFArrayRef (*$GSSystemCopyCapability)(CFStringRef); static CFArrayRef (*$GSSystemGetCapability)(CFStringRef); static Class $UIFormAssistant; @@ -171,8 +173,12 @@ static Class $UIWebBrowserView; $UIFormAssistant = objc_getClass("UIFormAssistant"); $UIWebBrowserView = objc_getClass("UIWebBrowserView"); - if ($UIWebBrowserView == nil) + if ($UIWebBrowserView == nil) { + Wildcat_ = false; $UIWebBrowserView = objc_getClass("UIWebDocumentView"); + } else { + Wildcat_ = true; + } } - (void) dealloc { @@ -288,6 +294,8 @@ static Class $UIWebBrowserView; context:@"submit" ] autorelease]; + [sheet setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [sheet setNumberOfRows:1]; [sheet popupAlertAnimated:YES]; } @@ -420,6 +428,8 @@ static Class $UIWebBrowserView; context:@"sensitive" ] autorelease]; + [sheet setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + NSString *host(@"XXX"); [sheet setNumberOfRows:1]; @@ -462,6 +472,8 @@ static Class $UIWebBrowserView; context:@"alert" ] autorelease]; + [sheet setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [sheet setBodyText:message]; [sheet popupAlertAnimated:YES]; } @@ -479,6 +491,8 @@ static Class $UIWebBrowserView; context:@"confirm" ] autorelease]; + [sheet setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [sheet setNumberOfRows:1]; [sheet setBodyText:message]; [sheet popupAlertAnimated:YES]; @@ -825,6 +839,8 @@ static Class $UIWebBrowserView; context:@"challenge" ] autorelease]; + [sheet setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [sheet setNumberOfRows:1]; [sheet addTextFieldWithValue:@"" label:UCLocalize("USERNAME")]; @@ -1226,7 +1242,7 @@ static Class $UIWebBrowserView; struct CGRect bounds = [self bounds]; - scroller_ = [[UIScrollView alloc] initWithFrame:bounds]; + scroller_ = [[objc_getClass(Wildcat_ ? "UIScrollView" : "UIScroller") alloc] initWithFrame:bounds]; [self addSubview:scroller_]; [scroller_ setFixedBackgroundPattern:YES]; @@ -1235,24 +1251,32 @@ static Class $UIWebBrowserView; [scroller_ setScrollingEnabled:YES]; [scroller_ setClipsSubviews:YES]; - if (false) + if (!Wildcat_) [scroller_ setAllowsRubberBanding:YES]; [scroller_ setDelegate:self]; [scroller_ setBounces:YES]; - if (false) { + if (!Wildcat_) { [scroller_ setScrollHysteresis:8]; [scroller_ setThumbDetectionEnabled:NO]; [scroller_ setDirectionalScrolling:YES]; - [scroller_ setScrollDecelerationFactor:0.99]; /* 0.989324 */ + //[scroller_ setScrollDecelerationFactor:0.99]; /* 0.989324 */ [scroller_ setEventMode:YES]; } + if (Wildcat_) { + UIScrollView *scroller((UIScrollView *)scroller_); + //[scroller setDirectionalLockEnabled:NO]; + [scroller setDelaysContentTouches:NO]; + //[scroller setScrollsToTop:NO]; + //[scroller setCanCancelContentTouches:NO]; + } + [scroller_ setShowBackgroundShadow:NO]; /* YES */ //[scroller_ setAllowsRubberBanding:YES]; /* Vertical */ - if (false) + if (!Wildcat_) [scroller_ setAdjustForContentSizeChange:YES]; /* NO */ CGRect webrect = [scroller_ bounds]; @@ -1366,8 +1390,10 @@ static Class $UIWebBrowserView; indicator_ = [[UIProgressIndicator alloc] initWithFrame:CGRectMake(bounds.size.width - 39, 12, indsize.width, indsize.height)]; [indicator_ setStyle:UIProgressIndicatorStyleMediumWhite]; - [self setAutoresizingMask:UIViewAutoresizingFlexibleHeight]; - [scroller_ setAutoresizingMask:UIViewAutoresizingFlexibleHeight]; + [self setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [scroller_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; + [indicator_ setAutoresizingMask:UIViewAutoresizingFlexibleLeftMargin]; + [webview_ setAutoresizingMask:(UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight)]; /*UIWebView *test([[[UIWebView alloc] initWithFrame:[self bounds]] autorelease]); [test loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.saurik.com/"]]]; |