Updated Branches: refs/heads/master 73f77bf0f -> bec1bb0cc
[ios] Renaming macro IsIPad to CDV_IsIPad Project: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/commit/bec1bb0c Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/bec1bb0c Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/bec1bb0c Branch: refs/heads/master Commit: bec1bb0cc051e234c0594680a285b5bef40578ae Parents: c0b09b0 Author: Michal Mocny <mmo...@gmail.com> Authored: Fri Sep 7 13:29:02 2012 -0400 Committer: Andrew Grieve <agri...@chromium.org> Committed: Fri Sep 7 13:38:26 2012 -0400 ---------------------------------------------------------------------- CordovaLib/Classes/CDVAvailability.h | 6 +++--- CordovaLib/Classes/CDVCapture.m | 2 +- CordovaLib/Classes/CDVViewController.m | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/bec1bb0c/CordovaLib/Classes/CDVAvailability.h ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVAvailability.h b/CordovaLib/Classes/CDVAvailability.h index 2fb3b6f..77d05f6 100644 --- a/CordovaLib/Classes/CDVAvailability.h +++ b/CordovaLib/Classes/CDVAvailability.h @@ -56,10 +56,10 @@ */ #define IsAtLeastiOSVersion(X) ([[[UIDevice currentDevice] systemVersion] compare:X options:NSNumericSearch] != NSOrderedAscending) +#define CDV_IsIPad() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] && ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)) + /* Return the string version of the decimal version */ #define CDV_VERSION [NSString stringWithFormat:@"%d.%d.%d", \ (CORDOVA_VERSION_MIN_REQUIRED / 10000), \ (CORDOVA_VERSION_MIN_REQUIRED % 10000) / 100, \ - (CORDOVA_VERSION_MIN_REQUIRED % 10000) % 100 ] - -#define IsIPad() ([[UIDevice currentDevice] respondsToSelector:@selector(userInterfaceIdiom)] && ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad)) \ No newline at end of file + (CORDOVA_VERSION_MIN_REQUIRED % 10000) % 100 ] \ No newline at end of file http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/bec1bb0c/CordovaLib/Classes/CDVCapture.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVCapture.m b/CordovaLib/Classes/CDVCapture.m index 75792f6..4703dac 100644 --- a/CordovaLib/Classes/CDVCapture.m +++ b/CordovaLib/Classes/CDVCapture.m @@ -543,7 +543,7 @@ if (isLessThaniOS4) { NSString* iPadResource = [NSString stringWithFormat:@"%@~ipad.png", resource]; - if (IsIPad() && [UIImage imageNamed:iPadResource]) { + if (CDV_IsIPad() && [UIImage imageNamed:iPadResource]) { return iPadResource; } else { return [NSString stringWithFormat:@"%@.png", resource]; http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/bec1bb0c/CordovaLib/Classes/CDVViewController.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m index 3695b18..da6baa0 100644 --- a/CordovaLib/Classes/CDVViewController.m +++ b/CordovaLib/Classes/CDVViewController.m @@ -590,7 +590,7 @@ // the iPad image (nor retina) differentiation code was not in 3.x, and we have to explicitly set the path if (isLessThaniOS4) { - if (IsIPad()) { + if (CDV_IsIPad()) { return [NSString stringWithFormat:@"%@~ipad.png", resource]; } else { return [NSString stringWithFormat:@"%@.png", resource]; @@ -642,7 +642,7 @@ // default to center of screen as in the original implementation. This will produce the 20px jump CGPoint center = CGPointMake((screenBounds.size.width / 2), (screenBounds.size.height / 2)); - if (IsIPad()) + if (CDV_IsIPad()) { if (!UIDeviceOrientationIsValidInterfaceOrientation(deviceOrientation)) { deviceOrientation = (UIDeviceOrientation)statusBarOrientation; @@ -688,7 +688,7 @@ launchImage = [UIImage imageNamed:[[self class] resolveImageResource:orientedLaunchImageFile]]; if (launchImage == nil) { - NSLog(@"WARNING: Splash-screen image '%@' was not found. Orientation: %d, iPad: %d", orientedLaunchImageFile, deviceOrientation, IsIPad()); + NSLog(@"WARNING: Splash-screen image '%@' was not found. Orientation: %d, iPad: %d", orientedLaunchImageFile, deviceOrientation, CDV_IsIPad()); } self.imageView = [[UIImageView alloc] initWithImage:launchImage];