incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From becka...@apache.org
Subject [4/50] git commit: Renamed PhoneGapDelegate to PGAppDelegate. PhoneGapViewController removed. This is a breaking change. The old classes will be re-added later and deprecated for upgrades.
Date Fri, 13 Jan 2012 15:59:06 GMT
Renamed PhoneGapDelegate to PGAppDelegate. PhoneGapViewController removed. This is a breaking change. The old classes will be re-added later and deprecated for upgrades.


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/8b48e442
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/8b48e442
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/8b48e442

Branch: refs/heads/master
Commit: 8b48e442dd151b6bf7200ec3bccf7cb9b5d15af7
Parents: 12e5ddd
Author: shazron <shazron@gmail.com>
Authored: Tue Jan 10 17:50:36 2012 -0800
Committer: shazron <shazron@gmail.com>
Committed: Tue Jan 10 17:50:36 2012 -0800

----------------------------------------------------------------------
 PhoneGap-based Application/Classes/AppDelegate.h  |   10 +-
 PhoneGapLib/Classes/Camera.m                      |    5 +-
 PhoneGapLib/Classes/Capture.m                     |   16 +-
 PhoneGapLib/Classes/Contact.m                     |    2 +-
 PhoneGapLib/Classes/Contacts.m                    |   10 +-
 PhoneGapLib/Classes/Location.m                    |    4 +-
 PhoneGapLib/Classes/PGAppDelegate.h               |   27 ++
 PhoneGapLib/Classes/PGAppDelegate.m               |  211 ++++++++++++++++
 PhoneGapLib/Classes/PGPlugin.h                    |   11 +-
 PhoneGapLib/Classes/PGPlugin.m                    |   12 +-
 PhoneGapLib/Classes/PGSplashScreen.m              |   10 +-
 PhoneGapLib/Classes/PGURLProtocol.m               |    4 +-
 PhoneGapLib/Classes/PGViewController.m            |    8 +-
 PhoneGapLib/Classes/PhoneGapDelegate.h            |   27 --
 PhoneGapLib/Classes/PhoneGapDelegate.m            |  211 ----------------
 PhoneGapLib/Classes/PhoneGapViewController.h      |   18 --
 PhoneGapLib/Classes/Sound.m                       |   27 +--
 PhoneGapLib/PhoneGapLib.xcodeproj/project.pbxproj |   30 +--
 18 files changed, 299 insertions(+), 344 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGap-based Application/Classes/AppDelegate.h
----------------------------------------------------------------------
diff --git a/PhoneGap-based Application/Classes/AppDelegate.h b/PhoneGap-based Application/Classes/AppDelegate.h
index 45815aa..54610db 100644
--- a/PhoneGap-based Application/Classes/AppDelegate.h	
+++ b/PhoneGap-based Application/Classes/AppDelegate.h	
@@ -8,14 +8,14 @@
 
 #import <UIKit/UIKit.h>
 #ifdef PHONEGAP_FRAMEWORK
-	#import <PhoneGap/PhoneGapDelegate.h>
-    #import <PhoneGap/PhoneGapViewController.h>
+	#import <PhoneGap/PGAppDelegate.h>
+    #import <PhoneGap/PGViewController.h>
 #else
-	#import "PhoneGapDelegate.h"
-    #import "PhoneGapViewController.h"
+	#import "PGAppDelegate.h"
+    #import "PGViewController.h"
 #endif
 
-@interface AppDelegate : PhoneGapDelegate < PGCommandDelegate > {
+@interface AppDelegate : PGAppDelegate < PGCommandDelegate > {
 
 	NSString* invokeString;
 }

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/Camera.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/Camera.m b/PhoneGapLib/Classes/Camera.m
index 4a47eff..90360d6 100644
--- a/PhoneGapLib/Classes/Camera.m
+++ b/PhoneGapLib/Classes/Camera.m
@@ -11,7 +11,7 @@
 #import "Camera.h"
 #import "NSData+Base64.h"
 #import "Categories.h"
-#import "PhonegapDelegate.h"
+#import "PGAppDelegate.h"
 #import <MobileCoreServices/UTCoreTypes.h>
 
 @implementation PGCamera
@@ -97,8 +97,7 @@
         }
         else 
         { 
-            [[super appViewController] 
-             presentModalViewController:self.pickerController animated:YES]; 
+            [self.viewController presentModalViewController:self.pickerController animated:YES]; 
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/Capture.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/Capture.m b/PhoneGapLib/Classes/Capture.m
index b577351..9ada9e8 100644
--- a/PhoneGapLib/Classes/Capture.m
+++ b/PhoneGapLib/Classes/Capture.m
@@ -8,7 +8,7 @@
 
 #import "Capture.h"
 #import "JSONKit.h"
-#import "PhoneGapDelegate.h"
+#import "PGAppDelegate.h"
 #import "PGViewController.h"
 
 #define kW3CMediaFormatHeight @"height"
@@ -85,7 +85,7 @@
         UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:audioViewController] autorelease];
         self.inUse = YES;
         
-        [self.appViewController presentModalViewController:navController animated: YES];
+        [self.viewController presentModalViewController:navController animated: YES];
     }
         
     if (result) {
@@ -130,7 +130,7 @@
         pickerController.callbackId = callbackId;
         pickerController.mimeType = mode;
 	
-        [[super appViewController] presentModalViewController:pickerController animated:YES];
+        [self.viewController presentModalViewController:pickerController animated:YES];
     }
 
 }
@@ -245,7 +245,7 @@
         // PGImagePicker specific property
         pickerController.callbackId = callbackId;
         
-        [[super appViewController] presentModalViewController:pickerController animated:YES];
+        [self.viewController presentModalViewController:pickerController animated:YES];
     }
     
 }
