Changed mac specific files to use ApplicationServices rather than Carbon
http://codereview.appspot.com/4644053/


git-svn-id: http://skia.googlecode.com/svn/trunk@1658 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gyp/core.gyp b/gyp/core.gyp
index ba63485..e9b019f 100644
--- a/gyp/core.gyp
+++ b/gyp/core.gyp
@@ -293,6 +293,7 @@
           'link_settings': {
             'libraries': [
               '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
+              '$(SDKROOT)/System/Library/Frameworks/ApplicationServices.framework',
             ],
           },
         }],
diff --git a/include/ports/SkTypeface_mac.h b/include/ports/SkTypeface_mac.h
index 61b226b..8f8af50 100644
--- a/include/ports/SkTypeface_mac.h
+++ b/include/ports/SkTypeface_mac.h
@@ -19,8 +19,13 @@
 #define SkTypeface_mac_DEFINED
 
 #include "SkTypeface.h"
-#include <Carbon/Carbon.h>
+#ifdef SK_BUILD_FOR_MAC
+#import <ApplicationServices/ApplicationServices.h>
+#endif
 
+#ifdef SK_BUILD_FOR_IOS
+#include <CoreText/CoreText.h>
+#endif
 /**
  *  Like the other Typeface create methods, this returns a new reference to the
  *  corresponding typeface for the specified CTFontRef. The caller must call
diff --git a/include/utils/mac/SkCGUtils.h b/include/utils/mac/SkCGUtils.h
index db67edf..06bb85c 100644
--- a/include/utils/mac/SkCGUtils.h
+++ b/include/utils/mac/SkCGUtils.h
@@ -4,9 +4,7 @@
 #include "SkTypes.h"
 
 #ifdef SK_BUILD_FOR_MAC
-    #include <Carbon/Carbon.h>
-#else
-    #include <CoreGraphics/CoreGraphics.h>
+#include <ApplicationServices/ApplicationServices.h>
 #endif
 
 class SkBitmap;
diff --git a/src/core/SkAdvancedTypefaceMetrics.cpp b/src/core/SkAdvancedTypefaceMetrics.cpp
index 05d5c28..d902224 100644
--- a/src/core/SkAdvancedTypefaceMetrics.cpp
+++ b/src/core/SkAdvancedTypefaceMetrics.cpp
@@ -23,7 +23,12 @@
 #endif
 
 #ifdef SK_BUILD_FOR_MAC
-#include <Carbon/Carbon.h>
+#import <ApplicationServices/ApplicationServices.h>
+#endif
+
+#ifdef SK_BUILD_FOR_IOS
+#include <CoreText/CoreText.h>
+#include <CoreGraphics/CoreGraphics.h>
 #endif
 
 namespace skia_advanced_typeface_metrics_utils {
@@ -146,7 +151,7 @@
         FT_Face face,
         int num_glyphs,
         bool (*getAdvance)(FT_Face face, int gId, int16_t* data));
-#elif defined(SK_BUILD_FOR_MAC)
+#elif defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS)
 template SkAdvancedTypefaceMetrics::WidthRange* getAdvanceData(
         CTFontRef ctFont,
         int num_glyphs,
diff --git a/src/ports/SkFontHost_mac_coretext.cpp b/src/ports/SkFontHost_mac_coretext.cpp
index f9eba95..30a2d67 100644
--- a/src/ports/SkFontHost_mac_coretext.cpp
+++ b/src/ports/SkFontHost_mac_coretext.cpp
@@ -14,7 +14,14 @@
  ** limitations under the License.
 */
 #include <vector>
-#include <Carbon/Carbon.h>
+#ifdef SK_BUILD_FOR_MAC
+#import <ApplicationServices/ApplicationServices.h>
+#endif
+
+#ifdef SK_BUILD_FOR_IOS
+#include <CoreText/CoreText.h>
+#include <CoreGraphics/CoreGraphics.h>
+#endif
 
 #include "SkFontHost.h"
 #include "SkDescriptor.h"
@@ -788,9 +795,9 @@
     uint32_t fLength;
 };
 
-static uint32 CalcTableCheckSum(uint32 *table, uint32 numberOfBytesInTable) {
-    uint32 sum = 0;
-    uint32 nLongs = (numberOfBytesInTable + 3) / 4;
+static uint32_t CalcTableCheckSum(uint32_t *table, uint32_t numberOfBytesInTable) {
+    uint32_t sum = 0;
+    uint32_t nLongs = (numberOfBytesInTable + 3) / 4;
 
     while (nLongs-- > 0) {
         sum += SkEndian_SwapBE32(*table++);
@@ -847,7 +854,7 @@
         GetTableData(uniqueID, tableTags[index], 0, tableSize, dataPtr);
         entry->fTag = SkEndian_SwapBE32(tableTags[index]);
         entry->fCheckSum = SkEndian_SwapBE32(CalcTableCheckSum(
-            (uint32*)dataPtr, tableSize));
+            (uint32_t*)dataPtr, tableSize));
         entry->fOffset = SkEndian_SwapBE32(dataPtr - dataStart);
         entry->fLength = SkEndian_SwapBE32(tableSize);
         dataPtr += (tableSize + 3) & ~3;
diff --git a/src/ports/SkImageDecoder_CG.cpp b/src/ports/SkImageDecoder_CG.cpp
index f7cc1ee..eb7ee16 100644
--- a/src/ports/SkImageDecoder_CG.cpp
+++ b/src/ports/SkImageDecoder_CG.cpp
@@ -13,7 +13,7 @@
 ** limitations under the License.
 */
 
-#include <Carbon/Carbon.h>
+#include <ApplicationServices/ApplicationServices.h>
 #include "SkImageDecoder.h"
 #include "SkImageEncoder.h"
 #include "SkMovie.h"