Added Mac Framework build target #239

Merged
merged 4 commits into from Oct 30, 2012
@@ -5,7 +5,12 @@
#ifdef __OBJC__
#import <Foundation/Foundation.h>
-#import <UIKit/UIKit.h>
#import <CoreText/CoreText.h>
-
+
+#if TARGET_OS_IPHONE
+ #import <UIKit/UIKit.h>
+#elif TARGET_OS_MAC
+ #import <AppKit/AppKit.h>
+#endif
+
#endif
Submodule DTFoundation updated 40 files
+3 −0 Core/DTFoundation.h
+28 −0 Core/Source/DTActivityTitleView.h
+106 −0 Core/Source/DTActivityTitleView.m
+8 −5 Core/Source/DTDownload.m
+2 −2 Core/Source/DTDownloadCache.h
+257 −213 Core/Source/DTDownloadCache.m
+11 −0 Core/Source/DTFoundationConstants.h
+11 −0 Core/Source/DTFoundationConstants.m
+36 −0 Core/Source/DTScriptExpression.h
+241 −0 Core/Source/DTScriptExpression.m
+19 −0 Core/Source/DTScriptVariable.h
+46 −0 Core/Source/DTScriptVariable.m
+15 −0 Core/Source/DTScrollView.h
+48 −0 Core/Source/DTScrollView.m
+15 −0 Core/Source/DTUtils.h
+34 −0 Core/Source/DTUtils.m
+11 −1 Core/Source/NSArray+DTError.h
+22 −26 Core/Source/NSArray+DTError.m
+10 −20 Core/Source/NSDictionary+DTError.m
+5 −0 Core/Source/NSDocument+DTFoundation.m
+19 −0 Core/Source/NSFileWrapper+DTCopying.h
+33 −0 Core/Source/NSFileWrapper+DTCopying.m
+20 −0 Core/Source/NSScanner+DTScripting.h
+98 −0 Core/Source/NSScanner+DTScripting.m
+1 −1 Core/Source/NSString+DTFormatNumbers.m
+43 −0 Core/Source/NSString+DTUTI.h
+50 −0 Core/Source/NSString+DTUTI.m
+4 −25 Core/Source/UIApplication+DTNetworkActivity.m
+200 −45 DTFoundation.xcodeproj/project.pbxproj
+24 −0 Test/Resources/ArraySample.plist
+33 −0 Test/Resources/DictionarySample.plist
+18 −0 Test/Source/DTScriptingTest.h
+77 −0 Test/Source/DTScriptingTest.m
+2 −2 Test/Source/DTVersionTest.m
+13 −0 Test/Source/NSArrayDTErrorTest.h
+56 −0 Test/Source/NSArrayDTErrorTest.m
+13 −0 Test/Source/NSDictionaryDTErrorTest.h
+56 −0 Test/Source/NSDictionaryDTErrorTest.m
+2 −4 Test/UnitTests-Prefix.pch
+17 −1 readme.markdown
@@ -77,10 +77,14 @@ - (id)initWithHTML:(NSData *)data options:(NSDictionary *)options documentAttrib
- (void)dealloc
{
- dispatch_release(_stringAssemblyQueue);
- dispatch_release(_stringAssemblyGroup);
- dispatch_release(_stringParsingQueue);
- dispatch_release(_stringParsingGroup);
+ #if TARGET_API_MAC_OSX
+ #if MAC_OS_X_VERSION_MIN_REQUIRED < 1080
+ dispatch_release(_stringAssemblyQueue);
+ dispatch_release(_stringAssemblyGroup);
+ dispatch_release(_stringParsingQueue);
+ dispatch_release(_stringParsingGroup);
+ #endif
+ #endif
}
- (BOOL)_buildString
@@ -59,7 +59,11 @@ + (DTTextAttachment *)textAttachmentWithElement:(DTHTMLElement *)element options
NSValue *maxImageSizeValue =[options objectForKey:DTMaxImageSize];
if (maxImageSizeValue)
{
+#if TARGET_OS_IPHONE
maxImageSize = [maxImageSizeValue CGSizeValue];
+#else
+ maxImageSize = [maxImageSizeValue sizeValue];
+#endif
}
// width, height from tag
@@ -154,7 +154,14 @@ - (NSArray *)arrayOfCSSShadowsWithCurrentTextSize:(CGFloat)textSize currentColor
CGSize offset = CGSizeMake(offset_x, offset_y);
CGFloat blur = [blurString pixelSizeOfCSSMeasureRelativeToCurrentTextSize:textSize];
- NSDictionary *shadowDict = [NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithCGSize:offset], @"Offset",
+ NSValue *offsetValue;
+#if TARGET_OS_IPHONE
+ offsetValue = [NSValue valueWithCGSize:offset];
+#else
+ offsetValue = [NSValue valueWithSize:offset];
+#endif
+
+ NSDictionary *shadowDict = [NSDictionary dictionaryWithObjectsAndKeys:offsetValue, @"Offset",
[NSNumber numberWithFloat:blur], @"Blur",
shadowColor, @"Color", nil];
@@ -193,7 +200,14 @@ - (NSArray *)arrayOfCSSShadowsWithCurrentTextSize:(CGFloat)textSize currentColor
CGSize offset = CGSizeMake(offset_x, offset_y);
CGFloat blur = [blurString pixelSizeOfCSSMeasureRelativeToCurrentTextSize:textSize];
- NSDictionary *shadowDict = [NSDictionary dictionaryWithObjectsAndKeys:[NSValue valueWithCGSize:offset], @"Offset",
+ NSValue *offsetValue;
+#if TARGET_OS_IPHONE
+ offsetValue = [NSValue valueWithCGSize:offset];
+#else
+ offsetValue = [NSValue valueWithSize:offset];
+#endif
+
+ NSDictionary *shadowDict = [NSDictionary dictionaryWithObjectsAndKeys:offsetValue, @"Offset",
[NSNumber numberWithFloat:blur], @"Blur",
shadowColor, @"Color", nil];
Oops, something went wrong.