@@ -339,7 +339,8 @@
     
     if (!mimeType){
         // try to determine mime type if not provided
-        id command = [[self appDelegate].viewController getCommandInstance: @"com.phonegap.file"];
+        PGViewController* vc = (PGViewController*)self.viewController;
+        id command = [vc getCommandInstance: @"com.phonegap.file"];
         bError = !([command isKindOfClass:[PGFile class]]);
         if (!bError) {
             PGFile* pgFile = (PGFile*)command;
@@ -426,7 +427,8 @@
     [fileDict setObject: fullPath forKey:@"fullPath"];
     // determine type
     if(!type) {
-        id command = [[self appDelegate].viewController getCommandInstance: @"com.phonegap.file"];
+        PGViewController* vc = (PGViewController*)self.viewController;
+        id command = [vc getCommandInstance: @"com.phonegap.file"];
         if([command isKindOfClass:[PGFile class]]) {
             PGFile* pgFile = (PGFile*)command;
             NSString* mimeType = [pgFile getMimeTypeFromPath:fullPath];
@@ -763,7 +765,7 @@
 - (void) dismissAudioView: (id) sender
 {
     // called when done button pressed or when error condition to do cleanup and remove view
-    [self.captureCommand.appViewController.modalViewController dismissModalViewControllerAnimated:YES];
+    [self.captureCommand.viewController.modalViewController dismissModalViewControllerAnimated:YES];
     if (!self.resultString) {
         // return error
         PluginResult* result = [PluginResult resultWithStatus:PGCommandStatus_OK messageToErrorObject:self.errorCode];

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/Contact.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/Contact.m b/PhoneGapLib/Classes/Contact.m
index 383d7fa..7b19c21 100644
--- a/PhoneGapLib/Classes/Contact.m
+++ b/PhoneGapLib/Classes/Contact.m
@@ -9,7 +9,7 @@
 
 #import "Contact.h"
 #import "Categories.h"
-#import "PhoneGapDelegate.h"
+#import "PGAppDelegate.h"
 
 #define DATE_OR_NULL(dateObj) ( (aDate != nil) ? (id)([aDate descriptionWithLocale: [NSLocale currentLocale]]) : (id)([NSNull null]) )
 #define IS_VALID_VALUE(value) ((value != nil) && (![value isKindOfClass: [NSNull class]]))

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/Contacts.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/Contacts.m b/PhoneGapLib/Classes/Contacts.m
index 5669607..2dd6ef9 100755
--- a/PhoneGapLib/Classes/Contacts.m
+++ b/PhoneGapLib/Classes/Contacts.m
@@ -9,7 +9,7 @@
 
 #import "Contacts.h"
 #import <UIKit/UIKit.h>
-#import "PhoneGapDelegate.h"
+#import "PGAppDelegate.h"
 #import "Categories.h"
 #import "Notification.h"
 
@@ -75,7 +75,7 @@
 	npController.callbackId = callbackId;
 
 	UINavigationController *navController = [[[UINavigationController alloc] initWithRootViewController:npController] autorelease];
-	[[super appViewController] presentModalViewController:navController animated: YES];
+	[self.viewController presentModalViewController:navController animated: YES];
  
 }
 
@@ -122,7 +122,7 @@
 
         [navController pushViewController:personController animated:YES];
 
-		[self.appViewController presentModalViewController:navController animated: YES];
+		[self.viewController presentModalViewController:navController animated: YES];
 
 		if (bEdit) {
             // create the editing controller and push it onto the stack
@@ -160,7 +160,7 @@
 	pickerController.selectedId = kABRecordInvalidID;
 	pickerController.allowsEditing = (BOOL)[options existsValue:@"true" forKey:@"allowsEditing"];
 	
-	[[super appViewController] presentModalViewController:pickerController animated: YES];
+	[self.viewController presentModalViewController:pickerController animated: YES];
 }
 
 - (BOOL) peoplePickerNavigationController:(ABPeoplePickerNavigationController*)peoplePicker 
@@ -462,7 +462,7 @@
     [super viewDidDisappear: animated];
     // I couldn't find the appViewController in the hierarchy of this UIViewController 
     // so using the passed ContactPlugin to access it.
-    [self.contactsPlugin.appViewController dismissModalViewControllerAnimated:NO];
+    [self.contactsPlugin.viewController dismissModalViewControllerAnimated:NO];
     
 }
 -(void) dealloc

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/Location.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/Location.m b/PhoneGapLib/Classes/Location.m
index 9552438..a5b7840 100755
--- a/PhoneGapLib/Classes/Location.m
+++ b/PhoneGapLib/Classes/Location.m
@@ -8,7 +8,7 @@
 
 #import "Location.h"
 #import "PGViewController.h"
-#import "PhoneGapDelegate.h"
+#import "PGAppDelegate.h"
 
 #pragma mark Constants
 
@@ -361,7 +361,7 @@
     if ([self.locationManager respondsToSelector: @selector(headingOrientation)]) {
         UIDeviceOrientation currentOrientation = [[UIDevice currentDevice] orientation];
         if (currentOrientation != UIDeviceOrientationUnknown) {
-            PhoneGapDelegate* pgDelegate = [self appDelegate];
+            PGAppDelegate* pgDelegate = [self appDelegate];
             PGViewController* pgViewController = pgDelegate.viewController;
             
             if ([pgViewController.supportedOrientations containsObject:

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/PGAppDelegate.h
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/PGAppDelegate.h b/PhoneGapLib/Classes/PGAppDelegate.h
new file mode 100644
index 0000000..71c39d5
--- /dev/null
+++ b/PhoneGapLib/Classes/PGAppDelegate.h
@@ -0,0 +1,27 @@
+/*
+ * PhoneGap is available under *either* the terms of the modified BSD license *or* the
+ * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
+ * 
+ * Copyright (c) 2005-2010, Nitobi Software Inc.
+ * Copyright (c) 2010, IBM Corporation
+ */
+
+#import <UIKit/UIKit.h>
+#import "JSONKit.h"
+
+@class PGViewController;
+
+@interface PGAppDelegate : NSObject <UIApplicationDelegate, UIWebViewDelegate>
+{
+}
+
+@property (nonatomic, readwrite, retain) IBOutlet UIWindow* window;
+@property (nonatomic, readonly, retain) IBOutlet PGViewController* viewController;
+
+- (void)applicationDidEnterBackground:(UIApplication *)application;
+- (void)applicationWillEnterForeground:(UIApplication *)application;
+- (void)applicationWillResignActive:(UIApplication *)application;
+- (void)applicationWillTerminate:(UIApplication *)application;
+
+@end
+

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/PGAppDelegate.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/PGAppDelegate.m b/PhoneGapLib/Classes/PGAppDelegate.m
new file mode 100644
index 0000000..0145b78
--- /dev/null
+++ b/PhoneGapLib/Classes/PGAppDelegate.m
@@ -0,0 +1,211 @@
+/*
+ * PhoneGap is available under *either* the terms of the modified BSD license *or* the
+ * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
+ * 
+ * Copyright (c) 2005-2010, Nitobi Software Inc.
+ * Copyright (c) 2010, IBM Corporation
+ */
+
+#import <UIKit/UIKit.h>
+#import <CoreLocation/CoreLocation.h>
+
+#import "Location.h"
+#import "Sound.h"
+#import "DebugConsole.h"
+#import "Connection.h"
+
+#import "PGURLProtocol.h"
+#import "PGWhitelist.h"
+#import "InvokedUrlCommand.h"
+#import "PGAppDelegate.h"
+#import "PGViewController.h"
+#import "PGPlugin.h"
+
+// class extension
+@interface PGAppDelegate ()
+
+// readwrite access for self
+
+@property (nonatomic, readwrite, retain) IBOutlet PGViewController* viewController;
+
+@end
+
+
+@implementation PGAppDelegate
+
+@synthesize window, viewController;
+
+- (id) init
+{
+    self = [super init];
+    if (self != nil) {
+        // Turn on cookie support ( shared with our app only! )
+        NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; 
+        [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
+        
+        [PGURLProtocol registerPGHttpURLProtocol];
+    }
+    return self; 
+}
+
+/**
+ * This is main kick off after the app inits, the views and Settings are setup here.
+ */
+- (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
+{    
+    CGRect screenBounds = [ [ UIScreen mainScreen ] bounds ];
+    self.window = [ [ [ UIWindow alloc ] initWithFrame:screenBounds ] autorelease ];
+    self.window.autoresizesSubviews = YES;
+    
+    CGRect viewBounds = [[UIScreen mainScreen] applicationFrame];
+    viewBounds.origin = screenBounds.origin;
+    self.viewController = [[[PGViewController alloc] init] autorelease];
+    self.viewController.useSplashScreen = YES;
+    self.viewController.view.bounds = viewBounds;
+    
+    // check whether the current orientation is supported: if it is, keep it, rather than forcing a rotation
+    BOOL forceStartupRotation = YES;
+    UIDeviceOrientation curDevOrientation = [[UIDevice currentDevice] orientation];
+
+    if (UIDeviceOrientationUnknown == curDevOrientation) {
+        // UIDevice isn't firing orientation notifications yet… go look at the status bar
+        curDevOrientation = (UIDeviceOrientation)[[UIApplication sharedApplication] statusBarOrientation];
+    }
+
+    if (UIDeviceOrientationIsValidInterfaceOrientation(curDevOrientation)) {
+        for (NSNumber *orient in self.viewController.supportedOrientations) {
+            if ([orient intValue] == curDevOrientation) {
+                forceStartupRotation = NO;
+                break;
+            }
+        }
+    } 
+    
+    if (forceStartupRotation) {
+        NSLog(@"supportedOrientations: %@", self.viewController.supportedOrientations);
+        // The first item in the supportedOrientations array is the start orientation (guaranteed to be at least Portrait)
+        UIInterfaceOrientation newOrient = [[self.viewController.supportedOrientations objectAtIndex:0] intValue];
+        NSLog(@"PhoneGapDelegate forcing status bar to: %d from: %d",newOrient,curDevOrientation);
+        [[UIApplication sharedApplication] setStatusBarOrientation:newOrient];
+    }
+    
+    [self.window addSubview:self.viewController.view];
+    [self.window makeKeyAndVisible];
+    
+    return YES;
+}
+
+- (NSString*) appURLScheme
+{
+    NSString* URLScheme = nil;
+    
+    NSArray *URLTypes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleURLTypes"];
+    if(URLTypes != nil ) {
+        NSDictionary* dict = [URLTypes objectAtIndex:0];
+        if(dict != nil ) {
+            NSArray* URLSchemes = [dict objectForKey:@"CFBundleURLSchemes"];
+            if( URLSchemes != nil ) {    
+                URLScheme = [URLSchemes objectAtIndex:0];
+            }
+        }
+    }
+    
+    return URLScheme;
+}
+
+/*
+ This method lets your application know that it is about to be terminated and purged from memory entirely
+*/
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+
+    NSLog(@"applicationWillTerminate");
+    
+    // empty the tmp directory
+    NSFileManager* fileMgr = [[NSFileManager alloc] init];
+    NSError* err = nil;    
+
+    // clear contents of NSTemporaryDirectory 
+    NSString* tempDirectoryPath = NSTemporaryDirectory();
+    NSDirectoryEnumerator* directoryEnumerator = [fileMgr enumeratorAtPath:tempDirectoryPath];    
+    NSString* fileName = nil;
+    BOOL result;
+    
+    while ((fileName = [directoryEnumerator nextObject])) {
+        NSString* filePath = [tempDirectoryPath stringByAppendingPathComponent:fileName];
+        result = [fileMgr removeItemAtPath:filePath error:&err];
+        if (!result && err) {
+            NSLog(@"Failed to delete: %@ (error: %@)", filePath, err);
+        }
+    }    
+    [fileMgr release];
+}
+
+/*
+ This method is called to let your application know that it is about to move from the active to inactive state.
+ You should use this method to pause ongoing tasks, disable timer, ...
+*/
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+    //NSLog(@"%@",@"applicationWillResignActive");
+    [self.viewController.webView stringByEvaluatingJavaScriptFromString:@"PhoneGap.fireDocumentEvent('resign');"];
+}
+
+/*
+ In iOS 4.0 and later, this method is called as part of the transition from the background to the inactive state. 
+ You can use this method to undo many of the changes you made to your application upon entering the background.
+ invariably followed by applicationDidBecomeActive
+*/
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+    //NSLog(@"%@",@"applicationWillEnterForeground");
+    [self.viewController.webView stringByEvaluatingJavaScriptFromString:@"PhoneGap.fireDocumentEvent('resume');"];
+}
+
+// This method is called to let your application know that it moved from the inactive to active state. 
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+    //NSLog(@"%@",@"applicationDidBecomeActive");
+    [self.viewController.webView stringByEvaluatingJavaScriptFromString:@"PhoneGap.fireDocumentEvent('active');"];
+}
+
+/*
+ In iOS 4.0 and later, this method is called instead of the applicationWillTerminate: method 
+ when the user quits an application that supports background execution.
+ */
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+    //NSLog(@"%@",@"applicationDidEnterBackground");
+    [self.viewController.webView stringByEvaluatingJavaScriptFromString:@"PhoneGap.fireDocumentEvent('pause');"];
+}
+
+
+/*
+ Determine the URL passed to this application.
+ Described in http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
+*/
+- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
+{
+    if (!url) { 
+        return NO; 
+    }
+
+    // Do something with the url here
+    NSString* jsString = [NSString stringWithFormat:@"handleOpenURL(\"%@\");", url];
+    [self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];
+    
+    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:PGPluginHandleOpenURLNotification object:url]];
+    
+    return YES;
+}
+
+- (void)dealloc
+{
+    [PluginResult releaseStatus];
+    self.viewController = nil;
+    self.window = nil;
+    
+    [super dealloc];
+}
+
+@end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/PGPlugin.h
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/PGPlugin.h b/PhoneGapLib/Classes/PGPlugin.h
index d910272..5a32a21 100644
--- a/PhoneGapLib/Classes/PGPlugin.h
+++ b/PhoneGapLib/Classes/PGPlugin.h
@@ -19,13 +19,12 @@
 callerFileName:__FILE__ callerFunctionName:__PRETTY_FUNCTION__]) { return; }
 
 
-@class PhoneGapDelegate;
-
 @interface PGPlugin : NSObject {
 }
 
-@property (nonatomic, retain) UIWebView *webView;
-@property (nonatomic, retain) NSDictionary *settings;
+@property (nonatomic, retain) UIWebView* webView;
+@property (nonatomic, retain) NSDictionary* settings;
+@property (nonatomic, retain) UIViewController* viewController;
 
 - (PGPlugin*) initWithWebView:(UIWebView*)theWebView settings:(NSDictionary*)classSettings;
 - (PGPlugin*) initWithWebView:(UIWebView*)theWebView;
@@ -42,8 +41,8 @@ callerFileName:__FILE__ callerFunctionName:__PRETTY_FUNCTION__]) { return; }
  - (void) onOrientationDidChange {}
  */
 
