diff options
author | Jay Freeman (saurik) <saurik@saurik.com> | 2010-10-04 02:40:27 -0700 |
---|---|---|
committer | Jay Freeman (saurik) <saurik@saurik.com> | 2010-10-04 09:45:29 +0000 |
commit | c21004b921c67b3e7748cc1f0c53d02deec1ebca (patch) | |
tree | ac3a8f0eacec9e3a9ed56d073bfc6567c4eed502 /UICaboodle | |
parent | 6d16684908fdd65f8cc7e000f8c28624a4aa0516 (diff) |
Rewrote the build environment from scratch.
Diffstat (limited to 'UICaboodle')
-rw-r--r-- | UICaboodle/BrowserView.h | 25 | ||||
-rw-r--r-- | UICaboodle/BrowserView.mm | 79 | ||||
-rw-r--r-- | UICaboodle/RVBook.h | 8 | ||||
-rw-r--r-- | UICaboodle/RVBook.mm | 8 | ||||
-rw-r--r-- | UICaboodle/RVPage.h | 1 | ||||
-rw-r--r-- | UICaboodle/ResetView.h | 10 | ||||
-rw-r--r-- | UICaboodle/ResetView.mm | 24 |
7 files changed, 72 insertions, 83 deletions
diff --git a/UICaboodle/BrowserView.h b/UICaboodle/BrowserView.h index ec779c9..2f77f84 100644 --- a/UICaboodle/BrowserView.h +++ b/UICaboodle/BrowserView.h @@ -1,22 +1,9 @@ #import "ResetView.h" -#include <WebKit/DOMCSSPrimitiveValue.h> -#include <WebKit/DOMCSSStyleDeclaration.h> -#include <WebKit/DOMDocument.h> -#include <WebKit/DOMHTMLBodyElement.h> #include <WebKit/DOMNodeList.h> -#include <WebKit/DOMRGBColor.h> - #include <WebKit/WebFrame.h> -#include <WebKit/WebPolicyDelegate.h> -#include <WebKit/WebPreferences.h> #include <WebKit/WebScriptObject.h> - -#import <WebKit/WebView.h> -#import <WebKit/WebView-WebPrivate.h> - -#include <WebCore/Page.h> -#include <WebCore/Settings.h> +#include <WebKit/WebView.h> #import <JavaScriptCore/JavaScriptCore.h> @@ -43,7 +30,9 @@ - (UCViewController *) pageForURL:(NSURL *)url hasTag:(int *)tag; @end -@interface BrowserController : UCViewController { +@interface BrowserController : UCViewController < + HookProtocol +> { UIScroller *scroller_; UIWebDocumentView *document_; UIProgressIndicator *indicator_; @@ -118,4 +107,10 @@ - (bool) promptForSensitive:(NSString *)name; - (bool) allowSensitiveRequests; +- (void) alertView:(UIAlertView *)alert clickedButtonAtIndex:(NSInteger)button; +- (void) applyRightButton; + +- (void) _startLoading; +- (void) close; + @end
\ No newline at end of file diff --git a/UICaboodle/BrowserView.mm b/UICaboodle/BrowserView.mm index 5fa21e1..8dd2afa 100644 --- a/UICaboodle/BrowserView.mm +++ b/UICaboodle/BrowserView.mm @@ -1,12 +1,28 @@ +#include <UIKit/UIKit.h> +#include "iPhonePrivate.h" + +#include "UCPlatform.h" + #include <UICaboodle/BrowserView.h> #include <UICaboodle/UCLocalize.h> -#import <QuartzCore/CALayer.h> +//#include <QuartzCore/CALayer.h> // XXX: fix the minimum requirement extern NSString * const kCAFilterNearest; #include <WebCore/WebCoreThread.h> -#include <WebKit/WebPreferences-WebPrivate.h> + +#include <WebKit/WebPolicyDelegate.h> +#include <WebKit/WebPreferences.h> + +#include <WebKit/DOMCSSPrimitiveValue.h> +#include <WebKit/DOMCSSStyleDeclaration.h> +#include <WebKit/DOMDocument.h> +#include <WebKit/DOMHTMLBodyElement.h> +#include <WebKit/DOMRGBColor.h> + +//#include <WebCore/Page.h> +//#include <WebCore/Settings.h> #include "substrate.h" @@ -19,12 +35,10 @@ static CFArrayRef (*$GSSystemGetCapability)(CFStringRef); static Class $UIFormAssistant; static Class $UIWebBrowserView; -@interface NSString (UIKit) -- (NSString *) stringByAddingPercentEscapes; -@end - /* Indirect Delegate {{{ */ -@interface IndirectDelegate : NSObject { +@interface IndirectDelegate : NSObject < + HookProtocol +> { _transient volatile id delegate_; } @@ -89,6 +103,11 @@ static Class $UIWebBrowserView; return nil; } +- (void) didDismissModalViewController { + if (delegate_ != nil) + return [delegate_ didDismissModalViewController]; +} + - (IMP) methodForSelector:(SEL)sel { if (IMP method = [super methodForSelector:sel]) return method; @@ -125,11 +144,19 @@ static Class $UIWebBrowserView; /* }}} */ @interface WebView (UICaboodle) -- (void) setScriptDebugDelegate:(id)delegate; ++ (BOOL) _canHandleRequest:(NSURLRequest *)request; - (void) _setFormDelegate:(id)delegate; +- (void) _setLayoutInterval:(float)interval; +- (void) setScriptDebugDelegate:(id)delegate; - (void) _setUIKitDelegate:(id)delegate; +- (void) _setUsesLoaderCache:(BOOL)uses; - (void) setWebMailDelegate:(id)delegate; -- (void) _setLayoutInterval:(float)interval; +@end + +@interface WebPreferences (Apple) ++ (void) _setInitialDefaultTextEncodingToSystemEncoding; +- (void) _setLayoutInterval:(NSInteger)interval; +- (void) setOfflineWebApplicationCacheEnabled:(BOOL)enabled; @end @implementation WebScriptObject (UICaboodle) @@ -356,7 +383,7 @@ static Class $UIWebBrowserView; if ([scroller_ respondsToSelector:@selector(setScrollerIndicatorSubrect:)]) [scroller_ setScrollerIndicatorSubrect:subrect]; - [document_ setValue:[NSValue valueWithSize:NSMakeSize(subrect.size.width, subrect.size.height)] forGestureAttribute:UIGestureAttributeVisibleSize]; + [document_ setValue:[NSValue valueWithSize:CGSizeMake(subrect.size.width, subrect.size.height)] forGestureAttribute:UIGestureAttributeVisibleSize]; CGSize size(size_); size.height += extra; @@ -581,7 +608,7 @@ static Class $UIWebBrowserView; } - (void) _openMailToURL:(NSURL *)url { - [UIApp openURL:url];// asPanel:YES]; + [[UIApplication sharedApplication] openURL:url];// asPanel:YES]; } - (void) webView:(WebView *)sender willBeginEditingFormElement:(id)element { @@ -675,7 +702,7 @@ static Class $UIWebBrowserView; WebView *webview([document_ webView]); if (frame == [webview mainFrame]) - [UIApp openURL:[request URL]]; + [[UIApplication sharedApplication] openURL:[request URL]]; } } @@ -728,7 +755,7 @@ static Class $UIWebBrowserView; )) { url = open; open: - [UIApp openURL:url]; + [[UIApplication sharedApplication] openURL:url]; goto ignore; } @@ -1027,17 +1054,13 @@ static Class $UIWebBrowserView; [self _startLoading]; } -- (UINavigationButtonStyle) rightButtonStyle { +- (UIBarButtonItemStyle) rightButtonStyle { if (style_ == nil) normal: - return UINavigationButtonStyleNormal; + return UIBarButtonItemStylePlain; else if ([style_ isEqualToString:@"Normal"]) - return UINavigationButtonStyleNormal; - else if ([style_ isEqualToString:@"Back"]) - return UINavigationButtonStyleBack; + return UIBarButtonItemStylePlain; else if ([style_ isEqualToString:@"Highlighted"]) - return UINavigationButtonStyleHighlighted; - else if ([style_ isEqualToString:@"Destructive"]) - return UINavigationButtonStyleDestructive; + return UIBarButtonItemStyleDone; else goto normal; } @@ -1522,8 +1545,12 @@ static Class $UIWebBrowserView; WebView *webview([document_ webView]); WebFrame *frame([webview mainFrame]); + WebPreferences *preferences([webview preferences]); + + bool maybe([preferences javaScriptCanOpenWindowsAutomatically]); + [preferences setJavaScriptCanOpenWindowsAutomatically:NO]; - id _private(MSHookIvar<id>(webview, "_private")); + /*id _private(MSHookIvar<id>(webview, "_private")); WebCore::Page *page(_private == nil ? NULL : MSHookIvar<WebCore::Page *>(_private, "page")); WebCore::Settings *settings(page == NULL ? NULL : page->settings()); @@ -1533,7 +1560,7 @@ static Class $UIWebBrowserView; else { no = settings->JavaScriptCanOpenWindowsAutomatically(); settings->setJavaScriptCanOpenWindowsAutomatically(true); - } + }*/ if (UIWindow *window = [[self view] window]) if (UIResponder *responder = [window firstResponder]) @@ -1543,8 +1570,10 @@ static Class $UIWebBrowserView; JSGlobalContextRef context([frame globalContext]); JSObjectCallAsFunction(context, object, NULL, 0, NULL, NULL); - if (settings != NULL) - settings->setJavaScriptCanOpenWindowsAutomatically(no); + /*if (settings != NULL) + settings->setJavaScriptCanOpenWindowsAutomatically(no);*/ + + [preferences setJavaScriptCanOpenWindowsAutomatically:maybe]; WebThreadUnlock(); } diff --git a/UICaboodle/RVBook.h b/UICaboodle/RVBook.h index b605cc6..09b1baf 100644 --- a/UICaboodle/RVBook.h +++ b/UICaboodle/RVBook.h @@ -2,10 +2,14 @@ #import <UIKit/UIKit.h> +@protocol HookProtocol +- (void) didDismissModalViewController; +@end + @interface UCNavigationController : UINavigationController { - id hook_; + id<HookProtocol> hook_; } -- (void) setHook:(id)hook; +- (void) setHook:(id<HookProtocol>)hook; @end diff --git a/UICaboodle/RVBook.mm b/UICaboodle/RVBook.mm index 2271cee..ba201ae 100644 --- a/UICaboodle/RVBook.mm +++ b/UICaboodle/RVBook.mm @@ -1,12 +1,6 @@ #import "RVBook.h" -#import <UIKit/UINavigationBar.h> -#import <UIKit/UINavigationItem.h> - -#import <UIKit/UITransitionView.h> - -#import <UIKit/UIView-Geometry.h> -#import <UIKit/UIView-Hierarchy.h> +#import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import <CoreGraphics/CGGeometry.h> diff --git a/UICaboodle/RVPage.h b/UICaboodle/RVPage.h index 270c248..d2f84fa 100644 --- a/UICaboodle/RVPage.h +++ b/UICaboodle/RVPage.h @@ -6,5 +6,6 @@ id delegate_; } - (void)setDelegate:(id)delegate; +- (void) reloadData; @end diff --git a/UICaboodle/ResetView.h b/UICaboodle/ResetView.h index 1f92590..9f9fafb 100644 --- a/UICaboodle/ResetView.h +++ b/UICaboodle/ResetView.h @@ -8,17 +8,7 @@ - (void) clearView; @end -@interface UITable (RVBook) -- (void) resetViewAnimated:(BOOL)animated; -- (void) clearView; -@end - @interface UITableView (RVBook) - (void) resetViewAnimated:(BOOL)animated; - (void) clearView; @end - -@interface UISectionList (RVBook) -- (void) resetViewAnimated:(BOOL)animated; -- (void) clearView; -@end diff --git a/UICaboodle/ResetView.mm b/UICaboodle/ResetView.mm index bd1c8ee..ffdb043 100644 --- a/UICaboodle/ResetView.mm +++ b/UICaboodle/ResetView.mm @@ -22,18 +22,6 @@ @end -@implementation UITable (RVBook) - -- (void) resetViewAnimated:(BOOL)animated { - [self selectRow:-1 byExtendingSelection:NO withFade:animated]; -} - -- (void) clearView { - [self clearAllData]; -} - -@end - @implementation UITableView (RVBook) - (void) resetViewAnimated:(BOOL)animated { @@ -47,15 +35,3 @@ } @end - -@implementation UISectionList (RVBook) - -- (void) resetViewAnimated:(BOOL)animated { - [[self table] resetViewAnimated:animated]; -} - -- (void) clearView { - [[self table] clearView]; -} - -@end |