[SCM] Multi-format 1D/2D barcode image processing library branch, upstream, updated. 24d4480bc48cf9eabf7b2bd2f528248b0e458809

rpechayr rpechayr at 59b500cc-1b3d-0410-9834-0bbf25fbcc57
Wed Aug 4 01:32:06 UTC 2010


The following commit has been merged in the upstream branch:
commit 205d36173f81d3d45f886f9f67502a8ed1d47066
Author: rpechayr <rpechayr at 59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Date:   Tue Jun 15 22:01:04 2010 +0000

    [iphone] now decoders need to be injected into ZXingWidgetController to enhance performance when only a few readers are needed. One exc bad access bug solved. A few minor bugs remain in ScanTest. 1st status bar does not reappear when success of scan. this one should be easy to fix. 2nd ScanTest does not display the results when scan success for the first time, but only second time. This second bug is strange
    
    git-svn-id: http://zxing.googlecode.com/svn/trunk@1432 59b500cc-1b3d-0410-9834-0bbf25fbcc57

diff --git a/iphone/ScanTest/Classes/RootViewController.m b/iphone/ScanTest/Classes/RootViewController.mm
similarity index 89%
rename from iphone/ScanTest/Classes/RootViewController.m
rename to iphone/ScanTest/Classes/RootViewController.mm
index 20ef834..36ff820 100644
--- a/iphone/ScanTest/Classes/RootViewController.m
+++ b/iphone/ScanTest/Classes/RootViewController.mm
@@ -7,6 +7,8 @@
 //
 
 #import "RootViewController.h"
+#import "QRCodeReader.h"
+
 @interface RootViewController()
 @property (nonatomic,retain) ZXingWidgetController *scanController;
 
@@ -25,6 +27,12 @@
 	[self setTitle:@"ZXing"];
   
   ZXingWidgetController *widController = [[ZXingWidgetController alloc] initWithDelegate:self showCancel:YES OneDMode:NO];
+  QRCodeReader* qrcodeReader = [[QRCodeReader alloc] init];
+  NSSet *readers = [[NSSet alloc ] initWithObjects:qrcodeReader,nil];
+  [qrcodeReader release];
+  widController.readers = readers;
+  [readers release];
+  
 	self.scanController = widController;
   [widController release];
 	NSBundle *mainBundle = [NSBundle mainBundle];
@@ -35,7 +43,7 @@
 - (IBAction)scanPressed:(id)sender {
   //UIImagePickerController *picker = [[UIImagePickerController alloc] init];
 	[self presentModalViewController:scanController
-                          animated:NO];
+                          animated:YES];
 //	[self.navigationController pushViewController:scanController animated:true];
 }
 
@@ -72,7 +80,7 @@
 
 - (void)scanResult:(NSString *)result {
 	//[self.resultsView setText:result];
-	[self dismissModalViewControllerAnimated:YES];
+	[self dismissModalViewControllerAnimated:NO];
   self.resultsToDisplay = result;
 }
 
diff --git a/iphone/ScanTest/ScanTest.xcodeproj/project.pbxproj b/iphone/ScanTest/ScanTest.xcodeproj/project.pbxproj
index 5d04841..09aff48 100755
--- a/iphone/ScanTest/ScanTest.xcodeproj/project.pbxproj
+++ b/iphone/ScanTest/ScanTest.xcodeproj/project.pbxproj
@@ -15,7 +15,7 @@
 		1FF586FD11BBD81D00E8E868 /* main.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1FF586FC11BBD81D00E8E868 /* main.mm */; };
 		2892E4100DC94CBA00A64D0F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2892E40F0DC94CBA00A64D0F /* CoreGraphics.framework */; };
 		28AD73600D9D9599002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD735F0D9D9599002E5188 /* MainWindow.xib */; };
-		28C286E10D94DF7D0034E888 /* RootViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28C286E00D94DF7D0034E888 /* RootViewController.m */; };
+		28C286E10D94DF7D0034E888 /* RootViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 28C286E00D94DF7D0034E888 /* RootViewController.mm */; };
 		28F335F11007B36200424DE2 /* RootViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28F335F01007B36200424DE2 /* RootViewController.xib */; };
 		E5345BF11198D81A000CB77F /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E5345BF01198D81A000CB77F /* AudioToolbox.framework */; };
 		E548755C119C62B9001CC0F8 /* beep-beep.aiff in Resources */ = {isa = PBXBuildFile; fileRef = E548755B119C62B9001CC0F8 /* beep-beep.aiff */; };
