From f340825f35ad3de28685f4890cd73bbf9bb6c0e6 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 28 Jul 2009 16:29:47 +0200 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to origin/qtwebkit-4.6-staging ( 07fbaeddfade72be1d0d7e7f2b947e5d3c183f4a ) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes in WebKit/qt since the last update: ++ b/WebKit/qt/ChangeLog Rubber-stamped by Ariya Hidayat. Fix compilation with the precompiled header. * WebKit_pch.h: Don't include JSDOMBinding.h and MathObject.h, as they include AtomicString.h. AtomicString.cpp needs to enable a #define before including AtomicString.h, which breaks if the PCH forces the inclusion beforehand. 2009-07-28 Ariya Hidayat Reviewed by Simon Hausmann. Added tests to ensure that scroll position can be changed programmatically, even when the scroll bar policy is set to off. * tests/qwebframe/tst_qwebframe.cpp: 2009-07-28 Tor Arne Vestbø Reviewed by Simon Hausmann. Fix a few compilation warnings in the QWebFrame tests. * tests/qwebframe/tst_qwebframe.cpp: 2009-07-28 Andre Pedralho Reviewed by Simon Hausmann. Fixed tst_QWebFrame::hasSetFocus test which was using an undefined resource. https://bugs.webkit.org/show_bug.cgi?id=27512 * tests/qwebframe/tst_qwebframe.cpp: 2009-07-28 Simon Hausmann --- src/3rdparty/webkit/ChangeLog | 26 + src/3rdparty/webkit/JavaScriptCore/ChangeLog | 16 + .../webkit/JavaScriptCore/JavaScriptCore.pri | 29 +- src/3rdparty/webkit/JavaScriptCore/jsc.pro | 31 + src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h | 37 +- .../JavaScriptCore/wtf/haiku/MainThreadHaiku.cpp | 47 - src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 83 + src/3rdparty/webkit/WebCore/WebCore.pro | 4 - .../webkit/WebCore/editing/haiku/EditorHaiku.cpp | 45 - .../webkit/WebCore/inspector/front-end/Console.js | 9 +- .../WebCore/inspector/front-end/ElementsPanel.js | 4 +- .../loader/icon/wince/IconDatabaseWince.cpp | 81 - .../WebCore/page/haiku/DragControllerHaiku.cpp | 77 - .../WebCore/page/haiku/EventHandlerHaiku.cpp | 151 -- .../webkit/WebCore/page/haiku/FrameHaiku.cpp | 43 - src/3rdparty/webkit/WebCore/platform/Logging.cpp | 79 +- .../platform/graphics/wince/FontCacheWince.cpp | 352 ---- .../graphics/wince/FontCustomPlatformData.cpp | 79 - .../graphics/wince/FontCustomPlatformData.h | 55 - .../platform/graphics/wince/FontPlatformData.cpp | 532 ------ .../platform/graphics/wince/FontPlatformData.h | 90 - .../WebCore/platform/graphics/wince/FontWince.cpp | 333 ---- .../graphics/wince/GlyphPageTreeNodeWince.cpp | 79 - .../graphics/wince/GraphicsContextWince.cpp | 1839 -------------------- .../graphics/wince/SimpleFontDataWince.cpp | 161 -- .../WebCore/platform/haiku/ClipboardHaiku.cpp | 207 --- .../webkit/WebCore/platform/haiku/ClipboardHaiku.h | 73 - .../WebCore/platform/haiku/ContextMenuHaiku.cpp | 143 -- .../platform/haiku/ContextMenuItemHaiku.cpp | 164 -- .../WebCore/platform/haiku/CookieJarHaiku.cpp | 61 - .../webkit/WebCore/platform/haiku/CursorHaiku.cpp | 237 --- .../WebCore/platform/haiku/DragDataHaiku.cpp | 109 -- .../WebCore/platform/haiku/DragImageHaiku.cpp | 74 - .../WebCore/platform/haiku/EventLoopHaiku.cpp | 41 - .../WebCore/platform/haiku/FileChooserHaiku.cpp | 46 - .../WebCore/platform/haiku/FileSystemHaiku.cpp | 82 - .../webkit/WebCore/platform/haiku/KeyboardCodes.h | 544 ------ .../platform/haiku/MIMETypeRegistryHaiku.cpp | 75 - .../image-decoders/haiku/ImageDecoderHaiku.cpp | 131 -- .../WebCore/platform/network/ResourceHandle.h | 6 - .../sql/chromium/SQLiteFileSystemChromium.cpp | 107 -- .../sql/chromium/SQLiteFileSystemChromiumLinux.cpp | 41 - .../sql/chromium/SQLiteFileSystemChromiumMac.cpp | 41 - .../sql/chromium/SQLiteFileSystemChromiumWin.cpp | 170 -- .../WebCore/platform/text/haiku/StringHaiku.cpp | 51 - .../haiku/TextBreakIteratorInternalICUHaiku.cpp | 36 - .../WebCore/storage/wince/DatabaseThreadWince.cpp | 95 - .../WebCore/storage/wince/DatabaseThreadWince.h | 65 - .../storage/wince/LocalStorageThreadWince.cpp | 83 - .../storage/wince/LocalStorageThreadWince.h | 58 - .../svg/graphics/wince/SVGResourceFilterWince.cpp | 46 - src/3rdparty/webkit/WebCore/wml/WMLNoopElement.cpp | 7 +- src/3rdparty/webkit/WebKit.pri | 4 + .../WebCoreSupport/ContextMenuClientHaiku.cpp | 85 - .../haiku/WebCoreSupport/ContextMenuClientHaiku.h | 53 - .../haiku/WebCoreSupport/DragClientHaiku.cpp | 74 - .../WebKit/haiku/WebCoreSupport/DragClientHaiku.h | 46 - .../haiku/WebCoreSupport/EditorClientHaiku.cpp | 479 ----- .../haiku/WebCoreSupport/EditorClientHaiku.h | 124 -- .../haiku/WebCoreSupport/InspectorClientHaiku.cpp | 119 -- .../haiku/WebCoreSupport/InspectorClientHaiku.h | 71 - src/3rdparty/webkit/WebKit/qt/ChangeLog | 38 + src/3rdparty/webkit/WebKit/qt/WebKit_pch.h | 3 - .../WebKit/qt/tests/qwebframe/tst_qwebframe.cpp | 48 +- 65 files changed, 355 insertions(+), 7866 deletions(-) create mode 100644 src/3rdparty/webkit/JavaScriptCore/jsc.pro delete mode 100644 src/3rdparty/webkit/JavaScriptCore/wtf/haiku/MainThreadHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/editing/haiku/EditorHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/loader/icon/wince/IconDatabaseWince.cpp delete mode 100644 src/3rdparty/webkit/WebCore/page/haiku/DragControllerHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/page/haiku/EventHandlerHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/page/haiku/FrameHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCacheWince.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCustomPlatformData.h delete mode 100644 src/3rdparty/webkit/WebCore/platform/graphics/wince/FontPlatformData.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/graphics/wince/FontPlatformData.h delete mode 100644 src/3rdparty/webkit/WebCore/platform/graphics/wince/FontWince.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/graphics/wince/GlyphPageTreeNodeWince.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/graphics/wince/GraphicsContextWince.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/graphics/wince/SimpleFontDataWince.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/ClipboardHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/ClipboardHaiku.h delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/ContextMenuHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/ContextMenuItemHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/CookieJarHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/CursorHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/DragDataHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/DragImageHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/EventLoopHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/FileChooserHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/FileSystemHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/KeyboardCodes.h delete mode 100644 src/3rdparty/webkit/WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromium.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumLinux.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumMac.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/text/haiku/StringHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/platform/text/haiku/TextBreakIteratorInternalICUHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebCore/storage/wince/DatabaseThreadWince.cpp delete mode 100644 src/3rdparty/webkit/WebCore/storage/wince/DatabaseThreadWince.h delete mode 100644 src/3rdparty/webkit/WebCore/storage/wince/LocalStorageThreadWince.cpp delete mode 100644 src/3rdparty/webkit/WebCore/storage/wince/LocalStorageThreadWince.h delete mode 100644 src/3rdparty/webkit/WebCore/svg/graphics/wince/SVGResourceFilterWince.cpp delete mode 100644 src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.h delete mode 100644 src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/DragClientHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/DragClientHaiku.h delete mode 100644 src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h delete mode 100644 src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp delete mode 100644 src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h diff --git a/src/3rdparty/webkit/ChangeLog b/src/3rdparty/webkit/ChangeLog index b9b0da7..a08a7b4 100644 --- a/src/3rdparty/webkit/ChangeLog +++ b/src/3rdparty/webkit/ChangeLog @@ -1,3 +1,29 @@ +2009-07-28 Xan Lopez + + Reviewed by Gustavo Noronha. + + Use automake 1.11 SILENT_RULES when present, for cleaner build + output. You can disable it by passing --disable-silent-rules to + configure or V=1 to make. + + * autotools/dolt.m4: + * configure.ac: + +2009-07-28 Laszlo Gombos + + Reviewed by Simon Hausmann. + + [Qt] Disable some compiler warnings for the win build + https://bugs.webkit.org/show_bug.cgi?id=27709 + + * WebKit.pri: + +2009-07-28 Xan Lopez + + Reviewed by Gustavo Noronha. + + * configure.ac: bump version for 1.1.12 release. + 2009-07-24 Xan Lopez Reviewed by Gustavo Noronha. diff --git a/src/3rdparty/webkit/JavaScriptCore/ChangeLog b/src/3rdparty/webkit/JavaScriptCore/ChangeLog index 67899ea..24fc7e7 100644 --- a/src/3rdparty/webkit/JavaScriptCore/ChangeLog +++ b/src/3rdparty/webkit/JavaScriptCore/ChangeLog @@ -1,3 +1,19 @@ +2009-07-28 Xan Lopez + + Add new files, fixes distcheck. + + * GNUmakefile.am: + +2009-07-28 Csaba Osztrogonac + + Reviewed by Simon Hausmann. + + [Qt] Determining whether to use JIT or interpreter + moved from JavaScriptCore.pri to Platform.h + + * JavaScriptCore.pri: + * wtf/Platform.h: + 2009-07-27 Brian Weinstein Fix of misuse of sort command. diff --git a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri index 5c50ee0..b43602e 100644 --- a/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri +++ b/src/3rdparty/webkit/JavaScriptCore/JavaScriptCore.pri @@ -37,34 +37,17 @@ win32-* { LIBS += -lwinmm } -# Default rules to turn JIT on/off -!contains(DEFINES, ENABLE_JIT=.) { - isEqual(QT_ARCH,i386)|isEqual(QT_ARCH,windows) { - # Require gcc >= 4.1 - CONFIG(release):linux-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) { - DEFINES += ENABLE_JIT=1 - } - win32-msvc* { - DEFINES += ENABLE_JIT=1 - } - } +# In debug mode JIT disabled until crash fixed +win32-* { + CONFIG(debug):!contains(DEFINES, ENABLE_JIT=1): DEFINES+=ENABLE_JIT=0 } -# Rules when JIT enabled -contains(DEFINES, ENABLE_JIT=1) { - !contains(DEFINES, ENABLE_YARR=.): DEFINES += ENABLE_YARR=1 - !contains(DEFINES, ENABLE_YARR_JIT=.): DEFINES += ENABLE_YARR_JIT=1 - !contains(DEFINES, ENABLE_JIT_OPTIMIZE_CALL=.): DEFINES += ENABLE_JIT_OPTIMIZE_CALL=1 - !contains(DEFINES, ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS=.): DEFINES += ENABLE_JIT_OPTIMIZE_PROPERTY_ACCESS=1 - !contains(DEFINES, ENABLE_JIT_OPTIMIZE_ARITHMETIC=.): DEFINES += ENABLE_JIT_OPTIMIZE_ARITHMETIC=1 - linux-g++* { - !contains(DEFINES, WTF_USE_JIT_STUB_ARGUMENT_VA_LIST=.): DEFINES += WTF_USE_JIT_STUB_ARGUMENT_VA_LIST=1 +# Rules when JIT enabled (not disabled) +!contains(DEFINES, ENABLE_JIT=0) { + linux-g++*:greaterThan(QT_GCC_MAJOR_VERSION,3):greaterThan(QT_GCC_MINOR_VERSION,0) { QMAKE_CXXFLAGS += -fno-stack-protector QMAKE_CFLAGS += -fno-stack-protector } - win32-msvc* { - !contains(DEFINES, WTF_USE_JIT_STUB_ARGUMENT_REGISTER=.): DEFINES += WTF_USE_JIT_STUB_ARGUMENT_REGISTER=1 - } } win32-msvc*: INCLUDEPATH += $$PWD/os-win32 diff --git a/src/3rdparty/webkit/JavaScriptCore/jsc.pro b/src/3rdparty/webkit/JavaScriptCore/jsc.pro new file mode 100644 index 0000000..ba880ff --- /dev/null +++ b/src/3rdparty/webkit/JavaScriptCore/jsc.pro @@ -0,0 +1,31 @@ +TEMPLATE = app +TARGET = jsc +DESTDIR = . +SOURCES = jsc.cpp +QT -= gui +CONFIG -= app_bundle +CONFIG += building-libs +win32-*: CONFIG += console +win32-msvc*: CONFIG += exceptions_off stl_off + +include($$PWD/../WebKit.pri) + +CONFIG += link_pkgconfig + +QMAKE_RPATHDIR += $$OUTPUT_DIR/lib + +isEmpty(OUTPUT_DIR):OUTPUT_DIR=$$PWD/.. +CONFIG(debug, debug|release) { + OBJECTS_DIR = obj/debug +} else { # Release + OBJECTS_DIR = obj/release +} +OBJECTS_DIR_WTR = $$OBJECTS_DIR$${QMAKE_DIR_SEP} +include($$PWD/JavaScriptCore.pri) + +lessThan(QT_MINOR_VERSION, 4) { + DEFINES += QT_BEGIN_NAMESPACE="" QT_END_NAMESPACE="" +} + +*-g++*:QMAKE_CXXFLAGS_RELEASE -= -O2 +*-g++*:QMAKE_CXXFLAGS_RELEASE += -O3 diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h index 29a6fbe..5b43d17 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/Platform.h @@ -567,6 +567,7 @@ #endif #if !defined(ENABLE_JIT) + /* The JIT is tested & working on x86_64 Mac */ #if PLATFORM(X86_64) && PLATFORM(MAC) #define ENABLE_JIT 1 @@ -582,7 +583,21 @@ #elif PLATFORM(X86) && PLATFORM(WIN) #define ENABLE_JIT 1 #endif + +#if PLATFORM(X86) && PLATFORM(QT) +#if PLATFORM(WIN_OS) && COMPILER(MINGW) && GCC_VERSION >= 40100 + #define ENABLE_JIT 1 + #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 +#elif PLATFORM(WIN_OS) && COMPILER(MSVC) + #define ENABLE_JIT 1 + #define WTF_USE_JIT_STUB_ARGUMENT_REGISTER 1 +#elif PLATFORM(LINUX) && GCC_VERSION >= 40100 + #define ENABLE_JIT 1 + #define WTF_USE_JIT_STUB_ARGUMENT_VA_LIST 1 #endif +#endif /* PLATFORM(QT) && PLATFORM(X86) */ + +#endif /* !defined(ENABLE_JIT) */ #if ENABLE(JIT) #ifndef ENABLE_JIT_OPTIMIZE_CALL @@ -621,15 +636,29 @@ #endif /* Yet Another Regex Runtime. */ +#if !defined(ENABLE_YARR_JIT) + /* YARR supports x86 & x86-64, and has been tested on Mac and Windows. */ -#if (!defined(ENABLE_YARR_JIT) && PLATFORM(X86) && PLATFORM(MAC)) \ - || (!defined(ENABLE_YARR_JIT) && PLATFORM(X86_64) && PLATFORM(MAC)) \ +#if (PLATFORM(X86) && PLATFORM(MAC)) \ + || (PLATFORM(X86_64) && PLATFORM(MAC)) \ /* Under development, temporarily disabled until 16Mb link range limit in assembler is fixed. */ \ - || (!defined(ENABLE_YARR_JIT) && PLATFORM_ARM_ARCH(7) && PLATFORM(IPHONE) && 0) \ - || (!defined(ENABLE_YARR_JIT) && PLATFORM(X86) && PLATFORM(WIN)) + || (PLATFORM_ARM_ARCH(7) && PLATFORM(IPHONE) && 0) \ + || (PLATFORM(X86) && PLATFORM(WIN)) +#define ENABLE_YARR 1 +#define ENABLE_YARR_JIT 1 +#endif + +#if PLATFORM(X86) && PLATFORM(QT) +#if (PLATFORM(WIN_OS) && COMPILER(MINGW) && GCC_VERSION >= 40100) \ + || (PLATFORM(WIN_OS) && COMPILER(MSVC)) \ + || (PLATFORM(LINUX) && GCC_VERSION >= 40100) #define ENABLE_YARR 1 #define ENABLE_YARR_JIT 1 #endif +#endif + +#endif /* !defined(ENABLE_YARR_JIT) */ + /* Sanity Check */ #if ENABLE(YARR_JIT) && !ENABLE(YARR) #error "YARR_JIT requires YARR" diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/haiku/MainThreadHaiku.cpp b/src/3rdparty/webkit/JavaScriptCore/wtf/haiku/MainThreadHaiku.cpp deleted file mode 100644 index 4fd7b35..0000000 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/haiku/MainThreadHaiku.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2007 Kevin Ollivier - * Copyright (C) 2009 Maxime Simon - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "config.h" -#include "MainThread.h" - - -namespace WTF { - -void initializeMainThreadPlatform() -{ - notImplemented(); -} - -void scheduleDispatchFunctionsOnMainThread() -{ - notImplemented(); -} - -} // namespace WTF - diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 8bc2428..89c70d1 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - c0d124d5d596c56fa2086a70436656d41bbc72f8 + 07fbaeddfade72be1d0d7e7f2b947e5d3c183f4a diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 467345a..7fc69b4 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,86 @@ +2009-07-28 Tor Arne Vestbø + + Reviewed by Steve Falkenburg. + + Add output directory for VS pre-build steps to enable out-of-tree builds + + https://bugs.webkit.org/show_bug.cgi?id=27700 + + The tmp.obj file is now placed in the intermediate build directory. + + * WebCore.vcproj/WebCoreCommon.vsprops: + +2009-07-28 Pavel Feldman + + Reviewed by Timothy Hatcher. + + Web Inspector: Add inspected node using public console API. + + https://bugs.webkit.org/show_bug.cgi?id=27758 + + * inspector/front-end/Console.js: + (WebInspector.Console.prototype.addInspectedNode): + * inspector/front-end/ElementsPanel.js: + (WebInspector.ElementsPanel.this.treeOutline.focusedNodeChanged): + (WebInspector.ElementsPanel): + +2009-07-28 Nikolas Zimmermann + + Reviewed by George Staikos. + + [WML] elements with a task shouldn't be exposed to the user + https://bugs.webkit.org/show_bug.cgi?id=27724 + + Fix WMLNoopElement to disable it's parent WMLDoElement, as required by the spec. + Moved manual-tests/wml/task-noop-in-do.wml to LayoutTests/fast/wml/task-noop-in-do.wml. + + * manual-tests/wml/task-noop-in-do.wml: Removed. + * wml/WMLNoopElement.cpp: + (WebCore::WMLNoopElement::insertedIntoDocument): + +2009-07-28 Laszlo Gombos + + Reviewed by Simon Hausmann. + + [Qt] Disable some compiler warnings for the win build + https://bugs.webkit.org/show_bug.cgi?id=27709 + + * WebCore.pro: Move the msvc options to WebKit.pri + +2009-07-28 Gustavo Noronha Silva + + Reviewed by Tor Arne Vestbø + + Make equality checks for logging channel names ignore casing. + + * platform/Logging.cpp: + (WebCore::getChannelFromName): + +2009-07-28 Jan Michael Alonzo + + Reviewed by Xan Lopez. + + [Gtk] Refactor ResourceHandleSoup - make start* functions static + https://bugs.webkit.org/show_bug.cgi?id=27687 + + * platform/network/ResourceHandle.h: + * platform/network/soup/ResourceHandleSoup.cpp: + (WebCore::startData): + (WebCore::startHttp): + (WebCore::): + +2009-07-28 Xan Lopez + + Reviewed by Gustavo Noronha. + + https://bugs.webkit.org/show_bug.cgi?id=25415 + [GTK][ATK] Please implement support for get_text_at_offset + + Do not cache the pango layout in the object, since the layout of + the page can change between calls. + + * accessibility/gtk/AccessibilityObjectWrapperAtk.cpp: + 2009-07-23 Anton Muhin Reviewed by Adam Barth. diff --git a/src/3rdparty/webkit/WebCore/WebCore.pro b/src/3rdparty/webkit/WebCore/WebCore.pro index 668678b..e49ab13 100644 --- a/src/3rdparty/webkit/WebCore/WebCore.pro +++ b/src/3rdparty/webkit/WebCore/WebCore.pro @@ -37,10 +37,6 @@ unix { CONFIG -= warn_on *-g++*:QMAKE_CXXFLAGS += -Wreturn-type -fno-strict-aliasing -# Disable a few warnings on Windows. The warnings are also -# disabled in WebKitLibraries/win/tools/vsprops/common.vsprops -win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 - unix:!mac:*-g++*:QMAKE_CXXFLAGS += -ffunction-sections -fdata-sections unix:!mac:*-g++*:QMAKE_LFLAGS += -Wl,--gc-sections diff --git a/src/3rdparty/webkit/WebCore/editing/haiku/EditorHaiku.cpp b/src/3rdparty/webkit/WebCore/editing/haiku/EditorHaiku.cpp deleted file mode 100644 index 17fde1f..0000000 --- a/src/3rdparty/webkit/WebCore/editing/haiku/EditorHaiku.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "Editor.h" - -#include "ClipboardAccessPolicy.h" -#include "Clipboard.h" - -#include "ClipboardHaiku.h" - - -namespace WebCore { - -PassRefPtr Editor::newGeneralClipboard(ClipboardAccessPolicy policy) -{ - return new ClipboardHaiku(policy, false); -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/Console.js b/src/3rdparty/webkit/WebCore/inspector/front-end/Console.js index 51b4459..520e213 100644 --- a/src/3rdparty/webkit/WebCore/inspector/front-end/Console.js +++ b/src/3rdparty/webkit/WebCore/inspector/front-end/Console.js @@ -430,7 +430,14 @@ WebInspector.Console.prototype = { inspectedWindow._inspectorCommandLineAPI.clear = InspectorController.wrapCallback(this.clearMessages.bind(this)); } }, - + + addInspectedNode: function(node) + { + var inspectedWindow = InspectorController.inspectedWindow(); + this._ensureCommandLineAPIInstalled(inspectedWindow); + inspectedWindow._inspectorCommandLineAPI._addInspectedNode(node); + }, + doEvalInWindow: function(expression, callback) { if (!expression) { diff --git a/src/3rdparty/webkit/WebCore/inspector/front-end/ElementsPanel.js b/src/3rdparty/webkit/WebCore/inspector/front-end/ElementsPanel.js index 735505f..76d9746 100644 --- a/src/3rdparty/webkit/WebCore/inspector/front-end/ElementsPanel.js +++ b/src/3rdparty/webkit/WebCore/inspector/front-end/ElementsPanel.js @@ -61,9 +61,7 @@ WebInspector.ElementsPanel = function() this.panel.nodeSearchButton.removeStyleClass("toggled-on"); } - var inspectedWindow = InspectorController.inspectedWindow(); - WebInspector.console._ensureCommandLineAPIInstalled(inspectedWindow); - inspectedWindow._inspectorCommandLineAPI._addInspectedNode(this._focusedDOMNode); + WebInspector.console.addInspectedNode(this._focusedDOMNode); }; this.contentElement.appendChild(this.treeOutline.element); diff --git a/src/3rdparty/webkit/WebCore/loader/icon/wince/IconDatabaseWince.cpp b/src/3rdparty/webkit/WebCore/loader/icon/wince/IconDatabaseWince.cpp deleted file mode 100644 index e6d686c..0000000 --- a/src/3rdparty/webkit/WebCore/loader/icon/wince/IconDatabaseWince.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2007-2009 Torch Mobile Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "IconDatabase.h" - -#include "AutodrainedPool.h" -#include "CString.h" -#include "DocumentLoader.h" -#include "FileSystem.h" -#include "IconDatabaseClient.h" -#include "IconRecord.h" -#include "Image.h" - -namespace WebCore { - -// Function to obtain the global icon database. -IconDatabase* iconDatabase() { return 0; } - -IconDatabase::IconDatabase() {} -IconDatabase::~IconDatabase() {} - -void IconDatabase::setClient(IconDatabaseClient*) {} - -bool IconDatabase::open(const String& path) { return false; } -void IconDatabase::close() {} - -void IconDatabase::removeAllIcons() {} - -Image* IconDatabase::iconForPageURL(const String&, const IntSize&) { return 0; } -void IconDatabase::readIconForPageURLFromDisk(const String&) {} -String IconDatabase::iconURLForPageURL(const String&) { return String(); } -Image* IconDatabase::defaultIcon(const IntSize&) { return 0;} - -void IconDatabase::retainIconForPageURL(const String&) {} -void IconDatabase::releaseIconForPageURL(const String&) {} - -void IconDatabase::setIconDataForIconURL(PassRefPtr data, const String&) {} -void IconDatabase::setIconURLForPageURL(const String& iconURL, const String& pageURL) {} - -IconLoadDecision IconDatabase::loadDecisionForIconURL(const String&, DocumentLoader*) { return IconLoadNo; } -bool IconDatabase::iconDataKnownForIconURL(const String&) { return false; } - -void IconDatabase::setEnabled(bool enabled) {} -bool IconDatabase::isEnabled() const { return false; } - -void IconDatabase::setPrivateBrowsingEnabled(bool flag) {} -bool IconDatabase::isPrivateBrowsingEnabled() const { return false; } - -void IconDatabase::delayDatabaseCleanup() {} -void IconDatabase::allowDatabaseCleanup() {} -void IconDatabase::checkIntegrityBeforeOpening() {} - -// Support for WebCoreStatistics in WebKit -size_t IconDatabase::pageURLMappingCount() { return 0; } -size_t IconDatabase::retainedPageURLCount() {return 0; } -size_t IconDatabase::iconRecordCount() { return 0; } -size_t IconDatabase::iconRecordCountWithData() { return 0; } - -bool IconDatabase::isOpen() const { return false; } -String IconDatabase::databasePath() const { return String(); } -String IconDatabase::defaultDatabaseFilename() { return String(); } - -} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/page/haiku/DragControllerHaiku.cpp b/src/3rdparty/webkit/WebCore/page/haiku/DragControllerHaiku.cpp deleted file mode 100644 index 0b95558..0000000 --- a/src/3rdparty/webkit/WebCore/page/haiku/DragControllerHaiku.cpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "DragController.h" - -#include "DragData.h" - -#include - - -namespace WebCore -{ - -// FIXME: These values are straight out of DragControllerMac, so probably have -// little correlation with Haiku standards... -const int DragController::LinkDragBorderInset = 2; -const int DragController::MaxOriginalImageArea = 1500 * 1500; -const int DragController::DragIconRightInset = 7; -const int DragController::DragIconBottomInset = 3; - -const float DragController::DragImageAlpha = 0.75f; - - -bool DragController::isCopyKeyDown() -{ - if (modifiers() & B_COMMAND_KEY) - return true; - - return false; -} - -DragOperation DragController::dragOperation(DragData* dragData) -{ - // FIXME: This logic is incomplete - if (dragData->containsURL()) - return DragOperationCopy; - - return DragOperationNone; -} - -const IntSize& DragController::maxDragImageSize() -{ - static const IntSize maxDragImageSize(400, 400); - - return maxDragImageSize; -} - -void DragController::cleanupAfterSystemDrag() -{ -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/page/haiku/EventHandlerHaiku.cpp b/src/3rdparty/webkit/WebCore/page/haiku/EventHandlerHaiku.cpp deleted file mode 100644 index 8d5dcb5..0000000 --- a/src/3rdparty/webkit/WebCore/page/haiku/EventHandlerHaiku.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Copyright (C) 2006 Zack Rusin - * Copyright (C) 2007 Ryan Leavengood - * Copyright (C) 2009 Maxime Simon - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "EventHandler.h" - -#include "ClipboardHaiku.h" -#include "EventNames.h" -#include "FocusController.h" -#include "Frame.h" -#include "FrameView.h" -#include "HitTestResult.h" -#include "KeyboardEvent.h" -#include "MouseEventWithHitTestResults.h" -#include "Page.h" -#include "PlatformKeyboardEvent.h" -#include "PlatformScrollBar.h" -#include "PlatformWheelEvent.h" -#include "RenderWidget.h" - -#include "NotImplemented.h" - -#include - - -namespace WebCore { - -const double EventHandler::TextDragDelay = 0.0; - -static bool isKeyboardOptionTab(KeyboardEvent* event) -{ - return event - && (event->type() == eventNames().keydownEvent - || event->type() == eventNames().keypressEvent) - && event->altKey() - && event->keyIdentifier() == "U+000009"; -} - -bool EventHandler::invertSenseOfTabsToLinks(KeyboardEvent* event) const -{ - return isKeyboardOptionTab(event); -} - -bool EventHandler::tabsToAllControls(KeyboardEvent* event) const -{ - bool handlingOptionTab = isKeyboardOptionTab(event); - - return handlingOptionTab; -} - -void EventHandler::focusDocumentView() -{ - BView* view = m_frame->view()->platformWidget(); - if (view) - view->MakeFocus(); - - Page* page = m_frame->page(); - if (page) - page->focusController()->setFocusedFrame(m_frame); -} - -bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event) -{ - // Figure out which view to send the event to. - RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0; - if (!target || !target->isWidget()) - return false; - - return passMouseDownEventToWidget(static_cast(target)->widget()); -} - -bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget) -{ - return passMouseDownEventToWidget(renderWidget->widget()); -} - -bool EventHandler::passMouseDownEventToWidget(Widget* widget) -{ - notImplemented(); - return false; -} - -bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const -{ - notImplemented(); - return false; -} - -bool EventHandler::passSubframeEventToSubframe(MouseEventWithHitTestResults& event, Frame* subframe, HitTestResult*) -{ - notImplemented(); - return true; -} - -bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& event, Widget* widget) -{ - notImplemented(); - return false; -} - -PassRefPtr EventHandler::createDraggingClipboard() const -{ - return new ClipboardHaiku(ClipboardWritable, true); -} - -bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) -{ - return passSubframeEventToSubframe(mev, subframe); -} - -bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode) -{ - return passSubframeEventToSubframe(mev, subframe, hoveredNode); -} - -bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) -{ - return passSubframeEventToSubframe(mev, subframe); -} - -unsigned EventHandler::accessKeyModifiers() -{ - return PlatformKeyboardEvent::AltKey; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/page/haiku/FrameHaiku.cpp b/src/3rdparty/webkit/WebCore/page/haiku/FrameHaiku.cpp deleted file mode 100644 index 50168dd..0000000 --- a/src/3rdparty/webkit/WebCore/page/haiku/FrameHaiku.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "Frame.h" - -#include "NotImplemented.h" - - -namespace WebCore { - -DragImageRef Frame::dragImageForSelection() -{ - notImplemented(); - return 0; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/Logging.cpp b/src/3rdparty/webkit/WebCore/platform/Logging.cpp index e369356..f3c6f1c 100644 --- a/src/3rdparty/webkit/WebCore/platform/Logging.cpp +++ b/src/3rdparty/webkit/WebCore/platform/Logging.cpp @@ -65,26 +65,65 @@ WTFLogChannel* getChannelFromName(const String& channelName) if (!(channelName.length() >= 2)) return 0; - if (channelName == String("BackForward")) return &LogBackForward; - if (channelName == String("Editing")) return &LogEditing; - if (channelName == String("Events")) return &LogEvents; - if (channelName == String("Frames")) return &LogFrames; - if (channelName == String("FTP")) return &LogFTP; - if (channelName == String("History")) return &LogHistory; - if (channelName == String("IconDatabase")) return &LogIconDatabase; - if (channelName == String("Loading")) return &LogLoading; - if (channelName == String("Media")) return &LogMedia; - if (channelName == String("Network")) return &LogNetwork; - if (channelName == String("NotYetImplemented")) return &LogNotYetImplemented; - if (channelName == String("PageCache")) return &LogPageCache; - if (channelName == String("PlatformLeaks")) return &LogPlatformLeaks; - if (channelName == String("Plugins")) return &LogPlugins; - if (channelName == String("PopupBlocking")) return &LogPopupBlocking; - if (channelName == String("SpellingAndGrammar")) return &LogSpellingAndGrammar; - if (channelName == String("SQLDatabase")) return &LogSQLDatabase; - if (channelName == String("StorageAPI")) return &LogStorageAPI; - if (channelName == String("TextConversion")) return &LogTextConversion; - if (channelName == String("Threading")) return &LogThreading; + if (equalIgnoringCase(channelName, String("BackForward"))) + return &LogBackForward; + + if (equalIgnoringCase(channelName, String("Editing"))) + return &LogEditing; + + if (equalIgnoringCase(channelName, String("Events"))) + return &LogEvents; + + if (equalIgnoringCase(channelName, String("Frames"))) + return &LogFrames; + + if (equalIgnoringCase(channelName, String("FTP"))) + return &LogFTP; + + if (equalIgnoringCase(channelName, String("History"))) + return &LogHistory; + + if (equalIgnoringCase(channelName, String("IconDatabase"))) + return &LogIconDatabase; + + if (equalIgnoringCase(channelName, String("Loading"))) + return &LogLoading; + + if (equalIgnoringCase(channelName, String("Media"))) + return &LogMedia; + + if (equalIgnoringCase(channelName, String("Network"))) + return &LogNetwork; + + if (equalIgnoringCase(channelName, String("NotYetImplemented"))) + return &LogNotYetImplemented; + + if (equalIgnoringCase(channelName, String("PageCache"))) + return &LogPageCache; + + if (equalIgnoringCase(channelName, String("PlatformLeaks"))) + return &LogPlatformLeaks; + + if (equalIgnoringCase(channelName, String("Plugins"))) + return &LogPlugins; + + if (equalIgnoringCase(channelName, String("PopupBlocking"))) + return &LogPopupBlocking; + + if (equalIgnoringCase(channelName, String("SpellingAndGrammar"))) + return &LogSpellingAndGrammar; + + if (equalIgnoringCase(channelName, String("SQLDatabase"))) + return &LogSQLDatabase; + + if (equalIgnoringCase(channelName, String("StorageAPI"))) + return &LogStorageAPI; + + if (equalIgnoringCase(channelName, String("TextConversion"))) + return &LogTextConversion; + + if (equalIgnoringCase(channelName, String("Threading"))) + return &LogThreading; return 0; } diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCacheWince.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCacheWince.cpp deleted file mode 100644 index f67f1b4..0000000 --- a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCacheWince.cpp +++ /dev/null @@ -1,352 +0,0 @@ -/* -* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. -* Copyright (C) 2007-2009 Torch Mobile, Inc. -* -* 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. -* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of -* its contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "config.h" -#include "FontCache.h" - -#include "Font.h" -#include "FontData.h" -#include "SimpleFontData.h" -#include "UnicodeRange.h" -#include "wtf/OwnPtr.h" - -#include -#include - -namespace WebCore { - -extern HDC g_screenDC; - -static IMultiLanguage *multiLanguage = 0; - -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) -static IMLangFontLink2* langFontLink = 0; -#else -static IMLangFontLink* langFontLink = 0; -#endif - -IMultiLanguage* getMultiLanguageInterface() -{ - if (!multiLanguage) - CoCreateInstance(CLSID_CMultiLanguage, 0, CLSCTX_INPROC_SERVER, IID_IMultiLanguage, (void**)&multiLanguage); - - return multiLanguage; -} - -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) -IMLangFontLink2* FontCache::getFontLinkInterface() -#else -IMLangFontLink* FontCache::getFontLinkInterface() -#endif -{ - if (!langFontLink) { - if (IMultiLanguage* mli = getMultiLanguageInterface()) - mli->QueryInterface(&langFontLink); - } - - return langFontLink; -} - -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) -static bool currentFontContainsCharacter(IMLangFontLink2* langFontLink, HDC hdc, UChar character) -{ - UINT unicodeRanges; - if (S_OK != langFontLink->GetFontUnicodeRanges(hdc, &unicodeRanges, 0)) - return false; - - static Vector glyphsetBuffer; - glyphsetBuffer.resize(unicodeRanges); - - if (S_OK != langFontLink->GetFontUnicodeRanges(hdc, &unicodeRanges, glyphsetBuffer.data())) - return false; - - // FIXME: Change this to a binary search. (Yong Li: That's easy. But, is it guaranteed that the ranges are sorted?) - for (Vector::const_iterator i = glyphsetBuffer.begin(); i != glyphsetBuffer.end(); ++i) { - if (i->wcTo >= character) - return i->wcFrom <= character; - } - - return false; -} -#else -static bool currentFontContainsCharacter(IMLangFontLink* langFontLink, HDC hdc, HFONT hfont, UChar character, const wchar_t* faceName) -{ - DWORD fontCodePages = 0, charCodePages = 0; - HRESULT result = langFontLink->GetFontCodePages(hdc, hfont, &fontCodePages); - if (result != S_OK) - return false; - result = langFontLink->GetCharCodePages(character, &charCodePages); - if (result != S_OK) - return false; - - fontCodePages |= FontPlatformData::getKnownFontCodePages(faceName); - if (fontCodePages & charCodePages) - return true; - - return false; -} -#endif - -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) -static HFONT createMLangFont(IMLangFontLink2* langFontLink, HDC hdc, DWORD codePageMask, UChar character = 0) -{ - HFONT mlangFont; - if (SUCCEEDED(langFontLink->MapFont(hdc, codePageMask, character, &mlangFont))) - return mlangFont; - - return 0; -} -#else -static HFONT createMLangFont(IMLangFontLink* langFontLink, HDC hdc, const FontPlatformData& refFont, DWORD codePageMask) -{ - HFONT mlangFont; - LRESULT result = langFontLink->MapFont(hdc, codePageMask, refFont.hfont(), &mlangFont); - - return result == S_OK ? mlangFont : 0; -} -#endif - -static const Vector& getCJKCodePageMasks() -{ - // The default order in which we look for a font for a CJK character. If the user's default code page is - // one of these, we will use it first. - static const UINT CJKCodePages[] = { - 932, /* Japanese */ - 936, /* Simplified Chinese */ - 950, /* Traditional Chinese */ - 949 /* Korean */ - }; - - static Vector codePageMasks; - static bool initialized; - if (!initialized) { - initialized = true; -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) - IMLangFontLink2* langFontLink = fontCache()->getFontLinkInterface(); -#else - IMLangFontLink* langFontLink = fontCache()->getFontLinkInterface(); -#endif - if (!langFontLink) - return codePageMasks; - - UINT defaultCodePage; - DWORD defaultCodePageMask = 0; - if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_RETURN_NUMBER | LOCALE_IDEFAULTANSICODEPAGE, reinterpret_cast(&defaultCodePage), sizeof(defaultCodePage))) - langFontLink->CodePageToCodePages(defaultCodePage, &defaultCodePageMask); - - if (defaultCodePage == CJKCodePages[0] || defaultCodePage == CJKCodePages[1] || defaultCodePage == CJKCodePages[2] || defaultCodePage == CJKCodePages[3]) - codePageMasks.append(defaultCodePageMask); - for (unsigned i = 0; i < 4; ++i) { - if (defaultCodePage != CJKCodePages[i]) { - DWORD codePageMask; - langFontLink->CodePageToCodePages(CJKCodePages[i], &codePageMask); - codePageMasks.append(codePageMask); - } - } - } - return codePageMasks; -} - - -struct TraitsInFamilyProcData { - TraitsInFamilyProcData(const AtomicString& familyName) - : m_familyName(familyName) - { - } - - const AtomicString& m_familyName; - HashSet m_traitsMasks; -}; - -static int CALLBACK traitsInFamilyEnumProc(CONST LOGFONT* logFont, CONST TEXTMETRIC* metrics, DWORD fontType, LPARAM lParam) -{ - TraitsInFamilyProcData* procData = reinterpret_cast(lParam); - - unsigned traitsMask = 0; - traitsMask |= logFont->lfItalic ? FontStyleItalicMask : FontStyleNormalMask; - traitsMask |= FontVariantNormalMask; - LONG weight = FontPlatformData::adjustedGDIFontWeight(logFont->lfWeight, procData->m_familyName); - traitsMask |= weight == FW_THIN ? FontWeight100Mask : - weight == FW_EXTRALIGHT ? FontWeight200Mask : - weight == FW_LIGHT ? FontWeight300Mask : - weight == FW_NORMAL ? FontWeight400Mask : - weight == FW_MEDIUM ? FontWeight500Mask : - weight == FW_SEMIBOLD ? FontWeight600Mask : - weight == FW_BOLD ? FontWeight700Mask : - weight == FW_EXTRABOLD ? FontWeight800Mask : - FontWeight900Mask; - procData->m_traitsMasks.add(traitsMask); - return 1; -} - -void FontCache::platformInit() -{ -} - -void FontCache::comInitialize() -{ -} - -void FontCache::comUninitialize() -{ - if (langFontLink) { - langFontLink->Release(); - langFontLink = 0; - } - if (multiLanguage) { - multiLanguage->Release(); - multiLanguage = 0; - } -} - -const SimpleFontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length) -{ - String familyName; - WCHAR name[LF_FACESIZE]; - - UChar character = characters[0]; - const FontPlatformData& origFont = font.primaryFont()->fontDataForCharacter(character)->platformData(); - unsigned unicodeRange = findCharUnicodeRange(character); - -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) - if (IMLangFontLink2* langFontLink = getFontLinkInterface()) { -#else - if (IMLangFontLink* langFontLink = getFontLinkInterface()) { -#endif - HGDIOBJ oldFont = GetCurrentObject(g_screenDC, OBJ_FONT); - HFONT hfont = 0; - DWORD codePages = 0; - UINT codePage = 0; - // Try MLang font linking first. - langFontLink->GetCharCodePages(character, &codePages); - if (codePages && unicodeRange == cRangeSetCJK) { - // The CJK character may belong to multiple code pages. We want to - // do font linking against a single one of them, preferring the default - // code page for the user's locale. - const Vector& CJKCodePageMasks = getCJKCodePageMasks(); - unsigned numCodePages = CJKCodePageMasks.size(); - for (unsigned i = 0; i < numCodePages; ++i) { -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) - hfont = createMLangFont(langFontLink, g_screenDC, CJKCodePageMasks[i]); -#else - hfont = createMLangFont(langFontLink, g_screenDC, origFont, CJKCodePageMasks[i]); -#endif - if (!hfont) - continue; - - SelectObject(g_screenDC, hfont); - GetTextFace(g_screenDC, LF_FACESIZE, name); - - if (hfont && !(codePages & CJKCodePageMasks[i])) { - // We asked about a code page that is not one of the code pages - // returned by MLang, so the font might not contain the character. -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) - if (!currentFontContainsCharacter(langFontLink, g_screenDC, character)) { -#else - if (!currentFontContainsCharacter(langFontLink, g_screenDC, hfont, character, name)) { -#endif - SelectObject(g_screenDC, oldFont); - langFontLink->ReleaseFont(hfont); - hfont = 0; - continue; - } - } - break; - } - } else { -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) - hfont = createMLangFont(langFontLink, g_screenDC, codePages, character); -#else - hfont = createMLangFont(langFontLink, g_screenDC, origFont, codePages); -#endif - SelectObject(g_screenDC, hfont); - GetTextFace(g_screenDC, LF_FACESIZE, name); - } - SelectObject(g_screenDC, oldFont); - - if (hfont) { - familyName = name; - langFontLink->ReleaseFont(hfont); - } else - FontPlatformData::mapKnownFont(codePages, familyName); - } - - if (familyName.isEmpty()) - familyName = FontPlatformData::defaultFontFamily(); - - if (!familyName.isEmpty()) { - // FIXME: temporary workaround for Thai font problem - FontDescription fontDescription(font.fontDescription()); - if (unicodeRange == cRangeThai && fontDescription.weight() > FontWeightNormal) - fontDescription.setWeight(FontWeightNormal); - - FontPlatformData* result = getCachedFontPlatformData(fontDescription, familyName); - if (result && result->hash() != origFont.hash()) { - if (SimpleFontData* fontData = getCachedFontData(result)) - return fontData; - } - } - - return 0; -} - -FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font) -{ - return 0; -} - -FontPlatformData* FontCache::getLastResortFallbackFont(const FontDescription& fontDesc) -{ - // FIXME: Would be even better to somehow get the user's default font here. For now we'll pick - // the default that the user would get without changing any prefs. - return getCachedFontPlatformData(fontDesc, FontPlatformData::defaultFontFamily()); -} - -FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family) -{ - FontPlatformData* result = new FontPlatformData(fontDescription, family); - return result; -} - -void FontCache::getTraitsInFamily(const AtomicString& familyName, Vector& traitsMasks) -{ - LOGFONT logFont; - logFont.lfCharSet = DEFAULT_CHARSET; - unsigned familyLength = std::min(familyName.length(), static_cast(LF_FACESIZE - 1)); - memcpy(logFont.lfFaceName, familyName.characters(), familyLength * sizeof(UChar)); - logFont.lfFaceName[familyLength] = 0; - logFont.lfPitchAndFamily = 0; - - TraitsInFamilyProcData procData(familyName); - EnumFontFamiliesEx(g_screenDC, &logFont, traitsInFamilyEnumProc, reinterpret_cast(&procData), 0); - copyToVector(procData.m_traitsMasks, traitsMasks); -} - -} - diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp deleted file mode 100644 index 7c6853c..0000000 --- a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCustomPlatformData.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. - * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "FontCustomPlatformData.h" - -#include "Base64.h" -#include "CachedFont.h" -#include "FontPlatformData.h" -#include - -namespace WebCore { - -static CustomFontCache* g_customFontCache = 0; - -bool renameFont(SharedBuffer* fontData, const String& fontName); - -FontCustomPlatformData::~FontCustomPlatformData() -{ - if (g_customFontCache && !m_name.isEmpty()) - g_customFontCache->unregisterFont(m_name); -} - -FontPlatformData FontCustomPlatformData::fontPlatformData(int size, bool bold, bool italic, FontRenderingMode renderingMode) -{ - FontDescription fontDesc; - fontDesc.setComputedSize(size); - fontDesc.setSpecifiedSize(size); - fontDesc.setItalic(italic); - fontDesc.setWeight(bold ? FontWeightBold : FontWeightNormal); - return FontPlatformData(fontDesc, m_name, false); -} - -// Creates a unique and unpredictable font name, in order to avoid collisions and to -// not allow access from CSS. -static String createUniqueFontName() -{ - Vector fontUuid(sizeof(GUID)); - - unsigned int* ptr = reinterpret_cast(fontUuid.data()); - for (int i = 0; i < sizeof(GUID) / sizeof(int) ; ++i) - *(ptr + i) = static_cast(WTF::randomNumber() * (std::numeric_limits::max() + 1.0)); - - Vector fontNameVector; - base64Encode(fontUuid, fontNameVector); - ASSERT(fontNameVector.size() < LF_FACESIZE); - String fontName(fontNameVector.data(), fontNameVector.size()); - return fontName.replace('/', '_'); -} - -FontCustomPlatformData* createFontCustomPlatformData(CachedFont* cachedFont) -{ - if (g_customFontCache && cachedFont->CachedResource::data()) { - String fontName = createUniqueFontName(); - if (renameFont(cachedFont->CachedResource::data(), fontName) && g_customFontCache->registerFont(fontName, cachedFont)) - return new FontCustomPlatformData(fontName); - } - return 0; -} - -} diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCustomPlatformData.h b/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCustomPlatformData.h deleted file mode 100644 index b1f64a0..0000000 --- a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontCustomPlatformData.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2007, 2008 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef FontCustomPlatformData_h -#define FontCustomPlatformData_h - -#include "FontRenderingMode.h" -#include "PlatformString.h" -#include - -namespace WebCore { - - class FontPlatformData; - class CachedFont; - - class CustomFontCache { - public: - virtual bool registerFont(const String& fontName, CachedFont*) = 0; - virtual void unregisterFont(const String& fontName) = 0; - }; - - struct FontCustomPlatformData : Noncopyable { - FontCustomPlatformData(const String& name) - : m_name(name) - { - } - - ~FontCustomPlatformData(); - - FontPlatformData fontPlatformData(int size, bool bold, bool italic, FontRenderingMode = NormalRenderingMode); - String m_name; - }; - - FontCustomPlatformData* createFontCustomPlatformData(CachedFont*); - -} - -#endif diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontPlatformData.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontPlatformData.cpp deleted file mode 100644 index f0db2ff..0000000 --- a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontPlatformData.cpp +++ /dev/null @@ -1,532 +0,0 @@ -/* - * Copyright (C) 2007-2009 Torch Mobile Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "FontPlatformData.h" - -#include "Font.h" -#include "FontCache.h" -#include "FontData.h" -#include "PlatformString.h" -#include "SimpleFontData.h" -#include "UnicodeRange.h" -#include "wtf/OwnPtr.h" - -#include -#include - -namespace WebCore { - -extern HDC g_screenDC; - -static wchar_t songTiStr[] = { 0x5b8b, 0x4f53, 0 }; -static wchar_t heiTiStr[] = { 0x9ed1, 0x4f53, 0 }; - -class FontFamilyCodePageInfo { -public: - FontFamilyCodePageInfo() - : m_codePage(0), m_codePages(0) - { - } - FontFamilyCodePageInfo(const wchar_t* family, UINT codePage) - : m_family(family), m_codePage(codePage), m_codePages(0) - { - } - DWORD codePages() const - { - if (!m_codePages) { -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) - if (IMLangFontLink2* langFontLink = fontCache()->getFontLinkInterface()) - langFontLink->CodePageToCodePages(m_codePage, &m_codePages); -#else - if (IMLangFontLink* langFontLink = fontCache()->getFontLinkInterface()) - langFontLink->CodePageToCodePages(m_codePage, &m_codePages); -#endif - } - return m_codePages; - } - - String m_family; - UINT m_codePage; -private: - mutable DWORD m_codePages; -}; - -class FontFamilyChecker { -public: - FontFamilyChecker(const wchar_t* family) - : m_exists(false) - { - EnumFontFamilies(g_screenDC, family, enumFontFamProc, (LPARAM)this); - } - bool isSupported() const { return m_exists; } -private: - bool m_exists; - static int CALLBACK enumFontFamProc(const LOGFONT FAR* lpelf, const TEXTMETRIC FAR* lpntm, DWORD FontType, LPARAM lParam); -}; - -class ValidFontFamilyFinder { -public: - ValidFontFamilyFinder() - { - EnumFontFamilies(g_screenDC, 0, enumFontFamProc, (LPARAM)this); - } - const String& family() const { return m_family; } -private: - String m_family; - static int CALLBACK enumFontFamProc(const LOGFONT FAR* lpelf, const TEXTMETRIC FAR* lpntm, DWORD FontType, LPARAM lParam); -}; - -class FixedSizeFontData: public RefCounted { -public: - LOGFONT m_font; - OwnPtr m_hfont; - TEXTMETRIC m_metrics; - DWORD m_codePages; - unsigned m_weight; - bool m_italic; - - static PassRefPtr create(const AtomicString& family, unsigned weight, bool italic); -private: - FixedSizeFontData() - : m_codePages(0) - , m_weight(0) - , m_italic(false) - { - memset(&m_font, 0, sizeof(m_font)); - memset(&m_metrics, 0, sizeof(m_metrics)); - } -}; - -struct FixedSizeFontDataKey { - FixedSizeFontDataKey(const AtomicString& family = AtomicString(), unsigned weight = 0, bool italic = false) - : m_family(family) - , m_weight(weight) - , m_italic(italic) - { - } - - FixedSizeFontDataKey(WTF::HashTableDeletedValueType) : m_weight(-2) { } - bool isHashTableDeletedValue() const { return m_weight == -2; } - - bool operator==(const FixedSizeFontDataKey& other) const - { - return equalIgnoringCase(m_family, other.m_family) - && m_weight == other.m_weight - && m_italic == other.m_italic; - } - - AtomicString m_family; - unsigned m_weight; - bool m_italic; -}; - -struct FixedSizeFontDataKeyHash { - static unsigned hash(const FixedSizeFontDataKey& font) - { - unsigned hashCodes[] = { - CaseFoldingHash::hash(font.m_family), - font.m_weight, - // static_cast(font.m_italic); - }; - return StringImpl::computeHash(reinterpret_cast(hashCodes), sizeof(hashCodes) / sizeof(UChar)); - } - - static bool equal(const FixedSizeFontDataKey& a, const FixedSizeFontDataKey& b) - { - return a == b; - } - - static const bool safeToCompareToEmptyOrDeleted = true; -}; - -struct FixedSizeFontDataKeyTraits : WTF::GenericHashTraits { - static const bool emptyValueIsZero = true; - static const FixedSizeFontDataKey& emptyValue() - { - DEFINE_STATIC_LOCAL(FixedSizeFontDataKey, key, (nullAtom)); - return key; - } - static void constructDeletedValue(FixedSizeFontDataKey& slot) - { - new (&slot) FixedSizeFontDataKey(WTF::HashTableDeletedValue); - } - static bool isDeletedValue(const FixedSizeFontDataKey& value) - { - return value.isHashTableDeletedValue(); - } -}; - -int CALLBACK FontFamilyChecker::enumFontFamProc(const LOGFONT FAR* lpelf, const TEXTMETRIC FAR* lpntm, DWORD FontType, LPARAM lParam) -{ - ((FontFamilyChecker*)lParam)->m_exists = true; - return 0; -} - -int CALLBACK ValidFontFamilyFinder::enumFontFamProc(const LOGFONT FAR* lpelf, const TEXTMETRIC FAR* lpntm, DWORD FontType, LPARAM lParam) -{ - if (lpelf->lfCharSet != SYMBOL_CHARSET) { - ((ValidFontFamilyFinder*)lParam)->m_family = String(lpelf->lfFaceName); - return 0; - } - return 1; -} - -typedef Vector KnownFonts; -static KnownFonts& knownFonts() -{ - static KnownFonts fonts; - static bool firstTime = true; - if (firstTime) { - firstTime = false; - if (FontPlatformData::isSongTiSupported()) - fonts.append(FontFamilyCodePageInfo(songTiStr, 936)); - } - return fonts; -} - -static String getDefaultFontFamily() -{ - if (FontFamilyChecker(L"Tahoma").isSupported()) - return String(L"Tahoma"); - - bool good = false; - String family; - HKEY key; - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"SYSTEM\\GDI\\SysFnt", 0, 0, &key) == ERROR_SUCCESS) { - DWORD maxlen, type; - if (RegQueryValueEx(key, L"Nm", 0, &type, 0, &maxlen) == ERROR_SUCCESS && type == REG_SZ) { - ++maxlen; - if (wchar_t* buffer = new wchar_t[maxlen]) { - if (RegQueryValueEx(key, L"Nm", 0, &type, (LPBYTE)buffer, &maxlen) == ERROR_SUCCESS) { - family = String(buffer, maxlen); - good = true; - } - delete[] buffer; - } - } - RegCloseKey(key); - } - if (good) - return family; - - return ValidFontFamilyFinder().family(); -} - -typedef HashMap, FixedSizeFontDataKeyHash, FixedSizeFontDataKeyTraits> FixedSizeFontCache; -FixedSizeFontCache g_fixedSizeFontCache; - -PassRefPtr FixedSizeFontData::create(const AtomicString& family, unsigned weight, bool italic) -{ - FixedSizeFontData* fontData = new FixedSizeFontData(); - - fontData->m_weight = weight; - fontData->m_italic = italic; - - LOGFONT& winFont = fontData->m_font; - // The size here looks unusual. The negative number is intentional. - winFont.lfHeight = -72; - winFont.lfWidth = 0; - winFont.lfEscapement = 0; - winFont.lfOrientation = 0; - winFont.lfUnderline = false; - winFont.lfStrikeOut = false; - winFont.lfCharSet = DEFAULT_CHARSET; - winFont.lfOutPrecision = OUT_DEFAULT_PRECIS; - winFont.lfQuality = CLEARTYPE_QUALITY; //DEFAULT_QUALITY; - winFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; - winFont.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; - winFont.lfItalic = italic; - winFont.lfWeight = FontPlatformData::adjustedGDIFontWeight(weight, family); - - int len = std::min(family.length(), (unsigned int)LF_FACESIZE - 1); - wmemcpy(winFont.lfFaceName, family.characters(), len); - winFont.lfFaceName[len] = L'\0'; - - fontData->m_hfont.set(CreateFontIndirect(&winFont)); - - HGDIOBJ oldFont = SelectObject(g_screenDC, fontData->m_hfont.get()); - - GetTextMetrics(g_screenDC, &fontData->m_metrics); - -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) - if (IMLangFontLink2* langFontLink = fontCache()->getFontLinkInterface()) { -#else - if (IMLangFontLink* langFontLink = fontCache()->getFontLinkInterface()) { -#endif - langFontLink->GetFontCodePages(g_screenDC, fontData->m_hfont.get(), &fontData->m_codePages); - fontData->m_codePages |= FontPlatformData::getKnownFontCodePages(winFont.lfFaceName); - } - - SelectObject(g_screenDC, oldFont); - - return adoptRef(fontData); -} - -static PassRefPtr createFixedSizeFontData(const AtomicString& family, unsigned weight, bool italic) -{ - FixedSizeFontDataKey key(family, weight, italic); - pair result = g_fixedSizeFontCache.add(key, RefPtr()); - if (result.second) - result.first->second = FixedSizeFontData::create(family, weight, italic); - - return result.first->second; -} - -static LONG toGDIFontWeight(FontWeight fontWeight) -{ - static LONG gdiFontWeights[] = { - FW_THIN, // FontWeight100 - FW_EXTRALIGHT, // FontWeight200 - FW_LIGHT, // FontWeight300 - FW_NORMAL, // FontWeight400 - FW_MEDIUM, // FontWeight500 - FW_SEMIBOLD, // FontWeight600 - FW_BOLD, // FontWeight700 - FW_EXTRABOLD, // FontWeight800 - FW_HEAVY // FontWeight900 - }; - return gdiFontWeights[fontWeight]; -} - -class FontPlatformPrivateData { -public: - int m_reference; - RefPtr m_rootFontData; - AtomicString m_family; - FontDescription m_fontDescription; - OwnPtr m_hfontScaled; - int m_size; - long m_fontScaledWidth; - long m_fontScaledHeight; - bool m_disabled; - FontPlatformPrivateData(int size, unsigned weight) - : m_reference(1) - , m_family(FontPlatformData::defaultFontFamily()) - , m_size(size) - , m_fontScaledWidth(0) - , m_fontScaledHeight(0) - , m_disabled(false) - { - m_rootFontData = createFixedSizeFontData(m_family, weight, false); - } - FontPlatformPrivateData(const FontDescription& fontDescription, const AtomicString& family) - : m_reference(1) - , m_size(fontDescription.computedPixelSize()) - , m_fontDescription(fontDescription) - , m_family(family) - , m_fontScaledWidth(0) - , m_fontScaledHeight(0) - , m_disabled(!fontDescription.specifiedSize()) - { - m_rootFontData = FixedSizeFontData::create(family, toGDIFontWeight(fontDescription.weight()), fontDescription.italic()); - } -}; - -FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const AtomicString& desiredFamily, bool useDefaultFontIfNotPresent) -{ - String family(desiredFamily); - if (!equalIgnoringCase(family, defaultFontFamily()) && !FontFamilyChecker(family.charactersWithNullTermination()).isSupported()) { - if (equalIgnoringCase(family, String(heiTiStr)) && isSongTiSupported()) - family = String(songTiStr); - else if (useDefaultFontIfNotPresent) - family = defaultFontFamily(); - } - - m_private = new FontPlatformPrivateData(fontDescription, family); -} - -FontPlatformData::FontPlatformData(float size, bool bold, bool oblique) -{ - if (!size) - m_private = 0; - else - m_private = new FontPlatformPrivateData((int)(size + 0.5), bold ? FW_BOLD : FW_NORMAL); -} - -FontPlatformData::~FontPlatformData() -{ - if (isValid() && !--m_private->m_reference) { - if (m_private->m_rootFontData->refCount() == 2) { - FixedSizeFontDataKey key(m_private->m_family, m_private->m_rootFontData->m_weight, m_private->m_rootFontData->m_italic); - g_fixedSizeFontCache.remove(key); - } - delete m_private; - } -} - -FontPlatformData& FontPlatformData::operator=(const FontPlatformData& o) -{ - if (isValid() && !--m_private->m_reference) - delete m_private; - - if (m_private = o.m_private) - ++m_private->m_reference; - - return *this; -} - -HFONT FontPlatformData::hfont() const -{ - if (!isValid()) - return 0; - - if (m_private->m_disabled) - return 0; - - if (!m_private->m_rootFontData->m_hfont) - m_private->m_rootFontData->m_hfont.set(CreateFontIndirect(&m_private->m_rootFontData->m_font)); - - return m_private->m_rootFontData->m_hfont.get(); -} - -HFONT FontPlatformData::getScaledFontHandle(int height, int width) const -{ - if (!isValid() || m_private->m_disabled) - return 0; - - if (!m_private->m_hfontScaled || m_private->m_fontScaledHeight != height || m_private->m_fontScaledWidth != width) { - m_private->m_fontScaledHeight = height; - m_private->m_fontScaledWidth = width; - LOGFONT font = m_private->m_rootFontData->m_font; - font.lfHeight = -height; - font.lfWidth = width; - m_private->m_hfontScaled.set(CreateFontIndirect(&font)); - } - - return m_private->m_hfontScaled.get(); -} - -bool FontPlatformData::discardFontHandle() -{ - if (!isValid()) - return false; - - if (m_private->m_rootFontData->m_hfont) { - m_private->m_rootFontData->m_hfont.set(0); - return true; - } - - if (m_private->m_hfontScaled) { - m_private->m_hfontScaled.set(0); - return true; - } - return false; -} - -const TEXTMETRIC& FontPlatformData::metrics() const -{ - return m_private->m_rootFontData->m_metrics; -} - -bool FontPlatformData::isSystemFont() const -{ - return false; -} - -int FontPlatformData::size() const -{ - return m_private->m_size; -} - -const FontDescription& FontPlatformData::fontDescription() const -{ - return m_private->m_fontDescription; -} - -const AtomicString& FontPlatformData::family() const -{ - return m_private->m_family; -} - -const LOGFONT& FontPlatformData::logFont() const -{ - return m_private->m_rootFontData->m_font; -} - -int FontPlatformData::averageCharWidth() const -{ - return (m_private->m_rootFontData->m_metrics.tmAveCharWidth * size() + 36) / 72; -} - -bool FontPlatformData::isDisabled() const -{ - return !isValid() || m_private->m_disabled; -} - -DWORD FontPlatformData::codePages() const -{ - return m_private->m_rootFontData->m_codePages; -} - -bool FontPlatformData::isSongTiSupported() -{ - static bool exists = FontFamilyChecker(songTiStr).isSupported(); - return exists; -} - -bool FontPlatformData::mapKnownFont(DWORD codePages, String& family) -{ - KnownFonts& fonts = knownFonts(); - for (KnownFonts::iterator i = fonts.begin(); i != fonts.end(); ++i) { - if (i->codePages() & codePages) { - family = i->m_family; - return true; - } - } - return false; -} - -DWORD FontPlatformData::getKnownFontCodePages(const wchar_t* family) -{ - KnownFonts& fonts = knownFonts(); - for (KnownFonts::iterator i = fonts.begin(); i != fonts.end(); ++i) { - if (equalIgnoringCase(i->m_family, String(family))) - return i->codePages(); - } - return 0; -} - -const String& FontPlatformData::defaultFontFamily() -{ - static String family(getDefaultFontFamily()); - return family; -} - -LONG FontPlatformData::adjustedGDIFontWeight(LONG gdiFontWeight, const String& family) -{ - static AtomicString lucidaStr("Lucida Grande"); - if (equalIgnoringCase(family, lucidaStr)) { - if (gdiFontWeight == FW_NORMAL) - return FW_MEDIUM; - if (gdiFontWeight == FW_BOLD) - return FW_SEMIBOLD; - } - return gdiFontWeight; -} - -#ifndef NDEBUG -String FontPlatformData::description() const -{ - return String(); -} -#endif - -} diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontPlatformData.h b/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontPlatformData.h deleted file mode 100644 index 77803d3..0000000 --- a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontPlatformData.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * This file is part of the internal font implementation. It should not be included by anyone other than - * FontMac.cpp, FontWin.cpp and Font.cpp. - * - * Copyright (C) 2006, 2007 Apple Inc. - * Copyright (C) 2007-2008 Torch Mobile, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#ifndef FontPlatformDataWince_H -#define FontPlatformDataWince_H - -#include "FontDescription.h" -#include "StringImpl.h" -#include - -typedef struct tagTEXTMETRICW TEXTMETRIC; -typedef struct tagLOGFONTW LOGFONT; - -namespace WebCore { - - class FontPlatformPrivateData; - class String; - - class FontPlatformData { - - public: - - FontPlatformData(): m_private(0) {} - FontPlatformData(float size, bool bold, bool oblique); - - // Used for deleted values in the font cache's hash tables. - FontPlatformData(WTF::HashTableDeletedValueType) : m_private((FontPlatformPrivateData*)1) {} - bool isHashTableDeletedValue() const { return (unsigned)m_private == 1; } - - FontPlatformData(const FontDescription& fontDescription, const AtomicString& family, bool useDefaultFontIfNotPresent = true); - - ~FontPlatformData(); - - FontPlatformData(const FontPlatformData& o) : m_private(0) { operator=(o); } - FontPlatformData& operator=(const FontPlatformData& o); - - int isValid() const { return reinterpret_cast(m_private) & ~1; } - HFONT hfont() const; - const TEXTMETRIC& metrics() const; - bool isSystemFont() const; - int size() const; - unsigned hash() const { return (unsigned)m_private; } - const FontDescription& fontDescription() const; - const AtomicString& family() const; - bool operator==(const FontPlatformData& other) const { return m_private == other.m_private; } - HFONT getScaledFontHandle(int height, int width) const; - const LOGFONT& logFont() const; - int averageCharWidth() const; - bool isDisabled() const; - bool discardFontHandle(); - DWORD codePages() const; - - static bool isSongTiSupported(); - static bool mapKnownFont(DWORD codePages, String& family); - static DWORD getKnownFontCodePages(const wchar_t* family); - static const String& defaultFontFamily(); - static LONG adjustedGDIFontWeight(LONG gdiFontWeight, const String& family); - -#ifndef NDEBUG - String description() const; -#endif - - private: - FontPlatformPrivateData* m_private; - }; - -} - -#endif diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontWince.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontWince.cpp deleted file mode 100644 index d00336b..0000000 --- a/src/3rdparty/webkit/WebCore/platform/graphics/wince/FontWince.cpp +++ /dev/null @@ -1,333 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007-2009 Torch Mobile, Inc. - * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) - * Copyright (C) 2008 Holger Hans Peter Freyther - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "Font.h" - -#include "FloatRect.h" -#include "FontCache.h" -#include "FontData.h" -#include "FontFallbackList.h" -#include "GlyphBuffer.h" -#include "GraphicsContext.h" -#include "IntRect.h" -#include "NotImplemented.h" -#include "TransformationMatrix.h" -#include "WidthIterator.h" -#include -#include -#include - -#include - -using namespace WTF::Unicode; - -namespace WebCore { - -HDC g_screenDC = GetDC(0); - -class ScreenDcReleaser { -public: - ~ScreenDcReleaser() - { - ReleaseDC(0, g_screenDC); - } -}; - -ScreenDcReleaser releaseScreenDc; - -void Font::drawGlyphs(GraphicsContext* graphicsContext, const SimpleFontData* fontData, const GlyphBuffer& glyphBuffer, - int from, int numGlyphs, const FloatPoint& point) const -{ - graphicsContext->drawText(fontData, glyphBuffer, from, numGlyphs, point); -} - -class TextRunComponent { -public: - TextRunComponent() : m_textRun(0, 0) {} - TextRunComponent(const UChar *start, int length, const TextRun& parentTextRun, const Font &font, int offset); - TextRunComponent(int spaces, const Font &font, int offset); - ~TextRunComponent() { m_textRun; } - - bool isSpace() const { return m_spaces; } - int textLength() const { return m_spaces ? m_spaces : m_textRun.length(); } - - TextRun m_textRun; - float m_width; - int m_offset; - int m_spaces; -}; - -TextRunComponent::TextRunComponent(const UChar *start, int length, const TextRun& parentTextRun, const Font &font, int o) - : m_textRun(start, length, parentTextRun.allowTabs(), 0, 0 - , parentTextRun.rtl() - , parentTextRun.directionalOverride() - , parentTextRun.applyRunRounding() - , parentTextRun.applyWordRounding()) - , m_offset(o) - , m_spaces(0) -{ - WidthIterator it(&font, m_textRun); - it.advance(m_textRun.length(), 0); - m_width = it.m_runWidthSoFar; -} - -TextRunComponent::TextRunComponent(int s, const Font &font, int o) - : m_textRun(0, 0) - , m_offset(o) - , m_spaces(s) -{ - m_width = s * font.primaryFont()->widthForGlyph(' '); -} - -typedef Vector TextRunComponents; - -static int generateComponents(TextRunComponents* components, const Font &font, const TextRun &run) -{ - int letterSpacing = font.letterSpacing(); - int wordSpacing = font.wordSpacing(); - int padding = run.padding(); - int numSpaces = 0; - if (padding) { - for (int i = 0; i < run.length(); i++) - if (Font::treatAsSpace(run[i])) - ++numSpaces; - } - - int offset = 0; - if (letterSpacing) { - // need to draw every letter on it's own - int start = 0; - if (Font::treatAsSpace(run[0])) { - int add = 0; - if (numSpaces) { - add = padding/numSpaces; - padding -= add; - --numSpaces; - } - components->append(TextRunComponent(1, font, offset)); - offset += add + letterSpacing + components->last().m_width; - start = 1; - } - for (int i = 1; i < run.length(); ++i) { - uint ch = run[i]; - if (isHighSurrogate(ch) && isLowSurrogate(run[i-1])) - ch = surrogateToUcs4(ch, run[i-1]); - if (isLowSurrogate(ch) || category(ch) == Mark_NonSpacing) - continue; - if (Font::treatAsSpace(run[i])) { - int add = 0; - if (i - start > 0) { - components->append(TextRunComponent(run.characters() + start, i - start, - run, font, offset)); - offset += components->last().m_width + letterSpacing; - } - if (numSpaces) { - add = padding/numSpaces; - padding -= add; - --numSpaces; - } - components->append(TextRunComponent(1, font, offset)); - offset += wordSpacing + add + components->last().m_width + letterSpacing; - start = i + 1; - continue; - } - if (i - start > 0) { - components->append(TextRunComponent(run.characters() + start, i - start, - run, - font, offset)); - offset += components->last().m_width + letterSpacing; - } - start = i; - } - if (run.length() - start > 0) { - components->append(TextRunComponent(run.characters() + start, run.length() - start, - run, - font, offset)); - offset += components->last().m_width; - } - offset += letterSpacing; - } else { - int start = 0; - for (int i = 0; i < run.length(); ++i) { - if (Font::treatAsSpace(run[i])) { - if (i - start > 0) { - components->append(TextRunComponent(run.characters() + start, i - start, - run, - font, offset)); - offset += components->last().m_width; - } - int add = 0; - if (numSpaces) { - add = padding/numSpaces; - padding -= add; - --numSpaces; - } - components->append(TextRunComponent(1, font, offset)); - offset += add + components->last().m_width; - if (i) - offset += wordSpacing; - start = i + 1; - } - } - if (run.length() - start > 0) { - components->append(TextRunComponent(run.characters() + start, run.length() - start, - run, - font, offset)); - offset += components->last().m_width; - } - } - return offset; -} - -void Font::drawComplexText(GraphicsContext* context, const TextRun& run, const FloatPoint& point, - int from, int to) const -{ - if (to < 0) - to = run.length(); - if (from < 0) - from = 0; - - TextRunComponents components; - int w = generateComponents(&components, *this, run); - - int curPos = 0; - for (int i = 0; i < (int)components.size(); ++i) { - const TextRunComponent& comp = components.at(i); - int len = comp.textLength(); - int curEnd = curPos + len; - if (curPos < to && from < curEnd && !comp.isSpace()) { - FloatPoint pt = point; - if (run.rtl()) - pt.setX(point.x() + w - comp.m_offset - comp.m_width); - else - pt.setX(point.x() + comp.m_offset); - drawSimpleText(context, comp.m_textRun, pt, from - curPos, std::min(to, curEnd) - curPos); - } - curPos += len; - if (from < curPos) - from = curPos; - } -} - -float Font::floatWidthForComplexText(const TextRun& run, HashSet* fallbackFonts) const -{ - TextRunComponents components; - int w = generateComponents(&components, *this, run); - return w; -} - -int Font::offsetForPositionForComplexText(const TextRun& run, int position, bool includePartialGlyphs) const -{ - TextRunComponents components; - int w = generateComponents(&components, *this, run); - - if (position >= w) - return run.length(); - - int offset = 0; - if (run.rtl()) { - for (size_t i = 0; i < components.size(); ++i) { - const TextRunComponent& comp = components.at(i); - int xe = w - comp.m_offset; - int xs = xe - comp.m_width; - if (position >= xs) - return offset + (comp.isSpace() - ? static_cast((position - xe) * comp.m_spaces / std::max(1.f, comp.m_width) + 0.5) - : offsetForPositionForSimpleText(comp.m_textRun, position - xs, includePartialGlyphs)); - - offset += comp.textLength(); - } - } else { - for (size_t i = 0; i < components.size(); ++i) { - const TextRunComponent& comp = components.at(i); - int xs = comp.m_offset; - int xe = xs + comp.m_width; - if (position <= xe) { - if (position - xs >= xe) - return offset + comp.textLength(); - return offset + (comp.isSpace() - ? static_cast((position - xs) * comp.m_spaces / std::max(1.f, comp.m_width) + 0.5) - : offsetForPositionForSimpleText(comp.m_textRun, position - xs, includePartialGlyphs)); - } - offset += comp.textLength(); - } - } - return run.length(); -} - - -static float cursorToX(const Font* font, const TextRunComponents& components, int width, bool rtl, int cursor) -{ - int start = 0; - for (size_t i = 0; i < components.size(); ++i) { - const TextRunComponent& comp = components.at(i); - if (start + comp.textLength() <= cursor) { - start += comp.textLength(); - continue; - } - int xs = comp.m_offset; - if (rtl) - xs = width - xs - comp.m_width; - - int pos = cursor - start; - if (comp.isSpace()) { - if (rtl) - pos = comp.textLength() - pos; - return xs + pos * comp.m_width / comp.m_spaces; - } - WidthIterator it(font, comp.m_textRun); - it.advance(pos); - return xs + it.m_runWidthSoFar; - } - return width; -} - -FloatRect Font::selectionRectForComplexText(const TextRun& run, const IntPoint& pt, - int h, int from, int to) const -{ - TextRunComponents components; - int w = generateComponents(&components, *this, run); - - if (!from && to == run.length()) - return FloatRect(pt.x(), pt.y(), w, h); - - float x1 = cursorToX(this, components, w, run.rtl(), from); - float x2 = cursorToX(this, components, w, run.rtl(), to); - if (x2 < x1) - std::swap(x1, x2); - - return FloatRect(pt.x() + x1, pt.y(), x2 - x1, h); -} - -bool Font::canReturnFallbackFontsForComplexText() -{ - return false; -} - -} diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/wince/GlyphPageTreeNodeWince.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/wince/GlyphPageTreeNodeWince.cpp deleted file mode 100644 index 27c4e15..0000000 --- a/src/3rdparty/webkit/WebCore/platform/graphics/wince/GlyphPageTreeNodeWince.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2007-2009 Torch Mobile Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "GlyphPageTreeNode.h" - -#include "Font.h" -#include "FontCache.h" -#include "FontData.h" -#include "SimpleFontData.h" - -namespace WebCore { - -DWORD getKnownFontCodePages(const wchar_t* family); - -typedef unsigned (*funcGetCharCodePages)(unsigned short c, unsigned& lastPos); -funcGetCharCodePages getCharCodePages = 0; - -bool GlyphPage::fill(unsigned offset, unsigned length, UChar* buffer, unsigned bufferLength, const SimpleFontData* fontData) -{ - if (length != bufferLength) - return false; - - if (fontData->platformData().hfont()) { - DWORD fontCodePages = fontData->platformData().codePages(); - if (fontCodePages) { - if (getCharCodePages) { - unsigned lastPos = 0; - for (unsigned i = 0; i < bufferLength; ++i) { - DWORD actualCodePages = getCharCodePages(buffer[i], lastPos); - if (!actualCodePages || (actualCodePages & fontCodePages)) - setGlyphDataForIndex(offset + i, buffer[i], fontData); - else - setGlyphDataForIndex(offset + i, buffer[i], 0); - } - return true; -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) - } else if (IMLangFontLink2* langFontLink = fontCache()->getFontLinkInterface()) { -#else - } else if (IMLangFontLink* langFontLink = fontCache()->getFontLinkInterface()) { -#endif - for (unsigned i = 0; i < bufferLength; ++i) { - DWORD actualCodePages; - langFontLink->GetCharCodePages(buffer[i], &actualCodePages); - if (!actualCodePages || (actualCodePages & fontCodePages)) - setGlyphDataForIndex(offset + i, buffer[i], fontData); - else - setGlyphDataForIndex(offset + i, buffer[i], 0); - } - return true; - } - } - } - - for (unsigned i = 0; i < length; ++i) - setGlyphDataForIndex(offset + i, buffer[i], fontData); - - return true; -} - -} - diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/wince/GraphicsContextWince.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/wince/GraphicsContextWince.cpp deleted file mode 100644 index 6a9cbca..0000000 --- a/src/3rdparty/webkit/WebCore/platform/graphics/wince/GraphicsContextWince.cpp +++ /dev/null @@ -1,1839 +0,0 @@ -/* - * Copyright (C) 2007-2009 Torch Mobile Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - * - */ - -#include "config.h" -#include "GraphicsContext.h" - -#include "CharacterNames.h" -#include "GlyphBuffer.h" -#include "Gradient.h" -#include "GraphicsContextPrivate.h" -#include "NotImplemented.h" -#include "Path.h" -#include "PlatformPathWince.h" -#include "SharedBitmap.h" -#include "SimpleFontData.h" -#include "TransformationMatrix.h" -#include - -#include - -namespace WebCore { - -typedef void (*FuncGradientFillRectLinear)(HDC hdc, const IntRect& r, const IntPoint& p0, const IntPoint& p1, const Vector& stops); -typedef void (*FuncGradientFillRectRadial)(HDC hdc, const IntRect& r, const IntPoint& p0, const IntPoint& p1, float r0, float r1, const Vector& stops); -FuncGradientFillRectLinear g_linearGradientFiller = 0; -FuncGradientFillRectRadial g_radialGradientFiller = 0; - -static inline bool isZero(double d) -{ - return d > 0 ? d <= 1.E-10 : d >= -1.E-10; -} - -// stableRound rounds -0.5 to 0, where lround rounds -0.5 to -1. -static inline int stableRound(double d) -{ - if (d > 0) - return static_cast(d + 0.5); - - int i = static_cast(d); - return i - d > 0.5 ? i - 1 : i; -} - -// Unlike enclosingIntRect(), this function does strict rounding. -static inline IntRect roundRect(const FloatRect& r) -{ - return IntRect(stableRound(r.x()), stableRound(r.y()), stableRound(r.right()) - stableRound(r.x()), stableRound(r.bottom()) - stableRound(r.y())); -} - -// Rotation transformation -class RotationTransform { -public: - RotationTransform() - : m_cosA(1.) - , m_sinA(0.) - , m_preShiftX(0) - , m_preShiftY(0) - , m_postShiftX(0) - , m_postShiftY(0) - { - } - RotationTransform operator-() const - { - RotationTransform rtn; - rtn.m_cosA = m_cosA; - rtn.m_sinA = -m_sinA; - rtn.m_preShiftX = m_postShiftX; - rtn.m_preShiftY = m_postShiftY; - rtn.m_postShiftX = m_preShiftX; - rtn.m_postShiftY = m_preShiftY; - return rtn; - } - void map(double x1, double y1, double* x2, double* y2) const - { - x1 += m_preShiftX; - y1 += m_preShiftY; - *x2 = x1 * m_cosA + y1 * m_sinA + m_postShiftX; - *y2 = y1 * m_cosA - x1 * m_sinA + m_postShiftY; - } - void map(int x1, int y1, int* x2, int* y2) const - { - x1 += m_preShiftX; - y1 += m_preShiftY; - *x2 = stableRound(x1 * m_cosA + y1 * m_sinA) + m_postShiftX; - *y2 = stableRound(y1 * m_cosA - x1 * m_sinA) + m_postShiftY; - } - - double m_cosA; - double m_sinA; - int m_preShiftX; - int m_preShiftY; - int m_postShiftX; - int m_postShiftY; -}; - -template static inline IntPoint mapPoint(const IntPoint& p, const T& t) -{ - int x, y; - t.map(p.x(), p.y(), &x, &y); - return IntPoint(x, y); -} - -template static inline FloatPoint mapPoint(const FloatPoint& p, const T& t) -{ - double x, y; - t.map(p.x(), p.y(), &x, &y); - return FloatPoint(static_cast(x), static_cast(y)); -} - -template static inline Rect mapRect(const Rect& rect, const Transform& transform) -{ - Value x[4], y[4]; - Value l, t, r, b; - r = rect.right() - 1; - b = rect.bottom() - 1; - transform.map(rect.x(), rect.y(), x, y); - transform.map(rect.x(), b, x + 1, y + 1); - transform.map(r, b, x + 2, y + 2); - transform.map(r, rect.y(), x + 3, y + 3); - l = r = x[3]; - t = b = y[3]; - for (int i = 0; i < 3; ++i) { - if (x[i] < l) - l = x[i]; - else if (x[i] > r) - r = x[i]; - - if (y[i] < t) - t = y[i]; - else if (y[i] > b) - b = y[i]; - } - - return IntRect(l, t, r - l + 1, b - t + 1); -} - -template static inline IntRect mapRect(const IntRect& rect, const T& transform) -{ - return mapRect(rect, transform); -} - -template static inline FloatRect mapRect(const FloatRect& rect, const T& transform) -{ - return mapRect(rect, transform); -} - -class GraphicsContextPlatformPrivateData { -public: - GraphicsContextPlatformPrivateData() - : m_transform() - , m_opacity(1.0) - { - } - - TransformationMatrix m_transform; - float m_opacity; - Vector m_paths; -}; - -enum AlphaPaintType { - AlphaPaintNone, - AlphaPaintImage, - AlphaPaintOther, -}; - -class GraphicsContextPlatformPrivate : public GraphicsContextPlatformPrivateData { -public: - GraphicsContextPlatformPrivate(HDC dc) - : m_dc(dc) - { - } - ~GraphicsContextPlatformPrivate() - { - while (!m_backupData.isEmpty()) - restore(); - } - - IntPoint origin() const - { - return IntPoint(stableRound(-m_transform.e()), stableRound(-m_transform.f())); - } - - void translate(float x, float y) - { - m_transform.translate(x, y); - } - - void scale(const FloatSize& size) - { - m_transform.scaleNonUniform(size.width(), size.height()); - } - - void rotate(float radians) - { - m_transform.rotate(rad2deg(radians)); - } - - void concatCTM(const TransformationMatrix& transform) - { - m_transform = transform * m_transform; - } - - IntRect mapRect(const IntRect& rect) const - { - return m_transform.mapRect(rect); - } - - FloatRect mapRect(const FloatRect& rect) const - { - return m_transform.mapRect(rect); - } - - IntPoint mapPoint(const IntPoint& point) const - { - return m_transform.mapPoint(point); - } - - FloatPoint mapPoint(const FloatPoint& point) const - { - return m_transform.mapPoint(point); - } - - FloatSize mapSize(const FloatSize& size) const - { - double w, h; - m_transform.map(size.width(), size.height(), w, h); - return FloatSize(static_cast(w), static_cast(h)); - } - - void save() - { - if (m_dc) - SaveDC(m_dc); - - m_backupData.append(*static_cast(this)); - } - - void restore() - { - if (m_backupData.isEmpty()) - return; - - if (m_dc) - RestoreDC(m_dc, -1); - - GraphicsContextPlatformPrivateData::operator=(m_backupData.last()); - m_backupData.removeLast(); - } - - bool hasAlpha() const { return m_bitmap && m_bitmap->hasAlpha(); } - - PassRefPtr getTransparentLayerBitmap(IntRect& origRect, AlphaPaintType alphaPaint, RECT& bmpRect, bool checkClipBox, bool force) const - { - if (m_opacity <= 0) - return 0; - - if (force || m_opacity < 1.) { - if (checkClipBox) { - RECT clipBox; - int clipType = GetClipBox(m_dc, &clipBox); - if (clipType == SIMPLEREGION || clipType == COMPLEXREGION) - origRect.intersect(clipBox); - if (origRect.isEmpty()) - return 0; - } - - RefPtr bmp = SharedBitmap::createInstance(alphaPaint == AlphaPaintNone, origRect.width(), origRect.height(), false); - SetRect(&bmpRect, 0, 0, origRect.width(), origRect.height()); - if (bmp) { - switch (alphaPaint) { - case AlphaPaintNone: - case AlphaPaintImage: - { - SharedBitmap::DCHolder dc(bmp.get()); - if (dc.get()) { - BitBlt(dc.get(), 0, 0, origRect.width(), origRect.height(), m_dc, origRect.x(), origRect.y(), SRCCOPY); - if (bmp->is32bit() && (!m_bitmap || m_bitmap->is16bit())) { - // Set alpha channel - unsigned* pixels = (unsigned*)bmp->bytes(); - const unsigned* const pixelsEnd = pixels + bmp->bitmapInfo().numPixels(); - while (pixels < pixelsEnd) { - *pixels |= 0xFF000000; - ++pixels; - } - } - return bmp; - } - } - break; - //case AlphaPaintOther: - default: - memset(bmp->bytes(), 0xFF, bmp->bitmapInfo().numPixels() * 4); - return bmp; - break; - } - } - } - - bmpRect = origRect; - return 0; - } - - void paintBackTransparentLayerBitmap(HDC hdc, SharedBitmap* bmp, const IntRect& origRect, AlphaPaintType alphaPaint, const RECT& bmpRect) - { - if (hdc == m_dc) - return; - -#if !defined(NO_ALPHABLEND) - if (alphaPaint == AlphaPaintOther) { - ASSERT(bmp && bmp->bytes() && bmp->is32bit()); - unsigned* pixels = (unsigned*)bmp->bytes(); - const unsigned* const pixelsEnd = pixels + bmp->bitmapInfo().numPixels(); - while (pixels < pixelsEnd) { - *pixels ^= 0xFF000000; - ++pixels; - } - } - if (m_opacity < 1. || alphaPaint == AlphaPaintOther) { - const BLENDFUNCTION blend = { AC_SRC_OVER, 0 - , m_opacity >= 1. ? 255 : (BYTE)(m_opacity * 255) - , alphaPaint == AlphaPaintNone ? 0 : AC_SRC_ALPHA }; - AlphaBlend(m_dc, origRect.x(), origRect.y(), origRect.width(), origRect.height(), hdc, 0, 0, bmpRect.right, bmpRect.bottom, blend); - } else -#endif - StretchBlt(m_dc, origRect.x(), origRect.y(), origRect.width(), origRect.height(), hdc, 0, 0, bmpRect.right, bmpRect.bottom, SRCCOPY); - } - - HDC m_dc; - RefPtr m_bitmap; - Vector m_backupData; -}; - -static HPEN createPen(const Color& col, double fWidth, StrokeStyle style) -{ - int width = stableRound(fWidth); - if (width < 1) - width = 1; - - int penStyle = PS_NULL; - switch (style) { - case SolidStroke: - penStyle = PS_SOLID; - break; - case DottedStroke: // not supported on Windows CE - case DashedStroke: - penStyle = PS_DASH; - width = 1; - break; - default: - break; - } - - return CreatePen(penStyle, width, RGB(col.red(), col.green(), col.blue())); -} - -static inline HGDIOBJ createBrush(const Color& col) -{ - return CreateSolidBrush(RGB(col.red(), col.green(), col.blue())); -} - -template static void _rotateBitmap(SharedBitmap* destBmp, const SharedBitmap* sourceBmp, const RotationTransform& transform) -{ - int destW = destBmp->width(); - int destH = destBmp->height(); - int sourceW = sourceBmp->width(); - int sourceH = sourceBmp->height(); - PixelType* dest = (PixelType*)destBmp->bytes(); - const PixelType* source = (const PixelType*)sourceBmp->bytes(); - int padding; - int paddedSourceW; - if (Is16bit) { - padding = destW & 1; - paddedSourceW = sourceW + (sourceW & 1); - } else { - padding = 0; - paddedSourceW = sourceW; - } - if (isZero(transform.m_sinA)) { - int cosA = transform.m_cosA > 0 ? 1 : -1; - for (int y = 0; y < destH; ++y) { - for (int x = 0; x < destW; ++x) { - int x1 = x + transform.m_preShiftX; - int y1 = y + transform.m_preShiftY; - int srcX = x1 * cosA + transform.m_postShiftX; - int srcY = y1 * cosA - transform.m_postShiftY; - if (srcX >= 0 && srcX <= sourceW && srcY >= 0 && srcY <= sourceH) - *dest++ = source[srcY * paddedSourceW + srcX] | 0xFF000000; - else - *dest++ |= 0xFF; - } - dest += padding; - } - } else if (isZero(transform.m_cosA)) { - int sinA = transform.m_sinA > 0 ? 1 : -1; - for (int y = 0; y < destH; ++y) { - for (int x = 0; x < destW; ++x) { - int x1 = x + transform.m_preShiftX; - int y1 = y + transform.m_preShiftY; - int srcX = y1 * sinA + transform.m_postShiftX; - int srcY = -x1 * sinA + transform.m_postShiftY; - if (srcX >= 0 && srcX <= sourceW && srcY >= 0 && srcY <= sourceH) - *dest++ = source[srcY * paddedSourceW + srcX]; - } - dest += padding; - } - } else { - for (int y = 0; y < destH; ++y) { - for (int x = 0; x < destW; ++x) { - // FIXME: for best quality, we should get weighted sum of four neighbours, - // but that will be too expensive - int srcX, srcY; - transform.map(x, y, &srcX, &srcY); - if (srcX >= 0 && srcX <= sourceW && srcY >= 0 && srcY <= sourceH) - *dest++ = source[srcY * paddedSourceW + srcX]; - } - dest += padding; - } - } -} - -static void rotateBitmap(SharedBitmap* destBmp, const SharedBitmap* sourceBmp, const RotationTransform& transform) -{ - ASSERT(destBmp->is16bit() == sourceBmp->is16bit()); - if (destBmp->is16bit()) - _rotateBitmap(destBmp, sourceBmp, transform); - else - _rotateBitmap(destBmp, sourceBmp, transform); -} - -class TransparentLayerDC : Noncopyable { -public: - TransparentLayerDC(GraphicsContextPlatformPrivate* data, IntRect& origRect, const IntRect* rectBeforeTransform = 0, int alpha = 255, bool paintImage = false); - ~TransparentLayerDC(); - - HDC hdc() const { return m_memDc; } - const RECT& rect() const { return m_bmpRect; } - IntSize toShift() const { return IntSize(m_bmpRect.left - m_origRect.x(), m_bmpRect.top - m_origRect.y()); } - void fillAlphaChannel(); - -private: - GraphicsContextPlatformPrivate* m_data; - IntRect m_origRect; - IntRect m_rotatedOrigRect; - HDC m_memDc; - RefPtr m_bitmap; - RefPtr m_rotatedBitmap; - RECT m_bmpRect; - unsigned m_key1; - unsigned m_key2; - RotationTransform m_rotation; - float m_oldOpacity; - AlphaPaintType m_alphaPaintType; -}; - -TransparentLayerDC::TransparentLayerDC(GraphicsContextPlatformPrivate* data, IntRect& origRect, const IntRect* rectBeforeTransform, int alpha, bool paintImage) -: m_data(data) -, m_origRect(origRect) -, m_oldOpacity(data->m_opacity) -// m_key1 and m_key2 are not initalized here. They are used only in the case that -// SharedBitmap::getDC() is called, I.E., when m_bitmap is not null. -{ - m_data->m_opacity *= alpha / 255.; - bool mustCreateLayer; - if (!m_data->hasAlpha()) { - mustCreateLayer = false; - m_alphaPaintType = AlphaPaintNone; - } else { - mustCreateLayer = true; - m_alphaPaintType = paintImage ? AlphaPaintImage : AlphaPaintOther; - } - if (rectBeforeTransform && !isZero(m_data->m_transform.b())) { - m_rotatedOrigRect = origRect; - m_rotatedBitmap = m_data->getTransparentLayerBitmap(m_rotatedOrigRect, m_alphaPaintType, m_bmpRect, false, true); - if (m_rotatedBitmap) { - double a = m_data->m_transform.a(); - double b = m_data->m_transform.b(); - double c = _hypot(a, b); - m_rotation.m_cosA = a / c; - m_rotation.m_sinA = b / c; - - int centerX = origRect.x() + origRect.width() / 2; - int centerY = origRect.y() + origRect.height() / 2; - m_rotation.m_preShiftX = -centerX; - m_rotation.m_preShiftY = -centerY; - m_rotation.m_postShiftX = centerX; - m_rotation.m_postShiftY = centerY; - - m_origRect = mapRect(m_rotatedOrigRect, m_rotation); - - m_rotation.m_preShiftX += m_rotatedOrigRect.x(); - m_rotation.m_preShiftY += m_rotatedOrigRect.y(); - m_rotation.m_postShiftX -= m_origRect.x(); - m_rotation.m_postShiftY -= m_origRect.y(); - - FloatPoint topLeft = m_data->m_transform.mapPoint(FloatPoint(rectBeforeTransform->topLeft())); - FloatPoint topRight(rectBeforeTransform->right() - 1, rectBeforeTransform->y()); - topRight = m_data->m_transform.mapPoint(topRight); - FloatPoint bottomLeft(rectBeforeTransform->x(), rectBeforeTransform->bottom() - 1); - bottomLeft = m_data->m_transform.mapPoint(bottomLeft); - FloatSize sideTop = topRight - topLeft; - FloatSize sideLeft = bottomLeft - topLeft; - float width = _hypot(sideTop.width() + 1, sideTop.height() + 1); - float height = _hypot(sideLeft.width() + 1, sideLeft.height() + 1); - - origRect.inflateX(stableRound((width - origRect.width()) * 0.5)); - origRect.inflateY(stableRound((height - origRect.height()) * 0.5)); - - m_bitmap = SharedBitmap::createInstance(m_rotatedBitmap->is16bit(), m_origRect.width(), m_origRect.height(), true); - if (m_bitmap) - rotateBitmap(m_bitmap.get(), m_rotatedBitmap.get(), -m_rotation); - else - m_rotatedBitmap = 0; - } - } else - m_bitmap = m_data->getTransparentLayerBitmap(m_origRect, m_alphaPaintType, m_bmpRect, true, mustCreateLayer); - if (m_bitmap) - m_memDc = m_bitmap->getDC(&m_key1, &m_key2); - else - m_memDc = m_data->m_dc; -} - -TransparentLayerDC::~TransparentLayerDC() -{ - if (m_rotatedBitmap) { - m_bitmap->releaseDC(m_memDc, m_key1, m_key2); - m_key1 = m_key2 = 0; - rotateBitmap(m_rotatedBitmap.get(), m_bitmap.get(), m_rotation); - m_memDc = m_rotatedBitmap->getDC(&m_key1, &m_key2); - m_data->paintBackTransparentLayerBitmap(m_memDc, m_rotatedBitmap.get(), m_rotatedOrigRect, m_alphaPaintType, m_bmpRect); - m_rotatedBitmap->releaseDC(m_memDc, m_key1, m_key2); - } else if (m_bitmap) { - m_data->paintBackTransparentLayerBitmap(m_memDc, m_bitmap.get(), m_origRect, m_alphaPaintType, m_bmpRect); - m_bitmap->releaseDC(m_memDc, m_key1, m_key2); - } - m_data->m_opacity = m_oldOpacity; -} - -void TransparentLayerDC::fillAlphaChannel() -{ - if (!m_bitmap || !m_bitmap->is32bit()) - return; - - unsigned* pixels = (unsigned*)m_bitmap->bytes(); - const unsigned* const pixelsEnd = pixels + m_bitmap->bitmapInfo().numPixels(); - while (pixels < pixelsEnd) { - *pixels |= 0xFF000000; - ++pixels; - } -} - -class ScopeDCProvider : Noncopyable { -public: - explicit ScopeDCProvider(GraphicsContextPlatformPrivate* data) - : m_data(data) - { - if (m_data->m_bitmap) - m_data->m_dc = m_data->m_bitmap->getDC(&m_key1, &m_key2); - } - ~ScopeDCProvider() - { - if (m_data->m_bitmap) { - m_data->m_bitmap->releaseDC(m_data->m_dc, m_key1, m_key2); - m_data->m_dc = 0; - } - } -private: - GraphicsContextPlatformPrivate* m_data; - unsigned m_key1; - unsigned m_key2; -}; - - -GraphicsContext::GraphicsContext(PlatformGraphicsContext* dc) -: m_common(createGraphicsContextPrivate()) -, m_data(new GraphicsContextPlatformPrivate(dc)) -{ -} - -GraphicsContext::~GraphicsContext() -{ - destroyGraphicsContextPrivate(m_common); - delete m_data; -} - -void GraphicsContext::setBitmap(PassRefPtr bmp) -{ - ASSERT(!m_data->m_dc); - m_data->m_bitmap = bmp; -} - -HDC GraphicsContext::getWindowsContext(const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap) -{ - notImplemented(); - ASSERT_NOT_REACHED(); - return 0; -} - -void GraphicsContext::releaseWindowsContext(HDC hdc, const IntRect& dstRect, bool supportAlphaBlend, bool mayCreateBitmap) -{ - notImplemented(); - ASSERT_NOT_REACHED(); -} - -void GraphicsContext::savePlatformState() -{ - m_data->save(); -} - -void GraphicsContext::restorePlatformState() -{ - m_data->restore(); -} - -void GraphicsContext::drawRect(const IntRect& rect) -{ - if (!m_data->m_opacity || paintingDisabled() || rect.isEmpty()) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect trRect = m_data->mapRect(rect); - TransparentLayerDC transparentDC(m_data, trRect, &rect); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - trRect.move(transparentDC.toShift()); - - HGDIOBJ brush = 0; - HGDIOBJ oldBrush; - if (fillColor().alpha()) { - brush = createBrush(fillColor()); - oldBrush = SelectObject(dc, brush); - } else - SelectObject(dc, GetStockObject(NULL_BRUSH)); - - HGDIOBJ pen = 0; - HGDIOBJ oldPen; - if (strokeStyle() != NoStroke) { - pen = createPen(strokeColor(), strokeThickness(), strokeStyle()); - oldPen = SelectObject(dc, pen); - } else - SelectObject(dc, GetStockObject(NULL_PEN)); - - if (!brush && !pen) - return; - - if (trRect.width() <= 0) - trRect.setWidth(1); - if (trRect.height() <= 0) - trRect.setHeight(1); - - Rectangle(dc, trRect.x(), trRect.y(), trRect.right(), trRect.bottom()); - - if (pen) { - SelectObject(dc, oldPen); - DeleteObject(pen); - } - - if (brush) { - SelectObject(dc, oldBrush); - DeleteObject(brush); - } -} - -void GraphicsContext::drawLine(const IntPoint& point1, const IntPoint& point2) -{ - if (!m_data->m_opacity || paintingDisabled() || strokeStyle() == NoStroke || !strokeColor().alpha()) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntPoint trPoint1 = m_data->mapPoint(point1); - IntPoint trPoint2 = m_data->mapPoint(point2); - - IntRect lineRect(trPoint1, trPoint2 - trPoint1); - lineRect.setHeight(lineRect.height() + strokeThickness()); - TransparentLayerDC transparentDC(m_data, lineRect, 0, strokeColor().alpha()); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - trPoint1 += transparentDC.toShift(); - trPoint2 += transparentDC.toShift(); - - HGDIOBJ pen = createPen(strokeColor(), strokeThickness(), strokeStyle()); - HGDIOBJ oldPen = SelectObject(dc, pen); - - MoveToEx(dc, trPoint1.x(), trPoint1.y(), 0); - LineTo(dc, trPoint2.x(), trPoint2.y()); - - SelectObject(dc, oldPen); - DeleteObject(pen); -} - -void GraphicsContext::drawEllipse(const IntRect& rect) -{ - if (!m_data->m_opacity || paintingDisabled() || (!fillColor().alpha() && strokeStyle() == NoStroke)) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect trRect = m_data->mapRect(rect); - TransparentLayerDC transparentDC(m_data, trRect, &rect); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - trRect.move(transparentDC.toShift()); - - HGDIOBJ brush = 0; - HGDIOBJ oldBrush; - if (fillColor().alpha()) { - brush = createBrush(fillColor()); - oldBrush = SelectObject(dc, brush); - } else - SelectObject(dc, GetStockObject(NULL_BRUSH)); - HGDIOBJ pen = 0; - HGDIOBJ oldPen; - if (strokeStyle() != NoStroke) { - pen = createPen(strokeColor(), strokeThickness(), strokeStyle()); - oldPen = SelectObject(dc, pen); - } else - SelectObject(dc, GetStockObject(NULL_PEN)); - - Ellipse(dc, trRect.x(), trRect.y(), trRect.right(), trRect.bottom()); - - if (pen) { - SelectObject(dc, oldPen); - DeleteObject(pen); - } - - if (brush) { - SelectObject(dc, oldBrush); - DeleteObject(brush); - } -} - -static inline bool equalAngle(double a, double b) -{ - return fabs(a - b) < 1E-5; -} - -void getEllipsePointByAngle(double angle, double a, double b, float& x, float& y) -{ - while (angle < 0) - angle += 2 * piDouble; - while (angle >= 2 * piDouble) - angle -= 2 * piDouble; - - if (equalAngle(angle, 0) || equalAngle(angle, 2 * piDouble)) { - x = a; - y = 0; - } else if (equalAngle(angle, piDouble)) { - x = -a; - y = 0; - } else if (equalAngle(angle, .5 * piDouble)) { - x = 0; - y = b; - } else if (equalAngle(angle, 1.5 * piDouble)) { - x = 0; - y = -b; - } else { - double k = tan(angle); - double sqA = a * a; - double sqB = b * b; - double tmp = 1. / (1. / sqA + (k * k) / sqB); - tmp = tmp <= 0 ? 0 : sqrt(tmp); - if (angle > .5 * piDouble && angle < 1.5 * piDouble) - tmp = -tmp; - x = tmp; - - k = tan(.5 * piDouble - angle); - tmp = 1. / ((k * k) / sqA + 1 / sqB); - tmp = tmp <= 0 ? 0 : sqrt(tmp); - if (angle > piDouble) - tmp = -tmp; - y = tmp; - } -} - -void GraphicsContext::strokeArc(const IntRect& rect, int startAngle, int angleSpan) -{ - if (!m_data->m_opacity || paintingDisabled() || strokeStyle() == NoStroke || rect.isEmpty()) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect trRect = m_data->mapRect(rect); - TransparentLayerDC transparentDC(m_data, trRect, &rect); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - trRect.move(transparentDC.toShift()); - - HGDIOBJ pen = createPen(strokeColor(), strokeThickness(), strokeStyle()); - HGDIOBJ oldPen = SelectObject(dc, pen); - - double a = trRect.width() * 0.5; - double b = trRect.height() * 0.5; - int centerX = stableRound(trRect.x() + a); - int centerY = stableRound(trRect.y() + b); - float fstartX, fstartY, fendX, fendY; - int startX, startY, endX, endY; - getEllipsePointByAngle(deg2rad((double)startAngle), a, b, fstartX, fstartY); - getEllipsePointByAngle(deg2rad((double)startAngle + angleSpan), a, b, fendX, fendY); - startX = stableRound(fstartX); - startY = stableRound(fstartY); - endX = stableRound(fendX); - endY = stableRound(fendY); - - startX += centerX; - startY = centerY - startY; - endX += centerX; - endY = centerY - endY; - RECT clipRect; - if (startX < endX) { - clipRect.left = startX; - clipRect.right = endX; - } else { - clipRect.left = endX; - clipRect.right = startX; - } - if (startY < endY) { - clipRect.top = startY; - clipRect.bottom = endY; - } else { - clipRect.top = endY; - clipRect.bottom = startY; - } - - OwnPtr clipRgn(CreateRectRgn(0, 0, 0, 0)); - bool newClip; - if (GetClipRgn(dc, clipRgn.get()) <= 0) { - newClip = true; - clipRgn.set(CreateRectRgn(clipRect.left, clipRect.top, clipRect.right, clipRect.bottom)); - SelectClipRgn(dc, clipRgn.get()); - } else { - newClip = false; - IntersectClipRect(dc, clipRect.left, clipRect.top, clipRect.right, clipRect.bottom); - } - - HGDIOBJ oldBrush = SelectObject(dc, GetStockObject(NULL_BRUSH)); - Ellipse(dc, trRect.x(), trRect.y(), trRect.right(), trRect.bottom()); - SelectObject(dc, oldBrush); - - if (newClip) - SelectClipRgn(dc, 0); - else - SelectClipRgn(dc, clipRgn.get()); - - SelectObject(dc, oldPen); - DeleteObject(pen); -} - -void GraphicsContext::drawConvexPolygon(size_t npoints, const FloatPoint* points, bool shouldAntialias) -{ - if (!m_data->m_opacity || paintingDisabled() || npoints <= 1 || !points) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - Vector winPoints(npoints); - FloatPoint trPoint = m_data->mapPoint(points[0]); - winPoints[0].x = stableRound(trPoint.x()); - winPoints[0].y = stableRound(trPoint.y()); - RECT rect = { winPoints[0].x, winPoints[0].y, winPoints[0].x, winPoints[0].y }; - for (size_t i = 1; i < npoints; ++i) { - trPoint = m_data->mapPoint(points[i]); - winPoints[i].x = stableRound(trPoint.x()); - winPoints[i].y = stableRound(trPoint.y()); - if (rect.left > winPoints[i].x) - rect.left = winPoints[i].x; - else if (rect.right < winPoints[i].x) - rect.right = winPoints[i].x; - if (rect.top > winPoints[i].y) - rect.top = winPoints[i].y; - else if (rect.bottom < winPoints[i].y) - rect.bottom = winPoints[i].y; - } - rect.bottom += 1; - rect.right += 1; - - IntRect intRect(rect); - TransparentLayerDC transparentDC(m_data, intRect); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - - for (size_t i = 0; i < npoints; ++i) { - winPoints[i].x += transparentDC.toShift().width(); - winPoints[i].y += transparentDC.toShift().height(); - } - - HGDIOBJ brush = 0; - HGDIOBJ oldBrush; - if (fillColor().alpha()) { - brush = createBrush(fillColor()); - oldBrush = SelectObject(dc, brush); - } else - SelectObject(dc, GetStockObject(NULL_BRUSH)); - - HGDIOBJ pen = 0; - HGDIOBJ oldPen; - if (strokeStyle() != NoStroke) { - pen = createPen(strokeColor(), strokeThickness(), strokeStyle()); - oldPen = SelectObject(dc, pen); - } else - SelectObject(dc, GetStockObject(NULL_PEN)); - - if (!brush && !pen) - return; - - Polygon(dc, winPoints.data(), npoints); - - if (pen) { - SelectObject(dc, oldPen); - DeleteObject(pen); - } - - if (brush) { - SelectObject(dc, oldBrush); - DeleteObject(brush); - } -} - -void GraphicsContext::fillRect(const FloatRect& rect, const Color& color) -{ - if (paintingDisabled() || !m_data->m_opacity) - return; - - int alpha = color.alpha(); - if (!alpha) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect intRect = enclosingIntRect(rect); - TransparentLayerDC transparentDC(m_data, m_data->mapRect(intRect), &intRect, alpha); - - if (!transparentDC.hdc()) - return; - - OwnPtr hbrush(CreateSolidBrush(RGB(color.red(), color.green(), color.blue()))); - FillRect(transparentDC.hdc(), &transparentDC.rect(), hbrush.get()); -} - -void GraphicsContext::clip(const FloatRect& rect) -{ - if (paintingDisabled()) - return; - - if (!m_data->m_dc) - return; - - IntRect trRect = enclosingIntRect(m_data->mapRect(rect)); - - OwnPtr clipRgn(CreateRectRgn(0, 0, 0, 0)); - if (GetClipRgn(m_data->m_dc, clipRgn.get()) > 0) - IntersectClipRect(m_data->m_dc, trRect.x(), trRect.y(), trRect.right(), trRect.bottom()); - else { - clipRgn.set(CreateRectRgn(trRect.x(), trRect.y(), trRect.right(), trRect.bottom())); - SelectClipRgn(m_data->m_dc, clipRgn.get()); - } -} - -void GraphicsContext::clipOut(const IntRect& rect) -{ - if (paintingDisabled()) - return; - - if (!m_data->m_dc) - return; - - IntRect trRect = m_data->mapRect(rect); - - ExcludeClipRect(m_data->m_dc, trRect.x(), trRect.y(), trRect.right(), trRect.bottom()); -} - -void GraphicsContext::drawFocusRing(const Color& color) -{ - if (!m_data->m_opacity || paintingDisabled()) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - int radius = (focusRingWidth() - 1) / 2; - int offset = radius + focusRingOffset(); - - const Vector& rects = focusRingRects(); - unsigned rectCount = rects.size(); - IntRect finalFocusRect; - for (unsigned i = 0; i < rectCount; i++) { - IntRect focusRect = rects[i]; - focusRect.inflate(offset); - finalFocusRect.unite(focusRect); - } - - IntRect intRect = finalFocusRect; - IntRect trRect = m_data->mapRect(finalFocusRect); - TransparentLayerDC transparentDC(m_data, trRect, &intRect); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - trRect.move(transparentDC.toShift()); - - RECT rect = trRect; - DrawFocusRect(dc, &rect); -} - -void GraphicsContext::drawLineForText(const IntPoint& origin, int width, bool printing) -{ - if (paintingDisabled()) - return; - - StrokeStyle oldStyle = strokeStyle(); - setStrokeStyle(SolidStroke); - drawLine(origin, origin + IntSize(width, 0)); - setStrokeStyle(oldStyle); -} - -void GraphicsContext::drawLineForMisspellingOrBadGrammar(const IntPoint&, int width, bool grammar) -{ - notImplemented(); -} - -void GraphicsContext::setPlatformFillColor(const Color& col) -{ - notImplemented(); -} - -void GraphicsContext::setPlatformStrokeColor(const Color& col) -{ - notImplemented(); -} - -void GraphicsContext::setPlatformStrokeThickness(float strokeThickness) -{ - notImplemented(); -} - -void GraphicsContext::setURLForRect(const KURL& link, const IntRect& destRect) -{ - notImplemented(); -} - -void GraphicsContext::addInnerRoundedRectClip(const IntRect& rect, int thickness) -{ - // We can only clip rectangles on WINCE - clip(rect); -} - -void GraphicsContext::clearRect(const FloatRect& rect) -{ - if (paintingDisabled()) - return; - - if (m_data->hasAlpha()) { - IntRect trRect = enclosingIntRect(m_data->mapRect(rect)); - m_data->m_bitmap->clearPixels(trRect); - return; - } - - fillRect(rect, Color(Color::white)); -} - -void GraphicsContext::strokeRect(const FloatRect& rect, float width) -{ - if (!m_data->m_opacity || paintingDisabled() || strokeStyle() == NoStroke) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect intRect = enclosingIntRect(rect); - IntRect trRect = m_data->mapRect(intRect); - TransparentLayerDC transparentDC(m_data, trRect, &intRect); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - trRect.move(transparentDC.toShift()); - - HGDIOBJ pen = createPen(strokeColor(), strokeThickness(), strokeStyle()); - HGDIOBJ oldPen = SelectObject(dc, pen); - - int right = trRect.right() - 1; - int bottom = trRect.bottom() - 1; - const POINT intPoints[5] = - { - { trRect.x(), trRect.y() }, - { right, trRect.y() }, - { right, bottom }, - { trRect.x(), bottom }, - { trRect.x(), trRect.y() } - }; - - Polyline(dc, intPoints, 5); - - SelectObject(dc, oldPen); - DeleteObject(pen); -} - -void GraphicsContext::beginTransparencyLayer(float opacity) -{ - m_data->save(); - m_data->m_opacity *= opacity; -} - -void GraphicsContext::endTransparencyLayer() -{ - m_data->restore(); -} - -void GraphicsContext::concatCTM(const TransformationMatrix& transform) -{ - m_data->concatCTM(transform); -} - -TransformationMatrix& GraphicsContext::affineTransform() -{ - return m_data->m_transform; -} - -const TransformationMatrix& GraphicsContext::affineTransform() const -{ - return m_data->m_transform; -} - -void GraphicsContext::resetAffineTransform() -{ - m_data->m_transform.makeIdentity(); -} - -void GraphicsContext::translate(float x, float y) -{ - m_data->translate(x, y); -} - -void GraphicsContext::rotate(float radians) -{ - m_data->rotate(radians); -} - -IntPoint GraphicsContext::origin() -{ - return m_data->origin(); -} - -void GraphicsContext::scale(const FloatSize& size) -{ - m_data->scale(size); -} - -void GraphicsContext::setLineCap(LineCap lineCap) -{ - notImplemented(); -} - -void GraphicsContext::setLineJoin(LineJoin lineJoin) -{ - notImplemented(); -} - -void GraphicsContext::setMiterLimit(float miter) -{ - notImplemented(); -} - -void GraphicsContext::setAlpha(float alpha) -{ - m_data->m_opacity = alpha; -} - -void GraphicsContext::setCompositeOperation(CompositeOperator op) -{ - notImplemented(); -} - -void GraphicsContext::beginPath() -{ - m_data->m_paths.clear(); -} - -void GraphicsContext::addPath(const Path& path) -{ - m_data->m_paths.append(path); -} - -void GraphicsContext::clip(const Path& path) -{ - notImplemented(); -} - -void GraphicsContext::clipOut(const Path&) -{ - notImplemented(); -} - -void GraphicsContext::clipOutEllipseInRect(const IntRect&) -{ - notImplemented(); -} - -void GraphicsContext::fillRoundedRect(const IntRect&, const IntSize& topLeft, const IntSize& topRight, const IntSize& bottomLeft, const IntSize& bottomRight, const Color&) -{ - notImplemented(); -} - -FloatRect GraphicsContext::roundToDevicePixels(const FloatRect& frect) -{ - notImplemented(); - return frect; -} - -Color gradientAverageColor(const Gradient* gradient) -{ - const Vector& stops = gradient->getStops(); - if (stops.isEmpty()) - return Color(); - - const Gradient::ColorStop& stop = stops.first(); - if (stops.size() == 1) - return Color(stop.red, stop.green, stop.blue, stop.alpha); - - const Gradient::ColorStop& lastStop = stops.last(); - return Color((stop.red + lastStop.red) * 0.5f - , (stop.green + lastStop.green) * 0.5f - , (stop.blue + lastStop.blue) * 0.5f - , (stop.alpha + lastStop.alpha) * 0.5f); -} - -void GraphicsContext::fillPath() -{ - Color c = m_common->state.fillColorSpace == GradientColorSpace && m_common->state.fillGradient - ? gradientAverageColor(m_common->state.fillGradient.get()) - : fillColor(); - - if (!c.alpha() || !m_data->m_opacity) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - if (m_data->m_opacity < 1.0f || m_data->hasAlpha()) { - HGDIOBJ brush = createBrush(c); - for (Vector::const_iterator i = m_data->m_paths.begin(); i != m_data->m_paths.end(); ++i) { - IntRect trRect = enclosingIntRect(m_data->mapRect(i->boundingRect())); - trRect.inflate(1); - TransparentLayerDC transparentDC(m_data, trRect); - HDC dc = transparentDC.hdc(); - if (!dc) - continue; - - TransformationMatrix tr = m_data->m_transform; - tr.translate(transparentDC.toShift().width(), transparentDC.toShift().height()); - - SelectObject(dc, GetStockObject(NULL_PEN)); - HGDIOBJ oldBrush = SelectObject(dc, brush); - i->platformPath()->fillPath(dc, &tr); - SelectObject(dc, oldBrush); - } - DeleteObject(brush); - } else { - SelectObject(m_data->m_dc, GetStockObject(NULL_PEN)); - HGDIOBJ brush = createBrush(c); - HGDIOBJ oldBrush = SelectObject(m_data->m_dc, brush); - for (Vector::const_iterator i = m_data->m_paths.begin(); i != m_data->m_paths.end(); ++i) - i->platformPath()->fillPath(m_data->m_dc, &m_data->m_transform); - SelectObject(m_data->m_dc, oldBrush); - DeleteObject(brush); - } -} - - -void GraphicsContext::strokePath() -{ - if (!m_data->m_opacity) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - if (m_data->m_opacity < 1.0f || m_data->hasAlpha()) { - HGDIOBJ pen = createPen(strokeColor(), strokeThickness(), strokeStyle()); - for (Vector::const_iterator i = m_data->m_paths.begin(); i != m_data->m_paths.end(); ++i) { - IntRect trRect = enclosingIntRect(m_data->mapRect(i->boundingRect())); - trRect.inflate(1); - TransparentLayerDC transparentDC(m_data, trRect); - HDC dc = transparentDC.hdc(); - if (!dc) - continue; - - TransformationMatrix tr = m_data->m_transform; - tr.translate(transparentDC.toShift().width(), transparentDC.toShift().height()); - - SelectObject(dc, GetStockObject(NULL_BRUSH)); - HGDIOBJ oldPen = SelectObject(dc, pen); - i->platformPath()->strokePath(dc, &tr); - SelectObject(dc, oldPen); - } - DeleteObject(pen); - } else { - SelectObject(m_data->m_dc, GetStockObject(NULL_BRUSH)); - HGDIOBJ pen = createPen(strokeColor(), strokeThickness(), strokeStyle()); - HGDIOBJ oldPen = SelectObject(m_data->m_dc, pen); - for (Vector::const_iterator i = m_data->m_paths.begin(); i != m_data->m_paths.end(); ++i) - i->platformPath()->strokePath(m_data->m_dc, &m_data->m_transform); - SelectObject(m_data->m_dc, oldPen); - DeleteObject(pen); - } -} - -void GraphicsContext::fillRect(const FloatRect& r, const Gradient* gradient) -{ - if (!m_data->m_opacity) - return; - - const Vector& stops = gradient->getStops(); - if (stops.isEmpty()) - return; - - size_t numStops = stops.size(); - if (numStops == 1) { - const Gradient::ColorStop& stop = stops.first(); - Color color(stop.red, stop.green, stop.blue, stop.alpha); - fillRect(r, color); - return; - } - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect intRect = enclosingIntRect(r); - IntRect rect = m_data->mapRect(intRect); - TransparentLayerDC transparentDC(m_data, rect, &intRect, 255, true); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - - rect.move(transparentDC.toShift()); - FloatPoint fp0 = m_data->mapPoint(gradient->p0()); - FloatPoint fp1 = m_data->mapPoint(gradient->p1()); - IntPoint p0(stableRound(fp0.x()), stableRound(fp0.y())); - IntPoint p1(stableRound(fp1.x()), stableRound(fp1.y())); - p0 += transparentDC.toShift(); - p1 += transparentDC.toShift(); - - if (gradient->isRadial()) { - if (g_radialGradientFiller) { - // FIXME: don't support 2D scaling at this time - double scale = (m_data->m_transform.a() + m_data->m_transform.d()) * 0.5; - float r0 = gradient->r0() * scale; - float r1 = gradient->r1() * scale; - g_radialGradientFiller(dc, rect, p0, p1, r0, r1, gradient->getStops()); - return; - } - } else if (g_linearGradientFiller) { - g_linearGradientFiller(dc, rect, p0, p1, gradient->getStops()); - return; - } - - // Simple 1D linear solution that assumes p0 is on the top or left side, and p1 is on the right or bottom side - size_t numRects = (numStops - 1); - Vector tv; - tv.resize(numRects * 2); - Vector mesh; - mesh.resize(numRects); - int x = rect.x(); - int y = rect.y(); - int width = rect.width(); - int height = rect.height(); - FloatSize d = gradient->p1() - gradient->p0(); - bool vertical = abs(d.height()) > abs(d.width()); - for (size_t i = 0; i < numStops; ++i) { - const Gradient::ColorStop& stop = stops[i]; - int iTv = i ? 2 * i - 1 : 0; - tv[iTv].Red = stop.red * 0xFFFF; - tv[iTv].Green = stop.green * 0xFFFF; - tv[iTv].Blue = stop.blue * 0xFFFF; - tv[iTv].Alpha = stop.alpha * 0xFFFF; - if (i) { - tv[iTv].x = vertical ? x + width: x + width * stop.stop; - tv[iTv].y = vertical ? y + height * stop.stop : y + height; - mesh[i - 1].UpperLeft = iTv - 1; - mesh[i - 1].LowerRight = iTv; - } else { - tv[iTv].x = x; - tv[iTv].y = y; - } - - if (i && i < numRects) { - tv[iTv + 1] = tv[iTv]; - if (vertical) - tv[iTv + 1].x = x; - else - tv[iTv + 1].y = y; - } - } - - GradientFill(dc, tv.data(), tv.size(), mesh.data(), mesh.size(), vertical ? GRADIENT_FILL_RECT_V : GRADIENT_FILL_RECT_H); -} - -TransformationMatrix GraphicsContext::getCTM() const -{ - return m_data->m_transform; -} - -void GraphicsContext::clipToImageBuffer(const FloatRect&, const ImageBuffer*) -{ - notImplemented(); -} - -void GraphicsContext::fillRect(const FloatRect& rect) -{ - if (m_common->state.fillColorSpace == GradientColorSpace && m_common->state.fillGradient) - fillRect(rect, m_common->state.fillGradient.get()); - else - fillRect(rect, fillColor()); -} - -void GraphicsContext::setPlatformShadow(const IntSize&, int, const Color&) -{ - notImplemented(); -} - -void GraphicsContext::clearPlatformShadow() -{ - notImplemented(); -} - -void GraphicsContext::setImageInterpolationQuality(InterpolationQuality) -{ - notImplemented(); -} - -static inline bool isCharVisible(UChar c) -{ - return c && c != zeroWidthSpace; -} - -void GraphicsContext::drawText(const Font& font, const TextRun& run, const IntPoint& point, int from, int to) -{ - if (paintingDisabled() || !fillColor().alpha() || !m_data->m_opacity) - return; - - bool mustSupportAlpha = m_data->hasAlpha(); - - if (!mustSupportAlpha && fillColor().alpha() == 0xFF && m_data->m_opacity >= 1.0) { - font.drawText(this, run, point, from, to); - return; - } - - float oldOpacity = m_data->m_opacity; - m_data->m_opacity *= fillColor().alpha() / 255.0; - - FloatRect textRect = font.selectionRectForText(run, point, font.height(), from, to); - textRect.setY(textRect.y() - font.ascent()); - IntRect trRect = enclosingIntRect(m_data->mapRect(textRect)); - RECT bmpRect; - AlphaPaintType alphaPaintType = mustSupportAlpha ? AlphaPaintOther : AlphaPaintNone; - if (RefPtr bmp = m_data->getTransparentLayerBitmap(trRect, alphaPaintType, bmpRect, true, mustSupportAlpha)) { - { - GraphicsContext gc(0); - gc.setBitmap(bmp); - gc.scale(FloatSize(m_data->m_transform.a(), m_data->m_transform.d())); - font.drawText(&gc, run, IntPoint(0, font.ascent()), from, to); - } - unsigned key1, key2; - HDC memDC = bmp->getDC(&key1, &key2); - if (memDC) { - m_data->paintBackTransparentLayerBitmap(memDC, bmp.get(), trRect, alphaPaintType, bmpRect); - bmp->releaseDC(memDC, key1, key2); - } - } - - m_data->m_opacity = oldOpacity; -} - -void GraphicsContext::drawText(const SimpleFontData* fontData, const GlyphBuffer& glyphBuffer, - int from, int numGlyphs, const FloatPoint& point) -{ - if (!m_data->m_opacity) - return; - - for (;;) { - if (!numGlyphs) - return; - if (isCharVisible(*glyphBuffer.glyphs(from))) - break; - ++from; - --numGlyphs; - } - - double scaleX = m_data->m_transform.a(); - double scaleY = m_data->m_transform.d(); - - int height = fontData->platformData().size() * scaleY; - int width = fontData->platformData().averageCharWidth() * scaleX; - - if (!height || !width) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - HFONT hFont = height > 1 - ? fontData->platformData().getScaledFontHandle(height, scaleX == scaleY ? 0 : width) - : 0; - - FloatPoint startPoint(point.x(), point.y() - fontData->ascent()); - FloatPoint trPoint = m_data->mapPoint(startPoint); - int y = stableRound(trPoint.y()); - - Color color = fillColor(); - if (!color.alpha()) - return; - - COLORREF fontColor = RGB(color.red(), color.green(), color.blue()); - - if (!hFont) { - double offset = trPoint.x(); - const GlyphBufferAdvance* advance = glyphBuffer.advanceData() + from; - if (scaleX == 1.) - for (int i = 1; i < numGlyphs; ++i) - offset += *advance++; - else - for (int i = 1; i < numGlyphs; ++i) - offset += *advance++ * scaleX; - - offset += width; - - OwnPtr hPen(CreatePen(PS_DASH, 1, fontColor)); - HGDIOBJ oldPen = SelectObject(m_data->m_dc, hPen.get()); - - MoveToEx(m_data->m_dc, stableRound(trPoint.x()), y, 0); - LineTo(m_data->m_dc, stableRound(offset), y); - - SelectObject(m_data->m_dc, oldPen); - return; - } - - IntSize shadowSize; - int shadowBlur = 0; - Color shadowColor; - bool hasShadow = textDrawingMode() == cTextFill - && getShadow(shadowSize, shadowBlur, shadowColor) - && shadowColor.alpha(); - COLORREF shadowRGBColor; - FloatPoint trShadowPoint; - if (hasShadow) { - shadowRGBColor = RGB(shadowColor.red(), shadowColor.green(), shadowColor.blue()); - trShadowPoint = m_data->mapPoint(startPoint + shadowSize); - } - - HGDIOBJ hOldFont = SelectObject(m_data->m_dc, hFont); - COLORREF oldTextColor = GetTextColor(m_data->m_dc); - int oldTextAlign = GetTextAlign(m_data->m_dc); - SetTextAlign(m_data->m_dc, 0); - - int oldBkMode = GetBkMode(m_data->m_dc); - SetBkMode(m_data->m_dc, TRANSPARENT); - - if (numGlyphs > 1) { - double offset = trPoint.x(); - Vector glyphSpace(numGlyphs); - Vector text(numGlyphs); - int* curSpace = glyphSpace.data(); - UChar* curChar = text.data(); - const UChar* srcChar = glyphBuffer.glyphs(from); - const UChar* const srcCharEnd = srcChar + numGlyphs; - *curChar++ = *srcChar++; - int firstOffset = stableRound(offset); - int lastOffset = firstOffset; - const GlyphBufferAdvance* advance = glyphBuffer.advanceData() + from; - // FIXME: ExtTextOut() can flip over each word for RTL languages, even when TA_RTLREADING is off. - // (this can be GDI bug or font driver bug?) - // We are not clear how it processes characters and handles specified spaces. On the other side, - // our glyph buffer is already in the correct order for rendering. So, the solution is that we - // call ExtTextOut() for each single character when the text contains any RTL character. - // This solution is not perfect as it is slower than calling ExtTextOut() one time for all characters. - // Drawing characters one by one may be too slow. - bool drawOneByOne = false; - if (scaleX == 1.) { - for (; srcChar < srcCharEnd; ++srcChar) { - offset += *advance++; - int offsetInt = stableRound(offset); - if (isCharVisible(*srcChar)) { - if (!drawOneByOne && WTF::Unicode::direction(*srcChar) == WTF::Unicode::RightToLeft) - drawOneByOne = true; - *curChar++ = *srcChar; - *curSpace++ = offsetInt - lastOffset; - lastOffset = offsetInt; - } - } - } else { - for (; srcChar < srcCharEnd; ++srcChar) { - offset += *advance++ * scaleX; - int offsetInt = stableRound(offset); - if (isCharVisible(*srcChar)) { - if (!drawOneByOne && WTF::Unicode::direction(*srcChar) == WTF::Unicode::RightToLeft) - drawOneByOne = true; - *curChar++ = *srcChar; - *curSpace++ = offsetInt - lastOffset; - lastOffset = offsetInt; - } - } - } - numGlyphs = curChar - text.data(); - if (hasShadow) { - SetTextColor(m_data->m_dc, shadowRGBColor); - if (drawOneByOne) { - int xShadow = firstOffset + stableRound(trShadowPoint.x() - trPoint.x()); - int yShadow = stableRound(trShadowPoint.y()); - for (int i = 0; i < numGlyphs; ++i) { - ExtTextOut(m_data->m_dc, xShadow, yShadow, 0, NULL, text.data() + i, 1, 0); - xShadow += glyphSpace[i]; - } - } else - ExtTextOut(m_data->m_dc, firstOffset + stableRound(trShadowPoint.x() - trPoint.x()), stableRound(trShadowPoint.y()), 0, NULL, text.data(), numGlyphs, glyphSpace.data()); - } - SetTextColor(m_data->m_dc, fontColor); - if (drawOneByOne) { - int x = firstOffset; - for (int i = 0; i < numGlyphs; ++i) { - ExtTextOut(m_data->m_dc, x, y, 0, NULL, text.data() + i, 1, 0); - x += glyphSpace[i]; - } - } else - ExtTextOut(m_data->m_dc, firstOffset, y, 0, NULL, text.data(), numGlyphs, glyphSpace.data()); - } else { - UChar c = *glyphBuffer.glyphs(from); - if (hasShadow) { - SetTextColor(m_data->m_dc, shadowRGBColor); - ExtTextOut(m_data->m_dc, stableRound(trShadowPoint.x()), stableRound(trShadowPoint.y()), 0, NULL, &c, 1, 0); - } - SetTextColor(m_data->m_dc, fontColor); - ExtTextOut(m_data->m_dc, stableRound(trPoint.x()), y, 0, NULL, &c, 1, 0); - } - - SetTextAlign(m_data->m_dc, oldTextAlign); - SetTextColor(m_data->m_dc, oldTextColor); - SetBkMode(m_data->m_dc, oldBkMode); - SelectObject(m_data->m_dc, hOldFont); -} - -void GraphicsContext::drawFrameControl(const IntRect& rect, unsigned type, unsigned state) -{ - if (!m_data->m_opacity) - return; - - const int boxWidthBest = 8; - const int boxHeightBest = 8; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect trRect = m_data->mapRect(rect); - TransparentLayerDC transparentDC(m_data, trRect, &rect, 255, true); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - trRect.move(transparentDC.toShift()); - - RECT rectWin = trRect; - - if ((rectWin.right - rectWin.left) < boxWidthBest) { - RefPtr bmp = SharedBitmap::createInstance(true, boxWidthBest, boxHeightBest, true); - SharedBitmap::DCHolder memDC(bmp.get()); - if (memDC.get()) { - RECT tempRect = {0, 0, boxWidthBest, boxHeightBest}; - DrawFrameControl(memDC.get(), &tempRect, type, state); - - ::StretchBlt(dc, rectWin.left, rectWin.top, rectWin.right - rectWin.left, rectWin.bottom - rectWin.top, memDC.get(), 0, 0, boxWidthBest, boxHeightBest, SRCCOPY); - return; - } - } - - DrawFrameControl(dc, &rectWin, type, state); -} - -void GraphicsContext::drawFocusRect(const IntRect& rect) -{ - if (!m_data->m_opacity) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect trRect = m_data->mapRect(rect); - TransparentLayerDC transparentDC(m_data, trRect, &rect); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - trRect.move(transparentDC.toShift()); - - RECT rectWin = trRect; - DrawFocusRect(dc, &rectWin); -} - -void GraphicsContext::paintTextField(const IntRect& rect, unsigned state) -{ - if (!m_data->m_opacity) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect trRect = m_data->mapRect(rect); - TransparentLayerDC transparentDC(m_data, trRect, &rect); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - trRect.move(transparentDC.toShift()); - - RECT rectWin = trRect; - DrawEdge(dc, &rectWin, EDGE_ETCHED, BF_RECT | BF_ADJUST); - FillRect(dc, &rectWin, reinterpret_cast(((state & DFCS_INACTIVE) ? COLOR_BTNFACE : COLOR_WINDOW) + 1)); -} - -void GraphicsContext::drawBitmap(SharedBitmap* bmp, const IntRect& dstRectIn, const IntRect& srcRect, CompositeOperator compositeOp) -{ - if (!m_data->m_opacity) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect dstRect = m_data->mapRect(dstRectIn); - TransparentLayerDC transparentDC(m_data, dstRect, &dstRectIn, 255, true); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - dstRect.move(transparentDC.toShift()); - - bmp->draw(dc, dstRect, srcRect, compositeOp); - - if (bmp->is16bit()) - transparentDC.fillAlphaChannel(); -} - -void GraphicsContext::drawBitmapPattern(SharedBitmap* bmp, const FloatRect& tileRectIn, const TransformationMatrix& patternTransform, - const FloatPoint& phase, CompositeOperator op, const FloatRect& destRectIn, const IntSize& origSourceSize) -{ - if (!m_data->m_opacity) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect intDstRect = enclosingIntRect(destRectIn); - IntRect trRect = m_data->mapRect(intDstRect); - TransparentLayerDC transparentDC(m_data, trRect, &intDstRect, 255, true); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - trRect.move(transparentDC.toShift()); - FloatRect movedDstRect = m_data->m_transform.inverse().mapRect(FloatRect(trRect)); - FloatSize moved(movedDstRect.location() - destRectIn.location()); - TransformationMatrix transform = m_data->m_transform; - transform.translate(moved.width(), moved.height()); - - bmp->drawPattern(dc, transform, tileRectIn, patternTransform, phase, op, destRectIn, origSourceSize); - - if (!bmp->hasAlpha()) - transparentDC.fillAlphaChannel(); -} - -void GraphicsContext::drawIcon(HICON icon, const IntRect& dstRectIn, UINT flags) -{ - if (!m_data->m_opacity) - return; - - ScopeDCProvider dcProvider(m_data); - if (!m_data->m_dc) - return; - - IntRect dstRect = m_data->mapRect(dstRectIn); - TransparentLayerDC transparentDC(m_data, dstRect, &dstRectIn, 255, true); - HDC dc = transparentDC.hdc(); - if (!dc) - return; - dstRect.move(transparentDC.toShift()); - - DrawIconEx(dc, dstRect.x(), dstRect.y(), icon, dstRect.width(), dstRect.height(), 0, NULL, flags); -} - -void GraphicsContext::setPlatformShouldAntialias(bool) -{ - notImplemented(); -} - -void GraphicsContext::setLineDash(const DashArray&, float) -{ - notImplemented(); -} - -void GraphicsContext::clipPath(WindRule) -{ - notImplemented(); -} - -} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/platform/graphics/wince/SimpleFontDataWince.cpp b/src/3rdparty/webkit/WebCore/platform/graphics/wince/SimpleFontDataWince.cpp deleted file mode 100644 index 1195294..0000000 --- a/src/3rdparty/webkit/WebCore/platform/graphics/wince/SimpleFontDataWince.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007-2009 Torch Mobile, Inc. - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "config.h" -#include "SimpleFontData.h" - -#include "FloatRect.h" -#include "Font.h" -#include "FontCache.h" -#include "FontDescription.h" -#include -#include -#include - -namespace WebCore { - -extern HDC g_screenDC; - -void SimpleFontData::platformInit() -{ - if (!m_platformData.isValid()) - return; - - const TEXTMETRIC& tm = m_platformData.metrics(); - m_isSystemFont = m_platformData.isSystemFont(); - - m_ascent = (tm.tmAscent * m_platformData.size() + 36) / 72; - m_descent = (tm.tmDescent * m_platformData.size() + 36) / 72; - m_lineGap = (tm.tmExternalLeading * m_platformData.size() + 36) / 72; - m_lineSpacing = m_ascent + m_descent + m_lineGap; - m_xHeight = m_ascent * 0.56f; -} - -void SimpleFontData::platformDestroy() -{ - delete m_smallCapsFontData; - m_smallCapsFontData = 0; -} - -SimpleFontData* SimpleFontData::smallCapsFontData(const FontDescription& fontDescription) const -{ - if (!m_smallCapsFontData) { - FontDescription fontDesc(fontDescription); - fontDesc.setComputedSize(lroundf(0.70f * fontDesc.computedSize())); - fontDesc.setSpecifiedSize(lroundf(0.70f * fontDesc.specifiedSize())); - fontDesc.setKeywordSize(lroundf(0.70f * fontDesc.keywordSize())); - FontPlatformData* result = fontCache()->getCachedFontPlatformData(fontDesc, m_platformData.family()); - if (result) - m_smallCapsFontData = new SimpleFontData(*result); - } - return m_smallCapsFontData; -} - -DWORD getKnownFontCodePages(const wchar_t* family); - -bool SimpleFontData::containsCharacters(const UChar* characters, int length) const -{ - if (m_platformData.isDisabled()) - return true; - - // FIXME: Microsoft documentation seems to imply that characters can be output using a given font and DC - // merely by testing code page intersection. This seems suspect though. Can't a font only partially - // cover a given code page? - - // FIXME: in the case that we failed to get the interface, still use the font. -#if defined(IMLANG_FONT_LINK) && (IMLANG_FONT_LINK == 2) - IMLangFontLink2* langFontLink = fontCache()->getFontLinkInterface(); -#else - IMLangFontLink* langFontLink = fontCache()->getFontLinkInterface(); -#endif - if (!langFontLink) - return true; - - DWORD fontCodePages = m_platformData.codePages(); - if (!fontCodePages) - return false; - - DWORD acpCodePages = 0; - langFontLink->CodePageToCodePages(CP_ACP, &acpCodePages); - - DWORD actualCodePages; - long numCharactersProcessed; - while (length) { - langFontLink->GetStrCodePages(characters, length, acpCodePages, &actualCodePages, &numCharactersProcessed); - if (actualCodePages && !(actualCodePages & fontCodePages)) - return false; - - length -= numCharactersProcessed; - characters += numCharactersProcessed; - } - - return true; -} - -void SimpleFontData::determinePitch() -{ - if (!m_platformData.isValid()) - return; - - const TEXTMETRIC& tm = m_platformData.metrics(); - - // Yes, this looks backwards, but the fixed pitch bit is actually set if the font - // is *not* fixed pitch. Unbelievable but true. - m_treatAsFixedPitch = !(tm.tmPitchAndFamily & TMPF_FIXED_PITCH); -} - -float SimpleFontData::platformWidthForGlyph(Glyph glyph) const -{ - if (m_platformData.isDisabled()) - return 0; - - HGDIOBJ hOldFont = SelectObject(g_screenDC, m_platformData.hfont()); - - SIZE fontSize; - wchar_t c = glyph; - GetTextExtentPoint32(g_screenDC, &c, 1, &fontSize); - - SelectObject(g_screenDC, hOldFont); - - return (float)fontSize.cx * (float)m_platformData.size() / 72.f; -} - - -void SimpleFontData::platformCharWidthInit() -{ - if (!m_platformData.isValid()) - return; - - const TEXTMETRIC& tm = m_platformData.metrics(); - m_avgCharWidth = (tm.tmAveCharWidth * m_platformData.size() + 36) / 72; - m_maxCharWidth = (tm.tmMaxCharWidth * m_platformData.size() + 36) / 72; -} - -} diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/ClipboardHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/haiku/ClipboardHaiku.cpp deleted file mode 100644 index 845c08c..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/ClipboardHaiku.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "ClipboardHaiku.h" - -#include "IntPoint.h" -#include "FileList.h" -#include "NotImplemented.h" -#include "PlatformString.h" -#include "StringHash.h" - -#include -#include -#include -#include -#include - - -namespace WebCore { - -ClipboardHaiku::ClipboardHaiku(ClipboardAccessPolicy policy, bool forDragging) - : Clipboard(policy, forDragging) -{ -} - -void ClipboardHaiku::clearData(const String& type) -{ - if (be_clipboard->Lock()) { - BMessage* data = be_clipboard->Data(); - - if (data) { - data->RemoveName(BString(type).String()); - be_clipboard->Commit(); - } - - be_clipboard->Unlock(); - } -} - -void ClipboardHaiku::clearAllData() -{ - if (be_clipboard->Lock()) { - be_clipboard->Clear(); - be_clipboard->Commit(); - be_clipboard->Unlock(); - } -} - -String ClipboardHaiku::getData(const String& type, bool& success) const -{ - BString result; - success = false; - - if (be_clipboard->Lock()) { - BMessage* data = be_clipboard->Data(); - - if (data) - if (data->FindString(BString(type).String(), &result) == B_OK) - success = true; - - be_clipboard->Unlock(); - } - - return result; -} - -bool ClipboardHaiku::setData(const String& type, const String& data) -{ - bool result = false; - - if (be_clipboard->Lock()) { - BMessage* bdata = be_clipboard->Data(); - - if (bdata) { - bdata->RemoveName(BString(type).String()); - - if (bdata->AddString(BString(type).String(), BString(data)) == B_OK) - result = true; - } - - be_clipboard->Commit(); - be_clipboard->Unlock(); - } - - return result; -} - -// Extensions beyond IE's API. -HashSet ClipboardHaiku::types() const -{ - HashSet result; - - if (be_clipboard->Lock()) { - BMessage* data = be_clipboard->Data(); - - if (data) { - char* name; - uint32 type; - int32 count; - - for (int32 i = 0; data->GetInfo(B_ANY_TYPE, i, &name, &type, &count) == B_OK; i++) - result.add(name); - } - - be_clipboard->Unlock(); - } - - return result; -} - -PassRefPtr ClipboardHaiku::files() const -{ - notImplemented(); - return 0; -} - -IntPoint ClipboardHaiku::dragLocation() const -{ - notImplemented(); - return IntPoint(0, 0); -} - -CachedImage* ClipboardHaiku::dragImage() const -{ - notImplemented(); - return 0; -} - -void ClipboardHaiku::setDragImage(CachedImage*, const IntPoint&) -{ - notImplemented(); -} - -Node* ClipboardHaiku::dragImageElement() -{ - notImplemented(); - return 0; -} - -void ClipboardHaiku::setDragImageElement(Node*, const IntPoint&) -{ - notImplemented(); -} - -DragImageRef ClipboardHaiku::createDragImage(IntPoint& dragLocation) const -{ - notImplemented(); - return 0; -} - -void ClipboardHaiku::declareAndWriteDragImage(Element*, const KURL&, const String&, Frame*) -{ - notImplemented(); -} - -void ClipboardHaiku::writeURL(const KURL&, const String&, Frame*) -{ - notImplemented(); -} - -void ClipboardHaiku::writeRange(Range*, Frame*) -{ - notImplemented(); -} - -bool ClipboardHaiku::hasData() -{ - bool result = false; - - if (be_clipboard->Lock()) { - BMessage* data = be_clipboard->Data(); - - if (data) - result = !data->IsEmpty(); - - be_clipboard->Unlock(); - } - - return result; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/ClipboardHaiku.h b/src/3rdparty/webkit/WebCore/platform/haiku/ClipboardHaiku.h deleted file mode 100644 index 23e3d7b..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/ClipboardHaiku.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 ClipboardHaiku_h -#define ClipboardHaiku_h - -#include "Clipboard.h" -#include "ClipboardAccessPolicy.h" - -namespace WebCore { - class CachedImage; - - // State available during IE's events for drag and drop and copy/paste. - class ClipboardHaiku : public Clipboard { - public: - static PassRefPtr create(ClipboardAccessPolicy policy, bool forDragging) - { - return adoptRef(new ClipboardHaiku(policy, forDragging)); - } - ~ClipboardHaiku() { } - - void clearData(const String& type); - void clearAllData(); - String getData(const String& type, bool& success) const; - bool setData(const String& type, const String& data); - - // Extensions beyond IE's API. - HashSet types() const; - virtual PassRefPtr files() const; - - IntPoint dragLocation() const; - CachedImage* dragImage() const; - void setDragImage(CachedImage*, const IntPoint&); - Node* dragImageElement(); - void setDragImageElement(Node*, const IntPoint&); - - virtual DragImageRef createDragImage(IntPoint& dragLoc) const; - virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*); - virtual void writeURL(const KURL&, const String&, Frame*); - virtual void writeRange(Range*, Frame*); - - virtual bool hasData(); - - private: - ClipboardHaiku(ClipboardAccessPolicy, bool forDragging); - }; -} // namespace WebCore - -#endif // ClipboardHaiku_h - diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/ContextMenuHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/haiku/ContextMenuHaiku.cpp deleted file mode 100644 index 03b8978..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/ContextMenuHaiku.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2006 Zack Rusin - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "ContextMenu.h" - -#include "ContextMenuItem.h" -#include "ContextMenuController.h" -#include "Frame.h" -#include "FrameView.h" -#include "Document.h" - -#include - -#include -#include -#include - - -namespace WebCore { - -// FIXME: This class isn't used yet -class ContextMenuReceiver : public BLooper -{ -public: - ContextMenuReceiver(ContextMenu* menu) - : BLooper("context_menu_receiver") - , m_menu(menu) - { - m_result = -1; - } - - void HandleMessage(BMessage* msg) - { - m_result = msg->what; - if (m_result != -1) { - BMenuItem* item = m_menu->platformDescription()->FindItem(m_result); - if (!item) { - printf("Error: Context menu item with code %i not found!\n", m_result); - return; - } - ContextMenuItem cmItem(item); - m_menu->controller()->contextMenuItemSelected(&cmItem); - cmItem.releasePlatformDescription(); - } - } - - int Result() - { - return m_result; - } - -private: - ContextMenu* m_menu; - int m_result; -}; - -ContextMenu::ContextMenu(const HitTestResult& result) - : m_hitTestResult(result) - , m_platformDescription(NULL) -{ - /* Get position */ - if (result.innerNode() && result.innerNode()->document()) { - BView* view = result.innerNode()->document()->frame()->view()->platformWidget(); - int child = 0; - while (view->ChildAt(child)) { - if (view->ChildAt(child)->Name() == "scroll_view_canvas") { - m_point = view->ChildAt(child)->ConvertToScreen(BPoint(result.point().x(), result.point().y())); - break; - } - child++; - } - } - m_platformDescription = new BMenu("context_menu"); -} - -ContextMenu::~ContextMenu() -{ - delete m_platformDescription; -} - -void ContextMenu::appendItem(ContextMenuItem& item) -{ - checkOrEnableIfNeeded(item); - - BMenuItem* bItem = item.releasePlatformDescription(); - if (bItem) - m_platformDescription->AddItem(bItem); -} - -unsigned ContextMenu::itemCount() const -{ - return m_platformDescription->CountItems(); -} - -void ContextMenu::insertItem(unsigned position, ContextMenuItem& item) -{ - checkOrEnableIfNeeded(item); - - BMenuItem* bItem = item.releasePlatformDescription(); - if (bItem) - m_platformDescription->AddItem(bItem, position); -} - -PlatformMenuDescription ContextMenu::platformDescription() const -{ - return m_platformDescription; -} - -void ContextMenu::setPlatformDescription(PlatformMenuDescription menu) -{ - if (static_cast(menu) == m_platformDescription) - return; - - delete m_platformDescription; - m_platformDescription = static_cast(menu); -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/ContextMenuItemHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/haiku/ContextMenuItemHaiku.cpp deleted file mode 100644 index cd5abaf..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/ContextMenuItemHaiku.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (C) 2006 Zack Rusin - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "ContextMenuItem.h" - -#include "ContextMenu.h" -#include "NotImplemented.h" - -#include -#include -#include -#include - - -using namespace WebCore; - -ContextMenuItem::ContextMenuItem(PlatformMenuItemDescription item) -{ - m_platformDescription = item; -} - -ContextMenuItem::ContextMenuItem(ContextMenu* subMenu) -{ - m_platformDescription = new BMenuItem(subMenu->platformDescription(), - new BMessage(ContextMenuItemTagNoAction)); -} - -ContextMenuItem::ContextMenuItem(ContextMenuItemType type, ContextMenuAction action, - const String& title, ContextMenu* subMenu) -{ - if (type == ActionType) - m_platformDescription = new BMenuItem(BString(title).String(), new BMessage(action)); - else if (type == SeparatorType) - m_platformDescription = new BSeparatorItem(); - else { - m_platformDescription = new BMenuItem(subMenu->platformDescription(), new BMessage(action)); - m_platformDescription->SetLabel(BString(title).String()); - } -} - -ContextMenuItem::~ContextMenuItem() -{ - delete m_platformDescription; -} - -PlatformMenuItemDescription ContextMenuItem::releasePlatformDescription() -{ - BMenuItem* item = m_platformDescription; - m_platformDescription = NULL; - return item; -} - -ContextMenuItemType ContextMenuItem::type() const -{ - if (dynamic_cast(m_platformDescription)) - return SeparatorType; - if (m_platformDescription->Submenu()) - return SubmenuType; - return ActionType; -} - -void ContextMenuItem::setType(ContextMenuItemType type) -{ - ContextMenuAction theAction = action(); - String theTitle = title(); - BMenu* subMenu = platformSubMenu(); - delete m_platformDescription; - - if (type == ActionType) - m_platformDescription = new BMenuItem(BString(theTitle).String(), new BMessage(theAction)); - else if (type == SeparatorType) - m_platformDescription = new BSeparatorItem(); - else { - if (subMenu) { - m_platformDescription = new BMenuItem(subMenu, new BMessage(theAction)); - m_platformDescription->SetLabel(BString(theTitle).String()); - } else - m_platformDescription = new BMenuItem(BString(theTitle).String(), new BMessage(theAction)); - } -} - -ContextMenuAction ContextMenuItem::action() const -{ - if (!m_platformDescription) - return ContextMenuItemTagNoAction; - return static_cast(m_platformDescription->Message()->what); -} - -void ContextMenuItem::setAction(ContextMenuAction action) -{ - if (m_platformDescription) - m_platformDescription->Message()->what = action; -} - -String ContextMenuItem::title() const -{ - if (m_platformDescription) - return ""; - return BString(m_platformDescription->Label()); -} - -void ContextMenuItem::setTitle(const String& title) -{ - // FIXME: We need to find a better way to convert WebKit Strings into c strings - m_platformDescription->SetLabel(BString(title).String()); -} - -PlatformMenuDescription ContextMenuItem::platformSubMenu() const -{ - return m_platformDescription->Submenu(); -} - -void ContextMenuItem::setSubMenu(ContextMenu* menu) -{ - // FIXME: We assume m_platformDescription is valid - const char* title = m_platformDescription->Label(); - delete m_platformDescription; - m_platformDescription = new BMenuItem(menu->platformDescription(), new BMessage(action())); - m_platformDescription->SetLabel(title); -} - -void ContextMenuItem::setChecked(bool checked) -{ - if (m_platformDescription) - m_platformDescription->SetMarked(checked); -} - -void ContextMenuItem::setEnabled(bool enable) -{ - if (m_platformDescription) - m_platformDescription->SetEnabled(enable); -} - -bool ContextMenuItem::enabled() const -{ - if (!m_platformDescription) - return true; - return m_platformDescription->IsEnabled(); -} - diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/CookieJarHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/haiku/CookieJarHaiku.cpp deleted file mode 100644 index 73519d7..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/CookieJarHaiku.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2006 George Staikos - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "CookieJar.h" - -#include "KURL.h" -#include "PlatformString.h" -#include "StringHash.h" - -#include - - -namespace WebCore { - -// FIXME: Shouldn't this be saved to and restored from disk too? -static HashMap cookieJar; - -void setCookies(const KURL& url, const KURL& /*policyURL*/, const String& value) -{ - cookieJar.set(url.string(), value); -} - -String cookies(const KURL& url) -{ - return cookieJar.get(url.string()); -} - -bool cookiesEnabled() -{ - // FIXME: This should probably be a setting - return true; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/CursorHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/haiku/CursorHaiku.cpp deleted file mode 100644 index 7f010d5..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/CursorHaiku.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "Cursor.h" - -#include "NotImplemented.h" - -#include - - -namespace WebCore { - -Cursor::Cursor(PlatformCursor cursor) - : m_impl(cursor) -{ -} - -Cursor::Cursor(const Cursor& other) - : m_impl(other.m_impl) -{ -} - -Cursor::~Cursor() -{ -} - -Cursor::Cursor(Image*, const IntPoint&) -{ - notImplemented(); -} - -Cursor& Cursor::operator=(const Cursor& other) -{ - m_impl = other.m_impl; - return *this; -} - -static Cursor globalCursor = const_cast(B_CURSOR_SYSTEM_DEFAULT); -static Cursor ibeamCursor = const_cast(B_CURSOR_I_BEAM); - -const Cursor& pointerCursor() -{ - return globalCursor; -} - -const Cursor& moveCursor() -{ - return globalCursor; -} - -const Cursor& crossCursor() -{ - return globalCursor; -} - -const Cursor& handCursor() -{ - return globalCursor; -} - -const Cursor& iBeamCursor() -{ - return ibeamCursor; -} - -const Cursor& waitCursor() -{ - return globalCursor; -} - -const Cursor& helpCursor() -{ - return globalCursor; -} - -const Cursor& eastResizeCursor() -{ - return globalCursor; -} - -const Cursor& northResizeCursor() -{ - return globalCursor; -} - -const Cursor& northEastResizeCursor() -{ - return globalCursor; -} - -const Cursor& northWestResizeCursor() -{ - return globalCursor; -} - -const Cursor& southResizeCursor() -{ - return globalCursor; -} - -const Cursor& southEastResizeCursor() -{ - return globalCursor; -} - -const Cursor& southWestResizeCursor() -{ - return globalCursor; -} - -const Cursor& westResizeCursor() -{ - return globalCursor; -} - -const Cursor& northSouthResizeCursor() -{ - return globalCursor; -} - -const Cursor& eastWestResizeCursor() -{ - return globalCursor; -} - -const Cursor& northEastSouthWestResizeCursor() -{ - return globalCursor; -} - -const Cursor& northWestSouthEastResizeCursor() -{ - return globalCursor; -} - -const Cursor& columnResizeCursor() -{ - return globalCursor; -} - -const Cursor& rowResizeCursor() -{ - return globalCursor; -} - -const Cursor& verticalTextCursor() -{ - return globalCursor; -} - -const Cursor& cellCursor() -{ - return globalCursor; -} - -const Cursor& contextMenuCursor() -{ - return globalCursor; -} - -const Cursor& noDropCursor() -{ - return globalCursor; -} - -const Cursor& copyCursor() -{ - return globalCursor; -} - -const Cursor& progressCursor() -{ - return globalCursor; -} - -const Cursor& aliasCursor() -{ - return globalCursor; -} - -const Cursor& noneCursor() -{ - return globalCursor; -} - -const Cursor& notAllowedCursor() -{ - return globalCursor; -} - -const Cursor& zoomInCursor() -{ - return globalCursor; -} - -const Cursor& zoomOutCursor() -{ - return globalCursor; -} - -const Cursor& grabCursor() -{ - return globalCursor; -} - -const Cursor& grabbingCursor() -{ - return globalCursor; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/DragDataHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/haiku/DragDataHaiku.cpp deleted file mode 100644 index b42b311..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/DragDataHaiku.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "DragData.h" - -#include "Document.h" -#include "DocumentFragment.h" -#include "ClipboardHaiku.h" - -#include "NotImplemented.h" - - -namespace WebCore { - -bool DragData::canSmartReplace() const -{ - notImplemented(); - return false; -} - -bool DragData::containsColor() const -{ - notImplemented(); - return false; -} - -bool DragData::containsFiles() const -{ - notImplemented(); - return false; -} - -void DragData::asFilenames(Vector& result) const -{ - notImplemented(); -} - -bool DragData::containsPlainText() const -{ - notImplemented(); - return false; -} - -String DragData::asPlainText() const -{ - notImplemented(); - return String(); -} - -Color DragData::asColor() const -{ - notImplemented(); - return Color(); -} - -WTF::PassRefPtr DragData::createClipboard(ClipboardAccessPolicy policy) const -{ - return new ClipboardHaiku(policy, true); -} - -bool DragData::containsCompatibleContent() const -{ - return containsColor() || containsURL() || containsPlainText(); -} - -bool DragData::containsURL() const -{ - notImplemented(); - return false; -} - -String DragData::asURL(String* title) const -{ - notImplemented(); - return String(); -} - -PassRefPtr DragData::asFragment(Document*) const -{ - notImplemented(); - return 0; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/DragImageHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/haiku/DragImageHaiku.cpp deleted file mode 100644 index 17a79f4..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/DragImageHaiku.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "DragImage.h" - -#include "CachedImage.h" -#include "Image.h" - -#include "NotImplemented.h" - - -namespace WebCore { - -IntSize dragImageSize(DragImageRef) -{ - notImplemented(); - return IntSize(0, 0); -} - -void deleteDragImage(DragImageRef) -{ - notImplemented(); -} - -DragImageRef scaleDragImage(DragImageRef image, FloatSize) -{ - notImplemented(); - return image; -} - -DragImageRef dissolveDragImageToFraction(DragImageRef image, float) -{ - notImplemented(); - return image; -} - -DragImageRef createDragImageFromImage(Image*) -{ - notImplemented(); - return 0; -} - -DragImageRef createDragImageIconForCachedImage(CachedImage*) -{ - notImplemented(); - return 0; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/EventLoopHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/haiku/EventLoopHaiku.cpp deleted file mode 100644 index 4750e6f..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/EventLoopHaiku.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2009 Maxime Simon - * - * 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. ``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 - * 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 "config.h" -#include "EventLoop.h" - -#include - - -namespace WebCore { - -void EventLoop::cycle() -{ - if (!be_app) - m_ended = true; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/FileChooserHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/haiku/FileChooserHaiku.cpp deleted file mode 100644 index b0e42b6..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/FileChooserHaiku.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2006 Nikolas Zimmermann - * Copyright (C) 2007 Ryan Leavengood - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#include "config.h" -#include "FileChooser.h" - -#include "NotImplemented.h" -#include "Icon.h" - - -namespace WebCore { - -FileChooser::FileChooser(FileChooserClient* client, const String& filename) - : m_client(client) - , m_filenames() - , m_icon(chooseIcon(filename)) -{ - m_filenames.append(filename); -} - -String FileChooser::basenameForWidth(const Font&, int width) const -{ - notImplemented(); - return String(); -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/FileSystemHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/haiku/FileSystemHaiku.cpp deleted file mode 100644 index 7400cd1..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/FileSystemHaiku.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "FileSystem.h" - -#include "CString.h" -#include "PlatformString.h" - -#include "NotImplemented.h" - - -namespace WebCore { - -CString fileSystemRepresentation(const String& string) -{ - return string.utf8(); -} - -String homeDirectoryPath() -{ - notImplemented(); - return String(); -} - -CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle) -{ - notImplemented(); - handle = invalidPlatformFileHandle; - return CString(); -} - -void closeFile(PlatformFileHandle&) -{ - notImplemented(); -} - -int writeToFile(PlatformFileHandle, const char* data, int length) -{ - notImplemented(); - return 0; -} - -bool unloadModule(PlatformModule) -{ - notImplemented(); - return false; -} - -Vector listDirectory(const String& path, const String& filter) -{ - Vector entries; - notImplemented(); - return entries; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/KeyboardCodes.h b/src/3rdparty/webkit/WebCore/platform/haiku/KeyboardCodes.h deleted file mode 100644 index 6f0d490..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/KeyboardCodes.h +++ /dev/null @@ -1,544 +0,0 @@ -/* - * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 KeyboardCodes_h -#define KeyboardCodes_h - - -namespace WebCore { - // VK_LBUTTON (01) Left mouse button - // VK_RBUTTON (02) Right mouse button - // VK_CANCEL (03) Control-break processing - // VK_MBUTTON (04) Middle mouse button (three-button mouse) - // VK_XBUTTON1 (05) - // VK_XBUTTON2 (06) - - // VK_BACK (08) BACKSPACE key - const int VK_BACK = 0x08; - - // VK_TAB (09) TAB key - const int VK_TAB = 0x09; - - // VK_CLEAR (0C) CLEAR key - const int VK_CLEAR = 0x0C; - - // VK_RETURN (0D) - const int VK_RETURN = 0x0D; - - // VK_SHIFT (10) SHIFT key - const int VK_SHIFT = 0x10; - - // VK_CONTROL (11) CTRL key - const int VK_CONTROL = 0x11; - - // VK_MENU (12) ALT key - const int VK_MENU = 0x12; - - // VK_PAUSE (13) PAUSE key - const int VK_PAUSE = 0x13; - - // VK_CAPITAL (14) CAPS LOCK key - const int VK_CAPITAL = 0x14; - - // VK_KANA (15) Input Method Editor (IME) Kana mode - const int VK_KANA = 0x15; - - // VK_HANGUEL (15) IME Hanguel mode (maintained for compatibility; use VK_HANGUL) - // VK_HANGUL (15) IME Hangul mode - const int VK_HANGUL = 0x15; - - // VK_JUNJA (17) IME Junja mode - const int VK_JUNJA = 0x17; - - // VK_FINAL (18) IME final mode - const int VK_FINAL = 0x18; - - // VK_HANJA (19) IME Hanja mode - const int VK_HANJA = 0x19; - - // VK_KANJI (19) IME Kanji mode - const int VK_KANJI = 0x19; - - // VK_ESCAPE (1B) ESC key - const int VK_ESCAPE = 0x1B; - - // VK_CONVERT (1C) IME convert - const int VK_CONVERT = 0x1C; - - // VK_NONCONVERT (1D) IME nonconvert - const int VK_NONCONVERT = 0x1D; - - // VK_ACCEPT (1E) IME accept - const int VK_ACCEPT = 0x1E; - - // VK_MODECHANGE (1F) IME mode change request - const int VK_MODECHANGE = 0x1F; - - // VK_SPACE (20) SPACEBAR - const int VK_SPACE = 0x20; - - // VK_PRIOR (21) PAGE UP key - const int VK_PRIOR = 0x21; - - // VK_NEXT (22) PAGE DOWN key - const int VK_NEXT = 0x22; - - // VK_END (23) END key - const int VK_END = 0x23; - - // VK_HOME (24) HOME key - const int VK_HOME = 0x24; - - // VK_LEFT (25) LEFT ARROW key - const int VK_LEFT = 0x25; - - // VK_UP (26) UP ARROW key - const int VK_UP = 0x26; - - // VK_RIGHT (27) RIGHT ARROW key - const int VK_RIGHT = 0x27; - - // VK_DOWN (28) DOWN ARROW key - const int VK_DOWN = 0x28; - - // VK_SELECT (29) SELECT key - const int VK_SELECT = 0x29; - - // VK_PRINT (2A) PRINT key - const int VK_PRINT = 0x2A; - - // VK_EXECUTE (2B) EXECUTE key - const int VK_EXECUTE = 0x2B; - - // VK_SNAPSHOT (2C) PRINT SCREEN key - const int VK_SNAPSHOT = 0x2C; - - // VK_INSERT (2D) INS key - const int VK_INSERT = 0x2D; - - // VK_DELETE (2E) DEL key - const int VK_DELETE = 0x2E; - - // VK_HELP (2F) HELP key - const int VK_HELP = 0x2F; - - // (30) 0 key - const int VK_0 = 0x30; - - // (31) 1 key - const int VK_1 = 0x31; - - // (32) 2 key - const int VK_2 = 0x32; - - // (33) 3 key - const int VK_3 = 0x33; - - // (34) 4 key - const int VK_4 = 0x34; - - // (35) 5 key; - - const int VK_5 = 0x35; - - // (36) 6 key - const int VK_6 = 0x36; - - // (37) 7 key - const int VK_7 = 0x37; - - // (38) 8 key - const int VK_8 = 0x38; - - // (39) 9 key - const int VK_9 = 0x39; - - // (41) A key - const int VK_A = 0x41; - - // (42) B key - const int VK_B = 0x42; - - // (43) C key - const int VK_C = 0x43; - - // (44) D key - const int VK_D = 0x44; - - // (45) E key - const int VK_E = 0x45; - - // (46) F key - const int VK_F = 0x46; - - // (47) G key - const int VK_G = 0x47; - - // (48) H key - const int VK_H = 0x48; - - // (49) I key - const int VK_I = 0x49; - - // (4A) J key - const int VK_J = 0x4A; - - // (4B) K key - const int VK_K = 0x4B; - - // (4C) L key - const int VK_L = 0x4C; - - // (4D) M key - const int VK_M = 0x4D; - - // (4E) N key - const int VK_N = 0x4E; - - // (4F) O key - const int VK_O = 0x4F; - - // (50) P key - const int VK_P = 0x50; - - // (51) Q key - const int VK_Q = 0x51; - - // (52) R key - const int VK_R = 0x52; - - // (53) S key - const int VK_S = 0x53; - - // (54) T key - const int VK_T = 0x54; - - // (55) U key - const int VK_U = 0x55; - - // (56) V key - const int VK_V = 0x56; - - // (57) W key - const int VK_W = 0x57; - - // (58) X key - const int VK_X = 0x58; - - // (59) Y key - const int VK_Y = 0x59; - - // (5A) Z key - const int VK_Z = 0x5A; - - // VK_LWIN (5B) Left Windows key (Microsoft Natural keyboard) - const int VK_LWIN = 0x5B; - - // VK_RWIN (5C) Right Windows key (Natural keyboard) - const int VK_RWIN = 0x5C; - - // VK_APPS (5D) Applications key (Natural keyboard) - const int VK_APPS = 0x5D; - - // VK_SLEEP (5F) Computer Sleep key - const int VK_SLEEP = 0x5F; - - // VK_NUMPAD0 (60) Numeric keypad 0 key - const int VK_NUMPAD0 = 0x60; - - // VK_NUMPAD1 (61) Numeric keypad 1 key - const int VK_NUMPAD1 = 0x61; - - // VK_NUMPAD2 (62) Numeric keypad 2 key - const int VK_NUMPAD2 = 0x62; - - // VK_NUMPAD3 (63) Numeric keypad 3 key - const int VK_NUMPAD3 = 0x63; - - // VK_NUMPAD4 (64) Numeric keypad 4 key - const int VK_NUMPAD4 = 0x64; - - // VK_NUMPAD5 (65) Numeric keypad 5 key - const int VK_NUMPAD5 = 0x65; - - // VK_NUMPAD6 (66) Numeric keypad 6 key - const int VK_NUMPAD6 = 0x66; - - // VK_NUMPAD7 (67) Numeric keypad 7 key - const int VK_NUMPAD7 = 0x67; - - // VK_NUMPAD8 (68) Numeric keypad 8 key - const int VK_NUMPAD8 = 0x68; - - // VK_NUMPAD9 (69) Numeric keypad 9 key - const int VK_NUMPAD9 = 0x69; - - // VK_MULTIPLY (6A) Multiply key - const int VK_MULTIPLY = 0x6A; - - // VK_ADD (6B) Add key - const int VK_ADD = 0x6B; - - // VK_SEPARATOR (6C) Separator key - const int VK_SEPARATOR = 0x6C; - - // VK_SUBTRACT (6D) Subtract key - const int VK_SUBTRACT = 0x6D; - - // VK_DECIMAL (6E) Decimal key - const int VK_DECIMAL = 0x6E; - - // VK_DIVIDE (6F) Divide key - const int VK_DIVIDE = 0x6F; - - // VK_F1 (70) F1 key - const int VK_F1 = 0x70; - - // VK_F2 (71) F2 key - const int VK_F2 = 0x71; - - // VK_F3 (72) F3 key - const int VK_F3 = 0x72; - - // VK_F4 (73) F4 key - const int VK_F4 = 0x73; - - // VK_F5 (74) F5 key - const int VK_F5 = 0x74; - - // VK_F6 (75) F6 key - const int VK_F6 = 0x75; - - // VK_F7 (76) F7 key - const int VK_F7 = 0x76; - - // VK_F8 (77) F8 key - const int VK_F8 = 0x77; - - // VK_F9 (78) F9 key - const int VK_F9 = 0x78; - - // VK_F10 (79) F10 key - const int VK_F10 = 0x79; - - // VK_F11 (7A) F11 key - const int VK_F11 = 0x7A; - - // VK_F12 (7B) F12 key - const int VK_F12 = 0x7B; - - // VK_F13 (7C) F13 key - const int VK_F13 = 0x7C; - - // VK_F14 (7D) F14 key - const int VK_F14 = 0x7D; - - // VK_F15 (7E) F15 key - const int VK_F15 = 0x7E; - - // VK_F16 (7F) F16 key - const int VK_F16 = 0x7F; - - // VK_F17 (80H) F17 key - const int VK_F17 = 0x80; - - // VK_F18 (81H) F18 key - const int VK_F18 = 0x81; - - // VK_F19 (82H) F19 key - const int VK_F19 = 0x82; - - // VK_F20 (83H) F20 key - const int VK_F20 = 0x83; - - // VK_F21 (84H) F21 key - const int VK_F21 = 0x84; - - // VK_F22 (85H) F22 key - const int VK_F22 = 0x85; - - // VK_F23 (86H) F23 key - const int VK_F23 = 0x86; - - // VK_F24 (87H) F24 key - const int VK_F24 = 0x87; - - // VK_NUMLOCK (90) NUM LOCK key - const int VK_NUMLOCK = 0x90; - - // VK_SCROLL (91) SCROLL LOCK key - const int VK_SCROLL = 0x91; - - // VK_LSHIFT (A0) Left SHIFT key - const int VK_LSHIFT = 0xA0; - - // VK_RSHIFT (A1) Right SHIFT key - const int VK_RSHIFT = 0xA1; - - // VK_LCONTROL (A2) Left CONTROL key - const int VK_LCONTROL = 0xA2; - - // VK_RCONTROL (A3) Right CONTROL key - const int VK_RCONTROL = 0xA3; - - // VK_LMENU (A4) Left MENU key - const int VK_LMENU = 0xA4; - - // VK_RMENU (A5) Right MENU key - const int VK_RMENU = 0xA5; - - // VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key - const int VK_BROWSER_BACK = 0xA6; - - // VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key - const int VK_BROWSER_FORWARD = 0xA7; - - // VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key - const int VK_BROWSER_REFRESH = 0xA8; - - // VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key - const int VK_BROWSER_STOP = 0xA9; - - // VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key - const int VK_BROWSER_SEARCH = 0xAA; - - // VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key - const int VK_BROWSER_FAVORITES = 0xAB; - - // VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key - const int VK_BROWSER_HOME = 0xAC; - - // VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key - const int VK_VOLUME_MUTE = 0xAD; - - // VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key - const int VK_VOLUME_DOWN = 0xAE; - - // VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key - const int VK_VOLUME_UP = 0xAF; - - // VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key - const int VK_MEDIA_NEXT_TRACK = 0xB0; - - // VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key - const int VK_MEDIA_PREV_TRACK = 0xB1; - - // VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key - const int VK_MEDIA_STOP = 0xB2; - - // VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key - const int VK_MEDIA_PLAY_PAUSE = 0xB3; - - // VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key - const int VK_MEDIA_LAUNCH_MAIL = 0xB4; - - // VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key - const int VK_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5; - - // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key - const int VK_MEDIA_LAUNCH_APP1 = 0xB6; - - // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key - const int VK_MEDIA_LAUNCH_APP2 = 0xB7; - - // VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key - const int VK_OEM_1 = 0xBA; - - // VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key - const int VK_OEM_PLUS = 0xBB; - - // VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key - const int VK_OEM_COMMA = 0xBC; - - // VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key - const int VK_OEM_MINUS = 0xBD; - - // VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key - const int VK_OEM_PERIOD = 0xBE; - - // VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key - const int VK_OEM_2 = 0xBF; - - // VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key - const int VK_OEM_3 = 0xC0; - - // VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key - const int VK_OEM_4 = 0xDB; - - // VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key - const int VK_OEM_5 = 0xDC; - - // VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key - const int VK_OEM_6 = 0xDD; - - // VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key - const int VK_OEM_7 = 0xDE; - - // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard. - const int VK_OEM_8 = 0xDF; - - // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard - const int VK_OEM_102 = 0xE2; - - // VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key - const int VK_PROCESSKEY = 0xE5; - - // VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP - const int VK_PACKET = 0xE7; - - // VK_ATTN (F6) Attn key - const int VK_ATTN = 0xF6; - - // VK_CRSEL (F7) CrSel key - const int VK_CRSEL = 0xF7; - - // VK_EXSEL (F8) ExSel key - const int VK_EXSEL = 0xF8; - - // VK_EREOF (F9) Erase EOF key - const int VK_EREOF = 0xF9; - - // VK_PLAY (FA) Play key - const int VK_PLAY = 0xFA; - - // VK_ZOOM (FB) Zoom key - const int VK_ZOOM = 0xFB; - - // VK_NONAME (FC) Reserved for future use - const int VK_NONAME = 0xFC; - - // VK_PA1 (FD) PA1 key - const int VK_PA1 = 0xFD; - - // VK_OEM_CLEAR (FE) Clear key - const int VK_OEM_CLEAR = 0xFE; - - const int VK_UNKNOWN = 0; -} // namespace WebCore - -#endif // KeyboardCodes_h diff --git a/src/3rdparty/webkit/WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp deleted file mode 100644 index 59ae19a..0000000 --- a/src/3rdparty/webkit/WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (C) 2006 Zack Rusin - * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. - * Copyright (C) 2007 Trolltech ASA - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "MIMETypeRegistry.h" - -#include "PlatformString.h" - - -namespace WebCore { -struct ExtensionMap { - const char* extension; - const char* mimeType; -}; - -static const ExtensionMap extensionMap [] = { - { "bmp", "image/bmp" }, - { "gif", "image/gif" }, - { "html", "text/html" }, - { "ico", "image/x-icon" }, - { "jpeg", "image/jpeg" }, - { "jpg", "image/jpeg" }, - { "js", "application/x-javascript" }, - { "pdf", "application/pdf" }, - { "png", "image/png" }, - { "rss", "application/rss+xml" }, - { "svg", "image/svg+xml" }, - { "text", "text/plain" }, - { "txt", "text/plain" }, - { "xbm", "image/x-xbitmap" }, - { "xml", "text/xml" }, - { "xsl", "text/xsl" }, - { "xhtml", "application/xhtml+xml" }, - { 0, 0 } -}; - -// FIXME: Use the Haiku MIME registry -String MIMETypeRegistry::getMIMETypeForExtension(const String &ext) -{ - String str = ext.lower(); - const ExtensionMap *extMap = extensionMap; - while (extMap->extension) { - if (str == extMap->extension) - return extMap->mimeType; - ++extMap; - } - // unknown, let's just assume plain text - return "text/plain"; -} -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp deleted file mode 100644 index 3542cc2..0000000 --- a/src/3rdparty/webkit/WebCore/platform/image-decoders/haiku/ImageDecoderHaiku.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (C) 2006 Apple Computer, 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "ImageDecoder.h" - -#include - - -namespace WebCore { - -RGBA32Buffer::RGBA32Buffer() - : m_hasAlpha(false) - , m_status(FrameEmpty) - , m_duration(0) - , m_disposalMethod(DisposeNotSpecified) -{ -} - -void RGBA32Buffer::clear() -{ - m_bytes.clear(); - m_status = FrameEmpty; - // NOTE: Do not reset other members here; clearFrameBufferCache() - // calls this to free the bitmap data, but other functions like - // initFrameBuffer() and frameComplete() may still need to read - // other metadata out of this frame later. -} - -void RGBA32Buffer::zeroFill() -{ - m_bytes.fill(0); - m_hasAlpha = true; -} - -void RGBA32Buffer::copyBitmapData(const RGBA32Buffer& other) -{ - if (this == &other) - return; - - m_bytes = other.m_bytes; - setHasAlpha(other.m_hasAlpha); -} - -bool RGBA32Buffer::setSize(int newWidth, int newHeight) -{ - // NOTE: This has no way to check for allocation failure if the - // requested size was too big... - m_bytes.resize(newWidth * newHeight); - m_size = IntSize(newWidth, newHeight); - - // Zero the image. - zeroFill(); - - return true; -} - -NativeImagePtr RGBA32Buffer::asNewNativeImage() const -{ - const void* bytes = m_bytes.data(); - - BBitmap* bmp = new BBitmap(BRect(0, 0, width(), height()), B_RGB32); - bmp->SetBits(bytes, m_size.width() * m_size.height(), 0, B_RGB32); - - return bmp; -} - -bool RGBA32Buffer::hasAlpha() const -{ - return m_hasAlpha; -} - -void RGBA32Buffer::setHasAlpha(bool alpha) -{ - m_hasAlpha = alpha; -} - -void RGBA32Buffer::setStatus(FrameStatus status) -{ - m_status = status; -} - -RGBA32Buffer& RGBA32Buffer::operator=(const RGBA32Buffer& other) -{ - if (this == &other) - return *this; - - m_bytes = other.m_bytes; - m_size = other.m_size; - setHasAlpha(other.hasAlpha()); - setRect(other.rect()); - setStatus(other.status()); - setDuration(other.duration()); - setDisposalMethod(other.disposalMethod()); - return *this; -} - -int RGBA32Buffer::width() const -{ - return m_size.width(); -} - -int RGBA32Buffer::height() const -{ - return m_size.height(); -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/network/ResourceHandle.h b/src/3rdparty/webkit/WebCore/platform/network/ResourceHandle.h index f0e1e94..4cb3561 100644 --- a/src/3rdparty/webkit/WebCore/platform/network/ResourceHandle.h +++ b/src/3rdparty/webkit/WebCore/platform/network/ResourceHandle.h @@ -191,12 +191,6 @@ public: void fireFailure(Timer*); private: -#if USE(SOUP) - bool startData(String urlString); - bool startHttp(String urlString); - bool startGio(KURL url); -#endif - void scheduleFailure(FailureType); bool start(Frame*); diff --git a/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromium.cpp b/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromium.cpp deleted file mode 100644 index fdb50d0..0000000 --- a/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromium.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (C) 2009 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER OR 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 "config.h" -#include "SQLiteFileSystem.h" - -#include "ChromiumBridge.h" -#include "CString.h" -#include "SQLiteDatabase.h" -#include - -#ifndef SQLITE_OPEN_FULLMUTEX -#define SQLITE_OPEN_FULLMUTEX 0x00010000 -#endif - -// SQLiteFileSystem::registerSQLiteVFS() is implemented in the -// platform-specific files SQLiteFileSystemChromium{Win|Posix}.cpp -namespace WebCore { - -SQLiteFileSystem::SQLiteFileSystem() -{ -} - -int SQLiteFileSystem::openDatabase(const String& fileName, sqlite3** database) -{ - // open databases using Chromium's VFS - return sqlite3_open_v2(fileName.utf8().data(), database, - SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX, - "chromium_vfs"); -} - -String SQLiteFileSystem::getFileNameForNewDatabase( - const String&, const String& dbName, const String &originIdentifier, SQLiteDatabase*) -{ - // Chromium names DB files based on origin and DB name only - return originIdentifier + "_" + dbName + ".db"; -} - -String SQLiteFileSystem::appendDatabaseFileNameToPath(const String&, const String& fileName) -{ - // Chromium saves all DB files in the same directory (known by - // the browser process only); as far as the renderer processes - // are concerned, all DB files are saved in the "current" directory - return fileName; -} - -bool SQLiteFileSystem::ensureDatabaseDirectoryExists(const String&) -{ - // if the directory where Chromium stores the databases does not exist, - // it will be automatically created by the browser process; - // so as far as the WebKit code is concerned, this directory always exists - return true; -} - -bool SQLiteFileSystem::ensureDatabaseFileExists(const String&, bool) -{ - // all database directories will be created as needed by the browser process - return true; -} - -bool SQLiteFileSystem::deleteEmptyDatabaseDirectory(const String&) -{ - // Chromium does not use a separate directory for each database, - // so there's nothing to do here - return true; -} - -bool SQLiteFileSystem::deleteDatabaseFile(const String& fileName) -{ - // return true if and only if the error code returned by - // ChromiumBridge::deleteDatabase() is 0 - return (!ChromiumBridge::databaseDeleteFile(fileName)); -} - -long long SQLiteFileSystem::getDatabaseFileSize(const String& fileName) -{ - return ChromiumBridge::databaseGetFileSize(fileName); -} - -} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumLinux.cpp b/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumLinux.cpp deleted file mode 100644 index e0a8236..0000000 --- a/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumLinux.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2009 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER OR 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 "config.h" -#include "SQLiteFileSystem.h" - -namespace WebCore { - -void SQLiteFileSystem::registerSQLiteVFS() -{ - // stub for registering Chromium's SQLite VFS for Linux -} - -} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumMac.cpp b/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumMac.cpp deleted file mode 100644 index 9551e99..0000000 --- a/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumMac.cpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2009 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER OR 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 "config.h" -#include "SQLiteFileSystem.h" - -namespace WebCore { - -void SQLiteFileSystem::registerSQLiteVFS() -{ - // stub for registering Chromium's SQLite VFS for Mac -} - -} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp b/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp deleted file mode 100644 index 8de35b6..0000000 --- a/src/3rdparty/webkit/WebCore/platform/sql/chromium/SQLiteFileSystemChromiumWin.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (C) 2009 Google 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: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * 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. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT - * OWNER OR 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 "config.h" -#include "SQLiteFileSystem.h" - -#include "ChromiumBridge.h" -#include -#include - -// Defined in Chromium's codebase in third_party/sqlite/src/os_win.c -extern "C" { -int chromium_sqlite3_initialize_win_sqlite3_file(sqlite3_file* file, HANDLE handle); -} - -// Chromium's Windows implementation of SQLite VFS -namespace { - -// Opens a file. -// -// vfs - pointer to the sqlite3_vfs object. -// fileName - the name of the file. -// id - the structure that will manipulate the newly opened file. -// desiredFlags - the desired open mode flags. -// usedFlags - the actual open mode flags that were used. -int chromiumOpen(sqlite3_vfs*, const char* fileName, - sqlite3_file* id, int desiredFlags, int* usedFlags) -{ - HANDLE h = WebCore::ChromiumBridge::databaseOpenFile(fileName, desiredFlags); - if (h == INVALID_HANDLE_VALUE) { - if (desiredFlags & SQLITE_OPEN_READWRITE) { - int newFlags = (desiredFlags | SQLITE_OPEN_READONLY) & ~SQLITE_OPEN_READWRITE; - return chromiumOpen(0, fileName, id, newFlags, usedFlags); - } else - return SQLITE_CANTOPEN; - } - if (usedFlags) { - if (desiredFlags & SQLITE_OPEN_READWRITE) - *usedFlags = SQLITE_OPEN_READWRITE; - else - *usedFlags = SQLITE_OPEN_READONLY; - } - - chromium_sqlite3_initialize_win_sqlite3_file(id, h); - return SQLITE_OK; -} - -// Deletes the given file. -// -// vfs - pointer to the sqlite3_vfs object. -// fileName - the name of the file. -// syncDir - determines if the directory to which this file belongs -// should be synched after the file is deleted. -int chromiumDelete(sqlite3_vfs*, const char* fileName, int) -{ - bool deleted = WebCore::ChromiumBridge::databaseDeleteFile(fileName); - DWORD rc = WebCore::ChromiumBridge::databaseGetFileAttributes(fileName); - return ((rc == INVALID_FILE_ATTRIBUTES) && deleted ? - SQLITE_OK : SQLITE_IOERR_DELETE); -} - -// Check the existance and status of the given file. -// -// vfs - pointer to the sqlite3_vfs object. -// fileName - the name of the file. -// flag - the type of test to make on this file. -// res - the result. -int chromiumAccess(sqlite3_vfs*, const char* fileName, int flag, int* res) -{ - DWORD attr = WebCore::ChromiumBridge::databaseGetFileAttributes(fileName); - switch (flag) { - case SQLITE_ACCESS_READ: - case SQLITE_ACCESS_EXISTS: - *res = (attr != INVALID_FILE_ATTRIBUTES); - break; - case SQLITE_ACCESS_READWRITE: - *res = ((attr & FILE_ATTRIBUTE_READONLY) == 0); - break; - default: - return SQLITE_ERROR; - } - - return SQLITE_OK; -} - -// Turns a relative pathname into a full pathname. -// -// vfs - pointer to the sqlite3_vfs object. -// relativePath - the relative path. -// bufSize - the size of the output buffer in bytes. -// absolutePath - the output buffer where the absolute path will be stored. -int chromiumFullPathname(sqlite3_vfs* vfs, const char* relativePath, - int, char* absolutePath) -{ - // The renderer process doesn't need to know the absolute path of the file - sqlite3_snprintf(vfs->mxPathname, absolutePath, "%s", relativePath); - return SQLITE_OK; -} - -#ifndef SQLITE_OMIT_LOAD_EXTENSION -// Returns NULL, thus disallowing loading libraries in the renderer process. -// -// vfs - pointer to the sqlite3_vfs object. -// fileName - the name of the shared library file. -void* chromiumDlOpen(sqlite3_vfs*, const char*) -{ - return 0; -} -#else -#define chromiumDlOpen 0 -#endif // SQLITE_OMIT_LOAD_EXTENSION - -} // namespace - -namespace WebCore { - -void SQLiteFileSystem::registerSQLiteVFS() -{ - sqlite3_vfs* win32_vfs = sqlite3_vfs_find("win32"); - static sqlite3_vfs chromium_vfs = { - 1, - win32_vfs->szOsFile, - win32_vfs->mxPathname, - 0, - "chromium_vfs", - 0, - chromiumOpen, - chromiumDelete, - chromiumAccess, - chromiumFullPathname, - chromiumDlOpen, - win32_vfs->xDlError, - win32_vfs->xDlSym, - win32_vfs->xDlClose, - win32_vfs->xRandomness, - win32_vfs->xSleep, - win32_vfs->xCurrentTime, - win32_vfs->xGetLastError - }; - sqlite3_vfs_register(&chromium_vfs, 1); -} - -} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/platform/text/haiku/StringHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/text/haiku/StringHaiku.cpp deleted file mode 100644 index 9e0fd3f..0000000 --- a/src/3rdparty/webkit/WebCore/platform/text/haiku/StringHaiku.cpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "CString.h" - -#include "PlatformString.h" - -#include - - -namespace WebCore { - -// String conversions -String::String(const BString& str) -{ - m_impl = String::fromUTF8(str.String(), str.Length()).impl(); -} - -String::operator BString() const -{ - BString string; - string.SetTo(utf8().data()); - - return string; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/platform/text/haiku/TextBreakIteratorInternalICUHaiku.cpp b/src/3rdparty/webkit/WebCore/platform/text/haiku/TextBreakIteratorInternalICUHaiku.cpp deleted file mode 100644 index 2c732d6..0000000 --- a/src/3rdparty/webkit/WebCore/platform/text/haiku/TextBreakIteratorInternalICUHaiku.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#include "config.h" -#include "TextBreakIteratorInternalICU.h" - -#include "NotImplemented.h" - - -namespace WebCore { - -const char* currentTextBreakLocaleID() -{ - notImplemented(); - return "en_us"; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebCore/storage/wince/DatabaseThreadWince.cpp b/src/3rdparty/webkit/WebCore/storage/wince/DatabaseThreadWince.cpp deleted file mode 100644 index d81145d..0000000 --- a/src/3rdparty/webkit/WebCore/storage/wince/DatabaseThreadWince.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (C) 2009 Torch Mobile, 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 library is distributed in the hope that i will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "DatabaseThread.h" - -#include "Database.h" -#include "DatabaseTask.h" - -namespace WebCore { - -DatabaseThread::DatabaseThread() -: m_timer(this, &DatabaseThread::timerFired) -{ -} - -DatabaseThread::~DatabaseThread() -{ -} - -void DatabaseThread::requestTermination() -{ - m_queue.clear(); -} - -bool DatabaseThread::terminationRequested() const -{ - return m_queue.isEmpty(); -} - -void DatabaseThread::timerFired(Timer*) -{ - if (!m_queue.isEmpty()) { - RefPtr task = m_queue.first(); - task->performTask(); - m_queue.removeFirst(); - if (!m_queue.isEmpty()) - m_timer.startOneShot(0); - } -} - -void DatabaseThread::scheduleTask(PassRefPtr task) -{ - m_queue.append(task); - if (!m_timer.isActive()) - m_timer.startOneShot(0); -} - -void DatabaseThread::scheduleImmediateTask(PassRefPtr task) -{ - task->performTask(); -} - -void DatabaseThread::unscheduleDatabaseTasks(Database* database) -{ - Deque > reservedTasks; - for (Deque >::const_iterator i = m_queue.begin(); i != m_queue.end(); ++i) { - if ((*i)->database() != database) - reservedTasks.append(*i); - } - - m_queue.swap(reservedTasks); -} - -void DatabaseThread::recordDatabaseOpen(Database* database) -{ - notImplemented(); -} - -void DatabaseThread::recordDatabaseClosed(Database* database) -{ - notImplemented(); -} - -} // namespace WebCore diff --git a/src/3rdparty/webkit/WebCore/storage/wince/DatabaseThreadWince.h b/src/3rdparty/webkit/WebCore/storage/wince/DatabaseThreadWince.h deleted file mode 100644 index fafc791..0000000 --- a/src/3rdparty/webkit/WebCore/storage/wince/DatabaseThreadWince.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (C) 2009 Torch Mobile, 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 library is distributed in the hope that i will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#ifndef DatabaseThreadWince_h -#define DatabaseThreadWince_h - -#include -#include - -namespace WebCore { - - class Database; - class DatabaseTask; - - class DatabaseThread: public WTF::RefCounted { - - public: - static PassRefPtr create() { return adoptRef(new DatabaseThread); } - ~DatabaseThread(); - - bool start() { return true; } - void requestTermination(); - bool terminationRequested() const; - - void scheduleTask(PassRefPtr); - void scheduleImmediateTask(PassRefPtr); - void unscheduleDatabaseTasks(Database*); - void recordDatabaseOpen(Database*); - void recordDatabaseClosed(Database*); -#ifndef NDEBUG - ThreadIdentifier getThreadID() const { return currentThread(); } -#endif - - private: - DatabaseThread(); - - void timerFired(Timer*); - - Deque > m_queue; - Timer m_timer; - }; - -} // namespace WebCore - -#endif // DatabaseThreadWince diff --git a/src/3rdparty/webkit/WebCore/storage/wince/LocalStorageThreadWince.cpp b/src/3rdparty/webkit/WebCore/storage/wince/LocalStorageThreadWince.cpp deleted file mode 100644 index 8dcb902..0000000 --- a/src/3rdparty/webkit/WebCore/storage/wince/LocalStorageThreadWince.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (C) 2009 Torch Mobile, 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 library is distributed in the hope that i will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - -#include "config.h" -#include "LocalStorageThread.h" - -#include "LocalStorageTask.h" -#include "StorageAreaSync.h" - -namespace WebCore { - -LocalStorageThread::LocalStorageThread() -: m_timer(this, &LocalStorageThread::timerFired) -{ -} - -LocalStorageThread::~LocalStorageThread() -{ -} - -bool LocalStorageThread::start() -{ - return true; -} - -void LocalStorageThread::timerFired(Timer*) -{ - if (!m_queue.isEmpty()) { - RefPtr task = m_queue.first(); - task->performTask(); - m_queue.removeFirst(); - if (!m_queue.isEmpty()) - m_timer.startOneShot(0); - } -} - -void LocalStorageThread::scheduleImport(PassRefPtr area) -{ - m_queue.append(LocalStorageTask::createImport(area)); - if (!m_timer.isActive()) - m_timer.startOneShot(0); -} - -void LocalStorageThread::scheduleSync(PassRefPtr area) -{ - m_queue.append(LocalStorageTask::createSync(area)); - if (!m_timer.isActive()) - m_timer.startOneShot(0); -} - -void LocalStorageThread::terminate() -{ - m_queue.clear(); - m_timer.stop(); -} - -void LocalStorageThread::performTerminate() -{ - m_queue.clear(); - m_timer.stop(); -} - -} diff --git a/src/3rdparty/webkit/WebCore/storage/wince/LocalStorageThreadWince.h b/src/3rdparty/webkit/WebCore/storage/wince/LocalStorageThreadWince.h deleted file mode 100644 index 300abb5..0000000 --- a/src/3rdparty/webkit/WebCore/storage/wince/LocalStorageThreadWince.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (C) 2009 Torch Mobile, 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 library is distributed in the hope that i will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public License - * along with this library; see the file COPYING.LIB. If not, write to - * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301, USA. - */ - - -#ifndef LocalStorageThreadWince_h -#define LocalStorageThreadWince_h - -#include -#include - -namespace WebCore { - - class StorageAreaSync; - class LocalStorageTask; - - class LocalStorageThread : public RefCounted { - public: - static PassRefPtr create() { return adoptRef(new LocalStorageThread); } - - ~LocalStorageThread(); - bool start(); - void scheduleImport(PassRefPtr); - void scheduleSync(PassRefPtr); - void terminate(); - void performTerminate(); - - private: - LocalStorageThread(); - - void timerFired(Timer*); - - Deque > m_queue; - Timer m_timer; - }; - -} // namespace WebCore - -#endif // LocalStorageThreadWince_h diff --git a/src/3rdparty/webkit/WebCore/svg/graphics/wince/SVGResourceFilterWince.cpp b/src/3rdparty/webkit/WebCore/svg/graphics/wince/SVGResourceFilterWince.cpp deleted file mode 100644 index d5a7dec..0000000 --- a/src/3rdparty/webkit/WebCore/svg/graphics/wince/SVGResourceFilterWince.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (C) 2009 Torch Mobile, Inc. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - aint with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "config.h" - -#if ENABLE(SVG) && ENABLE(SVG_FILTERS) -#include "SVGResourceFilter.h" -#include "NotImplemented.h" - -namespace WebCore { - -SVGResourceFilterPlatformData* SVGResourceFilter::createPlatformData() -{ - notImplemented(); - return 0; -} - -void SVGResourceFilter::prepareFilter(GraphicsContext*&, const FloatRect&) -{ - notImplemented(); -} - -void SVGResourceFilter::applyFilter(GraphicsContext*&, const FloatRect&) -{ - notImplemented(); -} - -} // namespace WebCore - -#endif diff --git a/src/3rdparty/webkit/WebCore/wml/WMLNoopElement.cpp b/src/3rdparty/webkit/WebCore/wml/WMLNoopElement.cpp index 1ba1c18..7c69ddc 100644 --- a/src/3rdparty/webkit/WebCore/wml/WMLNoopElement.cpp +++ b/src/3rdparty/webkit/WebCore/wml/WMLNoopElement.cpp @@ -53,7 +53,12 @@ void WMLNoopElement::insertedIntoDocument() if (parent->hasTagName(doTag)) { WMLDoElement* doElement = static_cast(parent); doElement->setNoop(true); - doElement->setNeedsStyleRecalc(); + + if (doElement->attached()) + doElement->detach(); + + ASSERT(!doElement->attached()); + doElement->attach(); } else if (parent->hasTagName(anchorTag)) reportWMLError(document(), WMLErrorForbiddenTaskInAnchorElement); } diff --git a/src/3rdparty/webkit/WebKit.pri b/src/3rdparty/webkit/WebKit.pri index a08a0bf..b363365 100644 --- a/src/3rdparty/webkit/WebKit.pri +++ b/src/3rdparty/webkit/WebKit.pri @@ -52,6 +52,10 @@ symbian { contains(DEFINES, QT_NO_UITOOLS): CONFIG -= uitools +# Disable a few warnings on Windows. The warnings are also +# disabled in WebKitLibraries/win/tools/vsprops/common.vsprops +win32-msvc*: QMAKE_CXXFLAGS += -wd4291 -wd4344 -wd4503 -wd4800 -wd4819 -wd4996 + # # For builds inside Qt we interpret the output rule and the input of each extra compiler manually # and add the resulting sources to the SOURCES variable, because the build inside Qt contains already diff --git a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.cpp b/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.cpp deleted file mode 100644 index 228adc7..0000000 --- a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright (C) 2006 Zack Rusin - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "ContextMenuClientHaiku.h" - -#include "ContextMenu.h" -#include "HitTestResult.h" -#include "KURL.h" - -#include "NotImplemented.h" - - -namespace WebCore { - -void ContextMenuClientHaiku::contextMenuDestroyed() -{ - notImplemented(); -} - -PlatformMenuDescription ContextMenuClientHaiku::getCustomMenuFromDefaultItems(ContextMenu* menu) -{ - return menu->platformDescription(); -} - -void ContextMenuClientHaiku::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*) -{ - notImplemented(); -} - -void ContextMenuClientHaiku::downloadURL(const KURL& url) -{ - notImplemented(); -} - -void ContextMenuClientHaiku::lookUpInDictionary(Frame*) -{ - notImplemented(); -} - -void ContextMenuClientHaiku::speak(const String&) -{ - notImplemented(); -} - -bool ContextMenuClientHaiku::isSpeaking() -{ - notImplemented(); - return false; -} - -void ContextMenuClientHaiku::stopSpeaking() -{ - notImplemented(); -} - -void ContextMenuClientHaiku::searchWithGoogle(const Frame*) -{ - notImplemented(); -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.h b/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.h deleted file mode 100644 index 756b3cf..0000000 --- a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (C) 2006 Zack Rusin - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 ContextMenuClientHaiku_h -#define ContextMenuClientHaiku_h - -#include "ContextMenuClient.h" - - -namespace WebCore { - class ContextMenu; - - class ContextMenuClientHaiku : public ContextMenuClient { - public: - virtual void contextMenuDestroyed(); - - virtual PlatformMenuDescription getCustomMenuFromDefaultItems(ContextMenu*); - virtual void contextMenuItemSelected(ContextMenuItem*, const ContextMenu*); - - virtual void downloadURL(const KURL& url); - virtual void searchWithGoogle(const Frame*); - virtual void lookUpInDictionary(Frame*); - virtual void speak(const String&); - virtual bool isSpeaking(); - virtual void stopSpeaking(); - }; -} // namespace WebCore - -#endif // ContextMenuClientHaiku_h - diff --git a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/DragClientHaiku.cpp b/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/DragClientHaiku.cpp deleted file mode 100644 index 8964c69..0000000 --- a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/DragClientHaiku.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "DragClientHaiku.h" - -#include "NotImplemented.h" - - -namespace WebCore { - -DragDestinationAction DragClientHaiku::actionMaskForDrag(DragData*) -{ - notImplemented(); - return DragDestinationActionAny; -} - -void DragClientHaiku::willPerformDragDestinationAction(DragDestinationAction, DragData*) -{ - notImplemented(); -} - -void DragClientHaiku::dragControllerDestroyed() -{ - notImplemented(); -} - -DragSourceAction DragClientHaiku::dragSourceActionMaskForPoint(const IntPoint&) -{ - notImplemented(); - return DragSourceActionAny; -} - -void DragClientHaiku::willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*) -{ - notImplemented(); -} - -void DragClientHaiku::startDrag(DragImageRef dragImage, const IntPoint&, const IntPoint&, Clipboard*, Frame*, bool) -{ - notImplemented(); -} - -DragImageRef DragClientHaiku::createDragImageForLink(KURL&, const String&, Frame*) -{ - notImplemented(); - return 0; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/DragClientHaiku.h b/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/DragClientHaiku.h deleted file mode 100644 index b184322..0000000 --- a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/DragClientHaiku.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "DragClient.h" - - -namespace WebCore { - - class DragClientHaiku : public DragClient { - public: - virtual void willPerformDragDestinationAction(DragDestinationAction, - DragData*); - virtual WebCore::DragDestinationAction actionMaskForDrag(DragData*); - virtual void dragControllerDestroyed(); - virtual DragSourceAction dragSourceActionMaskForPoint(const IntPoint&); - virtual void willPerformDragSourceAction(DragSourceAction, const IntPoint&, Clipboard*); - virtual void startDrag(DragImageRef dragImage, const IntPoint& dragImageOrigin, - const IntPoint& eventPos, Clipboard*, Frame*, bool linkDrag = false); - virtual DragImageRef createDragImageForLink(KURL&, const String& label, Frame*); - }; - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp b/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp deleted file mode 100644 index a51e361..0000000 --- a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/EditorClientHaiku.cpp +++ /dev/null @@ -1,479 +0,0 @@ -/* - * Copyright (C) 2006 Nikolas Zimmermann - * Copyright (C) 2006 Zack Rusin - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2007 Ryan Leavengood - * Copyright (C) 2007 Andrea Anzani - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 "config.h" -#include "EditorClientHaiku.h" - -#include "Document.h" -#include "Editor.h" -#include "FocusController.h" -#include "Frame.h" -#include "KeyboardCodes.h" -#include "KeyboardEvent.h" -#include "Page.h" -#include "PlatformKeyboardEvent.h" - -#include "NotImplemented.h" - - -namespace WebCore { - -EditorClientHaiku::EditorClientHaiku() - : m_editing(false) - , m_inUndoRedo(false) -{ -} - -void EditorClientHaiku::setPage(Page* page) -{ - m_page = page; -} - -void EditorClientHaiku::pageDestroyed() -{ - notImplemented(); -} - -bool EditorClientHaiku::shouldDeleteRange(Range*) -{ - notImplemented(); - return true; -} - -bool EditorClientHaiku::shouldShowDeleteInterface(HTMLElement*) -{ - notImplemented(); - return false; -} - -bool EditorClientHaiku::smartInsertDeleteEnabled() -{ - notImplemented(); - return false; -} - -bool EditorClientHaiku::isSelectTrailingWhitespaceEnabled() -{ - notImplemented(); - return false; -} - -bool EditorClientHaiku::isContinuousSpellCheckingEnabled() -{ - notImplemented(); - return false; -} - -void EditorClientHaiku::toggleContinuousSpellChecking() -{ - notImplemented(); -} - -bool EditorClientHaiku::isGrammarCheckingEnabled() -{ - notImplemented(); - return false; -} - -void EditorClientHaiku::toggleGrammarChecking() -{ - notImplemented(); -} - -int EditorClientHaiku::spellCheckerDocumentTag() -{ - notImplemented(); - return 0; -} - -bool EditorClientHaiku::isEditable() -{ - // FIXME: should be controllable - return false; -} - -bool EditorClientHaiku::shouldBeginEditing(WebCore::Range*) -{ - notImplemented(); - return true; -} - -bool EditorClientHaiku::shouldEndEditing(WebCore::Range*) -{ - notImplemented(); - return true; -} - -bool EditorClientHaiku::shouldInsertNode(Node*, Range*, EditorInsertAction) -{ - notImplemented(); - return true; -} - -bool EditorClientHaiku::shouldInsertText(const String&, Range*, EditorInsertAction) -{ - notImplemented(); - return true; -} - -bool EditorClientHaiku::shouldChangeSelectedRange(Range* fromRange, Range* toRange, - EAffinity, bool stillSelecting) -{ - notImplemented(); - return true; -} - -bool EditorClientHaiku::shouldApplyStyle(WebCore::CSSStyleDeclaration*, - WebCore::Range*) -{ - notImplemented(); - return true; -} - -bool EditorClientHaiku::shouldMoveRangeAfterDelete(Range*, Range*) -{ - notImplemented(); - return true; -} - -void EditorClientHaiku::didBeginEditing() -{ - notImplemented(); - m_editing = true; -} - -void EditorClientHaiku::respondToChangedContents() -{ - notImplemented(); -} - -void EditorClientHaiku::respondToChangedSelection() -{ - notImplemented(); -} - -void EditorClientHaiku::didEndEditing() -{ - notImplemented(); - m_editing = false; -} - -void EditorClientHaiku::didWriteSelectionToPasteboard() -{ - notImplemented(); -} - -void EditorClientHaiku::didSetSelectionTypesForPasteboard() -{ - notImplemented(); -} - -void EditorClientHaiku::registerCommandForUndo(WTF::PassRefPtr cmd) -{ - notImplemented(); -} - -void EditorClientHaiku::registerCommandForRedo(WTF::PassRefPtr) -{ - notImplemented(); -} - -void EditorClientHaiku::clearUndoRedoOperations() -{ - notImplemented(); -} - -bool EditorClientHaiku::canUndo() const -{ - notImplemented(); - return false; -} - -bool EditorClientHaiku::canRedo() const -{ - notImplemented(); - return false; -} - -void EditorClientHaiku::undo() -{ - notImplemented(); - m_inUndoRedo = true; - m_inUndoRedo = false; -} - -void EditorClientHaiku::redo() -{ - notImplemented(); - m_inUndoRedo = true; - m_inUndoRedo = false; -} - -void EditorClientHaiku::handleKeyboardEvent(KeyboardEvent* event) -{ - Frame* frame = m_page->focusController()->focusedOrMainFrame(); - if (!frame || !frame->document()->focusedNode()) - return; - - const PlatformKeyboardEvent* kevent = event->keyEvent(); - if (!kevent || kevent->type() == PlatformKeyboardEvent::KeyUp) - return; - - Node* start = frame->selection()->start().node(); - if (!start) - return; - - if (start->isContentEditable()) { - switch(kevent->windowsVirtualKeyCode()) { - case VK_BACK: - frame->editor()->deleteWithDirection(SelectionController::BACKWARD, - kevent->ctrlKey() ? WordGranularity : CharacterGranularity, - false, true); - break; - case VK_DELETE: - frame->editor()->deleteWithDirection(SelectionController::FORWARD, - kevent->ctrlKey() ? WordGranularity : CharacterGranularity, - false, true); - break; - case VK_LEFT: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::LEFT, - kevent->ctrlKey() ? WordGranularity : CharacterGranularity, - true); - break; - case VK_RIGHT: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::RIGHT, - kevent->ctrlKey() ? WordGranularity : CharacterGranularity, - true); - break; - case VK_UP: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::BACKWARD, - kevent->ctrlKey() ? ParagraphGranularity : LineGranularity, - true); - break; - case VK_DOWN: - frame->selection()->modify(kevent->shiftKey() ? SelectionController::EXTEND : SelectionController::MOVE, - SelectionController::FORWARD, - kevent->ctrlKey() ? ParagraphGranularity : LineGranularity, - true); - break; - case VK_PRIOR: // PageUp - frame->editor()->command("MoveUpByPageAndModifyCaret"); - break; - case VK_NEXT: // PageDown - frame->editor()->command("MoveDownByPageAndModifyCaret"); - break; - case VK_RETURN: - frame->editor()->command("InsertLineBreak"); - break; - case VK_TAB: - return; - default: - if (!kevent->ctrlKey() && !kevent->altKey() && !kevent->text().isEmpty()) { - if (kevent->text().length() == 1) { - UChar ch = kevent->text()[0]; - // Don't insert null or control characters as they can result in unexpected behaviour - if (ch < ' ') - break; - } - frame->editor()->insertText(kevent->text(), event); - } else if (kevent->ctrlKey()) { - switch (kevent->windowsVirtualKeyCode()) { - case VK_A: - frame->editor()->command("SelectAll"); - break; - case VK_B: - frame->editor()->command("ToggleBold"); - break; - case VK_C: - frame->editor()->command("Copy"); - break; - case VK_I: - frame->editor()->command("ToggleItalic"); - break; - case VK_V: - frame->editor()->command("Paste"); - break; - case VK_X: - frame->editor()->command("Cut"); - break; - case VK_Y: - frame->editor()->command("Redo"); - break; - case VK_Z: - frame->editor()->command("Undo"); - break; - default: - return; - } - } else return; - } - } else { - switch (kevent->windowsVirtualKeyCode()) { - case VK_UP: - frame->editor()->command("MoveUp"); - break; - case VK_DOWN: - frame->editor()->command("MoveDown"); - break; - case VK_PRIOR: // PageUp - frame->editor()->command("MoveUpByPageAndModifyCaret"); - break; - case VK_NEXT: // PageDown - frame->editor()->command("MoveDownByPageAndModifyCaret"); - break; - case VK_HOME: - if (kevent->ctrlKey()) - frame->editor()->command("MoveToBeginningOfDocument"); - break; - case VK_END: - if (kevent->ctrlKey()) - frame->editor()->command("MoveToEndOfDocument"); - break; - default: - if (kevent->ctrlKey()) { - switch(kevent->windowsVirtualKeyCode()) { - case VK_A: - frame->editor()->command("SelectAll"); - break; - case VK_C: case VK_X: - frame->editor()->command("Copy"); - break; - default: - return; - } - } else return; - } - } - event->setDefaultHandled(); -} - -void EditorClientHaiku::handleInputMethodKeydown(KeyboardEvent*) -{ - notImplemented(); -} - -void EditorClientHaiku::textFieldDidBeginEditing(Element*) -{ - m_editing = true; -} - -void EditorClientHaiku::textFieldDidEndEditing(Element*) -{ - m_editing = false; -} - -void EditorClientHaiku::textDidChangeInTextField(Element*) -{ - notImplemented(); -} - -bool EditorClientHaiku::doTextFieldCommandFromEvent(Element*, KeyboardEvent*) -{ - return false; -} - -void EditorClientHaiku::textWillBeDeletedInTextField(Element*) -{ - notImplemented(); -} - -void EditorClientHaiku::textDidChangeInTextArea(Element*) -{ - notImplemented(); -} - -void EditorClientHaiku::ignoreWordInSpellDocument(const String&) -{ - notImplemented(); -} - -void EditorClientHaiku::learnWord(const String&) -{ - notImplemented(); -} - -void EditorClientHaiku::checkSpellingOfString(const UChar*, int, int*, int*) -{ - notImplemented(); -} - -String EditorClientHaiku::getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord) -{ - notImplemented(); - return String(); -} - -void EditorClientHaiku::checkGrammarOfString(const UChar*, int, Vector&, int*, int*) -{ - notImplemented(); -} - -void EditorClientHaiku::updateSpellingUIWithGrammarString(const String&, const GrammarDetail&) -{ - notImplemented(); -} - -void EditorClientHaiku::updateSpellingUIWithMisspelledWord(const String&) -{ - notImplemented(); -} - -void EditorClientHaiku::showSpellingUI(bool) -{ - notImplemented(); -} - -bool EditorClientHaiku::spellingUIIsShowing() -{ - notImplemented(); - return false; -} - -void EditorClientHaiku::getGuessesForWord(const String&, Vector&) -{ - notImplemented(); -} - -void EditorClientHaiku::setInputMethodState(bool enabled) -{ - notImplemented(); -} - -bool EditorClientHaiku::isEditing() const -{ - return m_editing; -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h b/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h deleted file mode 100644 index eda9597..0000000 --- a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/EditorClientHaiku.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (C) 2006 Nikolas Zimmermann - * Copyright (C) 2006 Zack Rusin - * Copyright (C) 2006 Apple Computer, Inc. - * Copyright (C) 2007 Ryan Leavengood - * - * 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 COMPUTER, INC. ``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 COMPUTER, INC. OR - * 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 EditorClientHaiku_H -#define EditorClientHaiku_H - -#include "EditorClient.h" -#include "RefCounted.h" -#include "Page.h" - -#include - - -namespace WebCore { - - class EditorClientHaiku : public EditorClient { - public: - EditorClientHaiku(); - void setPage( Page* page ); - - virtual void pageDestroyed(); - - virtual bool shouldDeleteRange(Range*); - virtual bool shouldShowDeleteInterface(HTMLElement*); - virtual bool smartInsertDeleteEnabled(); - virtual bool isSelectTrailingWhitespaceEnabled(); - virtual bool isContinuousSpellCheckingEnabled(); - virtual void toggleContinuousSpellChecking(); - virtual bool isGrammarCheckingEnabled(); - virtual void toggleGrammarChecking(); - virtual int spellCheckerDocumentTag(); - - virtual bool isEditable(); - - virtual bool shouldBeginEditing(Range*); - virtual bool shouldEndEditing(Range*); - virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction); - virtual bool shouldInsertText(const String&, Range*, EditorInsertAction); - virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, - EAffinity, bool stillSelecting); - - virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*); - virtual bool shouldMoveRangeAfterDelete(Range*, Range*); - - virtual void didBeginEditing(); - virtual void respondToChangedContents(); - virtual void respondToChangedSelection(); - virtual void didEndEditing(); - virtual void didWriteSelectionToPasteboard(); - virtual void didSetSelectionTypesForPasteboard(); - - virtual void registerCommandForUndo(PassRefPtr); - virtual void registerCommandForRedo(PassRefPtr); - virtual void clearUndoRedoOperations(); - - virtual bool canUndo() const; - virtual bool canRedo() const; - - virtual void undo(); - virtual void redo(); - - virtual void handleKeyboardEvent(KeyboardEvent*); - virtual void handleInputMethodKeydown(KeyboardEvent*); - - virtual void textFieldDidBeginEditing(Element*); - virtual void textFieldDidEndEditing(Element*); - virtual void textDidChangeInTextField(Element*); - virtual bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*); - virtual void textWillBeDeletedInTextField(Element*); - virtual void textDidChangeInTextArea(Element*); - - virtual void ignoreWordInSpellDocument(const String&); - virtual void learnWord(const String&); - virtual void checkSpellingOfString(const UChar*, int length, int* misspellingLocation, - int* misspellingLength); - virtual String getAutoCorrectSuggestionForMisspelledWord(const String& misspelledWord); - virtual void checkGrammarOfString(const UChar*, int length, Vector&, - int* badGrammarLocation, int* badGrammarLength); - virtual void updateSpellingUIWithGrammarString(const String&, const GrammarDetail&); - virtual void updateSpellingUIWithMisspelledWord(const String&); - virtual void showSpellingUI(bool show); - virtual bool spellingUIIsShowing(); - virtual void getGuessesForWord(const String&, Vector& guesses); - virtual void setInputMethodState(bool enabled); - - bool isEditing() const; - - private: - Page* m_page; - bool m_editing; - bool m_inUndoRedo; // our undo stack works differently - don't re-enter! - }; - -} // namespace WebCore - -#endif // EditorClientHaiku_h - diff --git a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp b/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp deleted file mode 100644 index 6ec9d24..0000000 --- a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007 Ryan Leavengood - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "config.h" -#include "InspectorClientHaiku.h" - -#include "PlatformString.h" - -#include "NotImplemented.h" - - -namespace WebCore { - -void InspectorClientHaiku::inspectorDestroyed() -{ - notImplemented(); -} - -Page* InspectorClientHaiku::createPage() -{ - notImplemented(); - return 0; -} - -String InspectorClientHaiku::localizedStringsURL() -{ - notImplemented(); - return String(); -} - -String InspectorClientHaiku::hiddenPanels() -{ - notImplemented(); - return String(); -} - -void InspectorClientHaiku::showWindow() -{ - notImplemented(); -} - -void InspectorClientHaiku::closeWindow() -{ - notImplemented(); -} - -void InspectorClientHaiku::attachWindow() -{ - notImplemented(); -} - -void InspectorClientHaiku::detachWindow() -{ - notImplemented(); -} - -void InspectorClientHaiku::setAttachedWindowHeight(unsigned height) -{ - notImplemented(); -} - -void InspectorClientHaiku::highlight(Node* node) -{ - notImplemented(); -} - -void InspectorClientHaiku::hideHighlight() -{ - notImplemented(); -} - -void InspectorClientHaiku::inspectedURLChanged(const String&) -{ - notImplemented(); -} - -void InspectorClientHaiku::populateSetting(const String& key, InspectorController::Setting&) -{ - notImplemented(); -} - -void InspectorClientHaiku::storeSetting(const String& key, const InspectorController::Setting&) -{ - notImplemented(); -} - -void InspectorClientHaiku::removeSetting(const String& key) -{ - notImplemented(); -} - -} // namespace WebCore - diff --git a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h b/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h deleted file mode 100644 index 1de996d..0000000 --- a/src/3rdparty/webkit/WebKit/haiku/WebCoreSupport/InspectorClientHaiku.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2007 Apple Inc. All rights reserved. - * Copyright (C) 2007 Ryan Leavengood - * - * 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. - * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of - * its contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 InspectorClientHaiku_h -#define InspectorClientHaiku_h - -#include "InspectorClient.h" - - -namespace WebCore { - class Node; - class Page; - class String; - - class InspectorClientHaiku : public InspectorClient { - public: - virtual void inspectorDestroyed(); - - virtual Page* createPage(); - - virtual String localizedStringsURL(); - - virtual String hiddenPanels(); - - virtual void showWindow(); - virtual void closeWindow(); - - virtual void attachWindow(); - virtual void detachWindow(); - - virtual void setAttachedWindowHeight(unsigned height); - - virtual void highlight(Node*); - virtual void hideHighlight(); - - virtual void inspectedURLChanged(const String& newURL); - - virtual void populateSetting(const String& key, InspectorController::Setting&); - virtual void storeSetting(const String& key, const InspectorController::Setting&); - virtual void removeSetting(const String& key); - }; -} // namespace WebCore - -#endif // InspectorClientHaiku_h - diff --git a/src/3rdparty/webkit/WebKit/qt/ChangeLog b/src/3rdparty/webkit/WebKit/qt/ChangeLog index 08ba0d3..83808d2 100644 --- a/src/3rdparty/webkit/WebKit/qt/ChangeLog +++ b/src/3rdparty/webkit/WebKit/qt/ChangeLog @@ -1,5 +1,43 @@ 2009-07-28 Simon Hausmann + Rubber-stamped by Ariya Hidayat. + + Fix compilation with the precompiled header. + + * WebKit_pch.h: Don't include JSDOMBinding.h and MathObject.h, + as they include AtomicString.h. AtomicString.cpp needs to enable + a #define before including AtomicString.h, which breaks if the PCH + forces the inclusion beforehand. + +2009-07-28 Ariya Hidayat + + Reviewed by Simon Hausmann. + + Added tests to ensure that scroll position can be changed + programmatically, even when the scroll bar policy is set to off. + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-28 Tor Arne Vestbø + + Reviewed by Simon Hausmann. + + Fix a few compilation warnings in the QWebFrame tests. + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-28 Andre Pedralho + + Reviewed by Simon Hausmann. + + Fixed tst_QWebFrame::hasSetFocus test which was using + an undefined resource. + https://bugs.webkit.org/show_bug.cgi?id=27512 + + * tests/qwebframe/tst_qwebframe.cpp: + +2009-07-28 Simon Hausmann + Reviewed by Ariya Hidayat. Make it possible to pass relative file names to QtLauncher. diff --git a/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h b/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h index ae8ec88..1dd4d52 100644 --- a/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h +++ b/src/3rdparty/webkit/WebKit/qt/WebKit_pch.h @@ -77,7 +77,4 @@ #include #include #include - -#include "../../WebCore/bindings/js/JSDOMBinding.h" -#include "../../JavaScriptCore/runtime/MathObject.h" #endif diff --git a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp index 1616b5f..a3bcd20 100644 --- a/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp +++ b/src/3rdparty/webkit/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp @@ -589,6 +589,7 @@ private slots: void baseUrl(); void hasSetFocus(); void render(); + void scrollPosition(); private: QString evalJS(const QString&s) { @@ -2188,7 +2189,7 @@ class FakeReply : public QNetworkReply { virtual void abort() {} virtual void close() {} protected: - qint64 readData(char* data, qint64 maxSize) + qint64 readData(char*, qint64) { return 0; } @@ -2544,16 +2545,29 @@ void tst_QWebFrame::baseUrl() void tst_QWebFrame::hasSetFocus() { + QString html("

top

" \ + "