-- (PhoneGapDelegate*) appDelegate;
-- (UIViewController*) appViewController;
+- (id) appDelegate;
+- (UIViewController*) appViewController __attribute__((deprecated)); /* just use the .viewController property in the future */
 
 - (NSString*) writeJavascript:(NSString*)javascript;
 - (NSString*) success:(PluginResult*)pluginResult callbackId:(NSString*)callbackId;

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/PGPlugin.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/PGPlugin.m b/PhoneGapLib/Classes/PGPlugin.m
index 2970aef..2a8c822 100644
--- a/PhoneGapLib/Classes/PGPlugin.m
+++ b/PhoneGapLib/Classes/PGPlugin.m
@@ -10,12 +10,11 @@
 
 
 #import "PGPlugin.h"
-#import "PhoneGapDelegate.h"
+#import "PGAppDelegate.h"
 
 
 @implementation PGPlugin
-@synthesize webView;
-@synthesize settings;
+@synthesize webView, settings, viewController;
 
 
 - (PGPlugin*) initWithWebView:(UIWebView*)theWebView settings:(NSDictionary*)classSettings
@@ -125,14 +124,15 @@
     [super dealloc];
 }
 
-- (PhoneGapDelegate*) appDelegate
+- (id) appDelegate
 {
-	return (PhoneGapDelegate*)[[UIApplication sharedApplication] delegate];
+	return [[UIApplication sharedApplication] delegate];
 }
 
