5 Commits
4 changed files with 15 additions and 14 deletions
+2 -2
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?><plugin xmlns="http://www.phonegap.com/ns/plugins/1.0"
xmlns:android="http://schemas.android.com/apk/res/android"
id="com.phonegap.plugins.barcodescanner"
version="0.7.0">
version="0.7.1">
<name>BarcodeScanner</name>
@@ -28,7 +28,7 @@
<header-file src="src/ios/zxing-all-in-one.h" />
<source-file src="src/ios/CDVBarcodeScanner.mm" />
<source-file src="src/ios/CDVBarcodeScanner.mm" compiler-flags="-fno-objc-arc" />
<source-file src="src/ios/zxing-all-in-one.cpp" />
<framework src="libiconv.dylib" />
+1
View File
@@ -81,6 +81,7 @@ Workflow for creating and building example project with the plugin:
3. Install the plugin (current dir. being "hello"):
```
plugman --plugins_dir plugins --plugin com.phonegap.plugins.barcodescanner --platform android --project platforms\android
plugman install --plugins_dir plugins --plugin com.phonegap.plugins.barcodescanner --platform android --project platforms\android
```
Note. To manually remove plugin you need to re-create plugins\android.json (and remove changes done by the plugin - you can simply remove whole platform as described in first step and re-create).
+9 -9
View File
@@ -46,8 +46,8 @@
//------------------------------------------------------------------------------
@interface CDVBarcodeScanner : CDVPlugin {}
- (NSString*)isScanNotPossible;
- (void)scan:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void)encode:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options;
- (void)scan:(CDVInvokedUrlCommand*)command;
- (void)encode:(CDVInvokedUrlCommand*)command;
- (void)returnSuccess:(NSString*)scannedText format:(NSString*)format cancelled:(BOOL)cancelled callback:(NSString*)callback;
- (void)returnError:(NSString*)message callback:(NSString*)callback;
@end
@@ -120,18 +120,18 @@
}
//--------------------------------------------------------------------------
- (void)scan:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options {
- (void)scan:(CDVInvokedUrlCommand*)command {
CDVbcsProcessor* processor;
NSString* callback;
NSString* capabilityError;
callback = [arguments objectAtIndex:0];
callback = command.callbackId;
// We allow the user to define an alternate xib file for loading the overlay.
NSString *overlayXib = nil;
if ( [arguments count] == 2 )
if ( [command.arguments count] >= 1 )
{
overlayXib = [arguments objectAtIndex:1];
overlayXib = [command.arguments objectAtIndex:0];
}
capabilityError = [self isScanNotPossible];
@@ -152,8 +152,8 @@
}
//--------------------------------------------------------------------------
- (void)encode:(NSMutableArray*)arguments withDict:(NSMutableDictionary*)options {
[self returnError:@"encode function not supported" callback:[arguments objectAtIndex:0]];
- (void)encode:(CDVInvokedUrlCommand*)command {
[self returnError:@"encode function not supported" callback:command.callbackId];
}
//--------------------------------------------------------------------------
@@ -855,4 +855,4 @@ parentViewController:(UIViewController*)parentViewController
[super willAnimateRotationToInterfaceOrientation:orientation duration:duration];
}
@end
@end
+3 -3
View File
@@ -1940,7 +1940,7 @@ GreyscaleLuminanceSource::GreyscaleLuminanceSource(unsigned char* greyData, int
unsigned char* GreyscaleLuminanceSource::getRow(int y, unsigned char* row) {
if (y < 0 || y >= this->getHeight()) {
throw IllegalArgumentException("Requested row is outside the image: " + y);
throw IllegalArgumentException("Requested row is outside the image.");
}
int width = getWidth();
// TODO(flyashi): determine if row has enough size.
@@ -2017,7 +2017,7 @@ GreyscaleRotatedLuminanceSource::GreyscaleRotatedLuminanceSource(unsigned char*
// The API asks for rows, but we're rotated, so we return columns.
unsigned char* GreyscaleRotatedLuminanceSource::getRow(int y, unsigned char* row) {
if (y < 0 || y >= getHeight()) {
throw IllegalArgumentException("Requested row is outside the image: " + y);
throw IllegalArgumentException("Requested row is outside the image");
}
int width = getWidth();
if (row == NULL) {
@@ -10309,7 +10309,7 @@ namespace {
int secondThirdBytes = bits.readBits(16);
return ((firstByte & 0x1F) << 16) | secondThirdBytes;
}
throw IllegalArgumentException("Bad ECI bits starting with byte " + firstByte);
throw IllegalArgumentException("Bad ECI bits starting with byte ");
}
}