@@ -51,7 +51,7 @@
 		28A0AAE50D9B0CCF005BE974 /* ScanTest_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScanTest_Prefix.pch; sourceTree = "<group>"; };
 		28AD735F0D9D9599002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = "<group>"; };
 		28C286DF0D94DF7D0034E888 /* RootViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RootViewController.h; sourceTree = "<group>"; };
-		28C286E00D94DF7D0034E888 /* RootViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RootViewController.m; sourceTree = "<group>"; };
+		28C286E00D94DF7D0034E888 /* RootViewController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RootViewController.mm; sourceTree = "<group>"; };
 		28F335F01007B36200424DE2 /* RootViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = RootViewController.xib; sourceTree = "<group>"; };
 		8D1107310486CEB800E47090 /* ScanTest-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "ScanTest-Info.plist"; plistStructureDefinitionIdentifier = "com.apple.xcode.plist.structure-definition.iphone.info-plist"; sourceTree = "<group>"; };
 		E5345BF01198D81A000CB77F /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
@@ -80,7 +80,7 @@
 			isa = PBXGroup;
 			children = (
 				28C286DF0D94DF7D0034E888 /* RootViewController.h */,
-				28C286E00D94DF7D0034E888 /* RootViewController.m */,
+				28C286E00D94DF7D0034E888 /* RootViewController.mm */,
 				1D3623240D0F684500981E51 /* ScanTestAppDelegate.h */,
 				1D3623250D0F684500981E51 /* ScanTestAppDelegate.m */,
 			);
