From: Jay Freeman (saurik) Date: Mon, 21 Jun 2010 12:55:41 +0000 (+0000) Subject: For the sake of argument, let's assume this code was a good idea. X-Git-Tag: v0.9.4000~38 X-Git-Url: https://git.saurik.com/cydget.git/commitdiff_plain/d826762de95d7d584e02a869966e6114b3e8eda9 For the sake of argument, let's assume this code was a good idea. --- diff --git a/LockScreen.mm b/LockScreen.mm index 5e26660..cf6704d 100644 --- a/LockScreen.mm +++ b/LockScreen.mm @@ -42,6 +42,7 @@ #import #import +#import #import #import @@ -117,6 +118,8 @@ while (false) @end static Class $CydgetController(objc_getClass("CydgetController")); +static Class $UIFormAssistant(objc_getClass("CydgetController")); +static Class $SBStatusBarController(objc_getClass("SBStatusBarController")); @interface NSString (UIKit) - (NSString *) stringByAddingPercentEscapes; @@ -423,7 +426,7 @@ class Pcre { - (id) init { CGRect frame = {{0, 0}, {320, 480}}; - frame.size.height -= GSDefaultStatusBarHeight(); + frame.size.height -= [[[$SBStatusBarController sharedStatusBarController] statusBarView] frame].size.height; if ((self = [super initWithFrame:frame]) != nil) { loading_ = [[NSMutableSet alloc] initWithCapacity:3]; @@ -470,9 +473,8 @@ class Pcre { if ([document_ respondsToSelector:@selector(enableReachability)]) [document_ enableReachability]; - - [document_ setAllowsMessaging:YES]; - + if ([document_ respondsToSelector:@selector(setAllowsMessaging:)]) + [document_ setAllowsMessaging:YES]; if ([document_ respondsToSelector:@selector(useSelectionAssistantWithMode:)]) [document_ useSelectionAssistantWithMode:0]; @@ -526,7 +528,9 @@ class Pcre { [document_ setDelegate:self]; [document_ setGestureDelegate:self]; - [document_ setFormEditingDelegate:self]; + + if ([document_ respondsToSelector:@selector(setFormEditingDelegate:)]) + [document_ setFormEditingDelegate:self]; [document_ setInteractionDelegate:self]; [scroller_ addSubview:document_]; @@ -619,10 +623,10 @@ class Pcre { /* XXX: WebThreadLock? */ - (void) _fixScroller:(CGRect)bounds { float extra; - if (!editing_) + if (!editing_ || $UIFormAssistant == nil) extra = 0; else { - UIFormAssistant *assistant([UIFormAssistant sharedFormAssistant]); + UIFormAssistant *assistant([$UIFormAssistant sharedFormAssistant]); CGRect peripheral([assistant peripheralFrame]); extra = peripheral.size.height; } diff --git a/control b/control index ce1faae..8fbd532 100644 --- a/control +++ b/control @@ -3,7 +3,7 @@ Priority: optional Section: Development Maintainer: Jay Freeman (saurik) Architecture: iphoneos-arm -Version: 0.9.3141-1 +Version: 0.9.3160-1 Description: framework for managing lock screen plugins Name: Cydget Depends: mobilesubstrate (>= 0.9.2587-1), firmware (>= 2.2), preferenceloader, apr-lib, pcre, cycript (>= 0.9.292-1)