+/* deprecated - just use the viewController property */
 - (UIViewController*) appViewController
 {
-	return (UIViewController*)[self appDelegate].viewController;
+	return self.viewController;
 }
 
 - (NSString*) writeJavascript:(NSString*)javascript

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/PGSplashScreen.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/PGSplashScreen.m b/PhoneGapLib/Classes/PGSplashScreen.m
index 8bff7ce..fa6c6df 100644
--- a/PhoneGapLib/Classes/PGSplashScreen.m
+++ b/PhoneGapLib/Classes/PGSplashScreen.m
@@ -7,7 +7,7 @@
 
 
 #import "PGSplashScreen.h"
-#import "PhoneGapDelegate.h"
+#import "PGAppDelegate.h"
 #import "PGViewController.h"
 
 @implementation PGSplashScreen
@@ -15,13 +15,13 @@
 
 - (void) __show:(BOOL)show
 {
-	PhoneGapDelegate* delegate = [super appDelegate];
-	if (!delegate.viewController.imageView) {
+    PGViewController* vc = (PGViewController*)self.viewController;
+	if (vc.imageView) {
 		return;
 	}
 	
-	delegate.viewController.imageView.hidden = !show;
-	delegate.viewController.activityView.hidden = !show;
+	vc.imageView.hidden = !show;
+	vc.activityView.hidden = !show;
 }
 
 - (void) show:(NSArray*)arguments withDict:(NSMutableDictionary*)options

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/PGURLProtocol.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/PGURLProtocol.m b/PhoneGapLib/Classes/PGURLProtocol.m
index da46d65..7c2628d 100644
--- a/PhoneGapLib/Classes/PGURLProtocol.m
+++ b/PhoneGapLib/Classes/PGURLProtocol.m
@@ -8,7 +8,7 @@
 
 #import "PGURLProtocol.h"
 #import "PGWhitelist.h"
-#import "PhoneGapDelegate.h"
+#import "PGAppDelegate.h"
 #import "PGViewController.h"
 
 static PGWhitelist* gWhitelist = nil;
@@ -30,7 +30,7 @@ static PGWhitelist* gWhitelist = nil;
     NSString* theScheme = [theUrl scheme];
     
     if (gWhitelist == nil) {
-        PhoneGapDelegate* delegate = (PhoneGapDelegate*)[[UIApplication sharedApplication] delegate];
+        PGAppDelegate* delegate = (PGAppDelegate*)[[UIApplication sharedApplication] delegate];
         gWhitelist = [delegate.viewController.whitelist retain];
     }
     

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/PGViewController.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/PGViewController.m b/PhoneGapLib/Classes/PGViewController.m
index d61092e..4850a7c 100644
--- a/PhoneGapLib/Classes/PGViewController.m
+++ b/PhoneGapLib/Classes/PGViewController.m
@@ -390,7 +390,7 @@
      */
     else
     {
-        NSLog(@"PhoneGapDelegate::shouldStartLoadWithRequest: Received Unhandled URL %@", url);
+        NSLog(@"PGAppDelegate::shouldStartLoadWithRequest: Received Unhandled URL %@", url);
 		
         if ([[UIApplication sharedApplication] canOpenURL:url]) {
             [[UIApplication sharedApplication] openURL:url];
@@ -700,6 +700,10 @@ BOOL gSplashScreenShown = NO;
             obj = [[NSClassFromString(className) alloc] initWithWebView:webView];
         }
         
+        if ([obj isKindOfClass:[PGPlugin class]] && [obj respondsToSelector:@selector(setViewController)]) { 
+            [obj setViewController:self];
+        }
+        
         if (obj != nil) {
             [self.pluginObjects setObject:obj forKey:className];
             [obj release];
@@ -711,7 +715,7 @@ BOOL gSplashScreenShown = NO;
 }
 
 
-#pragma mark PhoneGapDelegate?
+#pragma mark -
 
 - (NSDictionary*) deviceProperties
 {

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/PhoneGapDelegate.h
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/PhoneGapDelegate.h b/PhoneGapLib/Classes/PhoneGapDelegate.h
deleted file mode 100644
index e5c31c8..0000000
--- a/PhoneGapLib/Classes/PhoneGapDelegate.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * PhoneGap is available under *either* the terms of the modified BSD license *or* the
- * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
- * 
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-
-#import <UIKit/UIKit.h>
-#import "JSONKit.h"
-
-@class PGViewController;
-
-@interface PhoneGapDelegate : NSObject <UIApplicationDelegate, UIWebViewDelegate>
-{
-}
-
-@property (nonatomic, readwrite, retain) IBOutlet UIWindow* window;
-@property (nonatomic, readonly, retain) IBOutlet PGViewController* viewController;
-
-- (void)applicationDidEnterBackground:(UIApplication *)application;
-- (void)applicationWillEnterForeground:(UIApplication *)application;
-- (void)applicationWillResignActive:(UIApplication *)application;
-- (void)applicationWillTerminate:(UIApplication *)application;
-
-@end
-

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/PhoneGapDelegate.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/PhoneGapDelegate.m b/PhoneGapLib/Classes/PhoneGapDelegate.m
deleted file mode 100644
index b3f7e94..0000000
--- a/PhoneGapLib/Classes/PhoneGapDelegate.m
+++ /dev/null
@@ -1,211 +0,0 @@
-/*
- * PhoneGap is available under *either* the terms of the modified BSD license *or* the
- * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
- * 
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- * Copyright (c) 2010, IBM Corporation
- */
-
-#import <UIKit/UIKit.h>
-#import <CoreLocation/CoreLocation.h>
-
-#import "Location.h"
-#import "Sound.h"
-#import "DebugConsole.h"
-#import "Connection.h"
-
-#import "PGURLProtocol.h"
-#import "PGWhitelist.h"
-#import "InvokedUrlCommand.h"
-#import "PhoneGapDelegate.h"
-#import "PGViewController.h"
-#import "PGPlugin.h"
-
-// class extension
-@interface PhoneGapDelegate ()
-
-// readwrite access for self
-
-@property (nonatomic, readwrite, retain) IBOutlet PGViewController* viewController;
-
-@end
-
-
-@implementation PhoneGapDelegate
-
-@synthesize window, viewController;
-
-- (id) init
-{
-    self = [super init];
-    if (self != nil) {
-        // Turn on cookie support ( shared with our app only! )
-        NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; 
-        [cookieStorage setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways];
-        
-        [PGURLProtocol registerPGHttpURLProtocol];
-    }
-    return self; 
-}
-
-/**
- * This is main kick off after the app inits, the views and Settings are setup here.
- */
-- (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
-{    
-    CGRect screenBounds = [ [ UIScreen mainScreen ] bounds ];
-    self.window = [ [ [ UIWindow alloc ] initWithFrame:screenBounds ] autorelease ];
-    self.window.autoresizesSubviews = YES;
-    
-    CGRect viewBounds = [[UIScreen mainScreen] applicationFrame];
-    viewBounds.origin = screenBounds.origin;
-    self.viewController = [[[PGViewController alloc] init] autorelease];
-    self.viewController.useSplashScreen = YES;
-    self.viewController.view.bounds = viewBounds;
-    
-    // check whether the current orientation is supported: if it is, keep it, rather than forcing a rotation
-    BOOL forceStartupRotation = YES;
-    UIDeviceOrientation curDevOrientation = [[UIDevice currentDevice] orientation];
-
-    if (UIDeviceOrientationUnknown == curDevOrientation) {
-        // UIDevice isn't firing orientation notifications yet… go look at the status bar
-        curDevOrientation = (UIDeviceOrientation)[[UIApplication sharedApplication] statusBarOrientation];
-    }
-
-    if (UIDeviceOrientationIsValidInterfaceOrientation(curDevOrientation)) {
-        for (NSNumber *orient in self.viewController.supportedOrientations) {
-            if ([orient intValue] == curDevOrientation) {
-                forceStartupRotation = NO;
-                break;
-            }
-        }
-    } 
-    
-    if (forceStartupRotation) {
-        NSLog(@"supportedOrientations: %@", self.viewController.supportedOrientations);
-        // The first item in the supportedOrientations array is the start orientation (guaranteed to be at least Portrait)
-        UIInterfaceOrientation newOrient = [[self.viewController.supportedOrientations objectAtIndex:0] intValue];
-        NSLog(@"PhoneGapDelegate forcing status bar to: %d from: %d",newOrient,curDevOrientation);
-        [[UIApplication sharedApplication] setStatusBarOrientation:newOrient];
-    }
-    
-    [self.window addSubview:self.viewController.view];
-    [self.window makeKeyAndVisible];
-    
-    return YES;
-}
-
-- (NSString*) appURLScheme
-{
-    NSString* URLScheme = nil;
-    
-    NSArray *URLTypes = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleURLTypes"];
-    if(URLTypes != nil ) {
-        NSDictionary* dict = [URLTypes objectAtIndex:0];
-        if(dict != nil ) {
-            NSArray* URLSchemes = [dict objectForKey:@"CFBundleURLSchemes"];
-            if( URLSchemes != nil ) {    
-                URLScheme = [URLSchemes objectAtIndex:0];
-            }
-        }
-    }
-    
-    return URLScheme;
-}
-
-/*
- This method lets your application know that it is about to be terminated and purged from memory entirely
-*/
-- (void)applicationWillTerminate:(UIApplication *)application
-{
-
-    NSLog(@"applicationWillTerminate");
-    
-    // empty the tmp directory
-    NSFileManager* fileMgr = [[NSFileManager alloc] init];
-    NSError* err = nil;    
-
-    // clear contents of NSTemporaryDirectory 
-    NSString* tempDirectoryPath = NSTemporaryDirectory();
-    NSDirectoryEnumerator* directoryEnumerator = [fileMgr enumeratorAtPath:tempDirectoryPath];    
-    NSString* fileName = nil;
-    BOOL result;
-    
-    while ((fileName = [directoryEnumerator nextObject])) {
-        NSString* filePath = [tempDirectoryPath stringByAppendingPathComponent:fileName];
-        result = [fileMgr removeItemAtPath:filePath error:&err];
-        if (!result && err) {
-            NSLog(@"Failed to delete: %@ (error: %@)", filePath, err);
-        }
-    }    
-    [fileMgr release];
-}
-
-/*
- This method is called to let your application know that it is about to move from the active to inactive state.
- You should use this method to pause ongoing tasks, disable timer, ...
-*/
-- (void)applicationWillResignActive:(UIApplication *)application
-{
-    //NSLog(@"%@",@"applicationWillResignActive");
-    [self.viewController.webView stringByEvaluatingJavaScriptFromString:@"PhoneGap.fireDocumentEvent('resign');"];
-}
-
-/*
- In iOS 4.0 and later, this method is called as part of the transition from the background to the inactive state. 
- You can use this method to undo many of the changes you made to your application upon entering the background.
- invariably followed by applicationDidBecomeActive
-*/
-- (void)applicationWillEnterForeground:(UIApplication *)application
-{
-    //NSLog(@"%@",@"applicationWillEnterForeground");
-    [self.viewController.webView stringByEvaluatingJavaScriptFromString:@"PhoneGap.fireDocumentEvent('resume');"];
-}
-
-// This method is called to let your application know that it moved from the inactive to active state. 
-- (void)applicationDidBecomeActive:(UIApplication *)application
-{
-    //NSLog(@"%@",@"applicationDidBecomeActive");
-    [self.viewController.webView stringByEvaluatingJavaScriptFromString:@"PhoneGap.fireDocumentEvent('active');"];
-}
-
-/*
- In iOS 4.0 and later, this method is called instead of the applicationWillTerminate: method 
- when the user quits an application that supports background execution.
- */
-- (void)applicationDidEnterBackground:(UIApplication *)application
-{
-    //NSLog(@"%@",@"applicationDidEnterBackground");
-    [self.viewController.webView stringByEvaluatingJavaScriptFromString:@"PhoneGap.fireDocumentEvent('pause');"];
-}
-
-
-/*
- Determine the URL passed to this application.
- Described in http://iphonedevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html
-*/
-- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
-{
-    if (!url) { 
-        return NO; 
-    }
-
-    // Do something with the url here
-    NSString* jsString = [NSString stringWithFormat:@"handleOpenURL(\"%@\");", url];
-    [self.viewController.webView stringByEvaluatingJavaScriptFromString:jsString];
-    
-    [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:PGPluginHandleOpenURLNotification object:url]];
-    
-    return YES;
-}
-
-- (void)dealloc
-{
-    [PluginResult releaseStatus];
-    self.viewController = nil;
-    self.window = nil;
-    
-    [super dealloc];
-}
-
-@end
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/PhoneGapViewController.h
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/PhoneGapViewController.h b/PhoneGapLib/Classes/PhoneGapViewController.h
deleted file mode 100755
index 944848a..0000000
--- a/PhoneGapLib/Classes/PhoneGapViewController.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/*
- * PhoneGap is available under *either* the terms of the modified BSD license *or* the
- * MIT License (2008). See http://opensource.org/licenses/alphabetical for full text.
- * 
- * Copyright (c) 2005-2010, Nitobi Software Inc.
- */
-
-
-#import "PGViewController.h"
-
-/* This is here for legacy reasons - deprecated */
- __attribute__((deprecated)) @interface PhoneGapViewController : PGViewController {
-}
-@end
-
-/* here for legacy reasons - deprecated */
-@implementation PhoneGapViewController
-@end

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/Classes/Sound.m
----------------------------------------------------------------------
diff --git a/PhoneGapLib/Classes/Sound.m b/PhoneGapLib/Classes/Sound.m
index f7aa59c..d3f54c2 100644
--- a/PhoneGapLib/Classes/Sound.m
+++ b/PhoneGapLib/Classes/Sound.m
@@ -7,7 +7,7 @@
 
 
 #import "Sound.h"
-#import "PhonegapDelegate.h"
+#import "PGAppDelegate.h"
 #import "PGViewController.h"
 
 #define DOCUMENTS_SCHEME_PREFIX		@"documents://"
@@ -16,31 +16,6 @@
 @implementation PGSound
 
 @synthesize soundCache, avSession;
-/*
-// Maps a url to the original resource path
-- (NSString*) resourceForUrl:(NSURL*)url
-{
-    NSBundle* mainBundle = [NSBundle mainBundle];
-	NSString* urlString = [url description];
-	NSString* retVal = @"";
-	
-	NSString* wwwPath = [mainBundle pathForResource:[PhoneGapDelegate wwwFolderName] ofType:@"" inDirectory:@""];
-	NSString* wwwUrl = [[NSURL fileURLWithPath:wwwPath] description];
-	NSString* documentsUrl = [[NSURL fileURLWithPath:[PhoneGapDelegate applicationDocumentsDirectory]] description];
-	
-	if ([urlString hasPrefix:wwwUrl]) {
-		retVal = [urlString substringFromIndex:[wwwUrl length]];
-	} else if ([urlString hasPrefix:HTTP_SCHEME_PREFIX]) {
-		retVal = urlString;
-	} else if ([urlString hasPrefix:documentsUrl]) {
-		retVal = [NSString stringWithFormat:@"%@%@", DOCUMENTS_SCHEME_PREFIX, [urlString substringFromIndex:[documentsUrl length]]];
-	} else {
-		NSLog(@"Cannot map url '%@' to a resource path.", urlString);
-	}
-
-	return retVal;
-}
-*/ 
 
 // Maps a url for a resource path
 // "Naked" resource paths are assumed to be from the www folder as its base

http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/8b48e442/PhoneGapLib/PhoneGapLib.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/PhoneGapLib/PhoneGapLib.xcodeproj/project.pbxproj b/PhoneGapLib/PhoneGapLib.xcodeproj/project.pbxproj
index 689527e..e55cef2 100644
--- a/PhoneGapLib/PhoneGapLib.xcodeproj/project.pbxproj
+++ b/PhoneGapLib/PhoneGapLib.xcodeproj/project.pbxproj
@@ -45,7 +45,7 @@
 		3032599E136B325100982B63 /* Location.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD471090FBE7009987E8 /* Location.m */; };
 		303259A1136B325100982B63 /* Notification.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD4F1090FBE7009987E8 /* Notification.m */; };
 		303259A2136B325100982B63 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD511090FBE7009987E8 /* NSData+Base64.m */; };
