move cg utils out of xcode and into src/include



git-svn-id: http://skia.googlecode.com/svn/trunk@35 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/utils/mac/SkCGUtils.h b/include/utils/mac/SkCGUtils.h
new file mode 100644
index 0000000..3b74b55
--- /dev/null
+++ b/include/utils/mac/SkCGUtils.h
@@ -0,0 +1,10 @@
+#ifndef SkCGUtils_DEFINED
+#define SkCGUtils_DEFINED
+
+#include <Carbon/Carbon.h>
+
+class SkBitmap;
+
+CGImageRef SkCreateCGImageRef(const SkBitmap&);
+
+#endif
diff --git a/xcode/hostapp/SkCreateCGImageRef.cpp b/src/utils/mac/SkCreateCGImageRef.cpp
similarity index 98%
rename from xcode/hostapp/SkCreateCGImageRef.cpp
rename to src/utils/mac/SkCreateCGImageRef.cpp
index 7cea543..001e1fa 100644
--- a/xcode/hostapp/SkCreateCGImageRef.cpp
+++ b/src/utils/mac/SkCreateCGImageRef.cpp
@@ -1,4 +1,4 @@
-#include <Carbon/Carbon.h>
+#include "SkCGUtils.h"
 #include "SkBitmap.h"
 
 extern CGImageRef SkCreateCGImageRef(const SkBitmap&);
diff --git a/xcode/hostapp/CICarbonSample.xcodeproj/project.pbxproj b/xcode/hostapp/CICarbonSample.xcodeproj/project.pbxproj
index 61b3747..3065934 100644
--- a/xcode/hostapp/CICarbonSample.xcodeproj/project.pbxproj
+++ b/xcode/hostapp/CICarbonSample.xcodeproj/project.pbxproj
@@ -8,7 +8,6 @@
 
 /* Begin PBXBuildFile section */
 		002884150EFA97F80083E387 /* test.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 002884140EFA97F80083E387 /* test.cpp */; };
-		0028845E0EFAB2190083E387 /* SkCreateCGImageRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0028845D0EFAB2190083E387 /* SkCreateCGImageRef.cpp */; };
 		0028847B0EFAB46A0083E387 /* libcore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 002884510EFAA35C0083E387 /* libcore.a */; };
 		002884BD0EFAB6A30083E387 /* libmaccore.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 002884BC0EFAB69F0083E387 /* libmaccore.a */; };
 		002884D90EFABFE60083E387 /* SkFontHost_none.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 002884D80EFABFE60083E387 /* SkFontHost_none.cpp */; };
@@ -54,7 +53,6 @@
 /* Begin PBXFileReference section */
 		002884140EFA97F80083E387 /* test.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = test.cpp; sourceTree = "<group>"; };
 		002884490EFAA35C0083E387 /* core.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = core.xcodeproj; path = ../core/core.xcodeproj; sourceTree = SOURCE_ROOT; };
-		0028845D0EFAB2190083E387 /* SkCreateCGImageRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkCreateCGImageRef.cpp; sourceTree = "<group>"; };
 		002884B40EFAB69F0083E387 /* maccore.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = maccore.xcodeproj; path = ../maccore/maccore.xcodeproj; sourceTree = SOURCE_ROOT; };
 		002884D80EFABFE60083E387 /* SkFontHost_none.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkFontHost_none.cpp; path = ../../src/ports/SkFontHost_none.cpp; sourceTree = SOURCE_ROOT; };
 		0156F80307C56A3000C6122B /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = /System/Library/Frameworks/Foundation.framework; sourceTree = "<absolute>"; };
@@ -127,7 +125,6 @@
 		20286C2AFDCF999611CA2CEA /* Sources */ = {
 			isa = PBXGroup;
 			children = (
-				0028845D0EFAB2190083E387 /* SkCreateCGImageRef.cpp */,
 				32DBCF6D0370B57F00C91783 /* CICarbonSample_Prefix.pch */,
 				20286C2BFDCF999611CA2CEA /* main.c */,
 				002884140EFA97F80083E387 /* test.cpp */,
@@ -243,7 +240,6 @@
 			files = (
 				8D0C4E900486CD37000505A6 /* main.c in Sources */,
 				002884150EFA97F80083E387 /* test.cpp in Sources */,
-				0028845E0EFAB2190083E387 /* SkCreateCGImageRef.cpp in Sources */,
 				002884D90EFABFE60083E387 /* SkFontHost_none.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
@@ -344,6 +340,10 @@
 		01E2163E09EDAC6600E66AF8 /* Development */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					SK_BUILD_FOR_MAC,
+					SK_DEBUG,
+				);
 				USER_HEADER_SEARCH_PATHS = "../../include/**";
 			};
 			name = Development;
@@ -351,6 +351,11 @@
 		01E2163F09EDAC6600E66AF8 /* Deployment */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					SK_BUILD_FOR_MAC,
+					SK_RELEASE,
+				);
+				USER_HEADER_SEARCH_PATHS = "../../include/**";
 			};
 			name = Deployment;
 		};
