diff --git a/iphone/ZXing/Classes/Decoder.h b/iphone/ZXing/Classes/Decoder.h new file mode 100644 index 000000000..95a237334 --- /dev/null +++ b/iphone/ZXing/Classes/Decoder.h @@ -0,0 +1,39 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed 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. + */ + +// +// Decoder.h +// ZXing +// +// Created by Christian Brunschen on 31/03/2008. +// + +#import +#import "DecoderDelegate.h" + +@interface Decoder : NSObject { + UIImage *image; + NSString *result; + id delegate; +} + +@property(nonatomic, retain) UIImage *image; +@property(nonatomic, retain) NSString *result; +@property(nonatomic, assign) id delegate; + +- (void) decodeImage:(UIImage *)image; + +@end diff --git a/iphone/ZXing/Classes/Decoder.m b/iphone/ZXing/Classes/Decoder.m new file mode 100644 index 000000000..d50cf107e --- /dev/null +++ b/iphone/ZXing/Classes/Decoder.m @@ -0,0 +1,50 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed 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. + */ + +// +// Decoder.m +// ZXing +// +// Created by Christian Brunschen on 31/03/2008. +// + +#import "Decoder.h" + +@implementation Decoder + +@synthesize image; +@synthesize result; +@synthesize delegate; + +- (void)decode:(id)arg { + [NSThread sleepForTimeInterval:2.0]; + self.result = @"This is some sample (fake) decoded text."; + [self.delegate decoder:self didDecodeImage:self.image withResult:self.result]; +} + +- (void) decodeImage:(UIImage *)i { + self.image = i; + [self.delegate decoder:self willDecodeImage:i]; + [NSThread detachNewThreadSelector:@selector(decode:) toTarget:self withObject:nil]; +} + +- (void) dealloc { + [image release]; + [result release]; + [super dealloc]; +} + +@end diff --git a/iphone/ZXing/Classes/DecoderDelegate.h b/iphone/ZXing/Classes/DecoderDelegate.h new file mode 100644 index 000000000..6499b9f75 --- /dev/null +++ b/iphone/ZXing/Classes/DecoderDelegate.h @@ -0,0 +1,32 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed 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. + */ + +// +// DecoderDelegate.h +// ZXing +// +// Created by Christian Brunschen on 01/04/2008. + +#import + +@class Decoder; + +@protocol DecoderDelegate + +- (void)decoder:(Decoder *)decoder willDecodeImage:(UIImage *)image; +- (void)decoder:(Decoder *)decoder didDecodeImage:(UIImage *)image withResult:(NSString *)result; + +@end diff --git a/iphone/ZXing/Classes/DecoderViewController.h b/iphone/ZXing/Classes/DecoderViewController.h new file mode 100644 index 000000000..1725925c8 --- /dev/null +++ b/iphone/ZXing/Classes/DecoderViewController.h @@ -0,0 +1,53 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed 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. + */ + +// +// DecoderViewController.h +// ZXing +// +// Created by Christian Brunschen on 31/03/2008. +// + +#import +#import "Decoder.h" +#import "DecoderDelegate.h" + +@interface DecoderViewController : UIViewController { + IBOutlet UIImageView *imageView; + IBOutlet UITextView *messageView; + Decoder *decoder; +} + +@property (nonatomic, retain) UIImageView *imageView; +@property (nonatomic, retain) UITextView *messageView; +@property (nonatomic, retain) Decoder *decoder; + +- (void)pickAndDecode; + +/* DecoderDelegate methods */ + +- (void)decoder:(Decoder *)decoder willDecodeImage:(UIImage *)image; +- (void)decoder:(Decoder *)decoder didDecodeImage:(UIImage *)image withResult:(NSString *)result; + +/* UIImagePickerControllerDelegate methods */ + +- (void)imagePickerController:(UIImagePickerController *)picker + didFinishPickingImage:(UIImage *)image + editingInfo:(NSDictionary *)editingInfo; +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker; + + +@end diff --git a/iphone/ZXing/Classes/DecoderViewController.m b/iphone/ZXing/Classes/DecoderViewController.m new file mode 100644 index 000000000..57f256763 --- /dev/null +++ b/iphone/ZXing/Classes/DecoderViewController.m @@ -0,0 +1,140 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed 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. + */ + +// +// DecoderViewController.m +// ZXing +// +// Created by Christian Brunschen on 31/03/2008. +// + +#import "DecoderViewController.h" +#import "Decoder.h" + +@implementation DecoderViewController + +@synthesize imageView; +@synthesize messageView; +@synthesize decoder; + +- (id)init +{ + if (self = [super init]) { + // Initialize your view controller. + self.title = @"DecoderViewController"; + + Decoder *d = [[Decoder alloc] init]; + self.decoder = d; + d.delegate = self; + [d release]; + } + return self; +} + + +- (void)loadView +{ + [[NSBundle mainBundle] loadNibNamed:@"DecoderView" owner:self options:nil]; + + /* programmatically create the message view for now */ + // TODO(christian.brunschen): find a suitable & working IB configuration + CGRect rect = [UIScreen mainScreen].applicationFrame; + rect = CGRectInset(rect, CGRectGetWidth(rect)/4, CGRectGetHeight(rect)/3); + rect.origin.y -= 50; + UITextView *mView = [[UITextView alloc] initWithFrame:rect]; + mView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth; + mView.text = @"Please take or select a picture containing a barcode"; + mView.backgroundColor = [UIColor yellowColor]; + mView.alpha = 0.7; + [self.view addSubview:mView]; + self.messageView = mView; + [mView release]; +} + +- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation +{ + // Return YES for supported orientations. + return YES; +} + +- (void)didReceiveMemoryWarning +{ + [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview. + // Release anything that's not essential, such as cached data. +} + +- (void)dealloc +{ + [decoder release]; + [imageView release]; + [messageView release]; + [super dealloc]; +} + + +// own methods + +- (void)pickAndDecode { + // Create the Image Picker + UIImagePickerControllerSourceType sourceType = + [UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] + ? UIImagePickerControllerSourceTypeCamera + : UIImagePickerControllerSourceTypePhotoLibrary; + + UIImagePickerController* picker = [[UIImagePickerController alloc] init]; + picker.sourceType = sourceType; + picker.delegate = self; + picker.allowsImageEditing = YES; + + // Picker is displayed asynchronously. + [self presentModalViewController:picker animated:YES]; +} + + +// DecoderDelegate methods + +- (void)decoder:(Decoder *)decoder willDecodeImage:(UIImage *)image { + [self.imageView setImage:image]; + self.messageView.text = [NSString stringWithFormat:@"Decoding image (%.0fx%.0f) ...", image.size.width, image.size.height]; +} + +- (void)decoder:(Decoder *)decoder didDecodeImage:(UIImage *)image withResult:(NSString *)result { + self.messageView.text = result; +} + + +// UIImagePickerControllerDelegate methods + +- (void)imagePickerController:(UIImagePickerController *)picker + didFinishPickingImage:(UIImage *)image + editingInfo:(NSDictionary *)editingInfo +{ + [[picker parentViewController] dismissModalViewControllerAnimated:YES]; + [image retain]; + [picker release]; + [self.decoder decodeImage:image]; + [image release]; +} + +- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker +{ + [picker dismissModalViewControllerAnimated:YES]; + [picker release]; +} + + + +@end diff --git a/iphone/ZXing/Classes/ZXingAppDelegate.h b/iphone/ZXing/Classes/ZXingAppDelegate.h new file mode 100644 index 000000000..8cd838200 --- /dev/null +++ b/iphone/ZXing/Classes/ZXingAppDelegate.h @@ -0,0 +1,37 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed 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. + */ + +// +// ZXingAppDelegate.h +// ZXing +// +// Created by Christian Brunschen on 23/04/2008. +// + +#import + +@class DecoderViewController; + +@interface ZXingAppDelegate : NSObject { + IBOutlet UIWindow *window; + DecoderViewController *viewController; +} + +@property (nonatomic, retain) UIWindow *window; +@property (nonatomic, retain) DecoderViewController *viewController; + +@end + diff --git a/iphone/ZXing/Classes/ZXingAppDelegate.m b/iphone/ZXing/Classes/ZXingAppDelegate.m new file mode 100644 index 000000000..7fd64f898 --- /dev/null +++ b/iphone/ZXing/Classes/ZXingAppDelegate.m @@ -0,0 +1,53 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed 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. + */ + +// +// ZXingAppDelegate.m +// ZXing +// +// Created by Christian Brunschen on 23/04/2008. +// + +#import "ZXingAppDelegate.h" +#import "DecoderViewController.h" + +@implementation ZXingAppDelegate + +@synthesize window; +@synthesize viewController; + +- (void)applicationDidFinishLaunching:(UIApplication *)application { + /* create the view controller */ + DecoderViewController *vc = [[DecoderViewController alloc] init]; + self.viewController = vc; + [vc release]; + + // hook up the view controller's view to be in the window + [window addSubview:viewController.view]; + + // show the window + [window makeKeyAndVisible]; + + // pick and decode + [viewController pickAndDecode]; +} + +- (void)dealloc { + [window release]; + [super dealloc]; +} + +@end diff --git a/iphone/ZXing/DecoderView.xib b/iphone/ZXing/DecoderView.xib new file mode 100644 index 000000000..d8cf672cc --- /dev/null +++ b/iphone/ZXing/DecoderView.xib @@ -0,0 +1,173 @@ + + + + 1050 + 9C7010 + 649 + 949.26 + 352.00 + + YES + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + IBFilesOwner + + + + 268 + + YES + + + 274 + {{20, 20}, {280, 440}} + + + 3 + MAA + + NO + 1 + NO + + + {320, 480} + + 3 + MAA + + 2 + + + NO + + + + + YES + + + view + + + + 4 + + + + imageView + + + + 10 + + + + + YES + + 0 + + YES + + + + + + 1 + + + YES + + + + + + -1 + + + RmlsZSdzIE93bmVyA + + + 8 + + + + + + + YES + + YES + -1.CustomClassName + 1.IBEditorWindowLastContentRect + 1.IBPluginDependency + 8.IBPluginDependency + + + YES + DecoderViewController + {{354, 376}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 14 + + + + YES + + DecoderViewController + UIViewController + + YES + + YES + imageView + messageView + + + YES + UIImageView + UITextView + + + + IBProjectSource + Classes/DecoderViewController.h + + + + + 0 + ZXing.xcodeproj + 3 + + diff --git a/iphone/ZXing/Info.plist b/iphone/ZXing/Info.plist new file mode 100644 index 000000000..18838ca3d --- /dev/null +++ b/iphone/ZXing/Info.plist @@ -0,0 +1,28 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDisplayName + ${PRODUCT_NAME} + CFBundleExecutable + ${EXECUTABLE_NAME} + CFBundleIconFile + + CFBundleIdentifier + com.yourcompany.${PRODUCT_NAME:identifier} + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + ${PRODUCT_NAME} + CFBundlePackageType + APPL + CFBundleSignature + ???? + CFBundleVersion + 1.0 + NSMainNibFile + MainWindow + + \ No newline at end of file diff --git a/iphone/ZXing/MainWindow.xib b/iphone/ZXing/MainWindow.xib new file mode 100644 index 000000000..f6d7675a5 --- /dev/null +++ b/iphone/ZXing/MainWindow.xib @@ -0,0 +1,191 @@ + + + + 1050 + 9C7010 + 649 + 949.26 + 352.00 + + YES + + + + YES + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + YES + + IBFilesOwner + + + + + 1292 + + {320, 480} + + + 1 + MSAxIDEAA + + NO + NO + + + + + YES + + + window + + + + 5 + + + + delegate + + + + 9 + + + + + YES + + 0 + + YES + + + + + + 2 + + + YES + + + + + -1 + + + RmlsZSdzIE93bmVyA + + + 3 + + + + + + + YES + + YES + -1.CustomClassName + 2.IBAttributePlaceholdersKey + 2.IBEditorWindowLastContentRect + 2.IBPluginDependency + 3.CustomClassName + 3.IBPluginDependency + + + YES + UIApplication + + YES + + YES + + + YES + + + {{238, 376}, {320, 480}} + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + ZXingAppDelegate + com.apple.InterfaceBuilder.IBCocoaTouchPlugin + + + + YES + + YES + + + YES + + + + + YES + + YES + + + YES + + + + 11 + + + + YES + + DecoderViewController + UIViewController + + YES + + YES + imageView + messageView + + + YES + UIImageView + UITextView + + + + IBProjectSource + Classes/DecoderViewController.h + + + + ZXingAppDelegate + NSObject + + YES + + YES + viewController + window + + + YES + DecoderViewController + UIWindow + + + + IBProjectSource + Classes/ZXingAppDelegate.h + + + + + 0 + ZXing.xcodeproj + 3 + + diff --git a/iphone/ZXing/ZXing.xcodeproj/project.pbxproj b/iphone/ZXing/ZXing.xcodeproj/project.pbxproj new file mode 100755 index 000000000..ead722bcc --- /dev/null +++ b/iphone/ZXing/ZXing.xcodeproj/project.pbxproj @@ -0,0 +1,258 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 45; + objects = { + +/* Begin PBXBuildFile section */ + 1D3623260D0F684500981E51 /* ZXingAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 1D3623250D0F684500981E51 /* ZXingAppDelegate.m */; }; + 1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */; }; + 1D60589B0D05DD56006BFB54 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 29B97316FDCFA39411CA2CEA /* main.m */; }; + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; + 8556C2560DBF492600C69E3B /* DecoderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8556C2510DBF492600C69E3B /* DecoderViewController.m */; }; + 8556C2580DBF492600C69E3B /* Decoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 8556C2550DBF492600C69E3B /* Decoder.m */; }; + 8556C3150DBF4FDD00C69E3B /* DecoderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 8556C3140DBF4FDD00C69E3B /* DecoderView.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + 1D30AB110D05D00D00671497 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; + 1D3623240D0F684500981E51 /* ZXingAppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXingAppDelegate.h; sourceTree = ""; }; + 1D3623250D0F684500981E51 /* ZXingAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ZXingAppDelegate.m; sourceTree = ""; }; + 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; + 1D6058910D05DD3D006BFB54 /* ZXing.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = ZXing.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; + 28AD733E0D9D9553002E5188 /* MainWindow.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainWindow.xib; sourceTree = ""; }; + 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; + 32CA4F630368D1EE00C91783 /* ZXing_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ZXing_Prefix.pch; sourceTree = ""; }; + 8556C24F0DBF492600C69E3B /* DecoderDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DecoderDelegate.h; sourceTree = ""; }; + 8556C2500DBF492600C69E3B /* DecoderViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DecoderViewController.h; sourceTree = ""; }; + 8556C2510DBF492600C69E3B /* DecoderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DecoderViewController.m; sourceTree = ""; }; + 8556C2540DBF492600C69E3B /* Decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Decoder.h; sourceTree = ""; }; + 8556C2550DBF492600C69E3B /* Decoder.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Decoder.m; sourceTree = ""; }; + 8556C3140DBF4FDD00C69E3B /* DecoderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DecoderView.xib; sourceTree = ""; }; + 8D1107310486CEB800E47090 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 1D60588F0D05DD3D006BFB54 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */, + 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */, + 1D3623EC0D0F72F000981E51 /* CoreGraphics.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 080E96DDFE201D6D7F000001 /* Classes */ = { + isa = PBXGroup; + children = ( + 8556C24F0DBF492600C69E3B /* DecoderDelegate.h */, + 8556C2500DBF492600C69E3B /* DecoderViewController.h */, + 8556C2510DBF492600C69E3B /* DecoderViewController.m */, + 8556C2540DBF492600C69E3B /* Decoder.h */, + 8556C2550DBF492600C69E3B /* Decoder.m */, + 1D3623240D0F684500981E51 /* ZXingAppDelegate.h */, + 1D3623250D0F684500981E51 /* ZXingAppDelegate.m */, + ); + path = Classes; + sourceTree = ""; + }; + 19C28FACFE9D520D11CA2CBB /* Products */ = { + isa = PBXGroup; + children = ( + 1D6058910D05DD3D006BFB54 /* ZXing.app */, + ); + name = Products; + sourceTree = ""; + }; + 29B97314FDCFA39411CA2CEA /* CustomTemplate */ = { + isa = PBXGroup; + children = ( + 080E96DDFE201D6D7F000001 /* Classes */, + 29B97315FDCFA39411CA2CEA /* Other Sources */, + 29B97317FDCFA39411CA2CEA /* Resources */, + 29B97323FDCFA39411CA2CEA /* Frameworks */, + 19C28FACFE9D520D11CA2CBB /* Products */, + 8556C3140DBF4FDD00C69E3B /* DecoderView.xib */, + ); + name = CustomTemplate; + sourceTree = ""; + }; + 29B97315FDCFA39411CA2CEA /* Other Sources */ = { + isa = PBXGroup; + children = ( + 32CA4F630368D1EE00C91783 /* ZXing_Prefix.pch */, + 29B97316FDCFA39411CA2CEA /* main.m */, + ); + name = "Other Sources"; + sourceTree = ""; + }; + 29B97317FDCFA39411CA2CEA /* Resources */ = { + isa = PBXGroup; + children = ( + 28AD733E0D9D9553002E5188 /* MainWindow.xib */, + 8D1107310486CEB800E47090 /* Info.plist */, + ); + name = Resources; + sourceTree = ""; + }; + 29B97323FDCFA39411CA2CEA /* Frameworks */ = { + isa = PBXGroup; + children = ( + 1D3623EB0D0F72F000981E51 /* CoreGraphics.framework */, + 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */, + 1D30AB110D05D00D00671497 /* Foundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 1D6058900D05DD3D006BFB54 /* ZXing */ = { + isa = PBXNativeTarget; + buildConfigurationList = 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ZXing" */; + buildPhases = ( + 1D60588D0D05DD3D006BFB54 /* Resources */, + 1D60588E0D05DD3D006BFB54 /* Sources */, + 1D60588F0D05DD3D006BFB54 /* Frameworks */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = ZXing; + productName = ZXing; + productReference = 1D6058910D05DD3D006BFB54 /* ZXing.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 29B97313FDCFA39411CA2CEA /* Project object */ = { + isa = PBXProject; + buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ZXing" */; + compatibilityVersion = "Xcode 3.1"; + hasScannedForEncodings = 1; + mainGroup = 29B97314FDCFA39411CA2CEA /* CustomTemplate */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 1D6058900D05DD3D006BFB54 /* ZXing */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 1D60588D0D05DD3D006BFB54 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */, + 8556C3150DBF4FDD00C69E3B /* DecoderView.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 1D60588E0D05DD3D006BFB54 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 1D60589B0D05DD56006BFB54 /* main.m in Sources */, + 1D3623260D0F684500981E51 /* ZXingAppDelegate.m in Sources */, + 8556C2560DBF492600C69E3B /* DecoderViewController.m in Sources */, + 8556C2580DBF492600C69E3B /* Decoder.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + 1D6058940D05DD3E006BFB54 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = NO; + GCC_DYNAMIC_NO_PIC = NO; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ZXing_Prefix.pch; + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = ZXing; + }; + name = Debug; + }; + 1D6058950D05DD3E006BFB54 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + COPY_PHASE_STRIP = YES; + GCC_PRECOMPILE_PREFIX_HEADER = YES; + GCC_PREFIX_HEADER = ZXing_Prefix.pch; + INFOPLIST_FILE = Info.plist; + PRODUCT_NAME = ZXing; + }; + name = Release; + }; + C01FCF4F08A954540054247B /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + ONLY_ACTIVE_ARCH = YES; + PREBINDING = NO; + SDKROOT = iphoneos2.0; + }; + name = Debug; + }; + C01FCF5008A954540054247B /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + GCC_C_LANGUAGE_STANDARD = c99; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + PREBINDING = NO; + SDKROOT = iphoneos2.0; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 1D6058960D05DD3E006BFB54 /* Build configuration list for PBXNativeTarget "ZXing" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 1D6058940D05DD3E006BFB54 /* Debug */, + 1D6058950D05DD3E006BFB54 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + C01FCF4E08A954540054247B /* Build configuration list for PBXProject "ZXing" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + C01FCF4F08A954540054247B /* Debug */, + C01FCF5008A954540054247B /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 29B97313FDCFA39411CA2CEA /* Project object */; +} diff --git a/iphone/ZXing/ZXing_Prefix.pch b/iphone/ZXing/ZXing_Prefix.pch new file mode 100644 index 000000000..08b2d9891 --- /dev/null +++ b/iphone/ZXing/ZXing_Prefix.pch @@ -0,0 +1,8 @@ +// +// Prefix header for all source files of the 'ZXing' target in the 'ZXing' project +// + +#ifdef __OBJC__ + #import + #import +#endif diff --git a/iphone/ZXing/main.m b/iphone/ZXing/main.m new file mode 100644 index 000000000..70c3506c6 --- /dev/null +++ b/iphone/ZXing/main.m @@ -0,0 +1,32 @@ +/* + * Copyright 2008 Google Inc. + * + * Licensed 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. + */ + +// +// main.m +// ZXing +// +// Created by Christian Brunschen on 23/04/2008. +// + +#import + +int main(int argc, char *argv[]) +{ + NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; + int retVal = UIApplicationMain(argc, argv, nil, nil); + [pool release]; + return retVal; +}