-		303259A4136B325100982B63 /* PhoneGapDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD5B1090FBE7009987E8 /* PhoneGapDelegate.m */; };
+		303259A4136B325100982B63 /* PGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD5B1090FBE7009987E8 /* PGAppDelegate.m */; };
 		303259A6136B325100982B63 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD5F1090FBE7009987E8 /* Reachability.m */; };
 		303259A7136B325100982B63 /* Sound.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD611090FBE7009987E8 /* Sound.m */; };
 		303259A8136B325100982B63 /* Accelerometer.m in Sources */ = {isa = PBXBuildFile; fileRef = 88BA573C109BB46F00FB5E78 /* Accelerometer.m */; };
@@ -61,7 +61,7 @@
 		303259BC136B326300982B63 /* Location.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD461090FBE7009987E8 /* Location.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		303259BF136B326300982B63 /* Notification.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD4E1090FBE7009987E8 /* Notification.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		303259C0136B326300982B63 /* NSData+Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD501090FBE7009987E8 /* NSData+Base64.h */; settings = {ATTRIBUTES = (Public, ); }; };
-		303259C2136B326300982B63 /* PhoneGapDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD5A1090FBE7009987E8 /* PhoneGapDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		303259C2136B326300982B63 /* PGAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD5A1090FBE7009987E8 /* PGAppDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		303259C4136B326300982B63 /* Reachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD5E1090FBE7009987E8 /* Reachability.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		303259C5136B326300982B63 /* Sound.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD601090FBE7009987E8 /* Sound.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		303259C6136B326300982B63 /* Accelerometer.h in Headers */ = {isa = PBXBuildFile; fileRef = 88BA573B109BB46F00FB5E78 /* Accelerometer.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -106,8 +106,6 @@
 		30E563D013E217EC00C949AA /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 30E563CE13E217EC00C949AA /* NSMutableArray+QueueAdditions.m */; };
 		30E563D113E217EC00C949AA /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E563CD13E217EC00C949AA /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		30E563D213E217EC00C949AA /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 30E563CE13E217EC00C949AA /* NSMutableArray+QueueAdditions.m */; };
