WebCore:
authorbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Feb 2007 06:00:26 +0000 (06:00 +0000)
committerbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 21 Feb 2007 06:00:26 +0000 (06:00 +0000)
commit0c8a077546f21004aed68d3e250172cb8ab72fa8
treef2b041bb2dfd8e9fc7ddde53817419ace3cf09b7
parent2ec3e617e98b44c4cb1edc502d514604d593bb21
WebCore:
        Reviewed by Maciej.

        Implement writeImage() on Pasteboard so that the context menus can
        call into the editor for the "Copy image" command instead of
        calling across the clients.

        * WebCore.exp:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/Editor.cpp:
        (WebCore::Editor::copyImage): Call into the Pasteboard.
        * editing/Editor.h:
        * loader/mac/LoaderNSURLExtras.h: A new NSURL extra needed inside
        WebCore.
        * loader/mac/LoaderNSURLExtras.m: Made this file Objective-C++
        (from Objective-C) since the call into the MIMETypeRegistry will
        return a Vector.
        (urlByRemovingComponent): Cast to build as Obj-C++
        (urlWithDataRelativeToURL): Same.
        (vectorContainsString): Helper.
        (suggestedFilenameWithMIMEType): New function.
        * page/ContextMenuClient.h: Remove copyImageToClipboard()
        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::contextMenuItemSelected): Call
        into the editor instead of the client.
        * page/mac/WebCoreViewFactory.h: New localized String.
        * platform/LocalizedStrings.h: Same.
        * platform/MimeTypeRegistry.h: Expose two additional functions for
        MIMEType information from WebCore System Interface.
        * platform/Pasteboard.h:
        * platform/SharedBuffer.h: Make platformData() and platformDataSize
        () public since they are needed to write the image to the
        pasteboard.
        * platform/mac/LocalizedStringsMac.mm: New localized string.
        (WebCore::copyImageUnknownFileLabel):
        * platform/mac/MimeTypeRegistryMac.mm:
        (WebCore::MimeTypeRegistry::getExtensionsForMIMEType):
        (WebCore::MimeTypeRegistry::getPreferredExtensionForMIMEType):
        * platform/mac/PasteboardMac.mm:
        (WebCore::writableTypesForImage):
        (WebCore::Pasteboard::writeURL): Write the correct types if the url
        is for an image.
        (WebCore::fileWrapperForImage):
        (WebCore::Pasteboard::writeFileWrapperAsRTFDAttachment):
        (WebCore::Pasteboard::writeImage):
        * platform/mac/WebCoreNSStringExtras.h: Added. Some the the
        NSStringExtras that were in WebKit are now needed by WebCore. To
        avoid having two copies of these functions, I just moved the
        implementations to WebCore. The WebKit functions just call into
        WebCore.
        * platform/mac/WebCoreNSStringExtras.mm: Added.
        (hasCaseInsensitiveSuffix):
        (hasCaseInsensitiveSubstring):
        (filenameByFixingIllegalCharacters):
        * platform/mac/WebCoreSystemInterface.h:
        wkGetPreferredExtensionForMIMEType and wkGetExtensionsForMIMEType
        are now needed in WebCore as well as WebKit.
        * platform/mac/WebCoreSystemInterface.mm:

WebKit:
        Reviewed by Maciej.

        WebKit changes needed to implement writeImage() in WebCore's
        Pasteboard class.

        * Misc/WebKitNSStringExtras.m: Call into WebCore for these
        implementations.
        (-[NSString _webkit_hasCaseInsensitiveSuffix:]):
        (-[NSString _webkit_hasCaseInsensitiveSubstring:]):
        (-[NSString _webkit_filenameByFixingIllegalCharacters]):
        * Misc/WebNSURLExtras.m: Same.
        (-[NSURL _webkit_suggestedFilenameWithMIMEType:]):
        * WebCoreSupport/WebContextMenuClient.h: Remove
        copyImageToClipboard()
        * WebCoreSupport/WebContextMenuClient.mm:
        * WebCoreSupport/WebSystemInterface.m: Expose
        GetExtensionsForMIMEType and GetPreferredExtensionForMIMEType to
        WebCore.
        (InitWebCoreSystemInterface):
        * WebCoreSupport/WebViewFactory.mm: New localized string for
        WebCore.
        (-[WebViewFactory copyImageUnknownFileLabel]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@19764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/editing/Editor.cpp
WebCore/editing/Editor.h
WebCore/loader/mac/LoaderNSURLExtras.h
WebCore/loader/mac/LoaderNSURLExtras.m
WebCore/page/ContextMenuClient.h
WebCore/page/ContextMenuController.cpp
WebCore/page/mac/WebCoreViewFactory.h
WebCore/platform/LocalizedStrings.h
WebCore/platform/MimeTypeRegistry.h
WebCore/platform/Pasteboard.h
WebCore/platform/SharedBuffer.h
WebCore/platform/mac/LocalizedStringsMac.mm
WebCore/platform/mac/MimeTypeRegistryMac.mm
WebCore/platform/mac/PasteboardMac.mm
WebCore/platform/mac/WebCoreNSStringExtras.h [new file with mode: 0644]
WebCore/platform/mac/WebCoreNSStringExtras.mm [new file with mode: 0644]
WebCore/platform/mac/WebCoreSystemInterface.h
WebCore/platform/mac/WebCoreSystemInterface.mm
WebKit/ChangeLog
WebKit/Misc/WebKitNSStringExtras.m
WebKit/Misc/WebNSURLExtras.m
WebKit/WebCoreSupport/WebContextMenuClient.h
WebKit/WebCoreSupport/WebContextMenuClient.mm
WebKit/WebCoreSupport/WebSystemInterface.m
WebKit/WebCoreSupport/WebViewFactory.mm