Permalink
Browse files

Adding tablet stand-in

  • Loading branch information...
1 parent 51f7a69 commit 0a970a5d3198808a285fffc42ccf74fe0091bc92 Erica Sadun committed Jan 14, 2010
Showing with 49 additions and 1 deletion.
  1. +5 −0 UIDevice-Hardware.h
  2. +44 −1 UIDevice-Hardware.m
View
@@ -24,6 +24,8 @@
#define IPROD_1G_NAMESTRING @"iProd 1G"
#define IPROD_2G_NAMESTRING @"iProd 2G"
+#define TABLET_1G_NAMESTRING @"Tablet"
+
#define IPOD_FAMILY_UNKNOWN_DEVICE @"Unknown device in the iPhone/iPod family"
#define IPHONE_SIMULATOR_NAMESTRING @"iPhone Simulator"
@@ -40,6 +42,7 @@ typedef enum {
UIDevice2GPlusiPod,
UIDevice3GiPod,
UIDevice4GiPod,
+ UIDevice1GTablet,
UIDeviceUnknowniPhone,
UIDeviceUnknowniPod,
UIDeviceIFPGA,
@@ -50,6 +53,7 @@ typedef enum {
typedef enum {
UIDeviceFirmware2,
UIDeviceFirmware3,
+ UIDeviceFirmware4,
} UIDeviceFirmware;
enum {
@@ -81,6 +85,7 @@ enum {
UIDeviceSupportsNike = 1 << 25,
UIDeviceSupportsPiezoClicker = 1 << 26,
UIDeviceSupportsVolumeButtons = 1 << 27,
+ UIDeviceSupportsEnhancedMultitouch = 1 << 28, // http://www.boygeniusreport.com/2010/01/13/apples-tablet-is-an-iphone-on-steroids/
};
/*
View
@@ -32,6 +32,8 @@ @implementation UIDevice (Hardware)
iPod3,1 -> iPod touch 3G
i386 -> iPhone Simulator
+
+ Tablet1,1 -> Tablet 1G
*/
@@ -122,6 +124,8 @@ - (NSUInteger) platformType
if ([platform isEqualToString:@"iPod3,1"]) return UIDevice3GiPod;
if ([platform isEqualToString:@"iPod4,1"]) return UIDevice4GiPod;
+ // if ([platform isEqualToString:@"Tablet1,1"]) return UIDevice1GTablet; // space holder
+
if ([platform hasPrefix:@"iPhone"]) return UIDeviceUnknowniPhone;
if ([platform hasPrefix:@"iPod"]) return UIDeviceUnknowniPod;
@@ -145,12 +149,14 @@ - (NSString *) platformString
case UIDevice4GiPod: return IPOD_4G_NAMESTRING;
case UIDeviceUnknowniPod: return IPOD_UNKNOWN_NAMESTRING;
+ case UIDevice1GTablet : return TABLET_1G_NAMESTRING;
+
case UIDeviceiPhoneSimulator: return IPHONE_SIMULATOR_NAMESTRING;
case UIDeviceiProd1G: return IPROD_1G_NAMESTRING;
case UIDeviceiProd2G: return IPROD_2G_NAMESTRING;
case UIDeviceIFPGA: return IFPGA_NAMESTRING;
-
+
default: return IPOD_FAMILY_UNKNOWN_DEVICE;
}
}
@@ -354,6 +360,39 @@ - (NSUInteger) platformCapabilities
);
case UIDeviceUnknowniPod: return 0;
+ case UIDevice1GiPod:
+ return
+ (// UIDeviceSupportsTelephony |
+ // UIDeviceSupportsSMS |
+ // UIDeviceSupportsStillCamera |
+ // UIDeviceSupportsAutofocusCamera |
+ // UIDeviceSupportsVideoCamera |
+ UIDeviceSupportsWifi |
+ UIDeviceSupportsAccelerometer |
+ UIDeviceSupportsLocationServices |
+ // UIDeviceSupportsGPS |
+ // UIDeviceSupportsMagnetometer |
+ UIDeviceSupportsBuiltInMicrophone |
+ UIDeviceSupportsExternalMicrophone |
+ UIDeviceSupportsOPENGLES1_1 |
+ UIDeviceSupportsOPENGLES2 |
+ UIDeviceSupportsBuiltInSpeaker |
+ // UIDeviceSupportsVibration |
+ // UIDeviceSupportsBuiltInProximitySensor |
+ UIDeviceSupportsAccessibility |
+ UIDeviceSupportsVoiceOver |
+ UIDeviceSupportsVoiceControl |
+ UIDeviceSupportsPeerToPeer |
+ UIDeviceSupportsARMV7 |
+ UIDeviceSupportsBrightnessSensor |
+ UIDeviceSupportsEncodeAAC |
+ UIDeviceSupportsBluetooth |
+ UIDeviceSupportsNike |
+ // UIDeviceSupportsPiezoClicker |
+ UIDeviceSupportsVolumeButtons |
+ UIDeviceSupportsEnhancedMultitouch
+ );
+
case UIDeviceiPhoneSimulator:
return
(// UIDeviceSupportsTelephony |
@@ -428,6 +467,8 @@ - (NSArray *) capabilityArray
if (flags & UIDeviceSupportsPiezoClicker) [array addObject:@"Piezo clicker"];
if (flags & UIDeviceSupportsVolumeButtons) [array addObject:@"Physical volume rocker"];
+ if (flags & UIDeviceSupportsEnhancedMultitouch) [array addObject:@"Enhanced Multitouch"];
+
return array;
}
@@ -492,6 +533,8 @@ - (NSString *) platformCode
case UIDevice3GiPod: return @"N18";
case UIDeviceUnknowniPod: return IPOD_UNKNOWN_NAMESTRING;
+ case UIDevice1GTablet: return @"K48AP"; // http://www.boygeniusreport.com/2010/01/13/apples-tablet-is-an-iphone-on-steroids/
+
case UIDeviceiPhoneSimulator: return IPHONE_SIMULATOR_NAMESTRING;
default: return IPOD_FAMILY_UNKNOWN_DEVICE;

0 comments on commit 0a970a5

Please sign in to comment.