-		30FE6E0E14B7D6C600206FA5 /* PhoneGapViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 30FE6E0C14B7D6C600206FA5 /* PhoneGapViewController.h */; };
-		30FE6E0F14B7D6C600206FA5 /* PhoneGapViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 30FE6E0C14B7D6C600206FA5 /* PhoneGapViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		686357B5141002F200DF4CF2 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 686357B3141002F200DF4CF2 /* InfoPlist.strings */; };
 		686357B8141002F200DF4CF2 /* PluginResultJSONSerializationTests.h in Resources */ = {isa = PBXBuildFile; fileRef = 686357B7141002F200DF4CF2 /* PluginResultJSONSerializationTests.h */; };
 		686357BA141002F200DF4CF2 /* PluginResultJSONSerializationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 686357B9141002F200DF4CF2 /* PluginResultJSONSerializationTests.m */; };
@@ -151,8 +149,8 @@
 		8887FD8E1090FBE7009987E8 /* Notification.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD4F1090FBE7009987E8 /* Notification.m */; };
 		8887FD8F1090FBE7009987E8 /* NSData+Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD501090FBE7009987E8 /* NSData+Base64.h */; };
 		8887FD901090FBE7009987E8 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD511090FBE7009987E8 /* NSData+Base64.m */; };
