summaryrefslogtreecommitdiff
path: root/MobileCydia.mm
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-24 09:25:55 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-24 09:31:03 -0700
commitb1497b56219ae6773df40864729329f8b17f33fa (patch)
tree134b9fe8dd022bfe56b22ce8ff776f2f3305c51d /MobileCydia.mm
parent945812b98ab6e9b6704c55b1f1ea715c577b1b05 (diff)
Provide some more infraustructure around WAKWindow.
Diffstat (limited to 'MobileCydia.mm')
-rw-r--r--MobileCydia.mm13
1 files changed, 10 insertions, 3 deletions
diff --git a/MobileCydia.mm b/MobileCydia.mm
index 6008a27..74c8993 100644
--- a/MobileCydia.mm
+++ b/MobileCydia.mm
@@ -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);