Commit 31f61300 authored by sfalken@apple.com's avatar sfalken@apple.com
Browse files

WebKit/win: <rdar://problem/8113038> WebKit1 and WebKit2 should build as a single DLL

https://bugs.webkit.org/show_bug.cgi?id=40921

Reviewed by Alice Liu.

Pre-WebKit2 WebKit now builds into a static library named WebKitLib.lib.
WebKit.dll now links in WebCore.lib, WebKitLib.lib and WebKit2 code.
        
This is a first step. We'll likely want to migrate the remainder of
the non-deprecated WebKit code (strings, DLLMain, resources) into WebKit2.

* WebKit.vcproj/WebKit.def: Removed.
* WebKit.vcproj/WebKit.make: Don't fail if WebKit doesn't produce a DLL.
* WebKit.vcproj/WebKit.vcproj: Build WebKit as a static lib.
Renamed project name to WebKitLib to avoid confusion and naming conflicts.
Generate intermediate pdb file for debuggability of static lib.
Removed DLL-related options.        
* WebKit.vcproj/deleteButton.png: Removed.
* WebKit.vcproj/deleteButtonPressed.png: Removed.
* WebKit.vcproj/fsVideoAudioVolumeHigh.png: Removed.
* WebKit.vcproj/fsVideoAudioVolumeLow.png: Removed.
* WebKit.vcproj/fsVideoExitFullscreen.png: Removed.
* WebKit.vcproj/fsVideoPause.png: Removed.
* WebKit.vcproj/fsVideoPlay.png: Removed.
* WebKit.vcproj/missingImage.png: Removed.
* WebKit.vcproj/nullplugin.png: Removed.
* WebKit.vcproj/panEastCursor.png: Removed.
* WebKit.vcproj/panIcon.png: Removed.
* WebKit.vcproj/panNorthCursor.png: Removed.
* WebKit.vcproj/panNorthEastCursor.png: Removed.
* WebKit.vcproj/panNorthWestCursor.png: Removed.
* WebKit.vcproj/panSouthCursor.png: Removed.
* WebKit.vcproj/panSouthEastCursor.png: Removed.
* WebKit.vcproj/panSouthWestCursor.png: Removed.
* WebKit.vcproj/panWestCursor.png: Removed.
* WebKit.vcproj/searchCancel.png: Removed.
* WebKit.vcproj/searchCancelPressed.png: Removed.
* WebKit.vcproj/searchMagnifier.png: Removed.
* WebKit.vcproj/searchMagnifierResults.png: Removed.
* WebKit.vcproj/textAreaResizeCorner.png: Removed.
* WebKit.vcproj/verticalTextCursor.png: Removed.
* WebKit.vcproj/zoomInCursor.png: Removed.
* WebKit.vcproj/zoomOutCursor.png: Removed.

WebKit2: <rdar://problem/8113038> WebKit1 and WebKit2 should build as a single DLL
https://bugs.webkit.org/show_bug.cgi?id=40921
        
Reviewed by Alice Liu.

Pre-WebKit2 WebKit now builds into a static library named WebKitLib.lib.
WebKit.dll now links in WebCore.lib, WebKitLib.lib and WebKit2 code.

This is a first step. We'll likely want to migrate the remainder of
the non-deprecated WebKit code (strings, DLLMain, resources) into WebKit2.

