diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdNetworkLibs/README b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdNetworkLibs/README deleted file mode 100644 index 4d20cf88d..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdNetworkLibs/README +++ /dev/null @@ -1,2 +0,0 @@ -You can put ad network libraries in this directory. The sample .xcodeproj references to files here. -DO NOT PUSH ANY AD NETWORK LIBRARIES TO GOOGLE CODE. diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/AdWhirlDelegateProtocol.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/AdWhirlDelegateProtocol.h deleted file mode 100644 index cf961c1d9..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/AdWhirlDelegateProtocol.h +++ /dev/null @@ -1,344 +0,0 @@ -/* - - AdWhirlDelegateProtocol.h - - Copyright 2009 AdMob, 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. - -*/ - -#import -#import - -@class AdWhirlView; - -@protocol AdWhirlDelegate - -@required - -- (NSString *)adWhirlApplicationKey; - -/** - * The view controller with which the ad network will display a modal view - * (web view, canvas), such as when the user clicks on the ad. You must - * supply a view controller. You should return the root view controller - * of your application, such as the root UINavigationController, or - * any controllers that are pushed/added directly to the root view controller. - * For example, if your app delegate has a pointer to the root view controller: - * - * return [(MyAppDelegate *)[[UIApplication sharedApplication] delegate] rootViewController] - * - * will suffice. - */ -- (UIViewController *)viewControllerForPresentingModalView; - -@optional - -#pragma mark server endpoints -/** - * If you are running your own AdWhirl server instance, make sure you - * implement the following to return the URL that points to the endpoints - * on your server. - */ -- (NSURL *)adWhirlConfigURL; -- (NSURL *)adWhirlImpMetricURL; -- (NSURL *)adWhirlClickMetricURL; -- (NSURL *)adWhirlCustomAdURL; - - -#pragma mark notifications -/** - * You can listen to callbacks from AdWhirl via these methods. When AdWhirl is - * notified that an ad request is fulfilled, it will notify you immediately. - * Thus, when notified that an ad request succeeded, you can choose to add the - * AdWhirlView object as a subview to your view. This view contains the ad. - * When you are notified that an ad request failed, you are also informed if the - * AdWhirlView is fetching a backup ad. The backup fetching order is specified - * by you in adwhirl.com or your own server instance. When all backup sources - * are attempted and the last ad request still fails, the usingBackup parameter - * will be set to NO. You can use this notification to try again and perhaps - * request another AdWhirlView via [AdWhirlView requestAdWhirlViewWithDelegate:] - */ -- (void)adWhirlDidReceiveAd:(AdWhirlView *)adWhirlView; -- (void)adWhirlDidFailToReceiveAd:(AdWhirlView *)adWhirlView usingBackup:(BOOL)yesOrNo; - -/** - * You can get notified when the transition animation to a new ad is completed - * so you can make necessary adjustments to the size of the adWhirlView and - * surrounding views after the animation. - */ -- (void)adWhirlDidAnimateToNewAdIn:(AdWhirlView *)adWhirlView; - -/** - * This function is your integration point for Generic Notifications. You can - * control when this notification occurs via the developers member section. You - * can allocate a percentage of your ad requests to initiate this callback. When - * you receive this notification, you can execute any code block that you own. - * For example, you can replace the ad in AdWhirlView after getting this callback - * by calling replaceBannerViewWith: . Note that the ad refresh cycle is still - * alive, so your view could be replaced by other ads when it's time for an - * ad refresh. - */ -- (void)adWhirlReceivedRequestForDeveloperToFufill:(AdWhirlView *)adWhirlView; - -/** - * In the event that ads are OFF, you can listen to this callback method to - * determine that ads have been turned off. - */ -- (void)adWhirlReceivedNotificationAdsAreOff:(AdWhirlView *)adWhirlView; - -/** - * These notifications will let you know when a user is being shown a full screen - * webview canvas with an ad because they tapped on an ad. You should listen to - * these notifications to determine when to pause/resume your game--if you're - * building a game app. - */ -- (void)adWhirlWillPresentFullScreenModal; -- (void)adWhirlDidDismissFullScreenModal; - -/** - * An ad request is a two step process: first the SDK must go to the AdWhirl - * server to retrieve configuration information. Then, based on the configuration - * information, it chooses an ad network and fetch an ad. The following call - * is for users to get notified when the first step is complete. The - * adWhirlView passed could be null if you had called the AdWhirlView class - * method +startPreFetchingConfigurationDataWithDelegate . - */ -- (void)adWhirlDidReceiveConfig:(AdWhirlView *)adWhirlView; - - -#pragma mark behavior configurations - -/** - * Request test ads for APIs that supports it. Make sure you turn it to OFF - * or remove the function before you submit your app to the app store. - */ -- (BOOL)adWhirlTestMode; - -/** - * Returns the device's current orientation for ad networks that relys on - * it. If you don't implement this function, [UIDevice currentDevice].orientation - * is used to get the current orientation. - */ -- (UIDeviceOrientation)adWhirlCurrentOrientation; - -#pragma mark appearance configurations -- (UIColor *)adWhirlAdBackgroundColor; -- (UIColor *)adWhirlTextColor; -- (UIColor *)adWhirlSecondaryTextColor; -- (UIColor *)backgroundColor DEPRECATED_ATTRIBUTE; // use the one with adWhirl prefix -- (UIColor *)textColor DEPRECATED_ATTRIBUTE; // use the one with adWhirl prefix - - -#pragma mark hard-coded application keys -- (NSString *)admobPublisherID; // your Publisher ID from Admob. -- (NSDictionary *)quattroWirelessDictionary; // key-value pairs for the keys "publisherID" and "siteID" provided by Quattro Wireless. Set NSString values for these two keys. -- (NSString *)pinchApplicationKey; // your Application Code from Pinch Media. -- (NSDictionary *)videoEggConfigDictionary; // key-value pairs for the keys "publisher" and "area" information from Video Egg. Set NSString values for these two keys. -- (NSString *)millennialMediaApIDString; // your ApID string from Millennial Media. -- (NSString *)MdotMApplicationKey; // your Application Code from MdotM -- (NSString *)googleAdSenseClientID; // your publisher ID from Google AdSense -- (NSString *)zestADZClientID; // your clientID from ZestADZ -- (NSString *)brightRollAppId; // your BrightRoll App ID -- (NSString *)inMobiAppID; // your inMobi app ID -- (NSString *)oneRiotAppID; -- (NSDictionary *) nexageDictionary; // your nexage dcn and position - - -#pragma mark demographic information optional delegate methods -- (CLLocation *)locationInfo; // user's current location -- (NSString *)postalCode; // user's postal code, e.g. "94401" -- (NSString *)areaCode; // user's area code, e.g. "415" -- (NSDate *)dateOfBirth; // user's date of birth -- (NSString *)gender; // user's gender (e.g. @"m" or @"f") -- (NSString *)keywords; // keywords the user has provided or that are contextually relevant, e.g. @"twitter client iPhone" -- (NSString *)searchString; // a search string the user has provided, e.g. @"Jasmine Tea House San Francisco" -- (NSUInteger)incomeLevel; // return actual annual income - - -#pragma mark QuattroWireless-specific optional delegate methods -/** - * Return the ad type desired for Quattro - * QWAdTypeBanner = 0, - * QWAdTypeText=2, - */ -- (NSUInteger)quattroWirelessAdType; - -/** - * Return a value for the education level if you have access to this info. This - * information will be relayed to Quattro Wireless if provided. - * QWEducationNoCollege = 0 - * QWEducationCollegeGraduate = 1 - * QWEducationGraduateSchool = 2 - * QWEducationUnknown = 3 - */ -- (NSUInteger)quattroWirelessEducationLevel; - -/** - * Return a value for the ethnicity if you have access to this info. This - * information will be relayed to Quattro Wireless if provided. - * QWEthnicGroupAfrican_American = 0 - * QWEthnicGroupAsian = 1 - * QWEthnicGroupHispanic = 2 - * QWEthnicGroupWhite = 3 - * QWEthnicGroupOther = 4 - */ -- (NSUInteger)quattroWirelessEthnicity; - - -#pragma mark MillennialMedia-specific optional delegate methods -/** - * Return the ad type desired for Millennial Media, depending on your ad position - * MMBannerAdTop = 1, - * MMBannerAdBottom = 2, - */ -- (NSUInteger)millennialMediaAdType; - -/** - * Return a value for the education level if you have access to this info. This - * information will be relayed to Millennial Media if provided - * MMEducationUnknown = 0, - * MMEducationHishSchool = 1, - * MMEducationSomeCollege = 2, - * MMEducationInCollege = 3, - * MMEducationBachelorsDegree = 4, - * MMEducationMastersDegree = 5, - * MMEducationPhD = 6 - */ -- (NSUInteger)millennialMediaEducationLevel; - -/** - * Return a value for ethnicity if you have access to this info. This - * information will be relayed to Millennial Media if provided. - * MMEthnicityUnknown = 0, - * MMEthnicityAfricanAmerican = 1, - * MMEthnicityAsian = 2, - * MMEthnicityCaucasian = 3, - * MMEthnicityHispanic = 4, - * MMEthnicityNativeAmerican = 5, - * MMEthnicityMixed = 6 - */ -- (NSUInteger)millennialMediaEthnicity; - -- (NSUInteger)millennialMediaAge DEPRECATED_ATTRIBUTE; // use dateOfBirth - - -#pragma mark Jumptap-specific optional delegate methods -/** - * optional site and spot id as provided by Jumptap. - */ -- (NSString *)jumptapSiteId; -- (NSString *)jumptapSpotId; - -/** - * Find a list of valid categories at https://support.jumptap.com/index.php/Valid_Categories - */ -- (NSString *)jumptapCategory; - -/** - * Whether adult content is allowed. - * AdultContentAllowed = 0, - * AdultContentNotAllowed = 1, - * AdultContentOnly = 2 - */ -- (NSUInteger)jumptapAdultContent; - -/** - * The transition to use when moving from, say, a banner to full-screen. - * TransitionHorizontalSlide = 0, - * TransitionVerticalSlide = 1, - * TransitionCurl = 2, - * TransitionFlip = 3 - */ -- (NSUInteger)jumptapTransitionType; - - -#pragma mark Google AdSense-specific delegate methods -/** - These are *REQUIRED* for googleAdSense. If you don't implement these methods, - your app will crash as the AdSense adapter looks for these methods. - */ -- (NSString *)googleAdSenseCompanyName; -- (NSString *)googleAdSenseAppName; -- (NSString *)googleAdSenseApplicationAppleID; - -/** - The following are optional and correspond to the optional kGADAdSense* ad attributes. - For documentation, see GADAdSenseParameters.h . - */ -- (NSString *)googleAdSenseKeywords; -- (NSURL *)googleAdSenseAppWebContentURL; -- (NSArray *)googleAdSenseChannelIDs; -- (NSString *)googleAdSenseAdType; -- (NSString *)googleAdSenseHostID; -//- (UIColor *)googleAdSenseAdBackgroundColor; // implement adWhirlAdBackgroundColor or set in server -- (UIColor *)googleAdSenseAdTopBackgroundColor; -- (UIColor *)googleAdSenseAdBorderColor; -- (UIColor *)googleAdSenseAdLinkColor; -//- (UIColor *)googleAdSenseAdTextColor; // implement adWhirlTextColor or set in server -- (UIColor *)googleAdSenseAdURLColor; -- (UIColor *)googleAdSenseAlternateAdColor; -- (NSURL *)googleAdSenseAlternateAdURL; -- (NSNumber *)googleAdSenseAllowAdsafeMedium; - - -#pragma mark InMobi-specific optional delegate methods -/** - * Education level for InMobi - * Edu_None = 0 - * Edu_HighSchool = 1 - * Edu_SomeCollege = 2 - * Edu_InCollege = 3 - * Edu_BachelorsDegree = 4 - * Edu_MastersDegree = 5 - * Edu_DoctoralDegree = 6 - * Edu_Other = 7 - */ -- (NSUInteger)inMobiEducation; - -/** - Eth_None = 0, - Eth_Mixed = 1, - Eth_Asian = 2, - Eth_Black = 3, - Eth_Hispanic = 4, - Eth_NativeAmerican = 5, - Eth_White = 6, - Eth_Other = 7 - */ -- (NSUInteger)inMobiEthnicity; - -/** - * See inMobi's documentation for valid values - */ -- (NSString *)inMobiInterests; - -- (NSString *)iAdAdvertisingSection; - -- (NSDictionary *)inMobiParamsDictionary; - -#pragma mark OneRiot-specific optional delegate methods - -/** Returns an array of NSStrings containing all optional context parameters - */ -- (NSArray *)oneRiotContextParameters; - -#pragma mark Nexage-specific optional delegate methods --(NSString *)nexageCity; --(NSString *)nexageDesignatedMarketArea; --(NSString *)nexageCountry; --(NSString *)nexageEthnicity; --(NSString *)nexageMaritalStatus; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/AdWhirlView.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/AdWhirlView.h deleted file mode 100644 index 7799fbdc6..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/AdWhirlView.h +++ /dev/null @@ -1,231 +0,0 @@ -/* - - AdWhirlView.h - - Copyright 2009 AdMob, 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. - -*/ - -#import -#import "AdWhirlDelegateProtocol.h" -#import "AWNetworkReachabilityWrapper.h" -#import "AdWhirlConfig.h" - -#define kAdWhirlAppVer 310 - -#define kAdWhirlViewWidth 320 -#define kAdWhirlViewHeight 50 -#define kAdWhirlViewDefaultSize \ - (CGSizeMake(kAdWhirlViewWidth, kAdWhirlViewHeight)) -#define kAdWhirlViewDefaultFrame \ - (CGRectMake(0,0,kAdWhirlViewWidth, kAdWhirlViewHeight)) - -#define kAdWhirlDefaultConfigURL @"http://mob.adwhirl.com/getInfo.php" -#define kAdWhirlDefaultImpMetricURL @"http://met.adwhirl.com/exmet.php" -#define kAdWhirlDefaultClickMetricURL @"http://met.adwhirl.com/exclick.php" -#define kAdWhirlDefaultCustomAdURL @"http://mob.adwhirl.com/custom.php" -#define kAWMinimumTimeBetweenFreshAdRequests 4.9f -#define kAdWhirlAdRequestTimeout 10 - - -@class AdWhirlAdNetworkConfig; -@class AdWhirlAdNetworkAdapter; -@class AdWhirlConfigStore; -@class AWNetworkReachabilityWrapper; - - -@interface AdWhirlView : UIView { - id delegate; - AdWhirlConfig *config; - - NSMutableArray *prioritizedAdNetCfgs; - double totalPercent; - - BOOL ignoreAutoRefreshTimer; - BOOL ignoreNewAdRequests; - BOOL appInactive; - BOOL showingModalView; - - BOOL requesting; - AdWhirlAdNetworkAdapter *currAdapter; - AdWhirlAdNetworkAdapter *lastAdapter; - NSDate *lastRequestTime; - NSMutableDictionary *pendingAdapters; - - NSTimer *refreshTimer; - - // remember which adapter we last sent click stats for so we don't send twice - id lastNotifyAdapter; - - NSError *lastError; - - AdWhirlConfigStore *configStore; - - AWNetworkReachabilityWrapper *rollOverReachability; - - NSUInteger configFetchAttempts; - - NSArray *testDarts; - NSUInteger testDartIndex; -} - -/** - * Call this method to get a view object that you can add to your own view. You - * must also provide a delegate. The delegate provides AdWhirl's application - * key and can listen for important messages. You can configure the view's - * settings and specific ad network information on AdWhirl.com or your own - * AdWhirl server instance. - */ -+ (AdWhirlView *)requestAdWhirlViewWithDelegate:(id)delegate; - -/** - * Starts pre-fetching ad network configurations from an AdWhirl server. If the - * configuration has been fetched when you are ready to request an ad, you save - * a round-trip to the network and hence your ad may show up faster. You - * typically call this in the applicationDidFinishLaunching: method of your - * app delegate. The request is non-blocking. You only need to call this - * at most once per run of your application. Subsequent calls to this function - * will be ignored. - */ -+ (void)startPreFetchingConfigurationDataWithDelegate:(id)d; - -/** - * Call this method to request a new configuration from the AdWhirl servers. - * This can be useful to support iOS 4.0 backgrounding. - */ -+ (void)updateAdWhirlConfigWithDelegate:(id)delegate; - -/** - * Call this method to request a new configuration from the AdWhirl servers. - */ -- (void)updateAdWhirlConfig; - -/** - * Call this method to get another ad to display. You can also specify under - * "app settings" on adwhirl.com to automatically get new ads periodically. - */ -- (void)requestFreshAd; - -/** - * Call this method if you prefer a rollover instead of a getNextAd call. This - * is offered primarily for developers who want to use generic notifications and - * then execute a rollover when an ad network fails to serve an ad. - */ -- (void)rollOver; - -/** - * The delegate is informed asynchronously whether an ad succeeds or fails to - * load. If you prefer to poll for this information, you can do so using this - * method. - * - */ -- (BOOL)adExists; - -/** - * Different ad networks may return different ad sizes. You may adjust the size - * of the AdWhirlView and your UI to avoid unsightly borders or chopping off - * pixels from ads. Call this method when you receive the adWhirlDidReceiveAd - * delegate method to get the size of the underlying ad network ad. - */ -- (CGSize)actualAdSize; - -/** - * Some ad networks may offer different banner sizes for different orientations. - * Call this function when the orientation of your UI changes so the underlying - * ad may handle the orientation change properly. You may also want to - * call the actualAdSize method right after calling this to get the size of - * the ad after the orientation change. - */ -- (void)rotateToOrientation:(UIInterfaceOrientation)orientation; - -/** - * Call this method to get the name of the most recent ad network that an ad - * request was made to. - */ -- (NSString *)mostRecentNetworkName; - -/** - * Call this method to ignore the automatic refresh timer. - * - * Note that the refresh timer is NOT invalidated when you call - * ignoreAutoRefreshTimer. - * This will simply ignore the refresh events that are called by the automatic - * refresh timer (if the refresh timer is enabled via adwhirl.com). So, for - * example, let's say you have a refresh cycle of 60 seconds. If you call - * ignoreAutoRefreshTimer at 30 seconds, and call resumeRefreshTimer at 90 sec, - * then the first refresh event is ignored, but the second refresh event at 120 - * sec will run. - */ -- (void)ignoreAutoRefreshTimer; -- (void)doNotIgnoreAutoRefreshTimer; -- (BOOL)isIgnoringAutoRefreshTimer; - -/** - * Call this method to ignore automatic refreshes AND manual refreshes entirely. - * - * This is provided for developers who asked to disable refreshing entirely, - * whether automatic or manual. - * If you call ignoreNewAdRequests, the AdWhirl will: - * 1) Ignore any Automatic refresh events (via the refresh timer) AND - * 2) Ignore any manual refresh calls (via requestFreshAd and rollOver) - */ -- (void)ignoreNewAdRequests; -- (void)doNotIgnoreNewAdRequests; -- (BOOL)isIgnoringNewAdRequests; - -/** - * Call this to replace the content of this AdWhirlView with the view. - */ -- (void)replaceBannerViewWith:(UIView*)bannerView; - -/** - * You can set the delegate to nil or another object. - * Make sure you set the delegate to nil when you release an AdWhirlView - * instance to avoid the AdWhirlView from calling to a non-existent delegate. - * If you set the delegate to another object, note that if the new delegate - * returns a different value for adWhirlApplicationKey, it will not overwrite - * the application key provided by the delegate you supplied for - * +requestAdWhirlViewWithDelegate . - */ -@property (nonatomic, assign) IBOutlet id delegate; - -/** - * Use this to retrieve more information after your delegate received a - * adWhirlDidFailToReceiveAd message. - */ -@property (nonatomic, readonly) NSError *lastError; - - -#pragma mark For ad network adapters use only - -/** - * Called by Adapters when there's a new ad view. - */ -- (void)adapter:(AdWhirlAdNetworkAdapter *)adapter - didReceiveAdView:(UIView *)view; - -/** - * Called by Adapters when ad view failed. - */ -- (void)adapter:(AdWhirlAdNetworkAdapter *)adapter didFailAd:(NSError *)error; - -/** - * Called by Adapters when the ad request is finished, but the ad view is - * furnished elsewhere. e.g. Generic Notification - */ -- (void)adapterDidFinishAdRequest:(AdWhirlAdNetworkAdapter *)adapter; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdNetworkAdapter.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdNetworkAdapter.h deleted file mode 100644 index a217d72e2..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdNetworkAdapter.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - - AdWhirlAdNetworkAdapter.h - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlDelegateProtocol.h" -#import "AdWhirlConfig.h" - -typedef enum { - AdWhirlAdNetworkTypeAdMob = 1, - AdWhirlAdNetworkTypeJumpTap = 2, - AdWhirlAdNetworkTypeVideoEgg = 3, - AdWhirlAdNetworkTypeMedialets = 4, - AdWhirlAdNetworkTypeLiveRail = 5, - AdWhirlAdNetworkTypeMillennial = 6, - AdWhirlAdNetworkTypeGreyStripe = 7, - AdWhirlAdNetworkTypeQuattro = 8, - AdWhirlAdNetworkTypeCustom = 9, - AdWhirlAdNetworkTypeAdWhirl10 = 10, - AdWhirlAdNetworkTypeMobClix = 11, - AdWhirlAdNetworkTypeMdotM = 12, - AdWhirlAdNetworkTypeAdWhirl13 = 13, - AdWhirlAdNetworkTypeGoogleAdSense = 14, - AdWhirlAdNetworkTypeGoogleDoubleClick = 15, - AdWhirlAdNetworkTypeGeneric = 16, - AdWhirlAdNetworkTypeEvent = 17, - AdWhirlAdNetworkTypeInMobi = 18, - AdWhirlAdNetworkTypeIAd = 19, - AdWhirlAdNetworkTypeZestADZ = 20, - AdWhirlAdNetworkTypeBrightRoll = 21, - AdWhirlAdNetworkTypeTapAd = 22, - AdWhirlAdNetworkTypeOneRiot = 23, - AdWhirlAdNetworkTypeNexage = 24 -} AdWhirlAdNetworkType; - -@class AdWhirlView; -@class AdWhirlConfig; -@class AdWhirlAdNetworkConfig; - -@interface AdWhirlAdNetworkAdapter : NSObject { - id adWhirlDelegate; - AdWhirlView *adWhirlView; - AdWhirlConfig *adWhirlConfig; - AdWhirlAdNetworkConfig *networkConfig; - UIView *adNetworkView; -} - -/** - * Subclasses must implement +networkType to return an AdWhirlAdNetworkType enum. - */ -//+ (AdWhirlAdNetworkType)networkType; - -/** - * Subclasses must add itself to the AdWhirlAdNetworkRegistry. One way - * to do so is to implement the +load function and register there. - */ -//+ (void)load; - -/** - * Default initializer. Subclasses do not need to override this method unless - * they need to perform additional initialization. In which case, this - * method must be called via the super keyword. - */ -- (id)initWithAdWhirlDelegate:(id)delegate - view:(AdWhirlView *)view - config:(AdWhirlConfig *)config - networkConfig:(AdWhirlAdNetworkConfig *)netConf; - -/** - * Ask the adapter to get an ad. This must be implemented by subclasses. - */ -- (void)getAd; - -/** - * When called, the adapter must remove itself as a delegate or notification - * observer from the underlying ad network SDK. Subclasses must implement this - * method, even if the underlying SDK doesn't have a way of removing delegate - * (in which case, you should contact the ad network). Note that this method - * will be called in dealloc at AdWhirlAdNetworkAdapter, before adNetworkView - * is released. Care must be taken if you also keep a reference of your ad view - * in a separate instance variable, as you may have released that variable - * before this gets called in AdWhirlAdNetworkAdapter's dealloc. Use - * adNetworkView, defined in this class, instead of your own instance variable. - * This function should also be idempotent, i.e. get called multiple times and - * not crash. - */ -- (void)stopBeingDelegate; - -/** - * Subclasses return YES to ask AdWhirlView to send metric requests to the - * AdWhirl server for ad impressions. Default is YES. - */ -- (BOOL)shouldSendExMetric; - -/** - * Tell the adapter that the interface orientation changed or is about to change - */ -- (void)rotateToOrientation:(UIInterfaceOrientation)orientation; - -/** - * Some ad transition types may cause issues with particular ad networks. The - * adapter should know whether the given animation type is OK. Defaults to - * YES. - */ -- (BOOL)isBannerAnimationOK:(AWBannerAnimationType)animType; - -@property (nonatomic,assign) id adWhirlDelegate; -@property (nonatomic,assign) AdWhirlView *adWhirlView; -@property (nonatomic,retain) AdWhirlConfig *adWhirlConfig; -@property (nonatomic,retain) AdWhirlAdNetworkConfig *networkConfig; -@property (nonatomic,retain) UIView *adNetworkView; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdMobAds.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdMobAds.h deleted file mode 100644 index 245e367ba..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdMobAds.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - - AdWhirlAdapterGoogleAdMobAds.h - Copyright 2011 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. - - */ - -#import "AdWhirlAdNetworkAdapter.h" -#import "GADBannerViewDelegate.h" - -@interface AdWhirlAdapterGoogleAdMobAds : AdWhirlAdNetworkAdapter - { -} - -- (SEL)delegatePublisherIdSelector; -- (NSString *)hexStringFromUIColor:(UIColor *)color; -+ (AdWhirlAdNetworkType)networkType; -- (NSString *)publisherId; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdMobAds.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdMobAds.m deleted file mode 100644 index bcff47e72..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdMobAds.m +++ /dev/null @@ -1,199 +0,0 @@ -/* - - AdWhirlAdapterGoogleAdMobAds.m - Copyright 2011 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. - -*/ - -#import "AdWhirlAdapterGoogleAdMobAds.h" -#import "AdWhirlAdNetworkConfig.h" -#import "AdWhirlView.h" -#import "GADBannerView.h" -#import "AdWhirlLog.h" -#import "AdWhirlAdNetworkAdapter+Helpers.h" -#import "AdWhirlAdNetworkRegistry.h" - -@implementation AdWhirlAdapterGoogleAdMobAds - -+ (void)load { - [[AdWhirlAdNetworkRegistry sharedRegistry] registerClass:self]; -} - -+ (AdWhirlAdNetworkType)networkType { - return AdWhirlAdNetworkTypeAdMob; -} - -// converts UIColor to hex string, ignoring alpha. -- (NSString *)hexStringFromUIColor:(UIColor *)color { - CGColorSpaceModel colorSpaceModel = - CGColorSpaceGetModel(CGColorGetColorSpace(color.CGColor)); - if (colorSpaceModel == kCGColorSpaceModelRGB - || colorSpaceModel == kCGColorSpaceModelMonochrome) { - const CGFloat *colors = CGColorGetComponents(color.CGColor); - CGFloat red = 0.0, green = 0.0, blue = 0.0; - if (colorSpaceModel == kCGColorSpaceModelRGB) { - red = colors[0]; - green = colors[1]; - blue = colors[2]; - // we ignore alpha here. - } else if (colorSpaceModel == kCGColorSpaceModelMonochrome) { - red = green = blue = colors[0]; - } - return [NSString stringWithFormat:@"%02X%02X%02X", - (int)(red * 255), (int)(green * 255), (int)(blue * 255)]; - } - return nil; -} - -- (NSObject *)delegateValueForSelector:(SEL)selector { - return ([adWhirlDelegate respondsToSelector:selector]) ? - [adWhirlDelegate performSelector:selector] : nil; -} - -- (void)getAd { - GADRequest *request = [GADRequest request]; - NSObject *value; - - NSMutableDictionary *additional = [NSMutableDictionary dictionary]; - if ([adWhirlDelegate respondsToSelector:@selector(adWhirlTestMode)] - && [adWhirlDelegate adWhirlTestMode]) { - [additional setObject:@"on" forKey:@"adtest"]; - } - - if ((value = [self delegateValueForSelector: - @selector(adWhirlAdBackgroundColor)])) { - [additional setObject:[self hexStringFromUIColor:(UIColor *)value] - forKey:@"color_bg"]; - } - - if ((value = [self delegateValueForSelector: - @selector(adWhirlAdBackgroundColor)])) { - [additional setObject:[self hexStringFromUIColor:(UIColor *)value] - forKey:@"color_text"]; - } - - // deliberately don't allow other color specifications. - - if ([additional count] > 0) { - request.additionalParameters = additional; - } - - CLLocation *location = - (CLLocation *)[self delegateValueForSelector:@selector(locationInfo)]; - - if ((adWhirlConfig.locationOn) && (location)) { - [request setLocationWithLatitude:location.coordinate.latitude - longitude:location.coordinate.longitude - accuracy:location.horizontalAccuracy]; - } - - NSString *string = - (NSString *)[self delegateValueForSelector:@selector(gender)]; - - if ([string isEqualToString:@"m"]) { - request.gender = kGADGenderMale; - } else if ([string isEqualToString:@"f"]) { - request.gender = kGADGenderFemale; - } else { - request.gender = kGADGenderUnknown; - } - - if ((value = [self delegateValueForSelector:@selector(dateOfBirth)])) { - request.birthday = (NSDate *)value; - } - - if ((value = [self delegateValueForSelector:@selector(keywords)])) { - NSArray *keywordArray = - [(NSString *)value componentsSeparatedByString:@" "]; - request.keywords = [NSMutableArray arrayWithArray:keywordArray]; - } - - // Set the frame for this view to match the bounds of the parent adWhirlView. - GADBannerView *view = - [[GADBannerView alloc] initWithFrame:adWhirlView.bounds]; - - view.adUnitID = [self publisherId]; - view.delegate = self; - view.rootViewController = - [adWhirlDelegate viewControllerForPresentingModalView]; - - self.adNetworkView = [view autorelease]; - - [view loadRequest:request]; -} - -- (void)stopBeingDelegate { - if (self.adNetworkView != nil - && [self.adNetworkView respondsToSelector:@selector(setDelegate:)]) { - [self.adNetworkView performSelector:@selector(setDelegate:) - withObject:nil]; - } -} - -#pragma mark Ad Request Lifecycle Notifications - -// Sent when an ad request loaded an ad. This is a good opportunity to add -// this view to the hierarchy if it has not yet been added. -- (void)adViewDidReceiveAd:(GADBannerView *)adView { - [adWhirlView adapter:self didReceiveAdView:adView]; -} - -// Sent when an ad request failed. Normally this is because no network -// connection was available or no ads were available (i.e. no fill). -- (void)adView:(GADBannerView *)adView - didFailToReceiveAdWithError:(GADRequestError *)error { - [adWhirlView adapter:self didFailAd:error]; -} - -#pragma mark Click-Time Lifecycle Notifications - -// Sent just before presenting the user a full screen view, such as a browser, -// in response to clicking on an ad. Use this opportunity to stop animations, -// time sensitive interactions, etc. -// -// Normally the user looks at the ad, dismisses it, and control returns to your -// application by calling adViewDidDismissScreen:. However if the user hits -// the Home button or clicks on an App Store link your application will end. -// On iOS 4.0+ the next method called will be applicationWillResignActive: of -// your UIViewController (UIApplicationWillResignActiveNotification). -// Immediately after that adViewWillLeaveApplication: is called. -- (void)adViewWillPresentScreen:(GADBannerView *)adView { - [self helperNotifyDelegateOfFullScreenModal]; -} - -// Sent just after dismissing a full screen view. Use this opportunity to -// restart anything you may have stopped as part of adViewWillPresentScreen:. -- (void)adViewDidDismissScreen:(GADBannerView *)adView { - [self helperNotifyDelegateOfFullScreenModalDismissal]; -} - -#pragma mark parameter gathering methods - -- (SEL)delegatePublisherIdSelector { - return @selector(admobPublisherID); -} - -- (NSString *)publisherId { - SEL delegateSelector = [self delegatePublisherIdSelector]; - - if ((delegateSelector) && - ([adWhirlDelegate respondsToSelector:delegateSelector])) { - return [adWhirlDelegate performSelector:delegateSelector]; - } - - return networkConfig.pubId; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdSense.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdSense.h deleted file mode 100644 index 46f28462d..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdSense.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - - AdWhirlAdapterGoogleAdSense.h - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdNetworkAdapter.h" -#import "GADAdViewController.h" -#import "GADAdSenseParameters.h" -#import "AdWhirlAdNetworkConfig.h" -#import "AdWhirlAdNetworkRegistry.h" -#import "AdWhirlView.h" - -@interface AdWhirlAdapterGoogleAdSense : AdWhirlAdNetworkAdapter { - GADAdViewController *adViewController; -} - -@property (retain) GADAdViewController *adViewController; - -+ (NSInteger)networkType; - -- (NSString *)publisherId; -- (NSString *)companyName; -- (NSString *)appName; -- (NSString *)applicationAppleID; -- (NSNumber *)testMode; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdSense.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdSense.m deleted file mode 100644 index aebd520f9..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterGoogleAdSense.m +++ /dev/null @@ -1,189 +0,0 @@ -/* - - AdWhirlAdapterGoogleAdSense.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdNetworkAdapter+Helpers.h" -#import "AdWhirlAdapterGoogleAdSense.h" -#import "AdWhirlAdNetworkConfig.h" -#import "AdWhirlConfig.h" -#import "AdWhirlLog.h" - -static NSDictionary *GASParamNameToSel; - -@implementation AdWhirlAdapterGoogleAdSense - -@synthesize adViewController; - -+ (NSInteger)networkType { - return AdWhirlAdNetworkTypeGoogleAdSense; -} - -+ (void)load { - [[AdWhirlAdNetworkRegistry sharedRegistry] registerClass:self]; - GASParamNameToSel = [[NSDictionary alloc] initWithObjectsAndKeys: - @"googleAdSenseKeywords", kGADAdSenseKeywords, - @"googleAdSenseAppWebContentURL", kGADAdSenseAppWebContentURL, - @"googleAdSenseChannelIDs", kGADAdSenseChannelIDs, - @"googleAdSenseAdType", kGADAdSenseAdType, - @"googleAdSenseHostID", kGADAdSenseHostID, - @"adWhirlAdBackgroundColor", kGADAdSenseAdBackgroundColor, - @"googleAdSenseAdTopBackgroundColor", kGADAdSenseAdTopBackgroundColor, - @"googleAdSenseAdBorderColor", kGADAdSenseAdBorderColor, - @"googleAdSenseAdLinkColor", kGADAdSenseAdLinkColor, - @"adWhirlTextColor", kGADAdSenseAdTextColor, - @"googleAdSenseAdURLColor", kGADAdSenseAdURLColor, - @"googleAdSenseAlternateAdColor", kGADAdSenseAlternateAdColor, - @"googleAdSenseAlternateAdURL", kGADAdSenseAlternateAdURL, - @"googleAdSenseAllowAdsafeMedium", kGADAdSenseAllowAdsafeMedium, - nil]; -} - -- (id)initWithAdWhirlDelegate:(id)delegate - view:(AdWhirlView *)view - config:(AdWhirlConfig *)config - networkConfig:(AdWhirlAdNetworkConfig *)netConf { - self = [super initWithAdWhirlDelegate:delegate - view:view - config:config - networkConfig:netConf]; - if (self != nil) { - // Check that the required methods are implemented. - if (![delegate respondsToSelector:@selector(googleAdSenseCompanyName)]) { - [NSException raise:NSInvalidArgumentException format: - @"You must implement googleAdSenseCompanyName in your AdwhirlDelegate in order to use Google AdSense"]; - } - if (![delegate respondsToSelector:@selector(googleAdSenseAppName)]) { - [NSException raise:NSInvalidArgumentException format: - @"You must implement googleAdSenseAppName in your AdwhirlDelegate in order to use Google AdSense"]; - } - if (![delegate respondsToSelector:@selector(googleAdSenseApplicationAppleID)]) { - [NSException raise:NSInvalidArgumentException format: - @"You must implement googleAdSenseApplicationAppleID in your AdwhirlDelegate in order to use Google AdSense"]; - } - } - return self; -} - -- (void)getAd { - adViewController = [[GADAdViewController alloc] initWithDelegate:self]; - - NSMutableDictionary *attributes = [NSMutableDictionary dictionaryWithObjectsAndKeys: - [self publisherId], kGADAdSenseClientID, - [self companyName], kGADAdSenseCompanyName, - [self appName], kGADAdSenseAppName, - [self applicationAppleID], kGADAdSenseApplicationAppleID, - [self testMode], kGADAdSenseIsTestAdRequest, - nil]; - - // optional params - for (NSString *paramName in GASParamNameToSel) { - SEL sel = NSSelectorFromString((NSString *)[GASParamNameToSel objectForKey:paramName]); - if ([adWhirlDelegate respondsToSelector:sel]) { - NSObject *val = [adWhirlDelegate performSelector:sel]; - if (val != nil) { - [attributes setObject:val forKey:paramName]; - } - } - } - - AWLogDebug(@"Google AdSense attributes: %@", attributes); - // load the ad - adViewController.adSize = kGADAdSize320x50; - [adViewController loadGoogleAd:attributes]; - adViewController.view.frame = kAdWhirlViewDefaultFrame; - self.adNetworkView = adViewController.view; -} - -- (void)stopBeingDelegate { - if (adViewController != nil) { - adViewController.delegate = nil; - } -} - -- (void)dealloc { - // need to call here cos adViewController will be nil when super dealloc runs - [self stopBeingDelegate]; - [adViewController release], adViewController = nil; - [super dealloc]; -} - -#pragma mark parameter gathering methods - -- (NSString *)publisherId { - if ([adWhirlDelegate respondsToSelector:@selector(googleAdSenseClientID)]) { - return [adWhirlDelegate googleAdSenseClientID]; - } - - return networkConfig.pubId; -} - -- (NSString *)companyName { - return [adWhirlDelegate googleAdSenseCompanyName]; -} - -- (NSString *)appName { - return [adWhirlDelegate googleAdSenseAppName]; -} - -- (NSString *)applicationAppleID { - return [adWhirlDelegate googleAdSenseApplicationAppleID]; -} - -- (NSNumber *)testMode { - if ([adWhirlDelegate respondsToSelector:@selector(adWhirlTestMode)] - && [adWhirlDelegate adWhirlTestMode]) { - return [NSNumber numberWithInt:1]; - } - return [NSNumber numberWithInt:0]; -} - -#pragma mark GADAdViewControllerDelegate required methods - -- (UIViewController *)viewControllerForModalPresentation:(GADAdViewController *)adController { - return [adWhirlDelegate viewControllerForPresentingModalView]; -} - -#pragma mark GADAdViewControllerDelegate notification methods - -- (void)loadSucceeded:(GADAdViewController *)adController withResults:(NSDictionary *)results { - [adWhirlView adapter:self didReceiveAdView:[adController view]]; -} - -- (void)loadFailed:(GADAdViewController *)adController withError:(NSError *) error { - [adWhirlView adapter:self didFailAd:error]; -} - -- (GADAdClickAction)adControllerActionModelForAdClick:(GADAdViewController *)adController { - [self helperNotifyDelegateOfFullScreenModal]; - return GAD_ACTION_DISPLAY_INTERNAL_WEBSITE_VIEW; // full screen web view -} - -- (void)adControllerDidCloseWebsiteView:(GADAdViewController *)adController { - [self helperNotifyDelegateOfFullScreenModalDismissal]; -} - -- (void)adControllerDidExpandAd:(GADAdViewController *)controller { - [self helperNotifyDelegateOfFullScreenModal]; -} - -- (void)adControllerDidCollapseAd:(GADAdViewController *)controller { - [self helperNotifyDelegateOfFullScreenModalDismissal]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterIAd.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterIAd.h deleted file mode 100644 index f83113ec7..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterIAd.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - - AdWhirlAdapterIAd.h - - Copyright 2010 AdMob, 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. - - */ - -#import "AdWhirlAdNetworkAdapter.h" -#import - -@interface AdWhirlAdapterIAd : AdWhirlAdNetworkAdapter { - NSString *kADBannerContentSizeIdentifierPortrait; - NSString *kADBannerContentSizeIdentifierLandscape; -} - -+ (AdWhirlAdNetworkType)networkType; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterIAd.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterIAd.m deleted file mode 100644 index 3f826feb1..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/adapters/AdWhirlAdapterIAd.m +++ /dev/null @@ -1,135 +0,0 @@ -/* - - AdWhirlAdapterIAd.m - - Copyright 2010 AdMob, 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. - - */ - -#import "AdWhirlAdapterIAd.h" -#import "AdWhirlAdNetworkConfig.h" -#import "AdWhirlView.h" -#import "AdWhirlLog.h" -#import "AdWhirlAdNetworkAdapter+Helpers.h" -#import "AdWhirlAdNetworkRegistry.h" - -@implementation AdWhirlAdapterIAd - -+ (AdWhirlAdNetworkType)networkType { - return AdWhirlAdNetworkTypeIAd; -} - -+ (void)load { - if(NSClassFromString(@"ADBannerView") != nil) { - [[AdWhirlAdNetworkRegistry sharedRegistry] registerClass:self]; - } -} - -- (void)getAd { - ADBannerView *iAdView = [[ADBannerView alloc] initWithFrame:CGRectZero]; - kADBannerContentSizeIdentifierPortrait = - &ADBannerContentSizeIdentifierPortrait != nil ? - ADBannerContentSizeIdentifierPortrait : - ADBannerContentSizeIdentifier320x50; - kADBannerContentSizeIdentifierLandscape = - &ADBannerContentSizeIdentifierLandscape != nil ? - ADBannerContentSizeIdentifierLandscape : - ADBannerContentSizeIdentifier480x32; - iAdView.requiredContentSizeIdentifiers = [NSSet setWithObjects: - kADBannerContentSizeIdentifierPortrait, - kADBannerContentSizeIdentifierLandscape, - nil]; - UIDeviceOrientation orientation; - if ([self.adWhirlDelegate respondsToSelector:@selector(adWhirlCurrentOrientation)]) { - orientation = [self.adWhirlDelegate adWhirlCurrentOrientation]; - } - else { - orientation = [UIDevice currentDevice].orientation; - } - - if (UIDeviceOrientationIsLandscape(orientation)) { - iAdView.currentContentSizeIdentifier = kADBannerContentSizeIdentifierLandscape; - } - else { - iAdView.currentContentSizeIdentifier = kADBannerContentSizeIdentifierPortrait; - } - [iAdView setDelegate:self]; - - self.adNetworkView = iAdView; - [iAdView release]; -} - -- (void)stopBeingDelegate { - ADBannerView *iAdView = (ADBannerView *)self.adNetworkView; - if (iAdView != nil) { - iAdView.delegate = nil; - } -} - -- (void)rotateToOrientation:(UIInterfaceOrientation)orientation { - ADBannerView *iAdView = (ADBannerView *)self.adNetworkView; - if (iAdView == nil) return; - if (UIInterfaceOrientationIsLandscape(orientation)) { - iAdView.currentContentSizeIdentifier = kADBannerContentSizeIdentifierLandscape; - } - else { - iAdView.currentContentSizeIdentifier = kADBannerContentSizeIdentifierPortrait; - } - // ADBanner positions itself in the center of the super view, which we do not - // want, since we rely on publishers to resize the container view. - // position back to 0,0 - CGRect newFrame = iAdView.frame; - newFrame.origin.x = newFrame.origin.y = 0; - iAdView.frame = newFrame; -} - -- (BOOL)isBannerAnimationOK:(AWBannerAnimationType)animType { - if (animType == AWBannerAnimationTypeFadeIn) { - return NO; - } - return YES; -} - -- (void)dealloc { - [super dealloc]; -} - -#pragma mark IAdDelegate methods - -- (void)bannerViewDidLoadAd:(ADBannerView *)banner { - // ADBanner positions itself in the center of the super view, which we do not - // want, since we rely on publishers to resize the container view. - // position back to 0,0 - CGRect newFrame = banner.frame; - newFrame.origin.x = newFrame.origin.y = 0; - banner.frame = newFrame; - - [adWhirlView adapter:self didReceiveAdView:banner]; -} - -- (void)bannerView:(ADBannerView *)banner didFailToReceiveAdWithError:(NSError *)error { - [adWhirlView adapter:self didFailAd:error]; -} - -- (BOOL)bannerViewActionShouldBegin:(ADBannerView *)banner willLeaveApplication:(BOOL)willLeave { - [self helperNotifyDelegateOfFullScreenModal]; - return YES; -} - -- (void)bannerViewActionDidFinish:(ADBannerView *)banner { - [self helperNotifyDelegateOfFullScreenModalDismissal]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/ARRollerView.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/ARRollerView.m deleted file mode 100644 index 4c1a0f9f1..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/ARRollerView.m +++ /dev/null @@ -1,46 +0,0 @@ -/* - - ARRollerView.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "ARRollerView.h" -#import "AdWhirlView+.h" - -@interface ARRollerView () -- (id)initWithDelegate:(id)delegate; -@end - -@implementation ARRollerView - -+ (ARRollerView*)requestRollerViewWithDelegate:(id)delegate { - return [[[ARRollerView alloc] initWithDelegate:delegate] autorelease]; -} - -- (id)initWithDelegate:(id)d { - return [super initWithDelegate:d]; -} - -- (void)getNextAd { - [self requestFreshAd]; -} - -- (void)setDelegateToNil { - self.delegate = nil; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AWNetworkReachabilityDelegate.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AWNetworkReachabilityDelegate.h deleted file mode 100644 index 98e6d3859..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AWNetworkReachabilityDelegate.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - - AWNetworkReachabilityDelegate.h - - Copyright 2010 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. - - */ - -@class AWNetworkReachabilityWrapper; - -@protocol AWNetworkReachabilityDelegate - -@optional -- (void)reachabilityBecameReachable:(AWNetworkReachabilityWrapper *)reachability; -- (void)reachabilityNotReachable:(AWNetworkReachabilityWrapper *)reachability; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AWNetworkReachabilityWrapper.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AWNetworkReachabilityWrapper.h deleted file mode 100644 index e1b130146..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AWNetworkReachabilityWrapper.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - - AWNetworkReachabilityWrapper.h - - Copyright 2010 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. - - */ - -#import -#import -#import -#import -#import -#import -#import -#import "AWNetworkReachabilityDelegate.h" - -@class AWNetworkReachabilityWrapper; - - -// Created for ease of mocking (hence testing) -@interface AWNetworkReachabilityWrapper : NSObject { - NSString *hostname_; - SCNetworkReachabilityRef reachability_; - id delegate_; -} - -@property (nonatomic,readonly) NSString *hostname; -@property (nonatomic,assign) id delegate; - -+ (AWNetworkReachabilityWrapper *) reachabilityWithHostname:(NSString *)host - callbackDelegate:(id)delegate; - -- (id)initWithHostname:(NSString *)host - callbackDelegate:(id)delegate; - -- (BOOL)scheduleInCurrentRunLoop; - -- (BOOL)unscheduleFromCurrentRunLoop; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AWNetworkReachabilityWrapper.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AWNetworkReachabilityWrapper.m deleted file mode 100644 index 3b04c1122..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AWNetworkReachabilityWrapper.m +++ /dev/null @@ -1,172 +0,0 @@ -/* - - AWNetworkReachabilityWrapper.m - - Copyright 2010 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. - - */ - -#import "AWNetworkReachabilityWrapper.h" -#import "AdWhirlLog.h" - -static void reachabilityCallback(SCNetworkReachabilityRef reachability, - SCNetworkReachabilityFlags flags, - void* data); - -@implementation AWNetworkReachabilityWrapper - -@synthesize hostname = hostname_; -@synthesize delegate = delegate_; - -+ (AWNetworkReachabilityWrapper *) reachabilityWithHostname:(NSString *)host - callbackDelegate:(id)delegate { - return [[[AWNetworkReachabilityWrapper alloc] initWithHostname:host - callbackDelegate:delegate] - autorelease]; -} - -- (id)initWithHostname:(NSString *)host - callbackDelegate:(id)delegate { - self = [super init]; - if (self != nil) { - reachability_ = SCNetworkReachabilityCreateWithName(NULL, - [host UTF8String]); - if (reachability_ == nil) { - AWLogError(@"Error creating SCNetworkReachability"); - [self release]; - return nil; - } - hostname_ = [[NSString alloc] initWithString:host]; - self.delegate = delegate; - - // set callback - SCNetworkReachabilityContext context = {0, self, NULL, NULL, NULL}; - if (!SCNetworkReachabilitySetCallback(reachability_, - &reachabilityCallback, - &context)) { - AWLogError(@"Error setting SCNetworkReachability callback"); - [self release]; - return nil; - } - } - return self; -} - -- (BOOL)scheduleInCurrentRunLoop { - return SCNetworkReachabilityScheduleWithRunLoop(reachability_, - CFRunLoopGetCurrent(), - kCFRunLoopDefaultMode); -} - -- (BOOL)unscheduleFromCurrentRunLoop { - return SCNetworkReachabilityUnscheduleFromRunLoop(reachability_, - CFRunLoopGetCurrent(), - kCFRunLoopDefaultMode); -} - -- (void)dealloc { - [self unscheduleFromCurrentRunLoop]; - if (reachability_ != NULL) CFRelease(reachability_); - [hostname_ release]; - [super dealloc]; -} - -#pragma mark callback methods - -static void printReachabilityFlags(SCNetworkReachabilityFlags flags) -{ - AWLogDebug(@"Reachability flag status: %c%c%c%c%c%c%c%c%c", - (flags & kSCNetworkReachabilityFlagsTransientConnection) ? 't' : '-', - (flags & kSCNetworkReachabilityFlagsReachable) ? 'R' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionRequired) ? 'c' : '-', - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) ? 'C' : '-', - (flags & kSCNetworkReachabilityFlagsInterventionRequired) ? 'i' : '-', -#ifdef kSCNetworkReachabilityFlagsConnectionOnDemand - (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) ? 'D' : '-', -#else - '-', -#endif - (flags & kSCNetworkReachabilityFlagsIsLocalAddress) ? 'l' : '-', - (flags & kSCNetworkReachabilityFlagsIsDirect) ? 'd' : '-', - (flags & kSCNetworkReachabilityFlagsIsWWAN) ? 'W' : '-' - ); -} - -- (void)notifyDelegateNotReachable { - if (self.delegate != nil && [self.delegate respondsToSelector: - @selector(reachabilityNotReachable:)]) { - [self.delegate reachabilityNotReachable:self]; - } -} - -- (void)gotCallback:(SCNetworkReachabilityRef)reachability - flags:(SCNetworkReachabilityFlags)flags { - if (reachability != reachability_) { - AWLogError(@"Unrelated reachability calling back to this object"); - return; - } - - printReachabilityFlags(flags); - if ((flags & kSCNetworkReachabilityFlagsReachable) == 0) { - [self notifyDelegateNotReachable]; - return; - } - - // even if the Reachable flag is on it may not be true for immediate use - BOOL reachable = NO; - - if ((flags & kSCNetworkReachabilityFlagsConnectionRequired) == 0) { - // no connection required, we should be able to connect, via WiFi presumably - reachable = YES; - } - - if (( -#ifdef kSCNetworkReachabilityFlagsConnectionOnDemand - (flags & kSCNetworkReachabilityFlagsConnectionOnDemand) != 0 || -#endif - (flags & kSCNetworkReachabilityFlagsConnectionOnTraffic) != 0) - && (flags & kSCNetworkReachabilityFlagsInterventionRequired) == 0) { - // The connection is on-demand or on-traffic and no user intervention is - // needed, likely able to connect - reachable = YES; - } - - if ((flags & kSCNetworkReachabilityFlagsIsWWAN) - == kSCNetworkReachabilityFlagsIsWWAN) { - // WWAN connections are available, likely able to connect barring network - // outage... - reachable = YES; - } - - if (!reachable) { - [self notifyDelegateNotReachable]; - return; - } - - // notify delegate that host just got reachable - if (self.delegate != nil && [self.delegate respondsToSelector: - @selector(reachabilityBecameReachable:)]) { - [self.delegate reachabilityBecameReachable:self]; - } -} - -void reachabilityCallback(SCNetworkReachabilityRef reachability, - SCNetworkReachabilityFlags flags, - void* data) { - AWNetworkReachabilityWrapper *wrapper = (AWNetworkReachabilityWrapper *)data; - [wrapper gotCallback:reachability flags:flags]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkAdapter+Helpers.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkAdapter+Helpers.h deleted file mode 100644 index de690e999..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkAdapter+Helpers.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - - AdWhirlAdNetworkAdapter+Helpers.h - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdNetworkAdapter.h" - -@interface AdWhirlAdNetworkAdapter (Helpers) - -/** - * Subclasses call this to notify delegate that there's going to be a full - * screen modal (usually after tap). - */ -- (void)helperNotifyDelegateOfFullScreenModal; - -/** - * Subclasses call this to notify delegate that the full screen modal has - * been dismissed. - */ -- (void)helperNotifyDelegateOfFullScreenModalDismissal; - -/* - * Subclasses call to get various configs to use, from the AdWhirlDelegate or - * config from server. - */ -- (UIColor *)helperBackgroundColorToUse; -- (UIColor *)helperTextColorToUse; -- (UIColor *)helperSecondaryTextColorToUse; -- (NSInteger)helperCalculateAge; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkAdapter+Helpers.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkAdapter+Helpers.m deleted file mode 100644 index dda958b82..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkAdapter+Helpers.m +++ /dev/null @@ -1,93 +0,0 @@ -/* - - AdWhirlAdNetworkAdapter+Helpers.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdNetworkAdapter+Helpers.h" -#import "AdWhirlView.h" -#import "AdWhirlView+.h" -#import "AdWhirlConfig.h" -#import "AdWhirlAdNetworkConfig.h" - -@implementation AdWhirlAdNetworkAdapter (Helpers) - -- (void)helperNotifyDelegateOfFullScreenModal { - // don't request new ad when modal view is on - adWhirlView.showingModalView = YES; - if ([adWhirlDelegate respondsToSelector:@selector(adWhirlWillPresentFullScreenModal)]) { - [adWhirlDelegate adWhirlWillPresentFullScreenModal]; - } -} - -- (void)helperNotifyDelegateOfFullScreenModalDismissal { - if ([adWhirlDelegate respondsToSelector:@selector(adWhirlDidDismissFullScreenModal)]) { - [adWhirlDelegate adWhirlDidDismissFullScreenModal]; - } - adWhirlView.showingModalView = NO; -} - -- (UIColor *)helperBackgroundColorToUse { - if ([adWhirlDelegate respondsToSelector:@selector(adWhirlAdBackgroundColor)]) { - UIColor *color = [adWhirlDelegate adWhirlAdBackgroundColor]; - if (color != nil) return color; - } - if ([adWhirlDelegate respondsToSelector:@selector(backgroundColor)]) { - UIColor *color = [adWhirlDelegate backgroundColor]; - if (color != nil) return color; - } - return adWhirlConfig.backgroundColor; -} - -- (UIColor *)helperTextColorToUse { - if ([adWhirlDelegate respondsToSelector:@selector(adWhirlTextColor)]) { - UIColor *color = [adWhirlDelegate adWhirlTextColor]; - if (color != nil) return color; - } - if ([adWhirlDelegate respondsToSelector:@selector(textColor)]) { - UIColor *color = [adWhirlDelegate textColor]; - if (color != nil) return color; - } - return adWhirlConfig.textColor; -} - -- (UIColor *)helperSecondaryTextColorToUse { - if ([adWhirlDelegate respondsToSelector:@selector(adWhirlSecondaryTextColor)]) { - UIColor *color = [adWhirlDelegate adWhirlSecondaryTextColor]; - if (color != nil) return color; - } - return nil; -} - -- (NSInteger)helperCalculateAge { - NSDate *birth = [adWhirlDelegate dateOfBirth]; - if (birth == nil) { - return -1; - } - NSDate *today = [[NSDate alloc] init]; - NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; - NSDateComponents *components = [gregorian components:NSYearCalendarUnit - fromDate:birth - toDate:today - options:0]; - NSInteger years = [components year]; - [gregorian release]; - [today release]; - return years; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkAdapter.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkAdapter.m deleted file mode 100644 index 1634bc8b6..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkAdapter.m +++ /dev/null @@ -1,84 +0,0 @@ -/* - - AdWhirlAdNetworkAdapter.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdNetworkAdapter.h" -#import "AdWhirlView.h" -#import "AdWhirlConfig.h" -#import "AdWhirlAdNetworkConfig.h" -#import "AdWhirlLog.h" -#import "AdWhirlAdNetworkRegistry.h" - -@implementation AdWhirlAdNetworkAdapter - -@synthesize adWhirlDelegate; -@synthesize adWhirlView; -@synthesize adWhirlConfig; -@synthesize networkConfig; -@synthesize adNetworkView; - -- (id)initWithAdWhirlDelegate:(id)delegate - view:(AdWhirlView *)view - config:(AdWhirlConfig *)config - networkConfig:(AdWhirlAdNetworkConfig *)netConf { - self = [super init]; - if (self != nil) { - self.adWhirlDelegate = delegate; - self.adWhirlView = view; - self.adWhirlConfig = config; - self.networkConfig = netConf; - } - return self; -} - -- (void)getAd { - AWLogCrit(@"Subclass of AdWhirlAdNetworkAdapter must implement -getAd."); - [self doesNotRecognizeSelector:_cmd]; -} - -- (void)stopBeingDelegate { - AWLogCrit(@"Subclass of AdWhirlAdNetworkAdapter must implement -stopBeingDelegate."); - [self doesNotRecognizeSelector:_cmd]; -} - -- (BOOL)shouldSendExMetric { - return YES; -} - -- (void)rotateToOrientation:(UIInterfaceOrientation)orientation { - // do nothing by default. Subclasses implement specific handling. - AWLogDebug(@"rotate to orientation %d called for adapter %@", - orientation, NSStringFromClass([self class])); -} - -- (BOOL)isBannerAnimationOK:(AWBannerAnimationType)animType { - return YES; -} - -- (void)dealloc { - [self stopBeingDelegate]; - adWhirlDelegate = nil; - adWhirlView = nil; - [adWhirlConfig release], adWhirlConfig = nil; - [networkConfig release], networkConfig = nil; - [adNetworkView release], adNetworkView = nil; - [super dealloc]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkConfig.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkConfig.h deleted file mode 100644 index 5f2c0ddff..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkConfig.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - - AdNetwork.h - - Copyright 2009 AdMob, 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. - -*/ - -#import -#import "AdWhirlDelegateProtocol.h" - -#define AWAdNetworkConfigKeyType @"type" -#define AWAdNetworkConfigKeyNID @"nid" -#define AWAdNetworkConfigKeyName @"nname" -#define AWAdNetworkConfigKeyWeight @"weight" -#define AWAdNetworkConfigKeyPriority @"priority" -#define AWAdNetworkConfigKeyCred @"key" - -@class AdWhirlError; -@class AdWhirlAdNetworkRegistry; - -@interface AdWhirlAdNetworkConfig : NSObject { - NSInteger networkType; - NSString *nid; - NSString *networkName; - double trafficPercentage; - NSInteger priority; - NSDictionary *credentials; - Class adapterClass; -} - -- (id)initWithDictionary:(NSDictionary *)adNetConfigDict - adNetworkRegistry:(AdWhirlAdNetworkRegistry *)registry - error:(AdWhirlError **)error; - -@property (nonatomic,readonly) NSInteger networkType; -@property (nonatomic,readonly) NSString *nid; -@property (nonatomic,readonly) NSString *networkName; -@property (nonatomic,readonly) double trafficPercentage; -@property (nonatomic,readonly) NSInteger priority; -@property (nonatomic,readonly) NSDictionary *credentials; -@property (nonatomic,readonly) NSString *pubId; -@property (nonatomic,readonly) Class adapterClass; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkConfig.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkConfig.m deleted file mode 100644 index cece08ab1..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkConfig.m +++ /dev/null @@ -1,169 +0,0 @@ -/* - - AdNetwork.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdNetworkConfig.h" -#import "AdWhirlConfig.h" -#import "AdWhirlAdNetworkRegistry.h" -#import "AdWhirlLog.h" -#import "AdWhirlError.h" -#import "AdWhirlClassWrapper.h" - -#define kAdWhirlPubIdKey @"pubid" - -@implementation AdWhirlAdNetworkConfig - -@synthesize networkType; -@synthesize nid; -@synthesize networkName; -@synthesize trafficPercentage; -@synthesize priority; -@synthesize credentials; -@synthesize adapterClass; - -- (id)initWithDictionary:(NSDictionary *)adNetConfigDict - adNetworkRegistry:(AdWhirlAdNetworkRegistry *)registry - error:(AdWhirlError **)error { - self = [super init]; - - if (self != nil) { - NSInteger temp; - id ntype = [adNetConfigDict objectForKey:AWAdNetworkConfigKeyType]; - id netId = [adNetConfigDict objectForKey:AWAdNetworkConfigKeyNID]; - id netName = [adNetConfigDict objectForKey:AWAdNetworkConfigKeyName]; - id weight = [adNetConfigDict objectForKey:AWAdNetworkConfigKeyWeight]; - id pri = [adNetConfigDict objectForKey:AWAdNetworkConfigKeyPriority]; - - if (ntype == nil || netId == nil || netName == nil || pri == nil) { - NSString *errorMsg = - @"Ad network config has no network type, network id, network name, or priority"; - if (error != nil) { - *error = [AdWhirlError errorWithCode:AdWhirlConfigDataError - description:errorMsg]; - } - else { - AWLogWarn(errorMsg); - } - - [self release]; - return nil; - } - - if (awIntVal(&temp, ntype)) { - networkType = temp; - } - if ([netId isKindOfClass:[NSString class]]) { - nid = [[NSString alloc] initWithString:netId]; - } - if ([netName isKindOfClass:[NSString class]]) { - networkName = [[NSString alloc] initWithString:netName]; - } - - double tempDouble; - if (weight == nil) { - trafficPercentage = 0.0; - } - else if (awDoubleVal(&tempDouble, weight)) { - trafficPercentage = tempDouble; - } - - if (awIntVal(&temp, pri)) { - priority = temp; - } - - if (networkType == 0 || nid == nil || networkName == nil || priority == 0) { - NSString *errorMsg = - @"Ad network config has invalid network type, network id, network name or priority"; - if (error != nil) { - *error = [AdWhirlError errorWithCode:AdWhirlConfigDataError - description:errorMsg]; - } - else { - AWLogWarn(errorMsg); - } - - [self release]; - return nil; - } - - id cred = [adNetConfigDict objectForKey:AWAdNetworkConfigKeyCred]; - if (cred == nil) { - credentials = nil; - } - else { - if ([cred isKindOfClass:[NSDictionary class]]) { - credentials = [[NSDictionary alloc] initWithDictionary:cred copyItems:YES]; - } - else if ([cred isKindOfClass:[NSString class]]) { - credentials = [[NSDictionary alloc] initWithObjectsAndKeys: - [NSString stringWithString:cred], kAdWhirlPubIdKey, - nil]; - } - } - - adapterClass = [registry adapterClassFor:networkType].theClass; - if (adapterClass == nil) { - NSString *errorMsg = - [NSString stringWithFormat:@"Ad network type %d not supported, no adapter found", - networkType]; - if (error != nil) { - *error = [AdWhirlError errorWithCode:AdWhirlConfigDataError - description:errorMsg]; - } - else { - AWLogWarn(errorMsg); - } - - [self release]; - return nil; - } - } - - return self; -} - -- (NSString *)pubId { - if (credentials == nil) return nil; - return [credentials objectForKey:kAdWhirlPubIdKey]; -} - -- (NSString *)description { - NSString *creds = [self pubId]; - if (creds == nil) { - creds = @"{"; - for (NSString *k in [credentials keyEnumerator]) { - creds = [creds stringByAppendingFormat:@"%@:%@ ", - k, [credentials objectForKey:k]]; - } - creds = [creds stringByAppendingString:@"}"]; - } - return [NSString stringWithFormat: - @"name:%@ type:%d nid:%@ weight:%lf priority:%d creds:%@", - networkName, networkType, nid, trafficPercentage, priority, creds]; -} - -- (void)dealloc { - [nid release], nid = nil; - [networkName release], networkName = nil; - [credentials release], credentials = nil; - - [super dealloc]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkRegistry.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkRegistry.h deleted file mode 100644 index 857714e31..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkRegistry.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - - AdWhirlAdNetworkRegistry.h - - Copyright 2009 AdMob, 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. - -*/ - -#import - -@class AdWhirlAdNetworkAdapter; -@class AdWhirlClassWrapper; - -@interface AdWhirlAdNetworkRegistry : NSObject { - NSMutableDictionary *adapterDict; -} - -+ (AdWhirlAdNetworkRegistry *)sharedRegistry; -- (void)registerClass:(Class)adapterClass; -- (AdWhirlClassWrapper *)adapterClassFor:(NSInteger)adNetworkType; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkRegistry.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkRegistry.m deleted file mode 100644 index a48fab59a..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdNetworkRegistry.m +++ /dev/null @@ -1,64 +0,0 @@ -/* - - AdWhirlAdNetworkRegistry.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdNetworkRegistry.h" -#import "AdWhirlAdNetworkAdapter.h" -#import "AdWhirlClassWrapper.h" - -@implementation AdWhirlAdNetworkRegistry - -+ (AdWhirlAdNetworkRegistry *)sharedRegistry { - static AdWhirlAdNetworkRegistry *registry = nil; - if (registry == nil) { - registry = [[AdWhirlAdNetworkRegistry alloc] init]; - } - return registry; -} - -- (id)init { - self = [super init]; - if (self != nil) { - adapterDict = [[NSMutableDictionary alloc] init]; - } - return self; -} - -- (void)registerClass:(Class)adapterClass { - // have to do all these to avoid compiler warnings... - NSInteger (*netTypeMethod)(id, SEL); - netTypeMethod = (NSInteger (*)(id, SEL))[adapterClass methodForSelector:@selector(networkType)]; - NSInteger netType = netTypeMethod(adapterClass, @selector(networkType)); - NSNumber *key = [[NSNumber alloc] initWithInteger:netType]; - AdWhirlClassWrapper *wrapper = [[AdWhirlClassWrapper alloc] initWithClass:adapterClass]; - [adapterDict setObject:wrapper forKey:key]; - [key release]; - [wrapper release]; -} - -- (AdWhirlClassWrapper *)adapterClassFor:(NSInteger)adNetworkType { - return [adapterDict objectForKey:[NSNumber numberWithInteger:adNetworkType]]; -} - -- (void)dealloc { - [adapterDict release], adapterDict = nil; - [super dealloc]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterCustom.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterCustom.h deleted file mode 100644 index f2922233c..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterCustom.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - - AdWhirlAdapterCustom.h - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdNetworkAdapter.h" -#import "AdWhirlCustomAdView.h" -#import "AdWhirlWebBrowserController.h" - -@interface AdWhirlAdapterCustom : AdWhirlAdNetworkAdapter -{ - BOOL requesting; - CLLocationManager *locationManager; - NSURLConnection *adConnection; - NSMutableData *adData; - NSURLConnection *imageConnection; - NSMutableData *imageData; - AdWhirlCustomAdView *adView; - AdWhirlWebBrowserController *webBrowserController; -} - -+ (AdWhirlAdNetworkType)networkType; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterCustom.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterCustom.m deleted file mode 100644 index 0eda0ad55..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterCustom.m +++ /dev/null @@ -1,423 +0,0 @@ -/* - - AdWhirlAdapterCustom.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdapterCustom.h" -#import "AdWhirlView.h" -#import "AdWhirlLog.h" -#import "AdWhirlConfig.h" -#import "AdWhirlAdNetworkConfig.h" -#import "AdWhirlError.h" -#import "CJSONDeserializer.h" -#import "AdWhirlCustomAdView.h" -#import "AdWhirlAdNetworkAdapter+Helpers.h" -#import "AdWhirlAdNetworkRegistry.h" - -@interface AdWhirlAdapterCustom () - -- (BOOL)parseAdData:(NSData *)data error:(NSError **)error; - -@property (nonatomic,readonly) CLLocationManager *locationManager; -@property (nonatomic,retain) NSURLConnection *adConnection; -@property (nonatomic,retain) NSURLConnection *imageConnection; -@property (nonatomic,retain) AdWhirlCustomAdView *adView; -@property (nonatomic,retain) AdWhirlWebBrowserController *webBrowserController; -@property (nonatomic, assign) CGFloat scale; - -@end - - -@implementation AdWhirlAdapterCustom - -@synthesize adConnection; -@synthesize imageConnection; -@synthesize adView; -@synthesize webBrowserController; -@synthesize scale; - -+ (AdWhirlAdNetworkType)networkType { - return AdWhirlAdNetworkTypeCustom; -} - -+ (void)load { - [[AdWhirlAdNetworkRegistry sharedRegistry] registerClass:self]; -} - -- (id)initWithAdWhirlDelegate:(id)delegate - view:(AdWhirlView *)view - config:(AdWhirlConfig *)config - networkConfig:(AdWhirlAdNetworkConfig *)netConf { - self = [super initWithAdWhirlDelegate:delegate - view:view - config:config - networkConfig:netConf]; - if (self != nil) { - adData = [[NSMutableData alloc] init]; - imageData = [[NSMutableData alloc] init]; - } - return self; -} - -- (BOOL)shouldSendExMetric { - return NO; // since we are getting the ad from the AdWhirl server anyway, no - // need to send extra metric ping to the same server. -} - -- (void)getAd { - @synchronized(self) { - if (requesting) return; - requesting = YES; - } - - NSURL *adRequestBaseURL = nil; - if ([self.adWhirlDelegate respondsToSelector:@selector(adWhirlCustomAdURL)]) { - adRequestBaseURL = [self.adWhirlDelegate adWhirlCustomAdURL]; - } - if (adRequestBaseURL == nil) { - adRequestBaseURL = [NSURL URLWithString:kAdWhirlDefaultCustomAdURL]; - } - NSString *query; - if (self.adWhirlConfig.locationOn) { - AWLogDebug(@"Allow location access in custom ad"); - CLLocation *location; - if ([self.adWhirlDelegate respondsToSelector:@selector(locationInfo)]) { - location = [self.adWhirlDelegate locationInfo]; - } - else { - location = [self.locationManager location]; - } - NSString *locationStr = [NSString stringWithFormat:@"%lf,%lf", - location.coordinate.latitude, - location.coordinate.longitude]; - query = [NSString stringWithFormat:@"?appver=%d&country_code=%@&appid=%@&nid=%@&location=%@&location_timestamp=%lf&client=1", - kAdWhirlAppVer, - [[NSLocale currentLocale] localeIdentifier], - self.adWhirlConfig.appKey, - self.networkConfig.nid, - locationStr, - [[NSDate date] timeIntervalSince1970]]; - } - else { - AWLogDebug(@"Do not allow location access in custom ad"); - query = [NSString stringWithFormat:@"?appver=%d&country_code=%@&appid=%@&nid=%@&client=1", - kAdWhirlAppVer, - [[NSLocale currentLocale] localeIdentifier], - self.adWhirlConfig.appKey, - self.networkConfig.nid]; - } - NSURL *adRequestURL = [NSURL URLWithString:query relativeToURL:adRequestBaseURL]; - AWLogDebug(@"Requesting custom ad at %@", adRequestURL); - NSURLRequest *adRequest = [NSURLRequest requestWithURL:adRequestURL]; - NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:adRequest - delegate:self]; - self.adConnection = conn; - [conn release]; -} - -- (void)stopBeingDelegate { - AdWhirlCustomAdView *theAdView = (AdWhirlCustomAdView *)self.adNetworkView; - if (theAdView != nil) { - theAdView.delegate = nil; - } -} - -- (void)dealloc { - [locationManager release], locationManager = nil; - [adConnection release], adConnection = nil; - [adData release], adData = nil; - [imageConnection release], imageConnection = nil; - [imageData release], imageData = nil; - [adView release], adView = nil; - [webBrowserController release], webBrowserController = nil; - [super dealloc]; -} - - -- (CLLocationManager *)locationManager { - if (locationManager == nil) { - locationManager = [[CLLocationManager alloc] init]; - } - return locationManager; -} - -- (BOOL)parseEnums:(int *)val - adInfo:(NSDictionary*)info - minVal:(int)min - maxVal:(int)max - fieldName:(NSString *)name - error:(NSError **)error { - NSString *str = [info objectForKey:name]; - if (str == nil) { - if (error != nil) - *error = [AdWhirlError errorWithCode:AdWhirlCustomAdDataError - description:[NSString stringWithFormat: - @"Custom ad data has no '%@' field", name]]; - return NO; - } - int intVal = [str intValue]; - if (intVal <= min || intVal >= max) { - if (error != nil) - *error = [AdWhirlError errorWithCode:AdWhirlCustomAdDataError - description:[NSString stringWithFormat: - @"Custom ad: Invalid value for %@ - %d", name, intVal]]; - return NO; - } - *val = intVal; - return YES; -} - -- (BOOL)parseAdData:(NSData *)data error:(NSError **)error { - NSError *jsonError = nil; - id parsed = [[CJSONDeserializer deserializer] deserialize:data error:&jsonError]; - if (parsed == nil) { - if (error != nil) - *error = [AdWhirlError errorWithCode:AdWhirlCustomAdParseError - description:@"Error parsing custom ad JSON from server" - underlyingError:jsonError]; - return NO; - } - if ([parsed isKindOfClass:[NSDictionary class]]) { - NSDictionary *adInfo = parsed; - - // gather up and validate ad info - NSString *text = [adInfo objectForKey:@"ad_text"]; - NSString *redirectURLStr = [adInfo objectForKey:@"redirect_url"]; - - int adTypeInt; - if (![self parseEnums:&adTypeInt - adInfo:adInfo - minVal:AWCustomAdTypeMIN - maxVal:AWCustomAdTypeMAX - fieldName:@"ad_type" - error:error]) { - return NO; - } - AWCustomAdType adType = adTypeInt; - - int launchTypeInt; - if (![self parseEnums:&launchTypeInt - adInfo:adInfo - minVal:AWCustomAdLaunchTypeMIN - maxVal:AWCustomAdLaunchTypeMAX - fieldName:@"launch_type" - error:error]) { - return NO; - } - AWCustomAdLaunchType launchType = launchTypeInt; - - int animTypeInt; - if (![self parseEnums:&animTypeInt - adInfo:adInfo - minVal:AWCustomAdWebViewAnimTypeMIN - maxVal:AWCustomAdWebViewAnimTypeMAX - fieldName:@"webview_animation_type" - error:error]) { - return NO; - } - AWCustomAdWebViewAnimType animType = animTypeInt; - - NSURL *redirectURL = nil; - if (redirectURLStr == nil) { - AWLogWarn(@"No redirect URL for custom ad"); - } - else { - redirectURL = [[NSURL alloc] initWithString:redirectURLStr]; - if (!redirectURL) - AWLogWarn(@"Custom ad: Malformed redirect URL string %@", redirectURLStr); - } - - NSString *clickMetricsURLStr = [adInfo objectForKey:@"metrics_url"]; - NSURL *clickMetricsURL = nil; - if (clickMetricsURLStr == nil) { - AWLogWarn(@"No click metric URL for custom ad"); - } - else { - clickMetricsURL = [[NSURL alloc] initWithString:clickMetricsURLStr]; - if (!clickMetricsURL) - AWLogWarn(@"Malformed click metrics URL string %@", clickMetricsURLStr); - } - - AWLogDebug(@"Got custom ad '%@' %@ %@ %d %d %d", text, redirectURL, - clickMetricsURL, adType, launchType, animType); - - self.adView = [[AdWhirlCustomAdView alloc] initWithDelegate:self - text:text - redirectURL:redirectURL - clickMetricsURL:clickMetricsURL - adType:adType - launchType:launchType - animType:animType - backgroundColor:[self helperBackgroundColorToUse] - textColor:[self helperTextColorToUse]]; - [self.adView release]; - self.adNetworkView = adView; - [redirectURL release]; - [clickMetricsURL release]; - if (adView == nil) { - if (error != nil) - *error = [AdWhirlError errorWithCode:AdWhirlCustomAdDataError - description:@"Error initializing AdWhirl custom ad view"]; - return NO; - } - - // fetch image, set scale - self.scale = [[UIScreen mainScreen] respondsToSelector:@selector(scale)] ? [[UIScreen mainScreen] scale] : 1.0; - NSString *imageURL; - if (self.scale == 2.0 && adType == AWCustomAdTypeBanner) { - imageURL = [adInfo objectForKey:@"img_url_640x100"]; - if (imageURL == nil || [imageURL length] == 0) { - self.scale = 1.0f; - imageURL = [adInfo objectForKey:@"img_url"]; - } - } else { - imageURL = [adInfo objectForKey:@"img_url"]; - } - AWLogDebug(@"Request custom ad image at %@", imageURL); - NSURLRequest *imageRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:imageURL]]; - NSURLConnection *conn = [[NSURLConnection alloc] initWithRequest:imageRequest - delegate:self]; - self.imageConnection = conn; - [conn release]; - } - else { - if (error != nil) - *error = [AdWhirlError errorWithCode:AdWhirlCustomAdDataError - description:@"Expected top-level dictionary in custom ad data"]; - return NO; - } - return YES; -} - - -#pragma mark NSURLConnection delegate methods. - -- (void)connection:(NSURLConnection *)conn didReceiveResponse:(NSURLResponse *)response { - if (conn == adConnection) { - [adData setLength:0]; - } - else if (conn == imageConnection) { - [imageData setLength:0]; - } -} - -- (void)connection:(NSURLConnection *)conn didFailWithError:(NSError *)error { - if (conn == adConnection) { - [self.adWhirlView adapter:self didFailAd:[AdWhirlError errorWithCode:AdWhirlCustomAdConnectionError - description:@"Error connecting to custom ad server" - underlyingError:error]]; - requesting = NO; - } - else if (conn == imageConnection) { - [self.adWhirlView adapter:self didFailAd:[AdWhirlError errorWithCode:AdWhirlCustomAdConnectionError - description:@"Error connecting to custom ad server to fetch image" - underlyingError:error]]; - requesting = NO; - } -} - -- (void)connectionDidFinishLoading:(NSURLConnection *)conn { - if (conn == adConnection) { - NSError *error = nil; - if (![self parseAdData:adData error:&error]) { - [self.adWhirlView adapter:self didFailAd:error]; - requesting = NO; - return; - } - } - else if (conn == imageConnection) { - UIImage *image = [[UIImage alloc] initWithData:imageData]; - if (self.scale == 2.0) { - UIImage *img = [[UIImage alloc] initWithCGImage:image.CGImage scale:2.0 orientation:image.imageOrientation]; - [image release]; - image = img; - } - if (image == nil) { - [self.adWhirlView adapter:self didFailAd:[AdWhirlError errorWithCode:AdWhirlCustomAdImageError - description:@"Cannot initialize custom ad image from data"]]; - requesting = NO; - return; - } - adView.image = image; - [adView setNeedsDisplay]; - [image release]; - requesting = NO; - [self.adWhirlView adapter:self didReceiveAdView:self.adView]; - } -} - -- (void)connection:(NSURLConnection *)conn didReceiveData:(NSData *)data { - if (conn == adConnection) { - [adData appendData:data]; - } - else if (conn == imageConnection) { - [imageData appendData:data]; - } -} - - -#pragma mark AdWhirlCustomAdViewDelegate methods - -- (void)adTapped:(AdWhirlCustomAdView *)ad { - if (ad != adView) return; - if (ad.clickMetricsURL != nil) { - NSURLRequest *metRequest = [NSURLRequest requestWithURL:ad.clickMetricsURL]; - [NSURLConnection connectionWithRequest:metRequest - delegate:nil]; // fire and forget - AWLogDebug(@"Sent custom ad click ping to %@", ad.clickMetricsURL); - } - if (ad.redirectURL == nil) { - AWLogError(@"Custom ad redirect URL is nil"); - return; - } - switch (ad.launchType) { - case AWCustomAdLaunchTypeSafari: - AWLogDebug(@"Opening URL '%@' for custom ad", ad.redirectURL); - if ([[UIApplication sharedApplication] openURL:ad.redirectURL] == NO) { - AWLogError(@"Cannot open URL '%@' for custom ad", ad.redirectURL); - } - break; - case AWCustomAdLaunchTypeCanvas: - if (self.webBrowserController == nil) { - AdWhirlWebBrowserController *ctrlr = [[AdWhirlWebBrowserController alloc] init]; - self.webBrowserController = ctrlr; - [ctrlr release]; - } - webBrowserController.delegate = self; - [webBrowserController presentWithController:[self.adWhirlDelegate viewControllerForPresentingModalView] - transition:ad.animType]; - [self helperNotifyDelegateOfFullScreenModal]; - [webBrowserController loadURL:ad.redirectURL]; - break; - default: - AWLogError(@"Custom ad: Unsupported launch type %d", ad.launchType); - break; - } -} - - -#pragma mark AdWhirlWebBrowserControllerDelegate methods - -- (void)webBrowserClosed:(AdWhirlWebBrowserController *)controller { - if (controller != webBrowserController) return; - self.webBrowserController = nil; // don't keep around to save memory - [self helperNotifyDelegateOfFullScreenModalDismissal]; -} - -@end - diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterEvent.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterEvent.h deleted file mode 100644 index 0960978bd..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterEvent.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - - AdWhirlAdapterEvent.h - - Copyright 2009 AdMob, 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. - - */ - -#import "AdWhirlAdNetworkAdapter.h" - -@interface AdWhirlAdapterEvent : AdWhirlAdNetworkAdapter { - -} - -+ (AdWhirlAdNetworkType)networkType; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterEvent.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterEvent.m deleted file mode 100644 index 4069e77b4..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterEvent.m +++ /dev/null @@ -1,69 +0,0 @@ -/* - - AdWhirlAdapterEvent.m - - Copyright 2009 AdMob, 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. - - */ - -#import "AdWhirlAdapterEvent.h" -#import "AdWhirlView.h" -#import "AdWhirlLog.h" -#import "AdWhirlAdNetworkAdapter+Helpers.h" -#import "AdWhirlAdNetworkRegistry.h" -#import "AdWhirlAdNetworkConfig.h" - -@implementation AdWhirlAdapterEvent - -+ (AdWhirlAdNetworkType)networkType { - return AdWhirlAdNetworkTypeEvent; -} - -+ (void)load { - [[AdWhirlAdNetworkRegistry sharedRegistry] registerClass:self]; -} - -- (void)getAd { - NSArray *eventKeys = [networkConfig.pubId componentsSeparatedByString:@"|;|"]; - NSString *eventSelectorStr = [eventKeys objectAtIndex:1]; - SEL eventSelector = NSSelectorFromString(eventSelectorStr); - - if ([adWhirlDelegate respondsToSelector:eventSelector]) { - [adWhirlDelegate performSelector:eventSelector]; - [adWhirlView adapterDidFinishAdRequest:self]; - } - else { - NSString *eventSelectorColonStr = [NSString stringWithFormat:@"%@:", eventSelectorStr]; - SEL eventSelectorColon = NSSelectorFromString(eventSelectorColonStr); - if ([adWhirlDelegate respondsToSelector:eventSelectorColon]) { - [adWhirlDelegate performSelector:eventSelectorColon withObject:adWhirlView]; - [adWhirlView adapterDidFinishAdRequest:self]; - } - else { - AWLogWarn(@"Delegate does not implement function %@ nor %@", eventSelectorStr, eventSelectorColonStr); - [adWhirlView adapter:self didFailAd:nil]; - } - } -} - -- (void)stopBeingDelegate { - // Nothing to do -} - -- (void)dealloc { - [super dealloc]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterGeneric.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterGeneric.h deleted file mode 100644 index d7dae4d62..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterGeneric.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - - AdWhirlAdapterGeneric.h - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdNetworkAdapter.h" - -@interface AdWhirlAdapterGeneric : AdWhirlAdNetworkAdapter { - -} - -+ (AdWhirlAdNetworkType)networkType; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterGeneric.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterGeneric.m deleted file mode 100644 index 0fffc0166..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlAdapterGeneric.m +++ /dev/null @@ -1,56 +0,0 @@ -/* - - AdWhirlAdapterGeneric.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdapterGeneric.h" -#import "AdWhirlView.h" -#import "AdWhirlLog.h" -#import "AdWhirlAdNetworkAdapter+Helpers.h" -#import "AdWhirlAdNetworkRegistry.h" - -@implementation AdWhirlAdapterGeneric - -+ (AdWhirlAdNetworkType)networkType { - return AdWhirlAdNetworkTypeGeneric; -} - -+ (void)load { - [[AdWhirlAdNetworkRegistry sharedRegistry] registerClass:self]; -} - -- (void)getAd { - if ([adWhirlDelegate respondsToSelector:@selector(adWhirlReceivedRequestForDeveloperToFufill:)]) { - [adWhirlDelegate adWhirlReceivedRequestForDeveloperToFufill:adWhirlView]; - [adWhirlView adapterDidFinishAdRequest:self]; - } - else { - AWLogWarn(@"Delegate does not implement adWhirlReceivedRequestForDeveloperToFufill"); - [adWhirlView adapter:self didFailAd:nil]; - } -} - -- (void)stopBeingDelegate { - // nothing to do -} - -- (void)dealloc { - [super dealloc]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlClassWrapper.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlClassWrapper.h deleted file mode 100644 index d3740a69d..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlClassWrapper.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - - AdWhirlClassWrapper.h - - Copyright 2010 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. - - */ - -#import - -@interface AdWhirlClassWrapper : NSObject { - Class theClass; -} - -- (id)initWithClass:(Class)c; - -@property (nonatomic, readonly) Class theClass; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlClassWrapper.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlClassWrapper.m deleted file mode 100644 index b22822028..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlClassWrapper.m +++ /dev/null @@ -1,35 +0,0 @@ -/* - - AdWhirlClassWrapper.m - - Copyright 2010 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. - - */ - -#import "AdWhirlClassWrapper.h" - -@implementation AdWhirlClassWrapper - -@synthesize theClass; - -- (id)initWithClass:(Class)c { - self = [super init]; - if (self != nil) { - theClass = c; - } - return self; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfig.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfig.h deleted file mode 100644 index 4ddef2ba6..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfig.h +++ /dev/null @@ -1,103 +0,0 @@ -/* - - AdWhirlConfig.h - - Copyright 2009 AdMob, 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. - -*/ - -#import -#import -#import "CJSONDeserializer.h" - -@class AdWhirlConfig; -@protocol AdWhirlConfigDelegate - -@optional -- (void)adWhirlConfigDidReceiveConfig:(AdWhirlConfig *)config; -- (void)adWhirlConfigDidFail:(AdWhirlConfig *)config error:(NSError *)error; -- (NSURL *)adWhirlConfigURL; - -@end - -typedef enum { - AWBannerAnimationTypeNone = 0, - AWBannerAnimationTypeFlipFromLeft = 1, - AWBannerAnimationTypeFlipFromRight = 2, - AWBannerAnimationTypeCurlUp = 3, - AWBannerAnimationTypeCurlDown = 4, - AWBannerAnimationTypeSlideFromLeft = 5, - AWBannerAnimationTypeSlideFromRight = 6, - AWBannerAnimationTypeFadeIn = 7, - AWBannerAnimationTypeRandom = 8, -} AWBannerAnimationType; - -@class AdWhirlAdNetworkConfig; -@class AdWhirlAdNetworkRegistry; - -@interface AdWhirlConfig : NSObject { - NSString *appKey; - NSURL *configURL; - BOOL legacy; - - BOOL adsAreOff; - NSMutableArray *adNetworkConfigs; - - UIColor *backgroundColor; - UIColor *textColor; - NSTimeInterval refreshInterval; - BOOL locationOn; - AWBannerAnimationType bannerAnimationType; - NSInteger fullscreenWaitInterval; - NSInteger fullscreenMaxAds; - - NSMutableArray *delegates; - BOOL hasConfig; - - AdWhirlAdNetworkRegistry *adNetworkRegistry; -} - -- (id)initWithAppKey:(NSString *)ak delegate:(id)delegate; -- (BOOL)parseConfig:(NSData *)data error:(NSError **)error; -- (BOOL)addDelegate:(id)delegate; -- (BOOL)removeDelegate:(id)delegate; -- (void)notifyDelegatesOfFailure:(NSError *)error; - -@property (nonatomic,readonly) NSString *appKey; -@property (nonatomic,readonly) NSURL *configURL; - -@property (nonatomic,readonly) BOOL hasConfig; - -@property (nonatomic,readonly) BOOL adsAreOff; -@property (nonatomic,readonly) NSArray *adNetworkConfigs; -@property (nonatomic,readonly) UIColor *backgroundColor; -@property (nonatomic,readonly) UIColor *textColor; -@property (nonatomic,readonly) NSTimeInterval refreshInterval; -@property (nonatomic,readonly) BOOL locationOn; -@property (nonatomic,readonly) AWBannerAnimationType bannerAnimationType; -@property (nonatomic,readonly) NSInteger fullscreenWaitInterval; -@property (nonatomic,readonly) NSInteger fullscreenMaxAds; - -@property (nonatomic,assign) AdWhirlAdNetworkRegistry *adNetworkRegistry; - -@end - - -// Convenience conversion functions, converts val into native types var. -// val can be NSNumber or NSString, all else will cause function to fail -// On failure, return NO. -BOOL awIntVal(NSInteger *var, id val); -BOOL awFloatVal(CGFloat *var, id val); -BOOL awDoubleVal(double *var, id val); diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfig.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfig.m deleted file mode 100644 index c2fb59d6d..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfig.m +++ /dev/null @@ -1,563 +0,0 @@ -/* - - AdWhirlConfig.m - - Copyright 2009 AdMob, 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. - -*/ - -#import - -#import "AdWhirlConfig.h" -#import "AdWhirlError.h" -#import "AdWhirlAdNetworkConfig.h" -#import "AdWhirlLog.h" -#import "AdWhirlView.h" -#import "AdWhirlAdNetworkAdapter.h" -#import "AdWhirlAdNetworkRegistry.h" -#import "UIColor+AdWhirlConfig.h" -#import "AWNetworkReachabilityWrapper.h" - - -BOOL awIntVal(NSInteger *var, id val) { - if ([val isKindOfClass:[NSNumber class]] || [val isKindOfClass:[NSString class]]) { - *var = [val integerValue]; - return YES; - } - return NO; -} - -BOOL awFloatVal(CGFloat *var, id val) { - if ([val isKindOfClass:[NSNumber class]] || [val isKindOfClass:[NSString class]]) { - *var = [val floatValue]; - return YES; - } - return NO; -} - -BOOL awDoubleVal(double *var, id val) { - if ([val isKindOfClass:[NSNumber class]] || [val isKindOfClass:[NSString class]]) { - *var = [val doubleValue]; - return YES; - } - return NO; -} - - -@implementation AdWhirlConfig - -@synthesize appKey; -@synthesize configURL; -@synthesize adsAreOff; -@synthesize adNetworkConfigs; -@synthesize backgroundColor; -@synthesize textColor; -@synthesize refreshInterval; -@synthesize locationOn; -@synthesize bannerAnimationType; -@synthesize fullscreenWaitInterval; -@synthesize fullscreenMaxAds; -@synthesize hasConfig; - -@synthesize adNetworkRegistry; - -#pragma mark - - -- (id)initWithAppKey:(NSString *)ak delegate:(id)delegate { - self = [super init]; - if (self != nil) { - appKey = [[NSString alloc] initWithString:ak]; - legacy = NO; - adNetworkConfigs = [[NSMutableArray alloc] init]; - delegates = [[NSMutableArray alloc] init]; - hasConfig = NO; - [self addDelegate:delegate]; - - // object dependencies - adNetworkRegistry = [AdWhirlAdNetworkRegistry sharedRegistry]; - - // default values - backgroundColor = [[UIColor alloc] initWithRed:0.3 green:0.3 blue:0.3 alpha:1.0]; - textColor = [[UIColor whiteColor] retain]; - refreshInterval = 60; - locationOn = YES; - bannerAnimationType = AWBannerAnimationTypeRandom; - fullscreenWaitInterval = 60; - fullscreenMaxAds = 2; - - // config URL - NSURL *configBaseURL = nil; - if ([delegate respondsToSelector:@selector(adWhirlConfigURL)]) { - configBaseURL = [delegate adWhirlConfigURL]; - } - if (configBaseURL == nil) { - configBaseURL = [NSURL URLWithString:kAdWhirlDefaultConfigURL]; - } - configURL = [[NSURL alloc] initWithString:[NSString stringWithFormat:@"?appid=%@&appver=%d&client=1", - appKey, - kAdWhirlAppVer] - relativeToURL:configBaseURL]; - } - return self; -} - -- (BOOL)addDelegate:(id)delegate { - for (NSValue *w in delegates) { - id existing = [w nonretainedObjectValue]; - if (existing == delegate) { - return NO; // already in the list of delegates - } - } - NSValue *wrapped = [NSValue valueWithNonretainedObject:delegate]; - [delegates addObject:wrapped]; - return YES; -} - -- (BOOL)removeDelegate:(id)delegate { - NSUInteger i; - for (i = 0; i < [delegates count]; i++) { - NSValue *w = [delegates objectAtIndex:i]; - id existing = [w nonretainedObjectValue]; - if (existing == delegate) { - break; - } - } - if (i < [delegates count]) { - [delegates removeObjectAtIndex:i]; - return YES; - } - return NO; -} - -- (void)notifyDelegatesOfFailure:(NSError *)error { - for (NSValue *wrapped in delegates) { - id delegate = [wrapped nonretainedObjectValue]; - if ([delegate respondsToSelector:@selector(adWhirlConfigDidFail:error:)]) { - [delegate adWhirlConfigDidFail:self error:error]; - } - } -} - -- (NSString *)description { - NSString *desc = [super description]; - NSString *configs = [NSString stringWithFormat: - @"location_access:%d fg_color:%@ bg_color:%@ cycle_time:%lf transition:%d", - locationOn, textColor, backgroundColor, refreshInterval, bannerAnimationType]; - return [NSString stringWithFormat:@"%@:\n%@ networks:%@",desc,configs,adNetworkConfigs]; -} - -- (void)dealloc { - [appKey release], appKey = nil; - [configURL release], configURL = nil; - [adNetworkConfigs release], adNetworkConfigs = nil; - [backgroundColor release], backgroundColor = nil; - [textColor release], textColor = nil; - [delegates release], delegates = nil; - [super dealloc]; -} - -#pragma mark parsing methods - -- (BOOL)parseExtraConfig:(NSDictionary *)configDict error:(NSError **)error { - id bgColor = [configDict objectForKey:@"background_color_rgb"]; - if (bgColor != nil && [bgColor isKindOfClass:[NSDictionary class]]) { - [backgroundColor release]; - backgroundColor = [[UIColor alloc] initWithDict:(NSDictionary *)bgColor]; - } - id txtColor = [configDict objectForKey:@"text_color_rgb"]; - if (txtColor != nil && [txtColor isKindOfClass:[NSDictionary class]]) { - [textColor release]; - textColor = [[UIColor alloc] initWithDict:txtColor]; - } - id tempVal; - tempVal = [configDict objectForKey:@"refresh_interval"]; - if (tempVal == nil) - tempVal = [configDict objectForKey:@"cycle_time"]; - NSInteger tempInt; - if (tempVal && awIntVal(&tempInt, tempVal)) { - refreshInterval = (NSTimeInterval)tempInt; - if (refreshInterval >= 30000.0) { - // effectively forever, set to 0 - refreshInterval = 0.0; - } - } - if (awIntVal(&tempInt, [configDict objectForKey:@"location_on"])) { - locationOn = (tempInt == 0)? NO : YES; - // check user preference. user preference of NO trumps all - - BOOL bLocationServiceEnabled = NO; - if ([CLLocationManager respondsToSelector: - @selector(locationServicesEnabled)]) { - bLocationServiceEnabled = [CLLocationManager locationServicesEnabled]; - } - else { - CLLocationManager* locMan = [[CLLocationManager alloc] init]; - bLocationServiceEnabled = locMan.locationServicesEnabled; - [locMan release], locMan = nil; - } - - if (locationOn == YES && bLocationServiceEnabled == NO) { - AWLogDebug(@"User disabled location services, set locationOn to NO"); - locationOn = NO; - } - } - tempVal = [configDict objectForKey:@"transition"]; - if (tempVal == nil) - tempVal = [configDict objectForKey:@"banner_animation_type"]; - if (tempVal && awIntVal(&tempInt, tempVal)) { - switch (tempInt) { - case 0: bannerAnimationType = AWBannerAnimationTypeNone; break; - case 1: bannerAnimationType = AWBannerAnimationTypeFlipFromLeft; break; - case 2: bannerAnimationType = AWBannerAnimationTypeFlipFromRight; break; - case 3: bannerAnimationType = AWBannerAnimationTypeCurlUp; break; - case 4: bannerAnimationType = AWBannerAnimationTypeCurlDown; break; - case 5: bannerAnimationType = AWBannerAnimationTypeSlideFromLeft; break; - case 6: bannerAnimationType = AWBannerAnimationTypeSlideFromRight; break; - case 7: bannerAnimationType = AWBannerAnimationTypeFadeIn; break; - case 8: bannerAnimationType = AWBannerAnimationTypeRandom; break; - } - } - if (awIntVal(&tempInt, [configDict objectForKey:@"fullscreen_wait_interval"])) { - fullscreenWaitInterval = tempInt; - } - if (awIntVal(&tempInt, [configDict objectForKey:@"fullscreen_max_ads"])) { - fullscreenMaxAds = tempInt; - } - return YES; -} - -- (BOOL)parseLegacyConfig:(NSArray *)configArray error:(NSError **)error { - NSMutableDictionary *adNetConfigDicts = [[NSMutableDictionary alloc] init]; - for (int i = 0; i < [configArray count]; i++) { - id configObj = [configArray objectAtIndex:i]; - if (![configObj isKindOfClass:[NSDictionary class]]) { - if (error != NULL) - *error = [AdWhirlError errorWithCode:AdWhirlConfigDataError - description:@"Expected dictionary in config data"]; - [adNetConfigDicts release]; - return NO; - } - NSDictionary *configDict = (NSDictionary *)configObj; - switch (i) { - case 0: - // ration map - case 1: - // key map - case 2: - // priority map - for (id key in [configDict keyEnumerator]) { - // format: "_" e.g. "admob_ration" - NSString *strKey = (NSString *)key; - if ([strKey compare:@"empty_ration"] == NSOrderedSame) { - NSInteger empty_ration; - if (awIntVal(&empty_ration, [configDict objectForKey:key]) && empty_ration == 100) { - adsAreOff = YES; - [adNetConfigDicts release]; - return YES; - } - } - adsAreOff = NO; - NSRange underScorePos = [strKey rangeOfString:@"_" options:NSBackwardsSearch]; - if (underScorePos.location == NSNotFound) { - if (error != NULL) - *error = [AdWhirlError errorWithCode:AdWhirlConfigDataError - description:[NSString stringWithFormat: - @"Expected underscore delimiter in key '%@'", strKey]]; - [adNetConfigDicts release]; - return NO; - } - NSString *networkName = [strKey substringToIndex:underScorePos.location]; - NSString *valueName = [strKey substringFromIndex:(underScorePos.location+1)]; - if ([networkName length] == 0) { - if (error != NULL) - *error = [AdWhirlError errorWithCode:AdWhirlConfigDataError - description:[NSString stringWithFormat: - @"Empty ad network name in key '%@'", strKey]]; - [adNetConfigDicts release]; - return NO; - } - if ([valueName length] == 0) { - if (error != NULL) - *error = [AdWhirlError errorWithCode:AdWhirlConfigDataError - description:[NSString stringWithFormat: - @"Empty value name in key '%@'", strKey]]; - [adNetConfigDicts release]; - return NO; - } - if ([networkName compare:@"dontcare"] == NSOrderedSame) { - continue; - } - NSMutableDictionary *adNetConfigDict = [adNetConfigDicts objectForKey:networkName]; - if (adNetConfigDict == nil) { - adNetConfigDict = [[NSMutableDictionary alloc] init]; - [adNetConfigDicts setObject:adNetConfigDict forKey:networkName]; - [adNetConfigDict release]; - adNetConfigDict = [adNetConfigDicts objectForKey:networkName]; - } - NSString *properValueName; - if ([valueName compare:@"ration"] == NSOrderedSame) { - properValueName = AWAdNetworkConfigKeyWeight; - } - else if ([valueName compare:@"key"] == NSOrderedSame) { - properValueName = AWAdNetworkConfigKeyCred; - } - else if ([valueName compare:@"priority"] == NSOrderedSame) { - properValueName = AWAdNetworkConfigKeyPriority; - } - else { - properValueName = valueName; - } - [adNetConfigDict setObject:[configDict objectForKey:key] - forKey:properValueName]; - } - break; // ad network config maps - - case 3: - // general config map - if (![self parseExtraConfig:configDict error:error]) { - [adNetConfigDicts release]; - return NO; - } - break; // general config map - default: - AWLogWarn(@"Ignoring element at index %d in legacy config", i); - break; - } // switch (i) - } // loop configArray - - // adwhirl_ special handling - NSMutableDictionary *adRolloConfig = [adNetConfigDicts objectForKey:@"adrollo"]; - if (adRolloConfig != nil) { - AWLogDebug(@"Processing AdRollo config %@", adRolloConfig); - NSMutableArray *adWhirlNetworkConfigs = [[NSMutableArray alloc] init];; - for (NSString *netname in [adNetConfigDicts keyEnumerator]) { - if (![netname hasPrefix:@"adwhirl_"]) continue; - [adWhirlNetworkConfigs addObject:[adNetConfigDicts objectForKey:netname]]; - } - if ([adWhirlNetworkConfigs count] > 0) { - // split the ration evenly, use same credentials - NSInteger ration = [[adRolloConfig objectForKey:AWAdNetworkConfigKeyWeight] integerValue]; - ration = ration/[adWhirlNetworkConfigs count]; - for (NSMutableDictionary *cd in adWhirlNetworkConfigs) { - [cd setObject:[NSNumber numberWithInteger:ration] - forKey:AWAdNetworkConfigKeyWeight]; - [cd setObject:[adRolloConfig objectForKey:AWAdNetworkConfigKeyCred] - forKey:AWAdNetworkConfigKeyCred]; - } - } - [adWhirlNetworkConfigs release]; - } - - NSInteger totalWeight = 0; - for (id networkName in [adNetConfigDicts keyEnumerator]) { - NSString *netname = (NSString *)networkName; - if ([netname compare:@"adrollo"] == NSOrderedSame) { - // skip adrollo, was used for "adwhirl_" networks - continue; - } - NSMutableDictionary *adNetConfigDict = [adNetConfigDicts objectForKey:netname]; - - // set network type for legacy - NSInteger networkType = 0; - if ([netname compare:@"admob"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeAdMob; - } - else if ([netname compare:@"jumptap"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeJumpTap; - } - else if ([netname compare:@"videoegg"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeVideoEgg; - } - else if ([netname compare:@"medialets"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeMedialets; - } - else if ([netname compare:@"liverail"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeLiveRail; - } - else if ([netname compare:@"millennial"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeMillennial; - } - else if ([netname compare:@"greystripe"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeGreyStripe; - } - else if ([netname compare:@"quattro"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeQuattro; - } - else if ([netname compare:@"custom"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeCustom; - } - else if ([netname compare:@"adwhirl_10"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeAdWhirl10; - } - else if ([netname compare:@"mobclix"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeMobClix; - } - else if ([netname compare:@"adwhirl_12"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeMdotM; - } - else if ([netname compare:@"adwhirl_13"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeAdWhirl13; - } - else if ([netname compare:@"google_adsense"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeGoogleAdSense; - } - else if ([netname compare:@"google_doubleclick"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeGoogleDoubleClick; - } - else if ([netname compare:@"generic"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeGeneric; - } - else if ([netname compare:@"inmobi"] == NSOrderedSame) { - networkType = AdWhirlAdNetworkTypeInMobi; - } - - else { - AWLogWarn(@"Unrecognized ad network '%@' in legacy config, ignored", netname); - continue; - } - - [adNetConfigDict setObject:netname forKey:AWAdNetworkConfigKeyName]; - [adNetConfigDict setObject:[NSString stringWithFormat:@"%d", networkType] - forKey:AWAdNetworkConfigKeyNID]; - [adNetConfigDict setObject:[NSNumber numberWithInteger:networkType] - forKey:AWAdNetworkConfigKeyType]; - - AdWhirlError *adNetConfigError = nil; - AdWhirlAdNetworkConfig *adNetConfig = - [[AdWhirlAdNetworkConfig alloc] initWithDictionary:adNetConfigDict - adNetworkRegistry:adNetworkRegistry - error:&adNetConfigError]; - if (adNetConfig != nil) { - [adNetworkConfigs addObject:adNetConfig]; - totalWeight += adNetConfig.trafficPercentage; - [adNetConfig release]; - } - else { - AWLogWarn(@"Cannot create ad network config from %@: %@", adNetConfigDict, - adNetConfigError != nil? [adNetConfigError localizedDescription]:@""); - } - } // for each ad network name - - if (totalWeight == 0) { - adsAreOff = YES; - } - - [adNetConfigDicts release]; - return YES; -} - -- (BOOL)parseNewConfig:(NSDictionary *)configDict error:(NSError **)error { - id extra = [configDict objectForKey:@"extra"]; - if (extra != nil && [extra isKindOfClass:[NSDictionary class]]) { - NSDictionary *extraDict = extra; - if (![self parseExtraConfig:extraDict error:error]) { - return NO; - } - } - else { - AWLogWarn(@"No extra info dict in ad network config"); - } - - id rations = [configDict objectForKey:@"rations"]; - double totalWeight = 0.0; - if (rations != nil && [rations isKindOfClass:[NSArray class]]) { - if ([(NSArray *)rations count] == 0) { - adsAreOff = YES; - return YES; - } - adsAreOff = NO; - for (id c in (NSArray *)rations) { - if (![c isKindOfClass:[NSDictionary class]]) { - AWLogWarn(@"Element in rations array is not a dictionary %@ in ad network config",c); - continue; - } - AdWhirlError *adNetConfigError = nil; - AdWhirlAdNetworkConfig *adNetConfig = - [[AdWhirlAdNetworkConfig alloc] initWithDictionary:(NSDictionary *)c - adNetworkRegistry:adNetworkRegistry - error:&adNetConfigError]; - if (adNetConfig != nil) { - [adNetworkConfigs addObject:adNetConfig]; - totalWeight += adNetConfig.trafficPercentage; - [adNetConfig release]; - } - else { - AWLogWarn(@"Cannot create ad network config from %@: %@", c, - adNetConfigError != nil? [adNetConfigError localizedDescription]:@""); - } - } - } - else { - AWLogError(@"No rations array in ad network config"); - } - - if (totalWeight == 0.0) { - adsAreOff = YES; - } - - return YES; -} - -- (BOOL)parseConfig:(NSData *)data error:(NSError **)error { - if (hasConfig) { - if (error != NULL) - *error = [AdWhirlError errorWithCode:AdWhirlConfigDataError - description:@"Already has config, will not parse"]; - return NO; - } - NSError *jsonError = nil; - id parsed = [[CJSONDeserializer deserializer] deserialize:data error:&jsonError]; - if (parsed == nil) { - if (error != NULL) - *error = [AdWhirlError errorWithCode:AdWhirlConfigParseError - description:@"Error parsing config JSON from server" - underlyingError:jsonError]; - return NO; - } - if ([parsed isKindOfClass:[NSArray class]]) { - // pre-open-source AdWhirl/AdRollo config - legacy = YES; - if (![self parseLegacyConfig:(NSArray *)parsed error:error]) { - return NO; - } - } - else if ([parsed isKindOfClass:[NSDictionary class]]) { - // open-source AdWhirl config - if (![self parseNewConfig:(NSDictionary *)parsed error:error]) { - return NO; - } - } - else { - if (error != NULL) - *error = [AdWhirlError errorWithCode:AdWhirlConfigDataError - description:@"Expected top-level dictionary in config data"]; - return NO; - } - - // parse success - hasConfig = YES; - - // notify delegates of success - for (NSValue *wrapped in delegates) { - id delegate = [wrapped nonretainedObjectValue]; - if ([delegate respondsToSelector:@selector(adWhirlConfigDidReceiveConfig:)]) { - [delegate adWhirlConfigDidReceiveConfig:self]; - } - } - - return YES; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfigStore.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfigStore.h deleted file mode 100644 index a2094090e..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfigStore.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - - AdWhirlConfigStore.h - - Copyright 2010 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. - - */ - -#import -#import "AdWhirlConfigStore.h" -#import "AdWhirlConfig.h" -#import "AWNetworkReachabilityDelegate.h" - -@class AWNetworkReachabilityWrapper; - -// Singleton class to store AdWhirl configs, keyed by appKey. Fetched config -// is cached unless it is force-fetched using fetchConfig. Checks network -// reachability using AWNetworkReachabilityWrapper before making connections to -// fetch configs, so that that means it will wait forever until the config host -// is reachable. -@interface AdWhirlConfigStore : NSObject { - NSMutableDictionary *configs_; - AdWhirlConfig *fetchingConfig_; - - AWNetworkReachabilityWrapper *reachability_; - NSURLConnection *connection_; - NSMutableData *receivedData_; -} - -// Returns the singleton AdWhirlConfigStore object. -+ (AdWhirlConfigStore *)sharedStore; - -// Deletes all existing configs. -+ (void)resetStore; - -// Returns config for appKey. If config does not exist for appKey, goes and -// fetches the config from the server, the URL of which is taken from -// [delegate adWhirlConfigURL]. -// Returns nil if appKey is nil or empty, another fetch is in progress, or -// error setting up reachability check. -- (AdWhirlConfig *)getConfig:(NSString *)appKey - delegate:(id)delegate; - -// Fetches (or re-fetch) the config for the given appKey. Always go to the -// network. Call this to get a new version of the config from the server. -// Returns nil if appKey is nil or empty, another fetch is in progress, or -// error setting up reachability check. -- (AdWhirlConfig *)fetchConfig:(NSString *)appKey - delegate:(id )delegate; - -// For testing -- set mocks here. -@property (nonatomic,retain) AWNetworkReachabilityWrapper *reachability; -@property (nonatomic,retain) NSURLConnection *connection; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfigStore.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfigStore.m deleted file mode 100644 index f1eff12ec..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlConfigStore.m +++ /dev/null @@ -1,291 +0,0 @@ -/* - - AdWhirlConfigStore.m - - Copyright 2010 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. - - */ - -#import "AdWhirlConfigStore.h" -#import "AdWhirlLog.h" -#import "AWNetworkReachabilityWrapper.h" -#import "AdWhirlError.h" - -static AdWhirlConfigStore *gStore = nil; - -@interface AdWhirlConfigStore () - -- (BOOL)checkReachability; -- (void)startFetchingAssumingReachable; -- (void)failedFetchingWithError:(AdWhirlError *)error; -- (void)finishedFetching; - -@end - - -@implementation AdWhirlConfigStore - -@synthesize reachability = reachability_; -@synthesize connection = connection_; - -+ (AdWhirlConfigStore *)sharedStore { - if (gStore == nil) { - gStore = [[AdWhirlConfigStore alloc] init]; - } - return gStore; -} - -+ (void)resetStore { - if (gStore != nil) { - [gStore release], gStore = nil; - [self sharedStore]; - } -} - -- (id)init { - self = [super init]; - if (self != nil) { - configs_ = [[NSMutableDictionary alloc] init]; - } - return self; -} - -- (AdWhirlConfig *)getConfig:(NSString *)appKey - delegate:(id)delegate { - AdWhirlConfig *config = [configs_ objectForKey:appKey]; - if (config != nil) { - if (config.hasConfig) { - if ([delegate - respondsToSelector:@selector(adWhirlConfigDidReceiveConfig:)]) { - // Don't call directly, instead schedule it in the runloop. Delegate - // may expect the message to be delivered out-of-band - [(NSObject *)delegate - performSelectorOnMainThread:@selector(adWhirlConfigDidReceiveConfig:) - withObject:config - waitUntilDone:NO]; - } - return config; - } - // If there's already a config fetching, and another call to this function - // add a delegate to the config - [config addDelegate:delegate]; - return config; - } - - // No config, create one, and start fetching it - return [self fetchConfig:appKey delegate:delegate]; -} - -- (AdWhirlConfig *)fetchConfig:(NSString *)appKey - delegate:(id )delegate { - - AdWhirlConfig *config = [[AdWhirlConfig alloc] initWithAppKey:appKey - delegate:delegate]; - - if (fetchingConfig_ != nil) { - AWLogWarn(@"Another fetch is in progress, wait until finished."); - [config release]; - return nil; - } - fetchingConfig_ = config; - - if (![self checkReachability]) { - [config release]; - return nil; - } - - [configs_ setObject:config forKey:appKey]; - [config release]; - return config; -} - -- (void)dealloc { - if (reachability_ != nil) { - reachability_.delegate = nil; - [reachability_ release]; - } - [connection_ release]; - [receivedData_ release]; - [configs_ release]; - [super dealloc]; -} - - -#pragma mark private helper methods - -// Check reachability first -- (BOOL)checkReachability { - AWLogDebug(@"Checking if config is reachable at %@", - fetchingConfig_.configURL); - - // Normally reachability_ should be nil so a new one will be created. - // In a testing environment, it may already have been assigned with a mock. - // In any case, reachability_ will be released when the config URL is - // reachable, in -reachabilityBecameReachable. - if (reachability_ == nil) { - reachability_ = [AWNetworkReachabilityWrapper - reachabilityWithHostname:[fetchingConfig_.configURL host] - callbackDelegate:self]; - [reachability_ retain]; - } - if (reachability_ == nil) { - [fetchingConfig_ notifyDelegatesOfFailure: - [AdWhirlError errorWithCode:AdWhirlConfigConnectionError - description: - @"Error setting up reachability check to config server"]]; - return NO; - } - - if (![reachability_ scheduleInCurrentRunLoop]) { - [fetchingConfig_ notifyDelegatesOfFailure: - [AdWhirlError errorWithCode:AdWhirlConfigConnectionError - description: - @"Error scheduling reachability check to config server"]]; - [reachability_ release], reachability_ = nil; - return NO; - } - - return YES; -} - -// Make connection -- (void)startFetchingAssumingReachable { - // go fetch config - NSURLRequest *configRequest - = [NSURLRequest requestWithURL:fetchingConfig_.configURL]; - - // Normally connection_ should be nil so a new one will be created. - // In a testing environment, it may alreay have been assigned with a mock. - // In any case, connection_ will be release when connection failed or - // finished. - if (connection_ == nil) { - connection_ = [[NSURLConnection alloc] initWithRequest:configRequest - delegate:self]; - } - - // Error checking - if (connection_ == nil) { - [self failedFetchingWithError: - [AdWhirlError errorWithCode:AdWhirlConfigConnectionError - description: - @"Error creating connection to config server"]]; - return; - } - receivedData_ = [[NSMutableData alloc] init]; -} - -// Clean up after fetching failed -- (void)failedFetchingWithError:(AdWhirlError *)error { - // notify - [fetchingConfig_ notifyDelegatesOfFailure:error]; - - // remove the failed config from the cache - [configs_ removeObjectForKey:fetchingConfig_.appKey]; - // the config is only retained by the dict,now released - - [self finishedFetching]; -} - -// Clean up after fetching, success or failed -- (void)finishedFetching { - [connection_ release], connection_ = nil; - [receivedData_ release], receivedData_ = nil; - fetchingConfig_ = nil; -} - - -#pragma mark reachability methods - -- (void)reachabilityNotReachable:(AWNetworkReachabilityWrapper *)reach { - if (reach != reachability_) { - AWLogWarn(@"Unrecognized reachability object called not reachable %s:%d", - __FILE__, __LINE__); - return; - } - AWLogDebug(@"Config host %@ not (yet) reachable, check back later", - reach.hostname); - [reachability_ release], reachability_ = nil; - [self performSelector:@selector(checkReachability) - withObject:nil - afterDelay:10.0]; -} - -- (void)reachabilityBecameReachable:(AWNetworkReachabilityWrapper *)reach { - if (reach != reachability_) { - AWLogWarn(@"Unrecognized reachability object called reachable %s:%d", - __FILE__, __LINE__); - return; - } - // done with the reachability - [reachability_ release], reachability_ = nil; - - [self startFetchingAssumingReachable]; -} - - -#pragma mark NSURLConnection delegate methods. - -- (void)connection:(NSURLConnection *)conn - didReceiveResponse:(NSURLResponse *)response { - if (conn != connection_) { - AWLogError(@"Unrecognized connection object %s:%d", __FILE__, __LINE__); - return; - } - if ([response isKindOfClass:[NSHTTPURLResponse class]]) { - NSHTTPURLResponse *http = (NSHTTPURLResponse*)response; - const int status = [http statusCode]; - - if (status < 200 || status >= 300) { - AWLogWarn(@"AdWhirlConfig: HTTP %d, cancelling %@", status, [http URL]); - [connection_ cancel]; - [self failedFetchingWithError: - [AdWhirlError errorWithCode:AdWhirlConfigStatusError - description:@"Config server did not return status 200"]]; - return; - } - } - - [receivedData_ setLength:0]; -} - -- (void)connection:(NSURLConnection *)conn didFailWithError:(NSError *)error { - if (conn != connection_) { - AWLogError(@"Unrecognized connection object %s:%d", __FILE__, __LINE__); - return; - } - [self failedFetchingWithError: - [AdWhirlError errorWithCode:AdWhirlConfigConnectionError - description:@"Error connecting to config server" - underlyingError:error]]; -} - -- (void)connectionDidFinishLoading:(NSURLConnection *)conn { - if (conn != connection_) { - AWLogError(@"Unrecognized connection object %s:%d", __FILE__, __LINE__); - return; - } - [fetchingConfig_ parseConfig:receivedData_ error:nil]; - [self finishedFetching]; -} - -- (void)connection:(NSURLConnection *)conn didReceiveData:(NSData *)data { - if (conn != connection_) { - AWLogError(@"Unrecognized connection object %s:%d", __FILE__, __LINE__); - return; - } - [receivedData_ appendData:data]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlCustomAdView.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlCustomAdView.h deleted file mode 100644 index 03dce95b7..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlCustomAdView.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - - AdWhirlCustomAdView.h - - Copyright 2009 AdMob, 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. - -*/ - -#import -#import - -typedef enum { - AWCustomAdTypeMIN = 0, - AWCustomAdTypeBanner = 1, - AWCustomAdTypeText = 2, - AWCustomAdTypeAutoLaunchFallBackBanner = 3, - AWCustomAdTypeAutoLaunchFallBackText = 4, - AWCustomAdTypeSearchBar = 5, - AWCustomAdTypeMAX = 6 -} AWCustomAdType; - -typedef enum { - AWCustomAdLaunchTypeMIN = 0, - AWCustomAdLaunchTypeSafari = 1, - AWCustomAdLaunchTypeCanvas = 2, - AWCustomAdLaunchTypeSafariRedirectFollowThrough = 3, - AWCustomAdLaunchTypeMAX = 4 -} AWCustomAdLaunchType; - -typedef enum { - AWCustomAdWebViewAnimTypeMIN = -1, - AWCustomAdWebViewAnimTypeNone = 0, - AWCustomAdWebViewAnimTypeFlipFromLeft = 1, - AWCustomAdWebViewAnimTypeFlipFromRight = 2, - AWCustomAdWebViewAnimTypeCurlUp = 3, - AWCustomAdWebViewAnimTypeCurlDown = 4, - AWCustomAdWebViewAnimTypeSlideFromLeft = 5, - AWCustomAdWebViewAnimTypeSlideFromRight = 6, - AWCustomAdWebViewAnimTypeFadeIn = 7, - AWCustomAdWebViewAnimTypeModal = 8, - AWCustomAdWebViewAnimTypeRandom = 9, - AWCustomAdWebViewAnimTypeMAX = 10 -} AWCustomAdWebViewAnimType; - -@class AdWhirlCustomAdView; - -@protocol AdWhirlCustomAdViewDelegate - -- (void)adTapped:(AdWhirlCustomAdView *)adView; - -@end - - -@interface AdWhirlCustomAdView : UIButton -{ - id delegate; - UIImage *image; - UILabel *textLabel; - NSURL *redirectURL; - NSURL *clickMetricsURL; - AWCustomAdType adType; - AWCustomAdLaunchType launchType; - AWCustomAdWebViewAnimType animType; - UIColor *backgroundColor; - UIColor *textColor; -} - -- (id)initWithDelegate:(id)delegate - text:(NSString *)text - redirectURL:(NSURL *)redirectURL - clickMetricsURL:(NSURL *)clickMetricsURL - adType:(AWCustomAdType)adType - launchType:(AWCustomAdLaunchType)launchType - animType:(AWCustomAdWebViewAnimType)animType - backgroundColor:(UIColor *)bgColor - textColor:(UIColor *)fgColor; - -@property (nonatomic,assign) id delegate; -@property (nonatomic,retain) UIImage *image; -@property (nonatomic,readonly) UILabel *textLabel; -@property (nonatomic,readonly) NSURL *redirectURL; -@property (nonatomic,readonly) NSURL *clickMetricsURL; -@property (nonatomic,readonly) AWCustomAdType adType; -@property (nonatomic,readonly) AWCustomAdLaunchType launchType; -@property (nonatomic,readonly) AWCustomAdWebViewAnimType animType; -@property (nonatomic,readonly) UIColor *backgroundColor; -@property (nonatomic,readonly) UIColor *textColor; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlCustomAdView.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlCustomAdView.m deleted file mode 100644 index 711ebd65d..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlCustomAdView.m +++ /dev/null @@ -1,168 +0,0 @@ -/* - - AdWhirlCustomAdView.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlCustomAdView.h" -#import "AdWhirlView.h" -#import "AdWhirlLog.h" - - -@implementation AdWhirlCustomAdView - -@synthesize delegate; -@synthesize image; -@synthesize textLabel; -@synthesize redirectURL; -@synthesize clickMetricsURL; -@synthesize adType; -@synthesize launchType; -@synthesize animType; -@synthesize backgroundColor; -@synthesize textColor; - -- (id)initWithDelegate:(id)d - text:(NSString *)txt - redirectURL:(NSURL *)rURL - clickMetricsURL:(NSURL *)cURL - adType:(AWCustomAdType)aType - launchType:(AWCustomAdLaunchType)launch - animType:(AWCustomAdWebViewAnimType)anim - backgroundColor:(UIColor *)bgColor - textColor:(UIColor *)fgColor { - - self = [super initWithFrame:kAdWhirlViewDefaultFrame]; - if (self != nil) { - delegate = d; - redirectURL = [rURL retain]; - clickMetricsURL = [cURL retain]; - adType = aType; - launchType = launch; - animType = anim; - backgroundColor = [bgColor retain]; - textColor = [fgColor retain]; - - if (adType == AWCustomAdTypeText) { - textLabel = [[UILabel alloc] initWithFrame:CGRectMake(50, 0, 270, CGRectGetHeight(self.bounds))]; - textLabel.text = txt; - textLabel.textColor = fgColor; - textLabel.numberOfLines = 3; - textLabel.backgroundColor = [UIColor clearColor]; - textLabel.font = [UIFont fontWithName:@"TrebuchetMS-Bold" size:13.0]; - [self addSubview:textLabel]; - } - - UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; - button.frame = self.bounds; - button.showsTouchWhenHighlighted = YES; - [button addTarget:self action:@selector(buttonTapUp:) forControlEvents:UIControlEventTouchUpInside]; - [self addSubview:button]; - } - return self; -} - -#define kNumBgColors 3 -#define kImageLeft 4 -#define kCornerRadius 7.0 -#define kImageDim 39 // assume square, so this is length of each side -#define kChamferLight [UIColor colorWithWhite:0.9 alpha:1].CGColor -#define kChamferDark [UIColor colorWithWhite:0.4 alpha:1].CGColor - -- (void)drawRect:(CGRect)rect { - - CGContextRef ctx = UIGraphicsGetCurrentContext(); - if (adType == AWCustomAdTypeText) { - - // draw background - CGFloat locations[kNumBgColors] = {0.0, 0.7, 1.0}; - CGColorRef colorArray[kNumBgColors] = - {[backgroundColor colorWithAlphaComponent:0.6].CGColor, - backgroundColor.CGColor, - backgroundColor.CGColor}; - CFArrayRef colors = CFArrayCreate(kCFAllocatorDefault, - (const void **)colorArray, - kNumBgColors, - &kCFTypeArrayCallBacks); - CGGradientRef gradient = CGGradientCreateWithColors(NULL, colors, locations); - CFRelease(colors); - CGContextSetFillColorWithColor(ctx, [UIColor whiteColor].CGColor); - CGContextFillRect(ctx, CGRectMake(0, 0, CGRectGetWidth(self.bounds), CGRectGetHeight(self.bounds))); - CGPoint midY = CGPointMake(0.0, CGRectGetHeight(self.bounds)/2); - CGPoint lowY = CGPointMake(0.0, CGRectGetHeight(self.bounds)); - CGContextDrawLinearGradient(ctx, gradient, CGPointZero, midY, 0); - CGContextDrawLinearGradient(ctx, gradient, lowY, midY, 0); - CGGradientRelease(gradient); - - // draw image and chamfer - CGFloat imageTop = (CGRectGetHeight(self.bounds) - kImageDim)/2.0; - CGPoint tl = CGPointMake(kImageLeft+kCornerRadius, imageTop+kCornerRadius); - CGPoint tr = CGPointMake(kImageLeft+kImageDim-kCornerRadius, imageTop+kCornerRadius); - CGPoint br = CGPointMake(kImageLeft+kImageDim-kCornerRadius, imageTop+kImageDim-kCornerRadius); - CGPoint bl = CGPointMake(kImageLeft+kCornerRadius, imageTop+kImageDim-kCornerRadius); - CGContextSaveGState(ctx); - CGContextMoveToPoint(ctx, kImageLeft, imageTop+kCornerRadius); - CGContextAddArc(ctx, tl.x, tl.y, kCornerRadius, M_PI, 3*M_PI/2, 0); - CGContextAddArc(ctx, tr.x, tr.y, kCornerRadius, 3*M_PI/2, 0, 0); - CGContextAddArc(ctx, br.x, br.y, kCornerRadius, 0, M_PI/2, 0); - CGContextAddArc(ctx, bl.x, bl.y, kCornerRadius, M_PI/2, M_PI, 0); - CGContextClosePath(ctx); - CGContextClip(ctx); - [image drawAtPoint:CGPointMake(kImageLeft, imageTop)]; - CGContextSetLineWidth(ctx, 0.5); - CGContextMoveToPoint(ctx, kImageLeft, imageTop+kImageDim-kCornerRadius); - CGContextSetStrokeColorWithColor(ctx, kChamferDark); - CGContextAddArc(ctx, tl.x, tl.y, kCornerRadius, M_PI, 5*M_PI/4, 0); - CGContextStrokePath(ctx); - CGContextSetStrokeColorWithColor(ctx, kChamferLight); - CGContextAddArc(ctx, tl.x, tl.y, kCornerRadius, 5*M_PI/4, 3*M_PI/2, 0); - CGContextAddArc(ctx, tr.x, tr.y, kCornerRadius, 3*M_PI/2, 0, 0); - CGContextAddArc(ctx, br.x, br.y, kCornerRadius, 0, M_PI/4, 0); - CGContextStrokePath(ctx); - CGContextSetStrokeColorWithColor(ctx, kChamferDark); - CGContextAddArc(ctx, br.x, br.y, kCornerRadius, M_PI/4, M_PI/2, 0); - CGContextAddArc(ctx, bl.x, bl.y, kCornerRadius, M_PI/2, M_PI, 0); - CGContextStrokePath(ctx); - CGContextRestoreGState(ctx); - - } // text ad - else if (adType == AWCustomAdTypeBanner) { - // draw image, place image in center of frame - [image drawAtPoint:CGPointMake((self.frame.size.width-image.size.width)/2, - (self.frame.size.height-image.size.height)/2)]; - } // banner ad -} - -- (void)dealloc { - [image release], image = nil; - [textLabel release], textLabel = nil; - [redirectURL release], redirectURL = nil; - [clickMetricsURL release], clickMetricsURL = nil; - [backgroundColor release], backgroundColor = nil; - [textColor release], textColor = nil; - [super dealloc]; -} - -#pragma mark UIButton control events - -- (void)buttonTapUp:(id)sender { - if (delegate != nil) { - [delegate adTapped:self]; - } -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlError.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlError.h deleted file mode 100644 index fcf4b27ec..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlError.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - - AdWhirlError.h - - Copyright 2009 AdMob, 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. - -*/ - -#import - -#define AdWhirlErrorDomain @"com.adwhirl.sdk.ErrorDomain" - -enum { - AdWhirlConfigConnectionError = 10, /* Cannot connect to config server */ - AdWhirlConfigStatusError = 11, /* config server did not return 200 */ - AdWhirlConfigParseError = 20, /* Error parsing config from server */ - AdWhirlConfigDataError = 30, /* Invalid config format from server */ - AdWhirlCustomAdConnectionError = 40, /* Cannot connect to custom ad server */ - AdWhirlCustomAdParseError = 50, /* Error parsing custom ad from server */ - AdWhirlCustomAdDataError = 60, /* Invalid custom ad data from server */ - AdWhirlCustomAdImageError = 70, /* Cannot create image from data */ - AdWhirlAdRequestIgnoredError = 80, /* ignoreNewAdRequests flag is set */ - AdWhirlAdRequestInProgressError = 90, /* ad request in progress */ - AdWhirlAdRequestNoConfigError = 100, /* no configurations for ad request */ - AdWhirlAdRequestTooSoonError = 110, /* requesting ad too soon */ - AdWhirlAdRequestNoMoreAdNetworks = 120, /* no more ad networks for rollover */ - AdWhirlAdRequestNoNetworkError = 130, /* no network connection */ - AdWhirlAdRequestModalActiveError = 140 /* modal view active */ -}; - -@interface AdWhirlError : NSError { - -} - -+ (AdWhirlError *)errorWithCode:(NSInteger)code userInfo:(NSDictionary *)dict; -+ (AdWhirlError *)errorWithCode:(NSInteger)code description:(NSString *)desc; -+ (AdWhirlError *)errorWithCode:(NSInteger)code description:(NSString *)desc underlyingError:(NSError *)uError; - -- (id)initWithCode:(NSInteger)code userInfo:(NSDictionary *)dict; -- (id)initWithCode:(NSInteger)code description:(NSString *)desc; -- (id)initWithCode:(NSInteger)code description:(NSString *)desc underlyingError:(NSError *)uError; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlError.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlError.m deleted file mode 100644 index 0cca4c296..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlError.m +++ /dev/null @@ -1,56 +0,0 @@ -/* - - AdWhirlError.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlError.h" - -@implementation AdWhirlError - -+ (AdWhirlError *)errorWithCode:(NSInteger)code userInfo:(NSDictionary *)dict { - return [[[AdWhirlError alloc] initWithCode:code userInfo:dict] autorelease]; -} - -+ (AdWhirlError *)errorWithCode:(NSInteger)code description:(NSString *)desc { - return [[[AdWhirlError alloc] initWithCode:code description:desc] autorelease]; -} - -+ (AdWhirlError *)errorWithCode:(NSInteger)code description:(NSString *)desc underlyingError:(NSError *)uError { - return [[[AdWhirlError alloc] initWithCode:code description:desc underlyingError:uError] autorelease]; -} - -- (id)initWithCode:(NSInteger)code userInfo:(NSDictionary *)dict { - return [super initWithDomain:AdWhirlErrorDomain code:code userInfo:dict]; -} - -- (id)initWithCode:(NSInteger)code description:(NSString *)desc { - NSDictionary *eInfo = [NSDictionary dictionaryWithObjectsAndKeys: - desc, NSLocalizedDescriptionKey, - nil]; - return [super initWithDomain:AdWhirlErrorDomain code:code userInfo:eInfo]; -} - -- (id)initWithCode:(NSInteger)code description:(NSString *)desc underlyingError:(NSError *)uError { - NSDictionary *eInfo = [NSDictionary dictionaryWithObjectsAndKeys: - desc, NSLocalizedDescriptionKey, - uError, NSUnderlyingErrorKey, - nil]; - return [super initWithDomain:AdWhirlErrorDomain code:code userInfo:eInfo]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlLog.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlLog.h deleted file mode 100644 index be1996dd4..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlLog.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - - AdWhirlLog.h - - Copyright 2009 AdMob, 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. - -*/ - -#import - -typedef enum { - AWLogLevelNone = 0, - AWLogLevelCrit = 10, - AWLogLevelError = 20, - AWLogLevelWarn = 30, - AWLogLevelInfo = 40, - AWLogLevelDebug = 50 -} AWLogLevel; - -void AWLogSetLogLevel(AWLogLevel level); - -// The actual function name has an underscore prefix, just so we can -// hijack AWLog* with other functions for testing, by defining -// preprocessor macros -void _AWLogCrit(NSString *format, ...); -void _AWLogError(NSString *format, ...); -void _AWLogWarn(NSString *format, ...); -void _AWLogInfo(NSString *format, ...); -void _AWLogDebug(NSString *format, ...); - -#ifndef AWLogCrit -#define AWLogCrit(...) _AWLogCrit(__VA_ARGS__) -#endif - -#ifndef AWLogError -#define AWLogError(...) _AWLogError(__VA_ARGS__) -#endif - -#ifndef AWLogWarn -#define AWLogWarn(...) _AWLogWarn(__VA_ARGS__) -#endif - -#ifndef AWLogInfo -#define AWLogInfo(...) _AWLogInfo(__VA_ARGS__) -#endif - -#ifndef AWLogDebug -#define AWLogDebug(...) _AWLogDebug(__VA_ARGS__) -#endif diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlLog.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlLog.m deleted file mode 100644 index c62ec9159..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlLog.m +++ /dev/null @@ -1,67 +0,0 @@ -/* - - AdWhirlLog.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlLog.h" - -static AWLogLevel g_AWLogLevel = AWLogLevelInfo; - -void AWLogSetLogLevel(AWLogLevel level) { - g_AWLogLevel = level; -} - -void _AWLogCrit(NSString *format, ...) { - if (g_AWLogLevel < AWLogLevelCrit) return; - va_list ap; - va_start(ap, format); - NSLogv(format, ap); - va_end(ap); -} - -void _AWLogError(NSString *format, ...) { - if (g_AWLogLevel < AWLogLevelError) return; - va_list ap; - va_start(ap, format); - NSLogv(format, ap); - va_end(ap); -} - -void _AWLogWarn(NSString *format, ...) { - if (g_AWLogLevel < AWLogLevelWarn) return; - va_list ap; - va_start(ap, format); - NSLogv(format, ap); - va_end(ap); -} - -void _AWLogInfo(NSString *format, ...) { - if (g_AWLogLevel < AWLogLevelInfo) return; - va_list ap; - va_start(ap, format); - NSLogv(format, ap); - va_end(ap); -} - -void _AWLogDebug(NSString *format, ...) { - if (g_AWLogLevel < AWLogLevelDebug) return; - va_list ap; - va_start(ap, format); - NSLogv(format, ap); - va_end(ap); -} diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlView+.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlView+.h deleted file mode 100644 index 5f326bd86..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlView+.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - - AdWhirlView+.h - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlAdNetworkAdapter.h" - - -@class AdWhirlConfigStore; - - -@interface AdWhirlView () - -// Only initializes default values for member variables -- (id)initWithDelegate:(id)delegate; - -// Kicks off getting config from AdWhirlConfigStore -- (void)startGetConfig; - -- (void)buildPrioritizedAdNetCfgsAndMakeRequest; -- (AdWhirlAdNetworkConfig *)nextNetworkCfgByPercent; -- (AdWhirlAdNetworkConfig *)nextNetworkCfgByPriority; -- (void)makeAdRequest:(BOOL)isFirstRequest; -- (void)reportExImpression:(NSString *)nid netType:(AdWhirlAdNetworkType)type; -- (void)reportExClick:(NSString *)nid netType:(AdWhirlAdNetworkType)type; -- (BOOL)canRefresh; -- (void)resignActive:(NSNotification *)notification; -- (void)becomeActive:(NSNotification *)notification; - -- (void)notifyDelegateOfErrorWithCode:(NSInteger)errorCode - description:(NSString *)desc; -- (void)notifyDelegateOfError:(NSError *)error; - -@property (retain) AdWhirlConfig *config; -@property (retain) NSMutableArray *prioritizedAdNetCfgs; -@property (nonatomic,retain) AdWhirlAdNetworkAdapter *currAdapter; -@property (nonatomic,retain) AdWhirlAdNetworkAdapter *lastAdapter; -@property (nonatomic,retain) NSDate *lastRequestTime; -@property (nonatomic,retain) NSTimer *refreshTimer; -@property (nonatomic) BOOL showingModalView; -@property (nonatomic,assign) AdWhirlConfigStore *configStore; -@property (nonatomic,retain) AWNetworkReachabilityWrapper *rollOverReachability; -@property (nonatomic,retain) NSArray *testDarts; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlView.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlView.m deleted file mode 100644 index 523f07d1f..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlView.m +++ /dev/null @@ -1,1015 +0,0 @@ -/* - - AdWhirlView.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlView.h" -#import "AdWhirlView+.h" -#import "AdWhirlConfigStore.h" -#import "AdWhirlAdNetworkConfig.h" -#import "CJSONDeserializer.h" -#import "AdWhirlLog.h" -#import "AdWhirlAdNetworkAdapter.h" -#import "AdWhirlError.h" -#import "AdWhirlConfigStore.h" -#import "AWNetworkReachabilityWrapper.h" - -#define kAdWhirlViewAdSubViewTag 1000 - - -NSInteger adNetworkPriorityComparer(id a, id b, void *ctx) { - AdWhirlAdNetworkConfig *acfg = a, *bcfg = b; - if(acfg.priority < bcfg.priority) - return NSOrderedAscending; - else if(acfg.priority > bcfg.priority) - return NSOrderedDescending; - else - return NSOrderedSame; -} - - -@implementation AdWhirlView - -#pragma mark Properties getters/setters - -@synthesize delegate; -@synthesize config; -@synthesize prioritizedAdNetCfgs; -@synthesize currAdapter; -@synthesize lastAdapter; -@synthesize lastRequestTime; -@synthesize refreshTimer; -@synthesize lastError; -@synthesize showingModalView; -@synthesize configStore; -@synthesize rollOverReachability; -@synthesize testDarts; - -- (void)setDelegate:(id )theDelegate { - [self willChangeValueForKey:@"delegate"]; - delegate = theDelegate; - if (self.currAdapter) { - self.currAdapter.adWhirlDelegate = theDelegate; - } - if (self.lastAdapter) { - self.lastAdapter.adWhirlDelegate = theDelegate; - } - [self didChangeValueForKey:@"delegate"]; -} - - -#pragma mark Life cycle methods - -+ (AdWhirlView *)requestAdWhirlViewWithDelegate:(id)delegate { - if (![delegate respondsToSelector: - @selector(viewControllerForPresentingModalView)]) { - [NSException raise:@"AdWhirlIncompleteDelegateException" - format:@"AdWhirlDelegate must implement" - @" viewControllerForPresentingModalView"]; - } - AdWhirlView *adView - = [[[AdWhirlView alloc] initWithDelegate:delegate] autorelease]; - [adView startGetConfig]; // errors are communicated via delegate - return adView; -} - -- (id)initWithDelegate:(id)d { - self = [super initWithFrame:kAdWhirlViewDefaultFrame]; - if (self != nil) { - delegate = d; - self.backgroundColor = [UIColor clearColor]; - // to prevent ugly artifacts if ad network banners are bigger than the - // default frame - self.clipsToBounds = YES; - showingModalView = NO; - appInactive = NO; - - // default config store. Can be overridden for testing - self.configStore = [AdWhirlConfigStore sharedStore]; - - // get notified of app activity - NSNotificationCenter *notifCenter = [NSNotificationCenter defaultCenter]; - [notifCenter addObserver:self - selector:@selector(resignActive:) - name:UIApplicationWillResignActiveNotification - object:nil]; - [notifCenter addObserver:self - selector:@selector(becomeActive:) - name:UIApplicationDidBecomeActiveNotification - object:nil]; - - // remember pending ad requests, so we don't make more than one - // request per ad network at a time - pendingAdapters = [[NSMutableDictionary alloc] initWithCapacity:30]; - } - return self; -} - -- (void)dealloc { - [[NSNotificationCenter defaultCenter] removeObserver:self]; - [rollOverReachability setDelegate:nil]; - [rollOverReachability release], rollOverReachability = nil; - delegate = nil; - [config removeDelegate:self]; - [config release], config = nil; - [prioritizedAdNetCfgs release], prioritizedAdNetCfgs = nil; - totalPercent = 0.0; - requesting = NO; - currAdapter.adWhirlDelegate = nil, currAdapter.adWhirlView = nil; - [currAdapter release], currAdapter = nil; - lastAdapter.adWhirlDelegate = nil, lastAdapter.adWhirlView = nil; - [lastAdapter release], lastAdapter = nil; - [lastRequestTime release], lastRequestTime = nil; - [pendingAdapters release], pendingAdapters = nil; - if (refreshTimer != nil) { - [refreshTimer invalidate]; - [refreshTimer release], refreshTimer = nil; - } - [lastError release], lastError = nil; - - [super dealloc]; -} - - -#pragma mark Config and setup methods - -static id classAdWhirlDelegateForConfig = nil; - -+ (void)startPreFetchingConfigurationDataWithDelegate: - (id)delegate { - if (classAdWhirlDelegateForConfig != nil) { - AWLogWarn(@"Called startPreFetchingConfig when another fetch is" - @" in progress"); - return; - } - classAdWhirlDelegateForConfig = delegate; - [[AdWhirlConfigStore sharedStore] getConfig:[delegate adWhirlApplicationKey] - delegate:(id)self]; -} - -+ (void)updateAdWhirlConfigWithDelegate:(id)delegate { - if (classAdWhirlDelegateForConfig != nil) { - AWLogWarn(@"Called updateConfig when another fetch is in progress"); - return; - } - classAdWhirlDelegateForConfig = delegate; - [[AdWhirlConfigStore sharedStore] - fetchConfig:[delegate adWhirlApplicationKey] - delegate:(id)self]; -} - -- (void)startGetConfig { - // Invalidate ad refresh timer as it may change with the new config - if (self.refreshTimer) { - [self.refreshTimer invalidate]; - self.refreshTimer = nil; - } - - configFetchAttempts = 0; - AdWhirlConfig *cfg = [configStore getConfig:[delegate adWhirlApplicationKey] - delegate:(id)self]; - self.config = cfg; -} - -- (void)attemptFetchConfig { - AdWhirlConfig *cfg = [configStore - fetchConfig:[delegate adWhirlApplicationKey] - delegate:(id)self]; - if (cfg != nil) { - self.config = cfg; - } -} - -- (void)updateAdWhirlConfig { - // Invalidate ad refresh timer as it may change with the new config - if (self.refreshTimer) { - [self.refreshTimer invalidate]; - self.refreshTimer = nil; - } - - // Request new config - AWLogDebug(@"======== Updating config ========"); - configFetchAttempts = 0; - [self attemptFetchConfig]; -} - -#pragma mark Ads management private methods - -- (void)buildPrioritizedAdNetCfgsAndMakeRequest { - NSMutableArray *freshNetCfgs = [[NSMutableArray alloc] init]; - for (AdWhirlAdNetworkConfig *cfg in config.adNetworkConfigs) { - // do not add the ad network in rotation if there's already a stray - // pending ad request to this ad network (due to network outage or plain - // slow request) - NSNumber *netKey = [NSNumber numberWithInt:(int)cfg.networkType]; - if ([pendingAdapters objectForKey:netKey] == nil) { - [freshNetCfgs addObject:cfg]; - } - else { - AWLogDebug(@"Already has pending ad request for network type %d," - @" not adding ad network config %@", - cfg.networkType, cfg); - } - } - [freshNetCfgs sortUsingFunction:adNetworkPriorityComparer context:nil]; - totalPercent = 0.0; - for (AdWhirlAdNetworkConfig *cfg in freshNetCfgs) { - totalPercent += cfg.trafficPercentage; - } - self.prioritizedAdNetCfgs = freshNetCfgs; - [freshNetCfgs release]; - - [self makeAdRequest:YES]; -} - -static BOOL randSeeded = NO; -- (double)nextDart { - if (testDarts != nil) { - if (testDartIndex >= [testDarts count]) { - testDartIndex = 0; - } - NSNumber *nextDartNum = [testDarts objectAtIndex:testDartIndex]; - double dart = [nextDartNum doubleValue]; - if (dart >= totalPercent) { - dart = totalPercent - 0.001; - } - testDartIndex++; - return dart; - } - else { - if (!randSeeded) { - srandom(CFAbsoluteTimeGetCurrent()); - randSeeded = YES; - } - return ((double)(random()-1)/RAND_MAX) * totalPercent; - } -} - -- (AdWhirlAdNetworkConfig *)nextNetworkCfgByPercent { - if ([prioritizedAdNetCfgs count] == 0) { - return nil; - } - - double dart = [self nextDart]; - - double tempTotal = 0.0; - - AdWhirlAdNetworkConfig *result = nil; - for (AdWhirlAdNetworkConfig *network in prioritizedAdNetCfgs) { - result = network; // make sure there is always a network chosen - tempTotal += network.trafficPercentage; - if (dart < tempTotal) { - // this is the one to use. - break; - } - } - - AWLogDebug(@">>>> By Percent chosen %@ (%@), dart %lf in %lf", - result.nid, result.networkName, dart, totalPercent); - return result; -} - -- (AdWhirlAdNetworkConfig *)nextNetworkCfgByPriority { - if ([prioritizedAdNetCfgs count] == 0) { - return nil; - } - AdWhirlAdNetworkConfig *result = [prioritizedAdNetCfgs objectAtIndex:0]; - AWLogDebug(@">>>> By Priority chosen %@ (%@)", - result.nid, result.networkName); - return result; -} - -- (void)makeAdRequest:(BOOL)isFirstRequest { - if ([prioritizedAdNetCfgs count] == 0) { - // ran out of ad networks - [self notifyDelegateOfErrorWithCode:AdWhirlAdRequestNoMoreAdNetworks - description:@"No more ad networks to roll over"]; - return; - } - - if (showingModalView) { - AWLogDebug(@"Modal view is active, not going to request another ad"); - return; - } - [self.rollOverReachability setDelegate:nil]; - self.rollOverReachability = nil; // stop any roll over reachability checks - - if (requesting) { - // it is OK to request a new one while another one is in progress - // the adapter callbacks from the old adapter will be ignored. - // User-initiated request ad will be blocked in requestFreshAd. - AWLogDebug(@"Already requesting ad, will request a new one."); - } - requesting = YES; - - AdWhirlAdNetworkConfig *nextAdNetCfg = nil; - - if (isFirstRequest && totalPercent > 0.0) { - nextAdNetCfg = [self nextNetworkCfgByPercent]; - } - else { - nextAdNetCfg = [self nextNetworkCfgByPriority]; - } - if (nextAdNetCfg == nil) { - [self notifyDelegateOfErrorWithCode:AdWhirlAdRequestNoMoreAdNetworks - description:@"No more ad networks to request"]; - return; - } - - AdWhirlAdNetworkAdapter *adapter = - [[nextAdNetCfg.adapterClass alloc] initWithAdWhirlDelegate:delegate - view:self - config:config - networkConfig:nextAdNetCfg]; - // keep the last adapter around to catch stale ad network delegate calls - // during transitions - self.lastAdapter = self.currAdapter; - self.currAdapter = adapter; - [adapter release]; - - // take nextAdNetCfg out so we don't request again when we roll over - [prioritizedAdNetCfgs removeObject:nextAdNetCfg]; - - if (lastRequestTime) { - [lastRequestTime release]; - } - lastRequestTime = [[NSDate date] retain]; - - // remember this pending request so we do not request again when we make - // new ad requests - NSNumber *netTypeKey = [NSNumber numberWithInt:(int)nextAdNetCfg.networkType]; - [pendingAdapters setObject:currAdapter forKey:netTypeKey]; - - // If last adapter is of the same network type, make the last adapter stop - // being an ad network view delegate to prevent the last adapter from calling - // back to this AdWhirlView during the transition and afterwards. - // We should not do this for all adapters, because if the last adapter is - // still in progress, we need to know about it in the adapter callbacks. - // That the last adapter is the same type as the new adapter is possible only - // if the last ad request finished, i.e. called back to its adapters. There - // are cases, e.g. iAd, when the ad network may call back multiple times, - // because of internal refreshes. - if (self.lastAdapter.networkConfig.networkType == - self.currAdapter.networkConfig.networkType) { - [self.lastAdapter stopBeingDelegate]; - } - - [currAdapter getAd]; -} - -- (BOOL)canRefresh { - return !(ignoreNewAdRequests - || ignoreAutoRefreshTimer - || appInactive - || showingModalView); -} - -- (void)timerRequestFreshAd { - if (![self canRefresh]) { - AWLogDebug(@"Not going to refresh due to flags, app not active or modal"); - return; - } - if (lastRequestTime != nil) { - NSTimeInterval sinceLast = -[lastRequestTime timeIntervalSinceNow]; - if (sinceLast <= kAWMinimumTimeBetweenFreshAdRequests) { - AWLogDebug(@"Ad refresh timer fired too soon after last ad request," - @" ignoring"); - return; - } - } - AWLogDebug(@"======== Refreshing ad due to timer ========"); - [self buildPrioritizedAdNetCfgsAndMakeRequest]; -} - -#pragma mark Ads management public methods - -- (void)requestFreshAd { - // only make request in main thread - if (![NSThread isMainThread]) { - [self performSelectorOnMainThread:@selector(requestFreshAd) - withObject:nil - waitUntilDone:NO]; - return; - } - if (ignoreNewAdRequests) { - // don't request new ad - [self notifyDelegateOfErrorWithCode:AdWhirlAdRequestIgnoredError - description:@"ignoreNewAdRequests flag set"]; - return; - } - if (requesting) { - // don't request if there's a request outstanding - [self notifyDelegateOfErrorWithCode:AdWhirlAdRequestInProgressError - description:@"Ad request already in progress"]; - return; - } - if (showingModalView) { - // don't request if there's a modal view active - [self notifyDelegateOfErrorWithCode:AdWhirlAdRequestModalActiveError - description:@"Modal view active"]; - return; - } - if (!config) { - [self notifyDelegateOfErrorWithCode:AdWhirlAdRequestNoConfigError - description:@"No ad configuration"]; - return; - } - if (lastRequestTime != nil) { - NSTimeInterval sinceLast = -[lastRequestTime timeIntervalSinceNow]; - if (sinceLast <= kAWMinimumTimeBetweenFreshAdRequests) { - NSString *desc - = [NSString stringWithFormat: - @"Requesting fresh ad too soon! It has been only %lfs. Minimum %lfs", - sinceLast, kAWMinimumTimeBetweenFreshAdRequests]; - [self notifyDelegateOfErrorWithCode:AdWhirlAdRequestTooSoonError - description:desc]; - return; - } - } - [self buildPrioritizedAdNetCfgsAndMakeRequest]; -} - -- (void)rollOver { - if (ignoreNewAdRequests) { - return; - } - // only make request in main thread - if (![NSThread isMainThread]) { - [self performSelectorOnMainThread:@selector(rollOver) - withObject:nil - waitUntilDone:NO]; - return; - } - [self makeAdRequest:NO]; -} - -- (BOOL)adExists { - UIView *currAdView = [self viewWithTag:kAdWhirlViewAdSubViewTag]; - return currAdView != nil; -} - -- (NSString *)mostRecentNetworkName { - if (currAdapter == nil) return nil; - return currAdapter.networkConfig.networkName; -} - -- (void)ignoreAutoRefreshTimer { - ignoreAutoRefreshTimer = YES; -} - -- (void)doNotIgnoreAutoRefreshTimer { - ignoreAutoRefreshTimer = NO; -} - -- (BOOL)isIgnoringAutoRefreshTimer { - return ignoreAutoRefreshTimer; -} - -- (void)ignoreNewAdRequests { - ignoreNewAdRequests = YES; -} - -- (void)doNotIgnoreNewAdRequests { - ignoreNewAdRequests = NO; -} - -- (BOOL)isIgnoringNewAdRequests { - return ignoreNewAdRequests; -} - - -#pragma mark Stats reporting methods - -- (void)metricPing:(NSURL *)endPointBaseURL - nid:(NSString *)nid - netType:(AdWhirlAdNetworkType)type { - // use config.appKey not from [delegate adWhirlApplicationKey] as delegate - // can be niled out at this point. Attempt at Issue #42 . - NSString *query - = [NSString stringWithFormat: - @"?appid=%@&nid=%@&type=%d&country_code=%@&appver=%d&client=1", - config.appKey, - nid, - type, - [[NSLocale currentLocale] localeIdentifier], - kAdWhirlAppVer]; - NSURL *metURL = [NSURL URLWithString:query - relativeToURL:endPointBaseURL]; - AWLogDebug(@"Sending metric ping to %@", metURL); - NSURLRequest *metRequest = [NSURLRequest requestWithURL:metURL]; - [NSURLConnection connectionWithRequest:metRequest - delegate:nil]; // fire and forget -} - -- (void)reportExImpression:(NSString *)nid netType:(AdWhirlAdNetworkType)type { - NSURL *baseURL = nil; - if ([delegate respondsToSelector:@selector(adWhirlImpMetricURL)]) { - baseURL = [delegate adWhirlImpMetricURL]; - } - if (baseURL == nil) { - baseURL = [NSURL URLWithString:kAdWhirlDefaultImpMetricURL]; - } - [self metricPing:baseURL nid:nid netType:type]; -} - -- (void)reportExClick:(NSString *)nid netType:(AdWhirlAdNetworkType)type { - NSURL *baseURL = nil; - if ([delegate respondsToSelector:@selector(adWhirlClickMetricURL)]) { - baseURL = [delegate adWhirlClickMetricURL]; - } - if (baseURL == nil) { - baseURL = [NSURL URLWithString:kAdWhirlDefaultClickMetricURL]; - } - [self metricPing:baseURL nid:nid netType:type]; -} - - -#pragma mark UI methods - -- (CGSize)actualAdSize { - if (currAdapter == nil || currAdapter.adNetworkView == nil) - return kAdWhirlViewDefaultSize; - return currAdapter.adNetworkView.frame.size; -} - -- (void)rotateToOrientation:(UIInterfaceOrientation)orientation { - if (currAdapter == nil) return; - [currAdapter rotateToOrientation:orientation]; -} - -- (void)transitionToView:(UIView *)view { - UIView *currAdView = [self viewWithTag:kAdWhirlViewAdSubViewTag]; - if (view == currAdView) { - AWLogDebug(@"ignoring ad transition to itself"); - return; // no need to transition to itself - } - view.tag = kAdWhirlViewAdSubViewTag; - if (currAdView) { - // swap - currAdView.tag = 0; - - AWBannerAnimationType animType; - if (config.bannerAnimationType == AWBannerAnimationTypeRandom) { - if (!randSeeded) { - srandom(CFAbsoluteTimeGetCurrent()); - } - // range is 1 to 7, inclusive - animType = (random() % 7) + 1; - AWLogDebug(@"Animation type chosen by random is %d", animType); - } - else { - animType = config.bannerAnimationType; - } - if (![currAdapter isBannerAnimationOK:animType]) { - animType = AWBannerAnimationTypeNone; - } - - if (animType == AWBannerAnimationTypeNone) { - [currAdView removeFromSuperview]; - [self addSubview:view]; - if ([delegate respondsToSelector: - @selector(adWhirlDidAnimateToNewAdIn:)]) { - // no animation, callback right away - [(NSObject *)delegate - performSelectorOnMainThread:@selector(adWhirlDidAnimateToNewAdIn:) - withObject:self - waitUntilDone:NO]; - } - } - else { - switch (animType) { - case AWBannerAnimationTypeSlideFromLeft: - { - CGRect f = view.frame; - f.origin.x = -f.size.width; - view.frame = f; - [self addSubview:view]; - break; - } - case AWBannerAnimationTypeSlideFromRight: - { - CGRect f = view.frame; - f.origin.x = self.frame.size.width; - view.frame = f; - [self addSubview:view]; - break; - } - case AWBannerAnimationTypeFadeIn: - view.alpha = 0; - [self addSubview:view]; - break; - default: - // no setup required for other animation types - break; - } - - [currAdView retain]; // will be released when animation is done - AWLogDebug(@"Beginning AdWhirlAdTransition animation" - @" currAdView %x incoming %x", currAdView, view); - [UIView beginAnimations:@"AdWhirlAdTransition" context:currAdView]; - [UIView setAnimationDelegate:self]; - [UIView setAnimationDidStopSelector: - @selector(newAdAnimationDidStopWithAnimationID:finished:context:)]; - [UIView setAnimationBeginsFromCurrentState:YES]; - [UIView setAnimationDuration:1.0]; - // cache has to set to NO because of VideoEgg - switch (animType) { - case AWBannerAnimationTypeFlipFromLeft: - [self addSubview:view]; - [currAdView removeFromSuperview]; - [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft - forView:self - cache:NO]; - break; - case AWBannerAnimationTypeFlipFromRight: - [self addSubview:view]; - [currAdView removeFromSuperview]; - [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight - forView:self - cache:NO]; - break; - case AWBannerAnimationTypeCurlUp: - [self addSubview:view]; - [currAdView removeFromSuperview]; - [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp - forView:self - cache:NO]; - break; - case AWBannerAnimationTypeCurlDown: - [self addSubview:view]; - [currAdView removeFromSuperview]; - [UIView setAnimationTransition:UIViewAnimationTransitionCurlDown - forView:self - cache:NO]; - break; - case AWBannerAnimationTypeSlideFromLeft: - case AWBannerAnimationTypeSlideFromRight: - { - CGRect f = view.frame; - f.origin.x = 0; - view.frame = f; - break; - } - case AWBannerAnimationTypeFadeIn: - view.alpha = 1.0; - break; - default: - [self addSubview:view]; - AWLogWarn(@"Unrecognized Animation type: %d", animType); - break; - } - [UIView commitAnimations]; - } - } - else { // currAdView - // new - [self addSubview:view]; - if ([delegate respondsToSelector:@selector(adWhirlDidAnimateToNewAdIn:)]) { - // no animation, callback right away - [(NSObject *)delegate - performSelectorOnMainThread:@selector(adWhirlDidAnimateToNewAdIn:) - withObject:self - waitUntilDone:NO]; - } - } -} - -- (void)replaceBannerViewWith:(UIView*)bannerView { - [self transitionToView:bannerView]; -} - -// Called at the end of the new ad animation; we use this opportunity to do -// memory management cleanup. See the comment in adDidLoad:. -- (void)newAdAnimationDidStopWithAnimationID:(NSString *)animationID - finished:(BOOL)finished - context:(void *)context -{ - AWLogDebug(@"animation %@ finished %@ context %x", - animationID, finished? @"YES":@"NO", context); - UIView *adViewToRemove = (UIView *)context; - [adViewToRemove removeFromSuperview]; - [adViewToRemove release]; // was retained before beginAnimations - lastAdapter.adWhirlDelegate = nil, lastAdapter.adWhirlView = nil; - self.lastAdapter = nil; - if ([delegate respondsToSelector:@selector(adWhirlDidAnimateToNewAdIn:)]) { - [delegate adWhirlDidAnimateToNewAdIn:self]; - } -} - - -#pragma mark UIView touch methods - -- (BOOL)_isEventATouch30:(UIEvent *)event { - if ([event respondsToSelector:@selector(type)]) { - return event.type == UIEventTypeTouches; - } - return YES; // UIEvent in 2.2.1 has no type property, so assume yes. -} - -- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { - BOOL itsInside = [super pointInside:point withEvent:event]; - if (itsInside && currAdapter != nil && lastNotifyAdapter != currAdapter - && [self _isEventATouch30:event] - && [currAdapter shouldSendExMetric]) { - lastNotifyAdapter = currAdapter; - [self reportExClick:currAdapter.networkConfig.nid - netType:currAdapter.networkConfig.networkType]; - } - return itsInside; -} - - -#pragma mark UIView methods - -- (void)willMoveToSuperview:(UIView *)newSuperview { - if (newSuperview == nil) { - [refreshTimer invalidate]; - self.refreshTimer = nil; - } -} - - -#pragma mark Adapter callbacks - -// Chores that are common to all adapter callbacks -- (void)adRequestReturnsForAdapter:(AdWhirlAdNetworkAdapter *)adapter { - // no longer pending. Need to retain and autorelease the adapter - // since the adapter may not be retained anywhere else other than the pending - // dict - NSNumber *netTypeKey - = [NSNumber numberWithInt:(int)adapter.networkConfig.networkType]; - AdWhirlAdNetworkAdapter *pendingAdapter - = [pendingAdapters objectForKey:netTypeKey]; - if (pendingAdapter != nil) { - if (pendingAdapter != adapter) { - // Possible if the ad refreshes itself and sends callbacks doing so, while - // a new ad of the same network is pending (e.g. iAd) - AWLogError(@"Stored pending adapter %@ for network type %@ is different" - @" from the one sending the adapter callback %@", - pendingAdapter, - netTypeKey, - adapter); - } - [[pendingAdapter retain] autorelease]; - [pendingAdapters removeObjectForKey:netTypeKey]; - } -} - -- (void)adapter:(AdWhirlAdNetworkAdapter *)adapter - didReceiveAdView:(UIView *)view { - [self adRequestReturnsForAdapter:adapter]; - if (adapter != currAdapter) { - AWLogDebug(@"Received didReceiveAdView from a stale adapter %@", adapter); - return; - } - AWLogDebug(@"Received ad from adapter (nid %@)", adapter.networkConfig.nid); - - // UIView operations should be performed on main thread - [self performSelectorOnMainThread:@selector(transitionToView:) - withObject:view - waitUntilDone:NO]; - requesting = NO; - - // report impression and notify delegate - if ([adapter shouldSendExMetric]) { - [self reportExImpression:adapter.networkConfig.nid - netType:adapter.networkConfig.networkType]; - } - if ([delegate respondsToSelector:@selector(adWhirlDidReceiveAd:)]) { - [delegate adWhirlDidReceiveAd:self]; - } -} - -- (void)adapter:(AdWhirlAdNetworkAdapter *)adapter didFailAd:(NSError *)error { - [self adRequestReturnsForAdapter:adapter]; - if (adapter != currAdapter) { - AWLogDebug(@"Received didFailAd from a stale adapter %@: %@", - adapter, error); - return; - } - AWLogDebug(@"Failed to receive ad from adapter (nid %@): %@", - adapter.networkConfig.nid, error); - requesting = NO; - - if ([prioritizedAdNetCfgs count] == 0) { - // we have run out of networks to try and need to error out. - [self notifyDelegateOfErrorWithCode:AdWhirlAdRequestNoMoreAdNetworks - description:@"No more ad networks to roll over"]; - return; - } - - // try to roll over, but before we do, check to see if the failure is because - // network has gotten unreachable. If so, don't roll over. Use www.google.com - // as test, assuming www.google.com itself is always up if there's network. - self.rollOverReachability - = [AWNetworkReachabilityWrapper reachabilityWithHostname:@"www.google.com" - callbackDelegate:self]; - if (self.rollOverReachability == nil) { - [self notifyDelegateOfErrorWithCode:AdWhirlAdRequestNoNetworkError - description:@"Failed network reachability test"]; - return; - } - if (![self.rollOverReachability scheduleInCurrentRunLoop]) { - [self notifyDelegateOfErrorWithCode:AdWhirlAdRequestNoNetworkError - description:@"Failed network reachability test"]; - return; - } -} - -- (void)adapterDidFinishAdRequest:(AdWhirlAdNetworkAdapter *)adapter { - [self adRequestReturnsForAdapter:adapter]; - if (adapter != currAdapter) { - AWLogDebug(@"Received adapterDidFinishAdRequest from a stale adapter"); - return; - } - // view is supplied via other mechanism (e.g. Generic Notification or Event) - requesting = NO; - - // report impression. No need to notify delegate because delegate is notified - // via Generic Notification or event. - if ([adapter shouldSendExMetric]) { - [self reportExImpression:adapter.networkConfig.nid - netType:adapter.networkConfig.networkType]; - } -} - - -#pragma mark AWNetworkReachabilityDelegate methods - -- (void)reachabilityNotReachable:(AWNetworkReachabilityWrapper *)reach { - if (reach == self.rollOverReachability) { - [self.rollOverReachability setDelegate:nil]; - self.rollOverReachability = nil; // release it and unschedule - [self notifyDelegateOfErrorWithCode:AdWhirlAdRequestNoNetworkError - description:@"No network connection for rollover"]; - return; - } - AWLogWarn(@"Unrecognized reachability called not reachable %s:%d", - __FILE__, __LINE__); -} - -- (void)reachabilityBecameReachable:(AWNetworkReachabilityWrapper *)reach { - if (reach == self.rollOverReachability) { - // not an error, just need to rollover - [lastError release], lastError = nil; - if ([delegate respondsToSelector: - @selector(adWhirlDidFailToReceiveAd:usingBackup:)]) { - [delegate adWhirlDidFailToReceiveAd:self usingBackup:YES]; - } - [self.rollOverReachability setDelegate:nil]; - self.rollOverReachability = nil; // release it and unschedule - [self rollOver]; - return; - } - AWLogWarn(@"Unrecognized reachability called reachable %s:%d", - __FILE__, __LINE__); -} - - -#pragma mark AdWhirlConfigDelegate methods - -+ (NSURL *)adWhirlConfigURL { - if (classAdWhirlDelegateForConfig != nil - && [classAdWhirlDelegateForConfig respondsToSelector: - @selector(adWhirlConfigURL)]) { - return [classAdWhirlDelegateForConfig adWhirlConfigURL]; - } - return nil; -} - -+ (void)adWhirlConfigDidReceiveConfig:(AdWhirlConfig *)config { - AWLogDebug(@"Fetched Ad network config: %@", config); - if (classAdWhirlDelegateForConfig != nil - && [classAdWhirlDelegateForConfig respondsToSelector: - @selector(adWhirlDidReceiveConfig:)]) { - [classAdWhirlDelegateForConfig adWhirlDidReceiveConfig:nil]; - } - classAdWhirlDelegateForConfig = nil; -} - -+ (void)adWhirlConfigDidFail:(AdWhirlConfig *)cfg error:(NSError *)error { - AWLogError(@"Failed pre-fetching AdWhirl config: %@", error); - classAdWhirlDelegateForConfig = nil; -} - -- (void)adWhirlConfigDidReceiveConfig:(AdWhirlConfig *)cfg { - if (self.config != cfg) { - AWLogWarn(@"AdWhirlView: getting adWhirlConfigDidReceiveConfig callback" - @" from unknown AdWhirlConfig object"); - return; - } - AWLogDebug(@"Fetched Ad network config: %@", cfg); - if ([delegate respondsToSelector:@selector(adWhirlDidReceiveConfig:)]) { - [delegate adWhirlDidReceiveConfig:self]; - } - if (cfg.adsAreOff) { - if ([delegate respondsToSelector: - @selector(adWhirlReceivedNotificationAdsAreOff:)]) { - // to prevent self being freed before this returns, in case the - // delegate decides to release this - [self retain]; - [delegate adWhirlReceivedNotificationAdsAreOff:self]; - [self autorelease]; - } - return; - } - - // Perform ad network data structure build and request in main thread - // to avoid contention - [self performSelectorOnMainThread: - @selector(buildPrioritizedAdNetCfgsAndMakeRequest) - withObject:nil - waitUntilDone:NO]; - - // Setup recurring timer for ad refreshes, if required - if (config.refreshInterval > kAWMinimumTimeBetweenFreshAdRequests) { - self.refreshTimer - = [NSTimer scheduledTimerWithTimeInterval:config.refreshInterval - target:self - selector:@selector(timerRequestFreshAd) - userInfo:nil - repeats:YES]; - } -} - -- (void)adWhirlConfigDidFail:(AdWhirlConfig *)cfg error:(NSError *)error { - if (self.config != nil && self.config != cfg) { - // self.config could be nil if this is called before init is finished - AWLogWarn(@"AdWhirlView: getting adWhirlConfigDidFail callback from unknown" - @" AdWhirlConfig object"); - return; - } - configFetchAttempts++; - if (configFetchAttempts < 3) { - // schedule in run loop to avoid recursive calls to this function - [self performSelectorOnMainThread:@selector(attemptFetchConfig) - withObject:self - waitUntilDone:NO]; - } - else { - AWLogError(@"Failed fetching AdWhirl config: %@", error); - [self notifyDelegateOfError:error]; - } -} - -- (NSURL *)adWhirlConfigURL { - if ([delegate respondsToSelector:@selector(adWhirlConfigURL)]) { - return [delegate adWhirlConfigURL]; - } - return nil; -} - - -#pragma mark Active status notification callbacks - -- (void)resignActive:(NSNotification *)notification { - AWLogDebug(@"App become inactive, AdWhirlView will stop requesting ads"); - appInactive = YES; -} - -- (void)becomeActive:(NSNotification *)notification { - AWLogDebug(@"App become active, AdWhirlView will resume requesting ads"); - appInactive = NO; -} - - -#pragma mark AdWhirlDelegate helper methods - -- (void)notifyDelegateOfErrorWithCode:(NSInteger)errorCode - description:(NSString *)desc { - NSError *error = [[AdWhirlError alloc] initWithCode:errorCode - description:desc]; - [self notifyDelegateOfError:error]; - [error release]; -} - -- (void)notifyDelegateOfError:(NSError *)error { - [error retain]; - [lastError release]; - lastError = error; - if ([delegate respondsToSelector: - @selector(adWhirlDidFailToReceiveAd:usingBackup:)]) { - // to prevent self being freed before this returns, in case the - // delegate decides to release this - [self retain]; - [delegate adWhirlDidFailToReceiveAd:self usingBackup:NO]; - [self autorelease]; - } -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlWebBrowser.xib b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlWebBrowser.xib deleted file mode 100644 index 21866d575..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlWebBrowser.xib +++ /dev/null @@ -1,764 +0,0 @@ - - - - 784 - 10D573 - 762 - 1038.29 - 460.00 - - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - 87 - - - YES - - - - YES - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - YES - - YES - - - YES - - - - YES - - IBFilesOwner - IBCocoaTouchFramework - - - IBFirstResponder - IBCocoaTouchFramework - - - - 274 - - YES - - - 274 - {320, 436} - - - 3 - MQA - - 2 - - - YES - YES - 2000 - IBCocoaTouchFramework - YES - 1 - YES - - - - 266 - {{0, 436}, {320, 44}} - - NO - NO - 1000 - IBCocoaTouchFramework - - YES - - 1001 - NO - IBCocoaTouchFramework - - - - IBCocoaTouchFramework - - 5 - - - 1002 - NO - IBCocoaTouchFramework - - 17 - - - IBCocoaTouchFramework - - 5 - - - 1003 - NO - IBCocoaTouchFramework - - 13 - - - 1004 - NO - IBCocoaTouchFramework - - 14 - - - IBCocoaTouchFramework - - 5 - - - 1005 - NO - IBCocoaTouchFramework - - 9 - - - IBCocoaTouchFramework - - 5 - - - 1006 - IBCocoaTouchFramework - 1 - - 0 - - - - 3 - MAA - - - - - {320, 480} - - - 3 - MAA - - - IBCocoaTouchFramework - - - - - YES - - - view - - - - 10 - - - - delegate - - - - 13 - - - - back: - - - - 41 - - - - forward: - - - - 42 - - - - reload: - - - - 43 - - - - stop: - - - - 44 - - - - linkOut: - - - - 45 - - - - close: - - - - 46 - - - - backButton - - - - 64 - - - - closeButton - - - - 65 - - - - forwardButton - - - - 66 - - - - linkOutButton - - - - 67 - - - - reloadButton - - - - 68 - - - - stopButton - - - - 69 - - - - webView - - - - 70 - - - - toolBar - - - - 71 - - - - - YES - - 0 - - - - - - 1 - - - YES - - - - - - - -1 - - - File's Owner - - - -2 - - - - - 3 - - - - - 4 - - - YES - - - - - - - - - - - - - - - 5 - - - - - 6 - - - - - 7 - - - - - 8 - - - - - 9 - - - - - 25 - - - - - 26 - - - - - 31 - - - - - 39 - - - - - 40 - - - - - - - YES - - YES - -1.CustomClassName - -2.CustomClassName - 1.IBEditorWindowLastContentRect - 1.IBPluginDependency - 25.IBPluginDependency - 26.IBPluginDependency - 3.IBPluginDependency - 31.IBPluginDependency - 39.IBPluginDependency - 4.IBPluginDependency - 40.IBPluginDependency - 5.CustomClassName - 5.IBPluginDependency - 6.IBPluginDependency - 7.IBPluginDependency - 8.IBPluginDependency - 9.IBPluginDependency - - - YES - AdWhirlWebBrowserController - UIResponder - {{577, 64}, {320, 480}} - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - AdWhirlBackButton - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - com.apple.InterfaceBuilder.IBCocoaTouchPlugin - - - - YES - - - YES - - - - - YES - - - YES - - - - 71 - - - - YES - - AdWhirlBackButton - UIBarButtonItem - - IBProjectSource - ../AdWhirl/internal/AdWhirlWebBrowserController.h - - - - AdWhirlWebBrowserController - UIViewController - - YES - - YES - back: - close: - forward: - linkOut: - reload: - stop: - - - YES - id - id - id - id - id - id - - - - YES - - YES - backButton - closeButton - delegate - forwardButton - linkOutButton - reloadButton - stopButton - toolBar - webView - - - YES - UIBarButtonItem - UIBarButtonItem - id - UIBarButtonItem - UIBarButtonItem - UIBarButtonItem - UIBarButtonItem - UIToolbar - UIWebView - - - - - - - YES - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSError.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSFileManager.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueCoding.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyValueObserving.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSKeyedArchiver.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSNetServices.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSObject.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSPort.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSRunLoop.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSStream.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSThread.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURL.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSURLConnection.h - - - - NSObject - - IBFrameworkSource - Foundation.framework/Headers/NSXMLParser.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CAAnimation.h - - - - NSObject - - IBFrameworkSource - QuartzCore.framework/Headers/CALayer.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIAccessibility.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UINibLoading.h - - - - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIResponder.h - - - - UIBarButtonItem - UIBarItem - - IBFrameworkSource - UIKit.framework/Headers/UIBarButtonItem.h - - - - UIBarItem - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UIBarItem.h - - - - UIResponder - NSObject - - - - UISearchBar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UISearchBar.h - - - - UISearchDisplayController - NSObject - - IBFrameworkSource - UIKit.framework/Headers/UISearchDisplayController.h - - - - UIToolbar - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIToolbar.h - - - - UIView - - IBFrameworkSource - UIKit.framework/Headers/UITextField.h - - - - UIView - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIView.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UINavigationController.h - - - - UIViewController - - IBFrameworkSource - UIKit.framework/Headers/UITabBarController.h - - - - UIViewController - UIResponder - - IBFrameworkSource - UIKit.framework/Headers/UIViewController.h - - - - UIWebView - UIView - - IBFrameworkSource - UIKit.framework/Headers/UIWebView.h - - - - - 0 - IBCocoaTouchFramework - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS - - - - com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3 - - - YES - ../AdWhirlSDK2_Sample.xcodeproj - 3 - 87 - - diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlWebBrowserController.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlWebBrowserController.h deleted file mode 100644 index 79c7c90e2..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlWebBrowserController.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - - AdWhirlWebBrowserController.h - - Copyright 2009 AdMob, 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. - -*/ - -#import -#import -#import "AdWhirlCustomAdView.h" - -@class AdWhirlWebBrowserController; - -@protocol AdWhirlWebBrowserControllerDelegate - -- (void)webBrowserClosed:(AdWhirlWebBrowserController *)controller; - -@end - - -@interface AdWhirlWebBrowserController : UIViewController { - id delegate; - UIViewController *viewControllerForPresenting; - NSArray *loadingButtons; - NSArray *loadedButtons; - AWCustomAdWebViewAnimType transitionType; - - UIWebView *webView; - UIToolbar *toolBar; - UIBarButtonItem *backButton; - UIBarButtonItem *forwardButton; - UIBarButtonItem *reloadButton; - UIBarButtonItem *stopButton; - UIBarButtonItem *linkOutButton; - UIBarButtonItem *closeButton; -} - -@property (nonatomic,assign) id delegate; -@property (nonatomic,assign) UIViewController *viewControllerForPresenting; -@property (nonatomic,retain) IBOutlet UIWebView *webView; -@property (nonatomic,retain) IBOutlet UIToolbar *toolBar; -@property (nonatomic,retain) IBOutlet UIBarButtonItem *backButton; -@property (nonatomic,retain) IBOutlet UIBarButtonItem *forwardButton; -@property (nonatomic,retain) IBOutlet UIBarButtonItem *reloadButton; -@property (nonatomic,retain) IBOutlet UIBarButtonItem *stopButton; -@property (nonatomic,retain) IBOutlet UIBarButtonItem *linkOutButton; -@property (nonatomic,retain) IBOutlet UIBarButtonItem *closeButton; - -- (void)presentWithController:(UIViewController *)viewController transition:(AWCustomAdWebViewAnimType)animType; -- (void)loadURL:(NSURL *)url; -- (IBAction)back:(id)sender; -- (IBAction)forward:(id)sender; -- (IBAction)reload:(id)sender; -- (IBAction)stop:(id)sender; -- (IBAction)linkOut:(id)sender; -- (IBAction)close:(id)sender; - -@end - -@interface AdWhirlBackButton : UIBarButtonItem -@end - diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlWebBrowserController.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlWebBrowserController.m deleted file mode 100644 index 98e07b538..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/AdWhirlWebBrowserController.m +++ /dev/null @@ -1,266 +0,0 @@ -/* - - AdWhirlWebBrowserController.m - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlWebBrowserController.h" -#import "AdWhirlLog.h" - -#define kAWWebViewAnimDuration 1.0 - -@interface AdWhirlWebBrowserController () -@property (nonatomic,retain) NSArray *loadingButtons; -@property (nonatomic,retain) NSArray *loadedButtons; -@end - - -@implementation AdWhirlWebBrowserController - -@synthesize delegate; -@synthesize viewControllerForPresenting; -@synthesize loadingButtons; -@synthesize loadedButtons; - -@synthesize webView; -@synthesize toolBar; -@synthesize backButton; -@synthesize forwardButton; -@synthesize reloadButton; -@synthesize stopButton; -@synthesize linkOutButton; -@synthesize closeButton; - - -- (id)init { - if ((self = [super initWithNibName:@"AdWhirlWebBrowser" bundle:nil])) { - } - return self; -} - -- (void)viewWillAppear:(BOOL)animated { - [super viewWillAppear:animated]; - if (self.webView.request) { - // has content from before, clear by creating another UIWebView - CGRect frame = self.webView.frame; - NSInteger tag = self.webView.tag; - UIWebView *newView = [[UIWebView alloc] initWithFrame:frame]; - newView.tag = tag; - UIWebView *oldView = self.webView; - [oldView removeFromSuperview]; - [self.view addSubview:newView]; - newView.delegate = self; - newView.scalesPageToFit = YES; - [newView release]; - } - self.toolBar.items = self.loadedButtons; -} - -- (void)viewDidLoad { - [super viewDidLoad]; - NSArray *items = self.toolBar.items; - - NSMutableArray *loadingItems = [[NSMutableArray alloc] init]; - [loadingItems addObjectsFromArray:items]; - [loadingItems removeObjectAtIndex:4]; - self.loadingButtons = loadingItems; - [loadingItems release], loadingItems = nil; - - NSMutableArray *loadedItems = [[NSMutableArray alloc] init]; - [loadedItems addObjectsFromArray:items]; - [loadedItems removeObjectAtIndex:5]; - self.loadedButtons = loadedItems; - [loadedItems release], loadedItems = nil; -} - -- (void)viewDidDisappear:(BOOL)animated { - if (self.delegate) { - [delegate webBrowserClosed:self]; - } -} - -- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { - return [viewControllerForPresenting shouldAutorotateToInterfaceOrientation:interfaceOrientation]; -} - -- (void)didReceiveMemoryWarning { - // Releases the view if it doesn't have a superview. - [super didReceiveMemoryWarning]; - - // Release any cached data, images, etc that aren't in use. -} - -- (void)presentWithController:(UIViewController *)viewController transition:(AWCustomAdWebViewAnimType)animType { - self.viewControllerForPresenting = viewController; - - if ([self respondsToSelector:@selector(setModalTransitionStyle:)]) { - switch (animType) { - case AWCustomAdWebViewAnimTypeFlipFromLeft: - case AWCustomAdWebViewAnimTypeFlipFromRight: - self.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; - break; - case AWCustomAdWebViewAnimTypeFadeIn: - self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; - case AWCustomAdWebViewAnimTypeModal: - default: - self.modalTransitionStyle = UIModalTransitionStyleCoverVertical; - break; - } - } - [viewController presentModalViewController:self animated:YES]; -} - -- (void)loadURL:(NSURL *)url { - NSURLRequest *urlRequest = [NSURLRequest requestWithURL:url]; - [self.webView loadRequest:urlRequest]; -} - -- (void)dealloc { - [loadingButtons release], loadingButtons = nil; - [loadedButtons release], loadedButtons = nil; - - // IBOutlets were retained automatically - webView.delegate = nil; - [webView release], webView = nil; - [toolBar release], toolBar = nil; - [backButton release], backButton = nil; - [forwardButton release], forwardButton = nil; - [reloadButton release], reloadButton = nil; - [stopButton release], stopButton = nil; - [linkOutButton release], linkOutButton = nil; - [closeButton release], closeButton = nil; - [super dealloc]; -} - -#pragma mark - -#pragma mark UIWebViewDelegate methods - -- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request - navigationType:(UIWebViewNavigationType)navigationType { - if ([request URL] != nil && [[request URL] scheme] != nil) { - if ([[[request URL] scheme] isEqualToString:@"mailto"]) { - // need to explicitly call out to the Mail app - [[UIApplication sharedApplication] openURL:[request URL]]; - } - } - return YES; -} - -- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error { - [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; - self.toolBar.items = self.loadedButtons; - if (self.webView.canGoForward) { - self.forwardButton.enabled = YES; - } - if (self.webView.canGoBack) { - self.backButton.enabled = YES; - } - self.reloadButton.enabled = YES; - self.stopButton.enabled = NO; - if (self.webView.request) { - self.linkOutButton.enabled = YES; - } -} - -- (void)webViewDidFinishLoad:(UIWebView *)webView { - [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; - self.toolBar.items = self.loadedButtons; - if (self.webView.canGoForward) { - self.forwardButton.enabled = YES; - } - if (self.webView.canGoBack) { - self.backButton.enabled = YES; - } - self.reloadButton.enabled = YES; - self.stopButton.enabled = NO; - if (self.webView.request) { - self.linkOutButton.enabled = YES; - } - -// // extract title of page -// NSString* title = [self.webView stringByEvaluatingJavaScriptFromString: @"document.title"]; -// self.navigationItem.title = title; -} - -- (void)webViewDidStartLoad:(UIWebView *)webView { - [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; - self.toolBar.items = self.loadingButtons; - self.forwardButton.enabled = NO; - self.backButton.enabled = NO; - self.reloadButton.enabled = NO; - self.stopButton.enabled = YES; -} - -#pragma mark - -#pragma mark button targets - -- (IBAction)forward:(id)sender { - [self.webView goForward]; -} - -- (IBAction)back:(id)sender { - [self.webView goBack]; -} - -- (IBAction)stop:(id)sender { - [self.webView stopLoading]; -} - -- (IBAction)reload:(id)sender { - [self.webView reload]; -} - -- (IBAction)linkOut:(id)sender { - [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; - [[UIApplication sharedApplication] openURL:self.webView.request.URL]; -} - -- (IBAction)close:(id)sender { - [UIApplication sharedApplication].networkActivityIndicatorVisible = NO; - [viewControllerForPresenting dismissModalViewControllerAnimated:YES]; -} - -@end - - -@implementation AdWhirlBackButton - -- (void)awakeFromNib { - // draw the back image - CGColorSpaceRef colorspace = CGColorSpaceCreateDeviceRGB(); - CGContextRef ctx = CGBitmapContextCreate(nil, 25, 25, 8, 0, colorspace, - kCGImageAlphaPremultipliedLast); - CGColorSpaceRelease(colorspace); - CGPoint bot = CGPointMake(19, 2); - CGPoint top = CGPointMake(19, 20); - CGPoint tip = CGPointMake(4, 11); - CGContextSetFillColorWithColor(ctx, [UIColor whiteColor].CGColor); - CGContextMoveToPoint(ctx, bot.x, bot.y); - CGContextAddLineToPoint(ctx, tip.x, tip.y); - CGContextAddLineToPoint(ctx, top.x, top.y); - CGContextFillPath(ctx); - - // set the image - CGImageRef backImgRef = CGBitmapContextCreateImage(ctx); - CGContextRelease(ctx); - UIImage* backImage = [[UIImage alloc] initWithCGImage:backImgRef]; - CGImageRelease(backImgRef); - self.image = backImage; - [backImage release]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/UIColor+AdWhirlConfig.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/UIColor+AdWhirlConfig.h deleted file mode 100644 index 0edf8d924..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/UIColor+AdWhirlConfig.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - - UIColor+AdWhirlConfig.h - - Copyright 2010 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. - - */ - -#import -#import -#import "UIColor+AdWhirlConfig.h" - -@class AdWhirlConfig; - -@interface UIColor (AdWhirlConfig) - -- (id)initWithDict:(NSDictionary *)dict; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/UIColor+AdWhirlConfig.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/UIColor+AdWhirlConfig.m deleted file mode 100644 index e72b96f56..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/internal/UIColor+AdWhirlConfig.m +++ /dev/null @@ -1,73 +0,0 @@ -/* - - UIColor+AdWhirlConfig.m - - Copyright 2010 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. - - */ - -#import "UIColor+AdWhirlConfig.h" -#import "AdWhirlConfig.h" - -@implementation UIColor (AdWhirlConfig) - -- (id)initWithDict:(NSDictionary *)dict { - id red, green, blue, alpha; - CGFloat r, g, b, a; - - red = [dict objectForKey:@"red"]; - if (red == nil) { - [self release]; - return nil; - } - green = [dict objectForKey:@"green"]; - if (green == nil) { - [self release]; - return nil; - } - blue = [dict objectForKey:@"blue"]; - if (blue == nil) { - [self release]; - return nil; - } - - NSInteger temp; - if (!awIntVal(&temp, red)) { - [self release]; - return nil; - } - r = (CGFloat)temp/255.0; - if (!awIntVal(&temp, green)) { - [self release]; - return nil; - } - g = (CGFloat)temp/255.0; - if (!awIntVal(&temp, blue)) { - [self release]; - return nil; - } - b = (CGFloat)temp/255.0; - - a = 1.0; // default 1.0 - alpha = [dict objectForKey:@"alpha"]; - CGFloat temp_f; - if (alpha != nil && awFloatVal(&temp_f, alpha)) { - a = (CGFloat)temp_f; - } - - return [self initWithRed:r green:g blue:b alpha:a]; -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/legacy/ARRollerProtocol.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/legacy/ARRollerProtocol.h deleted file mode 100644 index b471fe65a..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/legacy/ARRollerProtocol.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - - ARRollerProtocol.h - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlDelegateProtocol.h" - -#define ARRollerDelegate AdWhirlDelegate - -#define adRolloApplicationKey adWhirlApplicationKey -#define rollerDidReceiveAd adWhirlDidReceiveAd -#define rollerDidFailToReceiveAd adWhirlDidFailToReceiveAd -#define rollerReceivedRequestForDeveloperToFulfill adWhirlReceivedRequestForDeveloperToFufill -#define rollerReceivedNotificationAdsAreOff adWhirlView -#define willDisplayWebViewCanvas adWhirlWillPresentFullScreenModal -#define didDismissWebViewCanvas adWhirlDidDismissFullScreenModal diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/legacy/ARRollerView.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/legacy/ARRollerView.h deleted file mode 100644 index 4f6753a09..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/AdWhirl/legacy/ARRollerView.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - - ARRollerView.h - - Copyright 2009 AdMob, 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. - -*/ - -#import "AdWhirlView.h" -#import "ARRollerProtocol.h" - -@interface ARRollerView : AdWhirlView - -+ (ARRollerView*)requestRollerViewWithDelegate:(id)delegate; -- (void)getNextAd; -- (void)setDelegateToNil; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/Changelog.txt b/adwhirl/AdWhirlSDK_iOS_3.1.1/Changelog.txt deleted file mode 100644 index 926476bb9..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/Changelog.txt +++ /dev/null @@ -1,103 +0,0 @@ -AdWhirl iPhone SDK Changelog - -For a full detailed change log visit http://code.google.com/p/adwhirl/source/list?repo=sdk - -*************************** -Version 3.1.0 (Nov 15 2011) -*************************** - -- Added support for Nexage network -- Updated InMobi adapter to be compliant with v300 -- Updated Millennial adapter to be compliant with v4.2.6 -- Updated JumpTap adapter to be compliant with v2.0.14.1 -- Fixed Reachability NPE (Issue #118) -- Fixed potential NSError null dereference (Issue #179) - -*************************** -Version 3.0.0 (Apr 1 2011) -*************************** - -- Added support for 640x100 house ads -- Added support for the new Google AdMob Ads SDK -- Updated Millennial Media adapters to support v4.2 of their SDK -- Fixed Issue #178: network activity indicator bug - -*************************** -Version 2.6.3 (Mar 1 2011) -*************************** - -- Modified iAd adapter to use new Portrait/Landscape size constants. -- Added OneRiot adapter. - -*************************** -Version 2.6.2 (Nov 29 2010) -*************************** - -- Fixed Issue #70 with patch from Greystripe -- Fixed Issue #77 by releasing Jumptap object -- Issue #121 updated MdotM Adapter with patch from MdotM -- Added support for BrightRoll (Issue #134) - -*************************** -Version 2.6.1 (Oct 8 2010) -*************************** - -- Fixed Issue #42: Get the appid from the config instead of the delegate when reporting impressions. The delegate may have been gone by then. -- Fixed Issue #104 and #106: Fixed race condition where AdWhirl's refresh timer coincides with iAd's refresh timer, and the old iAd calling back when transitioning to the new iAd. In the process, added stopBeingDelegate required method for ad network adapters. -- Fixed Issue #116: Don't choose next ad network by percent if the total available percentage is 0. -- Don't make new ad request if modal view is active in any case. -- Added InMobi support. -- Remove support for Google AdSense expandables. It does not work with AdWhirl. - -*************************** -Version 2.6.0 (Sep 17 2010) -*************************** - -- Rewrote ads refresh mechanism, which should make ad refreshes more robust (Issues #33, #61, #69, #87): - - Setup a recurring timer regardless of whether ad requests succeeded or not. - - Retries fetching config three times before declaring failure. - - More proactively checking reachability when fetching config (Issue #99). -- Fixed issues with crashes related to network connections and reachability checks (Issues #85, #86, #92) -- Refactored and added tests for AdWhirlConfigStore. -- Fixed Issue 89: Prevent using fade in transition for iAd. -- Fixed Issue 90: Use new class method locationServicesEnabled of CLLocationManager available for iOS 4 to prevent memory leaks and deprecation warnings. -- Fixed Issue 91: nil out adView.delegate in MdotM adapter's dealloc. - -*************************** -Version 2.5.5 (Aug 19 2010) -*************************** - -- Added a test framework and some unit tests, using Google Toolbox for Mac and OCMock -- Added Xcode file templates for new AdWhirl files -- Some code refactoring to facilitate testing -- Allows config refresh using the updateAdWhirlConfig method of AdWhirlView (Issue #73) -- Call disableAdRefresh on MMAdView on adaptor dealloc (Issue #67) -- totalWeight should be a double when checking total weight in AdWhirlConfig.m (Issue #72) - -*************************** -Version 2.5.0 (Jul 28 2010) -*************************** - -- Updated Jumptap adapter for latest Jumptap API (2.0.12.4, 7/13/2010) -- Support decimal rations (Issue #49) -- Reset UIWebView's delegate in AdWhirlWebBrowserController (Issue #64) -- Reseed random() only once (Issue #66) - -*************************** -Version 2.3.1 (Jul 16 2010) -*************************** - -- Added support for ZestAdz. -- Fixed issue #40. Tapping mailto: links in in-app browser now sends users to the Mail App. -- Accepted contribution from Greystripe for an adapter and tested to work. -- Tested with latest Millennial library with iPhone OS 4. -- Tested with latest VideoEgg library with iPhone OS 4. - -*************************** -Version 2.3.0 (Jun 17 2010) -*************************** - -- iAd adapter release. -- Added mechanisms for apps to handle ad size and orientation changes. -- Changed AdWhirlSDK2_Sample to compile with iPhone SDK 4.0 . -- Bug fixes. diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/README b/adwhirl/AdWhirlSDK_iOS_3.1.1/README deleted file mode 100644 index 0d2eafdc9..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/README +++ /dev/null @@ -1 +0,0 @@ -Please see http://www.adwhirl.com/doc/ios/AdWhirliOSSDKSetup.html for setup instructions, Changelog.txt for changes in this version and http://code.google.com/p/adwhirl for the latest news, releases and issue reports. diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/CDataScanner.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/CDataScanner.h deleted file mode 100644 index b48982bab..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/CDataScanner.h +++ /dev/null @@ -1,68 +0,0 @@ -// -// CDataScanner.h -// TouchCode -// -// Created by Jonathan Wight on 04/16/08. -// Copyright 2008 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -// NSScanner - -@interface CDataScanner : NSObject { - NSData *data; - - u_int8_t *start; - u_int8_t *end; - u_int8_t *current; - NSUInteger length; - - NSCharacterSet *doubleCharacters; -} - -@property (readwrite, nonatomic, retain) NSData *data; -@property (readwrite, nonatomic, assign) NSUInteger scanLocation; -@property (readonly, nonatomic, assign) BOOL isAtEnd; - -+ (id)scannerWithData:(NSData *)inData; - -- (unichar)currentCharacter; -- (unichar)scanCharacter; -- (BOOL)scanCharacter:(unichar)inCharacter; - -- (BOOL)scanUTF8String:(const char *)inString intoString:(NSString **)outValue; -- (BOOL)scanString:(NSString *)inString intoString:(NSString **)outValue; -- (BOOL)scanCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue; // inSet must only contain 7-bit ASCII characters - -- (BOOL)scanUpToString:(NSString *)string intoString:(NSString **)outValue; -- (BOOL)scanUpToCharactersFromSet:(NSCharacterSet *)set intoString:(NSString **)outValue; // inSet must only contain 7-bit ASCII characters - -- (BOOL)scanNumber:(NSNumber **)outValue; - -- (void)skipWhitespace; - -- (NSString *)remainingString; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/CDataScanner.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/CDataScanner.m deleted file mode 100644 index 50f3a6709..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/CDataScanner.m +++ /dev/null @@ -1,270 +0,0 @@ -// -// CDataScanner.m -// TouchCode -// -// Created by Jonathan Wight on 04/16/08. -// Copyright 2008 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CDataScanner.h" - -#import "CDataScanner_Extensions.h" - -@interface CDataScanner () -@property (readwrite, nonatomic, retain) NSCharacterSet *doubleCharacters; -@end - -#pragma mark - - -inline static unichar CharacterAtPointer(void *start, void *end) -{ -#pragma unused(end) - -const u_int8_t theByte = *(u_int8_t *)start; -if (theByte & 0x80) - { - // TODO -- UNICODE!!!! (well in theory nothing todo here) - } -const unichar theCharacter = theByte; -return(theCharacter); -} - -@implementation CDataScanner - -@dynamic data; -@dynamic scanLocation; -@dynamic isAtEnd; -@synthesize doubleCharacters; - -+ (id)scannerWithData:(NSData *)inData -{ -CDataScanner *theScanner = [[[self alloc] init] autorelease]; -theScanner.data = inData; -return(theScanner); -} - -- (id)init -{ -if ((self = [super init]) != nil) - { - self.doubleCharacters = [NSCharacterSet characterSetWithCharactersInString:@"0123456789eE-."]; - } -return(self); -} - -- (void)dealloc -{ -self.data = NULL; -self.doubleCharacters = NULL; -// -[super dealloc]; -} - -- (NSUInteger)scanLocation -{ -return(current - start); -} - -- (NSData *)data -{ -return(data); -} - -- (void)setData:(NSData *)inData -{ -if (data != inData) - { - if (data) - { - [data release]; - data = NULL; - } - - if (inData) - { - data = [inData retain]; - // - start = (u_int8_t *)data.bytes; - end = start + data.length; - current = start; - length = data.length; - } - } -} - -- (void)setScanLocation:(NSUInteger)inScanLocation -{ -current = start + inScanLocation; -} - -- (BOOL)isAtEnd -{ -return(self.scanLocation >= length); -} - -- (unichar)currentCharacter -{ -return(CharacterAtPointer(current, end)); -} - -#pragma mark - - -- (unichar)scanCharacter -{ -const unichar theCharacter = CharacterAtPointer(current++, end); -return(theCharacter); -} - -- (BOOL)scanCharacter:(unichar)inCharacter -{ -unichar theCharacter = CharacterAtPointer(current, end); -if (theCharacter == inCharacter) - { - ++current; - return(YES); - } -else - return(NO); -} - -- (BOOL)scanUTF8String:(const char *)inString intoString:(NSString **)outValue; -{ -const size_t theLength = strlen(inString); -if ((size_t)(end - current) < theLength) - return(NO); -if (strncmp((char *)current, inString, theLength) == 0) - { - current += theLength; - if (outValue) - *outValue = [NSString stringWithUTF8String:inString]; - return(YES); - } -return(NO); -} - -- (BOOL)scanString:(NSString *)inString intoString:(NSString **)outValue -{ -if ((size_t)(end - current) < inString.length) - return(NO); -if (strncmp((char *)current, [inString UTF8String], inString.length) == 0) - { - current += inString.length; - if (outValue) - *outValue = inString; - return(YES); - } -return(NO); -} - -- (BOOL)scanCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue -{ -u_int8_t *P; -for (P = current; P < end && [inSet characterIsMember:*P] == YES; ++P) - ; - -if (P == current) - { - return(NO); - } - -if (outValue) - { - *outValue = [[[NSString alloc] initWithBytes:current length:P - current encoding:NSUTF8StringEncoding] autorelease]; - } - -current = P; - -return(YES); -} - -- (BOOL)scanUpToString:(NSString *)inString intoString:(NSString **)outValue -{ -const char *theToken = [inString UTF8String]; -const char *theResult = strnstr((char *)current, theToken, end - current); -if (theResult == NULL) - { - return(NO); - } - -if (outValue) - { - *outValue = [[[NSString alloc] initWithBytes:current length:theResult - (char *)current encoding:NSUTF8StringEncoding] autorelease]; - } - -current = (u_int8_t *)theResult; - -return(YES); -} - -- (BOOL)scanUpToCharactersFromSet:(NSCharacterSet *)inSet intoString:(NSString **)outValue -{ -u_int8_t *P; -for (P = current; P < end && [inSet characterIsMember:*P] == NO; ++P) - ; - -if (P == current) - { - return(NO); - } - -if (outValue) - { - *outValue = [[[NSString alloc] initWithBytes:current length:P - current encoding:NSUTF8StringEncoding] autorelease]; - } - -current = P; - -return(YES); -} - -- (BOOL)scanNumber:(NSNumber **)outValue -{ -// Replace all of this with a strtod call -NSString *theString = NULL; -if ([self scanCharactersFromSet:doubleCharacters intoString:&theString]) - { - if (outValue) - *outValue = [NSNumber numberWithDouble:[theString doubleValue]]; // TODO dont use doubleValue - return(YES); - } -return(NO); -} - -- (void)skipWhitespace -{ -u_int8_t *P; -for (P = current; P < end && (isspace(*P)); ++P) - ; - -current = P; -} - -- (NSString *)remainingString -{ -NSData *theRemainingData = [NSData dataWithBytes:current length:end - current]; -NSString *theString = [[[NSString alloc] initWithData:theRemainingData encoding:NSUTF8StringEncoding] autorelease]; -return(theString); -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/CDataScanner_Extensions.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/CDataScanner_Extensions.h deleted file mode 100644 index c7bf48be0..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/CDataScanner_Extensions.h +++ /dev/null @@ -1,37 +0,0 @@ -// -// CDataScanner_Extensions.h -// TouchCode -// -// Created by Jonathan Wight on 12/08/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CDataScanner.h" - -@interface CDataScanner (CDataScanner_Extensions) - -- (BOOL)scanCStyleComment:(NSString **)outComment; -- (BOOL)scanCPlusPlusStyleComment:(NSString **)outComment; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/CDataScanner_Extensions.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/CDataScanner_Extensions.m deleted file mode 100644 index 1dc338d84..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/CDataScanner_Extensions.m +++ /dev/null @@ -1,80 +0,0 @@ -// -// CDataScanner_Extensions.m -// TouchCode -// -// Created by Jonathan Wight on 12/08/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CDataScanner_Extensions.h" - -#import "NSCharacterSet_Extensions.h" - -@implementation CDataScanner (CDataScanner_Extensions) - -- (BOOL)scanCStyleComment:(NSString **)outComment -{ -if ([self scanString:@"/*" intoString:NULL] == YES) - { - NSString *theComment = NULL; - if ([self scanUpToString:@"*/" intoString:&theComment] == NO) - [NSException raise:NSGenericException format:@"Started to scan a C style comment but it wasn't terminated."]; - - if ([theComment rangeOfString:@"/*"].location != NSNotFound) - [NSException raise:NSGenericException format:@"C style comments should not be nested."]; - - if ([self scanString:@"*/" intoString:NULL] == NO) - [NSException raise:NSGenericException format:@"C style comment did not end correctly."]; - - if (outComment != NULL) - *outComment = theComment; - - return(YES); - } -else - { - return(NO); - } -} - -- (BOOL)scanCPlusPlusStyleComment:(NSString **)outComment -{ -if ([self scanString:@"//" intoString:NULL] == YES) - { - NSString *theComment = NULL; - [self scanUpToCharactersFromSet:[NSCharacterSet linebreaksCharacterSet] intoString:&theComment]; - [self scanCharactersFromSet:[NSCharacterSet linebreaksCharacterSet] intoString:NULL]; - - if (outComment != NULL) - *outComment = theComment; - - return(YES); - } -else - { - return(NO); - } -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSCharacterSet_Extensions.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSCharacterSet_Extensions.h deleted file mode 100644 index cfa9b2692..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSCharacterSet_Extensions.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// NSCharacterSet_Extensions.h -// TouchCode -// -// Created by Jonathan Wight on 12/08/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -@interface NSCharacterSet (NSCharacterSet_Extensions) - -+ (NSCharacterSet *)linebreaksCharacterSet; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSCharacterSet_Extensions.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSCharacterSet_Extensions.m deleted file mode 100644 index 5e62ab8b7..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSCharacterSet_Extensions.m +++ /dev/null @@ -1,48 +0,0 @@ -// -// NSCharacterSet_Extensions.m -// TouchCode -// -// Created by Jonathan Wight on 12/08/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "NSCharacterSet_Extensions.h" - -@implementation NSCharacterSet (NSCharacterSet_Extensions) - -#define LF 0x000a // Line Feed -#define FF 0x000c // Form Feed -#define CR 0x000d // Carriage Return -#define NEL 0x0085 // Next Line -#define LS 0x2028 // Line Separator -#define PS 0x2029 // Paragraph Separator - -+ (NSCharacterSet *)linebreaksCharacterSet -{ -unichar theCharacters[] = { LF, FF, CR, NEL, LS, PS, }; - -return([NSCharacterSet characterSetWithCharactersInString:[NSString stringWithCharacters:theCharacters length:sizeof(theCharacters) / sizeof(*theCharacters)]]); -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSDictionary_JSONExtensions.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSDictionary_JSONExtensions.h deleted file mode 100644 index dccbd7c25..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSDictionary_JSONExtensions.h +++ /dev/null @@ -1,36 +0,0 @@ -// -// NSDictionary_JSONExtensions.h -// TouchCode -// -// Created by Jonathan Wight on 04/17/08. -// Copyright 2008 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -@interface NSDictionary (NSDictionary_JSONExtensions) - -+ (id)dictionaryWithJSONData:(NSData *)inData error:(NSError **)outError; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSDictionary_JSONExtensions.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSDictionary_JSONExtensions.m deleted file mode 100644 index 7b50060ab..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSDictionary_JSONExtensions.m +++ /dev/null @@ -1,41 +0,0 @@ -// -// NSDictionary_JSONExtensions.m -// TouchCode -// -// Created by Jonathan Wight on 04/17/08. -// Copyright 2008 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "NSDictionary_JSONExtensions.h" - -#import "CJSONDeserializer.h" - -@implementation NSDictionary (NSDictionary_JSONExtensions) - -+ (id)dictionaryWithJSONData:(NSData *)inData error:(NSError **)outError -{ -return([[CJSONDeserializer deserializer] deserialize:inData error:outError]); -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSScanner_Extensions.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSScanner_Extensions.h deleted file mode 100644 index 142ec9549..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSScanner_Extensions.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// NSScanner_Extensions.h -// TouchCode -// -// Created by Jonathan Wight on 12/08/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -@interface NSScanner (NSScanner_Extensions) - -- (NSString *)remainingString; - -- (unichar)currentCharacter; -- (unichar)scanCharacter; -- (BOOL)scanCharacter:(unichar)inCharacter; -- (void)backtrack:(unsigned)inCount; - -- (BOOL)scanCStyleComment:(NSString **)outComment; -- (BOOL)scanCPlusPlusStyleComment:(NSString **)outComment; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSScanner_Extensions.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSScanner_Extensions.m deleted file mode 100644 index f06534549..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/Extensions/NSScanner_Extensions.m +++ /dev/null @@ -1,118 +0,0 @@ -// -// NSScanner_Extensions.m -// TouchCode -// -// Created by Jonathan Wight on 12/08/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "NSScanner_Extensions.h" - -#import "NSCharacterSet_Extensions.h" - -@implementation NSScanner (NSScanner_Extensions) - -- (NSString *)remainingString -{ -return([[self string] substringFromIndex:[self scanLocation]]); -} - -- (unichar)currentCharacter -{ -return([[self string] characterAtIndex:[self scanLocation]]); -} - -- (unichar)scanCharacter -{ -unsigned theScanLocation = [self scanLocation]; -unichar theCharacter = [[self string] characterAtIndex:theScanLocation]; -[self setScanLocation:theScanLocation + 1]; -return(theCharacter); -} - -- (BOOL)scanCharacter:(unichar)inCharacter -{ -unsigned theScanLocation = [self scanLocation]; -if ([[self string] characterAtIndex:theScanLocation] == inCharacter) - { - [self setScanLocation:theScanLocation + 1]; - return(YES); - } -else - return(NO); -} - -- (void)backtrack:(unsigned)inCount -{ -unsigned theScanLocation = [self scanLocation]; -if (inCount > theScanLocation) - [NSException raise:NSGenericException format:@"Backtracked too far."]; -[self setScanLocation:theScanLocation - inCount]; -} - -- (BOOL)scanCStyleComment:(NSString **)outComment -{ -if ([self scanString:@"/*" intoString:NULL] == YES) - { - NSString *theComment = NULL; - if ([self scanUpToString:@"*/" intoString:&theComment] == NO) - [NSException raise:NSGenericException format:@"Started to scan a C style comment but it wasn't terminated."]; - - if ([theComment rangeOfString:@"/*"].location != NSNotFound) - [NSException raise:NSGenericException format:@"C style comments should not be nested."]; - - if ([self scanString:@"*/" intoString:NULL] == NO) - [NSException raise:NSGenericException format:@"C style comment did not end correctly."]; - - if (outComment != NULL) - *outComment = theComment; - - return(YES); - } -else - { - return(NO); - } -} - -- (BOOL)scanCPlusPlusStyleComment:(NSString **)outComment -{ -if ([self scanString:@"//" intoString:NULL] == YES) - { - NSString *theComment = NULL; - [self scanUpToCharactersFromSet:[NSCharacterSet linebreaksCharacterSet] intoString:&theComment]; - [self scanCharactersFromSet:[NSCharacterSet linebreaksCharacterSet] intoString:NULL]; - - if (outComment != NULL) - *outComment = theComment; - - return(YES); - } -else - { - return(NO); - } -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDataSerializer.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDataSerializer.h deleted file mode 100644 index 9ec39a582..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDataSerializer.h +++ /dev/null @@ -1,46 +0,0 @@ -// -// CJSONDataSerializer.h -// TouchCode -// -// Created by Jonathan Wight on 12/07/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -@interface CJSONDataSerializer : NSObject { -} - -+ (id)serializer; - -/// Take any JSON compatible object (generally NSNull, NSNumber, NSString, NSArray and NSDictionary) and produce an NSData containing the serialized JSON. -- (NSData *)serializeObject:(id)inObject; - -- (NSData *)serializeNull:(NSNull *)inNull; -- (NSData *)serializeNumber:(NSNumber *)inNumber; -- (NSData *)serializeString:(NSString *)inString; -- (NSData *)serializeArray:(NSArray *)inArray; -- (NSData *)serializeDictionary:(NSDictionary *)inDictionary; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDataSerializer.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDataSerializer.m deleted file mode 100644 index d470dc43c..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDataSerializer.m +++ /dev/null @@ -1,225 +0,0 @@ -// -// CJSONDataSerializer.m -// TouchCode -// -// Created by Jonathan Wight on 12/07/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CJSONDataSerializer.h" - -#import "CSerializedJSONData.h" - -static NSData *kNULL = NULL; -static NSData *kFalse = NULL; -static NSData *kTrue = NULL; - -@implementation CJSONDataSerializer - -+ (void)initialize -{ -NSAutoreleasePool *thePool = [[NSAutoreleasePool alloc] init]; - -@synchronized(@"CJSONDataSerializer") - { - if (kNULL == NULL) - kNULL = [[NSData alloc] initWithBytesNoCopy:"null" length:4 freeWhenDone:NO]; - if (kFalse == NULL) - kFalse = [[NSData alloc] initWithBytesNoCopy:"false" length:5 freeWhenDone:NO]; - if (kTrue == NULL) - kTrue = [[NSData alloc] initWithBytesNoCopy:"true" length:4 freeWhenDone:NO]; - } - -[thePool release]; -} - -+ (id)serializer -{ -return([[[self alloc] init] autorelease]); -} - -- (NSData *)serializeObject:(id)inObject; -{ -NSData *theResult = NULL; - -if ([inObject isKindOfClass:[NSNull class]]) - { - theResult = [self serializeNull:inObject]; - } -else if ([inObject isKindOfClass:[NSNumber class]]) - { - theResult = [self serializeNumber:inObject]; - } -else if ([inObject isKindOfClass:[NSString class]]) - { - theResult = [self serializeString:inObject]; - } -else if ([inObject isKindOfClass:[NSArray class]]) - { - theResult = [self serializeArray:inObject]; - } -else if ([inObject isKindOfClass:[NSDictionary class]]) - { - theResult = [self serializeDictionary:inObject]; - } -else if ([inObject isKindOfClass:[NSData class]]) - { - NSString *theString = [[[NSString alloc] initWithData:inObject encoding:NSUTF8StringEncoding] autorelease]; - theResult = [self serializeString:theString]; - } -else if ([inObject isKindOfClass:[CSerializedJSONData class]]) - { - theResult = [inObject data]; - } -else - { - [NSException raise:NSGenericException format:@"Cannot serialize data of type '%@'", NSStringFromClass([inObject class])]; - } -if (theResult == NULL) - [NSException raise:NSGenericException format:@"Could not serialize object '%@'", inObject]; -return(theResult); -} - -- (NSData *)serializeNull:(NSNull *)inNull -{ -#pragma unused (inNull) -return(kNULL); -} - -- (NSData *)serializeNumber:(NSNumber *)inNumber -{ -NSData *theResult = NULL; -switch (CFNumberGetType((CFNumberRef)inNumber)) - { - case kCFNumberCharType: - { - int theValue = [inNumber intValue]; - if (theValue == 0) - theResult = kFalse; - else if (theValue == 1) - theResult = kTrue; - else - theResult = [[inNumber stringValue] dataUsingEncoding:NSASCIIStringEncoding]; - } - break; - case kCFNumberFloat32Type: - case kCFNumberFloat64Type: - case kCFNumberFloatType: - case kCFNumberDoubleType: - case kCFNumberSInt8Type: - case kCFNumberSInt16Type: - case kCFNumberSInt32Type: - case kCFNumberSInt64Type: - case kCFNumberShortType: - case kCFNumberIntType: - case kCFNumberLongType: - case kCFNumberLongLongType: - case kCFNumberCFIndexType: - default: - theResult = [[inNumber stringValue] dataUsingEncoding:NSASCIIStringEncoding]; - break; - } -return(theResult); -} - -- (NSData *)serializeString:(NSString *)inString -{ -NSMutableString *theMutableCopy = [[inString mutableCopy] autorelease]; -[theMutableCopy replaceOccurrencesOfString:@"\\" withString:@"\\\\" options:0 range:NSMakeRange(0, [theMutableCopy length])]; -[theMutableCopy replaceOccurrencesOfString:@"\"" withString:@"\\\"" options:0 range:NSMakeRange(0, [theMutableCopy length])]; -[theMutableCopy replaceOccurrencesOfString:@"/" withString:@"\\/" options:0 range:NSMakeRange(0, [theMutableCopy length])]; -[theMutableCopy replaceOccurrencesOfString:@"\b" withString:@"\\b" options:0 range:NSMakeRange(0, [theMutableCopy length])]; -[theMutableCopy replaceOccurrencesOfString:@"\f" withString:@"\\f" options:0 range:NSMakeRange(0, [theMutableCopy length])]; -[theMutableCopy replaceOccurrencesOfString:@"\n" withString:@"\\n" options:0 range:NSMakeRange(0, [theMutableCopy length])]; -[theMutableCopy replaceOccurrencesOfString:@"\r" withString:@"\\r" options:0 range:NSMakeRange(0, [theMutableCopy length])]; -[theMutableCopy replaceOccurrencesOfString:@"\t" withString:@"\\t" options:0 range:NSMakeRange(0, [theMutableCopy length])]; -/* - case 'u': - { - theCharacter = 0; - - int theShift; - for (theShift = 12; theShift >= 0; theShift -= 4) - { - int theDigit = HexToInt([self scanCharacter]); - if (theDigit == -1) - { - [self setScanLocation:theScanLocation]; - return(NO); - } - theCharacter |= (theDigit << theShift); - } - } -*/ -return([[NSString stringWithFormat:@"\"%@\"", theMutableCopy] dataUsingEncoding:NSUTF8StringEncoding]); -} - -- (NSData *)serializeArray:(NSArray *)inArray -{ -NSMutableData *theData = [NSMutableData data]; - -[theData appendBytes:"[" length:1]; - -NSEnumerator *theEnumerator = [inArray objectEnumerator]; -id theValue = NULL; -NSUInteger i = 0; -while ((theValue = [theEnumerator nextObject]) != NULL) - { - [theData appendData:[self serializeObject:theValue]]; - if (++i < [inArray count]) - [theData appendBytes:"," length:1]; - } - -[theData appendBytes:"]" length:1]; - -return(theData); -} - -- (NSData *)serializeDictionary:(NSDictionary *)inDictionary -{ -NSMutableData *theData = [NSMutableData data]; - -[theData appendBytes:"{" length:1]; - -NSArray *theKeys = [inDictionary allKeys]; -NSEnumerator *theEnumerator = [theKeys objectEnumerator]; -NSString *theKey = NULL; -while ((theKey = [theEnumerator nextObject]) != NULL) - { - id theValue = [inDictionary objectForKey:theKey]; - - [theData appendData:[self serializeString:theKey]]; - [theData appendBytes:":" length:1]; - [theData appendData:[self serializeObject:theValue]]; - - if (theKey != [theKeys lastObject]) - [theData appendData:[@"," dataUsingEncoding:NSASCIIStringEncoding]]; - } - -[theData appendBytes:"}" length:1]; - -return(theData); -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDeserializer.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDeserializer.h deleted file mode 100755 index 3af96cc39..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDeserializer.h +++ /dev/null @@ -1,45 +0,0 @@ -// -// CJSONDeserializer.h -// TouchCode -// -// Created by Jonathan Wight on 12/15/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -extern NSString *const kJSONDeserializerErrorDomain /* = @"CJSONDeserializerErrorDomain" */; - -@interface CJSONDeserializer : NSObject { - -} - -+ (id)deserializer; - -- (id)deserialize:(NSData *)inData error:(NSError **)outError; - -- (id)deserializeAsDictionary:(NSData *)inData error:(NSError **)outError; -- (id)deserializeAsArray:(NSData *)inData error:(NSError **)outError; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDeserializer.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDeserializer.m deleted file mode 100755 index d5ba6573f..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONDeserializer.m +++ /dev/null @@ -1,95 +0,0 @@ -// -// CJSONDeserializer.m -// TouchCode -// -// Created by Jonathan Wight on 12/15/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CJSONDeserializer.h" - -#import "CJSONScanner.h" -#import "CDataScanner.h" - -NSString *const kJSONDeserializerErrorDomain = @"CJSONDeserializerErrorDomain"; - -@implementation CJSONDeserializer - -+ (id)deserializer -{ -return([[[self alloc] init] autorelease]); -} - -- (id)deserialize:(NSData *)inData error:(NSError **)outError -{ -if (inData == NULL || [inData length] == 0) - { - if (outError) - *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:-1 userInfo:NULL]; - - return(NULL); - } -CJSONScanner *theScanner = [CJSONScanner scannerWithData:inData]; -id theObject = NULL; -if ([theScanner scanJSONObject:&theObject error:outError] == YES) - return(theObject); -else - return(NULL); -} - -- (id)deserializeAsDictionary:(NSData *)inData error:(NSError **)outError; -{ -if (inData == NULL || [inData length] == 0) - { - if (outError) - *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:-1 userInfo:NULL]; - - return(NULL); - } -CJSONScanner *theScanner = [CJSONScanner scannerWithData:inData]; -NSDictionary *theDictionary = NULL; -if ([theScanner scanJSONDictionary:&theDictionary error:outError] == YES) - return(theDictionary); -else - return(NULL); -} - -- (id)deserializeAsArray:(NSData *)inData error:(NSError **)outError; -{ -if (inData == NULL || [inData length] == 0) - { - if (outError) - *outError = [NSError errorWithDomain:kJSONDeserializerErrorDomain code:-1 userInfo:NULL]; - - return(NULL); - } -CJSONScanner *theScanner = [CJSONScanner scannerWithData:inData]; -NSArray *theArray = NULL; -if ([theScanner scanJSONArray:&theArray error:outError] == YES) - return(theArray); -else - return(NULL); -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONScanner.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONScanner.h deleted file mode 100644 index 9a53db974..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONScanner.h +++ /dev/null @@ -1,44 +0,0 @@ -// -// CJSONScanner.h -// TouchCode -// -// Created by Jonathan Wight on 12/07/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CDataScanner.h" - -/// CDataScanner subclass that understands JSON syntax natively. You should generally use CJSONDeserializer instead of this class. (TODO - this could have been a category?) -@interface CJSONScanner : CDataScanner { -} - -- (BOOL)scanJSONObject:(id *)outObject error:(NSError **)outError; -- (BOOL)scanJSONDictionary:(NSDictionary **)outDictionary error:(NSError **)outError; -- (BOOL)scanJSONArray:(NSArray **)outArray error:(NSError **)outError; -- (BOOL)scanJSONStringConstant:(NSString **)outStringConstant error:(NSError **)outError; -- (BOOL)scanJSONNumberConstant:(NSNumber **)outNumberConstant error:(NSError **)outError; - -@end - -extern NSString *const kJSONScannerErrorDomain /* = @"CJSONScannerErrorDomain" */; diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONScanner.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONScanner.m deleted file mode 100644 index 9f2b4770b..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONScanner.m +++ /dev/null @@ -1,539 +0,0 @@ -// -// CJSONScanner.m -// TouchCode -// -// Created by Jonathan Wight on 12/07/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CJSONScanner.h" - -#import "NSCharacterSet_Extensions.h" -#import "CDataScanner_Extensions.h" - -#if !defined(TREAT_COMMENTS_AS_WHITESPACE) -#define TREAT_COMMENTS_AS_WHITESPACE 0 -#endif // !defined(TREAT_COMMENTS_AS_WHITESPACE) - -NSString *const kJSONScannerErrorDomain = @"CJSONScannerErrorDomain"; - -inline static int HexToInt(char inCharacter) -{ -int theValues[] = { 0x0 /* 48 '0' */, 0x1 /* 49 '1' */, 0x2 /* 50 '2' */, 0x3 /* 51 '3' */, 0x4 /* 52 '4' */, 0x5 /* 53 '5' */, 0x6 /* 54 '6' */, 0x7 /* 55 '7' */, 0x8 /* 56 '8' */, 0x9 /* 57 '9' */, -1 /* 58 ':' */, -1 /* 59 ';' */, -1 /* 60 '<' */, -1 /* 61 '=' */, -1 /* 62 '>' */, -1 /* 63 '?' */, -1 /* 64 '@' */, 0xa /* 65 'A' */, 0xb /* 66 'B' */, 0xc /* 67 'C' */, 0xd /* 68 'D' */, 0xe /* 69 'E' */, 0xf /* 70 'F' */, -1 /* 71 'G' */, -1 /* 72 'H' */, -1 /* 73 'I' */, -1 /* 74 'J' */, -1 /* 75 'K' */, -1 /* 76 'L' */, -1 /* 77 'M' */, -1 /* 78 'N' */, -1 /* 79 'O' */, -1 /* 80 'P' */, -1 /* 81 'Q' */, -1 /* 82 'R' */, -1 /* 83 'S' */, -1 /* 84 'T' */, -1 /* 85 'U' */, -1 /* 86 'V' */, -1 /* 87 'W' */, -1 /* 88 'X' */, -1 /* 89 'Y' */, -1 /* 90 'Z' */, -1 /* 91 '[' */, -1 /* 92 '\' */, -1 /* 93 ']' */, -1 /* 94 '^' */, -1 /* 95 '_' */, -1 /* 96 '`' */, 0xa /* 97 'a' */, 0xb /* 98 'b' */, 0xc /* 99 'c' */, 0xd /* 100 'd' */, 0xe /* 101 'e' */, 0xf /* 102 'f' */, }; -if (inCharacter >= '0' && inCharacter <= 'f') - return(theValues[inCharacter - '0']); -else - return(-1); -} - -@interface CJSONScanner () -- (BOOL)scanNotQuoteCharactersIntoString:(NSString **)outValue; -@end - -#pragma mark - - -@implementation CJSONScanner - -- (id)init -{ -if ((self = [super init]) != nil) - { - } -return(self); -} - -- (void)dealloc -{ -// -[super dealloc]; -} - -#pragma mark - - -- (void)setData:(NSData *)inData -{ -NSData *theData = inData; -if (theData && theData.length >= 4) - { - // This code is lame, but it works. Because the first character of any JSON string will always be a (ascii) control character we can work out the Unicode encoding by the bit pattern. See section 3 of http://www.ietf.org/rfc/rfc4627.txt - const char *theChars = theData.bytes; - NSStringEncoding theEncoding = NSUTF8StringEncoding; - if (theChars[0] != 0 && theChars[1] == 0) - { - if (theChars[2] != 0 && theChars[3] == 0) - theEncoding = NSUTF16LittleEndianStringEncoding; - else if (theChars[2] == 0 && theChars[3] == 0) - theEncoding = NSUTF32LittleEndianStringEncoding; - } - else if (theChars[0] == 0 && theChars[2] == 0 && theChars[3] != 0) - { - if (theChars[1] == 0) - theEncoding = NSUTF32BigEndianStringEncoding; - else if (theChars[1] != 0) - theEncoding = NSUTF16BigEndianStringEncoding; - } - - if (theEncoding != NSUTF8StringEncoding) - { - NSString *theString = [[NSString alloc] initWithData:theData encoding:theEncoding]; - theData = [theString dataUsingEncoding:NSUTF8StringEncoding]; - [theString release]; - } - } -[super setData:theData]; -} - -#pragma mark - - -- (BOOL)scanJSONObject:(id *)outObject error:(NSError **)outError -{ -BOOL theResult = YES; - -[self skipWhitespace]; - -id theObject = NULL; - -const unichar C = [self currentCharacter]; -switch (C) - { - case 't': - if ([self scanUTF8String:"true" intoString:NULL]) - { - theObject = [NSNumber numberWithBool:YES]; - } - break; - case 'f': - if ([self scanUTF8String:"false" intoString:NULL]) - { - theObject = [NSNumber numberWithBool:NO]; - } - break; - case 'n': - if ([self scanUTF8String:"null" intoString:NULL]) - { - theObject = [NSNull null]; - } - break; - case '\"': - case '\'': - theResult = [self scanJSONStringConstant:&theObject error:outError]; - break; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case '-': - theResult = [self scanJSONNumberConstant:&theObject error:outError]; - break; - case '{': - theResult = [self scanJSONDictionary:&theObject error:outError]; - break; - case '[': - theResult = [self scanJSONArray:&theObject error:outError]; - break; - default: - - break; - } - -if (outObject != NULL) - *outObject = theObject; - -return(theResult); -} - -- (BOOL)scanJSONDictionary:(NSDictionary **)outDictionary error:(NSError **)outError -{ -NSUInteger theScanLocation = [self scanLocation]; - -if ([self scanCharacter:'{'] == NO) - { - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Dictionary that does not start with '{' character.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-1 userInfo:theUserInfo]; - } - return(NO); - } - -NSMutableDictionary *theDictionary = [[NSMutableDictionary alloc] init]; - -while ([self currentCharacter] != '}') - { - [self skipWhitespace]; - - if ([self currentCharacter] == '}') - break; - - NSString *theKey = NULL; - if ([self scanJSONStringConstant:&theKey error:outError] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Failed to scan a key.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-2 userInfo:theUserInfo]; - } - [theDictionary release]; - return(NO); - } - - [self skipWhitespace]; - - if ([self scanCharacter:':'] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Key was not terminated with a ':' character.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-3 userInfo:theUserInfo]; - } - [theDictionary release]; - return(NO); - } - - id theValue = NULL; - if ([self scanJSONObject:&theValue error:outError] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Failed to scan a value.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-4 userInfo:theUserInfo]; - } - [theDictionary release]; - return(NO); - } - - [theDictionary setValue:theValue forKey:theKey]; - - [self skipWhitespace]; - if ([self scanCharacter:','] == NO) - { - if ([self currentCharacter] != '}') - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Key value pairs not delimited with a ',' character.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-5 userInfo:theUserInfo]; - } - [theDictionary release]; - return(NO); - } - break; - } - else - { - [self skipWhitespace]; - if ([self currentCharacter] == '}') - break; - } - } - -if ([self scanCharacter:'}'] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan dictionary. Dictionary not terminated by a '}' character.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-6 userInfo:theUserInfo]; - } - [theDictionary release]; - return(NO); - } - -if (outDictionary != NULL) - *outDictionary = [[theDictionary copy] autorelease]; - -[theDictionary release]; - -return(YES); -} - -- (BOOL)scanJSONArray:(NSArray **)outArray error:(NSError **)outError -{ -NSUInteger theScanLocation = [self scanLocation]; - -if ([self scanCharacter:'['] == NO) - { - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan array. Array not started by a '{' character.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-7 userInfo:theUserInfo]; - } - return(NO); - } - -NSMutableArray *theArray = [[NSMutableArray alloc] init]; - -[self skipWhitespace]; -while ([self currentCharacter] != ']') - { - NSString *theValue = NULL; - if ([self scanJSONObject:&theValue error:outError] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan array. Could not scan a value.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-8 userInfo:theUserInfo]; - } - [theArray release]; - return(NO); - } - - [theArray addObject:theValue]; - - [self skipWhitespace]; - if ([self scanCharacter:','] == NO) - { - [self skipWhitespace]; - if ([self currentCharacter] != ']') - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan array. Array not terminated by a ']' character.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-9 userInfo:theUserInfo]; - } - [theArray release]; - return(NO); - } - - break; - } - [self skipWhitespace]; - } - -[self skipWhitespace]; - -if ([self scanCharacter:']'] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan array. Array not terminated by a ']' character.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-10 userInfo:theUserInfo]; - } - [theArray release]; - return(NO); - } - -if (outArray != NULL) - *outArray = [[theArray copy] autorelease]; - -[theArray release]; - -return(YES); -} - -- (BOOL)scanJSONStringConstant:(NSString **)outStringConstant error:(NSError **)outError -{ -NSUInteger theScanLocation = [self scanLocation]; - -[self skipWhitespace]; // TODO - i want to remove this method. But breaks unit tests. - -NSMutableString *theString = [[NSMutableString alloc] init]; - -if ([self scanCharacter:'"'] == NO) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan string constant. String not started by a '\"' character.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-11 userInfo:theUserInfo]; - } - [theString release]; - return(NO); - } - -while ([self scanCharacter:'"'] == NO) - { - NSString *theStringChunk = NULL; - if ([self scanNotQuoteCharactersIntoString:&theStringChunk]) - { - [theString appendString:theStringChunk]; - } - - if ([self scanCharacter:'\\'] == YES) - { - unichar theCharacter = [self scanCharacter]; - switch (theCharacter) - { - case '"': - case '\\': - case '/': - break; - case 'b': - theCharacter = '\b'; - break; - case 'f': - theCharacter = '\f'; - break; - case 'n': - theCharacter = '\n'; - break; - case 'r': - theCharacter = '\r'; - break; - case 't': - theCharacter = '\t'; - break; - case 'u': - { - theCharacter = 0; - - int theShift; - for (theShift = 12; theShift >= 0; theShift -= 4) - { - const int theDigit = HexToInt([self scanCharacter]); - if (theDigit == -1) - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan string constant. Unicode character could not be decoded.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-12 userInfo:theUserInfo]; - } - [theString release]; - return(NO); - } - theCharacter |= (theDigit << theShift); - } - } - break; - default: - { - [self setScanLocation:theScanLocation]; - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan string constant. Unknown escape code.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-13 userInfo:theUserInfo]; - } - [theString release]; - return(NO); - } - break; - } - CFStringAppendCharacters((CFMutableStringRef)theString, &theCharacter, 1); - } - } - -if (outStringConstant != NULL) - *outStringConstant = [[theString copy] autorelease]; - -[theString release]; - -return(YES); -} - -- (BOOL)scanJSONNumberConstant:(NSNumber **)outNumberConstant error:(NSError **)outError -{ -NSNumber *theNumber = NULL; -if ([self scanNumber:&theNumber] == YES) - { - if (outNumberConstant != NULL) - *outNumberConstant = theNumber; - return(YES); - } -else - { - if (outError) - { - NSDictionary *theUserInfo = [NSDictionary dictionaryWithObjectsAndKeys: - @"Could not scan number constant.", NSLocalizedDescriptionKey, - NULL]; - *outError = [NSError errorWithDomain:kJSONScannerErrorDomain code:-14 userInfo:theUserInfo]; - } - return(NO); - } -} - -#if TREAT_COMMENTS_AS_WHITESPACE -- (void)skipWhitespace -{ -[super skipWhitespace]; -[self scanCStyleComment:NULL]; -[self scanCPlusPlusStyleComment:NULL]; -[super skipWhitespace]; -} -#endif // TREAT_COMMENTS_AS_WHITESPACE - -#pragma mark - - -- (BOOL)scanNotQuoteCharactersIntoString:(NSString **)outValue -{ -u_int8_t *P; -for (P = current; P < end && *P != '\"' && *P != '\\'; ++P) - ; - -if (P == current) - { - return(NO); - } - -if (outValue) - { - *outValue = [[[NSString alloc] initWithBytes:current length:P - current encoding:NSUTF8StringEncoding] autorelease]; - } - -current = P; - -return(YES); -} - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONSerializer.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONSerializer.h deleted file mode 100644 index 43f75d0d9..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONSerializer.h +++ /dev/null @@ -1,47 +0,0 @@ -// -// CJSONSerializer.h -// TouchCode -// -// Created by Jonathan Wight on 12/07/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -@class CJSONDataSerializer; - -/// Serialize JSON compatible objects (NSNull, NSNumber, NSString, NSArray, NSDictionary) into a JSON formatted string. Note this class is just a wrapper around CJSONDataSerializer which you really should be using instead. -@interface CJSONSerializer : NSObject { - CJSONDataSerializer *serializer; -} - -+ (id)serializer; - -/// Take any JSON compatible object (generally NSNull, NSNumber, NSString, NSArray and NSDictionary) and produce a JSON string. -- (NSString *)serializeObject:(id)inObject; - -- (NSString *)serializeArray:(NSArray *)inArray; -- (NSString *)serializeDictionary:(NSDictionary *)inDictionary; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONSerializer.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONSerializer.m deleted file mode 100644 index 46baa98af..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CJSONSerializer.m +++ /dev/null @@ -1,75 +0,0 @@ -// -// CJSONSerializer.m -// TouchCode -// -// Created by Jonathan Wight on 12/07/2005. -// Copyright 2005 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CJSONSerializer.h" - -#import "CJSONDataSerializer.h" - -@implementation CJSONSerializer - -+ (id)serializer -{ -return([[[self alloc] init] autorelease]); -} - -- (id)init -{ -if ((self = [super init]) != NULL) - { - serializer = [[CJSONDataSerializer alloc] init]; - } -return(self); -} - -- (void)dealloc -{ -[serializer release]; -serializer = NULL; -// -[super dealloc]; -} - -- (NSString *)serializeObject:(id)inObject; -{ -NSData *theData = [serializer serializeObject:inObject]; -return([[[NSString alloc] initWithData:theData encoding:NSUTF8StringEncoding] autorelease]); -} - -- (NSString *)serializeArray:(NSArray *)inArray -{ -NSData *theData = [serializer serializeArray:inArray]; -return([[[NSString alloc] initWithData:theData encoding:NSUTF8StringEncoding] autorelease]); -} - -- (NSString *)serializeDictionary:(NSDictionary *)inDictionary; -{ -NSData *theData = [serializer serializeDictionary:inDictionary]; -return([[[NSString alloc] initWithData:theData encoding:NSUTF8StringEncoding] autorelease]); -} -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CSerializedJSONData.h b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CSerializedJSONData.h deleted file mode 100644 index 70f600d89..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CSerializedJSONData.h +++ /dev/null @@ -1,40 +0,0 @@ -// -// CSerializedJSONData.h -// TouchCode -// -// Created by Jonathan Wight on 10/23/09. -// Copyright 2009 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import - -@interface CSerializedJSONData : NSObject { - NSData *data; -} - -@property (readonly, nonatomic, retain) NSData *data; - -- (id)initWithData:(NSData *)inData; - -@end diff --git a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CSerializedJSONData.m b/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CSerializedJSONData.m deleted file mode 100644 index 707cf2f32..000000000 --- a/adwhirl/AdWhirlSDK_iOS_3.1.1/TouchJSON/JSON/CSerializedJSONData.m +++ /dev/null @@ -1,54 +0,0 @@ -// -// CSerializedJSONData.m -// TouchCode -// -// Created by Jonathan Wight on 10/23/09. -// Copyright 2009 toxicsoftware.com. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. -// - -#import "CSerializedJSONData.h" - -@implementation CSerializedJSONData - -@synthesize data; - -- (id)initWithData:(NSData *)inData; -{ -if ((self = [self init]) != NULL) - { - data = inData; - } -return(self); -} - -- (void)dealloc -{ -[data release]; -data = NULL; -// -[super dealloc]; -} - - -@end diff --git a/projects/mtg/Android/AndroidManifest.xml b/projects/mtg/Android/AndroidManifest.xml index 67f9ad26e..570694fad 100644 --- a/projects/mtg/Android/AndroidManifest.xml +++ b/projects/mtg/Android/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/projects/mtg/Android/default.properties b/projects/mtg/Android/default.properties index 9a2c9f6c8..8010039f3 100644 --- a/projects/mtg/Android/default.properties +++ b/projects/mtg/Android/default.properties @@ -8,4 +8,4 @@ # project structure. # Project target. -target=android-9 +target=android-10 diff --git a/projects/mtg/Android/gen/R.java.d b/projects/mtg/Android/gen/R.java.d new file mode 100644 index 000000000..3b5cb5410 --- /dev/null +++ b/projects/mtg/Android/gen/R.java.d @@ -0,0 +1,10 @@ +/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/gen/net/wagic/app/R.java \ + : /Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-hdpi/icon.png \ +/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-ldpi/icon.png \ +/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-mdpi/icon.png \ +/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/layout/main.xml \ +/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/values/strings.xml \ +/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-hdpi/icon.png \ +/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-ldpi/icon.png \ +/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-mdpi/icon.png \ +/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/AndroidManifest.xml \ diff --git a/projects/mtg/Android/gen/net/wagic/app/BuildConfig.java b/projects/mtg/Android/gen/net/wagic/app/BuildConfig.java new file mode 100644 index 000000000..c70b441e9 --- /dev/null +++ b/projects/mtg/Android/gen/net/wagic/app/BuildConfig.java @@ -0,0 +1,6 @@ +/** Automatically generated file. DO NOT MODIFY */ +package net.wagic.app; + +public final class BuildConfig { + public final static boolean DEBUG = true; +} \ No newline at end of file diff --git a/projects/mtg/Android/gen/net/wagic/app/R.java b/projects/mtg/Android/gen/net/wagic/app/R.java new file mode 100644 index 000000000..ec5e38a14 --- /dev/null +++ b/projects/mtg/Android/gen/net/wagic/app/R.java @@ -0,0 +1,27 @@ +/* AUTO-GENERATED FILE. DO NOT MODIFY. + * + * This class was automatically generated by the + * aapt tool from the resource data it found. It + * should not be modified by hand. + */ + +package net.wagic.app; + +public final class R { + public static final class attr { + } + public static final class drawable { + public static final int icon=0x7f020000; + } + public static final class id { + public static final int mainLayout=0x7f050000; + } + public static final class layout { + public static final int main=0x7f030000; + } + public static final class string { + public static final int app_name=0x7f040000; + public static final int app_version=0x7f040001; + public static final int info_text=0x7f040002; + } +} diff --git a/projects/mtg/Android/project.properties b/projects/mtg/Android/project.properties index c6998b3d1..b7c2081d5 100644 --- a/projects/mtg/Android/project.properties +++ b/projects/mtg/Android/project.properties @@ -11,4 +11,4 @@ #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt # Project target. -target=android-9 +target=android-10 diff --git a/projects/mtg/Default-568h@2x.png b/projects/mtg/Default-568h@2x.png new file mode 100644 index 000000000..5ff4e4ce4 Binary files /dev/null and b/projects/mtg/Default-568h@2x.png differ diff --git a/projects/mtg/Makefile.linux b/projects/mtg/Makefile.linux new file mode 100644 index 000000000..609ac182c --- /dev/null +++ b/projects/mtg/Makefile.linux @@ -0,0 +1 @@ +FMOD= diff --git a/projects/mtg/build.number.properties b/projects/mtg/build.number.properties index 63a056a81..721346776 100644 --- a/projects/mtg/build.number.properties +++ b/projects/mtg/build.number.properties @@ -2,5 +2,5 @@ #Sun, 06 May 2012 11:56:35 -0700 build.major=0 build.minor=19 -build.point=0 +build.point=1 diff --git a/projects/mtg/iOS/Reachability/Reachability 2.0.4ddg/Reachability/Reachability.m b/projects/mtg/iOS/Reachability/Reachability 2.0.4ddg/Reachability/Reachability.m index 566f4882f..05ed2692f 100644 --- a/projects/mtg/iOS/Reachability/Reachability 2.0.4ddg/Reachability/Reachability.m +++ b/projects/mtg/iOS/Reachability/Reachability 2.0.4ddg/Reachability/Reachability.m @@ -161,13 +161,13 @@ static void logNetworkStatus_(const char *name, int line, NetworkStatus status) switch (status) { case kNotReachable: - statusString = [NSString stringWithString: @"Not Reachable"]; + statusString = @"Not Reachable"; break; case kReachableViaWWAN: - statusString = [NSString stringWithString: @"Reachable via WWAN"]; + statusString = @"Reachable via WWAN"; break; case kReachableViaWiFi: - statusString = [NSString stringWithString: @"Reachable via WiFi"]; + statusString = @"Reachable via WiFi"; break; } diff --git a/projects/mtg/include/Wagic_Version.h b/projects/mtg/include/Wagic_Version.h index 918f836d2..8b3e45b2e 100644 --- a/projects/mtg/include/Wagic_Version.h +++ b/projects/mtg/include/Wagic_Version.h @@ -13,7 +13,7 @@ Author: Michael Nguyen /* Wagic versions */ #define WAGIC_VERSION_MAJOR 0 #define WAGIC_VERSION_MEDIUM 19 -#define WAGIC_VERSION_MINOR 0 +#define WAGIC_VERSION_MINOR 1 #define VERSION_DOT(a, b, c) a ##.## b ##.## c #define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c @@ -30,4 +30,4 @@ Author: Michael Nguyen #endif - \ No newline at end of file + diff --git a/projects/mtg/wagic.xcodeproj/project.pbxproj b/projects/mtg/wagic.xcodeproj/project.pbxproj index cf9275fe4..8da43af99 100755 --- a/projects/mtg/wagic.xcodeproj/project.pbxproj +++ b/projects/mtg/wagic.xcodeproj/project.pbxproj @@ -19,10 +19,6 @@ 12059D7214980B7200DAC43B /* zfs.vcxproj.filters in Resources */ = {isa = PBXBuildFile; fileRef = 12B8122C1404B9E10092E303 /* zfs.vcxproj.filters */; }; 12059D7314980B7200DAC43B /* modrules.xml in Resources */ = {isa = PBXBuildFile; fileRef = 129654D5148AA2390031100B /* modrules.xml */; }; 12059D7414980B7200DAC43B /* README.txt in Resources */ = {isa = PBXBuildFile; fileRef = 128ED37A148BAE7B00C58E83 /* README.txt */; }; - 12059D7514980B7200DAC43B /* README in Resources */ = {isa = PBXBuildFile; fileRef = 128ED3EF148BC94B00C58E83 /* README */; }; - 12059D7614980B7200DAC43B /* AdWhirlWebBrowser.xib in Resources */ = {isa = PBXBuildFile; fileRef = 128ED42D148BC94B00C58E83 /* AdWhirlWebBrowser.xib */; }; - 12059D7714980B7200DAC43B /* Changelog.txt in Resources */ = {isa = PBXBuildFile; fileRef = 128ED475148BC94B00C58E83 /* Changelog.txt */; }; - 12059D7814980B7200DAC43B /* README in Resources */ = {isa = PBXBuildFile; fileRef = 128ED481148BC94C00C58E83 /* README */; }; 12059D7914980B7200DAC43B /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 12211ECA1494811D00641703 /* Default.png */; }; 12059D7A14980B7200DAC43B /* Default-Landscape~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 12211ECC149481B600641703 /* Default-Landscape~ipad.png */; }; 12059D7B14980B7200DAC43B /* Default-Portrait~ipad.png in Resources */ = {isa = PBXBuildFile; fileRef = 12211ECE149481C300641703 /* Default-Portrait~ipad.png */; }; @@ -184,36 +180,6 @@ 12059E1914980B7300DAC43B /* AIPlayerBakaB.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12769484144127380088F6D3 /* AIPlayerBakaB.cpp */; }; 12059E1A14980B7300DAC43B /* TestSuiteAI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12769485144127380088F6D3 /* TestSuiteAI.cpp */; }; 12059E1B14980B7300DAC43B /* AbilityParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12CCA02F144A05D100E343A0 /* AbilityParser.cpp */; }; - 12059E1C14980B7300DAC43B /* AdWhirlAdapterGoogleAdMobAds.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED3F5148BC94B00C58E83 /* AdWhirlAdapterGoogleAdMobAds.m */; }; - 12059E1D14980B7300DAC43B /* AdWhirlAdapterIAd.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED3FB148BC94B00C58E83 /* AdWhirlAdapterIAd.m */; }; - 12059E1E14980B7300DAC43B /* AdWhirlAdapterCustom.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED413148BC94B00C58E83 /* AdWhirlAdapterCustom.m */; }; - 12059E1F14980B7300DAC43B /* AdWhirlAdapterEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED415148BC94B00C58E83 /* AdWhirlAdapterEvent.m */; }; - 12059E2014980B7300DAC43B /* AdWhirlAdapterGeneric.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED417148BC94B00C58E83 /* AdWhirlAdapterGeneric.m */; }; - 12059E2114980B7300DAC43B /* AdWhirlAdNetworkAdapter+Helpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED419148BC94B00C58E83 /* AdWhirlAdNetworkAdapter+Helpers.m */; }; - 12059E2214980B7300DAC43B /* AdWhirlAdNetworkAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED41A148BC94B00C58E83 /* AdWhirlAdNetworkAdapter.m */; }; - 12059E2314980B7300DAC43B /* AdWhirlAdNetworkConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED41C148BC94B00C58E83 /* AdWhirlAdNetworkConfig.m */; }; - 12059E2414980B7300DAC43B /* AdWhirlAdNetworkRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED41E148BC94B00C58E83 /* AdWhirlAdNetworkRegistry.m */; }; - 12059E2514980B7300DAC43B /* AdWhirlClassWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED420148BC94B00C58E83 /* AdWhirlClassWrapper.m */; }; - 12059E2614980B7300DAC43B /* AdWhirlConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED422148BC94B00C58E83 /* AdWhirlConfig.m */; }; - 12059E2714980B7300DAC43B /* AdWhirlConfigStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED424148BC94B00C58E83 /* AdWhirlConfigStore.m */; }; - 12059E2814980B7300DAC43B /* AdWhirlCustomAdView.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED426148BC94B00C58E83 /* AdWhirlCustomAdView.m */; }; - 12059E2914980B7300DAC43B /* AdWhirlError.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED428148BC94B00C58E83 /* AdWhirlError.m */; }; - 12059E2A14980B7300DAC43B /* AdWhirlLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED42A148BC94B00C58E83 /* AdWhirlLog.m */; }; - 12059E2B14980B7300DAC43B /* AdWhirlView.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED42C148BC94B00C58E83 /* AdWhirlView.m */; }; - 12059E2C14980B7300DAC43B /* AdWhirlWebBrowserController.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED42F148BC94B00C58E83 /* AdWhirlWebBrowserController.m */; }; - 12059E2D14980B7300DAC43B /* ARRollerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED430148BC94B00C58E83 /* ARRollerView.m */; }; - 12059E2E14980B7300DAC43B /* AWNetworkReachabilityWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED433148BC94B00C58E83 /* AWNetworkReachabilityWrapper.m */; }; - 12059E2F14980B7300DAC43B /* UIColor+AdWhirlConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED435148BC94B00C58E83 /* UIColor+AdWhirlConfig.m */; }; - 12059E3014980B7300DAC43B /* CDataScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED484148BC94C00C58E83 /* CDataScanner.m */; }; - 12059E3114980B7300DAC43B /* CDataScanner_Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED487148BC94C00C58E83 /* CDataScanner_Extensions.m */; }; - 12059E3214980B7300DAC43B /* NSCharacterSet_Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED489148BC94C00C58E83 /* NSCharacterSet_Extensions.m */; }; - 12059E3314980B7300DAC43B /* NSDictionary_JSONExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED48B148BC94C00C58E83 /* NSDictionary_JSONExtensions.m */; }; - 12059E3414980B7300DAC43B /* NSScanner_Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED48D148BC94C00C58E83 /* NSScanner_Extensions.m */; }; - 12059E3514980B7300DAC43B /* CJSONDataSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED490148BC94C00C58E83 /* CJSONDataSerializer.m */; }; - 12059E3614980B7300DAC43B /* CJSONDeserializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED492148BC94C00C58E83 /* CJSONDeserializer.m */; }; - 12059E3714980B7300DAC43B /* CJSONScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED494148BC94C00C58E83 /* CJSONScanner.m */; }; - 12059E3814980B7300DAC43B /* CJSONSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED496148BC94C00C58E83 /* CJSONSerializer.m */; }; - 12059E3914980B7300DAC43B /* CSerializedJSONData.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED498148BC94C00C58E83 /* CSerializedJSONData.m */; }; 12059E3A14980B7300DAC43B /* ASIAuthenticationDialog.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2814931CBB00641703 /* ASIAuthenticationDialog.m */; }; 12059E3B14980B7300DAC43B /* ASIDataCompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2B14931CBB00641703 /* ASIDataCompressor.m */; }; 12059E3C14980B7300DAC43B /* ASIDataDecompressor.m in Sources */ = {isa = PBXBuildFile; fileRef = 12211E2D14931CBB00641703 /* ASIDataDecompressor.m */; }; @@ -287,40 +253,6 @@ 128ED380148BAEC900C58E83 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED37D148BAEC900C58E83 /* AudioToolbox.framework */; }; 128ED381148BAEC900C58E83 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED37E148BAEC900C58E83 /* MessageUI.framework */; }; 128ED382148BAEC900C58E83 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED37F148BAEC900C58E83 /* SystemConfiguration.framework */; }; - 128ED4A9148BC94D00C58E83 /* README in Resources */ = {isa = PBXBuildFile; fileRef = 128ED3EF148BC94B00C58E83 /* README */; }; - 128ED4AB148BC94D00C58E83 /* AdWhirlAdapterGoogleAdMobAds.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED3F5148BC94B00C58E83 /* AdWhirlAdapterGoogleAdMobAds.m */; }; - 128ED4AE148BC94D00C58E83 /* AdWhirlAdapterIAd.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED3FB148BC94B00C58E83 /* AdWhirlAdapterIAd.m */; }; - 128ED4B8148BC94D00C58E83 /* AdWhirlAdapterCustom.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED413148BC94B00C58E83 /* AdWhirlAdapterCustom.m */; }; - 128ED4B9148BC94D00C58E83 /* AdWhirlAdapterEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED415148BC94B00C58E83 /* AdWhirlAdapterEvent.m */; }; - 128ED4BA148BC94D00C58E83 /* AdWhirlAdapterGeneric.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED417148BC94B00C58E83 /* AdWhirlAdapterGeneric.m */; }; - 128ED4BB148BC94D00C58E83 /* AdWhirlAdNetworkAdapter+Helpers.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED419148BC94B00C58E83 /* AdWhirlAdNetworkAdapter+Helpers.m */; }; - 128ED4BC148BC94D00C58E83 /* AdWhirlAdNetworkAdapter.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED41A148BC94B00C58E83 /* AdWhirlAdNetworkAdapter.m */; }; - 128ED4BD148BC94D00C58E83 /* AdWhirlAdNetworkConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED41C148BC94B00C58E83 /* AdWhirlAdNetworkConfig.m */; }; - 128ED4BE148BC94D00C58E83 /* AdWhirlAdNetworkRegistry.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED41E148BC94B00C58E83 /* AdWhirlAdNetworkRegistry.m */; }; - 128ED4BF148BC94D00C58E83 /* AdWhirlClassWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED420148BC94B00C58E83 /* AdWhirlClassWrapper.m */; }; - 128ED4C0148BC94D00C58E83 /* AdWhirlConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED422148BC94B00C58E83 /* AdWhirlConfig.m */; }; - 128ED4C1148BC94D00C58E83 /* AdWhirlConfigStore.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED424148BC94B00C58E83 /* AdWhirlConfigStore.m */; }; - 128ED4C2148BC94D00C58E83 /* AdWhirlCustomAdView.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED426148BC94B00C58E83 /* AdWhirlCustomAdView.m */; }; - 128ED4C3148BC94D00C58E83 /* AdWhirlError.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED428148BC94B00C58E83 /* AdWhirlError.m */; }; - 128ED4C4148BC94D00C58E83 /* AdWhirlLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED42A148BC94B00C58E83 /* AdWhirlLog.m */; }; - 128ED4C5148BC94D00C58E83 /* AdWhirlView.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED42C148BC94B00C58E83 /* AdWhirlView.m */; }; - 128ED4C6148BC94D00C58E83 /* AdWhirlWebBrowser.xib in Resources */ = {isa = PBXBuildFile; fileRef = 128ED42D148BC94B00C58E83 /* AdWhirlWebBrowser.xib */; }; - 128ED4C7148BC94D00C58E83 /* AdWhirlWebBrowserController.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED42F148BC94B00C58E83 /* AdWhirlWebBrowserController.m */; }; - 128ED4C8148BC94D00C58E83 /* ARRollerView.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED430148BC94B00C58E83 /* ARRollerView.m */; }; - 128ED4C9148BC94D00C58E83 /* AWNetworkReachabilityWrapper.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED433148BC94B00C58E83 /* AWNetworkReachabilityWrapper.m */; }; - 128ED4CA148BC94D00C58E83 /* UIColor+AdWhirlConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED435148BC94B00C58E83 /* UIColor+AdWhirlConfig.m */; }; - 128ED4E8148BC94D00C58E83 /* Changelog.txt in Resources */ = {isa = PBXBuildFile; fileRef = 128ED475148BC94B00C58E83 /* Changelog.txt */; }; - 128ED4F0148BC94D00C58E83 /* README in Resources */ = {isa = PBXBuildFile; fileRef = 128ED481148BC94C00C58E83 /* README */; }; - 128ED4F1148BC94D00C58E83 /* CDataScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED484148BC94C00C58E83 /* CDataScanner.m */; }; - 128ED4F2148BC94D00C58E83 /* CDataScanner_Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED487148BC94C00C58E83 /* CDataScanner_Extensions.m */; }; - 128ED4F3148BC94D00C58E83 /* NSCharacterSet_Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED489148BC94C00C58E83 /* NSCharacterSet_Extensions.m */; }; - 128ED4F4148BC94D00C58E83 /* NSDictionary_JSONExtensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED48B148BC94C00C58E83 /* NSDictionary_JSONExtensions.m */; }; - 128ED4F5148BC94D00C58E83 /* NSScanner_Extensions.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED48D148BC94C00C58E83 /* NSScanner_Extensions.m */; }; - 128ED4F6148BC94D00C58E83 /* CJSONDataSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED490148BC94C00C58E83 /* CJSONDataSerializer.m */; }; - 128ED4F7148BC94D00C58E83 /* CJSONDeserializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED492148BC94C00C58E83 /* CJSONDeserializer.m */; }; - 128ED4F8148BC94D00C58E83 /* CJSONScanner.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED494148BC94C00C58E83 /* CJSONScanner.m */; }; - 128ED4F9148BC94D00C58E83 /* CJSONSerializer.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED496148BC94C00C58E83 /* CJSONSerializer.m */; }; - 128ED4FA148BC94D00C58E83 /* CSerializedJSONData.m in Sources */ = {isa = PBXBuildFile; fileRef = 128ED498148BC94C00C58E83 /* CSerializedJSONData.m */; }; 128ED508148BCB7D00C58E83 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED507148BCB7D00C58E83 /* CoreLocation.framework */; }; 128ED50D148BCBBC00C58E83 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50A148BCBBC00C58E83 /* AVFoundation.framework */; }; 128ED510148BCC1900C58E83 /* libsqlite3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 128ED50F148BCC1900C58E83 /* libsqlite3.dylib */; settings = {ATTRIBUTES = (Weak, ); }; }; @@ -577,8 +509,6 @@ 12769485144127380088F6D3 /* TestSuiteAI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TestSuiteAI.cpp; sourceTree = ""; }; 127694891441274D0088F6D3 /* AIPlayerBaka.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AIPlayerBaka.h; sourceTree = ""; }; 1276948A1441274D0088F6D3 /* AIPlayerBakaB.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AIPlayerBakaB.h; sourceTree = ""; }; - 1278F94C149145BB00A7A373 /* AdWhirlAdapterGoogleAdSense.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlAdapterGoogleAdSense.m; sourceTree = ""; }; - 1278F94D149145BB00A7A373 /* AdWhirlAdapterGoogleAdSense.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlAdapterGoogleAdSense.h; sourceTree = ""; }; 127D4C6E1376B33200109AB4 /* mtg.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = mtg.txt; path = bin/Res/sets/primitives/mtg.txt; sourceTree = ""; }; 128ED373148BAE7B00C58E83 /* GADBannerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADBannerView.h; sourceTree = ""; }; 128ED374148BAE7B00C58E83 /* GADBannerViewDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GADBannerViewDelegate.h; sourceTree = ""; }; @@ -591,74 +521,6 @@ 128ED37D148BAEC900C58E83 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; 128ED37E148BAEC900C58E83 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; 128ED37F148BAEC900C58E83 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; - 128ED3EF148BC94B00C58E83 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; - 128ED3F4148BC94B00C58E83 /* AdWhirlAdapterGoogleAdMobAds.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlAdapterGoogleAdMobAds.h; sourceTree = ""; }; - 128ED3F5148BC94B00C58E83 /* AdWhirlAdapterGoogleAdMobAds.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlAdapterGoogleAdMobAds.m; sourceTree = ""; }; - 128ED3FA148BC94B00C58E83 /* AdWhirlAdapterIAd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlAdapterIAd.h; sourceTree = ""; }; - 128ED3FB148BC94B00C58E83 /* AdWhirlAdapterIAd.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlAdapterIAd.m; sourceTree = ""; }; - 128ED40E148BC94B00C58E83 /* AdWhirlAdNetworkAdapter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlAdNetworkAdapter.h; sourceTree = ""; }; - 128ED40F148BC94B00C58E83 /* AdWhirlDelegateProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlDelegateProtocol.h; sourceTree = ""; }; - 128ED410148BC94B00C58E83 /* AdWhirlView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlView.h; sourceTree = ""; }; - 128ED412148BC94B00C58E83 /* AdWhirlAdapterCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlAdapterCustom.h; sourceTree = ""; }; - 128ED413148BC94B00C58E83 /* AdWhirlAdapterCustom.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlAdapterCustom.m; sourceTree = ""; }; - 128ED414148BC94B00C58E83 /* AdWhirlAdapterEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlAdapterEvent.h; sourceTree = ""; }; - 128ED415148BC94B00C58E83 /* AdWhirlAdapterEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlAdapterEvent.m; sourceTree = ""; }; - 128ED416148BC94B00C58E83 /* AdWhirlAdapterGeneric.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlAdapterGeneric.h; sourceTree = ""; }; - 128ED417148BC94B00C58E83 /* AdWhirlAdapterGeneric.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlAdapterGeneric.m; sourceTree = ""; }; - 128ED418148BC94B00C58E83 /* AdWhirlAdNetworkAdapter+Helpers.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AdWhirlAdNetworkAdapter+Helpers.h"; sourceTree = ""; }; - 128ED419148BC94B00C58E83 /* AdWhirlAdNetworkAdapter+Helpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "AdWhirlAdNetworkAdapter+Helpers.m"; sourceTree = ""; }; - 128ED41A148BC94B00C58E83 /* AdWhirlAdNetworkAdapter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlAdNetworkAdapter.m; sourceTree = ""; }; - 128ED41B148BC94B00C58E83 /* AdWhirlAdNetworkConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlAdNetworkConfig.h; sourceTree = ""; }; - 128ED41C148BC94B00C58E83 /* AdWhirlAdNetworkConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlAdNetworkConfig.m; sourceTree = ""; }; - 128ED41D148BC94B00C58E83 /* AdWhirlAdNetworkRegistry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlAdNetworkRegistry.h; sourceTree = ""; }; - 128ED41E148BC94B00C58E83 /* AdWhirlAdNetworkRegistry.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlAdNetworkRegistry.m; sourceTree = ""; }; - 128ED41F148BC94B00C58E83 /* AdWhirlClassWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlClassWrapper.h; sourceTree = ""; }; - 128ED420148BC94B00C58E83 /* AdWhirlClassWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlClassWrapper.m; sourceTree = ""; }; - 128ED421148BC94B00C58E83 /* AdWhirlConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlConfig.h; sourceTree = ""; }; - 128ED422148BC94B00C58E83 /* AdWhirlConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlConfig.m; sourceTree = ""; }; - 128ED423148BC94B00C58E83 /* AdWhirlConfigStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlConfigStore.h; sourceTree = ""; }; - 128ED424148BC94B00C58E83 /* AdWhirlConfigStore.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlConfigStore.m; sourceTree = ""; }; - 128ED425148BC94B00C58E83 /* AdWhirlCustomAdView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlCustomAdView.h; sourceTree = ""; }; - 128ED426148BC94B00C58E83 /* AdWhirlCustomAdView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlCustomAdView.m; sourceTree = ""; }; - 128ED427148BC94B00C58E83 /* AdWhirlError.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlError.h; sourceTree = ""; }; - 128ED428148BC94B00C58E83 /* AdWhirlError.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlError.m; sourceTree = ""; }; - 128ED429148BC94B00C58E83 /* AdWhirlLog.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlLog.h; sourceTree = ""; }; - 128ED42A148BC94B00C58E83 /* AdWhirlLog.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlLog.m; sourceTree = ""; }; - 128ED42B148BC94B00C58E83 /* AdWhirlView+.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "AdWhirlView+.h"; sourceTree = ""; }; - 128ED42C148BC94B00C58E83 /* AdWhirlView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlView.m; sourceTree = ""; }; - 128ED42D148BC94B00C58E83 /* AdWhirlWebBrowser.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = AdWhirlWebBrowser.xib; sourceTree = ""; }; - 128ED42E148BC94B00C58E83 /* AdWhirlWebBrowserController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AdWhirlWebBrowserController.h; sourceTree = ""; }; - 128ED42F148BC94B00C58E83 /* AdWhirlWebBrowserController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AdWhirlWebBrowserController.m; sourceTree = ""; }; - 128ED430148BC94B00C58E83 /* ARRollerView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ARRollerView.m; sourceTree = ""; }; - 128ED431148BC94B00C58E83 /* AWNetworkReachabilityDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AWNetworkReachabilityDelegate.h; sourceTree = ""; }; - 128ED432148BC94B00C58E83 /* AWNetworkReachabilityWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AWNetworkReachabilityWrapper.h; sourceTree = ""; }; - 128ED433148BC94B00C58E83 /* AWNetworkReachabilityWrapper.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AWNetworkReachabilityWrapper.m; sourceTree = ""; }; - 128ED434148BC94B00C58E83 /* UIColor+AdWhirlConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIColor+AdWhirlConfig.h"; sourceTree = ""; }; - 128ED435148BC94B00C58E83 /* UIColor+AdWhirlConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIColor+AdWhirlConfig.m"; sourceTree = ""; }; - 128ED437148BC94B00C58E83 /* ARRollerProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARRollerProtocol.h; sourceTree = ""; }; - 128ED438148BC94B00C58E83 /* ARRollerView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ARRollerView.h; sourceTree = ""; }; - 128ED475148BC94B00C58E83 /* Changelog.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Changelog.txt; sourceTree = ""; }; - 128ED481148BC94C00C58E83 /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; - 128ED483148BC94C00C58E83 /* CDataScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDataScanner.h; sourceTree = ""; }; - 128ED484148BC94C00C58E83 /* CDataScanner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDataScanner.m; sourceTree = ""; }; - 128ED486148BC94C00C58E83 /* CDataScanner_Extensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CDataScanner_Extensions.h; sourceTree = ""; }; - 128ED487148BC94C00C58E83 /* CDataScanner_Extensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CDataScanner_Extensions.m; sourceTree = ""; }; - 128ED488148BC94C00C58E83 /* NSCharacterSet_Extensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSCharacterSet_Extensions.h; sourceTree = ""; }; - 128ED489148BC94C00C58E83 /* NSCharacterSet_Extensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSCharacterSet_Extensions.m; sourceTree = ""; }; - 128ED48A148BC94C00C58E83 /* NSDictionary_JSONExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSDictionary_JSONExtensions.h; sourceTree = ""; }; - 128ED48B148BC94C00C58E83 /* NSDictionary_JSONExtensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSDictionary_JSONExtensions.m; sourceTree = ""; }; - 128ED48C148BC94C00C58E83 /* NSScanner_Extensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NSScanner_Extensions.h; sourceTree = ""; }; - 128ED48D148BC94C00C58E83 /* NSScanner_Extensions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = NSScanner_Extensions.m; sourceTree = ""; }; - 128ED48F148BC94C00C58E83 /* CJSONDataSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONDataSerializer.h; sourceTree = ""; }; - 128ED490148BC94C00C58E83 /* CJSONDataSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONDataSerializer.m; sourceTree = ""; }; - 128ED491148BC94C00C58E83 /* CJSONDeserializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONDeserializer.h; sourceTree = ""; }; - 128ED492148BC94C00C58E83 /* CJSONDeserializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONDeserializer.m; sourceTree = ""; }; - 128ED493148BC94C00C58E83 /* CJSONScanner.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONScanner.h; sourceTree = ""; }; - 128ED494148BC94C00C58E83 /* CJSONScanner.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONScanner.m; sourceTree = ""; }; - 128ED495148BC94C00C58E83 /* CJSONSerializer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CJSONSerializer.h; sourceTree = ""; }; - 128ED496148BC94C00C58E83 /* CJSONSerializer.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CJSONSerializer.m; sourceTree = ""; }; - 128ED497148BC94C00C58E83 /* CSerializedJSONData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSerializedJSONData.h; sourceTree = ""; }; - 128ED498148BC94C00C58E83 /* CSerializedJSONData.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CSerializedJSONData.m; sourceTree = ""; }; 128ED507148BCB7D00C58E83 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; 128ED509148BCBBC00C58E83 /* AddressBook.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AddressBook.framework; path = System/Library/Frameworks/AddressBook.framework; sourceTree = SDKROOT; }; 128ED50A148BCBBC00C58E83 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; @@ -1188,7 +1050,6 @@ 125C5CF213B09AA200DF2F2C /* Tools */ = { isa = PBXGroup; children = ( - 128ED3ED148BC94B00C58E83 /* AdWhirlSDK_iOS_3.1.1 */, 128ED372148BAE7B00C58E83 /* GoogleAdMobAdsSDKiOS-5.0.5 */, 12211EA014933D4A00641703 /* minizip */, 12211E9E14933CC200641703 /* ZipArchive */, @@ -1212,148 +1073,6 @@ path = "../../admobsdk/iOS/GoogleAdMobAdsSDKiOS-5.0.5"; sourceTree = ""; }; - 128ED3ED148BC94B00C58E83 /* AdWhirlSDK_iOS_3.1.1 */ = { - isa = PBXGroup; - children = ( - 128ED3EE148BC94B00C58E83 /* AdNetworkLibs */, - 128ED3F0148BC94B00C58E83 /* AdWhirl */, - 128ED475148BC94B00C58E83 /* Changelog.txt */, - 128ED481148BC94C00C58E83 /* README */, - 128ED482148BC94C00C58E83 /* TouchJSON */, - ); - name = AdWhirlSDK_iOS_3.1.1; - path = ../../adwhirl/AdWhirlSDK_iOS_3.1.1; - sourceTree = ""; - }; - 128ED3EE148BC94B00C58E83 /* AdNetworkLibs */ = { - isa = PBXGroup; - children = ( - 128ED3EF148BC94B00C58E83 /* README */, - ); - path = AdNetworkLibs; - sourceTree = ""; - }; - 128ED3F0148BC94B00C58E83 /* AdWhirl */ = { - isa = PBXGroup; - children = ( - 128ED3F1148BC94B00C58E83 /* adapters */, - 128ED40F148BC94B00C58E83 /* AdWhirlDelegateProtocol.h */, - 128ED410148BC94B00C58E83 /* AdWhirlView.h */, - 128ED411148BC94B00C58E83 /* internal */, - 128ED436148BC94B00C58E83 /* legacy */, - ); - path = AdWhirl; - sourceTree = ""; - }; - 128ED3F1148BC94B00C58E83 /* adapters */ = { - isa = PBXGroup; - children = ( - 1278F94C149145BB00A7A373 /* AdWhirlAdapterGoogleAdSense.m */, - 1278F94D149145BB00A7A373 /* AdWhirlAdapterGoogleAdSense.h */, - 128ED3F4148BC94B00C58E83 /* AdWhirlAdapterGoogleAdMobAds.h */, - 128ED3F5148BC94B00C58E83 /* AdWhirlAdapterGoogleAdMobAds.m */, - 128ED3FA148BC94B00C58E83 /* AdWhirlAdapterIAd.h */, - 128ED3FB148BC94B00C58E83 /* AdWhirlAdapterIAd.m */, - 128ED40E148BC94B00C58E83 /* AdWhirlAdNetworkAdapter.h */, - ); - path = adapters; - sourceTree = ""; - }; - 128ED411148BC94B00C58E83 /* internal */ = { - isa = PBXGroup; - children = ( - 128ED412148BC94B00C58E83 /* AdWhirlAdapterCustom.h */, - 128ED413148BC94B00C58E83 /* AdWhirlAdapterCustom.m */, - 128ED414148BC94B00C58E83 /* AdWhirlAdapterEvent.h */, - 128ED415148BC94B00C58E83 /* AdWhirlAdapterEvent.m */, - 128ED416148BC94B00C58E83 /* AdWhirlAdapterGeneric.h */, - 128ED417148BC94B00C58E83 /* AdWhirlAdapterGeneric.m */, - 128ED418148BC94B00C58E83 /* AdWhirlAdNetworkAdapter+Helpers.h */, - 128ED419148BC94B00C58E83 /* AdWhirlAdNetworkAdapter+Helpers.m */, - 128ED41A148BC94B00C58E83 /* AdWhirlAdNetworkAdapter.m */, - 128ED41B148BC94B00C58E83 /* AdWhirlAdNetworkConfig.h */, - 128ED41C148BC94B00C58E83 /* AdWhirlAdNetworkConfig.m */, - 128ED41D148BC94B00C58E83 /* AdWhirlAdNetworkRegistry.h */, - 128ED41E148BC94B00C58E83 /* AdWhirlAdNetworkRegistry.m */, - 128ED41F148BC94B00C58E83 /* AdWhirlClassWrapper.h */, - 128ED420148BC94B00C58E83 /* AdWhirlClassWrapper.m */, - 128ED421148BC94B00C58E83 /* AdWhirlConfig.h */, - 128ED422148BC94B00C58E83 /* AdWhirlConfig.m */, - 128ED423148BC94B00C58E83 /* AdWhirlConfigStore.h */, - 128ED424148BC94B00C58E83 /* AdWhirlConfigStore.m */, - 128ED425148BC94B00C58E83 /* AdWhirlCustomAdView.h */, - 128ED426148BC94B00C58E83 /* AdWhirlCustomAdView.m */, - 128ED427148BC94B00C58E83 /* AdWhirlError.h */, - 128ED428148BC94B00C58E83 /* AdWhirlError.m */, - 128ED429148BC94B00C58E83 /* AdWhirlLog.h */, - 128ED42A148BC94B00C58E83 /* AdWhirlLog.m */, - 128ED42B148BC94B00C58E83 /* AdWhirlView+.h */, - 128ED42C148BC94B00C58E83 /* AdWhirlView.m */, - 128ED42D148BC94B00C58E83 /* AdWhirlWebBrowser.xib */, - 128ED42E148BC94B00C58E83 /* AdWhirlWebBrowserController.h */, - 128ED42F148BC94B00C58E83 /* AdWhirlWebBrowserController.m */, - 128ED430148BC94B00C58E83 /* ARRollerView.m */, - 128ED431148BC94B00C58E83 /* AWNetworkReachabilityDelegate.h */, - 128ED432148BC94B00C58E83 /* AWNetworkReachabilityWrapper.h */, - 128ED433148BC94B00C58E83 /* AWNetworkReachabilityWrapper.m */, - 128ED434148BC94B00C58E83 /* UIColor+AdWhirlConfig.h */, - 128ED435148BC94B00C58E83 /* UIColor+AdWhirlConfig.m */, - ); - path = internal; - sourceTree = ""; - }; - 128ED436148BC94B00C58E83 /* legacy */ = { - isa = PBXGroup; - children = ( - 128ED437148BC94B00C58E83 /* ARRollerProtocol.h */, - 128ED438148BC94B00C58E83 /* ARRollerView.h */, - ); - path = legacy; - sourceTree = ""; - }; - 128ED482148BC94C00C58E83 /* TouchJSON */ = { - isa = PBXGroup; - children = ( - 128ED483148BC94C00C58E83 /* CDataScanner.h */, - 128ED484148BC94C00C58E83 /* CDataScanner.m */, - 128ED485148BC94C00C58E83 /* Extensions */, - 128ED48E148BC94C00C58E83 /* JSON */, - ); - path = TouchJSON; - sourceTree = ""; - }; - 128ED485148BC94C00C58E83 /* Extensions */ = { - isa = PBXGroup; - children = ( - 128ED486148BC94C00C58E83 /* CDataScanner_Extensions.h */, - 128ED487148BC94C00C58E83 /* CDataScanner_Extensions.m */, - 128ED488148BC94C00C58E83 /* NSCharacterSet_Extensions.h */, - 128ED489148BC94C00C58E83 /* NSCharacterSet_Extensions.m */, - 128ED48A148BC94C00C58E83 /* NSDictionary_JSONExtensions.h */, - 128ED48B148BC94C00C58E83 /* NSDictionary_JSONExtensions.m */, - 128ED48C148BC94C00C58E83 /* NSScanner_Extensions.h */, - 128ED48D148BC94C00C58E83 /* NSScanner_Extensions.m */, - ); - path = Extensions; - sourceTree = ""; - }; - 128ED48E148BC94C00C58E83 /* JSON */ = { - isa = PBXGroup; - children = ( - 128ED48F148BC94C00C58E83 /* CJSONDataSerializer.h */, - 128ED490148BC94C00C58E83 /* CJSONDataSerializer.m */, - 128ED491148BC94C00C58E83 /* CJSONDeserializer.h */, - 128ED492148BC94C00C58E83 /* CJSONDeserializer.m */, - 128ED493148BC94C00C58E83 /* CJSONScanner.h */, - 128ED494148BC94C00C58E83 /* CJSONScanner.m */, - 128ED495148BC94C00C58E83 /* CJSONSerializer.h */, - 128ED496148BC94C00C58E83 /* CJSONSerializer.m */, - 128ED497148BC94C00C58E83 /* CSerializedJSONData.h */, - 128ED498148BC94C00C58E83 /* CSerializedJSONData.m */, - ); - path = JSON; - sourceTree = ""; - }; 128FB96A149537A600ED4EE6 /* Images */ = { isa = PBXGroup; children = ( @@ -2017,10 +1736,6 @@ 12059D7214980B7200DAC43B /* zfs.vcxproj.filters in Resources */, 12059D7314980B7200DAC43B /* modrules.xml in Resources */, 12059D7414980B7200DAC43B /* README.txt in Resources */, - 12059D7514980B7200DAC43B /* README in Resources */, - 12059D7614980B7200DAC43B /* AdWhirlWebBrowser.xib in Resources */, - 12059D7714980B7200DAC43B /* Changelog.txt in Resources */, - 12059D7814980B7200DAC43B /* README in Resources */, 12059D7914980B7200DAC43B /* Default.png in Resources */, 12059D7A14980B7200DAC43B /* Default-Landscape~ipad.png in Resources */, 12059D7B14980B7200DAC43B /* Default-Portrait~ipad.png in Resources */, @@ -2046,10 +1761,6 @@ 12B8123C1404B9E20092E303 /* zfs.vcxproj.filters in Resources */, 129654D6148AA23A0031100B /* modrules.xml in Resources */, 128ED37C148BAE7B00C58E83 /* README.txt in Resources */, - 128ED4A9148BC94D00C58E83 /* README in Resources */, - 128ED4C6148BC94D00C58E83 /* AdWhirlWebBrowser.xib in Resources */, - 128ED4E8148BC94D00C58E83 /* Changelog.txt in Resources */, - 128ED4F0148BC94D00C58E83 /* README in Resources */, 12211ECB1494811D00641703 /* Default.png in Resources */, 12211ECD149481B600641703 /* Default-Landscape~ipad.png in Resources */, 12211ECF149481C400641703 /* Default-Portrait~ipad.png in Resources */, @@ -2221,36 +1932,6 @@ 12059E1914980B7300DAC43B /* AIPlayerBakaB.cpp in Sources */, 12059E1A14980B7300DAC43B /* TestSuiteAI.cpp in Sources */, 12059E1B14980B7300DAC43B /* AbilityParser.cpp in Sources */, - 12059E1C14980B7300DAC43B /* AdWhirlAdapterGoogleAdMobAds.m in Sources */, - 12059E1D14980B7300DAC43B /* AdWhirlAdapterIAd.m in Sources */, - 12059E1E14980B7300DAC43B /* AdWhirlAdapterCustom.m in Sources */, - 12059E1F14980B7300DAC43B /* AdWhirlAdapterEvent.m in Sources */, - 12059E2014980B7300DAC43B /* AdWhirlAdapterGeneric.m in Sources */, - 12059E2114980B7300DAC43B /* AdWhirlAdNetworkAdapter+Helpers.m in Sources */, - 12059E2214980B7300DAC43B /* AdWhirlAdNetworkAdapter.m in Sources */, - 12059E2314980B7300DAC43B /* AdWhirlAdNetworkConfig.m in Sources */, - 12059E2414980B7300DAC43B /* AdWhirlAdNetworkRegistry.m in Sources */, - 12059E2514980B7300DAC43B /* AdWhirlClassWrapper.m in Sources */, - 12059E2614980B7300DAC43B /* AdWhirlConfig.m in Sources */, - 12059E2714980B7300DAC43B /* AdWhirlConfigStore.m in Sources */, - 12059E2814980B7300DAC43B /* AdWhirlCustomAdView.m in Sources */, - 12059E2914980B7300DAC43B /* AdWhirlError.m in Sources */, - 12059E2A14980B7300DAC43B /* AdWhirlLog.m in Sources */, - 12059E2B14980B7300DAC43B /* AdWhirlView.m in Sources */, - 12059E2C14980B7300DAC43B /* AdWhirlWebBrowserController.m in Sources */, - 12059E2D14980B7300DAC43B /* ARRollerView.m in Sources */, - 12059E2E14980B7300DAC43B /* AWNetworkReachabilityWrapper.m in Sources */, - 12059E2F14980B7300DAC43B /* UIColor+AdWhirlConfig.m in Sources */, - 12059E3014980B7300DAC43B /* CDataScanner.m in Sources */, - 12059E3114980B7300DAC43B /* CDataScanner_Extensions.m in Sources */, - 12059E3214980B7300DAC43B /* NSCharacterSet_Extensions.m in Sources */, - 12059E3314980B7300DAC43B /* NSDictionary_JSONExtensions.m in Sources */, - 12059E3414980B7300DAC43B /* NSScanner_Extensions.m in Sources */, - 12059E3514980B7300DAC43B /* CJSONDataSerializer.m in Sources */, - 12059E3614980B7300DAC43B /* CJSONDeserializer.m in Sources */, - 12059E3714980B7300DAC43B /* CJSONScanner.m in Sources */, - 12059E3814980B7300DAC43B /* CJSONSerializer.m in Sources */, - 12059E3914980B7300DAC43B /* CSerializedJSONData.m in Sources */, 12059E3A14980B7300DAC43B /* ASIAuthenticationDialog.m in Sources */, 12059E3B14980B7300DAC43B /* ASIDataCompressor.m in Sources */, 12059E3C14980B7300DAC43B /* ASIDataDecompressor.m in Sources */, @@ -2433,36 +2114,6 @@ 12769487144127380088F6D3 /* AIPlayerBakaB.cpp in Sources */, 12769488144127380088F6D3 /* TestSuiteAI.cpp in Sources */, 12CCA030144A05D100E343A0 /* AbilityParser.cpp in Sources */, - 128ED4AB148BC94D00C58E83 /* AdWhirlAdapterGoogleAdMobAds.m in Sources */, - 128ED4AE148BC94D00C58E83 /* AdWhirlAdapterIAd.m in Sources */, - 128ED4B8148BC94D00C58E83 /* AdWhirlAdapterCustom.m in Sources */, - 128ED4B9148BC94D00C58E83 /* AdWhirlAdapterEvent.m in Sources */, - 128ED4BA148BC94D00C58E83 /* AdWhirlAdapterGeneric.m in Sources */, - 128ED4BB148BC94D00C58E83 /* AdWhirlAdNetworkAdapter+Helpers.m in Sources */, - 128ED4BC148BC94D00C58E83 /* AdWhirlAdNetworkAdapter.m in Sources */, - 128ED4BD148BC94D00C58E83 /* AdWhirlAdNetworkConfig.m in Sources */, - 128ED4BE148BC94D00C58E83 /* AdWhirlAdNetworkRegistry.m in Sources */, - 128ED4BF148BC94D00C58E83 /* AdWhirlClassWrapper.m in Sources */, - 128ED4C0148BC94D00C58E83 /* AdWhirlConfig.m in Sources */, - 128ED4C1148BC94D00C58E83 /* AdWhirlConfigStore.m in Sources */, - 128ED4C2148BC94D00C58E83 /* AdWhirlCustomAdView.m in Sources */, - 128ED4C3148BC94D00C58E83 /* AdWhirlError.m in Sources */, - 128ED4C4148BC94D00C58E83 /* AdWhirlLog.m in Sources */, - 128ED4C5148BC94D00C58E83 /* AdWhirlView.m in Sources */, - 128ED4C7148BC94D00C58E83 /* AdWhirlWebBrowserController.m in Sources */, - 128ED4C8148BC94D00C58E83 /* ARRollerView.m in Sources */, - 128ED4C9148BC94D00C58E83 /* AWNetworkReachabilityWrapper.m in Sources */, - 128ED4CA148BC94D00C58E83 /* UIColor+AdWhirlConfig.m in Sources */, - 128ED4F1148BC94D00C58E83 /* CDataScanner.m in Sources */, - 128ED4F2148BC94D00C58E83 /* CDataScanner_Extensions.m in Sources */, - 128ED4F3148BC94D00C58E83 /* NSCharacterSet_Extensions.m in Sources */, - 128ED4F4148BC94D00C58E83 /* NSDictionary_JSONExtensions.m in Sources */, - 128ED4F5148BC94D00C58E83 /* NSScanner_Extensions.m in Sources */, - 128ED4F6148BC94D00C58E83 /* CJSONDataSerializer.m in Sources */, - 128ED4F7148BC94D00C58E83 /* CJSONDeserializer.m in Sources */, - 128ED4F8148BC94D00C58E83 /* CJSONScanner.m in Sources */, - 128ED4F9148BC94D00C58E83 /* CJSONSerializer.m in Sources */, - 128ED4FA148BC94D00C58E83 /* CSerializedJSONData.m in Sources */, 12211E7914931CBB00641703 /* ASIAuthenticationDialog.m in Sources */, 12211E7A14931CBB00641703 /* ASIDataCompressor.m in Sources */, 12211E7B14931CBB00641703 /* ASIDataDecompressor.m in Sources */, @@ -2705,7 +2356,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ../../Boost/boost; - IPHONEOS_DEPLOYMENT_TARGET = 4.0; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; PROVISIONING_PROFILE = ""; SDKROOT = iphoneos; TARGETED_DEVICE_FAMILY = "1,2"; @@ -2722,7 +2373,7 @@ GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_UNUSED_VARIABLE = YES; HEADER_SEARCH_PATHS = ../../Boost/boost; - IPHONEOS_DEPLOYMENT_TARGET = 4.0; + IPHONEOS_DEPLOYMENT_TARGET = 5.1; OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; PROVISIONING_PROFILE = ""; "PROVISIONING_PROFILE[sdk=iphoneos*]" = ""; diff --git a/projects/mtg/wagic.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/projects/mtg/wagic.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 000000000..1991a9a00 --- /dev/null +++ b/projects/mtg/wagic.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/projects/mtg/wagic.xcodeproj/project.xcworkspace/xcuserdata/mnguyen.xcuserdatad/UserInterfaceState.xcuserstate b/projects/mtg/wagic.xcodeproj/project.xcworkspace/xcuserdata/mnguyen.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 000000000..b760b735f Binary files /dev/null and b/projects/mtg/wagic.xcodeproj/project.xcworkspace/xcuserdata/mnguyen.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/wagic-opengl1.1.xcscheme b/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/wagic-opengl1.1.xcscheme new file mode 100644 index 000000000..ff4186a80 --- /dev/null +++ b/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/wagic-opengl1.1.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/wagic.xcscheme b/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/wagic.xcscheme new file mode 100644 index 000000000..f4cb119b6 --- /dev/null +++ b/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/wagic.xcscheme @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/xcschememanagement.plist b/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 000000000..f32f981cf --- /dev/null +++ b/projects/mtg/wagic.xcodeproj/xcuserdata/mnguyen.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,32 @@ + + + + + SchemeUserState + + wagic-opengl1.1.xcscheme + + orderHint + 1 + + wagic.xcscheme + + orderHint + 0 + + + SuppressBuildableAutocreation + + 12059D6714980B7200DAC43B + + primary + + + 1D6058900D05DD3D006BFB54 + + primary + + + + +