X-Git-Url: https://git.saurik.com/cydia.git/blobdiff_plain/f98962e5a9e0baa28f1fca154ebaa33c52bfb654..2b5ceba288a3a3de4bceb6767953972b30f97f46:/CyteKit/ViewController.mm diff --git a/CyteKit/ViewController.mm b/CyteKit/ViewController.mm index 1991bcfd..41e7ea9a 100644 --- a/CyteKit/ViewController.mm +++ b/CyteKit/ViewController.mm @@ -1,5 +1,5 @@ /* Cydia - iPhone UIKit Front-End for Debian APT - * Copyright (C) 2008-2014 Jay Freeman (saurik) + * Copyright (C) 2008-2015 Jay Freeman (saurik) */ /* GNU General Public License, Version 3 {{{ */ @@ -19,12 +19,15 @@ **/ /* }}} */ -#include "CyteKit/ViewController.h" +#include "CyteKit/UCPlatform.h" #include #include +#include "CyteKit/ViewController.h" + #include "iPhonePrivate.h" +#include @implementation UIViewController (Cydia) @@ -49,9 +52,24 @@ return nil; } +- (UIViewController *) rootViewController { + UIViewController *base(self); + while ([base parentOrPresentingViewController] != nil) + base = [base parentOrPresentingViewController]; + return base; +} + +- (NSURL *) navigationURL { + return nil; +} + @end -@implementation CyteViewController +@implementation CyteViewController { + _transient id delegate_; + BOOL loaded_; + _H color_; +} - (void) setDelegate:(id)delegate { delegate_ = delegate; @@ -102,28 +120,16 @@ [super unloadData]; } -- (NSURL *) navigationURL { - return nil; -} - -- (NSUInteger) supportedInterfaceOrientations { - extern bool IsWildcat_; - extern CGFloat ScreenScale_; - return IsWildcat_ || ScreenScale_ == 3 ? UIInterfaceOrientationMaskAll : UIInterfaceOrientationMaskPortrait; -} - -- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation { - return ([self supportedInterfaceOrientations] & 1 << orientation) != 0; -} - -- (BOOL) shouldAutorotate { - return YES; -} - - (void) setPageColor:(UIColor *)color { if (color == nil) color = [UIColor groupTableViewBackgroundColor]; color_ = color; } +- (UIColor *) pageColor { + return color_; +} + +#include "InterfaceOrientation.h" + @end