* UIProcess/API/C/WKBase.h: Updated to new BUILDING_ name.
* WebProcess/InjectedBundle/API/c/WKBundleBase.h: Updated to new BUILDING_ name.
* WebProcess/WebCoreSupport/win/WebCoreLocalizedStrings.cpp: Removed.
* WebProcess/win/DllMain.cpp: Removed. Overlaps with implementation in WebKitLib.lib.
* WebProcess/win/WebLocalizableStrings.cpp: Removed. Overlaps with implementation in WebKitLib.lib.
* WebProcess/win/WebLocalizableStrings.h: Removed. Overlaps with implementation in WebKitLib.lib.
* win/WebKit2.def: Added. Copied from WebKit project.
* win/WebKit2.rc: Added resources previously in WebKit.
* win/WebKit2.vcproj: Changed project name to WebKit so we will link output to WebKit.dll.
Removed implementations overlapping with WebKitLib (WebCoreLocalizedStrings, DllMain, WebLocalizableStrings, WebProcessMain).
* win/WebKit2Common.vsprops: Use a framework name of WebKit instead of WebKit2 to reflect project name.
Renamed BUILDING_WEBKIT2 to BUILDING_WEBKIT since there is now just a single WebKit.dll.
* win/WebKit2WebProcess.vcproj: Link against WebKit instead of WebKit2 due to renaming.        
* win/deleteButton.png: Copied from ../WebKit/win/WebKit.vcproj/deleteButton.png.
* win/deleteButtonPressed.png: Copied from ../WebKit/win/WebKit.vcproj/deleteButtonPressed.png.
* win/fsVideoAudioVolumeHigh.png: Copied from ../WebKit/win/WebKit.vcproj/fsVideoAudioVolumeHigh.png.
* win/fsVideoAudioVolumeLow.png: Copied from ../WebKit/win/WebKit.vcproj/fsVideoAudioVolumeLow.png.
* win/fsVideoExitFullscreen.png: Copied from ../WebKit/win/WebKit.vcproj/fsVideoExitFullscreen.png.
* win/fsVideoPause.png: Copied from ../WebKit/win/WebKit.vcproj/fsVideoPause.png.
* win/fsVideoPlay.png: Copied from ../WebKit/win/WebKit.vcproj/fsVideoPlay.png.
* win/missingImage.png: Copied from ../WebKit/win/WebKit.vcproj/missingImage.png.
* win/nullplugin.png: Copied from ../WebKit/win/WebKit.vcproj/nullplugin.png.
* win/panEastCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panEastCursor.png.
* win/panIcon.png: Copied from ../WebKit/win/WebKit.vcproj/panIcon.png.
* win/panNorthCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panNorthCursor.png.
* win/panNorthEastCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panNorthEastCursor.png.
* win/panNorthWestCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panNorthWestCursor.png.
* win/panSouthCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panSouthCursor.png.
* win/panSouthEastCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panSouthEastCursor.png.
* win/panSouthWestCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panSouthWestCursor.png.
* win/panWestCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panWestCursor.png.
* win/searchCancel.png: Copied from ../WebKit/win/WebKit.vcproj/searchCancel.png.
* win/searchCancelPressed.png: Copied from ../WebKit/win/WebKit.vcproj/searchCancelPressed.png.
* win/searchMagnifier.png: Copied from ../WebKit/win/WebKit.vcproj/searchMagnifier.png.
* win/searchMagnifierResults.png: Copied from ../WebKit/win/WebKit.vcproj/searchMagnifierResults.png.
* win/textAreaResizeCorner.png: Copied from ../WebKit/win/WebKit.vcproj/textAreaResizeCorner.png.
* win/verticalTextCursor.png: Copied from ../WebKit/win/WebKit.vcproj/verticalTextCursor.png.
* win/zoomInCursor.png: Copied from ../WebKit/win/WebKit.vcproj/zoomInCursor.png.
* win/zoomOutCursor.png: Copied from ../WebKit/win/WebKit.vcproj/zoomOutCursor.png.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63151 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bda4184c
2010-07-12 Steve Falkenburg <sfalken@apple.com>
Reviewed by Alice Liu.
<rdar://problem/8113038> WebKit1 and WebKit2 should build as a single DLL
https://bugs.webkit.org/show_bug.cgi?id=40921
Pre-WebKit2 WebKit now builds into a static library named WebKitLib.lib.
WebKit.dll now links in WebCore.lib, WebKitLib.lib and WebKit2 code.
This is a first step. We'll likely want to migrate the remainder of
the non-deprecated WebKit code (strings, DLLMain, resources) into WebKit2.
* WebKit.vcproj/WebKit.def: Removed.
* WebKit.vcproj/WebKit.make: Don't fail if WebKit doesn't produce a DLL.
* WebKit.vcproj/WebKit.vcproj: Build WebKit as a static lib.
Renamed project name to WebKitLib to avoid confusion and naming conflicts.
Generate intermediate pdb file for debuggability of static lib.
Removed DLL-related options.
* WebKit.vcproj/deleteButton.png: Removed.
* WebKit.vcproj/deleteButtonPressed.png: Removed.
* WebKit.vcproj/fsVideoAudioVolumeHigh.png: Removed.
* WebKit.vcproj/fsVideoAudioVolumeLow.png: Removed.
* WebKit.vcproj/fsVideoExitFullscreen.png: Removed.
* WebKit.vcproj/fsVideoPause.png: Removed.
* WebKit.vcproj/fsVideoPlay.png: Removed.
* WebKit.vcproj/missingImage.png: Removed.
* WebKit.vcproj/nullplugin.png: Removed.
* WebKit.vcproj/panEastCursor.png: Removed.
* WebKit.vcproj/panIcon.png: Removed.
* WebKit.vcproj/panNorthCursor.png: Removed.
* WebKit.vcproj/panNorthEastCursor.png: Removed.
* WebKit.vcproj/panNorthWestCursor.png: Removed.
* WebKit.vcproj/panSouthCursor.png: Removed.
* WebKit.vcproj/panSouthEastCursor.png: Removed.
* WebKit.vcproj/panSouthWestCursor.png: Removed.
* WebKit.vcproj/panWestCursor.png: Removed.
* WebKit.vcproj/searchCancel.png: Removed.
* WebKit.vcproj/searchCancelPressed.png: Removed.
* WebKit.vcproj/searchMagnifier.png: Removed.
* WebKit.vcproj/searchMagnifierResults.png: Removed.
* WebKit.vcproj/textAreaResizeCorner.png: Removed.
* WebKit.vcproj/verticalTextCursor.png: Removed.
* WebKit.vcproj/zoomInCursor.png: Removed.
* WebKit.vcproj/zoomOutCursor.png: Removed.
2010-07-08 Aaron Boodman <aa@chromium.org>
Reviewed by Timothy Hatcher.
......
......@@ -11,7 +11,7 @@ install:
devenv "WebKit.submit.sln" /rebuild $(BUILDSTYLE)
-xcopy "$(OBJROOT)\bin\*.exe" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
xcopy "$(OBJROOT)\bin\*.pdb" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
xcopy "$(OBJROOT)\bin\*.dll" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
-xcopy "$(OBJROOT)\bin\*.dll" "$(DSTROOT)\AppleInternal\bin\" /e/v/i/h/y
xcopy "$(OBJROOT)\include\*" "$(DSTROOT)\AppleInternal\include\" /e/v/i/h/y
xcopy "$(OBJROOT)\lib\*" "$(DSTROOT)\AppleInternal\lib\" /e/v/i/h/y
xcopy "$(OBJROOT)\bin\WebKit.resources\*" "$(DSTROOT)\AppleInternal\bin\WebKit.resources" /e/v/i/h/y
This diff is collapsed.
2010-07-12 Steve Falkenburg <sfalken@apple.com>
Reviewed by Alice Liu.
<rdar://problem/8113038> WebKit1 and WebKit2 should build as a single DLL
https://bugs.webkit.org/show_bug.cgi?id=40921
Pre-WebKit2 WebKit now builds into a static library named WebKitLib.lib.
WebKit.dll now links in WebCore.lib, WebKitLib.lib and WebKit2 code.
This is a first step. We'll likely want to migrate the remainder of
the non-deprecated WebKit code (strings, DLLMain, resources) into WebKit2.
* UIProcess/API/C/WKBase.h: Updated to new BUILDING_ name.
* WebProcess/InjectedBundle/API/c/WKBundleBase.h: Updated to new BUILDING_ name.
* WebProcess/WebCoreSupport/win/WebCoreLocalizedStrings.cpp: Removed.
* WebProcess/win/DllMain.cpp: Removed. Overlaps with implementation in WebKitLib.lib.
* WebProcess/win/WebLocalizableStrings.cpp: Removed. Overlaps with implementation in WebKitLib.lib.
* WebProcess/win/WebLocalizableStrings.h: Removed. Overlaps with implementation in WebKitLib.lib.
* win/WebKit2.def: Added. Copied from WebKit project.
* win/WebKit2.rc: Added resources previously in WebKit.
* win/WebKit2.vcproj: Changed project name to WebKit so we will link output to WebKit.dll.
Removed implementations overlapping with WebKitLib (WebCoreLocalizedStrings, DllMain, WebLocalizableStrings, WebProcessMain).
* win/WebKit2Common.vsprops: Use a framework name of WebKit instead of WebKit2 to reflect project name.
Renamed BUILDING_WEBKIT2 to BUILDING_WEBKIT since there is now just a single WebKit.dll.
* win/WebKit2WebProcess.vcproj: Link against WebKit instead of WebKit2 due to renaming.
* win/deleteButton.png: Copied from ../WebKit/win/WebKit.vcproj/deleteButton.png.
* win/deleteButtonPressed.png: Copied from ../WebKit/win/WebKit.vcproj/deleteButtonPressed.png.
* win/fsVideoAudioVolumeHigh.png: Copied from ../WebKit/win/WebKit.vcproj/fsVideoAudioVolumeHigh.png.
* win/fsVideoAudioVolumeLow.png: Copied from ../WebKit/win/WebKit.vcproj/fsVideoAudioVolumeLow.png.
* win/fsVideoExitFullscreen.png: Copied from ../WebKit/win/WebKit.vcproj/fsVideoExitFullscreen.png.
* win/fsVideoPause.png: Copied from ../WebKit/win/WebKit.vcproj/fsVideoPause.png.
* win/fsVideoPlay.png: Copied from ../WebKit/win/WebKit.vcproj/fsVideoPlay.png.
* win/missingImage.png: Copied from ../WebKit/win/WebKit.vcproj/missingImage.png.
* win/nullplugin.png: Copied from ../WebKit/win/WebKit.vcproj/nullplugin.png.
* win/panEastCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panEastCursor.png.
* win/panIcon.png: Copied from ../WebKit/win/WebKit.vcproj/panIcon.png.
* win/panNorthCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panNorthCursor.png.
* win/panNorthEastCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panNorthEastCursor.png.
* win/panNorthWestCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panNorthWestCursor.png.
* win/panSouthCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panSouthCursor.png.
* win/panSouthEastCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panSouthEastCursor.png.
* win/panSouthWestCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panSouthWestCursor.png.
* win/panWestCursor.png: Copied from ../WebKit/win/WebKit.vcproj/panWestCursor.png.
* win/searchCancel.png: Copied from ../WebKit/win/WebKit.vcproj/searchCancel.png.
* win/searchCancelPressed.png: Copied from ../WebKit/win/WebKit.vcproj/searchCancelPressed.png.
* win/searchMagnifier.png: Copied from ../WebKit/win/WebKit.vcproj/searchMagnifier.png.
* win/searchMagnifierResults.png: Copied from ../WebKit/win/WebKit.vcproj/searchMagnifierResults.png.
* win/textAreaResizeCorner.png: Copied from ../WebKit/win/WebKit.vcproj/textAreaResizeCorner.png.
* win/verticalTextCursor.png: Copied from ../WebKit/win/WebKit.vcproj/verticalTextCursor.png.
* win/zoomInCursor.png: Copied from ../WebKit/win/WebKit.vcproj/zoomInCursor.png.
* win/zoomOutCursor.png: Copied from ../WebKit/win/WebKit.vcproj/zoomOutCursor.png.
2010-07-12 Maciej Stachowiak <mjs@apple.com>
Reviewed by Anders Carlsson.
......
......@@ -49,7 +49,7 @@ typedef struct OpaqueWKURLRef* WKURLRef;
#elif defined(__GNUC__)
#define WK_EXPORT __attribute__((visibility("default")))
#elif defined(WIN32) || defined(_WIN32)
#if BUILDING_WEBKIT2
#if BUILDING_WEBKIT
#define WK_EXPORT __declspec(dllexport)
#else
#define WK_EXPORT __declspec(dllimport)
......
......@@ -36,7 +36,7 @@ typedef struct OpaqueWKBundle* WKBundleRef;
#elif defined(__GNUC__)
#define WK_EXPORT __attribute__((visibility("default")))
#elif defined(WIN32) || defined(_WIN32)
#if BUILDING_WEBKIT2
#if BUILDING_WEBKIT
#define WK_EXPORT __declspec(dllexport)
#else
#define WK_EXPORT __declspec(dllimport)
......
/*
* Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <WebCore/RenderThemeWin.h>
#include <WebCore/SharedBuffer.h>
#include <WebCore/WebCoreInstanceHandle.h>
using namespace WebCore;
STDAPI_(BOOL) DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID /*lpReserved*/)
{
switch (ul_reason_for_call) {
case DLL_PROCESS_ATTACH:
setInstanceHandle(hModule);
return TRUE;
case DLL_PROCESS_DETACH:
WebCore::RenderThemeWin::setWebKitIsBeingUnloaded();
break;
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
break;
}
return FALSE;
}
// FIXME: We should consider moving this to a new file for cross-project functionality
PassRefPtr<WebCore::SharedBuffer> loadResourceIntoBuffer(const char* name)
{
return 0;
}
/*
* Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "WebLocalizableStrings.h"
#include <CoreFoundation/CoreFoundation.h>
#include <WebCore/PlatformString.h>
#include <WebCore/StringHash.h>
#include <WebCore/WebCoreInstanceHandle.h>
#include <wtf/Assertions.h>
#include <wtf/HashMap.h>
#include <wtf/RetainPtr.h>
#include <wtf/StdLibExtras.h>
class LocalizedString;
using namespace WebCore;
WebLocalizableStringsBundle WebKit2LocalizableStringsBundle = { "com.apple.WebKit2", 0 };
typedef HashMap<String, LocalizedString*> LocalizedStringMap;
static Mutex& mainBundleLocStringsMutex()
{
DEFINE_STATIC_LOCAL(Mutex, mutex, ());
return mutex;
}
static LocalizedStringMap& mainBundleLocStrings()
{
DEFINE_STATIC_LOCAL(LocalizedStringMap, map, ());
return map;
}
static Mutex& frameworkLocStringsMutex()
{
DEFINE_STATIC_LOCAL(Mutex, mutex, ());
return mutex;
}
static LocalizedStringMap frameworkLocStrings()
{
DEFINE_STATIC_LOCAL(LocalizedStringMap, map, ());
return map;
}
class LocalizedString : public Noncopyable {
public:
LocalizedString(CFStringRef string)
: m_cfString(string)
{
ASSERT_ARG(string, string);
}
operator LPCTSTR() const;
operator CFStringRef() const { return m_cfString; }
private:
CFStringRef m_cfString;
mutable String m_string;
};
LocalizedString::operator LPCTSTR() const
{
if (!m_string.isEmpty())
return m_string.charactersWithNullTermination();
m_string = m_cfString;
for (unsigned int i = 1; i < m_string.length(); i++)
if (m_string[i] == '@' && (m_string[i - 1] == '%' || (i > 2 && m_string[i - 1] == '$' && m_string[i - 2] >= '1' && m_string[i - 2] <= '9' && m_string[i - 3] == '%')))
m_string.replace(i, 1, "s");
return m_string.charactersWithNullTermination();
}
static CFBundleRef createWebKitBundle()
{
static CFBundleRef bundle;
static bool initialized;
if (initialized)
return bundle;
initialized = true;
WCHAR pathStr[MAX_PATH];
DWORD length = ::GetModuleFileNameW(instanceHandle(), pathStr, MAX_PATH);
if (!length || (length == MAX_PATH && GetLastError() == ERROR_INSUFFICIENT_BUFFER))
return 0;
bool found = false;
for (int i = length - 1; i >= 0; i--) {
// warning C6385: Invalid data: accessing 'pathStr', the readable size is '520' bytes, but '2000' bytes might be read
#pragma warning(suppress: 6385)
if (pathStr[i] == L'\\') {
// warning C6386: Buffer overrun: accessing 'pathStr', the writable size is '520' bytes, but '1996' bytes might be written
#pragma warning(suppress: 6386)
pathStr[i] = 0;
found = true;
break;
}
}
if (!found)
return 0;
if (wcscat_s(pathStr, MAX_PATH, L"\\WebKit.resources"))
return 0;
String bundlePathString(pathStr);
CFStringRef bundlePathCFString = bundlePathString.createCFString();
if (!bundlePathCFString)
return 0;
CFURLRef bundleURLRef = CFURLCreateWithFileSystemPath(0, bundlePathCFString, kCFURLWindowsPathStyle, true);
CFRelease(bundlePathCFString);
if (!bundleURLRef)
return 0;
bundle = CFBundleCreate(0, bundleURLRef);
CFRelease(bundleURLRef);
return bundle;
}
static CFBundleRef cfBundleForStringsBundle(WebLocalizableStringsBundle* stringsBundle)
{
if (!stringsBundle) {
static CFBundleRef mainBundle = CFBundleGetMainBundle();
return mainBundle;
}
createWebKitBundle();
if (!stringsBundle->bundle)
stringsBundle->bundle = CFBundleGetBundleWithIdentifier(RetainPtr<CFStringRef>(AdoptCF, CFStringCreateWithCString(0, stringsBundle->identifier, kCFStringEncodingASCII)).get());
return stringsBundle->bundle;
}
static CFStringRef copyLocalizedStringFromBundle(WebLocalizableStringsBundle* stringsBundle, const String& key)
{
static CFStringRef notFound = CFSTR("localized string not found");
CFBundleRef bundle = cfBundleForStringsBundle(stringsBundle);
if (!bundle)
return notFound;
RetainPtr<CFStringRef> keyString(AdoptCF, key.createCFString());
CFStringRef result = CFCopyLocalizedStringWithDefaultValue(keyString.get(), 0, bundle, notFound, 0);
ASSERT_WITH_MESSAGE(result != notFound, "could not find localizable string %s in bundle", key);
return result;
}
static LocalizedString* findCachedString(WebLocalizableStringsBundle* stringsBundle, const String& key)
{
if (!stringsBundle) {
MutexLocker lock(mainBundleLocStringsMutex());
return mainBundleLocStrings().get(key);
}
if (stringsBundle->bundle == WebKit2LocalizableStringsBundle.bundle) {
MutexLocker lock(frameworkLocStringsMutex());
return frameworkLocStrings().get(key);
}
return 0;
}
static void cacheString(WebLocalizableStringsBundle* stringsBundle, const String& key, LocalizedString* value)
{
if (!stringsBundle) {
MutexLocker lock(mainBundleLocStringsMutex());
mainBundleLocStrings().set(key, value);
return;
}
MutexLocker lock(frameworkLocStringsMutex());
frameworkLocStrings().set(key, value);
}
static const LocalizedString& localizedString(WebLocalizableStringsBundle* stringsBundle, const String& key)
{
LocalizedString* string = findCachedString(stringsBundle, key);
if (string)
return *string;
string = new LocalizedString(copyLocalizedStringFromBundle(stringsBundle, key));
cacheString(stringsBundle, key, string);
return *string;
}
CFStringRef WebLocalizedStringUTF8(WebLocalizableStringsBundle* stringsBundle, LPCSTR key)
{
if (!key)
return 0;
return localizedString(stringsBundle, String::fromUTF8(key));
}
LPCTSTR WebLocalizedLPCTSTRUTF8(WebLocalizableStringsBundle* stringsBundle, LPCSTR key)
{
if (!key)
return 0;
return localizedString(stringsBundle, String::fromUTF8(key));
}
// These functions are deprecated.
CFStringRef WebLocalizedString(WebLocalizableStringsBundle* stringsBundle, LPCTSTR key)
{
if (!key)
return 0;
return localizedString(stringsBundle, String(key));
}
LPCTSTR WebLocalizedLPCTSTR(WebLocalizableStringsBundle* stringsBundle, LPCTSTR key)
{
if (!key)
return 0;
return localizedString(stringsBundle, String(key));
}
void SetWebLocalizedStringMainBundle(CFBundleRef)
{
}
/*
* Copyright (C) 2006, 2007, 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef WebLocalizableStrings_h
#define WebLocalizableStrings_h
#include <CoreFoundation/CoreFoundation.h>
typedef struct {
const char *identifier;
CFBundleRef bundle;
} WebLocalizableStringsBundle;
#ifdef __cplusplus
extern "C" {
#endif
CFStringRef WebLocalizedStringUTF8(WebLocalizableStringsBundle*, LPCSTR key);
LPCTSTR WebLocalizedLPCTSTRUTF8(WebLocalizableStringsBundle*, LPCSTR key);
void SetWebLocalizedStringMainBundle(CFBundleRef bundle);
// These functions are deprecated. Use the UTF-8 versions instead.
CFStringRef WebLocalizedString(WebLocalizableStringsBundle *bundle, LPCTSTR key);
LPCTSTR WebLocalizedLPCTSTR(WebLocalizableStringsBundle *bundle, LPCTSTR key);
#ifdef __cplusplus
}
#endif
#ifdef FRAMEWORK_NAME
#define LOCALIZABLE_STRINGS_BUNDLE(F) LOCALIZABLE_STRINGS_BUNDLE_HELPER(F)
#define LOCALIZABLE_STRINGS_BUNDLE_HELPER(F) F ## LocalizableStringsBundle
extern WebLocalizableStringsBundle LOCALIZABLE_STRINGS_BUNDLE(FRAMEWORK_NAME);
#define UI_STRING(string, comment) WebLocalizedStringUTF8(&LOCALIZABLE_STRINGS_BUNDLE(FRAMEWORK_NAME), string)
#define UI_STRING_KEY(string, key, comment) WebLocalizedStringUTF8(&LOCALIZABLE_STRINGS_BUNDLE(FRAMEWORK_NAME), key)
#define LPCTSTR_UI_STRING(string, comment) WebLocalizedLPCTSTRUTF8(&LOCALIZABLE_STRINGS_BUNDLE(FRAMEWORK_NAME), string)
#define LPCTSTR_UI_STRING_KEY(string, key, comment) WebLocalizedLPCTSTRUTF8(&LOCALIZABLE_STRINGS_BUNDLE(FRAMEWORK_NAME), key)
#else
#define UI_STRING(string, comment) WebLocalizedStringUTF8(0, string)
#define UI_STRING_KEY(string, key, comment) WebLocalizedStringUTF8(0, key)
#define LPCTSTR_UI_STRING(string, comment) WebLocalizedLPCTSTRUTF8(0, string)
#define LPCTSTR_UI_STRING_KEY(string, key, comment) WebLocalizedLPCTSTRUTF8(0, key)
#endif
#endif // WebLocalizableStrings_h
......@@ -30,13 +30,13 @@ BEGIN
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "WebKit2 Dynamic Link Library"
VALUE "FileDescription", "WebKit Dynamic Link Library"
VALUE "FileVersion", __VERSION_TEXT__
VALUE "CompanyName", "Apple Inc."
VALUE "InternalName", "WebKit2"
VALUE "InternalName", "WebKit"
VALUE "LegalCopyright", "Copyright Apple Inc. 2003-" __COPYRIGHT_YEAR_END_TEXT__
VALUE "OriginalFilename", "WebKit2.dll"
VALUE "ProductName", "WebKit2"
VALUE "OriginalFilename", "WebKit.dll"
VALUE "ProductName", "WebKit"
VALUE "ProductVersion", __BUILD_NUMBER_SHORT__
END
END
......@@ -45,3 +45,35 @@ BEGIN
VALUE "Translation", 0x409, 1200
END
END
/////////////////////////////////////////////////////////////////////////////
//
// PNG
//
IDR_RESIZE_CORNER PNG "textAreaResizeCorner.png"
IDR_MISSING_IMAGE PNG "missingImage.png"
IDR_NULL_PLUGIN PNG "nullplugin.png"
IDR_DELETE_BUTTON PNG "deleteButton.png"
IDR_DELETE_BUTTON_PRESSED PNG "deleteButtonPressed.png"
IDR_ZOOM_IN_CURSOR PNG "zoomInCursor.png"
IDR_ZOOM_OUT_CURSOR PNG "zoomOutCursor.png"
IDR_VERTICAL_TEXT_CURSOR PNG "verticalTextCursor.png"
IDR_PAN_SCROLL_ICON PNG "panIcon.png"
IDR_PAN_SOUTH_CURSOR PNG "panSouthCursor.png"
IDR_PAN_NORTH_CURSOR PNG "panNorthCursor.png"
IDR_PAN_EAST_CURSOR PNG "panEastCursor.png"
IDR_PAN_WEST_CURSOR PNG "panWestCursor.png"
IDR_PAN_SOUTH_EAST_CURSOR PNG "panSouthEastCursor.png"
IDR_PAN_SOUTH_WEST_CURSOR PNG "panSouthWestCursor.png"
IDR_PAN_NORTH_EAST_CURSOR PNG "panNorthEastCursor.png"
IDR_PAN_NORTH_WEST_CURSOR PNG "panNorthWestCursor.png"
IDR_SEARCH_CANCEL PNG "searchCancel.png"
IDR_SEARCH_CANCEL_PRESSED PNG "searchCancelPressed.png"
IDR_SEARCH_MAGNIFIER PNG "searchMagnifier.png"
IDR_SEARCH_MAGNIFIER_RESULTS PNG "searchMagnifierResults.png"
IDR_FS_VIDEO_AUDIO_VOLUME_HIGH PNG "fsVideoAudioVolumeHigh.png"
IDR_FS_VIDEO_AUDIO_VOLUME_LOW PNG "fsVideoAudioVolumeLow.png"
IDR_FS_VIDEO_EXIT_FULLSCREEN PNG "fsVideoExitFullscreen.png"
IDR_FS_VIDEO_PAUSE PNG "fsVideoPause.png"
IDR_FS_VIDEO_PLAY PNG "fsVideoPlay.png"
......@@ -2,7 +2,7 @@
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="WebKit2"
Name="WebKit"
ProjectGUID="{2E51ABE8-76CB-485B-A66C-46AEF4DF8ACD}"
RootNamespace="WebKit2"
Keyword="Win32Proj"
......@@ -591,10 +591,6 @@
<Filter
Name="win"
>
<File
RelativePath="..\WebProcess\WebCoreSupport\win\WebCoreLocalizedStrings.cpp"
>
</File>
<File
RelativePath="..\WebProcess\WebCoreSupport\win\WebErrorsWin.cpp"
>
......@@ -660,18 +656,6 @@
<Filter
Name="win"
>
<File
RelativePath="..\WebProcess\win\DllMain.cpp"
>
</File>
<File
RelativePath="..\WebProcess\win\WebLocalizableStrings.cpp"
>
</File>
<File
RelativePath="..\WebProcess\win\WebLocalizableStrings.h"