]> git.saurik.com Git - cydia.git/commitdiff
Add dispatchEvent:@"CydiaTouchEnd".
authorJay Freeman (saurik) <saurik@saurik.com>
Sun, 13 Mar 2011 21:29:45 +0000 (14:29 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 14 Mar 2011 12:09:09 +0000 (05:09 -0700)
CyteKit/dispatchEvent.mm
iPhonePrivate.h

index 277d89b24a7365f14fb727757dfd320ebf1806ac..f0e79addf59622bd8f15e2ced8f18aab4cd44859 100644 (file)
 }
 
 @end
+
+MSHook(void, UIWebBrowserView$_webTouchEventsRecognized$, UIWebBrowserView *self, SEL _cmd, UIWebTouchEventsGestureRecognizer *recognizer) {
+    _UIWebBrowserView$_webTouchEventsRecognized$(self, _cmd, recognizer);
+
+    if ([recognizer type] == 8)
+    //if ([[recognizer _typeDescription] isEqualToString:@"WebEventTouchEnd"])
+        [self dispatchEvent:@"CydiaTouchEnd"];
+}
+
+__attribute__((__constructor__)) static void $() {
+    if (Class $UIWebBrowserView = objc_getClass("UIWebBrowserView")) {
+        if (Method method = class_getInstanceMethod($UIWebBrowserView, @selector(_webTouchEventsRecognized:))) {
+            _UIWebBrowserView$_webTouchEventsRecognized$ = reinterpret_cast<void (*)(UIWebBrowserView *, SEL, id)>(method_getImplementation(method));
+            method_setImplementation(method, reinterpret_cast<IMP>(&$UIWebBrowserView$_webTouchEventsRecognized$));
+        }
+    }
+}
index e9df918039d0b652a7a8ba5ae42d1bd561ac5c3c..b5a5959411ecf0055a6a80087b91aa134dc39f78 100644 (file)
@@ -149,6 +149,15 @@ typedef enum {
 + (WebDefaultUIKitDelegate *) sharedUIKitDelegate;
 @end
 // }}}
+// @interface UIWeb* : * {{{
+@interface UIWebBrowserView : UIWebDocumentView
+@end
+
+@interface UIWebTouchEventsGestureRecognizer : UIGestureRecognizer
+- (int) type;
+- (NSString *) _typeDescription;
+@end
+// }}}
 
 // @interface NS* (*) {{{
 @interface NSMutableURLRequest (Apple)