diff --git a/.gitignore b/.gitignore index a7ac3fd..410bb47 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ build/ dist/ xcuserdata +*.xccheckout diff --git a/PublicAutomation.xcodeproj/project.pbxproj b/PublicAutomation.xcodeproj/project.pbxproj index c8bc087..ff2d0e6 100644 --- a/PublicAutomation.xcodeproj/project.pbxproj +++ b/PublicAutomation.xcodeproj/project.pbxproj @@ -9,7 +9,7 @@ /* Begin PBXBuildFile section */ C194253C15D838BD004FC314 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C194253B15D838BD004FC314 /* Foundation.framework */; }; C194255215D83B49004FC314 /* UIAutomationBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = C194254E15D839EC004FC314 /* UIAutomationBridge.m */; }; - C194256315D94610004FC314 /* KIFTypist.m in Sources */ = {isa = PBXBuildFile; fileRef = C194256215D9460F004FC314 /* KIFTypist.m */; }; + C194256315D94610004FC314 /* PA_KIFTypist.m in Sources */ = {isa = PBXBuildFile; fileRef = C194256215D9460F004FC314 /* PA_KIFTypist.m */; }; C194256715D9516B004FC314 /* UIAutomationBridge.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = C194254D15D839EC004FC314 /* UIAutomationBridge.h */; }; C1FFB24915DCCECC00CACB04 /* PALoader.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FFB24815DCCECC00CACB04 /* PALoader.m */; }; /* End PBXBuildFile section */ @@ -35,8 +35,8 @@ C194254D15D839EC004FC314 /* UIAutomationBridge.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UIAutomationBridge.h; sourceTree = ""; }; C194254E15D839EC004FC314 /* UIAutomationBridge.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UIAutomationBridge.m; sourceTree = ""; }; C194255015D83A1D004FC314 /* LoadableCategory.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LoadableCategory.h; sourceTree = ""; }; - C194256115D9460F004FC314 /* KIFTypist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KIFTypist.h; sourceTree = ""; }; - C194256215D9460F004FC314 /* KIFTypist.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = KIFTypist.m; sourceTree = ""; }; + C194256115D9460F004FC314 /* PA_KIFTypist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PA_KIFTypist.h; sourceTree = ""; }; + C194256215D9460F004FC314 /* PA_KIFTypist.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PA_KIFTypist.m; sourceTree = ""; }; C194256415D949CE004FC314 /* CGGeometry-KIFAdditions.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "CGGeometry-KIFAdditions.h"; sourceTree = ""; }; C1FFB24815DCCECC00CACB04 /* PALoader.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PALoader.m; sourceTree = ""; }; F8D883FA18229E9400CC7C38 /* PALogging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PALogging.h; sourceTree = ""; }; @@ -85,8 +85,8 @@ C1FFB24815DCCECC00CACB04 /* PALoader.m */, F8D883FA18229E9400CC7C38 /* PALogging.h */, C194256415D949CE004FC314 /* CGGeometry-KIFAdditions.h */, - C194256115D9460F004FC314 /* KIFTypist.h */, - C194256215D9460F004FC314 /* KIFTypist.m */, + C194256115D9460F004FC314 /* PA_KIFTypist.h */, + C194256215D9460F004FC314 /* PA_KIFTypist.m */, C194255015D83A1D004FC314 /* LoadableCategory.h */, C194254D15D839EC004FC314 /* UIAutomationBridge.h */, C194254E15D839EC004FC314 /* UIAutomationBridge.m */, @@ -130,7 +130,7 @@ C194252F15D838BD004FC314 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0460; + LastUpgradeCheck = 0610; ORGANIZATIONNAME = ThoughtWorks; }; buildConfigurationList = C194253215D838BD004FC314 /* Build configuration list for PBXProject "PublicAutomation" */; @@ -156,7 +156,7 @@ buildActionMask = 2147483647; files = ( C194255215D83B49004FC314 /* UIAutomationBridge.m in Sources */, - C194256315D94610004FC314 /* KIFTypist.m in Sources */, + C194256315D94610004FC314 /* PA_KIFTypist.m in Sources */, C1FFB24915DCCECC00CACB04 /* PALoader.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -168,13 +168,16 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_OPTIMIZATION_LEVEL = 0; @@ -184,10 +187,14 @@ ); GCC_SYMBOLS_PRIVATE_EXTERN = NO; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.1; + ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; }; name = Debug; @@ -196,17 +203,23 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - ARCHS = "$(ARCHS_STANDARD_32_BIT)"; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; COPY_PHASE_STRIP = YES; + ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_VERSION = com.apple.compilers.llvm.clang.1_0; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; IPHONEOS_DEPLOYMENT_TARGET = 5.1; SDKROOT = iphoneos; diff --git a/PublicAutomation/KIFTypist.h b/PublicAutomation/PA_KIFTypist.h similarity index 80% rename from PublicAutomation/KIFTypist.h rename to PublicAutomation/PA_KIFTypist.h index 8ba0cef..3f9933b 100644 --- a/PublicAutomation/KIFTypist.h +++ b/PublicAutomation/PA_KIFTypist.h @@ -1,12 +1,12 @@ // -// KIFTypist.h +// PA_KIFTypist.h // KIF // // Created by Pete Hodgson on 8/12/12. // // -@interface KIFTypist : NSObject +@interface PA_KIFTypist : NSObject + (UIWindow *) keyboardWindow; + (BOOL)enterCharacter:(NSString *)characterString; + (BOOL)enterText:(NSString *)text; diff --git a/PublicAutomation/KIFTypist.m b/PublicAutomation/PA_KIFTypist.m similarity index 98% rename from PublicAutomation/KIFTypist.m rename to PublicAutomation/PA_KIFTypist.m index da75324..eb66b06 100644 --- a/PublicAutomation/KIFTypist.m +++ b/PublicAutomation/PA_KIFTypist.m @@ -6,7 +6,7 @@ // // -#import "KIFTypist.h" +#import "PA_KIFTypist.h" #import "UIAutomationBridge.h" #import "CGGeometry-KIFAdditions.h" @@ -14,14 +14,14 @@ const NSTimeInterval KEYSTROKE_DELAY = 0.05f; -@interface KIFTypist() +@interface PA_KIFTypist() + (NSString *)_representedKeyboardStringForCharacter:(NSString *)characterString; + (BOOL)_enterCharacter:(NSString *)characterString history:(NSMutableDictionary *)history; + (NSArray *)_subviewsOfView:(UIView *)view withClassNamePrefix:(NSString *)prefix; @end -@implementation KIFTypist +@implementation PA_KIFTypist // Listed from UIApplication+KIFAdditions + (UIWindow *)keyboardWindow; @@ -53,7 +53,7 @@ + (BOOL)enterText:(NSString *)text; for (NSUInteger characterIndex = 0; characterIndex < [text length]; characterIndex++) { NSString *characterString = [text substringWithRange:NSMakeRange(characterIndex, 1)]; - if (![KIFTypist enterCharacter:characterString]) { + if (![PA_KIFTypist enterCharacter:characterString]) { return NO; } } diff --git a/PublicAutomation/UIAutomationBridge.m b/PublicAutomation/UIAutomationBridge.m index 2bb2cb4..ecb16a0 100644 --- a/PublicAutomation/UIAutomationBridge.m +++ b/PublicAutomation/UIAutomationBridge.m @@ -7,7 +7,7 @@ // #import "UIAutomationBridge.h" #import "UIAutomation.h" -#import "KIFTypist.h" +#import "PA_KIFTypist.h" #import "PALogging.h" #import "CGGeometry-KIFAdditions.h" @@ -27,12 +27,12 @@ + (UIATarget *)uiat{ } + (BOOL) checkForKeyboard { - return [KIFTypist keyboardWindow] != nil; + return [PA_KIFTypist keyboardWindow] != nil; } + (BOOL) typeIntoKeyboard:(NSString *)string { DLog(@"typing into keyboard: %@", string ); - return [KIFTypist enterText:string]; + return [PA_KIFTypist enterText:string]; } + (CGPoint) tapView:(UIView *)view {