@@ -237,7 +237,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				1D3623260D0F684500981E51 /* ScanTestAppDelegate.m in Sources */,
-				28C286E10D94DF7D0034E888 /* RootViewController.m in Sources */,
+				28C286E10D94DF7D0034E888 /* RootViewController.mm in Sources */,
 				1FF586FD11BBD81D00E8E868 /* main.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -264,6 +264,7 @@
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = ScanTest_Prefix.pch;
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
 				GCC_VERSION = "";
 				INFOPLIST_FILE = "ScanTest-Info.plist";
 				LIBRARY_SEARCH_PATHS = "$(inherited)";
@@ -282,6 +283,7 @@
 				EXPORTED_SYMBOLS_FILE = ../ZXingWidget/exportList;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = ScanTest_Prefix.pch;
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
 				INFOPLIST_FILE = "ScanTest-Info.plist";
 				LIBRARY_SEARCH_PATHS = (
 					"$(inherited)",
@@ -301,10 +303,13 @@
 				GCC_VERSION = "";
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				HEADER_SEARCH_PATHS = "../ZXingWidget/Classes/**";
-				IPHONEOS_DEPLOYMENT_TARGET = 3.1;
+				HEADER_SEARCH_PATHS = (
+					../../cpp/core/src,
+					"../ZXingWidget/Classes/**",
+				);
+				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
 				PREBINDING = NO;
-				SDKROOT = iphoneos3.1;
+				SDKROOT = iphoneos3.1.3;
 			};
 			name = Debug;
 		};
@@ -316,10 +321,14 @@
 				GCC_C_LANGUAGE_STANDARD = c99;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
-				HEADER_SEARCH_PATHS = "../ZXingWidget/Classes/**";
+				HEADER_SEARCH_PATHS = (
+					../../cpp/core/src,
+					"../ZXingWidget/Classes/**",
+				);
+				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
 				OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
 				PREBINDING = NO;
-				SDKROOT = iphoneos3.1;
+				SDKROOT = iphoneos3.1.3;
 			};
 			name = Release;
 		};
diff --git a/iphone/ZXingWidget/Classes/DataMatrixReader.h b/iphone/ZXingWidget/Classes/DataMatrixReader.h
new file mode 100644
index 0000000..8bdfbe8
--- /dev/null
+++ b/iphone/ZXingWidget/Classes/DataMatrixReader.h
@@ -0,0 +1,17 @@
+//
+//  DataMatrixReader.h
+//  ZXingWidget
+//
+//  Created by Romain Pechayre on 6/14/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "FormatReader.h"
+
+
+ at interface DataMatrixReader : FormatReader {
+
+}
+- (id) init;
+ at end
diff --git a/iphone/ZXingWidget/Classes/DataMatrixReader.mm b/iphone/ZXingWidget/Classes/DataMatrixReader.mm
new file mode 100644
index 0000000..f4509c4
--- /dev/null
+++ b/iphone/ZXingWidget/Classes/DataMatrixReader.mm
@@ -0,0 +1,19 @@
+//
+//  DataMatrixReader.mm
+//  ZXingWidget
+//
+//  Created by Romain Pechayre on 6/14/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "DataMatrixReader.h"
+#import <zxing/datamatrix/DataMatrixReader.h>
+
+ at implementation DataMatrixReader
+
+
+- (id) init {
+  zxing::datamatrix::DataMatrixReader *reader = new   zxing::datamatrix::DataMatrixReader();
+  return [super initWithReader:reader];
+}
+ at end
diff --git a/iphone/ZXingWidget/Classes/Decoder.h b/iphone/ZXingWidget/Classes/Decoder.h
index be2bf57..7b0da30 100644
--- a/iphone/ZXingWidget/Classes/Decoder.h
+++ b/iphone/ZXingWidget/Classes/Decoder.h
@@ -24,7 +24,8 @@
 #import "DecoderDelegate.h"
 
 @interface Decoder : NSObject {
-	UIImage *image;
+	NSSet *readers;
+  UIImage *image;
 	CGRect cropRect;
   UIImage *subsetImage;
   unsigned char *subsetData;
@@ -36,6 +37,7 @@
 }
 
 @property(nonatomic, retain) UIImage *image;
+ at property(nonatomic, retain) NSSet *readers;
 @property(nonatomic, assign) CGRect cropRect;
 @property(nonatomic, retain) UIImage *subsetImage;
 @property(nonatomic, assign) unsigned char *subsetData;
diff --git a/iphone/ZXingWidget/Classes/Decoder.mm b/iphone/ZXingWidget/Classes/Decoder.mm
index cc2c7d6..4c11d3c 100644
--- a/iphone/ZXingWidget/Classes/Decoder.mm
+++ b/iphone/ZXingWidget/Classes/Decoder.mm
@@ -43,6 +43,7 @@ using namespace zxing;
 @synthesize subsetBytesPerRow;
 @synthesize delegate;
 @synthesize operationQueue;
+ at synthesize readers;
 
 
 - (id)init {
@@ -157,8 +158,8 @@ using namespace zxing;
 - (void)decode:(id)arg {
   NSAutoreleasePool* mainpool = [[NSAutoreleasePool alloc] init];
   { 
-    NSSet *formatReaders = [FormatReader formatReaders];
-    
+    //NSSet *formatReaders = [FormatReader formatReaders];
+    NSSet *formatReaders = self.readers;
     Ref<LuminanceSource> source (new GrayBytesMonochromeBitmapSource(subsetData, subsetWidth, subsetHeight, subsetBytesPerRow));
     Ref<Binarizer> binarizer (new GlobalHistogramBinarizer(source));
     Ref<BinaryBitmap> grayImage (new BinaryBitmap(binarizer));
@@ -187,7 +188,7 @@ using namespace zxing;
           const char *cString = resultText->getText().c_str();
           const std::vector<Ref<ResultPoint> > &resultPoints = result->getResultPoints();
           NSMutableArray *points = 
-            [NSMutableArray arrayWithCapacity:resultPoints.size()];
+            [[NSMutableArray alloc ] initWithCapacity:resultPoints.size()];
           
           for (size_t i = 0; i < resultPoints.size(); i++) {
             const Ref<ResultPoint> &rp = resultPoints[i];
@@ -200,6 +201,7 @@ using namespace zxing;
           
           decoderResult = [[TwoDDecoderResult resultWithText:resultString
                                                      points:points] retain];
+          [points release];
         } catch (ReaderException &rex) {
           NSLog(@"failed to decode, caught ReaderException '%s'",
               rex.what());
@@ -279,6 +281,7 @@ using namespace zxing;
   [subsetImage release];
   if (subsetData) free(subsetData);
   [operationQueue release];
+  [readers release];
   [super dealloc];
 }
 
diff --git a/iphone/ZXingWidget/Classes/FormatReader.h b/iphone/ZXingWidget/Classes/FormatReader.h
index 350a7a6..58c406d 100644
--- a/iphone/ZXingWidget/Classes/FormatReader.h
+++ b/iphone/ZXingWidget/Classes/FormatReader.h
@@ -29,7 +29,7 @@
 }
 
 + (void)registerFormatReader:(FormatReader *)formatReader;
-+ (NSSet *)formatReaders;
+//+ (NSSet *)formatReaders;
 
 - (id)initWithReader:(zxing::Reader *)reader;
 - (zxing::Ref<zxing::Result>)decode:(zxing::Ref<zxing::BinaryBitmap>)grayImage;
diff --git a/iphone/ZXingWidget/Classes/FormatReader.mm b/iphone/ZXingWidget/Classes/FormatReader.mm
index 74d5e21..474413b 100644
--- a/iphone/ZXingWidget/Classes/FormatReader.mm
+++ b/iphone/ZXingWidget/Classes/FormatReader.mm
@@ -35,6 +35,7 @@ static NSMutableSet *sFormatReaders = nil;
   [pool drain];
 }
 
+/*
 + (NSSet *)formatReaders {
   NSSet *formatReaders = nil;
   @synchronized(self) {
@@ -43,6 +44,7 @@ static NSMutableSet *sFormatReaders = nil;
   }
   return formatReaders;
 }
+*/
 
 - (id)initWithReader:(zxing::Reader *)reader {
   if ((self = [super init])) {
diff --git a/iphone/ZXingWidget/Classes/MultiFormatOneDReader.h b/iphone/ZXingWidget/Classes/MultiFormatOneDReader.h
new file mode 100644
index 0000000..4437c56
--- /dev/null
+++ b/iphone/ZXingWidget/Classes/MultiFormatOneDReader.h
@@ -0,0 +1,17 @@
+//
+//  MultiFormatOneDReader.h
+//  ZXingWidget
+//
+//  Created by Romain Pechayre on 6/14/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "FormatReader.h"
+
+
+ at interface MultiFormatOneDReader : FormatReader {
+
+}
+- (id) init;
+ at end
diff --git a/iphone/ZXingWidget/Classes/MultiFormatOneDReader.mm b/iphone/ZXingWidget/Classes/MultiFormatOneDReader.mm
new file mode 100644
index 0000000..c9e0df5
--- /dev/null
+++ b/iphone/ZXingWidget/Classes/MultiFormatOneDReader.mm
@@ -0,0 +1,19 @@
+//
+//  MultiFormatOneDReader.mm
+//  ZXingWidget
+//
+//  Created by Romain Pechayre on 6/14/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "MultiFormatOneDReader.h"
+#import <zxing/oned/MultiFormatOneDReader.h>
+
+ at implementation MultiFormatOneDReader
+
+
+- (id) init {
+  zxing::oned::MultiFormatOneDReader *reader = new   zxing::oned::MultiFormatOneDReader();
+  return [super initWithReader:reader];
+}
+ at end
diff --git a/iphone/ZXingWidget/Classes/MultiFormatUPCEANReader.h b/iphone/ZXingWidget/Classes/MultiFormatUPCEANReader.h
new file mode 100644
index 0000000..3777dc9
--- /dev/null
+++ b/iphone/ZXingWidget/Classes/MultiFormatUPCEANReader.h
@@ -0,0 +1,17 @@
+//
+//  MultiFormatUPCEANReader.h
+//  ZXingWidget
+//
+//  Created by Romain Pechayre on 6/14/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "FormatReader.h"
+
+
+ at interface MultiFormatUPCEANReader : FormatReader {
+
+}
+- (id) init;
+ at end
diff --git a/iphone/ZXingWidget/Classes/MultiFormatUPCEANReader.mm b/iphone/ZXingWidget/Classes/MultiFormatUPCEANReader.mm
new file mode 100644
index 0000000..33f723c
--- /dev/null
+++ b/iphone/ZXingWidget/Classes/MultiFormatUPCEANReader.mm
@@ -0,0 +1,18 @@
+//
+//  MultiFormatUPCEANReader.mm
+//  ZXingWidget
+//
+//  Created by Romain Pechayre on 6/14/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "MultiFormatUPCEANReader.h"
+#import <zxing/oned/MultiFormatUPCEANReader.h>
+
+ at implementation MultiFormatUPCEANReader
+
+- (id) init {
+  zxing::oned::MultiFormatUPCEANReader *reader = new zxing::oned::MultiFormatUPCEANReader();
+  return [super initWithReader:reader];
+}
+ at end
diff --git a/iphone/ZXingWidget/Classes/OverlayView.h b/iphone/ZXingWidget/Classes/OverlayView.h
index d9f6d35..ad1ee63 100755
--- a/iphone/ZXingWidget/Classes/OverlayView.h
+++ b/iphone/ZXingWidget/Classes/OverlayView.h
@@ -30,6 +30,7 @@
 @property (nonatomic, assign) id<CancelDelegate> delegate;
 @property (nonatomic, assign) BOOL oneDMode;
 
+
 - (id)initWithFrame:(CGRect)theFrame cancelEnabled:(BOOL)isCancelEnabled oneDMode:(BOOL)isOneDModeEnabled;
 
 - (CGRect)cropRect;
diff --git a/iphone/ZXingWidget/Classes/OverlayView.m b/iphone/ZXingWidget/Classes/OverlayView.m
index b8e2355..7c55d49 100755
--- a/iphone/ZXingWidget/Classes/OverlayView.m
+++ b/iphone/ZXingWidget/Classes/OverlayView.m
@@ -18,11 +18,16 @@
 
 static const CGFloat kPadding = 10;
 
+ at interface OverlayView()
+ at property (nonatomic,assign) UIButton *cancelButton;
+ at end
+
+
 @implementation OverlayView
 
 @synthesize delegate, oneDMode;
 @synthesize points = _points;
-
+ at synthesize cancelButton;
 
 ////////////////////////////////////////////////////////////////////////////////////////////////////
 - (id) initWithFrame:(CGRect)theFrame cancelEnabled:(BOOL)isCancelEnabled oneDMode:(BOOL)isOneDModeEnabled {
@@ -30,7 +35,8 @@ static const CGFloat kPadding = 10;
 		self.backgroundColor = [UIColor clearColor];
     self.oneDMode = isOneDModeEnabled;
     if (isCancelEnabled) {
-      cancelButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
+      UIButton *butt = [UIButton buttonWithType:UIButtonTypeRoundedRect]; 
+      self.cancelButton = butt;
       [cancelButton setTitle:@"Cancel" forState:UIControlStateNormal];
       if (oneDMode) {
         [cancelButton setTransform:CGAffineTransformMakeRotation(M_PI/2)];
@@ -60,7 +66,6 @@ static const CGFloat kPadding = 10;
 	imageView = nil;
 	[_points release];
 	_points = nil;
-	[cancelButton release];
 	[super dealloc];
 }
 
diff --git a/iphone/ZXingWidget/Classes/QRCodeReader.h b/iphone/ZXingWidget/Classes/QRCodeReader.h
new file mode 100644
index 0000000..54fabc8
--- /dev/null
+++ b/iphone/ZXingWidget/Classes/QRCodeReader.h
@@ -0,0 +1,16 @@
+//
+//  QRCodeReader.h
+//  ZXingWidget
+//
+//  Created by Romain Pechayre on 6/14/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import <Foundation/Foundation.h>
+#import "FormatReader.h"
+
+ at interface QRCodeReader : FormatReader {
+
+}
+- (id) init;
+ at end
diff --git a/iphone/ZXingWidget/Classes/QRCodeReader.mm b/iphone/ZXingWidget/Classes/QRCodeReader.mm
new file mode 100644
index 0000000..bc496da
--- /dev/null
+++ b/iphone/ZXingWidget/Classes/QRCodeReader.mm
@@ -0,0 +1,20 @@
+//
+//  QRCodeReader.mm
+//  ZXingWidget
+//
+//  Created by Romain Pechayre on 6/14/10.
+//  Copyright 2010 __MyCompanyName__. All rights reserved.
+//
+
+#import "QRCodeReader.h"
+#import <zxing/qrcode/QRCodeReader.h>
+#import "FormatReader.h"
+
+ at implementation QRCodeReader
+
+
+- (id) init {
+  zxing::qrcode::QRCodeReader *reader = new zxing::qrcode::QRCodeReader();
+  return [super initWithReader:reader];
+}
+ at end
diff --git a/iphone/ZXingWidget/Classes/ZXingWidgetController.h b/iphone/ZXingWidget/Classes/ZXingWidgetController.h
index 522cfb6..f58c3a5 100755
--- a/iphone/ZXingWidget/Classes/ZXingWidgetController.h
+++ b/iphone/ZXingWidget/Classes/ZXingWidgetController.h
@@ -24,6 +24,7 @@
 
 //@interface ZXingWidgetController : UIImagePickerController <DecoderDelegate, CancelDelegate> {
 @interface ZXingWidgetController : UIViewController<DecoderDelegate, CancelDelegate, UIImagePickerControllerDelegate,UINavigationControllerDelegate> {
+  NSSet *readers;
   ParsedResult *result;
   UIImagePickerController *imagePicker;
   NSArray *actions;       
@@ -36,6 +37,7 @@
   BOOL oneDMode;
 }
 
+ at property (nonatomic, retain ) NSSet *readers;
 @property (nonatomic, assign) id<ZXingDelegate> delegate;
 @property (nonatomic, assign) NSURL *soundToPlay;
 @property (nonatomic, retain) ParsedResult *result;
diff --git a/iphone/ZXingWidget/Classes/ZXingWidgetController.m b/iphone/ZXingWidget/Classes/ZXingWidgetController.m
index 49ac8ca..84be34d 100755
--- a/iphone/ZXingWidget/Classes/ZXingWidgetController.m
+++ b/iphone/ZXingWidget/Classes/ZXingWidgetController.m
@@ -47,6 +47,7 @@ CGImageRef UIGetScreenImage(void);
 @synthesize overlayView;
 @synthesize oneDMode, showCancel;
 @synthesize imagePicker;
+ at synthesize readers;
 
 
 -(void)loadImagePicker {
@@ -102,6 +103,7 @@ CGImageRef UIGetScreenImage(void);
   imagePicker.cameraOverlayView = nil;
   [imagePicker release];
   [overlayView release];
+  [readers release];
   [super dealloc];
 }
 
@@ -269,6 +271,7 @@ CGImageRef UIGetScreenImage(void);
   UIImage *scrn = [[UIImage alloc] initWithCGImage:newImage];
   CGImageRelease(newImage);
   Decoder *d = [[Decoder alloc] init];
+  d.readers = readers;
   d.delegate = self;
   cropRect.origin.x = 0.0;
   cropRect.origin.y = 0.0;
diff --git a/iphone/ZXingWidget/ZXingWidget.xcodeproj/project.pbxproj b/iphone/ZXingWidget/ZXingWidget.xcodeproj/project.pbxproj
index c0e0620..b66b48f 100644
--- a/iphone/ZXingWidget/ZXingWidget.xcodeproj/project.pbxproj
+++ b/iphone/ZXingWidget/ZXingWidget.xcodeproj/project.pbxproj
@@ -79,6 +79,14 @@
 		1F02802C11A7BF06006B06DE /* URLResultParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F02801211A7BF06006B06DE /* URLResultParser.m */; };
 		1F02802D11A7BF06006B06DE /* URLTOResultParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F02801311A7BF06006B06DE /* URLTOResultParser.h */; };
 		1F02802E11A7BF06006B06DE /* URLTOResultParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F02801411A7BF06006B06DE /* URLTOResultParser.m */; };
+		1F3DB0C211C60DB4009C581B /* QRCodeReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F3DB0C011C60DB4009C581B /* QRCodeReader.h */; };
+		1F3DB0C311C60DB4009C581B /* QRCodeReader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F3DB0C111C60DB4009C581B /* QRCodeReader.mm */; };
+		1F3DB0FB11C61080009C581B /* DataMatrixReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F3DB0F511C61080009C581B /* DataMatrixReader.h */; };
+		1F3DB0FC11C61080009C581B /* DataMatrixReader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F3DB0F611C61080009C581B /* DataMatrixReader.mm */; };
+		1F3DB0FD11C61080009C581B /* MultiFormatOneDReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F3DB0F711C61080009C581B /* MultiFormatOneDReader.h */; };
+		1F3DB0FE11C61080009C581B /* MultiFormatOneDReader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F3DB0F811C61080009C581B /* MultiFormatOneDReader.mm */; };
+		1F3DB0FF11C61080009C581B /* MultiFormatUPCEANReader.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F3DB0F911C61080009C581B /* MultiFormatUPCEANReader.h */; };
+		1F3DB10011C61080009C581B /* MultiFormatUPCEANReader.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1F3DB0FA11C61080009C581B /* MultiFormatUPCEANReader.mm */; };
 		AA747D9F0F9514B9006C5449 /* ZXingWidget_Prefix.pch in Headers */ = {isa = PBXBuildFile; fileRef = AA747D9E0F9514B9006C5449 /* ZXingWidget_Prefix.pch */; };
 		AACBBE4A0F95108600F1A2B1 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AACBBE490F95108600F1A2B1 /* Foundation.framework */; };
 		E534594311987396000CB77F /* BarcodeFormat.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E53458B511987396000CB77F /* BarcodeFormat.cpp */; };