-		8887FD991090FBE7009987E8 /* PhoneGapDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD5A1090FBE7009987E8 /* PhoneGapDelegate.h */; };
-		8887FD9A1090FBE7009987E8 /* PhoneGapDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD5B1090FBE7009987E8 /* PhoneGapDelegate.m */; };
+		8887FD991090FBE7009987E8 /* PGAppDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD5A1090FBE7009987E8 /* PGAppDelegate.h */; };
+		8887FD9A1090FBE7009987E8 /* PGAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD5B1090FBE7009987E8 /* PGAppDelegate.m */; };
 		8887FD9D1090FBE7009987E8 /* Reachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD5E1090FBE7009987E8 /* Reachability.h */; };
 		8887FD9E1090FBE7009987E8 /* Reachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 8887FD5F1090FBE7009987E8 /* Reachability.m */; };
 		8887FD9F1090FBE7009987E8 /* Sound.h in Headers */ = {isa = PBXBuildFile; fileRef = 8887FD601090FBE7009987E8 /* Sound.h */; };
@@ -207,7 +205,6 @@
 		30E33AF113A7E24B00594D64 /* PGPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PGPlugin.m; path = Classes/PGPlugin.m; sourceTree = "<group>"; };
 		30E563CD13E217EC00C949AA /* NSMutableArray+QueueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSMutableArray+QueueAdditions.h"; path = "Classes/NSMutableArray+QueueAdditions.h"; sourceTree = "<group>"; };
 		30E563CE13E217EC00C949AA /* NSMutableArray+QueueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSMutableArray+QueueAdditions.m"; path = "Classes/NSMutableArray+QueueAdditions.m"; sourceTree = "<group>"; };
-		30FE6E0C14B7D6C600206FA5 /* PhoneGapViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PhoneGapViewController.h; path = Classes/PhoneGapViewController.h; sourceTree = "<group>"; };
 		686357A9141002F100DF4CF2 /* PhoneGapLibTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PhoneGapLibTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
 		686357AA141002F100DF4CF2 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
 		686357AC141002F100DF4CF2 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
@@ -248,8 +245,8 @@
 		8887FD4F1090FBE7009987E8 /* Notification.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Notification.m; path = Classes/Notification.m; sourceTree = "<group>"; };
 		8887FD501090FBE7009987E8 /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSData+Base64.h"; path = "Classes/NSData+Base64.h"; sourceTree = "<group>"; };
 		8887FD511090FBE7009987E8 /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSData+Base64.m"; path = "Classes/NSData+Base64.m"; sourceTree = "<group>"; };
-		8887FD5A1090FBE7009987E8 /* PhoneGapDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PhoneGapDelegate.h; path = Classes/PhoneGapDelegate.h; sourceTree = "<group>"; };
-		8887FD5B1090FBE7009987E8 /* PhoneGapDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PhoneGapDelegate.m; path = Classes/PhoneGapDelegate.m; sourceTree = "<group>"; };
+		8887FD5A1090FBE7009987E8 /* PGAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = PGAppDelegate.h; path = Classes/PGAppDelegate.h; sourceTree = "<group>"; };
+		8887FD5B1090FBE7009987E8 /* PGAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = PGAppDelegate.m; path = Classes/PGAppDelegate.m; sourceTree = "<group>"; };
 		8887FD5E1090FBE7009987E8 /* Reachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Reachability.h; path = Classes/Reachability.h; sourceTree = "<group>"; };
 		8887FD5F1090FBE7009987E8 /* Reachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = Reachability.m; path = Classes/Reachability.m; sourceTree = "<group>"; };
 		8887FD601090FBE7009987E8 /* Sound.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Sound.h; path = Classes/Sound.h; sourceTree = "<group>"; };
@@ -462,9 +459,8 @@
 				8887FD361090FBE7009987E8 /* JSON */,
 				888700D910923009009987E8 /* Util */,
 				888700D810922FD3009987E8 /* Plugins */,
