2008-02-29 Mark Rowe <mrowe@apple.com>
authormrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Feb 2008 22:06:56 +0000 (22:06 +0000)
committermrowe@apple.com <mrowe@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 29 Feb 2008 22:06:56 +0000 (22:06 +0000)
        Reviewed by Anders Carlsson.

        Replace use of WKPathFromFont with implementation in terms of public API.

        * WebCore.base.exp: Remove unused symbol.
        * platform/graphics/mac/SimpleFontDataMac.mm:
        (WebCore::initFontData):
        (WebCore::pathFromFont): Implement pathFromFont in terms of public API.
        (WebCore::SimpleFontData::platformInit):
        * platform/mac/WebCoreSystemInterface.h: Remove unused symbol.
        * platform/mac/WebCoreSystemInterface.mm: Ditto.

2008-02-29  Mark Rowe  <mrowe@apple.com>

        Reviewed by Anders Carlsson.

        Replace use of WKPathFromFont with implementation in terms of public API.

        * WebCoreSupport/WebSystemInterface.m:
        (InitWebCoreSystemInterface): Remove unused symbol.

2008-02-29  Mark Rowe  <mrowe@apple.com>

        Reviewed by Anders Carlsson.

        Replace use of WKPathFromFont with implementation in terms of public API.

        * WebKitSystemInterface.h:  Remove unused symbol.
        * libWebKitSystemInterfaceLeopard.a:
        * libWebKitSystemInterfaceTiger.a:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30672 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/WebCore.base.exp
WebCore/platform/graphics/mac/SimpleFontDataMac.mm
WebCore/platform/mac/WebCoreSystemInterface.h
WebCore/platform/mac/WebCoreSystemInterface.mm
WebKit/mac/ChangeLog
WebKit/mac/WebCoreSupport/WebSystemInterface.m
WebKitLibraries/ChangeLog
WebKitLibraries/WebKitSystemInterface.h
WebKitLibraries/libWebKitSystemInterfaceLeopard.a
WebKitLibraries/libWebKitSystemInterfaceTiger.a

index cd694c230c409f5b6cb56b9036242f4ed6b4a3a3..dc2345e6607c7ed4ba1d414ab3113e3c08612ae1 100644 (file)
@@ -1,3 +1,17 @@
+2008-02-29  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Replace use of WKPathFromFont with implementation in terms of public API.
+
+        * WebCore.base.exp: Remove unused symbol.
+        * platform/graphics/mac/SimpleFontDataMac.mm:
+        (WebCore::initFontData):
+        (WebCore::pathFromFont): Implement pathFromFont in terms of public API.
+        (WebCore::SimpleFontData::platformInit):
+        * platform/mac/WebCoreSystemInterface.h: Remove unused symbol.
+        * platform/mac/WebCoreSystemInterface.mm: Ditto.
+
 2008-02-29  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Adam.
index 21888bf20789e3f43dc4252aba94ea77bf7f7e2f..b4381ad3e631661950b4f94a1acec0f732066173 100644 (file)
@@ -732,7 +732,6 @@ _wkGetNSURLResponseMustRevalidate
 _wkGetPreferredExtensionForMIMEType
 _wkGetWheelEventDeltas
 _wkInitializeGlyphVector
-_wkPathFromFont
 _wkPopupMenu
 _wkQTMovieDataRate
 _wkQTMovieMaxTimeLoaded
index 7c97e8c1b8780bd47e97ed396cc63989f73f9c1b..908099dbf89e93b8f08672ebdde7031ee83abbfb 100644 (file)
@@ -62,7 +62,7 @@ bool initFontData(SimpleFontData* fontData)
     ATSUStyle fontStyle;
     if (ATSUCreateStyle(&fontStyle) != noErr)
         return false;
-    
+
     ATSUFontID fontId = fontData->m_font.m_atsuFontID;
     if (!fontId) {
         ATSUDisposeStyle(fontStyle);
@@ -96,6 +96,35 @@ static NSString *webFallbackFontFamily(void)
     return webFallbackFontFamily.get();
 }
 