@@ -292,6 +300,14 @@
 		1F02801211A7BF06006B06DE /* URLResultParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = URLResultParser.m; path = Classes/resultParsers/URLResultParser.m; sourceTree = "<group>"; };
 		1F02801311A7BF06006B06DE /* URLTOResultParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = URLTOResultParser.h; path = Classes/resultParsers/URLTOResultParser.h; sourceTree = "<group>"; };
 		1F02801411A7BF06006B06DE /* URLTOResultParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = URLTOResultParser.m; path = Classes/resultParsers/URLTOResultParser.m; sourceTree = "<group>"; };
+		1F3DB0C011C60DB4009C581B /* QRCodeReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QRCodeReader.h; path = Classes/QRCodeReader.h; sourceTree = "<group>"; };
+		1F3DB0C111C60DB4009C581B /* QRCodeReader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = QRCodeReader.mm; path = Classes/QRCodeReader.mm; sourceTree = "<group>"; };
+		1F3DB0F511C61080009C581B /* DataMatrixReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DataMatrixReader.h; path = Classes/DataMatrixReader.h; sourceTree = "<group>"; };
+		1F3DB0F611C61080009C581B /* DataMatrixReader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = DataMatrixReader.mm; path = Classes/DataMatrixReader.mm; sourceTree = "<group>"; };
+		1F3DB0F711C61080009C581B /* MultiFormatOneDReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiFormatOneDReader.h; path = Classes/MultiFormatOneDReader.h; sourceTree = "<group>"; };
+		1F3DB0F811C61080009C581B /* MultiFormatOneDReader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MultiFormatOneDReader.mm; path = Classes/MultiFormatOneDReader.mm; sourceTree = "<group>"; };
+		1F3DB0F911C61080009C581B /* MultiFormatUPCEANReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MultiFormatUPCEANReader.h; path = Classes/MultiFormatUPCEANReader.h; sourceTree = "<group>"; };
+		1F3DB0FA11C61080009C581B /* MultiFormatUPCEANReader.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = MultiFormatUPCEANReader.mm; path = Classes/MultiFormatUPCEANReader.mm; sourceTree = "<group>"; };
 		AA747D9E0F9514B9006C5449 /* ZXingWidget_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXingWidget_Prefix.pch; sourceTree = SOURCE_ROOT; };
 		AACBBE490F95108600F1A2B1 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
 		D2AAC07E0554694100DB518D /* libZXingWidget.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libZXingWidget.a; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -483,6 +499,14 @@
 		08FB77AEFE84172EC02AAC07 /* Classes */ = {
 			isa = PBXGroup;
 			children = (
+				1F3DB0F511C61080009C581B /* DataMatrixReader.h */,
+				1F3DB0F611C61080009C581B /* DataMatrixReader.mm */,
+				1F3DB0F711C61080009C581B /* MultiFormatOneDReader.h */,
+				1F3DB0F811C61080009C581B /* MultiFormatOneDReader.mm */,
+				1F3DB0F911C61080009C581B /* MultiFormatUPCEANReader.h */,
+				1F3DB0FA11C61080009C581B /* MultiFormatUPCEANReader.mm */,
+				1F3DB0C011C60DB4009C581B /* QRCodeReader.h */,
+				1F3DB0C111C60DB4009C581B /* QRCodeReader.mm */,
 				1F027FB711A7BEBF006B06DE /* TwoDDecoderResult.h */,
 				1F027FB811A7BEBF006B06DE /* TwoDDecoderResult.m */,
 				1F027FB911A7BEBF006B06DE /* ZXingWidgetController.h */,
@@ -930,6 +954,10 @@
 				1F02802911A7BF06006B06DE /* TextResultParser.h in Headers */,
 				1F02802B11A7BF06006B06DE /* URLResultParser.h in Headers */,
 				1F02802D11A7BF06006B06DE /* URLTOResultParser.h in Headers */,
+				1F3DB0C211C60DB4009C581B /* QRCodeReader.h in Headers */,
+				1F3DB0FB11C61080009C581B /* DataMatrixReader.h in Headers */,
+				1F3DB0FD11C61080009C581B /* MultiFormatOneDReader.h in Headers */,
+				1F3DB0FF11C61080009C581B /* MultiFormatUPCEANReader.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1078,6 +1106,10 @@
 				1F02802A11A7BF06006B06DE /* TextResultParser.m in Sources */,
 				1F02802C11A7BF06006B06DE /* URLResultParser.m in Sources */,
 				1F02802E11A7BF06006B06DE /* URLTOResultParser.m in Sources */,
+				1F3DB0C311C60DB4009C581B /* QRCodeReader.mm in Sources */,
+				1F3DB0FC11C61080009C581B /* DataMatrixReader.mm in Sources */,
+				1F3DB0FE11C61080009C581B /* MultiFormatOneDReader.mm in Sources */,
+				1F3DB10011C61080009C581B /* MultiFormatUPCEANReader.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1088,7 +1120,7 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = YES;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
 				COPY_PHASE_STRIP = NO;
 				DEAD_CODE_STRIPPING = YES;
 				DSTROOT = /tmp/ZXingWidget.dst;
@@ -1099,9 +1131,10 @@
 				GCC_OPTIMIZATION_LEVEL = 0;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = ZXingWidget_Prefix.pch;
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
 				HEADER_SEARCH_PATHS = ../../cpp/core/src;
 				INSTALL_PATH = /usr/local/lib;
-				IPHONEOS_DEPLOYMENT_TARGET = 3.1.2;
+				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
 				LD_GENERATE_MAP_FILE = YES;
 				LD_OPENMP_FLAGS = "-fopenmp";
 				MACH_O_TYPE = staticlib;
@@ -1111,7 +1144,7 @@
 				);
 				PRESERVE_DEAD_CODE_INITS_AND_TERMS = NO;
 				PRODUCT_NAME = ZXingWidget;
-				SDKROOT = iphonesimulator3.1;
+				SDKROOT = iphoneos3.1.3;
 				SEPARATE_STRIP = NO;
 				SKIP_INSTALL = YES;
 				STANDARD_C_PLUS_PLUS_LIBRARY_TYPE = dynamic;
@@ -1122,15 +1155,17 @@
 			isa = XCBuildConfiguration;
 			buildSettings = {
 				ALWAYS_SEARCH_USER_PATHS = NO;
-				ARCHS = "$(ARCHS_STANDARD_32_BIT)";
+				ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
 				DSTROOT = /tmp/ZXingWidget.dst;
 				GCC_MODEL_TUNING = G5;
 				GCC_PRECOMPILE_PREFIX_HEADER = YES;
 				GCC_PREFIX_HEADER = ZXingWidget_Prefix.pch;
+				GCC_SYMBOLS_PRIVATE_EXTERN = NO;
 				HEADER_SEARCH_PATHS = ../../cpp/core/src;
 				INSTALL_PATH = /usr/local/lib;
+				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
 				PRODUCT_NAME = ZXingWidget;
-				SDKROOT = iphonesimulator3.1;
+				SDKROOT = iphoneos3.1.3;
 			};
 			name = Release;
 		};
@@ -1146,7 +1181,7 @@
 				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
 				OTHER_LDFLAGS = "-ObjC";
 				PREBINDING = NO;
-				SDKROOT = iphonesimulator3.1;
+				SDKROOT = iphoneos3.1.3;
 			};
 			name = Debug;
 		};
@@ -1155,13 +1190,13 @@
 			buildSettings = {
 				ARCHS = "$(ARCHS_UNIVERSAL_IPHONE_OS)";
 				GCC_C_LANGUAGE_STANDARD = c99;
-				GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
+				GCC_VERSION = "";
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				IPHONEOS_DEPLOYMENT_TARGET = 3.1.3;
 				OTHER_LDFLAGS = "-ObjC";
 				PREBINDING = NO;
-				SDKROOT = iphonesimulator3.1;
+				SDKROOT = iphoneos3.1.3;
 			};
 			name = Release;
 		};

-- 
Multi-format 1D/2D barcode image processing library



More information about the Pkg-google-commits mailing list