]> git.saurik.com Git - cydia.git/commitdiff
Provide some more infraustructure around WAKWindow.
authorJay Freeman (saurik) <saurik@saurik.com>
Thu, 24 Mar 2011 16:25:55 +0000 (09:25 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Thu, 24 Mar 2011 16:31:03 +0000 (09:31 -0700)
MobileCydia.mm
iPhonePrivate.h

index 6008a27b9bf098ae813755359cb7378e0b965f47..74c8993f08267d1833d4d722544c6be160b387a3 100644 (file)
@@ -10354,8 +10354,14 @@ MSHook(id, NSURLConnection$init$, NSURLConnection *self, SEL _cmd, NSURLRequest
     } return self;
 }
 
-static CGSize $WAKWindow$screenSize(id self, SEL _cmd) {
-    return [[UIScreen mainScreen] bounds].size;
+Class $WAKWindow;
+
+static CGSize $WAKWindow$screenSize(WAKWindow self, SEL _cmd) {
+    CGSize size([[UIScreen mainScreen] bounds].size);
+    /*if ([$WAKWindow respondsToSelector:@selector(hasLandscapeOrientation)])
+        if ([$WAKWindow hasLandscapeOrientation])
+            std::swap(size.width, size.height);*/
+    return size;
 }
 
 int main(int argc, char *argv[]) {
@@ -10424,7 +10430,8 @@ int main(int argc, char *argv[]) {
     /* Library Hacks {{{ */
     class_addMethod(objc_getClass("DOMNodeList"), @selector(countByEnumeratingWithState:objects:count:), (IMP) &DOMNodeList$countByEnumeratingWithState$objects$count$, "I20@0:4^{NSFastEnumerationState}8^@12I16");
 
-    if (Class $WAKWindow = objc_getClass("WAKWindow"))
+    $WAKWindow = objc_getClass("WAKWindow");
+    if ($WAKWindow != NULL)
         if (Method method = class_getInstanceMethod($WAKWindow, @selector(screenSize)))
             method_setImplementation(method, (IMP) &$WAKWindow$screenSize);
 
index c4855bb09c94fa21980f4fee1f6ed4b05551e551..fc85776df7fb1b438b2ba26e7fd363274e6cc9df 100644 (file)
@@ -166,6 +166,11 @@ typedef enum {
 - (NSString *) _typeDescription;
 @end
 // }}}
+// @interface WAK* : * {{{
+@interface WAKWindow : NSObject
++ (BOOL) hasLandscapeOrientation;
+@end
+// }}}
 
 // @interface NS* (*) {{{
 @interface NSMutableURLRequest (Apple)