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 cd694c2..dc2345e 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 21888bf..b4381ad 100644 (file)
@@ -732,7 +732,6 @@ _wkGetNSURLResponseMustRevalidate
 _wkGetPreferredExtensionForMIMEType
 _wkGetWheelEventDeltas
 _wkInitializeGlyphVector
-_wkPathFromFont
 _wkPopupMenu
 _wkQTMovieDataRate
 _wkQTMovieMaxTimeLoaded
index 7c97e8c..908099d 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 8e79d54..873d3bf 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 0b85af2..6fea621 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 e6ab770..2d1256d 100644 (file)
@@ -1,5 +1,14 @@
 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.
 
         Fix spelling of "request" in name of WKNSURLProtocolClassForRequest.
index 13dd012..2e8376c 100644 (file)
@@ -74,7 +74,6 @@ void InitWebCoreSystemInterface(void)
     INIT(GetPreferredExtensionForMIMEType);
     INIT(GetWheelEventDeltas);
     INIT(InitializeGlyphVector);
-    INIT(PathFromFont);
     INIT(PopupMenu);
     INIT(ReleaseStyleGroup);
     INIT(SetCGFontRenderingMode);
index 3f007cf..43c0570 100644 (file)
@@ -1,5 +1,15 @@
 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.
 
         Fix spelling of "request" in name of WKNSURLProtocolClassForRequest.
index 3e36950..eb64426 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 5172db3..3e7dd9b 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceLeopard.a and b/WebKitLibraries/libWebKitSystemInterfaceLeopard.a differ
index 9776869..1741dc8 100644 (file)
Binary files a/WebKitLibraries/libWebKitSystemInterfaceTiger.a and b/WebKitLibraries/libWebKitSystemInterfaceTiger.a differ