+static NSString* pathFromFont(NSFont *font)
+{
+    ATSFontRef atsFont = FMGetATSFontRefFromFont(wkGetNSFontATSUFontId(font));
+    FSRef fileRef;
+
+#ifndef BUILDING_ON_TIGER
+    OSStatus status = ATSFontGetFileReference(atsFont, &fileRef);
+    if (status != noErr)
+        return nil;
+#else
+    FSSpec oFile;
+    OSStatus status = ATSFontGetFileSpecification(atsFont, &oFile);
+    if (status != noErr)
+        return nil;
+
+    status = FSpMakeFSRef(&oFile, &fileRef);
+    if (status != noErr)
+        return nil;
+#endif
+
+    UInt8 filePathBuffer[PATH_MAX];
+    status = FSRefMakePath(&fileRef, filePathBuffer, PATH_MAX);
+    if (status == noErr)
+        return [NSString stringWithUTF8String:(const char*)filePathBuffer];
+
+    return nil;
+}
+
+
 void SimpleFontData::platformInit()
 {
     m_styleGroup = 0;
@@ -128,7 +157,7 @@ void SimpleFontData::platformInit()
 #endif
         m_font.setFont([[NSFontManager sharedFontManager] convertFont:m_font.font() toFamily:fallbackFontFamily]);
 #if !ERROR_DISABLED
-        NSString *filePath = wkPathFromFont(initialFont.get());
+        NSString *filePath = pathFromFont(initialFont.get());
         if (!filePath)
             filePath = @"not known";
 #endif
index 8e79d547ce11ffc3cbf9d934e5e5fe5eb26e6bd6..873d3bf7d651fad9af6b53b10df7fc52888c1c21 100644 (file)
@@ -120,7 +120,6 @@ extern NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
 extern BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
 extern void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
 extern OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs);
-extern NSString* (*wkPathFromFont)(NSFont*);
 extern void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
 extern int (*wkQTMovieDataRate)(QTMovie*);
 extern float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
index 0b85af2a3410b78eb720beb873cffbaf6ac79747..6fea6218addbe31888745dcda3bb9104b8e67fb3 100644 (file)
@@ -63,7 +63,6 @@ NSDate *(*wkGetNSURLResponseLastModifiedDate)(NSURLResponse *response);
 BOOL (*wkGetNSURLResponseMustRevalidate)(NSURLResponse *response);
 void (*wkGetWheelEventDeltas)(NSEvent*, float* deltaX, float* deltaY, BOOL* continuous);
 OSStatus (*wkInitializeGlyphVector)(int count, void* glyphs);
-NSString* (*wkPathFromFont)(NSFont*);
 void (*wkPopupMenu)(NSMenu*, NSPoint location, float width, NSView*, int selectedItem, NSFont*);
 int (*wkQTMovieDataRate)(QTMovie*);
 float (*wkQTMovieMaxTimeLoaded)(QTMovie*);
index e6ab770c00bc1c0823ff8b3e6eadc648814b3a55..2d1256dc249cb8a1d1d0f6feb2ef2305140169c6 100644 (file)
@@ -1,3 +1,12 @@
+2008-02-29  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Replace use of WKPathFromFont with implementation in terms of public API.
+
+        * WebCoreSupport/WebSystemInterface.m:
+        (InitWebCoreSystemInterface): Remove unused symbol.
+
 2008-02-29  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Oliver Hunt.
index 13dd0125182f6dab8b9a1e254de90b31ced34d3c..2e8376c6e2be4cb931b50e739006c0beabf5e3d6 100644 (file)
@@ -74,7 +74,6 @@ void InitWebCoreSystemInterface(void)
     INIT(GetPreferredExtensionForMIMEType);
     INIT(GetWheelEventDeltas);
     INIT(InitializeGlyphVector);
-    INIT(PathFromFont);
     INIT(PopupMenu);
     INIT(ReleaseStyleGroup);
     INIT(SetCGFontRenderingMode);
index 3f007cf3550e1d89f31404a525130aba705980c0..43c0570e4f8b1fdbe871eeb1dc28ff7d3d0ef572 100644 (file)
@@ -1,3 +1,13 @@
+2008-02-29  Mark Rowe  <mrowe@apple.com>
+
+        Reviewed by Anders Carlsson.
+
+        Replace use of WKPathFromFont with implementation in terms of public API.
+
+        * WebKitSystemInterface.h:  Remove unused symbol.
+        * libWebKitSystemInterfaceLeopard.a:
+        * libWebKitSystemInterfaceTiger.a:
+
 2008-02-29  Mark Rowe  <mrowe@apple.com>
 
         Reviewed by Oliver Hunt.
index 3e36950b137e612afe9baaa42ecbcc95453eebb1..eb64426106230e350ca888ef14c0f0a279f60542 100644 (file)
@@ -152,8 +152,6 @@ void WKNSWindowMakeBottomCornersSquare(NSWindow *);
 BOOL WKSupportsMultipartXMixedReplace(NSMutableURLRequest *request);
 #endif
 
-NSString* WKPathFromFont(NSFont *font);
-
 BOOL WKCGContextIsBitmapContext(CGContextRef context);
 
 void WKGetWheelEventDeltas(NSEvent *, float *deltaX, float *deltaY, BOOL *continuous);
index 5172db324bf08f051c97052c28cbc7911f06ec7c..3e7dd9b7a87a13a1b859160e484657d90c6b390c 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 9776869258e050a1e44d6e37aa563404f7df4adb..1741dc8d83e1a41c326341d1de702419473566a1 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceTiger.a and b/WebKitLibraries/libWebKitSystemInterfaceTiger.a differ