diff --git a/xcode/hostapp/test.cpp b/xcode/hostapp/test.cpp
index aae344d..3b3e119 100644
--- a/xcode/hostapp/test.cpp
+++ b/xcode/hostapp/test.cpp
@@ -1,8 +1,8 @@
 #include <Carbon/Carbon.h>
+#include "SkCGUtils.h"
 #include "SkCanvas.h"
 #include "SkPaint.h"
 
-extern CGImageRef SkCreateCGImageRef(const SkBitmap&);
 extern "C" void SkiaDraw(CGContextRef cg, CGRect bounds);
 
 static void sampleDraw(SkCanvas* canvas) {
diff --git a/xcode/maccore/maccore.xcodeproj/project.pbxproj b/xcode/maccore/maccore.xcodeproj/project.pbxproj
index 218f217..5ac5983 100644
--- a/xcode/maccore/maccore.xcodeproj/project.pbxproj
+++ b/xcode/maccore/maccore.xcodeproj/project.pbxproj
@@ -11,6 +11,7 @@
 		002884A60EFAB5DE0083E387 /* SkThread_pthread.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 002884A30EFAB5DE0083E387 /* SkThread_pthread.cpp */; };
 		002884A70EFAB5DE0083E387 /* SkTime_Unix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 002884A40EFAB5DE0083E387 /* SkTime_Unix.cpp */; };
 		002884E10EFABFFC0083E387 /* SkGlobals_global.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 002884E00EFABFFC0083E387 /* SkGlobals_global.cpp */; };
+		002885130EFAD89B0083E387 /* SkCreateCGImageRef.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 002885120EFAD89B0083E387 /* SkCreateCGImageRef.cpp */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXFileReference section */
@@ -18,6 +19,7 @@
 		002884A30EFAB5DE0083E387 /* SkThread_pthread.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkThread_pthread.cpp; path = ../../src/ports/SkThread_pthread.cpp; sourceTree = SOURCE_ROOT; };
 		002884A40EFAB5DE0083E387 /* SkTime_Unix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkTime_Unix.cpp; path = ../../src/ports/SkTime_Unix.cpp; sourceTree = SOURCE_ROOT; };
 		002884E00EFABFFC0083E387 /* SkGlobals_global.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkGlobals_global.cpp; path = ../../src/ports/SkGlobals_global.cpp; sourceTree = SOURCE_ROOT; };
+		002885120EFAD89B0083E387 /* SkCreateCGImageRef.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkCreateCGImageRef.cpp; path = ../../src/utils/mac/SkCreateCGImageRef.cpp; sourceTree = SOURCE_ROOT; };
 		D2AAC046055464E500DB518D /* libmaccore.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libmaccore.a; sourceTree = BUILT_PRODUCTS_DIR; };
 /* End PBXFileReference section */
 
@@ -32,9 +34,18 @@
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		002885110EFAD8840083E387 /* utils */ = {
+			isa = PBXGroup;
+			children = (
+				002885120EFAD89B0083E387 /* SkCreateCGImageRef.cpp */,
+			);
+			name = utils;
+			sourceTree = "<group>";
+		};
 		08FB7794FE84155DC02AAC07 /* maccore */ = {
 			isa = PBXGroup;
 			children = (
+				002885110EFAD8840083E387 /* utils */,
 				08FB7795FE84155DC02AAC07 /* Source */,
 				C6A0FF2B0290797F04C91782 /* Documentation */,
 				1AB674ADFE9D54B511CA2CBB /* Products */,
@@ -124,6 +135,7 @@
 				002884A60EFAB5DE0083E387 /* SkThread_pthread.cpp in Sources */,
 				002884A70EFAB5DE0083E387 /* SkTime_Unix.cpp in Sources */,
 				002884E10EFABFFC0083E387 /* SkGlobals_global.cpp in Sources */,
+				002885130EFAD89B0083E387 /* SkCreateCGImageRef.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -165,7 +177,7 @@
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				PREBINDING = NO;
 				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
-				USER_HEADER_SEARCH_PATHS = "../../include/ports ../../include/core";
+				USER_HEADER_SEARCH_PATHS = "../../src/utils/mac ../../include/ports ../../include/core";
 			};
 			name = Debug;
 		};
@@ -184,7 +196,7 @@
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				PREBINDING = NO;
 				SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
-				USER_HEADER_SEARCH_PATHS = "../../include/ports ../../include/core";
+				USER_HEADER_SEARCH_PATHS = "../../include/utils/mac ../../include/ports ../../include/core";
 			};
 			name = Release;
 		};