-				8887FD5A1090FBE7009987E8 /* PhoneGapDelegate.h */,
-				8887FD5B1090FBE7009987E8 /* PhoneGapDelegate.m */,
-				30FE6E0C14B7D6C600206FA5 /* PhoneGapViewController.h */,
+				8887FD5A1090FBE7009987E8 /* PGAppDelegate.h */,
+				8887FD5B1090FBE7009987E8 /* PGAppDelegate.m */,
 			);
 			name = Classes;
 			sourceTree = "<group>";
@@ -496,7 +492,7 @@
 				303259BC136B326300982B63 /* Location.h in Headers */,
 				303259BF136B326300982B63 /* Notification.h in Headers */,
 				303259C0136B326300982B63 /* NSData+Base64.h in Headers */,
-				303259C2136B326300982B63 /* PhoneGapDelegate.h in Headers */,
+				303259C2136B326300982B63 /* PGAppDelegate.h in Headers */,
 				303259C4136B326300982B63 /* Reachability.h in Headers */,
 				303259C5136B326300982B63 /* Sound.h in Headers */,
 				303259C6136B326300982B63 /* Accelerometer.h in Headers */,
@@ -515,7 +511,6 @@
 				30E563D113E217EC00C949AA /* NSMutableArray+QueueAdditions.h in Headers */,
 				8852C43B14B65FD800F0E735 /* PGViewController.h in Headers */,
 				8852C44014B65FD800F0E735 /* UIGapView.h in Headers */,
-				30FE6E0F14B7D6C600206FA5 /* PhoneGapViewController.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -532,7 +527,7 @@
 				8887FD851090FBE7009987E8 /* Location.h in Headers */,
 				8887FD8D1090FBE7009987E8 /* Notification.h in Headers */,
 				8887FD8F1090FBE7009987E8 /* NSData+Base64.h in Headers */,
-				8887FD991090FBE7009987E8 /* PhoneGapDelegate.h in Headers */,
+				8887FD991090FBE7009987E8 /* PGAppDelegate.h in Headers */,
 				8887FD9D1090FBE7009987E8 /* Reachability.h in Headers */,
 				8887FD9F1090FBE7009987E8 /* Sound.h in Headers */,
 				88BA573D109BB46F00FB5E78 /* Accelerometer.h in Headers */,
@@ -552,7 +547,6 @@
 				30A90B9114588697006178D3 /* JSONKit.h in Headers */,
 				8852C43A14B65FD800F0E735 /* PGViewController.h in Headers */,
 				8852C43F14B65FD800F0E735 /* UIGapView.h in Headers */,
-				30FE6E0E14B7D6C600206FA5 /* PhoneGapViewController.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -747,7 +741,7 @@
 				3032599E136B325100982B63 /* Location.m in Sources */,
 				303259A1136B325100982B63 /* Notification.m in Sources */,
 				303259A2136B325100982B63 /* NSData+Base64.m in Sources */,
-				303259A4136B325100982B63 /* PhoneGapDelegate.m in Sources */,
+				303259A4136B325100982B63 /* PGAppDelegate.m in Sources */,
 				303259A6136B325100982B63 /* Reachability.m in Sources */,
 				303259A7136B325100982B63 /* Sound.m in Sources */,
 				303259A8136B325100982B63 /* Accelerometer.m in Sources */,
@@ -791,7 +785,7 @@
 				8887FD861090FBE7009987E8 /* Location.m in Sources */,
 				8887FD8E1090FBE7009987E8 /* Notification.m in Sources */,
 				8887FD901090FBE7009987E8 /* NSData+Base64.m in Sources */,
-				8887FD9A1090FBE7009987E8 /* PhoneGapDelegate.m in Sources */,
+				8887FD9A1090FBE7009987E8 /* PGAppDelegate.m in Sources */,
 				8887FD9E1090FBE7009987E8 /* Reachability.m in Sources */,
 				8887FDA01090FBE7009987E8 /* Sound.m in Sources */,
 				88BA573E109BB46F00FB5E78 /* Accelerometer.m in Sources */,


Mime
View raw message