Update some plugins to new Exec format. Plugins update: -CDVAccelerometer -CDVBattery -CDVDebugConsole -CDVDevice -CDVLogger -CDVSplashScreen
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/01eb22da Tree: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/tree/01eb22da Diff: http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/diff/01eb22da Branch: refs/heads/master Commit: 01eb22da37382be1b3944ede5e08a5ec9a6641d7 Parents: fe006ae Author: Andrew Grieve <agri...@chromium.org> Authored: Fri Aug 3 09:53:21 2012 -0400 Committer: Andrew Grieve <agri...@chromium.org> Committed: Fri Aug 3 11:16:58 2012 -0400 ---------------------------------------------------------------------- CordovaLib/Classes/CDVAccelerometer.h | 4 ++-- CordovaLib/Classes/CDVAccelerometer.m | 8 ++++---- CordovaLib/Classes/CDVBattery.h | 4 ++-- CordovaLib/Classes/CDVBattery.m | 8 ++++---- CordovaLib/Classes/CDVDebugConsole.h | 2 +- CordovaLib/Classes/CDVDebugConsole.m | 7 +++---- CordovaLib/Classes/CDVDevice.h | 2 +- CordovaLib/Classes/CDVDevice.m | 4 ++-- CordovaLib/Classes/CDVLogger.h | 2 +- CordovaLib/Classes/CDVLogger.m | 6 +++--- CordovaLib/Classes/CDVSplashScreen.h | 4 ++-- CordovaLib/Classes/CDVSplashScreen.m | 4 ++-- 12 files changed, 27 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVAccelerometer.h ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVAccelerometer.h b/CordovaLib/Classes/CDVAccelerometer.h index f62fb82..50f8a48 100755 --- a/CordovaLib/Classes/CDVAccelerometer.h +++ b/CordovaLib/Classes/CDVAccelerometer.h @@ -35,8 +35,8 @@ - (CDVAccelerometer*) init; -- (void)start:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void)stop:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; +- (void)start:(CDVInvokedUrlCommand*)command; +- (void)stop:(CDVInvokedUrlCommand*)command; @end http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVAccelerometer.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVAccelerometer.m b/CordovaLib/Classes/CDVAccelerometer.m index 77b863a..7d82758 100644 --- a/CordovaLib/Classes/CDVAccelerometer.m +++ b/CordovaLib/Classes/CDVAccelerometer.m @@ -51,12 +51,12 @@ } - (void) dealloc { - [self stop:nil withDict:nil]; + [self stop:nil]; } -- (void)start:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options +- (void)start:(CDVInvokedUrlCommand*)command { - NSString* cbId = [arguments objectAtIndex:0]; + NSString* cbId = command.callbackId; NSTimeInterval desiredFrequency_num = kAccelerometerInterval; UIAccelerometer* pAccel = [UIAccelerometer sharedAccelerometer]; // accelerometer expects fractional seconds, but we have msecs @@ -69,7 +69,7 @@ } } -- (void)stop:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options +- (void)stop:(CDVInvokedUrlCommand*)command { UIAccelerometer* theAccelerometer = [UIAccelerometer sharedAccelerometer]; theAccelerometer.delegate = nil; http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVBattery.h ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVBattery.h b/CordovaLib/Classes/CDVBattery.h index 5cc765c..88656b4 100644 --- a/CordovaLib/Classes/CDVBattery.h +++ b/CordovaLib/Classes/CDVBattery.h @@ -35,7 +35,7 @@ - (void) updateBatteryStatus:(NSNotification*)notification; - (NSDictionary*) getBatteryStatus; -- (void) start:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; -- (void) stop:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; +- (void) start:(CDVInvokedUrlCommand*)command; +- (void) stop:(CDVInvokedUrlCommand*)command; - (void)dealloc; @end http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVBattery.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVBattery.m b/CordovaLib/Classes/CDVBattery.m index 8a74ad3..278b78b 100644 --- a/CordovaLib/Classes/CDVBattery.m +++ b/CordovaLib/Classes/CDVBattery.m @@ -105,9 +105,9 @@ } /* turn on battery monitoring*/ -- (void) start:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options +- (void) start:(CDVInvokedUrlCommand*)command { - self.callbackId = [arguments objectAtIndex:0]; + self.callbackId = command.callbackId; if ( [UIDevice currentDevice].batteryMonitoringEnabled == NO) { [[UIDevice currentDevice] setBatteryMonitoringEnabled:YES]; @@ -119,7 +119,7 @@ } /* turn off battery monitoring */ -- (void) stop:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options +- (void) stop:(CDVInvokedUrlCommand*)command { // callback one last time to clear the callback function on JS side if (self.callbackId) { @@ -148,7 +148,7 @@ - (void)dealloc { - [self stop: NULL withDict:NULL]; + [self stop:nil]; } @end http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVDebugConsole.h ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVDebugConsole.h b/CordovaLib/Classes/CDVDebugConsole.h index 2bc82f3..44e49da 100644 --- a/CordovaLib/Classes/CDVDebugConsole.h +++ b/CordovaLib/Classes/CDVDebugConsole.h @@ -25,6 +25,6 @@ @interface CDVDebugConsole : CDVPlugin { } -- (void)log:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; +- (void)log:(CDVInvokedUrlCommand*)command; @end http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVDebugConsole.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVDebugConsole.m b/CordovaLib/Classes/CDVDebugConsole.m index da7e303..decf7ae 100644 --- a/CordovaLib/Classes/CDVDebugConsole.m +++ b/CordovaLib/Classes/CDVDebugConsole.m @@ -21,11 +21,10 @@ @implementation CDVDebugConsole -- (void)log:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options +- (void)log:(CDVInvokedUrlCommand*)command { - NSString* callbackId = [arguments objectAtIndex:0]; -#pragma unused(callbackId) - NSString* message = [arguments objectAtIndex:1]; + NSString* message = [command.arguments objectAtIndex:0]; + NSDictionary* options = [command.arguments objectAtIndex:1]; NSString* log_level = @"INFO"; if ([options objectForKey:@"logLevel"]) log_level = [options objectForKey:@"logLevel"]; http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVDevice.h ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVDevice.h b/CordovaLib/Classes/CDVDevice.h index bcdf80f..394f5fc 100644 --- a/CordovaLib/Classes/CDVDevice.h +++ b/CordovaLib/Classes/CDVDevice.h @@ -26,7 +26,7 @@ + (NSString*) cordovaVersion; -- (void)getDeviceInfo:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options; +- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command; @end http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVDevice.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVDevice.m b/CordovaLib/Classes/CDVDevice.m index dcaec6a..d0a4b43 100644 --- a/CordovaLib/Classes/CDVDevice.m +++ b/CordovaLib/Classes/CDVDevice.m @@ -27,9 +27,9 @@ @implementation CDVDevice -- (void)getDeviceInfo:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options +- (void)getDeviceInfo:(CDVInvokedUrlCommand*)command { - NSString* cbId = [arguments objectAtIndex:0]; + NSString* cbId = command.callbackId; NSDictionary *deviceProperties = [self deviceProperties]; NSMutableString* result = [[NSMutableString alloc] initWithFormat:@""]; CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:deviceProperties]; http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVLogger.h ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVLogger.h b/CordovaLib/Classes/CDVLogger.h index 68e9040..484a566 100644 --- a/CordovaLib/Classes/CDVLogger.h +++ b/CordovaLib/Classes/CDVLogger.h @@ -21,6 +21,6 @@ @interface CDVLogger : CDVPlugin -- (void) logLevel:(NSArray*)arguments withDict:(NSMutableDictionary*)options; +- (void) logLevel:(CDVInvokedUrlCommand*)command; @end http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVLogger.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVLogger.m b/CordovaLib/Classes/CDVLogger.m index 0a3b4f8..bf4a36c 100644 --- a/CordovaLib/Classes/CDVLogger.m +++ b/CordovaLib/Classes/CDVLogger.m @@ -23,10 +23,10 @@ @implementation CDVLogger /* log a message */ -- (void) logLevel:(NSArray*)arguments withDict:(NSMutableDictionary*)options; +- (void) logLevel:(CDVInvokedUrlCommand*)command { - id level = [arguments objectAtIndex:1]; - id message = [arguments objectAtIndex:2]; + id level = [command.arguments objectAtIndex:0]; + id message = [command.arguments objectAtIndex:1]; if ([level isEqualToString:@"LOG"]) { NSLog(@"%@", message); http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVSplashScreen.h ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVSplashScreen.h b/CordovaLib/Classes/CDVSplashScreen.h index e2a6d4c..d5bb5c4 100644 --- a/CordovaLib/Classes/CDVSplashScreen.h +++ b/CordovaLib/Classes/CDVSplashScreen.h @@ -24,7 +24,7 @@ @interface CDVSplashScreen : CDVPlugin { } -- (void) show:(NSArray*)arguments withDict:(NSMutableDictionary*)options; -- (void) hide:(NSArray*)arguments withDict:(NSMutableDictionary*)options; +- (void) show:(CDVInvokedUrlCommand*)command; +- (void) hide:(CDVInvokedUrlCommand*)command; @end http://git-wip-us.apache.org/repos/asf/incubator-cordova-ios/blob/01eb22da/CordovaLib/Classes/CDVSplashScreen.m ---------------------------------------------------------------------- diff --git a/CordovaLib/Classes/CDVSplashScreen.m b/CordovaLib/Classes/CDVSplashScreen.m index cce13ab..43fc4dd 100644 --- a/CordovaLib/Classes/CDVSplashScreen.m +++ b/CordovaLib/Classes/CDVSplashScreen.m @@ -38,12 +38,12 @@ } } -- (void) show:(NSArray*)arguments withDict:(NSMutableDictionary*)options +- (void) show:(CDVInvokedUrlCommand*)command { [self __show:YES]; } -- (void) hide:(NSArray*)arguments withDict:(NSMutableDictionary*)options +- (void) hide:(CDVInvokedUrlCommand*)command { [self __show:NO]; }