You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2013/03/09 01:37:33 UTC
[4/6] mac commit: Move CordovaLib folder into its own
CordovaFramework project, add as a sub-project to a CordovaMac project.
Move CordovaLib folder into its own CordovaFramework project, add as a sub-project to a CordovaMac project.
Project: http://git-wip-us.apache.org/repos/asf/cordova-osx/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-osx/commit/5a67ee70
Tree: http://git-wip-us.apache.org/repos/asf/cordova-osx/tree/5a67ee70
Diff: http://git-wip-us.apache.org/repos/asf/cordova-osx/diff/5a67ee70
Branch: refs/heads/master
Commit: 5a67ee70095bd7dc38c94921740134a960e0b3a5
Parents: 542771b
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Mar 8 15:02:08 2013 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Mar 8 15:02:08 2013 -0800
----------------------------------------------------------------------
.../CordovaFramework.xcodeproj/project.pbxproj | 653 +++++++++++++++
.../CordovaFramework/Classes/CDVBridge.h | 35 +
.../CordovaFramework/Classes/CDVBridge.m | 204 +++++
.../CordovaFramework/Classes/CDVViewController.h | 57 ++
.../CordovaFramework/Classes/CDVViewController.m | 192 +++++
.../CordovaFramework/Classes/CDVWebViewDelegate.h | 34 +
.../CordovaFramework/Classes/CDVWebViewDelegate.m | 87 ++
.../CordovaFramework/Classes/Commands/CDV.h | 27 +
.../Classes/Commands/CDVAvailability.h | 53 ++
.../Classes/Commands/CDVCommandDelegate.h | 55 ++
.../Classes/Commands/CDVCommandDelegateImpl.h | 32 +
.../Classes/Commands/CDVCommandDelegateImpl.m | 156 ++++
.../Classes/Commands/CDVCommandQueue.h | 40 +
.../Classes/Commands/CDVCommandQueue.m | 164 ++++
.../Classes/Commands/CDVConfigParser.h | 28 +
.../Classes/Commands/CDVConfigParser.m | 70 ++
.../Classes/Commands/CDVConnection.h | 34 +
.../Classes/Commands/CDVConnection.m | 125 +++
.../CordovaFramework/Classes/Commands/CDVConsole.h | 29 +
.../CordovaFramework/Classes/Commands/CDVConsole.m | 75 ++
.../CordovaFramework/Classes/Commands/CDVDebug.h | 25 +
.../CordovaFramework/Classes/Commands/CDVDevice.h | 29 +
.../CordovaFramework/Classes/Commands/CDVDevice.m | 116 +++
.../Classes/Commands/CDVInvokedUrlCommand.h | 52 ++
.../Classes/Commands/CDVInvokedUrlCommand.m | 140 +++
.../CordovaFramework/Classes/Commands/CDVJSON.h | 30 +
.../CordovaFramework/Classes/Commands/CDVJSON.m | 77 ++
.../CordovaFramework/Classes/Commands/CDVPlugin.h | 59 ++
.../CordovaFramework/Classes/Commands/CDVPlugin.m | 129 +++
.../Classes/Commands/CDVPluginResult.h | 65 ++
.../Classes/Commands/CDVPluginResult.m | 224 +++++
.../Classes/Commands/CDVReachability.h | 85 ++
.../Classes/Commands/CDVReachability.m | 261 ++++++
.../CordovaFramework/Classes/Utils/NSData+Base64.h | 33 +
.../CordovaFramework/Classes/Utils/NSData+Base64.m | 286 +++++++
.../Classes/Utils/NSWindow+Utils.h | 27 +
.../Classes/Utils/NSWindow+Utils.m | 34 +
.../CordovaFramework/CordovaFramework-Info.plist | 30 +
.../CordovaFramework/CordovaFramework-Prefix.pch | 7 +
.../CordovaFramework/en.lproj/InfoPlist.strings | 2 +
.../CordovaFrameworkTests-Info.plist | 22 +
.../CordovaFrameworkTests/CordovaFrameworkTests.h | 13 +
.../CordovaFrameworkTests/CordovaFrameworkTests.m | 32 +
.../en.lproj/InfoPlist.strings | 2 +
CordovaMac/CordovaLib/CDVBridge.h | 35 -
CordovaMac/CordovaLib/CDVBridge.m | 204 -----
CordovaMac/CordovaLib/CDVViewController.h | 57 --
CordovaMac/CordovaLib/CDVViewController.m | 192 -----
CordovaMac/CordovaLib/CDVWebViewDelegate.h | 34 -
CordovaMac/CordovaLib/CDVWebViewDelegate.m | 87 --
CordovaMac/CordovaLib/Commands/CDV.h | 27 -
CordovaMac/CordovaLib/Commands/CDVAvailability.h | 53 --
.../CordovaLib/Commands/CDVCommandDelegate.h | 55 --
.../CordovaLib/Commands/CDVCommandDelegateImpl.h | 32 -
.../CordovaLib/Commands/CDVCommandDelegateImpl.m | 156 ----
CordovaMac/CordovaLib/Commands/CDVCommandQueue.h | 40 -
CordovaMac/CordovaLib/Commands/CDVCommandQueue.m | 164 ----
CordovaMac/CordovaLib/Commands/CDVConfigParser.h | 28 -
CordovaMac/CordovaLib/Commands/CDVConfigParser.m | 70 --
CordovaMac/CordovaLib/Commands/CDVConnection.h | 34 -
CordovaMac/CordovaLib/Commands/CDVConnection.m | 125 ---
CordovaMac/CordovaLib/Commands/CDVConsole.h | 29 -
CordovaMac/CordovaLib/Commands/CDVConsole.m | 75 --
CordovaMac/CordovaLib/Commands/CDVDebug.h | 25 -
CordovaMac/CordovaLib/Commands/CDVDevice.h | 29 -
CordovaMac/CordovaLib/Commands/CDVDevice.m | 116 ---
.../CordovaLib/Commands/CDVInvokedUrlCommand.h | 52 --
.../CordovaLib/Commands/CDVInvokedUrlCommand.m | 140 ---
CordovaMac/CordovaLib/Commands/CDVJSON.h | 30 -
CordovaMac/CordovaLib/Commands/CDVJSON.m | 77 --
CordovaMac/CordovaLib/Commands/CDVPlugin.h | 59 --
CordovaMac/CordovaLib/Commands/CDVPlugin.m | 129 ---
CordovaMac/CordovaLib/Commands/CDVPluginResult.h | 65 --
CordovaMac/CordovaLib/Commands/CDVPluginResult.m | 224 -----
CordovaMac/CordovaLib/Commands/CDVReachability.h | 85 --
CordovaMac/CordovaLib/Commands/CDVReachability.m | 261 ------
CordovaMac/CordovaLib/Utils/NSData+Base64.h | 33 -
CordovaMac/CordovaLib/Utils/NSData+Base64.m | 286 -------
CordovaMac/CordovaLib/Utils/NSWindow+Utils.h | 27 -
CordovaMac/CordovaLib/Utils/NSWindow+Utils.m | 34 -
CordovaMac/CordovaMac.xcodeproj/project.pbxproj | 197 ++---
CordovaMac/CordovaMac/Classes/AppDelegate.h | 2 +-
CordovaMac/CordovaMac/Classes/MainViewController.h | 6 +-
83 files changed, 4003 insertions(+), 3301 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework.xcodeproj/project.pbxproj b/CordovaFramework/CordovaFramework.xcodeproj/project.pbxproj
new file mode 100644
index 0000000..3112420
--- /dev/null
+++ b/CordovaFramework/CordovaFramework.xcodeproj/project.pbxproj
@@ -0,0 +1,653 @@
+// !$*UTF8*$!
+{
+ archiveVersion = 1;
+ classes = {
+ };
+ objectVersion = 46;
+ objects = {
+
+/* Begin PBXBuildFile section */
+ 7E4C0A7416EAA1C600542982 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E4C0A7316EAA1C600542982 /* Cocoa.framework */; };
+ 7E4C0A7E16EAA1C600542982 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7E4C0A7C16EAA1C600542982 /* InfoPlist.strings */; };
+ 7E4C0A8A16EAA1C600542982 /* SenTestingKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E4C0A8916EAA1C600542982 /* SenTestingKit.framework */; };
+ 7E4C0A8B16EAA1C600542982 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E4C0A7316EAA1C600542982 /* Cocoa.framework */; };
+ 7E4C0A8E16EAA1C600542982 /* Cordova.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E4C0A7016EAA1C600542982 /* Cordova.framework */; };
+ 7E4C0A9416EAA1C700542982 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 7E4C0A9216EAA1C700542982 /* InfoPlist.strings */; };
+ 7E4C0A9716EAA1C700542982 /* CordovaFrameworkTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0A9616EAA1C700542982 /* CordovaFrameworkTests.m */; };
+ 7E4C0AC616EAA2AD00542982 /* CDVBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AA016EAA2AD00542982 /* CDVBridge.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AC716EAA2AD00542982 /* CDVBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AA116EAA2AD00542982 /* CDVBridge.m */; };
+ 7E4C0AC816EAA2AD00542982 /* CDVBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AA116EAA2AD00542982 /* CDVBridge.m */; };
+ 7E4C0AC916EAA2AD00542982 /* CDVViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AA216EAA2AD00542982 /* CDVViewController.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0ACA16EAA2AD00542982 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AA316EAA2AD00542982 /* CDVViewController.m */; };
+ 7E4C0ACB16EAA2AD00542982 /* CDVViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AA316EAA2AD00542982 /* CDVViewController.m */; };
+ 7E4C0ACC16EAA2AD00542982 /* CDVWebViewDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AA416EAA2AD00542982 /* CDVWebViewDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0ACD16EAA2AD00542982 /* CDVWebViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AA516EAA2AD00542982 /* CDVWebViewDelegate.m */; };
+ 7E4C0ACE16EAA2AD00542982 /* CDVWebViewDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AA516EAA2AD00542982 /* CDVWebViewDelegate.m */; };
+ 7E4C0ACF16EAA2AD00542982 /* CDV.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AA716EAA2AD00542982 /* CDV.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AD016EAA2AD00542982 /* CDVAvailability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AA816EAA2AD00542982 /* CDVAvailability.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AD116EAA2AD00542982 /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AA916EAA2AD00542982 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AD216EAA2AD00542982 /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AAA16EAA2AD00542982 /* CDVCommandDelegateImpl.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AD316EAA2AD00542982 /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AAB16EAA2AD00542982 /* CDVCommandDelegateImpl.m */; };
+ 7E4C0AD416EAA2AD00542982 /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AAB16EAA2AD00542982 /* CDVCommandDelegateImpl.m */; };
+ 7E4C0AD516EAA2AD00542982 /* CDVCommandQueue.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AAC16EAA2AD00542982 /* CDVCommandQueue.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AD616EAA2AD00542982 /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AAD16EAA2AD00542982 /* CDVCommandQueue.m */; };
+ 7E4C0AD716EAA2AD00542982 /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AAD16EAA2AD00542982 /* CDVCommandQueue.m */; };
+ 7E4C0AD816EAA2AD00542982 /* CDVConfigParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AAE16EAA2AD00542982 /* CDVConfigParser.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AD916EAA2AD00542982 /* CDVConfigParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AAF16EAA2AD00542982 /* CDVConfigParser.m */; };
+ 7E4C0ADA16EAA2AD00542982 /* CDVConfigParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AAF16EAA2AD00542982 /* CDVConfigParser.m */; };
+ 7E4C0ADB16EAA2AD00542982 /* CDVConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AB016EAA2AD00542982 /* CDVConnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0ADC16EAA2AD00542982 /* CDVConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AB116EAA2AD00542982 /* CDVConnection.m */; };
+ 7E4C0ADD16EAA2AD00542982 /* CDVConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AB116EAA2AD00542982 /* CDVConnection.m */; };
+ 7E4C0ADE16EAA2AD00542982 /* CDVConsole.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AB216EAA2AD00542982 /* CDVConsole.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0ADF16EAA2AD00542982 /* CDVConsole.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AB316EAA2AD00542982 /* CDVConsole.m */; };
+ 7E4C0AE016EAA2AD00542982 /* CDVConsole.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AB316EAA2AD00542982 /* CDVConsole.m */; };
+ 7E4C0AE116EAA2AD00542982 /* CDVDebug.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AB416EAA2AD00542982 /* CDVDebug.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AE216EAA2AD00542982 /* CDVDevice.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AB516EAA2AD00542982 /* CDVDevice.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AE316EAA2AD00542982 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AB616EAA2AD00542982 /* CDVDevice.m */; };
+ 7E4C0AE416EAA2AD00542982 /* CDVDevice.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AB616EAA2AD00542982 /* CDVDevice.m */; };
+ 7E4C0AE516EAA2AD00542982 /* CDVInvokedUrlCommand.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AB716EAA2AD00542982 /* CDVInvokedUrlCommand.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AE616EAA2AD00542982 /* CDVInvokedUrlCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AB816EAA2AD00542982 /* CDVInvokedUrlCommand.m */; };
+ 7E4C0AE716EAA2AD00542982 /* CDVInvokedUrlCommand.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AB816EAA2AD00542982 /* CDVInvokedUrlCommand.m */; };
+ 7E4C0AE816EAA2AD00542982 /* CDVJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AB916EAA2AD00542982 /* CDVJSON.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AE916EAA2AD00542982 /* CDVJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0ABA16EAA2AD00542982 /* CDVJSON.m */; };
+ 7E4C0AEA16EAA2AD00542982 /* CDVJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0ABA16EAA2AD00542982 /* CDVJSON.m */; };
+ 7E4C0AEB16EAA2AD00542982 /* CDVPlugin.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0ABB16EAA2AD00542982 /* CDVPlugin.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AEC16EAA2AD00542982 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0ABC16EAA2AD00542982 /* CDVPlugin.m */; };
+ 7E4C0AED16EAA2AD00542982 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0ABC16EAA2AD00542982 /* CDVPlugin.m */; };
+ 7E4C0AEE16EAA2AD00542982 /* CDVPluginResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0ABD16EAA2AD00542982 /* CDVPluginResult.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AEF16EAA2AD00542982 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0ABE16EAA2AD00542982 /* CDVPluginResult.m */; };
+ 7E4C0AF016EAA2AD00542982 /* CDVPluginResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0ABE16EAA2AD00542982 /* CDVPluginResult.m */; };
+ 7E4C0AF116EAA2AD00542982 /* CDVReachability.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0ABF16EAA2AD00542982 /* CDVReachability.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AF216EAA2AD00542982 /* CDVReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AC016EAA2AD00542982 /* CDVReachability.m */; };
+ 7E4C0AF316EAA2AD00542982 /* CDVReachability.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AC016EAA2AD00542982 /* CDVReachability.m */; };
+ 7E4C0AF416EAA2AD00542982 /* NSData+Base64.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AC216EAA2AD00542982 /* NSData+Base64.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AF516EAA2AD00542982 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AC316EAA2AD00542982 /* NSData+Base64.m */; };
+ 7E4C0AF616EAA2AD00542982 /* NSData+Base64.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AC316EAA2AD00542982 /* NSData+Base64.m */; };
+ 7E4C0AF716EAA2AD00542982 /* NSWindow+Utils.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E4C0AC416EAA2AD00542982 /* NSWindow+Utils.h */; settings = {ATTRIBUTES = (Public, ); }; };
+ 7E4C0AF816EAA2AD00542982 /* NSWindow+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AC516EAA2AD00542982 /* NSWindow+Utils.m */; };
+ 7E4C0AF916EAA2AD00542982 /* NSWindow+Utils.m in Sources */ = {isa = PBXBuildFile; fileRef = 7E4C0AC516EAA2AD00542982 /* NSWindow+Utils.m */; };
+ 7E4C0AFB16EAA35300542982 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E4C0AFA16EAA35300542982 /* SystemConfiguration.framework */; };
+ 7E4C0AFD16EAA36400542982 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7E4C0AFC16EAA36400542982 /* WebKit.framework */; };
+/* End PBXBuildFile section */
+
+/* Begin PBXContainerItemProxy section */
+ 7E4C0A8C16EAA1C600542982 /* PBXContainerItemProxy */ = {
+ isa = PBXContainerItemProxy;
+ containerPortal = 7E4C0A6716EAA1C600542982 /* Project object */;
+ proxyType = 1;
+ remoteGlobalIDString = 7E4C0A6F16EAA1C600542982;
+ remoteInfo = CordovaFramework;
+ };
+/* End PBXContainerItemProxy section */
+
+/* Begin PBXFileReference section */
+ 7E4C0A7016EAA1C600542982 /* Cordova.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Cordova.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+ 7E4C0A7316EAA1C600542982 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
+ 7E4C0A7616EAA1C600542982 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
+ 7E4C0A7716EAA1C600542982 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = System/Library/Frameworks/CoreData.framework; sourceTree = SDKROOT; };
+ 7E4C0A7816EAA1C600542982 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
+ 7E4C0A7B16EAA1C600542982 /* CordovaFramework-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CordovaFramework-Info.plist"; sourceTree = "<group>"; };
+ 7E4C0A7D16EAA1C600542982 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 7E4C0A7F16EAA1C600542982 /* CordovaFramework-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CordovaFramework-Prefix.pch"; sourceTree = "<group>"; };
+ 7E4C0A8816EAA1C600542982 /* CordovaFrameworkTests.octest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = CordovaFrameworkTests.octest; sourceTree = BUILT_PRODUCTS_DIR; };
+ 7E4C0A8916EAA1C600542982 /* SenTestingKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SenTestingKit.framework; path = Library/Frameworks/SenTestingKit.framework; sourceTree = DEVELOPER_DIR; };
+ 7E4C0A9116EAA1C700542982 /* CordovaFrameworkTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "CordovaFrameworkTests-Info.plist"; sourceTree = "<group>"; };
+ 7E4C0A9316EAA1C700542982 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
+ 7E4C0A9516EAA1C700542982 /* CordovaFrameworkTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CordovaFrameworkTests.h; sourceTree = "<group>"; };
+ 7E4C0A9616EAA1C700542982 /* CordovaFrameworkTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CordovaFrameworkTests.m; sourceTree = "<group>"; };
+ 7E4C0AA016EAA2AD00542982 /* CDVBridge.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVBridge.h; path = Classes/CDVBridge.h; sourceTree = "<group>"; };
+ 7E4C0AA116EAA2AD00542982 /* CDVBridge.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVBridge.m; path = Classes/CDVBridge.m; sourceTree = "<group>"; };
+ 7E4C0AA216EAA2AD00542982 /* CDVViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVViewController.h; path = Classes/CDVViewController.h; sourceTree = "<group>"; };
+ 7E4C0AA316EAA2AD00542982 /* CDVViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVViewController.m; path = Classes/CDVViewController.m; sourceTree = "<group>"; };
+ 7E4C0AA416EAA2AD00542982 /* CDVWebViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVWebViewDelegate.h; path = Classes/CDVWebViewDelegate.h; sourceTree = "<group>"; };
+ 7E4C0AA516EAA2AD00542982 /* CDVWebViewDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVWebViewDelegate.m; path = Classes/CDVWebViewDelegate.m; sourceTree = "<group>"; };
+ 7E4C0AA716EAA2AD00542982 /* CDV.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDV.h; sourceTree = "<group>"; };
+ 7E4C0AA816EAA2AD00542982 /* CDVAvailability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVAvailability.h; sourceTree = "<group>"; };
+ 7E4C0AA916EAA2AD00542982 /* CDVCommandDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegate.h; sourceTree = "<group>"; };
+ 7E4C0AAA16EAA2AD00542982 /* CDVCommandDelegateImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandDelegateImpl.h; sourceTree = "<group>"; };
+ 7E4C0AAB16EAA2AD00542982 /* CDVCommandDelegateImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandDelegateImpl.m; sourceTree = "<group>"; };
+ 7E4C0AAC16EAA2AD00542982 /* CDVCommandQueue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVCommandQueue.h; sourceTree = "<group>"; };
+ 7E4C0AAD16EAA2AD00542982 /* CDVCommandQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVCommandQueue.m; sourceTree = "<group>"; };
+ 7E4C0AAE16EAA2AD00542982 /* CDVConfigParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVConfigParser.h; sourceTree = "<group>"; };
+ 7E4C0AAF16EAA2AD00542982 /* CDVConfigParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVConfigParser.m; sourceTree = "<group>"; };
+ 7E4C0AB016EAA2AD00542982 /* CDVConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVConnection.h; sourceTree = "<group>"; };
+ 7E4C0AB116EAA2AD00542982 /* CDVConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVConnection.m; sourceTree = "<group>"; };
+ 7E4C0AB216EAA2AD00542982 /* CDVConsole.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVConsole.h; sourceTree = "<group>"; };
+ 7E4C0AB316EAA2AD00542982 /* CDVConsole.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVConsole.m; sourceTree = "<group>"; };
+ 7E4C0AB416EAA2AD00542982 /* CDVDebug.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVDebug.h; sourceTree = "<group>"; };
+ 7E4C0AB516EAA2AD00542982 /* CDVDevice.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVDevice.h; sourceTree = "<group>"; };
+ 7E4C0AB616EAA2AD00542982 /* CDVDevice.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVDevice.m; sourceTree = "<group>"; };
+ 7E4C0AB716EAA2AD00542982 /* CDVInvokedUrlCommand.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVInvokedUrlCommand.h; sourceTree = "<group>"; };
+ 7E4C0AB816EAA2AD00542982 /* CDVInvokedUrlCommand.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVInvokedUrlCommand.m; sourceTree = "<group>"; };
+ 7E4C0AB916EAA2AD00542982 /* CDVJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVJSON.h; sourceTree = "<group>"; };
+ 7E4C0ABA16EAA2AD00542982 /* CDVJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVJSON.m; sourceTree = "<group>"; };
+ 7E4C0ABB16EAA2AD00542982 /* CDVPlugin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPlugin.h; sourceTree = "<group>"; };
+ 7E4C0ABC16EAA2AD00542982 /* CDVPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPlugin.m; sourceTree = "<group>"; };
+ 7E4C0ABD16EAA2AD00542982 /* CDVPluginResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVPluginResult.h; sourceTree = "<group>"; };
+ 7E4C0ABE16EAA2AD00542982 /* CDVPluginResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVPluginResult.m; sourceTree = "<group>"; };
+ 7E4C0ABF16EAA2AD00542982 /* CDVReachability.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDVReachability.h; sourceTree = "<group>"; };
+ 7E4C0AC016EAA2AD00542982 /* CDVReachability.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDVReachability.m; sourceTree = "<group>"; };
+ 7E4C0AC216EAA2AD00542982 /* NSData+Base64.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSData+Base64.h"; sourceTree = "<group>"; };
+ 7E4C0AC316EAA2AD00542982 /* NSData+Base64.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSData+Base64.m"; sourceTree = "<group>"; };
+ 7E4C0AC416EAA2AD00542982 /* NSWindow+Utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSWindow+Utils.h"; sourceTree = "<group>"; };
+ 7E4C0AC516EAA2AD00542982 /* NSWindow+Utils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSWindow+Utils.m"; sourceTree = "<group>"; };
+ 7E4C0AFA16EAA35300542982 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
+ 7E4C0AFC16EAA36400542982 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WebKit.framework; path = System/Library/Frameworks/WebKit.framework; sourceTree = SDKROOT; };
+/* End PBXFileReference section */
+
+/* Begin PBXFrameworksBuildPhase section */
+ 7E4C0A6C16EAA1C600542982 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E4C0AFD16EAA36400542982 /* WebKit.framework in Frameworks */,
+ 7E4C0AFB16EAA35300542982 /* SystemConfiguration.framework in Frameworks */,
+ 7E4C0A7416EAA1C600542982 /* Cocoa.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 7E4C0A8416EAA1C600542982 /* Frameworks */ = {
+ isa = PBXFrameworksBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E4C0A8A16EAA1C600542982 /* SenTestingKit.framework in Frameworks */,
+ 7E4C0A8B16EAA1C600542982 /* Cocoa.framework in Frameworks */,
+ 7E4C0A8E16EAA1C600542982 /* Cordova.framework in Frameworks */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXFrameworksBuildPhase section */
+
+/* Begin PBXGroup section */
+ 7E4C0A6616EAA1C600542982 = {
+ isa = PBXGroup;
+ children = (
+ 7E4C0A7916EAA1C600542982 /* CordovaFramework */,
+ 7E4C0A7A16EAA1C600542982 /* Supporting Files */,
+ 7E4C0A8F16EAA1C600542982 /* CordovaFrameworkTests */,
+ 7E4C0A7216EAA1C600542982 /* Frameworks */,
+ 7E4C0A7116EAA1C600542982 /* Products */,
+ );
+ sourceTree = "<group>";
+ };
+ 7E4C0A7116EAA1C600542982 /* Products */ = {
+ isa = PBXGroup;
+ children = (
+ 7E4C0A7016EAA1C600542982 /* Cordova.framework */,
+ 7E4C0A8816EAA1C600542982 /* CordovaFrameworkTests.octest */,
+ );
+ name = Products;
+ sourceTree = "<group>";
+ };
+ 7E4C0A7216EAA1C600542982 /* Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 7E4C0AFC16EAA36400542982 /* WebKit.framework */,
+ 7E4C0AFA16EAA35300542982 /* SystemConfiguration.framework */,
+ 7E4C0A7316EAA1C600542982 /* Cocoa.framework */,
+ 7E4C0A8916EAA1C600542982 /* SenTestingKit.framework */,
+ 7E4C0A7516EAA1C600542982 /* Other Frameworks */,
+ );
+ name = Frameworks;
+ sourceTree = "<group>";
+ };
+ 7E4C0A7516EAA1C600542982 /* Other Frameworks */ = {
+ isa = PBXGroup;
+ children = (
+ 7E4C0A7616EAA1C600542982 /* AppKit.framework */,
+ 7E4C0A7716EAA1C600542982 /* CoreData.framework */,
+ 7E4C0A7816EAA1C600542982 /* Foundation.framework */,
+ );
+ name = "Other Frameworks";
+ sourceTree = "<group>";
+ };
+ 7E4C0A7916EAA1C600542982 /* CordovaFramework */ = {
+ isa = PBXGroup;
+ children = (
+ 7E4C0AA016EAA2AD00542982 /* CDVBridge.h */,
+ 7E4C0AA116EAA2AD00542982 /* CDVBridge.m */,
+ 7E4C0AA216EAA2AD00542982 /* CDVViewController.h */,
+ 7E4C0AA316EAA2AD00542982 /* CDVViewController.m */,
+ 7E4C0AA416EAA2AD00542982 /* CDVWebViewDelegate.h */,
+ 7E4C0AA516EAA2AD00542982 /* CDVWebViewDelegate.m */,
+ 7E4C0AA616EAA2AD00542982 /* Commands */,
+ 7E4C0AC116EAA2AD00542982 /* Utils */,
+ );
+ path = CordovaFramework;
+ sourceTree = "<group>";
+ };
+ 7E4C0A7A16EAA1C600542982 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 7E4C0A7B16EAA1C600542982 /* CordovaFramework-Info.plist */,
+ 7E4C0A7C16EAA1C600542982 /* InfoPlist.strings */,
+ 7E4C0A7F16EAA1C600542982 /* CordovaFramework-Prefix.pch */,
+ );
+ name = "Supporting Files";
+ path = CordovaFramework;
+ sourceTree = "<group>";
+ };
+ 7E4C0A8F16EAA1C600542982 /* CordovaFrameworkTests */ = {
+ isa = PBXGroup;
+ children = (
+ 7E4C0A9516EAA1C700542982 /* CordovaFrameworkTests.h */,
+ 7E4C0A9616EAA1C700542982 /* CordovaFrameworkTests.m */,
+ 7E4C0A9016EAA1C700542982 /* Supporting Files */,
+ );
+ path = CordovaFrameworkTests;
+ sourceTree = "<group>";
+ };
+ 7E4C0A9016EAA1C700542982 /* Supporting Files */ = {
+ isa = PBXGroup;
+ children = (
+ 7E4C0A9116EAA1C700542982 /* CordovaFrameworkTests-Info.plist */,
+ 7E4C0A9216EAA1C700542982 /* InfoPlist.strings */,
+ );
+ name = "Supporting Files";
+ sourceTree = "<group>";
+ };
+ 7E4C0AA616EAA2AD00542982 /* Commands */ = {
+ isa = PBXGroup;
+ children = (
+ 7E4C0AA716EAA2AD00542982 /* CDV.h */,
+ 7E4C0AA816EAA2AD00542982 /* CDVAvailability.h */,
+ 7E4C0AA916EAA2AD00542982 /* CDVCommandDelegate.h */,
+ 7E4C0AAA16EAA2AD00542982 /* CDVCommandDelegateImpl.h */,
+ 7E4C0AAB16EAA2AD00542982 /* CDVCommandDelegateImpl.m */,
+ 7E4C0AAC16EAA2AD00542982 /* CDVCommandQueue.h */,
+ 7E4C0AAD16EAA2AD00542982 /* CDVCommandQueue.m */,
+ 7E4C0AAE16EAA2AD00542982 /* CDVConfigParser.h */,
+ 7E4C0AAF16EAA2AD00542982 /* CDVConfigParser.m */,
+ 7E4C0AB016EAA2AD00542982 /* CDVConnection.h */,
+ 7E4C0AB116EAA2AD00542982 /* CDVConnection.m */,
+ 7E4C0AB216EAA2AD00542982 /* CDVConsole.h */,
+ 7E4C0AB316EAA2AD00542982 /* CDVConsole.m */,
+ 7E4C0AB416EAA2AD00542982 /* CDVDebug.h */,
+ 7E4C0AB516EAA2AD00542982 /* CDVDevice.h */,
+ 7E4C0AB616EAA2AD00542982 /* CDVDevice.m */,
+ 7E4C0AB716EAA2AD00542982 /* CDVInvokedUrlCommand.h */,
+ 7E4C0AB816EAA2AD00542982 /* CDVInvokedUrlCommand.m */,
+ 7E4C0AB916EAA2AD00542982 /* CDVJSON.h */,
+ 7E4C0ABA16EAA2AD00542982 /* CDVJSON.m */,
+ 7E4C0ABB16EAA2AD00542982 /* CDVPlugin.h */,
+ 7E4C0ABC16EAA2AD00542982 /* CDVPlugin.m */,
+ 7E4C0ABD16EAA2AD00542982 /* CDVPluginResult.h */,
+ 7E4C0ABE16EAA2AD00542982 /* CDVPluginResult.m */,
+ 7E4C0ABF16EAA2AD00542982 /* CDVReachability.h */,
+ 7E4C0AC016EAA2AD00542982 /* CDVReachability.m */,
+ );
+ name = Commands;
+ path = Classes/Commands;
+ sourceTree = "<group>";
+ };
+ 7E4C0AC116EAA2AD00542982 /* Utils */ = {
+ isa = PBXGroup;
+ children = (
+ 7E4C0AC216EAA2AD00542982 /* NSData+Base64.h */,
+ 7E4C0AC316EAA2AD00542982 /* NSData+Base64.m */,
+ 7E4C0AC416EAA2AD00542982 /* NSWindow+Utils.h */,
+ 7E4C0AC516EAA2AD00542982 /* NSWindow+Utils.m */,
+ );
+ name = Utils;
+ path = Classes/Utils;
+ sourceTree = "<group>";
+ };
+/* End PBXGroup section */
+
+/* Begin PBXHeadersBuildPhase section */
+ 7E4C0A6D16EAA1C600542982 /* Headers */ = {
+ isa = PBXHeadersBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E4C0AC616EAA2AD00542982 /* CDVBridge.h in Headers */,
+ 7E4C0AC916EAA2AD00542982 /* CDVViewController.h in Headers */,
+ 7E4C0ACC16EAA2AD00542982 /* CDVWebViewDelegate.h in Headers */,
+ 7E4C0ACF16EAA2AD00542982 /* CDV.h in Headers */,
+ 7E4C0AD016EAA2AD00542982 /* CDVAvailability.h in Headers */,
+ 7E4C0AD116EAA2AD00542982 /* CDVCommandDelegate.h in Headers */,
+ 7E4C0AD216EAA2AD00542982 /* CDVCommandDelegateImpl.h in Headers */,
+ 7E4C0AD516EAA2AD00542982 /* CDVCommandQueue.h in Headers */,
+ 7E4C0AD816EAA2AD00542982 /* CDVConfigParser.h in Headers */,
+ 7E4C0ADB16EAA2AD00542982 /* CDVConnection.h in Headers */,
+ 7E4C0ADE16EAA2AD00542982 /* CDVConsole.h in Headers */,
+ 7E4C0AE116EAA2AD00542982 /* CDVDebug.h in Headers */,
+ 7E4C0AE216EAA2AD00542982 /* CDVDevice.h in Headers */,
+ 7E4C0AE516EAA2AD00542982 /* CDVInvokedUrlCommand.h in Headers */,
+ 7E4C0AE816EAA2AD00542982 /* CDVJSON.h in Headers */,
+ 7E4C0AEB16EAA2AD00542982 /* CDVPlugin.h in Headers */,
+ 7E4C0AEE16EAA2AD00542982 /* CDVPluginResult.h in Headers */,
+ 7E4C0AF116EAA2AD00542982 /* CDVReachability.h in Headers */,
+ 7E4C0AF416EAA2AD00542982 /* NSData+Base64.h in Headers */,
+ 7E4C0AF716EAA2AD00542982 /* NSWindow+Utils.h in Headers */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXHeadersBuildPhase section */
+
+/* Begin PBXNativeTarget section */
+ 7E4C0A6F16EAA1C600542982 /* Cordova */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 7E4C0A9A16EAA1C700542982 /* Build configuration list for PBXNativeTarget "Cordova" */;
+ buildPhases = (
+ 7E4C0A6B16EAA1C600542982 /* Sources */,
+ 7E4C0A6C16EAA1C600542982 /* Frameworks */,
+ 7E4C0A6D16EAA1C600542982 /* Headers */,
+ 7E4C0A6E16EAA1C600542982 /* Resources */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ );
+ name = Cordova;
+ productName = CordovaFramework;
+ productReference = 7E4C0A7016EAA1C600542982 /* Cordova.framework */;
+ productType = "com.apple.product-type.framework";
+ };
+ 7E4C0A8716EAA1C600542982 /* CordovaFrameworkTests */ = {
+ isa = PBXNativeTarget;
+ buildConfigurationList = 7E4C0A9D16EAA1C700542982 /* Build configuration list for PBXNativeTarget "CordovaFrameworkTests" */;
+ buildPhases = (
+ 7E4C0A8316EAA1C600542982 /* Sources */,
+ 7E4C0A8416EAA1C600542982 /* Frameworks */,
+ 7E4C0A8516EAA1C600542982 /* Resources */,
+ 7E4C0A8616EAA1C600542982 /* ShellScript */,
+ );
+ buildRules = (
+ );
+ dependencies = (
+ 7E4C0A8D16EAA1C600542982 /* PBXTargetDependency */,
+ );
+ name = CordovaFrameworkTests;
+ productName = CordovaFrameworkTests;
+ productReference = 7E4C0A8816EAA1C600542982 /* CordovaFrameworkTests.octest */;
+ productType = "com.apple.product-type.bundle";
+ };
+/* End PBXNativeTarget section */
+
+/* Begin PBXProject section */
+ 7E4C0A6716EAA1C600542982 /* Project object */ = {
+ isa = PBXProject;
+ attributes = {
+ LastUpgradeCheck = 0460;
+ ORGANIZATIONNAME = "Apache Foundation";
+ };
+ buildConfigurationList = 7E4C0A6A16EAA1C600542982 /* Build configuration list for PBXProject "CordovaFramework" */;
+ compatibilityVersion = "Xcode 3.2";
+ developmentRegion = English;
+ hasScannedForEncodings = 0;
+ knownRegions = (
+ en,
+ );
+ mainGroup = 7E4C0A6616EAA1C600542982;
+ productRefGroup = 7E4C0A7116EAA1C600542982 /* Products */;
+ projectDirPath = "";
+ projectRoot = "";
+ targets = (
+ 7E4C0A6F16EAA1C600542982 /* Cordova */,
+ 7E4C0A8716EAA1C600542982 /* CordovaFrameworkTests */,
+ );
+ };
+/* End PBXProject section */
+
+/* Begin PBXResourcesBuildPhase section */
+ 7E4C0A6E16EAA1C600542982 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E4C0A7E16EAA1C600542982 /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 7E4C0A8516EAA1C600542982 /* Resources */ = {
+ isa = PBXResourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E4C0A9416EAA1C700542982 /* InfoPlist.strings in Resources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXResourcesBuildPhase section */
+
+/* Begin PBXShellScriptBuildPhase section */
+ 7E4C0A8616EAA1C600542982 /* ShellScript */ = {
+ isa = PBXShellScriptBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ );
+ inputPaths = (
+ );
+ outputPaths = (
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ shellPath = /bin/sh;
+ shellScript = "# Run the unit tests in this test bundle.\n\"${SYSTEM_DEVELOPER_DIR}/Tools/RunUnitTests\"\n";
+ };
+/* End PBXShellScriptBuildPhase section */
+
+/* Begin PBXSourcesBuildPhase section */
+ 7E4C0A6B16EAA1C600542982 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E4C0AC716EAA2AD00542982 /* CDVBridge.m in Sources */,
+ 7E4C0ACA16EAA2AD00542982 /* CDVViewController.m in Sources */,
+ 7E4C0ACD16EAA2AD00542982 /* CDVWebViewDelegate.m in Sources */,
+ 7E4C0AD316EAA2AD00542982 /* CDVCommandDelegateImpl.m in Sources */,
+ 7E4C0AD616EAA2AD00542982 /* CDVCommandQueue.m in Sources */,
+ 7E4C0AD916EAA2AD00542982 /* CDVConfigParser.m in Sources */,
+ 7E4C0ADC16EAA2AD00542982 /* CDVConnection.m in Sources */,
+ 7E4C0ADF16EAA2AD00542982 /* CDVConsole.m in Sources */,
+ 7E4C0AE316EAA2AD00542982 /* CDVDevice.m in Sources */,
+ 7E4C0AE616EAA2AD00542982 /* CDVInvokedUrlCommand.m in Sources */,
+ 7E4C0AE916EAA2AD00542982 /* CDVJSON.m in Sources */,
+ 7E4C0AEC16EAA2AD00542982 /* CDVPlugin.m in Sources */,
+ 7E4C0AEF16EAA2AD00542982 /* CDVPluginResult.m in Sources */,
+ 7E4C0AF216EAA2AD00542982 /* CDVReachability.m in Sources */,
+ 7E4C0AF516EAA2AD00542982 /* NSData+Base64.m in Sources */,
+ 7E4C0AF816EAA2AD00542982 /* NSWindow+Utils.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+ 7E4C0A8316EAA1C600542982 /* Sources */ = {
+ isa = PBXSourcesBuildPhase;
+ buildActionMask = 2147483647;
+ files = (
+ 7E4C0A9716EAA1C700542982 /* CordovaFrameworkTests.m in Sources */,
+ 7E4C0AC816EAA2AD00542982 /* CDVBridge.m in Sources */,
+ 7E4C0ACB16EAA2AD00542982 /* CDVViewController.m in Sources */,
+ 7E4C0ACE16EAA2AD00542982 /* CDVWebViewDelegate.m in Sources */,
+ 7E4C0AD416EAA2AD00542982 /* CDVCommandDelegateImpl.m in Sources */,
+ 7E4C0AD716EAA2AD00542982 /* CDVCommandQueue.m in Sources */,
+ 7E4C0ADA16EAA2AD00542982 /* CDVConfigParser.m in Sources */,
+ 7E4C0ADD16EAA2AD00542982 /* CDVConnection.m in Sources */,
+ 7E4C0AE016EAA2AD00542982 /* CDVConsole.m in Sources */,
+ 7E4C0AE416EAA2AD00542982 /* CDVDevice.m in Sources */,
+ 7E4C0AE716EAA2AD00542982 /* CDVInvokedUrlCommand.m in Sources */,
+ 7E4C0AEA16EAA2AD00542982 /* CDVJSON.m in Sources */,
+ 7E4C0AED16EAA2AD00542982 /* CDVPlugin.m in Sources */,
+ 7E4C0AF016EAA2AD00542982 /* CDVPluginResult.m in Sources */,
+ 7E4C0AF316EAA2AD00542982 /* CDVReachability.m in Sources */,
+ 7E4C0AF616EAA2AD00542982 /* NSData+Base64.m in Sources */,
+ 7E4C0AF916EAA2AD00542982 /* NSWindow+Utils.m in Sources */,
+ );
+ runOnlyForDeploymentPostprocessing = 0;
+ };
+/* End PBXSourcesBuildPhase section */
+
+/* Begin PBXTargetDependency section */
+ 7E4C0A8D16EAA1C600542982 /* PBXTargetDependency */ = {
+ isa = PBXTargetDependency;
+ target = 7E4C0A6F16EAA1C600542982 /* Cordova */;
+ targetProxy = 7E4C0A8C16EAA1C600542982 /* PBXContainerItemProxy */;
+ };
+/* End PBXTargetDependency section */
+
+/* Begin PBXVariantGroup section */
+ 7E4C0A7C16EAA1C600542982 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 7E4C0A7D16EAA1C600542982 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+ 7E4C0A9216EAA1C700542982 /* InfoPlist.strings */ = {
+ isa = PBXVariantGroup;
+ children = (
+ 7E4C0A9316EAA1C700542982 /* en */,
+ );
+ name = InfoPlist.strings;
+ sourceTree = "<group>";
+ };
+/* End PBXVariantGroup section */
+
+/* Begin XCBuildConfiguration section */
+ 7E4C0A9816EAA1C700542982 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = NO;
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_DYNAMIC_NO_PIC = NO;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_OPTIMIZATION_LEVEL = 0;
+ GCC_PREPROCESSOR_DEFINITIONS = (
+ "DEBUG=1",
+ "$(inherited)",
+ );
+ GCC_SYMBOLS_PRIVATE_EXTERN = NO;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ ONLY_ACTIVE_ARCH = YES;
+ SDKROOT = macosx;
+ };
+ name = Debug;
+ };
+ 7E4C0A9916EAA1C700542982 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ ALWAYS_SEARCH_USER_PATHS = NO;
+ ARCHS = "$(ARCHS_STANDARD_64_BIT)";
+ CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
+ CLANG_CXX_LIBRARY = "libc++";
+ CLANG_ENABLE_OBJC_ARC = YES;
+ CLANG_WARN_CONSTANT_CONVERSION = YES;
+ CLANG_WARN_EMPTY_BODY = YES;
+ CLANG_WARN_ENUM_CONVERSION = YES;
+ CLANG_WARN_INT_CONVERSION = YES;
+ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
+ COPY_PHASE_STRIP = YES;
+ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+ GCC_C_LANGUAGE_STANDARD = gnu99;
+ GCC_ENABLE_OBJC_EXCEPTIONS = YES;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
+ GCC_WARN_ABOUT_RETURN_TYPE = YES;
+ GCC_WARN_UNINITIALIZED_AUTOS = YES;
+ GCC_WARN_UNUSED_VARIABLE = YES;
+ MACOSX_DEPLOYMENT_TARGET = 10.8;
+ SDKROOT = macosx;
+ };
+ name = Release;
+ };
+ 7E4C0A9B16EAA1C700542982 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "CordovaFramework/CordovaFramework-Prefix.pch";
+ INFOPLIST_FILE = "CordovaFramework/CordovaFramework-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Debug;
+ };
+ 7E4C0A9C16EAA1C700542982 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ DYLIB_COMPATIBILITY_VERSION = 1;
+ DYLIB_CURRENT_VERSION = 1;
+ FRAMEWORK_VERSION = A;
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "CordovaFramework/CordovaFramework-Prefix.pch";
+ INFOPLIST_FILE = "CordovaFramework/CordovaFramework-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = framework;
+ };
+ name = Release;
+ };
+ 7E4C0A9E16EAA1C700542982 /* Debug */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "CordovaFramework/CordovaFramework-Prefix.pch";
+ INFOPLIST_FILE = "CordovaFrameworkTests/CordovaFrameworkTests-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = octest;
+ };
+ name = Debug;
+ };
+ 7E4C0A9F16EAA1C700542982 /* Release */ = {
+ isa = XCBuildConfiguration;
+ buildSettings = {
+ COMBINE_HIDPI_IMAGES = YES;
+ FRAMEWORK_SEARCH_PATHS = "\"$(DEVELOPER_LIBRARY_DIR)/Frameworks\"";
+ GCC_PRECOMPILE_PREFIX_HEADER = YES;
+ GCC_PREFIX_HEADER = "CordovaFramework/CordovaFramework-Prefix.pch";
+ INFOPLIST_FILE = "CordovaFrameworkTests/CordovaFrameworkTests-Info.plist";
+ PRODUCT_NAME = "$(TARGET_NAME)";
+ WRAPPER_EXTENSION = octest;
+ };
+ name = Release;
+ };
+/* End XCBuildConfiguration section */
+
+/* Begin XCConfigurationList section */
+ 7E4C0A6A16EAA1C600542982 /* Build configuration list for PBXProject "CordovaFramework" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7E4C0A9816EAA1C700542982 /* Debug */,
+ 7E4C0A9916EAA1C700542982 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 7E4C0A9A16EAA1C700542982 /* Build configuration list for PBXNativeTarget "Cordova" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7E4C0A9B16EAA1C700542982 /* Debug */,
+ 7E4C0A9C16EAA1C700542982 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+ 7E4C0A9D16EAA1C700542982 /* Build configuration list for PBXNativeTarget "CordovaFrameworkTests" */ = {
+ isa = XCConfigurationList;
+ buildConfigurations = (
+ 7E4C0A9E16EAA1C700542982 /* Debug */,
+ 7E4C0A9F16EAA1C700542982 /* Release */,
+ );
+ defaultConfigurationIsVisible = 0;
+ defaultConfigurationName = Release;
+ };
+/* End XCConfigurationList section */
+ };
+ rootObject = 7E4C0A6716EAA1C600542982 /* Project object */;
+}
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/CDVBridge.h
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/CDVBridge.h b/CordovaFramework/CordovaFramework/Classes/CDVBridge.h
new file mode 100644
index 0000000..aa9e087
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/CDVBridge.h
@@ -0,0 +1,35 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Cocoa/Cocoa.h>
+@class WebView;
+@class CDVViewController;
+
+@interface CDVBridge : NSObject {
+
+}
+
+@property (nonatomic, weak) WebView* webView;
+@property (nonatomic, weak) CDVViewController* viewController;
+
+- (id) initWithWebView:(WebView*)webView andViewController:(CDVViewController*)viewController;
+- (void) exec:(NSString*)callbackId withService:(NSString*)service andAction:(NSString*)action andArguments:(NSArray*)arguments;
+
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/CDVBridge.m
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/CDVBridge.m b/CordovaFramework/CordovaFramework/Classes/CDVBridge.m
new file mode 100644
index 0000000..fade163
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/CDVBridge.m
@@ -0,0 +1,204 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <WebKit/WebKit.h>
+#import <AppKit/AppKit.h>
+#import <Foundation/NSJSONSerialization.h>
+#include <objc/message.h>
+
+#import "CDVBridge.h"
+#import "CDVViewController.h"
+
+@implementation CDVBridge
+
+- (BOOL) isArray:(id)item
+{
+ id win = [self.webView windowScriptObject];
+ NSNumber* result = [win callWebScriptMethod:@"CordovaBridgeUtil.isArray" withArguments:[NSArray arrayWithObject:item]];
+
+ return [result boolValue];
+}
+
+- (BOOL) isDictionary:(id)item
+{
+ id win = [self.webView windowScriptObject];
+ NSNumber* result = [win callWebScriptMethod:@"CordovaBridgeUtil.isObject" withArguments:[NSArray arrayWithObject:item]];
+ return [result boolValue];
+}
+
+- (NSDictionary*) convertWebScriptObjectToNSDictionary:(WebScriptObject*)webScriptObject
+{
+ // Assumption: webScriptObject has already been tested using isDictionary:
+
+ id win = [self.webView windowScriptObject];
+
+ WebScriptObject* keysObject = [win callWebScriptMethod:@"CordovaBridgeUtil.getDictionaryKeys" withArguments:[NSArray arrayWithObject:webScriptObject]];
+ NSArray* keys = [self convertWebScriptObjectToNSArray:keysObject];
+ NSMutableDictionary* dict = [NSMutableDictionary dictionaryWithCapacity:[keys count]];
+
+ NSEnumerator* enumerator = [keys objectEnumerator];
+ id key;
+ while (key = [enumerator nextObject]) {
+ [dict setObject:[webScriptObject valueForKey:key] forKey:key];
+ }
+
+ return dict;
+}
+
+- (NSArray*) convertWebScriptObjectToNSArray:(WebScriptObject*)webScriptObject
+{
+ // Assumption: webScriptObject has already been tested using isArray:
+
+ NSUInteger count = [[webScriptObject valueForKey:@"length"] integerValue];
+ NSMutableArray *a = [NSMutableArray array];
+ for (unsigned i = 0; i < count; i++) {
+ id item = [webScriptObject webScriptValueAtIndex:i];
+ if ([item isKindOfClass:[WebScriptObject class]]) {
+ if ([self isArray:item]) {
+ [a addObject:[self convertWebScriptObjectToNSArray:item]];
+ } else if ([self isDictionary:item]) {
+ [a addObject:[self convertWebScriptObjectToNSDictionary:item]];
+ };
+ } else {
+ [a addObject:item];
+ }
+ }
+
+ return a;
+}
+
+- (void) registerJavaScriptHelpers
+{
+ NSString* cordovaBridgeUtil = @"CordovaBridgeUtil = {};";
+ NSString* isArray = [NSString stringWithFormat:@"CordovaBridgeUtil.isArray = function(obj) { return obj.constructor == Array; };"];
+ NSString* isObject = [NSString stringWithFormat:@"CordovaBridgeUtil.isObject = function(obj) { return obj.constructor == Object; };"];
+ NSString* dictionaryKeys = [NSString stringWithFormat:
+ @" \
+ CordovaBridgeUtil.getDictionaryKeys = function(obj) { \
+ var a = []; \
+ for (var key in obj) { \
+ if (!obj.hasOwnProperty(key)) { \
+ continue; \
+ } \
+ a.push(key); \
+ } \
+ return a; \
+ }"
+ ];
+
+ id win = [self.webView windowScriptObject];
+ [win evaluateWebScript:cordovaBridgeUtil];
+ [win evaluateWebScript:isArray];
+ [win evaluateWebScript:isObject];
+ [win evaluateWebScript:dictionaryKeys];
+}
+
+- (id) initWithWebView:(WebView *)webView andViewController:(CDVViewController*)viewController
+{
+ if ((self = [super init]) != nil) {
+ self.webView = webView;
+ self.viewController = viewController;
+ [self registerJavaScriptHelpers];
+ }
+
+ return self;
+}
+
+- (void) exec:(NSString*)callbackId withService:(NSString*)service andAction:(NSString*)action andArguments:(WebScriptObject*)webScriptObject
+{
+ // We are going with the iOS method of passing in a callbackId.
+ // Note that we can use the JavaScriptCore C API to pass in the JavaScript function references
+ // and context and call them directly, but this is done this way for possible plugin sharing
+ // between iOS and OS X. Also we are going async as well.
+
+ // we're just going to assume the webScriptObject passed in is an NSArray
+ NSArray* arguments = [self convertWebScriptObjectToNSArray:webScriptObject];
+
+ CDVInvokedUrlCommand* command = [[CDVInvokedUrlCommand alloc] initWithArguments:arguments callbackId:callbackId className:service methodName:action];
+
+ if ((command.className == nil) || (command.methodName == nil)) {
+ NSLog(@"ERROR: Classname and/or methodName not found for command.");
+ return;
+ }
+
+ // Fetch an instance of this class
+ CDVPlugin* obj = [_viewController.commandDelegate getCommandInstance:command.className];
+
+ if (!([obj isKindOfClass:[CDVPlugin class]])) {
+ NSLog(@"ERROR: Plugin '%@' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.", command.className);
+ return;
+ }
+
+ // Find the proper selector to call.
+ NSString* methodName = [NSString stringWithFormat:@"%@:", command.methodName];
+ SEL normalSelector = NSSelectorFromString(methodName);
+ if ([obj respondsToSelector:normalSelector]) {
+ // [obj performSelector:normalSelector withObject:command];
+ objc_msgSend(obj, normalSelector, command);
+ } else {
+ // There's no method to call, so throw an error.
+ NSLog(@"ERROR: Method '%@' not defined in Plugin '%@'", methodName, command.className);
+ }
+}
+
+#pragma mark WebScripting Protocol
+
+/* checks whether a selector is acceptable to be called from JavaScript */
++ (BOOL) isSelectorExcludedFromWebScript:(SEL)selector
+{
+ BOOL result = YES;
+
+ int i = 0;
+ static SEL * acceptableList = NULL;
+ SEL currentSelector;
+
+ if (acceptableList == NULL && (acceptableList = calloc(256, sizeof(SEL)))) // up to 256 selectors
+ {
+ acceptableList[i++] = @selector(exec:withService:andAction:andArguments:);
+ }
+
+ i = 0;
+ while (result == YES && (currentSelector = acceptableList[i++]))
+ {
+ //checking for exclusions
+ result = !(selector == currentSelector);
+ }
+
+ return result;
+}
+
+/* helper function so we don't have to have underscores and stuff in js to refer to the right method */
++ (NSString*) webScriptNameForSelector:(SEL)aSelector
+{
+ id result = nil;
+
+ if (aSelector == @selector(exec:withService:andAction:andArguments:)) {
+ result = @"exec";
+ }
+
+ return result;
+}
+
+// right now exclude all properties (eg keys)
++ (BOOL) isKeyExcludedFromWebScript:(const char*)name
+{
+ return YES;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/CDVViewController.h
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/CDVViewController.h b/CordovaFramework/CordovaFramework/Classes/CDVViewController.h
new file mode 100644
index 0000000..490b1ee
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/CDVViewController.h
@@ -0,0 +1,57 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import <WebKit/WebKit.h>
+#import <Foundation/NSJSONSerialization.h>
+#import "CDVAvailability.h"
+#import "CDVInvokedUrlCommand.h"
+#import "CDVCommandDelegate.h"
+#import "CDVCommandQueue.h"
+#import "CDVPlugin.h"
+#import "CDVWebViewDelegate.h"
+
+@interface CDVViewController : NSWindowController
+{
+ @protected
+ id <CDVCommandDelegate> _commandDelegate;
+ @protected
+ CDVCommandQueue* _commandQueue;
+ NSString* _userAgent;
+}
+
+@property (nonatomic, strong) IBOutlet NSView* contentView;
+@property (nonatomic, strong) IBOutlet WebView* webView;
+@property (nonatomic, strong) IBOutlet CDVWebViewDelegate* webViewDelegate;
+
+@property (nonatomic, readonly, strong) NSMutableDictionary* pluginObjects;
+@property (nonatomic, readonly, strong) NSDictionary* pluginsMap;
+@property (nonatomic, readonly, strong) NSMutableDictionary* settings;
+@property (nonatomic, readonly, strong) NSXMLParser* configParser;
+@property (nonatomic, readonly, assign) BOOL loadFromString;
+
+@property (nonatomic, readwrite, copy) NSString* wwwFolderName;
+@property (nonatomic, readwrite, copy) NSString* startPage;
+@property (nonatomic, readonly, strong) CDVCommandQueue* commandQueue;
+@property (nonatomic, readonly, strong) id <CDVCommandDelegate> commandDelegate;
+
+- (id)getCommandInstance:(NSString*)pluginName;
+- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className;
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/CDVViewController.m b/CordovaFramework/CordovaFramework/Classes/CDVViewController.m
new file mode 100644
index 0000000..5324871
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/CDVViewController.m
@@ -0,0 +1,192 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVViewController.h"
+#import "CDVConfigParser.h"
+#import "CDVCommandDelegateImpl.h"
+
+@interface CDVViewController ()
+
+@property (nonatomic, readwrite, strong) NSXMLParser* configParser;
+@property (nonatomic, readwrite, strong) NSMutableDictionary* settings;
+@property (nonatomic, readwrite, strong) NSMutableDictionary* pluginObjects;
+@property (nonatomic, readwrite, strong) NSArray* startupPluginNames;
+@property (nonatomic, readwrite, strong) NSDictionary* pluginsMap;
+@property (nonatomic, readwrite, assign) BOOL loadFromString;
+
+@end
+
+@implementation CDVViewController
+
+@synthesize webView;
+@synthesize pluginObjects, pluginsMap, startupPluginNames;
+@synthesize configParser, settings, loadFromString;
+@synthesize wwwFolderName, startPage;
+@synthesize commandDelegate = _commandDelegate;
+@synthesize commandQueue = _commandQueue;
+
+- (void) awakeFromNib
+{
+ _commandDelegate = [[CDVCommandDelegateImpl alloc] initWithViewController:self];
+ self.webViewDelegate.viewController = self;
+
+ NSURL* appURL = nil;
+ NSString* loadErr = nil;
+
+ if ([self.startPage rangeOfString:@"://"].location != NSNotFound) {
+ appURL = [NSURL URLWithString:self.startPage];
+ } else if ([self.wwwFolderName rangeOfString:@"://"].location != NSNotFound) {
+ appURL = [NSURL URLWithString:[NSString stringWithFormat:@"%@/%@", self.wwwFolderName, self.startPage]];
+ } else {
+ NSString* startFilePath = [self.commandDelegate pathForResource:self.startPage];
+ if (startFilePath == nil) {
+ loadErr = [NSString stringWithFormat:@"ERROR: Start Page at '%@/%@' was not found.", self.wwwFolderName, self.startPage];
+ NSLog(@"%@", loadErr);
+ self.loadFromString = YES;
+ appURL = nil;
+ } else {
+ appURL = [NSURL fileURLWithPath:startFilePath];
+ }
+ }
+
+ if (!loadErr) {
+ NSURLRequest* appReq = [NSURLRequest requestWithURL:appURL cachePolicy:NSURLRequestUseProtocolCachePolicy timeoutInterval:20.0];
+ [[self.webView mainFrame] loadRequest:appReq];
+
+ } else {
+ NSString* html = [NSString stringWithFormat:@"<html><body> %@ </body></html>", loadErr];
+ [[self.webView mainFrame] loadHTMLString:html baseURL:nil];
+ }
+
+ for (NSString* pluginName in self.startupPluginNames) {
+ [self getCommandInstance:pluginName];
+ }
+}
+
+- (void) __init
+{
+ [self loadSettings];
+}
+
+- (id) init
+{
+ self = [super init];
+ if (self) {
+ // Initialization code here.
+ [self __init];
+ }
+ return self;
+}
+
+- (id)initWithWindowNibName:(NSString*)nibNameOrNil
+{
+ self = [super initWithWindowNibName:nibNameOrNil];
+ if (self) {
+ // Initialization code here.
+ [self __init];
+ }
+ return self;
+}
+
+- (void)loadSettings
+{
+ CDVConfigParser* delegate = [[CDVConfigParser alloc] init];
+
+ // read from config.xml in the app bundle
+ NSString* path = [[NSBundle mainBundle] pathForResource:@"config" ofType:@"xml"];
+
+ if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
+ NSAssert(NO, @"ERROR: config.xml does not exist. Please run cordova-ios/bin/cordova_plist_to_config_xml path/to/project.");
+ return;
+ }
+
+ NSURL* url = [NSURL fileURLWithPath:path];
+
+ configParser = [[NSXMLParser alloc] initWithContentsOfURL:url];
+ if (configParser == nil) {
+ NSLog(@"Failed to initialize XML parser.");
+ return;
+ }
+ [configParser setDelegate:((id < NSXMLParserDelegate >)delegate)];
+ [configParser parse];
+
+ // Get the plugin dictionary, whitelist and settings from the delegate.
+ self.pluginsMap = delegate.pluginsDict;
+ self.startupPluginNames = delegate.startupPluginNames;
+ self.settings = delegate.settings;
+
+ // And the start folder/page.
+ self.wwwFolderName = @"www";
+ self.startPage = delegate.startPage;
+ if (self.startPage == nil) {
+ self.startPage = @"index.html";
+ }
+
+ // Initialize the plugin objects dict.
+ self.pluginObjects = [[NSMutableDictionary alloc] initWithCapacity:20];
+}
+
+- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className
+{
+ if ([plugin respondsToSelector:@selector(setViewController:)]) {
+ [plugin setViewController:self];
+ }
+
+ if ([plugin respondsToSelector:@selector(setCommandDelegate:)]) {
+ [plugin setCommandDelegate:_commandDelegate];
+ }
+
+ [self.pluginObjects setObject:plugin forKey:className];
+ [plugin pluginInitialize];
+}
+
+/**
+ Returns an instance of a CordovaCommand object, based on its name. If one exists already, it is returned.
+ */
+- (id)getCommandInstance:(NSString*)pluginName
+{
+ // first, we try to find the pluginName in the pluginsMap
+ // (acts as a whitelist as well) if it does not exist, we return nil
+ // NOTE: plugin names are matched as lowercase to avoid problems - however, a
+ // possible issue is there can be duplicates possible if you had:
+ // "org.apache.cordova.Foo" and "org.apache.cordova.foo" - only the lower-cased entry will match
+ NSString* className = [self.pluginsMap objectForKey:[pluginName lowercaseString]];
+
+ if (className == nil) {
+ return nil;
+ }
+
+ id obj = [self.pluginObjects objectForKey:className];
+ if (!obj) {
+ obj = [[NSClassFromString (className)alloc] initWithWebView:webView];
+
+ if (obj != nil) {
+ [self registerPlugin:obj withClassName:className];
+ } else {
+ NSLog(@"CDVPlugin class %@ (pluginName: %@) does not exist.", className, pluginName);
+ }
+ }
+ return obj;
+}
+
+- (void) windowResized:(NSNotification*)notification;
+{
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/CDVWebViewDelegate.h
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/CDVWebViewDelegate.h b/CordovaFramework/CordovaFramework/Classes/CDVWebViewDelegate.h
new file mode 100644
index 0000000..c2a33f4
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/CDVWebViewDelegate.h
@@ -0,0 +1,34 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Cocoa/Cocoa.h>
+#import <WebKit/WebKit.h>
+
+@class CDVConsole;
+@class CDVBridge;
+@class CDVViewController;
+
+@interface CDVWebViewDelegate : NSObject {
+}
+
+@property (nonatomic, strong) CDVConsole* console;
+@property (nonatomic, strong) CDVBridge* bridge;
+@property (nonatomic, weak) CDVViewController* viewController;
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/CDVWebViewDelegate.m
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/CDVWebViewDelegate.m b/CordovaFramework/CordovaFramework/Classes/CDVWebViewDelegate.m
new file mode 100644
index 0000000..144c8fd
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/CDVWebViewDelegate.m
@@ -0,0 +1,87 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+
+#import "CDVWebViewDelegate.h"
+#import "CDVConsole.h"
+#import "CDVBridge.h"
+
+@implementation CDVWebViewDelegate
+
+@synthesize console;
+
+- (void) webView:(WebView*)webView windowScriptObjectAvailable:(WebScriptObject*)windowScriptObject
+{
+ if (self.console == nil) {
+ self.console = [CDVConsole new];
+ }
+ [windowScriptObject setValue:self.console forKey:@"console"];
+
+ if (self.bridge == nil) {
+ self.bridge = [[CDVBridge alloc] initWithWebView:webView andViewController:self.viewController];
+ }
+ [windowScriptObject setValue:self.bridge forKey:@"cordovabridge"];
+}
+
+- (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame
+{
+ id win = [sender windowScriptObject];
+ NSString* nativeReady = @"try{cordova.require('cordova/channel').onNativeReady.fire();}catch(e){window._nativeReady = true;}";
+ [win evaluateWebScript:nativeReady];
+}
+
+/* This logs all errors from Javascript, nifty */
+- (void) webView:(WebView*)webView addMessageToConsole:(NSDictionary*)message
+{
+ if (![message isKindOfClass:[NSDictionary class]]) {
+ return;
+ }
+
+ NSLog(@"JavaScript error: %@:%@: %@",
+ [[message objectForKey:@"sourceURL"] lastPathComponent], // could be nil
+ [message objectForKey:@"lineNumber"],
+ [message objectForKey:@"message"]);
+}
+
+#pragma mark WebScripting protocol
+
+/* checks whether a selector is acceptable to be called from JavaScript */
++ (BOOL) isSelectorExcludedFromWebScript:(SEL)selector
+{
+ return YES;
+}
+
+// right now exclude all properties (eg keys)
++ (BOOL) isKeyExcludedFromWebScript:(const char*)name
+{
+ return YES;
+}
+
+#pragma mark WebPolicyDelegate
+
+- (void)webView:(WebView *)sender decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener
+{
+ NSString* url = [[request URL] description];
+ NSLog(@"navigating to %@", url);
+
+ [listener use];
+}
+
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/Commands/CDV.h
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/Commands/CDV.h b/CordovaFramework/CordovaFramework/Classes/Commands/CDV.h
new file mode 100644
index 0000000..6fe45d8
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/Commands/CDV.h
@@ -0,0 +1,27 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVAvailability.h"
+
+#import "CDVJSON.h"
+#import "CDVDebug.h"
+#import "CDVPluginResult.h"
+#import "CDVInvokedUrlCommand.h"
+#import "CDVPlugin.h"
+#import "CDVDevice.h"
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/Commands/CDVAvailability.h
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/Commands/CDVAvailability.h b/CordovaFramework/CordovaFramework/Classes/Commands/CDVAvailability.h
new file mode 100644
index 0000000..955051e
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/Commands/CDVAvailability.h
@@ -0,0 +1,53 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#define __CORDOVA_2_6_0 20600
+#define __CORDOVA_NA 99999 /* not available */
+
+/*
+ #if CORDOVA_VERSION_MIN_REQUIRED >= __CORDOVA_1_7_0
+ // do something when its at least 1.7.0
+ #else
+ // do something else (non 1.7.0)
+ #endif
+ */
+#ifndef CORDOVA_VERSION_MIN_REQUIRED
+ #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_2_6_0
+#endif
+
+
+/* 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]
+
+#ifdef __clang__
+ #define CDV_DEPRECATED(version, msg) __attribute__((deprecated("Deprecated in Cordova " #version ". " msg)))
+#else
+ #define CDV_DEPRECATED(version, msg) __attribute__((deprecated()))
+#endif
+
+// Enable this to log all exec() calls.
+#define CDV_ENABLE_EXEC_LOGGING 0
+#if CDV_ENABLE_EXEC_LOGGING
+ #define CDV_EXEC_LOG NSLog
+#else
+ #define CDV_EXEC_LOG(...) do {} while (NO)
+#endif
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegate.h
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegate.h b/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegate.h
new file mode 100644
index 0000000..e177c63
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegate.h
@@ -0,0 +1,55 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVAvailability.h"
+#import "CDVInvokedUrlCommand.h"
+
+@class CDVPlugin;
+@class CDVPluginResult;
+@class CDVWhitelist;
+
+@protocol CDVCommandDelegate <NSObject>
+
+@property (nonatomic, readonly) NSDictionary* settings;
+
+- (NSString*)pathForResource:(NSString*)resourcepath;
+- (id)getCommandInstance:(NSString*)pluginName;
+- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className CDV_DEPRECATED(2.2, "Use CDVViewController to register plugins, or use config.xml.");
+
+// Plugins should not be using this interface to call other plugins since it
+// will result in bogus callbacks being made.
+- (BOOL)execute:(CDVInvokedUrlCommand*)command CDV_DEPRECATED(2.2, "Use direct method calls instead.");
+
+// Sends a plugin result to the JS. This is thread-safe.
+- (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId;
+// Evaluates the given JS. This is thread-safe.
+- (void)evalJs:(NSString*)js;
+// Can be used to evaluate JS right away instead of scheduling it on the run-loop.
+// This is required for dispatch resign and pause events, but should not be used
+// without reason. Without the run-loop delay, alerts used in JS callbacks may result
+// in dead-lock. This method must be called from the UI thread.
+- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop;
+// Runs the given block on a background thread using a shared thread-pool.
+- (void)runInBackground:(void (^)())block;
+// Returns the User-Agent of the associated UIWebView.
+- (NSString*)userAgent;
+// Returns whether the given URL passes the white-list.
+- (BOOL)URLIsWhitelisted:(NSURL*)url;
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegateImpl.h
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegateImpl.h b/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegateImpl.h
new file mode 100644
index 0000000..db0bd09
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegateImpl.h
@@ -0,0 +1,32 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVCommandDelegate.h"
+
+@class CDVViewController;
+@class CDVCommandQueue;
+
+@interface CDVCommandDelegateImpl : NSObject <CDVCommandDelegate>{
+// @private
+ __weak CDVViewController* _viewController;
+ @protected
+ __weak CDVCommandQueue* _commandQueue;
+}
+- (id)initWithViewController:(CDVViewController*)viewController;
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegateImpl.m
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegateImpl.m b/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegateImpl.m
new file mode 100644
index 0000000..ed082aa
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandDelegateImpl.m
@@ -0,0 +1,156 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVCommandDelegateImpl.h"
+#import "CDVJSON.h"
+#import "CDVCommandQueue.h"
+#import "CDVPluginResult.h"
+#import "CDVViewController.h"
+
+@implementation CDVCommandDelegateImpl
+
+- (id)initWithViewController:(CDVViewController*)viewController
+{
+ self = [super init];
+ if (self != nil) {
+ _viewController = viewController;
+ // TODO:
+ //_commandQueue = _viewController.commandQueue;
+ }
+ return self;
+}
+
+- (NSString*)pathForResource:(NSString*)resourcepath
+{
+ NSBundle* mainBundle = [NSBundle mainBundle];
+ NSMutableArray* directoryParts = [NSMutableArray arrayWithArray:[resourcepath componentsSeparatedByString:@"/"]];
+ NSString* filename = [directoryParts lastObject];
+
+ [directoryParts removeLastObject];
+
+ NSString* directoryPartsJoined = [directoryParts componentsJoinedByString:@"/"];
+ NSString* directoryStr = _viewController.wwwFolderName;
+
+ if ([directoryPartsJoined length] > 0) {
+ directoryStr = [NSString stringWithFormat:@"%@/%@", _viewController.wwwFolderName, [directoryParts componentsJoinedByString:@"/"]];
+ }
+
+ return [mainBundle pathForResource:filename ofType:@"" inDirectory:directoryStr];
+}
+
+- (void)evalJsHelper2:(NSString*)js
+{
+ CDV_EXEC_LOG(@"Exec: evalling: %@", [js substringToIndex:MIN([js length], 160)]);
+ NSString* commandsJSON = [_viewController.webView stringByEvaluatingJavaScriptFromString:js];
+ if ([commandsJSON length] > 0) {
+ CDV_EXEC_LOG(@"Exec: Retrieved new exec messages by chaining.");
+ }
+
+ // TODO:
+// [_commandQueue enqueCommandBatch:commandsJSON];
+}
+
+- (void)evalJsHelper:(NSString*)js
+{
+ // Cycle the run-loop before executing the JS.
+ // This works around a bug where sometimes alerts() within callbacks can cause
+ // dead-lock.
+ // If the commandQueue is currently executing, then we know that it is safe to
+ // execute the callback immediately.
+ // Using (dispatch_get_main_queue()) does *not* fix deadlocks for some reaon,
+ // but performSelectorOnMainThread: does.
+
+ if (![NSThread isMainThread] || !_commandQueue.currentlyExecuting) {
+ [self performSelectorOnMainThread:@selector(evalJsHelper2:) withObject:js waitUntilDone:NO];
+ } else {
+ [self evalJsHelper2:js];
+ }
+}
+
+- (void)sendPluginResult:(CDVPluginResult*)result callbackId:(NSString*)callbackId
+{
+ CDV_EXEC_LOG(@"Exec(%@): Sending result. Status=%@", callbackId, result.status);
+ // This occurs when there is are no win/fail callbacks for the call.
+ if ([@"INVALID" isEqualToString:callbackId]) {
+ return;
+ }
+ int status = [result.status intValue];
+ BOOL keepCallback = [result.keepCallback boolValue];
+ NSString* argumentsAsJSON = [result argumentsAsJSON];
+
+ NSString* js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeCallback('%@',%d,%@,%d)", callbackId, status, argumentsAsJSON, keepCallback];
+
+ [self evalJsHelper:js];
+}
+
+- (void)evalJs:(NSString*)js
+{
+ [self evalJs:js scheduledOnRunLoop:YES];
+}
+
+- (void)evalJs:(NSString*)js scheduledOnRunLoop:(BOOL)scheduledOnRunLoop
+{
+ js = [NSString stringWithFormat:@"cordova.require('cordova/exec').nativeEvalAndFetch(function(){%@})", js];
+ if (scheduledOnRunLoop) {
+ [self evalJsHelper:js];
+ } else {
+ [self evalJsHelper2:js];
+ }
+}
+
+- (BOOL)execute:(CDVInvokedUrlCommand*)command
+{
+ return [_commandQueue execute:command];
+}
+
+- (id)getCommandInstance:(NSString*)pluginName
+{
+ return [_viewController getCommandInstance:pluginName];
+}
+
+- (void)registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className
+{
+ [_viewController registerPlugin:plugin withClassName:className];
+}
+
+- (void)runInBackground:(void (^)())block
+{
+ dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), block);
+}
+
+- (NSString*)userAgent
+{
+ //return [_viewController userAgent];
+ return nil;
+}
+
+- (BOOL)URLIsWhitelisted:(NSURL*)url
+{
+// TODO:
+// return ![_viewController.whitelist schemeIsAllowed:[url scheme]] ||
+// [_viewController.whitelist URLIsAllowed:url];
+ return NO;
+}
+
+- (NSDictionary*)settings
+{
+ return _viewController.settings;
+}
+
+@end
http://git-wip-us.apache.org/repos/asf/cordova-osx/blob/5a67ee70/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandQueue.h
----------------------------------------------------------------------
diff --git a/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandQueue.h b/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandQueue.h
new file mode 100644
index 0000000..27c47b5
--- /dev/null
+++ b/CordovaFramework/CordovaFramework/Classes/Commands/CDVCommandQueue.h
@@ -0,0 +1,40 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import <Foundation/Foundation.h>
+
+@class CDVInvokedUrlCommand;
+@class CDVViewController;
+
+@interface CDVCommandQueue : NSObject
+
+@property (nonatomic, readonly) BOOL currentlyExecuting;
+
+- (id)initWithViewController:(CDVViewController*)viewController;
+- (void)dispose;
+
+- (void)resetRequestId;
+- (void)enqueCommandBatch:(NSString*)batchJSON;
+
+- (void)maybeFetchCommandsFromJs:(NSNumber*)requestId;
+- (void)fetchCommandsFromJs;
+- (void)executePending;
+- (BOOL)execute:(CDVInvokedUrlCommand*)command;
+
+@end