[ios/ZXingWidget] update to make ZxingWidget more acceptable on iPad 2

git-svn-id: https://zxing.googlecode.com/svn/trunk@1806 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
rpechayr 2011-06-01 18:17:37 +00:00
parent e0030780bc
commit 2f8acfd250
5 changed files with 21 additions and 5 deletions

View file

@ -54,6 +54,7 @@ Ralf Kistner
Randy Shen (Acer)
Rasmus Schrøder Sørensen
Richard Hřivňák
Romain Pechayre
Roman Nurik (Google)
Ryan Alford
Sanford Squires

View file

@ -68,13 +68,13 @@ public:
if ([self.delegate respondsToSelector:@selector(decoder:didDecodeImage:usingSubset:withResult:)]) {
[self.delegate decoder:self didDecodeImage:self.image usingSubset:self.subsetImage withResult:result];
}
[result release];
}
- (void)failedToDecodeImage:(NSString *)reason {
if ([self.delegate respondsToSelector:@selector(decoder:failedToDecodeImage:usingSubset:reason:)]) {
[self.delegate decoder:self failedToDecodeImage:self.image usingSubset:self.subsetImage reason:reason];
if (!self) return;
if ([delegate respondsToSelector:@selector(decoder:failedToDecodeImage:usingSubset:reason:)]) {
[delegate decoder:self failedToDecodeImage:self.image usingSubset:self.subsetImage reason:reason];
}
}
@ -279,6 +279,7 @@ public:
}
- (void) dealloc {
delegate = nil;
[image release];
[subsetImage release];
free(subsetData);

View file

@ -54,10 +54,14 @@ static const CGFloat kPadding = 10;
[cancelButton setTitle:@"Cancel" forState:UIControlStateNormal];
if (oneDMode) {
[cancelButton setTransform:CGAffineTransformMakeRotation(M_PI/2)];
[cancelButton setFrame:CGRectMake(20, 175, 45, 130)];
}
else {
[cancelButton setFrame:CGRectMake(95, 420, 130, 45)];
CGSize theSize = CGSizeMake(100, 50);
CGRect theRect = CGRectMake((theFrame.size.width - theSize.width) / 2, cropRect.origin.y + cropRect.size.height + 20, theSize.width, theSize.height);
[cancelButton setFrame:theRect];
}
[cancelButton addTarget:self action:@selector(cancel:) forControlEvents:UIControlEventTouchUpInside];

View file

@ -444,7 +444,7 @@ didOutputSampleBuffer:(CMSampleBufferRef)sampleBuffer
Decoder *d = [[Decoder alloc] init];
d.readers = readers;
d.delegate = self;
cropRect.origin.x = 0.0;
cropRect.origin.x = 0.0;
cropRect.origin.y = 0.0;
decoding = [d decodeImage:scrn cropRect:cropRect] == YES ? NO : YES;
[d release];

View file

@ -77,6 +77,8 @@
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 */; };
1F33FCD9133A52A90004D41D /* VCardResultParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F33FCD7133A52A90004D41D /* VCardResultParser.h */; };
1F33FCDA133A52A90004D41D /* VCardResultParser.m in Sources */ = {isa = PBXBuildFile; fileRef = 1F33FCD8133A52A90004D41D /* VCardResultParser.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 */; };
@ -306,6 +308,8 @@
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>"; };
1F33FCD7133A52A90004D41D /* VCardResultParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = VCardResultParser.h; sourceTree = "<group>"; };
1F33FCD8133A52A90004D41D /* VCardResultParser.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = VCardResultParser.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>"; };
@ -812,6 +816,8 @@
1F02801211A7BF06006B06DE /* URLResultParser.m */,
1F02801311A7BF06006B06DE /* URLTOResultParser.h */,
1F02801411A7BF06006B06DE /* URLTOResultParser.m */,
1F33FCD7133A52A90004D41D /* VCardResultParser.h */,
1F33FCD8133A52A90004D41D /* VCardResultParser.m */,
);
name = ResultParsers;
sourceTree = "<group>";
@ -986,6 +992,7 @@
3B81AAF9120F0A7E0022E5D4 /* GreyscaleRotatedLuminanceSource.h in Headers */,
3B72D97012130EF6007CEF32 /* ResultPointCallback.h in Headers */,
1FB4319F12901C76002D63E8 /* UniversalResultParser.h in Headers */,
1F33FCD9133A52A90004D41D /* VCardResultParser.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1149,6 +1156,7 @@
3B81AAF8120F0A7E0022E5D4 /* GreyscaleRotatedLuminanceSource.cpp in Sources */,
3B72D96F12130EF6007CEF32 /* ResultPointCallback.cpp in Sources */,
1FB431A012901C76002D63E8 /* UniversalResultParser.m in Sources */,
1F33FCDA133A52A90004D41D /* VCardResultParser.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1159,6 +1167,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
EXPORTED_SYMBOLS_FILE = exportList;
@ -1191,6 +1200,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = ZXingWidget_Prefix.pch;