WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Add WebCore bits of Nix
nix.diff (text/plain), 322.05 KB, created by
Hugo Parente Lima
on 2013-06-25 16:11:40 PDT
(
hide
)
Description:
Add WebCore bits of Nix
Filename:
MIME Type:
Creator:
Hugo Parente Lima
Created:
2013-06-25 16:11:40 PDT
Size:
322.05 KB
patch
obsolete
>diff --git a/CMakeLists.txt b/CMakeLists.txt >index 281f94a..bfc49d8 100644 >--- a/CMakeLists.txt >+++ b/CMakeLists.txt >@@ -10,6 +10,7 @@ set(WEBCORE_DIR "${CMAKE_SOURCE_DIR}/Source/WebCore") > set(WEBKIT_DIR "${CMAKE_SOURCE_DIR}/Source/WebKit") > set(WEBKIT2_DIR "${CMAKE_SOURCE_DIR}/Source/WebKit2") > set(THIRDPARTY_DIR "${CMAKE_SOURCE_DIR}/Source/ThirdParty") >+set(PLATFORM_DIR "${CMAKE_SOURCE_DIR}/Source/Platform") > > set(TOOLS_DIR "${CMAKE_SOURCE_DIR}/Tools") > >@@ -39,7 +40,7 @@ include(WebKitFeatures) > # ----------------------------------------------------------------------------- > # Determine which port will be built > # ----------------------------------------------------------------------------- >-set(ALL_PORTS Efl WinCE BlackBerry GTK) >+set(ALL_PORTS Efl WinCE BlackBerry GTK Nix) > set(PORT "NOPORT" CACHE STRING "choose which WebKit port to build (one of ${ALL_PORTS})") > > list(FIND ALL_PORTS ${PORT} RET) >diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt >index 3736eea..268ba2e 100644 >--- a/Source/CMakeLists.txt >+++ b/Source/CMakeLists.txt >@@ -5,6 +5,10 @@ add_subdirectory(WTF) > > add_subdirectory(JavaScriptCore) > >+if ("${PORT}" STREQUAL "Nix") >+ add_subdirectory(Platform) >+endif () >+ > if (ENABLE_API_TESTS) > add_subdirectory(cmake/gtest) > endif () >@@ -26,6 +30,13 @@ WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS() > # ----------------------------------------------------------------------------- > # Set compiler flags for all targets > # ----------------------------------------------------------------------------- >+if ("${PORT}" STREQUAL "Nix") >+ if (NOT DISABLE_STRICT_BUILD) >+ set(ADDITIONAL_FLAGS ENABLE_WERROR) >+ endif () >+ WEBKIT_SET_EXTRA_COMPILER_FLAGS(Platform ${ADDITIONAL_FLAGS}) >+endif () >+ > if (${PORT} STREQUAL "Efl") > set(ADDITIONAL_FLAGS ENABLE_WERROR) > endif () >diff --git a/Source/Platform/CMakeLists.txt b/Source/Platform/CMakeLists.txt >new file mode 100644 >index 0000000..faf7cab >--- /dev/null >+++ b/Source/Platform/CMakeLists.txt >@@ -0,0 +1,5 @@ >+WEBKIT_INCLUDE_CONFIG_FILES_IF_EXISTS() >+ >+include_directories(${Platform_INCLUDES}) >+add_library(Platform STATIC ${Platform_SOURCES}) >+set_target_properties(Platform PROPERTIES FOLDER "Platform") >diff --git a/Source/Platform/PlatformNix.cmake b/Source/Platform/PlatformNix.cmake >new file mode 100644 >index 0000000..12baa6c >--- /dev/null >+++ b/Source/Platform/PlatformNix.cmake >@@ -0,0 +1,29 @@ >+set (Platform_INCLUDES >+ nix >+ ${WEBCORE_DIR}/platform/graphics/ # For IntRect.h >+ ${WTF_DIR} # For config.h >+ ${CMAKE_BINARY_DIR} # For cmakeconfig.h >+) >+ >+set (Platform_HEADERS >+ nix/public/Platform.h >+ nix/public/WebColor.h >+ nix/public/WebFFTFrame.h >+ nix/public/WebRect.h >+ nix/public/WebSize.h >+ nix/public/WebThemeEngine.h >+ nix/public/WebAudioBus.h >+ nix/public/WebAudioDevice.h >+ nix/public/WebCommon.h >+ nix/public/WebData.h >+ nix/public/WebGamepads.h >+ nix/public/WebGamepad.h >+ nix/public/WebVector.h >+) >+ >+set (Platform_SOURCES >+ nix/src/Platform.cpp >+ nix/src/DefaultWebThemeEngine.cpp >+) >+ >+install(FILES ${Platform_HEADERS} DESTINATION include/${WebKit2_OUTPUT_NAME}-${PROJECT_VERSION_MAJOR}/NixPlatform) >diff --git a/Source/Platform/nix/public/Platform.h b/Source/Platform/nix/public/Platform.h >new file mode 100644 >index 0000000..ab257a5 >--- /dev/null >+++ b/Source/Platform/nix/public/Platform.h >@@ -0,0 +1,87 @@ >+/* >+ * Copyright (C) 2012 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. >+ */ >+ >+#ifndef Platform_h >+#define Platform_h >+ >+#include "WebAudioDevice.h" >+#include "WebData.h" >+#include "WebGamepads.h" >+ >+namespace WebKit { >+ >+class WebAudioBus; >+class WebFFTFrame; >+class WebThemeEngine; >+ >+class WEBKIT_EXPORT Platform { >+public: >+ >+ WEBKIT_EXPORT static void initialize(Platform*); >+ WEBKIT_EXPORT static void shutdown(); >+ WEBKIT_EXPORT static Platform* current(); >+ >+ // Audio -------------------------------------------------------------- >+ virtual double audioHardwareSampleRate() { return 0; } >+ virtual size_t audioHardwareBufferSize() { return 0; } >+ virtual unsigned audioHardwareOutputChannels() { return 0; } >+ >+ // Creates a device for audio I/O. >+ // Pass in (numberOfInputChannels > 0) if live/local audio input is desired. >+ virtual WebAudioDevice* createAudioDevice(size_t /*bufferSize*/, unsigned /*numberOfInputChannels*/, unsigned /*numberOfChannels*/, double /*sampleRate*/, WebAudioDevice::RenderCallback*) { return 0; } >+ >+ >+ // Gamepad ------------------------------------------------------------- >+ virtual void sampleGamepads(WebGamepads& into) { into.length = 0; } >+ >+ >+ // FFTFrame >+ virtual WebFFTFrame* createFFTFrame(unsigned /*fftsize*/) { return 0; } >+ virtual WebFFTFrame* createFFTFrame(const WebFFTFrame* /*frame*/) { return 0; } >+ >+ // Resources ----------------------------------------------------------- >+ // Returns a blob of data corresponding to the named resource. >+ virtual WebData loadResource(const char* /*name*/) { return WebData(); } >+ >+ // Decodes the in-memory audio file data and returns the linear PCM audio data in the destinationBus. >+ // A sample-rate conversion to sampleRate will occur if the file data is at a different sample-rate. >+ // Returns true on success. >+ virtual bool loadAudioResource(WebAudioBus* /*destinationBus*/, const char* /*audioFileData*/, size_t /*dataSize*/, double /*sampleRate*/) { return false; } >+ >+ // Theme engine >+ virtual WebThemeEngine* themeEngine(); >+ >+protected: >+ virtual ~Platform() { } >+}; >+ >+} // namespace WebKit >+ >+#endif >diff --git a/Source/Platform/nix/public/WebAudioBus.h b/Source/Platform/nix/public/WebAudioBus.h >new file mode 100644 >index 0000000..17b2544 >--- /dev/null >+++ b/Source/Platform/nix/public/WebAudioBus.h >@@ -0,0 +1,79 @@ >+/* >+ * Copyright (C) 2010, 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: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef WebAudioBus_h >+#define WebAudioBus_h >+ >+#include "WebCommon.h" >+ >+namespace WebCore { class AudioBus; } >+ >+#ifdef BUILDING_NIX__ >+namespace WTF { template <typename T> class PassRefPtr; } >+#endif >+ >+namespace WebKit { >+ >+class WebAudioBusPrivate; >+ >+// A container for multi-channel linear PCM audio data. >+// >+// WARNING: It is not safe to pass a WebAudioBus across threads!!! >+// >+class WebAudioBus { >+public: >+ WebAudioBus() : m_d(0) { } >+ ~WebAudioBus() { reset(); } >+ >+ // initialize() allocates memory of the given length for the given number of channels. >+ WEBKIT_EXPORT void initialize(unsigned numberOfChannels, size_t length, double sampleRate); >+ >+ // resizeSmaller() can only be called after initialize() with a new length <= the initialization length. >+ // The data stored in the bus will remain undisturbed. >+ WEBKIT_EXPORT void resizeSmaller(size_t newLength); >+ >+ // reset() releases the memory allocated from initialize(). >+ WEBKIT_EXPORT void reset(); >+ >+ WEBKIT_EXPORT unsigned numberOfChannels() const; >+ WEBKIT_EXPORT size_t length() const; >+ WEBKIT_EXPORT double sampleRate() const; >+ >+ WEBKIT_EXPORT float* channelData(unsigned channelIndex); >+ >+#ifdef BUILDING_NIX__ >+ WTF::PassRefPtr<WebCore::AudioBus> audioBus(); >+#endif >+ >+private: >+ // Disallow copy and assign. >+ WebAudioBus(const WebAudioBus&); >+ void operator=(const WebAudioBus&); >+ >+ WebAudioBusPrivate* m_d; >+}; >+ >+} // namespace WebKit >+ >+#endif // WebAudioBus_h >diff --git a/Source/Platform/nix/public/WebAudioDevice.h b/Source/Platform/nix/public/WebAudioDevice.h >new file mode 100644 >index 0000000..3045136 >--- /dev/null >+++ b/Source/Platform/nix/public/WebAudioDevice.h >@@ -0,0 +1,57 @@ >+/* >+ * Copyright (C) 2010 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: >+ * >+ * 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 WebAudioDevice_h >+#define WebAudioDevice_h >+ >+#include "WebVector.h" >+ >+namespace WebKit { >+ >+// Abstract interface to the Chromium audio system. >+ >+class WebAudioDevice { >+public: >+ class RenderCallback { >+ public: >+ virtual void render(const WebVector<float*>& /*sourceData*/, const WebVector<float*>& /*destinationData*/, size_t /*numberOfFrames*/) { } >+ >+ protected: >+ virtual ~RenderCallback() { } >+ }; >+ >+ virtual ~WebAudioDevice() { } >+ >+ virtual void start() = 0; >+ virtual void stop() = 0; >+ virtual double sampleRate() = 0; >+}; >+ >+} // namespace WebKit >+ >+#endif // WebAudioDevice_h >diff --git a/Source/Platform/nix/public/WebCanvas.h b/Source/Platform/nix/public/WebCanvas.h >new file mode 100644 >index 0000000..99b2fe0 >--- /dev/null >+++ b/Source/Platform/nix/public/WebCanvas.h >@@ -0,0 +1,10 @@ >+#ifndef WebCanvas_h >+#define WebCanvas_h >+ >+#include <cairo/cairo.h> >+ >+namespace WebKit { >+typedef cairo_t WebCanvas; >+} >+ >+#endif >diff --git a/Source/Platform/nix/public/WebColor.h b/Source/Platform/nix/public/WebColor.h >new file mode 100644 >index 0000000..3415790 >--- /dev/null >+++ b/Source/Platform/nix/public/WebColor.h >@@ -0,0 +1,99 @@ >+/* >+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 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. >+*/ >+ >+#ifndef WebColor_h >+#define WebColor_h >+ >+#include <algorithm> >+ >+namespace WebKit { >+ >+typedef unsigned RGBA32; // RGBA quadruplet >+ >+struct WebColor >+{ >+ static const RGBA32 black = 0xFF000000; >+ static const RGBA32 white = 0xFFFFFFFF; >+ static const RGBA32 darkGray = 0xFF808080; >+ static const RGBA32 gray = 0xFFA0A0A0; >+ static const RGBA32 lightGray = 0xFFC0C0C0; >+ static const RGBA32 transparent = 0x00000000; >+ >+ RGBA32 rgba; >+ >+ WebColor() >+ : rgba(WebColor::black) >+ { >+ } >+ >+ WebColor(RGBA32 rgba) >+ : rgba(rgba) >+ { >+ } >+ >+ WebColor(int r, int g, int b, int a = 255) >+ : rgba(std::max(0, std::min(a, 255)) << 24 | std::max(0, std::min(r, 255)) << 16 | std::max(0, std::min(g, 255)) << 8 | std::max(0, std::min(b, 255))) >+ { >+ } >+ >+ operator RGBA32() const >+ { >+ return rgba; >+ } >+ >+ unsigned char r() const >+ { >+ return (rgba & 0x00FF0000) >> 16; >+ } >+ >+ unsigned char g() const >+ { >+ return (rgba & 0x0000FF00) >> 8; >+ } >+ >+ unsigned char b() const >+ { >+ return (rgba & 0x000000FF); >+ } >+ >+ unsigned char a() const >+ { >+ return (rgba & 0xFF000000) >> 24; >+ } >+}; >+ >+inline bool operator==(const WebColor& a, const WebColor& b) >+{ >+ return a.rgba == b.rgba; >+} >+ >+inline bool operator!=(const WebColor& a, const WebColor& b) >+{ >+ return !(a == b); >+} >+ >+} // namespace WebKit >+ >+#endif >diff --git a/Source/Platform/nix/public/WebCommon.h b/Source/Platform/nix/public/WebCommon.h >new file mode 100644 >index 0000000..438d73c >--- /dev/null >+++ b/Source/Platform/nix/public/WebCommon.h >@@ -0,0 +1,47 @@ >+/* >+ * Copyright (C) 2010 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. >+ */ >+ >+#ifndef WebCommon_h >+#define WebCommon_h >+ >+// ----------------------------------------------------------------------------- >+// Exported symbols need to be annotated with WEBKIT_EXPORT >+#define WEBKIT_EXPORT __attribute__((visibility("default"))) >+ >+// ----------------------------------------------------------------------------- >+// Basic types >+#include <stddef.h> // For size_t >+ >+namespace WebKit { >+// UTF-16 character type >+typedef unsigned short WebUChar; >+} // namespace WebKit >+ >+#endif >diff --git a/Source/Platform/nix/public/WebData.h b/Source/Platform/nix/public/WebData.h >new file mode 100644 >index 0000000..3ce6219 >--- /dev/null >+++ b/Source/Platform/nix/public/WebData.h >@@ -0,0 +1,110 @@ >+/* >+ * 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. >+ */ >+ >+#ifndef WebData_h >+#define WebData_h >+ >+#include "WebCommon.h" >+ >+#ifdef BUILDING_NIX__ >+namespace WebCore { class SharedBuffer; } >+namespace WTF { template <typename T> class PassRefPtr; } >+#endif >+ >+namespace WebKit { >+ >+class WebDataPrivate; >+ >+// A container for raw bytes. It is inexpensive to copy a WebData object. >+// >+// WARNING: It is not safe to pass a WebData across threads!!! >+// >+class WebData { >+public: >+ ~WebData() { reset(); } >+ >+ WebData() : m_private(0) { } >+ >+ WebData(const char* data, size_t size) : m_private(0) >+ { >+ assign(data, size); >+ } >+ >+ template <int N> >+ WebData(const char (&data)[N]) : m_private(0) >+ { >+ assign(data, N - 1); >+ } >+ >+ WebData(const WebData& d) : m_private(0) { assign(d); } >+ >+ WebData& operator=(const WebData& d) >+ { >+ assign(d); >+ return *this; >+ } >+ >+ WEBKIT_EXPORT void reset(); >+ WEBKIT_EXPORT void assign(const WebData&); >+ WEBKIT_EXPORT void assign(const char* data, size_t size); >+ >+ WEBKIT_EXPORT size_t size() const; >+ WEBKIT_EXPORT const char* data() const; >+ >+ bool isEmpty() const { return !size(); } >+ bool isNull() const { return !m_private; } >+ >+#ifdef BUILDING_NIX__ >+ WebData(const WTF::PassRefPtr<WebCore::SharedBuffer>&); >+ WebData& operator=(const WTF::PassRefPtr<WebCore::SharedBuffer>&); >+ operator WTF::PassRefPtr<WebCore::SharedBuffer>() const; >+#else >+ template <class C> >+ WebData(const C& c) : m_private(0) >+ { >+ assign(c.data(), c.size()); >+ } >+ >+ template <class C> >+ WebData& operator=(const C& c) >+ { >+ assign(c.data(), c.size()); >+ return *this; >+ } >+#endif >+ >+private: >+ void assign(WebDataPrivate*); >+ WebDataPrivate* m_private; >+}; >+ >+} // namespace WebKit >+ >+#endif >diff --git a/Source/Platform/nix/public/WebFFTFrame.h b/Source/Platform/nix/public/WebFFTFrame.h >new file mode 100644 >index 0000000..77c111d >--- /dev/null >+++ b/Source/Platform/nix/public/WebFFTFrame.h >@@ -0,0 +1,53 @@ >+/* >+ * Copyright (C) 2013-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 WebFFTFrame_h >+#define WebFFTFrame_h >+ >+namespace WebKit { >+ >+class WebAudioBus; >+ >+class WebFFTFrame { >+public: >+ virtual ~WebFFTFrame() { } >+ >+ virtual void doFFT(const float*) { } >+ virtual void doInverseFFT(float*) { } >+ virtual void multiply(const WebFFTFrame&) { } >+ >+ virtual unsigned frequencyDomainSampleCount() const { return 0; } >+ // After multiplication and transform operations, the data is scaled >+ // to take in account the scale used internally in WebKit, originally >+ // from Mac's vecLib. >+ // After multiplication: Planar data is scaled by 0.5. >+ // After direct transform: Planar data is scaled by 2.0. >+ // After inverse transform: Time domain data is scaled by 1.0/(2* FFT size). >+ virtual float* realData() const { return 0; } >+ virtual float* imagData() const { return 0; } >+}; >+ >+} // namespace WebKit >+ >+#endif >diff --git a/Source/Platform/nix/public/WebGamepad.h b/Source/Platform/nix/public/WebGamepad.h >new file mode 100644 >index 0000000..ff325f5 >--- /dev/null >+++ b/Source/Platform/nix/public/WebGamepad.h >@@ -0,0 +1,71 @@ >+// Copyright (C) 2011, 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: >+// >+// 1. Redistributions of source code must retain the above copyright >+// notice, this list of conditions and the following disclaimer. >+// 2. Redistributions in binary form must reproduce the above copyright >+// notice, this list of conditions and the following disclaimer in the >+// documentation and/or other materials provided with the distribution. >+// >+// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE >+// ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE >+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT >+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY >+// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH >+// DAMAGE. >+ >+#ifndef WebGamepad_h >+#define WebGamepad_h >+ >+#include "WebCommon.h" >+ >+namespace WebKit { >+ >+class WebGamepad { >+public: >+ static const size_t idLengthCap = 128; >+ static const size_t axesLengthCap = 16; >+ static const size_t buttonsLengthCap = 32; >+ >+ WebGamepad() >+ : connected(false) >+ , timestamp(0) >+ , axesLength(0) >+ , buttonsLength(0) >+ { >+ id[0] = 0; >+ } >+ >+ // Is there a gamepad connected at this index? >+ bool connected; >+ >+ // Device identifier (based on manufacturer, model, etc.). >+ WebUChar id[idLengthCap]; >+ >+ // Monotonically increasing value referring to when the data were last >+ // updated. >+ unsigned long long timestamp; >+ >+ // Number of valid entries in the axes array. >+ unsigned axesLength; >+ >+ // Normalized values representing axes, in the range [-1..1]. >+ float axes[axesLengthCap]; >+ >+ // Number of valid entries in the buttons array. >+ unsigned buttonsLength; >+ >+ // Normalized values representing buttons, in the range [0..1]. >+ float buttons[buttonsLengthCap]; >+}; >+ >+} >+ >+#endif // WebGamepad_h >diff --git a/Source/Platform/nix/public/WebGamepads.h b/Source/Platform/nix/public/WebGamepads.h >new file mode 100644 >index 0000000..13ba2ae >--- /dev/null >+++ b/Source/Platform/nix/public/WebGamepads.h >@@ -0,0 +1,47 @@ >+// Copyright (C) 2011, 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: >+// >+// 1. Redistributions of source code must retain the above copyright >+// notice, this list of conditions and the following disclaimer. >+// 2. Redistributions in binary form must reproduce the above copyright >+// notice, this list of conditions and the following disclaimer in the >+// documentation and/or other materials provided with the distribution. >+// >+// THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE >+// ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE >+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT >+// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY >+// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH >+// DAMAGE. >+ >+#ifndef WebGamepads_h >+#define WebGamepads_h >+ >+#include "WebGamepad.h" >+ >+namespace WebKit { >+ >+class WebGamepads { >+public: >+ WebGamepads() >+ : length(0) { } >+ >+ static const size_t itemsLengthCap = 4; >+ >+ // Number of valid entries in the items array. >+ unsigned length; >+ >+ // Gamepad data for N separate gamepad devices. >+ WebGamepad items[itemsLengthCap]; >+}; >+ >+} >+ >+#endif // WebGamepads_h >diff --git a/Source/Platform/nix/public/WebRect.h b/Source/Platform/nix/public/WebRect.h >new file mode 100644 >index 0000000..1261aac >--- /dev/null >+++ b/Source/Platform/nix/public/WebRect.h >@@ -0,0 +1,46 @@ >+#ifndef WebRect_h >+#define WebRect_h >+ >+#ifdef BUILDING_NIX__ >+#include "IntRect.h" >+#endif >+ >+namespace WebKit { >+ >+class WebRect { >+public: >+ int x; >+ int y; >+ int width; >+ int height; >+ >+ WebRect(const WebRect& r) >+ : x(r.x) >+ , y(r.y) >+ , width(r.width) >+ , height(r.height) >+ { >+ } >+ >+#ifdef BUILDING_NIX__ >+ WebRect(const WebCore::IntRect& r) >+ : x(r.x()) >+ , y(r.y()) >+ , width(r.width()) >+ , height(r.height()) >+ { >+ } >+ >+ WebRect& operator=(const WebCore::IntRect& r) >+ { >+ x = r.x(); >+ y = r.y(); >+ width = r.width(); >+ height = r.height(); >+ return *this; >+ } >+#endif >+}; >+ >+} >+#endif >diff --git a/Source/Platform/nix/public/WebSize.h b/Source/Platform/nix/public/WebSize.h >new file mode 100644 >index 0000000..504ef5a >--- /dev/null >+++ b/Source/Platform/nix/public/WebSize.h >@@ -0,0 +1,91 @@ >+/* >+ * 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. >+ */ >+ >+#ifndef WebSize_h >+#define WebSize_h >+ >+#ifdef BUILDING_NIX__ >+#include "IntSize.h" >+#endif >+ >+namespace WebKit { >+ >+struct WebSize { >+ int width; >+ int height; >+ >+ bool isEmpty() const { return width <= 0 || height <= 0; } >+ >+ WebSize() >+ : width(0) >+ , height(0) >+ { >+ } >+ >+ WebSize(int width, int height) >+ : width(width) >+ , height(height) >+ { >+ } >+ >+#ifdef BUILDING_NIX__ >+ WebSize(const WebCore::IntSize& s) >+ : width(s.width()) >+ , height(s.height()) >+ { >+ } >+ >+ WebSize& operator=(const WebCore::IntSize& s) >+ { >+ width = s.width(); >+ height = s.height(); >+ return *this; >+ } >+ >+ operator WebCore::IntSize() const >+ { >+ return WebCore::IntSize(width, height); >+ } >+#endif >+}; >+ >+inline bool operator==(const WebSize& a, const WebSize& b) >+{ >+ return a.width == b.width && a.height == b.height; >+} >+ >+inline bool operator!=(const WebSize& a, const WebSize& b) >+{ >+ return !(a == b); >+} >+ >+} // namespace WebKit >+ >+#endif >diff --git a/Source/Platform/nix/public/WebThemeEngine.h b/Source/Platform/nix/public/WebThemeEngine.h >new file mode 100644 >index 0000000..a4c2b94 >--- /dev/null >+++ b/Source/Platform/nix/public/WebThemeEngine.h >@@ -0,0 +1,160 @@ >+/* >+ * Copyright (C) 2010 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. >+ */ >+ >+#ifndef WebThemeEngine_h >+#define WebThemeEngine_h >+ >+#include "WebSize.h" >+#include "WebCanvas.h" >+#include "WebColor.h" >+ >+namespace WebKit { >+ >+class WebRect; >+ >+class WebThemeEngine { >+public: >+ // The current state of the associated Part. >+ enum State { >+ StateDisabled, >+ StateHover, >+ StateNormal, >+ StatePressed >+ }; >+ >+ // Extra parameters for drawing the PartScrollbarHorizontalTrack and >+ // PartScrollbarVerticalTrack. >+ struct ScrollbarTrackExtraParams { >+ // The bounds of the entire track, as opposed to the part being painted. >+ int trackX; >+ int trackY; >+ int trackWidth; >+ int trackHeight; >+ }; >+ >+ // Extra parameters for PartCheckbox, PartPushButton and PartRadio. >+ struct ButtonExtraParams { >+ bool checked; >+ bool indeterminate; // Whether the button state is indeterminate. >+ bool isDefault; // Whether the button is default button. >+ bool hasBorder; >+ WebColor backgroundColor; >+ }; >+ >+ // Extra parameters for PartMenuList >+ struct MenuListExtraParams { >+ bool hasBorder; >+ bool hasBorderRadius; >+ int arrowX; >+ int arrowY; >+ WebColor backgroundColor; >+ }; >+ >+ // Extra parameters for PartSliderTrack and PartSliderThumb >+ struct SliderExtraParams { >+ bool vertical; >+ bool inDrag; >+ }; >+ >+ // Extra parameters for PartInnerSpinButton >+ struct InnerSpinButtonExtraParams { >+ bool spinUp; >+ bool readOnly; >+ }; >+ >+ // Extra parameters for PartProgressBar >+ struct ProgressBarExtraParams { >+ bool isDeterminate; >+ double position; >+ double animationProgress; >+ double animationStartTime; >+ }; >+ >+ struct MeterExtraParams >+ { >+ double min; >+ double max; >+ double value; >+ double low; >+ double high; >+ double optimum; >+ double valueRatio() const >+ { >+ if (max <= min) >+ return 0; >+ return (value - min) / (max - min); >+ } >+ }; >+ >+ virtual const char* extraDefaultStyleSheet() const { return ""; } >+ virtual const char* extraQuirksStyleSheet() const { return ""; } >+ virtual const char* extraPlugInsStyleSheet() const { return ""; } >+ >+ // Text selection colors. >+ virtual WebColor activeSelectionBackgroundColor() const = 0; >+ virtual WebColor activeSelectionForegroundColor() const = 0; >+ virtual WebColor inactiveSelectionBackgroundColor() const = 0; >+ virtual WebColor inactiveSelectionForegroundColor() const = 0; >+ >+ // List box selection colors >+ virtual WebColor activeListBoxSelectionBackgroundColor() const = 0; >+ virtual WebColor activeListBoxSelectionForegroundColor() const = 0; >+ virtual WebColor inactiveListBoxSelectionBackgroundColor() const = 0; >+ virtual WebColor inactiveListBoxSelectionForegroundColor() const = 0; >+ >+ virtual WebColor activeTextSearchHighlightColor() const = 0; >+ virtual WebColor inactiveTextSearchHighlightColor() const = 0; >+ >+ virtual WebColor focusRingColor() const = 0; >+ >+ virtual WebColor tapHighlightColor() const = 0; >+ >+ virtual void paintButton(WebCanvas*, State, const WebRect&, const ButtonExtraParams&) const = 0; >+ virtual void paintTextField(WebCanvas*, State, const WebRect&) const = 0; >+ virtual WebSize getCheckboxSize() const = 0; >+ virtual void paintCheckbox(WebCanvas*, State, const WebRect&, const ButtonExtraParams&) const = 0; >+ virtual WebSize getRadioSize() const = 0; >+ virtual void paintRadio(WebCanvas*, State, const WebRect&, const ButtonExtraParams&) const = 0; >+ virtual void paintTextArea(WebCanvas*, State, const WebRect&) const = 0; >+ virtual void getMenuListPadding(int& paddingTop, int& paddingLeft, int& paddingBottom, int& paddingRight) const = 0; >+ virtual void paintMenuList(WebCanvas*, State, const WebRect&) const = 0; >+ virtual void paintProgressBar(WebCanvas*, State, const WebRect&, const ProgressBarExtraParams&) const = 0; >+ virtual double getAnimationRepeatIntervalForProgressBar() const = 0; >+ virtual double getAnimationDurationForProgressBar() const = 0; >+ virtual void getInnerSpinButtonPadding(int& paddingTop, int& paddingLeft, int& paddingBottom, int& paddingRight) const = 0; >+ virtual void paintInnerSpinButton(WebCanvas*, State, const WebRect&, const InnerSpinButtonExtraParams&) const = 0; >+ virtual void paintMeter(WebCanvas*, State, const WebRect&, const MeterExtraParams&) const = 0; >+ virtual void paintSliderTrack(WebCanvas*, State, const WebRect&) const = 0; >+ virtual void paintSliderThumb(WebCanvas*, State, const WebRect&) const = 0; >+}; >+ >+} // namespace WebKit >+ >+#endif >diff --git a/Source/Platform/nix/public/WebVector.h b/Source/Platform/nix/public/WebVector.h >new file mode 100644 >index 0000000..446b7e6 >--- /dev/null >+++ b/Source/Platform/nix/public/WebVector.h >@@ -0,0 +1,187 @@ >+/* >+ * 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. >+ */ >+ >+#ifndef WebVector_h >+#define WebVector_h >+ >+#include "WebCommon.h" >+ >+#include <algorithm> >+#include <cassert> >+ >+namespace WebKit { >+ >+// A simple vector class. >+// >+// Sample usage: >+// >+// void Foo(WebVector<int>& result) >+// { >+// WebVector<int> data(10); >+// for (size_t i = 0; i < data.size(); ++i) >+// data[i] = ... >+// result.swap(data); >+// } >+// >+// It is also possible to assign from other types of random access >+// containers: >+// >+// void Foo(const std::vector<std::string>& input) >+// { >+// WebVector<WebCString> cstrings = input; >+// ... >+// } >+// >+template <typename T> >+class WebVector { >+public: >+ typedef T ValueType; >+ >+ ~WebVector() >+ { >+ destroy(); >+ } >+ >+ explicit WebVector(size_t size = 0) >+ { >+ initialize(size); >+ } >+ >+ WebVector(const WebVector<T>& other) >+ { >+ initializeFrom(other.m_ptr, other.m_size); >+ } >+ >+ template <typename C> >+ WebVector(const C& other) >+ { >+ initializeFrom(other.size() ? &other[0] : 0, other.size()); >+ } >+ >+ WebVector& operator=(const WebVector& other) >+ { >+ if (this != &other) >+ assign(other); >+ return *this; >+ } >+ >+ template <typename C> >+ WebVector<T>& operator=(const C& other) >+ { >+ if (this != reinterpret_cast<const WebVector<T>*>(&other)) >+ assign(other); >+ return *this; >+ } >+ >+ template <typename C> >+ void assign(const C& other) >+ { >+ assign(other.size() ? &other[0] : 0, other.size()); >+ } >+ >+ template <typename U> >+ void assign(const U* values, size_t size) >+ { >+ destroy(); >+ initializeFrom(values, size); >+ } >+ >+ size_t size() const { return m_size; } >+ bool isEmpty() const { return !m_size; } >+ >+ T& operator[](size_t i) >+ { >+ assert(i < m_size); >+ return m_ptr[i]; >+ } >+ const T& operator[](size_t i) const >+ { >+ assert(i < m_size); >+ return m_ptr[i]; >+ } >+ >+ bool contains(const T& value) const >+ { >+ for (size_t i = 0; i < m_size; i++) { >+ if (m_ptr[i] == value) >+ return true; >+ } >+ return false; >+ } >+ >+ T* data() { return m_ptr; } >+ const T* data() const { return m_ptr; } >+ >+ void swap(WebVector<T>& other) >+ { >+ std::swap(m_ptr, other.m_ptr); >+ std::swap(m_size, other.m_size); >+ } >+ >+private: >+ void initialize(size_t size) >+ { >+ m_size = size; >+ if (!m_size) >+ m_ptr = 0; >+ else { >+ m_ptr = static_cast<T*>(::operator new(sizeof(T) * m_size)); >+ for (size_t i = 0; i < m_size; ++i) >+ new (&m_ptr[i]) T(); >+ } >+ } >+ >+ template <typename U> >+ void initializeFrom(const U* values, size_t size) >+ { >+ m_size = size; >+ if (!m_size) >+ m_ptr = 0; >+ else { >+ m_ptr = static_cast<T*>(::operator new(sizeof(T) * m_size)); >+ for (size_t i = 0; i < m_size; ++i) >+ new (&m_ptr[i]) T(values[i]); >+ } >+ } >+ >+ void destroy() >+ { >+ for (size_t i = 0; i < m_size; ++i) >+ m_ptr[i].~T(); >+ ::operator delete(m_ptr); >+ } >+ >+ T* m_ptr; >+ size_t m_size; >+}; >+ >+} // namespace WebKit >+ >+#endif >diff --git a/Source/Platform/nix/src/DefaultWebThemeEngine.cpp b/Source/Platform/nix/src/DefaultWebThemeEngine.cpp >new file mode 100644 >index 0000000..340fc7b >--- /dev/null >+++ b/Source/Platform/nix/src/DefaultWebThemeEngine.cpp >@@ -0,0 +1,370 @@ >+/* >+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 "DefaultWebThemeEngine.h" >+#include "public/WebColor.h" >+#include "public/WebRect.h" >+#include "public/WebSize.h" >+#include <algorithm> >+#include <cmath> >+#include <cairo/cairo.h> >+ >+const double BG_COLOR1 = 0xF6/256.0; >+const double BG_COLOR2 = 0xDE/256.0; >+const double BORDER_COLOR = 0xA4/256.0; >+const double BORDER_ONHOVER_COLOR = 0x7A/256.0; >+const double CHECK_COLOR = 0x66/256.0; >+const double TEXTFIELD_DARK_BORDER_COLOR = 0x9A/256.0; >+const double TEXTFIELD_LIGHT_BORDER_COLOR = 0xEE/256.0; >+ >+const int MENULIST_BORDER = 5; >+const int MENULIST_ARROW_SIZE = 6; >+ >+const int INNERSPINBUTTON_BORDER = 3; >+const int INNERSPINBUTTON_ARROW_SIZE = 2; >+ >+const WebKit::RGBA32 TAP_HIGHLIGHT_COLOR = 0x66000000; >+ >+namespace WebKit { >+ >+WebColor DefaultWebThemeEngine::activeSelectionBackgroundColor() const >+{ >+ return WebColor(0, 0, 255); >+} >+ >+WebColor DefaultWebThemeEngine::activeSelectionForegroundColor() const >+{ >+ return WebColor::white; >+} >+ >+WebColor DefaultWebThemeEngine::inactiveSelectionBackgroundColor() const >+{ >+ return WebColor(176, 176, 176); >+} >+ >+WebColor DefaultWebThemeEngine::inactiveSelectionForegroundColor() const >+{ >+ return WebColor::black; >+} >+ >+WebColor DefaultWebThemeEngine::activeListBoxSelectionBackgroundColor() const >+{ >+ return activeSelectionBackgroundColor(); >+} >+ >+WebColor DefaultWebThemeEngine::activeListBoxSelectionForegroundColor() const >+{ >+ return activeSelectionForegroundColor(); >+} >+ >+WebColor DefaultWebThemeEngine::inactiveListBoxSelectionBackgroundColor() const >+{ >+ return inactiveSelectionBackgroundColor(); >+} >+ >+WebColor DefaultWebThemeEngine::inactiveListBoxSelectionForegroundColor() const >+{ >+ return inactiveSelectionForegroundColor(); >+} >+ >+WebColor DefaultWebThemeEngine::activeTextSearchHighlightColor() const >+{ >+ return WebColor(255, 150, 50); // Orange. >+} >+ >+WebColor DefaultWebThemeEngine::inactiveTextSearchHighlightColor() const >+{ >+ return WebColor(255, 255, 0); // Yellow. >+} >+ >+WebColor DefaultWebThemeEngine::focusRingColor() const >+{ >+ return WebColor::black; >+} >+ >+WebColor DefaultWebThemeEngine::tapHighlightColor() const >+{ >+ return TAP_HIGHLIGHT_COLOR; >+} >+ >+static void gradientFill(cairo_t* cairo, double yStart, double yLength, bool inverted = false) >+{ >+ double gradStartColor = BG_COLOR1; >+ double gradEndColor = BG_COLOR2; >+ if (inverted) >+ std::swap(gradStartColor, gradEndColor); >+ >+ cairo_pattern_t* gradient = cairo_pattern_create_linear(0, yStart, 0, yStart + yLength); >+ cairo_pattern_add_color_stop_rgb(gradient, 0, gradStartColor, gradStartColor, gradStartColor); >+ cairo_pattern_add_color_stop_rgb(gradient, 1, gradEndColor, gradEndColor, gradEndColor); >+ cairo_set_source(cairo, gradient); >+ cairo_fill(cairo); >+ cairo_pattern_destroy(gradient); >+} >+ >+static void setupBorder(cairo_t * cairo, WebThemeEngine::State state) >+{ >+ double borderColor = state == WebThemeEngine::StateHover ? BORDER_ONHOVER_COLOR : BORDER_COLOR; >+ cairo_set_source_rgb(cairo, borderColor, borderColor, borderColor); >+ cairo_set_line_width(cairo, 1); >+} >+ >+void DefaultWebThemeEngine::paintButton(WebCanvas* canvas, State state, const WebRect& rect, const ButtonExtraParams&) const >+{ >+ cairo_save(canvas); >+ setupBorder(canvas, state); >+ // Cairo uses a coordinate system not based on pixel coordinates, so >+ // we need to add 0.5 to x and y coord or the line will stay between >+ // two pixels instead of in the middle of a pixel. >+ cairo_rectangle(canvas, rect.x + 0.5, rect.y + 0.5, rect.width, rect.height); >+ cairo_stroke_preserve(canvas); >+ >+ gradientFill(canvas, rect.y, rect.height, state == StatePressed); >+ cairo_restore(canvas); >+} >+ >+void DefaultWebThemeEngine::paintTextField(WebCanvas* canvas, State, const WebRect& rect) const >+{ >+ cairo_save(canvas); >+ >+ const double lineWidth = 2; >+ const double correction = lineWidth / 2.0; >+ >+ cairo_set_line_width(canvas, lineWidth); >+ cairo_set_source_rgb(canvas, TEXTFIELD_DARK_BORDER_COLOR, TEXTFIELD_DARK_BORDER_COLOR, TEXTFIELD_DARK_BORDER_COLOR); >+ cairo_move_to(canvas, rect.x + correction, rect.y + correction + rect.height); >+ cairo_rel_line_to(canvas, 0, -rect.height); >+ cairo_rel_line_to(canvas, rect.width, 0); >+ cairo_stroke(canvas); >+ >+ cairo_set_source_rgb(canvas, TEXTFIELD_LIGHT_BORDER_COLOR, TEXTFIELD_LIGHT_BORDER_COLOR, TEXTFIELD_LIGHT_BORDER_COLOR); >+ cairo_move_to(canvas, rect.x + correction + rect.width, rect.y + correction); >+ cairo_rel_line_to(canvas, 0, rect.height); >+ cairo_rel_line_to(canvas, -rect.width, 0); >+ cairo_stroke(canvas); >+ >+ cairo_restore(canvas); >+} >+ >+void DefaultWebThemeEngine::paintTextArea(WebCanvas* canvas, State state, const WebRect& rect) const >+{ >+ paintTextField(canvas, state, rect); >+} >+ >+WebSize DefaultWebThemeEngine::getCheckboxSize() const >+{ >+ return WebSize(13, 13); >+} >+ >+void DefaultWebThemeEngine::paintCheckbox(WebCanvas* canvas, State state, const WebRect& rect, const ButtonExtraParams& param) const >+{ >+ cairo_save(canvas); >+ setupBorder(canvas, state); >+ cairo_rectangle(canvas, rect.x + 0.5, rect.y + 0.5, rect.width, rect.height); >+ cairo_stroke_preserve(canvas); >+ >+ gradientFill(canvas, rect.y, rect.height, state == StatePressed); >+ >+ if (param.checked) { >+ const double border = 3; >+ cairo_set_line_width(canvas, 2); >+ cairo_set_source_rgb(canvas, CHECK_COLOR, CHECK_COLOR, CHECK_COLOR); >+ cairo_move_to(canvas, rect.x + 0.5 + border, rect.y + 0.5 + rect.height - border); >+ cairo_rel_line_to(canvas, rect.width - border * 2, -rect.height + border * 2); >+ cairo_move_to(canvas, rect.x + 0.5 + border, rect.y + 0.5 + border); >+ cairo_rel_line_to(canvas, rect.width - border * 2, rect.height - border * 2); >+ cairo_stroke(canvas); >+ } >+ >+ cairo_restore(canvas); >+} >+ >+WebSize DefaultWebThemeEngine::getRadioSize() const >+{ >+ return WebSize(13, 13); >+} >+ >+void DefaultWebThemeEngine::paintRadio(WebCanvas* canvas, State state, const WebRect& rect, const ButtonExtraParams& param) const >+{ >+ cairo_save(canvas); >+ setupBorder(canvas, state); >+ cairo_arc(canvas, rect.x + rect.width/2.0, rect.y + rect.height/2.0, rect.width/2.0, 0, 2 * M_PI); >+ cairo_stroke_preserve(canvas); >+ >+ gradientFill(canvas, rect.y, rect.height); >+ >+ if (param.checked) { >+ cairo_set_source_rgb(canvas, CHECK_COLOR, CHECK_COLOR, CHECK_COLOR); >+ cairo_arc(canvas, rect.x + rect.width/2.0, rect.y + rect.height/2.0, rect.width/4.0, 0, 2 * M_PI); >+ cairo_fill(canvas); >+ } >+ cairo_restore(canvas); >+} >+ >+void DefaultWebThemeEngine::getMenuListPadding(int& paddingTop, int& paddingLeft, int& paddingBottom, int& paddingRight) const >+{ >+ paddingTop = MENULIST_BORDER; >+ paddingLeft = MENULIST_BORDER; >+ paddingBottom = MENULIST_BORDER; >+ paddingRight = 2 * MENULIST_BORDER + MENULIST_ARROW_SIZE; >+} >+ >+void DefaultWebThemeEngine::paintMenuList(WebCanvas* canvas, State state, const WebRect& rect) const >+{ >+ cairo_save(canvas); >+ setupBorder(canvas, state); >+ cairo_rectangle(canvas, rect.x + 0.5, rect.y + 0.5, rect.width, rect.height); >+ cairo_stroke_preserve(canvas); >+ >+ gradientFill(canvas, rect.y, rect.height, state == StatePressed); >+ >+ cairo_move_to(canvas, rect.x + rect.width - MENULIST_ARROW_SIZE - MENULIST_BORDER, rect.y + 1 + rect.height/2 - MENULIST_ARROW_SIZE/2); >+ cairo_set_source_rgb(canvas, CHECK_COLOR, CHECK_COLOR, CHECK_COLOR); >+ cairo_rel_line_to(canvas, MENULIST_ARROW_SIZE, 0); >+ cairo_rel_line_to(canvas, -MENULIST_ARROW_SIZE/2, MENULIST_ARROW_SIZE); >+ cairo_close_path(canvas); >+ cairo_fill(canvas); >+ >+ cairo_restore(canvas); >+} >+ >+WebSize DefaultWebThemeEngine::getProgressBarSize() const >+{ >+ return WebSize(2000, 300); >+} >+ >+void DefaultWebThemeEngine::paintProgressBar(WebCanvas* canvas, State state, const WebRect& rect, const ProgressBarExtraParams& params) const >+{ >+ cairo_save(canvas); >+ >+ if (params.isDeterminate) { >+ // Background >+ setupBorder(canvas, state); >+ cairo_rectangle(canvas, rect.x, rect.y, rect.width, rect.height); >+ cairo_fill(canvas); >+ // Progress >+ cairo_rectangle(canvas, rect.x, rect.y, rect.width * params.position, rect.height); >+ gradientFill(canvas, rect.y, rect.height); >+ } else { >+ cairo_rectangle(canvas, rect.x, rect.y, rect.width, rect.height); >+ gradientFill(canvas, rect.y, rect.height, true); >+ } >+ >+ cairo_restore(canvas); >+} >+ >+// These values have been copied from RenderThemeChromiumSkia.cpp >+static const int progressActivityBlocks = 5; >+static const int progressAnimationFrames = 10; >+static const double progressAnimationInterval = 0.125; >+ >+double DefaultWebThemeEngine::getAnimationRepeatIntervalForProgressBar() const >+{ >+ return progressAnimationInterval; >+} >+ >+double DefaultWebThemeEngine::getAnimationDurationForProgressBar() const >+{ >+ return progressAnimationInterval * progressAnimationFrames * 2; // "2" for back and forth; >+} >+ >+void DefaultWebThemeEngine::getInnerSpinButtonPadding(int& paddingTop, int& paddingLeft, int& paddingBottom, int& paddingRight) const >+{ >+ paddingTop = INNERSPINBUTTON_BORDER; >+ paddingLeft = INNERSPINBUTTON_BORDER; >+ paddingBottom = INNERSPINBUTTON_BORDER; >+ paddingRight = 2 * INNERSPINBUTTON_BORDER + INNERSPINBUTTON_ARROW_SIZE; >+} >+ >+void DefaultWebThemeEngine::paintInnerSpinButton(WebCanvas* canvas, State state, const WebRect& rect, const InnerSpinButtonExtraParams& param) const >+{ >+ double rectHalfHeight = rect.height / 2; >+ >+ cairo_save(canvas); >+ setupBorder(canvas, state); >+ cairo_rectangle(canvas, rect.x + 0.5, rect.y + 1.5, rect.width, rectHalfHeight); >+ cairo_stroke_preserve(canvas); >+ >+ gradientFill(canvas, rect.y, rectHalfHeight, state == StatePressed && param.spinUp); >+ >+ setupBorder(canvas, state); >+ cairo_rectangle(canvas, rect.x + 0.5, rect.y + 0.5 + rectHalfHeight, rect.width, rectHalfHeight); >+ cairo_stroke_preserve(canvas); >+ >+ gradientFill(canvas, rect.y + rectHalfHeight, rectHalfHeight, state == StatePressed && !param.spinUp); >+ >+ cairo_move_to(canvas, rect.x + rect.width - INNERSPINBUTTON_ARROW_SIZE - INNERSPINBUTTON_BORDER * 2, rect.y + rectHalfHeight + rect.height/4 - INNERSPINBUTTON_ARROW_SIZE + 1.5); >+ cairo_set_source_rgb(canvas, CHECK_COLOR, CHECK_COLOR, CHECK_COLOR); >+ cairo_rel_line_to(canvas, MENULIST_ARROW_SIZE, 0); >+ cairo_rel_line_to(canvas, -MENULIST_ARROW_SIZE / 2, MENULIST_ARROW_SIZE); >+ cairo_close_path(canvas); >+ >+ cairo_move_to(canvas, rect.x + rect.width - INNERSPINBUTTON_ARROW_SIZE - INNERSPINBUTTON_BORDER * 2, rect.y + rect.height/4 + INNERSPINBUTTON_ARROW_SIZE); >+ cairo_set_source_rgb(canvas, CHECK_COLOR, CHECK_COLOR, CHECK_COLOR); >+ cairo_rel_line_to(canvas, MENULIST_ARROW_SIZE, 0); >+ cairo_rel_line_to(canvas, -MENULIST_ARROW_SIZE / 2, -MENULIST_ARROW_SIZE); >+ cairo_close_path(canvas); >+ >+ cairo_fill(canvas); >+} >+ >+void DefaultWebThemeEngine::paintMeter(WebCanvas* canvas, State state, const WebRect& rect, const MeterExtraParams& params) const >+{ >+ cairo_save(canvas); >+ >+ // Background >+ setupBorder(canvas, state); >+ cairo_rectangle(canvas, rect.x, rect.y, rect.width, rect.height); >+ cairo_fill(canvas); >+ // Meter >+ cairo_rectangle(canvas, rect.x, rect.y, rect.width * params.valueRatio(), rect.height); >+ gradientFill(canvas, rect.y, rect.height); >+ >+ cairo_restore(canvas); >+} >+ >+const int SLIDER_TRACK_HEIGHT = 6; >+ >+void DefaultWebThemeEngine::paintSliderTrack(WebCanvas* canvas, State, const WebRect& rect) const >+{ >+ cairo_save(canvas); >+ cairo_rectangle(canvas, rect.x, rect.y + (rect.height - SLIDER_TRACK_HEIGHT) / 2.0, rect.width, SLIDER_TRACK_HEIGHT); >+ gradientFill(canvas, rect.y, rect.height, true); >+ cairo_restore(canvas); >+} >+ >+void DefaultWebThemeEngine::paintSliderThumb(WebCanvas* canvas, State state, const WebRect& rect) const >+{ >+ cairo_save(canvas); >+ setupBorder(canvas, state); >+ cairo_rectangle(canvas, rect.x, rect.y, rect.width, rect.height); >+ cairo_stroke_preserve(canvas); >+ gradientFill(canvas, rect.y, rect.height, state == StatePressed); >+ cairo_restore(canvas); >+} >+ >+} >diff --git a/Source/Platform/nix/src/DefaultWebThemeEngine.h b/Source/Platform/nix/src/DefaultWebThemeEngine.h >new file mode 100644 >index 0000000..569a529 >--- /dev/null >+++ b/Source/Platform/nix/src/DefaultWebThemeEngine.h >@@ -0,0 +1,50 @@ >+#ifndef DefaultWebThemeEngine_h >+#define DefaultWebThemeEngine_h >+ >+#include "public/WebThemeEngine.h" >+ >+namespace WebKit { >+ >+class DefaultWebThemeEngine : public WebThemeEngine { >+public: >+ // Text selection colors. >+ virtual WebColor activeSelectionBackgroundColor() const; >+ virtual WebColor activeSelectionForegroundColor() const; >+ virtual WebColor inactiveSelectionBackgroundColor() const; >+ virtual WebColor inactiveSelectionForegroundColor() const; >+ >+ // List box selection colors >+ virtual WebColor activeListBoxSelectionBackgroundColor() const; >+ virtual WebColor activeListBoxSelectionForegroundColor() const; >+ virtual WebColor inactiveListBoxSelectionBackgroundColor() const; >+ virtual WebColor inactiveListBoxSelectionForegroundColor() const; >+ >+ virtual WebColor activeTextSearchHighlightColor() const; >+ virtual WebColor inactiveTextSearchHighlightColor() const; >+ >+ virtual WebColor focusRingColor() const; >+ >+ virtual WebColor tapHighlightColor() const; >+ >+ virtual void paintButton(WebCanvas*, State state, const WebRect&, const ButtonExtraParams&) const; >+ virtual void paintTextField(WebCanvas*, State, const WebRect&) const; >+ virtual void paintTextArea(WebCanvas*, State, const WebRect&) const; >+ virtual WebSize getCheckboxSize() const; >+ virtual void paintCheckbox(WebCanvas*, State, const WebRect&, const ButtonExtraParams&) const; >+ virtual WebSize getRadioSize() const; >+ virtual void paintRadio(WebCanvas*, State, const WebRect&, const ButtonExtraParams&) const; >+ virtual void paintMenuList(WebCanvas *, State, const WebRect &) const; >+ virtual void getMenuListPadding(int& paddingTop, int& paddingLeft, int& paddingBottom, int& paddingRight) const; >+ virtual WebSize getProgressBarSize() const; >+ virtual void paintProgressBar(WebCanvas*, State, const WebRect&, const ProgressBarExtraParams&) const; >+ virtual double getAnimationRepeatIntervalForProgressBar() const; >+ virtual double getAnimationDurationForProgressBar() const; >+ virtual void paintInnerSpinButton(WebCanvas *, State, const WebRect &, const InnerSpinButtonExtraParams&) const; >+ virtual void getInnerSpinButtonPadding(int& paddingTop, int& paddingLeft, int& paddingBottom, int& paddingRight) const; >+ virtual void paintMeter(WebCanvas*, State, const WebRect&, const MeterExtraParams&) const; >+ virtual void paintSliderTrack(WebCanvas*, State, const WebRect&) const; >+ virtual void paintSliderThumb(WebCanvas*, State, const WebRect&) const; >+}; >+ >+} >+#endif >diff --git a/Source/Platform/nix/src/Platform.cpp b/Source/Platform/nix/src/Platform.cpp >new file mode 100644 >index 0000000..6654a94 >--- /dev/null >+++ b/Source/Platform/nix/src/Platform.cpp >@@ -0,0 +1,70 @@ >+/* >+ * Copyright (C) 2012 Google Inc. All rights reserved. >+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 "public/Platform.h" >+#include "DefaultWebThemeEngine.h" >+ >+#include <wtf/PassOwnPtr.h> >+#include <wtf/OwnPtr.h> >+ >+namespace WebKit { >+ >+class EmptyPlatform : public Platform { >+public: >+ ~EmptyPlatform() { } >+}; >+static WTF::OwnPtr<EmptyPlatform> s_emptyPlatform = WTF::adoptPtr(new EmptyPlatform()); >+ >+static Platform* s_platform = s_emptyPlatform.get(); >+ >+void Platform::initialize(Platform* platform) >+{ >+ s_platform = platform; >+} >+ >+void Platform::shutdown() >+{ >+ s_platform = 0; >+} >+ >+Platform* Platform::current() >+{ >+ return s_platform; >+} >+ >+WebThemeEngine* Platform::themeEngine() >+{ >+ static DefaultWebThemeEngine theme; >+ return &theme; >+} >+ >+} // namespace WebKit >diff --git a/Source/WTF/wtf/FeatureDefines.h b/Source/WTF/wtf/FeatureDefines.h >index 7329c95..2a02048 100644 >--- a/Source/WTF/wtf/FeatureDefines.h >+++ b/Source/WTF/wtf/FeatureDefines.h >@@ -235,6 +235,11 @@ > > #endif /* PLATFORM(WIN_CAIRO) */ > >+/* --------- NIX port (Unix) --------- */ >+#if PLATFORM(NIX) >+#include "nix/FeatureDefinesNix.h" >+#endif /* PLATFORM(NIX) */ >+ > /* --------- EFL port (Unix) --------- */ > #if PLATFORM(EFL) > >diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h >index 76fc145..b8e14ba 100644 >--- a/Source/WTF/wtf/Platform.h >+++ b/Source/WTF/wtf/Platform.h >@@ -446,6 +446,8 @@ > #define WTF_PLATFORM_GTK 1 > #elif defined(BUILDING_BLACKBERRY__) > #define WTF_PLATFORM_BLACKBERRY 1 >+#elif defined(BUILDING_NIX__) >+#include "nix/PlatformNix.h" > #elif OS(DARWIN) > #define WTF_PLATFORM_MAC 1 > #elif OS(WINDOWS) >diff --git a/Source/WTF/wtf/PlatformNix.cmake b/Source/WTF/wtf/PlatformNix.cmake >new file mode 100644 >index 0000000..f732e60 >--- /dev/null >+++ b/Source/WTF/wtf/PlatformNix.cmake >@@ -0,0 +1,16 @@ >+list(APPEND WTF_SOURCES >+ gtk/MainThreadGtk.cpp >+ gobject/GOwnPtr.cpp >+ gobject/GRefPtr.cpp >+ gobject/GlibUtilities.cpp >+) >+ >+list(APPEND WTF_LIBRARIES >+ pthread >+ ${GLIB_LIBRARIES} >+ ${GLIB_GIO_LIBRARIES} >+) >+ >+list(APPEND WTF_INCLUDE_DIRECTORIES >+ ${GLIB_INCLUDE_DIRS} >+) >diff --git a/Source/WTF/wtf/nix/FeatureDefinesNix.h b/Source/WTF/wtf/nix/FeatureDefinesNix.h >new file mode 100644 >index 0000000..3432ad0 >--- /dev/null >+++ b/Source/WTF/wtf/nix/FeatureDefinesNix.h >@@ -0,0 +1,281 @@ >+/* >+* Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). >+* >+* 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 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. >+*/ >+ >+#ifndef WTF_FeatureDefinesNix_h >+#define WTF_FeatureDefinesNix_h >+ >+#if !defined(ENABLE_3D_RENDERING) >+#define ENABLE_3D_RENDERING 1 >+#endif >+ >+#if !defined(ENABLE_ACCELERATED_2D_CANVAS) >+#define ENABLE_ACCELERATED_2D_CANVAS 0 >+#endif >+ >+#if !defined(ENABLE_ACCELERATED_OVERFLOW_SCROLLING) >+#define ENABLE_ACCELERATED_OVERFLOW_SCROLLING 1 >+#endif >+ >+#if !defined(ENABLE_BLOB) >+#define ENABLE_BLOB 1 >+#endif >+ >+#if !defined(ENABLE_CHANNEL_MESSAGING) >+#define ENABLE_CHANNEL_MESSAGING 1 >+#endif >+ >+#if !defined(ENABLE_CONTEXT_MENUS) >+#define ENABLE_CONTEXT_MENUS 1 >+#endif >+ >+#if !defined(ENABLE_CSS3_TEXT) >+#define ENABLE_CSS3_TEXT 1 >+#endif >+ >+#if !defined(ENABLE_CSS_BOX_DECORATION_BREAK) >+#define ENABLE_CSS_BOX_DECORATION_BREAK 1 >+#endif >+ >+#if !defined(ENABLE_CSS_EXCLUSIONS) >+#define ENABLE_CSS_EXCLUSIONS 1 >+#endif >+ >+#if !defined(ENABLE_CSS_FILTERS) >+#define ENABLE_CSS_FILTERS 1 >+#endif >+ >+#if !defined(ENABLE_CSS_IMAGE_ORIENTATION) >+#define ENABLE_CSS_IMAGE_ORIENTATION 1 >+#endif >+ >+#if !defined(ENABLE_CSS_IMAGE_RESOLUTION) >+#define ENABLE_CSS_IMAGE_RESOLUTION 1 >+#endif >+ >+#if !defined(ENABLE_CSS_IMAGE_SET) >+#define ENABLE_CSS_IMAGE_SET 1 >+#endif >+ >+#if !defined(ENABLE_CSS_REGIONS) >+#define ENABLE_CSS_REGIONS 1 >+#endif >+ >+#if !defined(ENABLE_CSS_SHADERS) >+#define ENABLE_CSS_SHADERS 1 >+#endif >+ >+#if !defined(ENABLE_CSS_VARIABLES) >+#define ENABLE_CSS_VARIABLES 1 >+#endif >+ >+#if !defined(ENABLE_DATALIST_ELEMENT) >+#define ENABLE_DATALIST_ELEMENT 1 >+#endif >+ >+#if !defined(ENABLE_DETAILS_ELEMENT) >+#define ENABLE_DETAILS_ELEMENT 1 >+#endif >+ >+#if !defined(ENABLE_DRAG_SUPPORT) >+#define ENABLE_DRAG_SUPPORT 0 >+#endif >+ >+#if !defined(ENABLE_FAST_MOBILE_SCROLLING) >+#define ENABLE_FAST_MOBILE_SCROLLING 1 >+#endif >+ >+#if !defined(ENABLE_FILTERS) >+#define ENABLE_FILTERS 1 >+#endif >+ >+#if !defined(ENABLE_FTPDIR) >+#define ENABLE_FTPDIR 1 >+#endif >+ >+#if !defined(ENABLE_FULLSCREEN_API) >+#define ENABLE_FULLSCREEN_API 0 >+#endif >+ >+#if !defined(ENABLE_GAMEPAD) >+#define ENABLE_GAMEPAD 1 >+#endif >+ >+#if !defined(ENABLE_GESTURE_EVENTS) >+#define ENABLE_GESTURE_EVENTS 1 >+#endif >+ >+#if !defined(ENABLE_ICONDATABASE) >+#define ENABLE_ICONDATABASE 1 >+#endif >+ >+#if !defined(ENABLE_IFRAME_SEAMLESS) >+#define ENABLE_IFRAME_SEAMLESS 1 >+#endif >+ >+#if !defined(ENABLE_INDEXED_DATABASE) >+#define ENABLE_INDEXED_DATABASE 1 >+#endif >+ >+#if !defined(ENABLE_INSPECTOR) >+#define ENABLE_INSPECTOR 1 >+#endif >+ >+#if !defined(ENABLE_INSPECTOR_SERVER) >+#define ENABLE_INSPECTOR_SERVER 1 >+#endif >+ >+#if !defined(ENABLE_JAVASCRIPT_DEBUGGER) >+#define ENABLE_JAVASCRIPT_DEBUGGER 1 >+#endif >+ >+#if !defined(ENABLE_JIT) >+#define ENABLE_JIT 1 >+#endif >+ >+#if !defined(ENABLE_LEGACY_VENDOR_PREFIXES) >+#define ENABLE_LEGACY_VENDOR_PREFIXES 0 >+#endif >+ >+#if !defined(ENABLE_LEGACY_VIEWPORT_ADAPTION) >+#define ENABLE_LEGACY_VIEWPORT_ADAPTION 1 >+#endif >+ >+#if !defined(ENABLE_LEGACY_WEB_AUDIO) >+#define ENABLE_LEGACY_WEB_AUDIO 1 >+#endif >+ >+#if !defined(ENABLE_LLINT) >+#define ENABLE_LLINT 1 >+#endif >+ >+#if !defined(ENABLE_MATHML) >+#define ENABLE_MATHML 1 >+#endif >+ >+#if !defined(ENABLE_METER_ELEMENT) >+#define ENABLE_METER_ELEMENT 1 >+#endif >+ >+#if !defined(ENABLE_MICRODATA) >+#define ENABLE_MICRODATA 1 >+#endif >+ >+#if !defined(ENABLE_NAVIGATOR_CONTENT_UTILS) >+#define ENABLE_NAVIGATOR_CONTENT_UTILS 1 >+#endif >+ >+#if !defined(ENABLE_NETSCAPE_PLUGIN_API) >+#define ENABLE_NETSCAPE_PLUGIN_API 0 >+#endif >+ >+#if !defined(ENABLE_NETWORK_INFO) >+#define ENABLE_NETWORK_INFO 1 >+#endif >+ >+#if !defined(ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH) >+#define ENABLE_PLUGIN_PACKAGE_SIMPLE_HASH 1 >+#endif >+ >+#if !defined(ENABLE_POPUP_MENUS) >+#define ENABLE_POPUP_MENUS 1 >+#endif >+ >+#if !defined(ENABLE_PROGRESS_ELEMENT) >+#define ENABLE_PROGRESS_ELEMENT 1 >+#endif >+ >+#if !defined(ENABLE_REQUEST_ANIMATION_FRAME) >+#define ENABLE_REQUEST_ANIMATION_FRAME 1 >+#endif >+ >+#if !defined(ENABLE_CSS_SHAPES) >+#define ENABLE_CSS_SHAPES 1 >+#endif >+ >+#if !defined(ENABLE_SHARED_WORKERS) >+#define ENABLE_SHARED_WORKERS 1 >+#endif >+ >+#if !defined(ENABLE_SQL_DATABASE) >+#define ENABLE_SQL_DATABASE 1 >+#endif >+ >+#if !defined(ENABLE_SVG) >+#define ENABLE_SVG 1 >+#endif >+ >+#if !defined(ENABLE_SVG_FONTS) >+#define ENABLE_SVG_FONTS 1 >+#endif >+ >+#if !defined(ENABLE_TOUCH_ADJUSTMENT) >+#define ENABLE_TOUCH_ADJUSTMENT 1 >+#endif >+ >+#if !defined(ENABLE_TOUCH_EVENTS) >+#define ENABLE_TOUCH_EVENTS 1 >+#endif >+ >+#if !defined(ENABLE_UNDO_MANAGER) >+#define ENABLE_UNDO_MANAGER 0 >+#endif >+ >+#if !defined(ENABLE_VIDEO) >+#define ENABLE_VIDEO 0 >+#endif >+ >+#if !defined(ENABLE_VIEW_MODE_CSS_MEDIA) >+#define ENABLE_VIEW_MODE_CSS_MEDIA 1 >+#endif >+ >+#if !defined(ENABLE_WEB_AUDIO) >+#define ENABLE_WEB_AUDIO 1 >+#endif >+ >+#if !defined(ENABLE_WEBGL) >+#define ENABLE_WEBGL 1 >+#endif >+ >+#if !defined(ENABLE_WEB_SOCKETS) >+#define ENABLE_WEB_SOCKETS 1 >+#endif >+ >+#if !defined(ENABLE_WEB_TIMING) >+#define ENABLE_WEB_TIMING 1 >+#endif >+ >+#if !defined(ENABLE_WORKERS) >+#define ENABLE_WORKERS 1 >+#endif >+ >+#if !defined(ENABLE_XHR_RESPONSE_BLOB) >+#define ENABLE_XHR_RESPONSE_BLOB 1 >+#endif >+ >+#if !defined(ENABLE_XSLT) >+#define ENABLE_XSLT 1 >+#endif >+ >+#endif >diff --git a/Source/WTF/wtf/nix/PlatformNix.h b/Source/WTF/wtf/nix/PlatformNix.h >new file mode 100644 >index 0000000..70d53a3 >--- /dev/null >+++ b/Source/WTF/wtf/nix/PlatformNix.h >@@ -0,0 +1,66 @@ >+/* >+* Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies). >+* >+* 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 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. >+*/ >+ >+#ifndef WTF_PlatformNix_h >+#define WTF_PlatformNix_h >+ >+#define WTF_PLATFORM_NIX 1 >+#define ENABLE_GLOBAL_FASTMALLOC_NEW 0 >+ >+// Some bits can't be changed at all >+#define WTF_USE_3D_GRAPHICS 1 >+#define WTF_USE_ACCELERATED_COMPOSITING 1 >+#define WTF_USE_CAIRO 1 >+#define WTF_USE_COORDINATED_GRAPHICS 1 >+#define WTF_USE_CROSS_PLATFORM_CONTEXT_MENUS 1 >+#define WTF_USE_FREETYPE 1 >+#define WTF_USE_GLIB 1 >+#define WTF_USE_HARFBUZZ 1 >+#define WTF_USE_HARFBUZZ_NG 1 >+#define WTF_USE_ICU_UNICODE 1 >+#define WTF_USE_IOSURFACE_CANVAS_BACKING_STORE 1 >+#define WTF_USE_LEVELDB 1 >+#define WTF_USE_PTHREADS 1 >+#define WTF_USE_TEXTURE_MAPPER 1 >+#define WTF_USE_TEXTURE_MAPPER_GL 1 >+#define WTF_USE_TILED_BACKING_STORE 1 >+#define WTF_USE_UNIX_DOMAIN_SOCKETS 1 >+ >+// EGL/OpenGLES2 vs GLX >+#if !defined(WTF_USE_OPENGL_ES_2) || !WTF_USE_OPENGL_ES_2 >+#define WTF_USE_OPENGL 1 >+#define WTF_USE_GLX 1 >+#define WTF_PLATFORM_X11 1 >+#define WTF_USE_GRAPHICS_SURFACE 1 >+#else >+#define WTF_USE_EGL 1 >+#endif >+ >+// Soup vs libCurl >+#if !defined(WTF_USE_CURL) || !WTF_USE_CURL >+#define WTF_USE_SOUP 1 >+#endif >+ >+#endif >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index c1ace5e..3346047 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -2831,16 +2831,18 @@ endif () > > if (WTF_USE_3D_GRAPHICS) > list(APPEND WebCore_INCLUDE_DIRECTORIES >- ${OPENGL_INCLUDE_DIR} > "${THIRDPARTY_DIR}/ANGLE/src" > "${THIRDPARTY_DIR}/ANGLE/include" > "${THIRDPARTY_DIR}/ANGLE/include/KHR" > "${THIRDPARTY_DIR}/ANGLE/include/GLSLANG" > "${WEBCORE_DIR}/platform/graphics/gpu" > ) >- list(APPEND WebCore_LIBRARIES >- ${OPENGL_gl_LIBRARY} >- ) >+ >+ # Nix may use either OpenGL or OpenGLES2 headers, so we handle this at PlatformNix.cmake. >+ if (NOT PORT STREQUAL "Nix") >+ list(APPEND WebCore_INCLUDE_DIRECTORIES ${OPENGL_INCLUDE_DIR}) >+ list(APPEND WebCore_LIBRARIES ${OPENGL_gl_LIBRARY}) >+ endif () > > if (BISON_VERSION EQUAL "2.5") > # Bison 2.5 can not compile generated glslang. >diff --git a/Source/WebCore/PlatformNix.cmake b/Source/WebCore/PlatformNix.cmake >new file mode 100644 >index 0000000..6f32d62 >--- /dev/null >+++ b/Source/WebCore/PlatformNix.cmake >@@ -0,0 +1,265 @@ >+list(APPEND WebCore_INCLUDE_DIRECTORIES >+ "${WEBCORE_DIR}/platform/nix" >+ "${WEBCORE_DIR}/platform/cairo" >+ "${WEBCORE_DIR}/platform/graphics/cairo" >+ "${WEBCORE_DIR}/platform/graphics/freetype" >+ "${WEBCORE_DIR}/platform/graphics/glx" >+ "${WEBCORE_DIR}/platform/graphics/harfbuzz/" >+ "${WEBCORE_DIR}/platform/graphics/harfbuzz/ng" >+ "${WEBCORE_DIR}/platform/graphics/opengl" >+ "${WEBCORE_DIR}/platform/graphics/surfaces" >+ "${WEBCORE_DIR}/platform/graphics/texmap" >+ "${WEBCORE_DIR}/platform/linux" >+ "${WEBCORE_DIR}/platform/mediastream/gstreamer" >+ "${PLATFORM_DIR}/nix/" >+) >+ >+list(APPEND WebCore_SOURCES >+ page/TouchAdjustment.cpp >+ >+ page/nix/EventHandlerNix.cpp >+ platform/Cursor.cpp >+ platform/ContextMenuNone.cpp >+ platform/ContextMenuItemNone.cpp >+ platform/nix/CursorNix.cpp >+ platform/nix/DragDataNix.cpp >+ platform/nix/DragImageNix.cpp >+ platform/nix/NixKeyboardUtilities.cpp >+ platform/nix/ErrorsNix.cpp >+ platform/gtk/EventLoopGtk.cpp >+ platform/nix/FileSystemNix.cpp >+ platform/nix/LanguageNix.cpp >+ platform/nix/LocalizedStringsNix.cpp >+ platform/gtk/LoggingGtk.cpp >+ platform/nix/MIMETypeRegistryNix.cpp >+ platform/nix/PasteboardNix.cpp >+ platform/nix/PlatformScreenNix.cpp >+ platform/nix/PlatformKeyboardEventNix.cpp >+ platform/nix/RenderThemeNix.cpp >+ platform/nix/RunLoopNix.cpp >+ platform/nix/ScrollbarThemeNix.cpp >+ platform/gtk/SharedBufferGtk.cpp >+ platform/nix/SoundNix.cpp >+ platform/nix/SharedTimerNix.cpp >+ platform/nix/TemporaryLinkStubs.cpp >+ platform/nix/WidgetNix.cpp >+ >+ platform/cairo/WidgetBackingStoreCairo.cpp >+ platform/graphics/cairo/BitmapImageCairo.cpp >+ platform/graphics/cairo/CairoUtilities.cpp >+ platform/graphics/cairo/FontCairo.cpp >+ platform/graphics/cairo/GradientCairo.cpp >+ platform/graphics/cairo/GraphicsContextCairo.cpp >+ platform/graphics/cairo/ImageBufferCairo.cpp >+ platform/graphics/cairo/ImageCairo.cpp >+ platform/graphics/cairo/IntRectCairo.cpp >+ platform/graphics/cairo/OwnPtrCairo.cpp >+ platform/graphics/cairo/PathCairo.cpp >+ platform/graphics/cairo/PatternCairo.cpp >+ platform/graphics/cairo/PlatformContextCairo.cpp >+ platform/graphics/cairo/PlatformPathCairo.cpp >+ platform/graphics/cairo/RefPtrCairo.cpp >+ platform/graphics/cairo/TileCairo.cpp >+ platform/graphics/cairo/TiledBackingStoreBackendCairo.cpp >+ platform/graphics/cairo/TransformationMatrixCairo.cpp >+ >+ platform/image-decoders/cairo/ImageDecoderCairo.cpp >+ >+ platform/graphics/WOFFFileFormat.cpp >+ platform/graphics/cairo/FontCairoHarfbuzzNG.cpp >+ platform/graphics/freetype/FontCacheFreeType.cpp >+ platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp >+ platform/graphics/freetype/FontPlatformDataFreeType.cpp >+ platform/graphics/freetype/GlyphPageTreeNodeFreeType.cpp >+ platform/graphics/freetype/SimpleFontDataFreeType.cpp >+ platform/graphics/harfbuzz/HarfBuzzFace.cpp >+ platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp >+ platform/graphics/harfbuzz/HarfBuzzShaper.cpp >+ >+ platform/graphics/ImageSource.cpp >+ platform/graphics/cairo/DrawingBufferCairo.cpp >+ platform/graphics/nix/IconNix.cpp >+ platform/graphics/nix/ImageNix.cpp >+ platform/graphics/OpenGLShims.cpp >+ platform/graphics/opengl/Extensions3DOpenGLCommon.cpp >+ platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp >+ platform/graphics/texmap/TextureMapperGL.cpp >+ platform/graphics/texmap/TextureMapperShaderProgram.cpp >+ platform/graphics/texmap/GraphicsLayerTextureMapper.cpp >+ >+ platform/graphics/filters/CustomFilterMeshGenerator.cpp >+ platform/graphics/filters/CustomFilterValidatedProgram.cpp >+ >+ platform/image-decoders/ImageDecoder.cpp >+ platform/image-decoders/bmp/BMPImageDecoder.cpp >+ platform/image-decoders/bmp/BMPImageReader.cpp >+ platform/image-decoders/gif/GIFImageDecoder.cpp >+ platform/image-decoders/gif/GIFImageReader.cpp >+ platform/image-decoders/ico/ICOImageDecoder.cpp >+ platform/image-decoders/jpeg/JPEGImageDecoder.cpp >+ platform/image-decoders/png/PNGImageDecoder.cpp >+ platform/image-decoders/webp/WEBPImageDecoder.cpp >+ platform/linux/GamepadDeviceLinux.cpp >+ platform/mediastream/gstreamer/MediaStreamCenterGStreamer.cpp >+ platform/PlatformStrategies.cpp >+ platform/text/nix/TextBreakIteratorInternalICUNix.cpp >+ >+ plugins/PluginDatabase.cpp >+ plugins/PluginDebug.cpp >+ plugins/PluginPackage.cpp >+ plugins/PluginStream.cpp >+ plugins/PluginView.cpp >+ plugins/PluginPackageNone.cpp >+ plugins/PluginViewNone.cpp >+ >+ editing/SmartReplaceICU.cpp >+ platform/text/LocaleNone.cpp >+ >+ platform/nix/support/WebAudioBus.cpp >+ platform/nix/support/WebData.cpp >+ >+ css/WebKitCSSArrayFunctionValue.cpp >+ css/WebKitCSSMixFunctionValue.cpp >+ css/WebKitCSSMatrix.cpp >+ css/WebKitCSSMatFunctionValue.cpp >+ rendering/style/StyleCachedShader.cpp >+ rendering/style/StyleCustomFilterProgram.cpp >+ rendering/style/StyleCustomFilterProgramCache.cpp >+) >+ >+if (WTF_USE_OPENGL_ES_2) >+ list(APPEND WebCore_SOURCES >+ platform/graphics/opengl/Extensions3DOpenGLES.cpp >+ platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp >+ ) >+ list(INSERT WebCore_INCLUDE_DIRECTORIES 0 ${OPENGLES2_INCLUDE_DIRS}) >+ list(APPEND WebCore_LIBRARIES ${OPENGLES2_LIBRARIES}) >+ add_definitions(${OPENGLES2_DEFINITIONS}) >+else () >+ list(APPEND WebCore_SOURCES >+ platform/graphics/opengl/Extensions3DOpenGL.cpp >+ platform/graphics/opengl/GraphicsContext3DOpenGL.cpp >+ ) >+ list(APPEND WebCore_LIBRARIES >+ ${OPENGL_gl_LIBRARY} >+ ) >+endif () >+ >+if (WTF_USE_EGL) >+ list(INSERT WebCore_INCLUDE_DIRECTORIES 0 >+ platform/graphics/egl >+ ${EGL_INCLUDE_DIR} >+ ) >+ list(APPEND WebCore_SOURCES >+ platform/graphics/cairo/GLContext.cpp >+ platform/graphics/cairo/GraphicsContext3DCairo.cpp >+ platform/graphics/cairo/GraphicsContext3DPrivate.cpp >+ platform/graphics/egl/GLContextFromCurrentEGL.cpp >+ ) >+ list(APPEND WebCore_LIBRARIES ${EGL_LIBRARY}) >+else () >+ list(APPEND WebCore_INCLUDE_DIRECTORIES >+ platform/graphics/surfaces/glx >+ platform/graphics/surfaces/efl >+ ${X11_X11_INCLUDE_PATH} >+ ) >+ list(APPEND WebCore_SOURCES >+ platform/graphics/efl/GraphicsContext3DEfl.cpp >+ platform/graphics/efl/GraphicsContext3DPrivate.cpp >+ platform/graphics/opengl/GLPlatformContext.cpp >+ platform/graphics/opengl/GLPlatformSurface.cpp >+ platform/graphics/surfaces/efl/GLTransportSurface.cpp >+ platform/graphics/surfaces/efl/GraphicsSurfaceCommon.cpp >+ platform/graphics/surfaces/GraphicsSurface.cpp >+ >+ platform/graphics/surfaces/glx/X11Helper.cpp >+ platform/graphics/surfaces/glx/GLXContext.cpp >+ platform/graphics/surfaces/glx/GLXSurface.cpp >+ ) >+ list(APPEND WebCore_LIBRARIES ${X11_X11_LIB} ${X11_Xcomposite_LIB} ${X11_Xrender_LIB}) >+endif () >+ >+list(APPEND WebCore_USER_AGENT_STYLE_SHEETS >+ ${WEBCORE_DIR}/css/mediaControlsNix.css >+ ${WEBCORE_DIR}/css/mediaControlsNixFullscreen.css >+) >+ >+list(APPEND WebCore_LIBRARIES >+ ${CAIRO_LIBRARIES} >+ ${FONTCONFIG_LIBRARIES} >+ ${FREETYPE_LIBRARIES} >+ ${JPEG_LIBRARY} >+ ${LIBXML2_LIBRARIES} >+ ${LIBXSLT_LIBRARIES} >+ ${PNG_LIBRARY} >+ ${SQLITE_LIBRARIES} >+ ${GLIB_LIBRARIES} >+ ${GLIB_GIO_LIBRARIES} >+ ${GLIB_GMODULE_LIBRARIES} >+ ${GLIB_GOBJECT_LIBRARIES} >+ ${ZLIB_LIBRARIES} >+ Platform >+ ${HARFBUZZ_LIBRARIES} >+) >+ >+list(APPEND WebCore_INCLUDE_DIRECTORIES >+ ${FONTCONFIG_INCLUDE_DIR} >+ ${CAIRO_INCLUDE_DIRS} >+ ${FREETYPE_INCLUDE_DIRS} >+ ${LIBXML2_INCLUDE_DIR} >+ ${LIBXSLT_INCLUDE_DIR} >+ ${SQLITE_INCLUDE_DIR} >+ ${GLIB_INCLUDE_DIRS} >+ ${ZLIB_INCLUDE_DIRS} >+ ${HARFBUZZ_INCLUDE_DIRS} >+) >+ >+add_definitions(-DDATA_DIR="${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}") >+ >+if (ENABLE_WEB_AUDIO) >+ LIST(APPEND WebCore_INCLUDE_DIRECTORIES >+ "${WEBCORE_DIR}/platform/audio/nix" >+ ) >+ LIST(APPEND WebCore_SOURCES >+ platform/audio/nix/AudioBusNix.cpp >+ platform/audio/nix/AudioDestinationNix.cpp >+ platform/audio/nix/FFTFrameNix.cpp >+ ) >+ SET(WEB_AUDIO_DIR ${CMAKE_INSTALL_PREFIX}/${DATA_INSTALL_DIR}/webaudio/resources) >+ FILE(GLOB WEB_AUDIO_DATA "${WEBCORE_DIR}/platform/audio/resources/*.wav") >+ INSTALL(FILES ${WEB_AUDIO_DATA} DESTINATION ${WEB_AUDIO_DIR}) >+ ADD_DEFINITIONS(-DUNINSTALLED_AUDIO_RESOURCES_DIR="${WEBCORE_DIR}/platform/audio/resources") >+endif () >+ >+if (ENABLE_GAMEPAD) >+ list(APPEND WebCore_SOURCES >+ platform/nix/GamepadsNix.cpp >+ ) >+endif () >+ >+list(APPEND WebCore_SOURCES >+ platform/network/soup/AuthenticationChallengeSoup.cpp >+ platform/network/soup/CookieJarSoup.cpp >+ platform/network/soup/CookieStorageSoup.cpp >+ platform/network/soup/CredentialStorageSoup.cpp >+ platform/network/soup/DNSSoup.cpp >+ platform/network/soup/GOwnPtrSoup.cpp >+ platform/network/soup/NetworkStorageSessionSoup.cpp >+ platform/network/soup/ProxyResolverSoup.cpp >+ platform/network/soup/ProxyServerSoup.cpp >+ platform/network/soup/ResourceErrorSoup.cpp >+ platform/network/soup/ResourceHandleSoup.cpp >+ platform/network/soup/ResourceRequestSoup.cpp >+ platform/network/soup/ResourceResponseSoup.cpp >+ platform/network/soup/SocketStreamHandleSoup.cpp >+ platform/network/soup/SoupURIUtils.cpp >+) >+ >+list(APPEND WebCore_INCLUDE_DIRECTORIES >+ "${WEBCORE_DIR}/platform/network/soup" >+ ${LIBSOUP_INCLUDE_DIRS} >+) >+ >+list(APPEND WebCore_LIBRARIES >+ ${LIBSOUP_LIBRARIES} >+) >diff --git a/Source/WebCore/bridge/npruntime_internal.h b/Source/WebCore/bridge/npruntime_internal.h >index 3a04512..f2b1883 100644 >--- a/Source/WebCore/bridge/npruntime_internal.h >+++ b/Source/WebCore/bridge/npruntime_internal.h >@@ -29,7 +29,7 @@ > #include "npfunctions.h" > #include "npruntime.h" > >-#if defined(MOZ_X11) >+#if defined(XP_UNIX) && defined(MOZ_X11) > #include <X11/Xresource.h> > > #undef None >diff --git a/Source/WebCore/css/mediaControlsNix.css b/Source/WebCore/css/mediaControlsNix.css >new file mode 100644 >index 0000000..b5b3665 >--- /dev/null >+++ b/Source/WebCore/css/mediaControlsNix.css >@@ -0,0 +1,203 @@ >+/* >+ * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. >+ * Copyright (C) 2011 Samsung Electronics >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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, >+ * 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. >+ */ >+ >+/* NixWebKit media controls. Extends mediaControls.css */ >+ >+audio { >+ width: 300px; >+ height: 20px; >+} >+ >+audio::-webkit-media-controls-panel, video::-webkit-media-controls-panel { >+ display: -webkit-box; >+ -webkit-box-orient: horizontal; >+ -webkit-box-align: center; >+ -webkit-user-select: none; >+ position: relative; >+ bottom: 0; >+ width: 100%; >+ z-index: 0; >+ overflow: hidden; >+ height: 20px; >+ text-align: right; >+} >+ >+video:-webkit-full-page-media::-webkit-media-controls-panel { >+ bottom: 0px; >+} >+ >+audio::-webkit-media-controls-mute-button, video::-webkit-media-controls-mute-button { >+ -webkit-appearance: media-mute-button; >+ display: -webkit-box; >+ width: 20px; >+ height: 20px; >+ position: relative; >+ z-index: 2; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+} >+ >+audio::-webkit-media-controls-play-button, video::-webkit-media-controls-play-button { >+ -webkit-appearance: media-play-button; >+ display: -webkit-box; >+ width: 20px; >+ height: 20px; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+} >+ >+audio::-webkit-media-controls-timeline-container, video::-webkit-media-controls-timeline-container { >+ -webkit-appearance: media-controls-background; >+ display: -webkit-box; >+ -webkit-box-orient: horizontal; >+ -webkit-box-align: center; >+ -webkit-box-pack: end; >+ -webkit-box-flex: 1; >+ -webkit-user-select: none; >+ height: 20px; >+} >+ >+audio::-webkit-media-controls-current-time-display, video::-webkit-media-controls-current-time-display { >+ -webkit-appearance: media-current-time-display; >+ -webkit-user-select: none; >+ display: -webkit-box; >+ height: 20px; >+ >+ padding: 4px; >+ >+ text-align: center; >+ font-size: 10px; >+ >+ color: black; >+ letter-spacing: normal; >+ word-spacing: normal; >+ line-height: normal; >+ text-transform: none; >+ text-indent: 0; >+ text-shadow: none; >+ text-decoration: none; >+ font-style: normal; >+ font-weight: normal; >+ font-family: serif; >+} >+ >+audio::-webkit-media-controls-time-remaining-display, video::-webkit-media-controls-time-remaining-display { >+ display: none; >+} >+ >+audio::-webkit-media-controls-timeline, video::-webkit-media-controls-timeline { >+ -webkit-appearance: media-slider; >+ display: -webkit-box; >+ -webkit-box-flex: 1; >+ height: 20px; >+ padding: 0px 2px; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+ margin: initial; >+} >+ >+audio::-webkit-media-controls-volume-slider-container, video::-webkit-media-controls-volume-slider-container { >+ -webkit-appearance: media-volume-slider-container; >+ position: absolute; >+ height: 100px; >+ width: 20px; >+ bottom: 20px; >+ z-index: 1; >+} >+ >+audio::-webkit-media-controls-volume-slider, video::-webkit-media-controls-volume-slider { >+ -webkit-appearance: media-volume-slider; >+ display: none; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+ margin: initial; >+} >+ >+audio::-webkit-media-controls-seek-back-button, video::-webkit-media-controls-seek-back-button { >+ -webkit-appearance: media-seek-back-button; >+ display: -webkit-box; >+ width: 20px; >+ height: 20px; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+} >+ >+audio::-webkit-media-controls-seek-forward-button, video::-webkit-media-controls-seek-forward-button { >+ -webkit-appearance: media-seek-forward-button; >+ display: -webkit-box; >+ width: 20px; >+ height: 20px; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+} >+ >+audio::-webkit-media-controls-fullscreen-button, video::-webkit-media-controls-fullscreen-button { >+ -webkit-appearance: media-fullscreen-button; >+ display: -webkit-box; >+ width: 20px; >+ height: 20px; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+} >+ >+audio::-webkit-media-controls-rewind-button, video::-webkit-media-controls-rewind-button { >+ display: none; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+} >+ >+audio::-webkit-media-controls-return-to-realtime-button, video::-webkit-media-controls-return-to-realtime-button { >+ display: none; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+} >+ >+audio::-webkit-media-controls-toggle-closed-captions-button, video::-webkit-media-controls-toggle-closed-captions-button { >+ -webkit-appearance: media-toggle-closed-captions-button; >+ display: -webkit-box; >+ width: 20px; >+ height: 20px; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+} >+ >+audio::-webkit-media-controls-volume-slider-mute-button, video::-webkit-media-controls-volume-slider-mute-button { >+ -webkit-appearance: media-volume-slider-mute-button; >+ display: none; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+} >diff --git a/Source/WebCore/css/mediaControlsNixFullscreen.css b/Source/WebCore/css/mediaControlsNixFullscreen.css >new file mode 100644 >index 0000000..633d707d >--- /dev/null >+++ b/Source/WebCore/css/mediaControlsNixFullscreen.css >@@ -0,0 +1,129 @@ >+/* >+ * Copyright (C) 2012 Samsung Electronics >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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, >+ * 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. >+ */ >+ >+/* NixWebKit media controls for fullscreen. */ >+ >+video::-webkit-media-controls-panel { >+ display: -webkit-box; >+ -webkit-box-orient: horizontal; >+ -webkit-box-align: center; >+ -webkit-user-select: none; >+ position: relative; >+ bottom: 0; >+ width: 100%; >+ z-index: 0; >+ overflow: hidden; >+ height: 20px; >+ text-align: right; >+} >+ >+video:-webkit-full-page-media::-webkit-media-controls-panel { >+ display: none; >+} >+ >+video::-webkit-media-controls-mute-button { >+ display: none; >+} >+ >+video::-webkit-media-controls-play-button { >+ -webkit-appearance: media-play-button; >+ display: -webkit-box; >+ width: 20px; >+ height: 20px; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+} >+ >+video::-webkit-media-controls-timeline-container { >+ -webkit-appearance: media-controls-background; >+ display: -webkit-box; >+ -webkit-box-orient: horizontal; >+ -webkit-box-align: center; >+ -webkit-box-pack: end; >+ -webkit-box-flex: 1; >+ -webkit-user-select: none; >+ height: 20px; >+} >+ >+video::-webkit-media-controls-current-time-display { >+ -webkit-appearance: media-current-time-display; >+ -webkit-user-select: none; >+ display: inline-block; >+ height: 20px; >+ padding: 4px; >+ text-align: center; >+ font-size: 10px; >+} >+ >+video::-webkit-media-controls-time-remaining-display { >+ display: none; >+} >+ >+video::-webkit-media-controls-timeline { >+ -webkit-appearance: media-slider; >+ display: -webkit-box; >+ -webkit-box-flex: 1; >+ height: 20px; >+ padding: 0px 2px; >+ background-color: initial; >+ border: initial; >+ color: inherit; >+ margin: initial; >+} >+ >+video::-webkit-media-controls-volume-slider-container { >+ -webkit-appearance: media-volume-slider-container; >+ display: none; >+} >+ >+video::-webkit-media-controls-volume-slider { >+ -webkit-appearance: media-volume-slider; >+ display: none; >+} >+ >+video::-webkit-media-controls-seek-back-button { >+ display: none; >+} >+ >+video::-webkit-media-controls-seek-forward-button { >+ display: none; >+} >+ >+video::-webkit-media-controls-fullscreen-button { >+ display: none; >+} >+ >+video::-webkit-media-controls-rewind-button { >+ display: none; >+} >+ >+video::-webkit-media-controls-return-to-realtime-button { >+ display: none; >+} >+ >+video::-webkit-media-controls-toggle-closed-captions-button { >+ display: none; >+} >diff --git a/Source/WebCore/loader/FrameLoader.cpp b/Source/WebCore/loader/FrameLoader.cpp >index 83d42f3..78d15e2 100644 >--- a/Source/WebCore/loader/FrameLoader.cpp >+++ b/Source/WebCore/loader/FrameLoader.cpp >@@ -898,7 +898,7 @@ ObjectContentType FrameLoader::defaultObjectContentType(const KURL& url, const S > if (mimeType.isEmpty()) > mimeType = mimeTypeFromURL(url); > >-#if !PLATFORM(MAC) && !PLATFORM(EFL) // Mac has no PluginDatabase, nor does Chromium or EFL >+#if !PLATFORM(MAC) && !PLATFORM(EFL) && !PLATFORM(NIX) // Mac has no PluginDatabase, nor does Chromium or EFL > if (mimeType.isEmpty()) { > String decodedPath = decodeURLEscapeSequences(url.path()); > mimeType = PluginDatabase::installedPlugins()->MIMETypeForExtension(decodedPath.substring(decodedPath.reverseFind('.') + 1)); >@@ -908,7 +908,7 @@ ObjectContentType FrameLoader::defaultObjectContentType(const KURL& url, const S > if (mimeType.isEmpty()) > return ObjectContentFrame; // Go ahead and hope that we can display the content. > >-#if !PLATFORM(MAC) && !PLATFORM(EFL) // Mac has no PluginDatabase, nor does Chromium or EFL >+#if !PLATFORM(MAC) && !PLATFORM(EFL) && !PLATFORM(NIX) // Mac has no PluginDatabase, nor does Chromium or EFL > bool plugInSupportsMIMEType = PluginDatabase::installedPlugins()->isMIMETypeRegistered(mimeType); > #else > bool plugInSupportsMIMEType = false; >diff --git a/Source/WebCore/page/nix/EventHandlerNix.cpp b/Source/WebCore/page/nix/EventHandlerNix.cpp >new file mode 100644 >index 0000000..0197418 >--- /dev/null >+++ b/Source/WebCore/page/nix/EventHandlerNix.cpp >@@ -0,0 +1,130 @@ >+/* >+ * Copyright (C) 2006 Zack Rusin <zack@kde.org> >+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia >+ * Copyright (C) 2009,2010 ProFUSION embedded systems >+ * Copyright (C) 2009,2010 Samsung Electronics >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 "Clipboard.h" >+#include "EventNames.h" >+#include "FloatPoint.h" >+#include "FocusController.h" >+#include "Frame.h" >+#include "FrameView.h" >+#include "KeyboardEvent.h" >+#include "MouseEventWithHitTestResults.h" >+#include "NotImplemented.h" >+#include "Page.h" >+#include "PlatformKeyboardEvent.h" >+#include "PlatformWheelEvent.h" >+#include "RenderWidget.h" >+#include "Scrollbar.h" >+ >+namespace WebCore { >+ >+#if ENABLE(DRAG_SUPPORT) >+const double EventHandler::TextDragDelay = 0.0; >+#endif >+ >+bool EventHandler::tabsToAllFormControls(KeyboardEvent*) const >+{ >+ return true; >+} >+ >+void EventHandler::focusDocumentView() >+{ >+ if (Page* page = m_frame->page()) >+ page->focusController()->setFocusedFrame(m_frame); >+} >+ >+bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults& event) >+{ >+ RenderObject* target = event.targetNode() ? event.targetNode()->renderer() : 0; >+ >+ if (!target || !target->isWidget()) >+ return false; >+ >+ return passMouseDownEventToWidget(static_cast<RenderWidget*>(target)->widget()); >+} >+ >+bool EventHandler::passWidgetMouseDownEventToWidget(RenderWidget* renderWidget) >+{ >+ return passMouseDownEventToWidget(renderWidget->widget()); >+} >+ >+bool EventHandler::passMouseDownEventToWidget(Widget*) >+{ >+ notImplemented(); >+ return false; >+} >+ >+bool EventHandler::eventActivatedView(const PlatformMouseEvent&) const >+{ >+ notImplemented(); >+ return false; >+} >+ >+bool EventHandler::passWheelEventToWidget(const PlatformWheelEvent& event, Widget* widget) >+{ >+ ASSERT(widget); >+ if (!widget->isFrameView()) >+ return false; >+ >+ return static_cast<FrameView*>(widget)->frame()->eventHandler()->handleWheelEvent(event); >+} >+ >+#if ENABLE(DRAG_SUPPORT) >+PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const >+{ >+ return Clipboard::createForDragAndDrop(); >+} >+#endif >+ >+bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) >+{ >+ subframe->eventHandler()->handleMousePressEvent(mev.event()); >+ return true; >+} >+ >+bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode) >+{ >+ subframe->eventHandler()->handleMouseMoveEvent(mev.event(), hoveredNode); >+ return true; >+} >+ >+bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) >+{ >+ subframe->eventHandler()->handleMouseReleaseEvent(mev.event()); >+ return true; >+} >+ >+unsigned EventHandler::accessKeyModifiers() >+{ >+ return PlatformEvent::AltKey; >+} >+} >diff --git a/Source/WebCore/platform/Cursor.h b/Source/WebCore/platform/Cursor.h >index c240e57..d35420d 100644 >--- a/Source/WebCore/platform/Cursor.h >+++ b/Source/WebCore/platform/Cursor.h >@@ -56,7 +56,7 @@ typedef HICON HCURSOR; > #endif > > // Looks like it's just PLATFORM(BLACKBERRY) still not using this? >-#if PLATFORM(WIN) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) >+#if PLATFORM(WIN) || PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(NIX) > #define WTF_USE_LAZY_NATIVE_CURSOR 1 > #endif > >@@ -79,7 +79,7 @@ namespace WebCore { > typedef NSCursor *PlatformCursor; > #elif PLATFORM(GTK) > typedef GRefPtr<GdkCursor> PlatformCursor; >-#elif PLATFORM(EFL) >+#elif PLATFORM(EFL) || PLATFORM(NIX) > typedef const char* PlatformCursor; > #elif PLATFORM(QT) && !defined(QT_NO_CURSOR) > // Do not need to be shared but need to be created dynamically via ensurePlatformCursor. >diff --git a/Source/WebCore/platform/DragData.h b/Source/WebCore/platform/DragData.h >index 6444926..74efff5 100644 >--- a/Source/WebCore/platform/DragData.h >+++ b/Source/WebCore/platform/DragData.h >@@ -59,7 +59,7 @@ namespace WebCore { > class DataObjectGtk; > } > typedef WebCore::DataObjectGtk* DragDataRef; >-#elif PLATFORM(EFL) || PLATFORM(BLACKBERRY) >+#elif PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(NIX) > typedef void* DragDataRef; > #endif > >diff --git a/Source/WebCore/platform/DragImage.h b/Source/WebCore/platform/DragImage.h >index ec10b2c..942331e 100644 >--- a/Source/WebCore/platform/DragImage.h >+++ b/Source/WebCore/platform/DragImage.h >@@ -41,7 +41,7 @@ class QPixmap; > QT_END_NAMESPACE > #elif PLATFORM(WIN) > typedef struct HBITMAP__* HBITMAP; >-#elif PLATFORM(GTK) >+#elif PLATFORM(GTK) || PLATFORM(NIX) > typedef struct _cairo_surface cairo_surface_t; > #endif > >@@ -60,7 +60,7 @@ namespace WebCore { > typedef QPixmap* DragImageRef; > #elif PLATFORM(WIN) > typedef HBITMAP DragImageRef; >-#elif PLATFORM(GTK) >+#elif PLATFORM(GTK) || PLATFORM(NIX) > typedef cairo_surface_t* DragImageRef; > #elif PLATFORM(EFL) || PLATFORM(BLACKBERRY) > typedef void* DragImageRef; >diff --git a/Source/WebCore/platform/FileSystem.h b/Source/WebCore/platform/FileSystem.h >index e1d5b7e..aa30c2f 100644 >--- a/Source/WebCore/platform/FileSystem.h >+++ b/Source/WebCore/platform/FileSystem.h >@@ -61,7 +61,7 @@ typedef struct HINSTANCE__* HINSTANCE; > typedef HINSTANCE HMODULE; > #endif > >-#if PLATFORM(GTK) >+#if PLATFORM(GTK) || PLATFORM(NIX) > typedef struct _GFileIOStream GFileIOStream; > typedef struct _GModule GModule; > #endif >@@ -75,7 +75,7 @@ namespace WebCore { > // PlatformModule > #if OS(WINDOWS) > typedef HMODULE PlatformModule; >-#elif PLATFORM(GTK) >+#elif PLATFORM(GTK) || PLATFORM(NIX) > typedef GModule* PlatformModule; > #elif PLATFORM(EFL) > typedef Eina_Module* PlatformModule; >@@ -120,7 +120,7 @@ typedef unsigned PlatformModuleVersion; > #if PLATFORM(QT) > typedef QFile* PlatformFileHandle; > const PlatformFileHandle invalidPlatformFileHandle = 0; >-#elif PLATFORM(GTK) >+#elif PLATFORM(GTK) || PLATFORM(NIX) > typedef GFileIOStream* PlatformFileHandle; > const PlatformFileHandle invalidPlatformFileHandle = 0; > #elif OS(WINDOWS) >@@ -212,7 +212,7 @@ RetainPtr<CFURLRef> pathAsURL(const String&); > void setMetadataURL(String& URLString, const String& referrer, const String& path); > #endif > >-#if PLATFORM(GTK) >+#if PLATFORM(GTK) || PLATFORM(NIX) > String filenameToString(const char*); > String filenameForDisplay(const String&); > CString applicationDirectoryPath(); >diff --git a/Source/WebCore/platform/PlatformMenuDescription.h b/Source/WebCore/platform/PlatformMenuDescription.h >index 7b18637..f5fbe8c 100644 >--- a/Source/WebCore/platform/PlatformMenuDescription.h >+++ b/Source/WebCore/platform/PlatformMenuDescription.h >@@ -34,6 +34,8 @@ OBJC_CLASS NSMutableArray; > #include <qlist.h> > #elif PLATFORM(GTK) > typedef struct _GtkMenu GtkMenu; >+#elif PLATFORM(NIX) >+#include <wtf/Vector.h> > #endif > > namespace WebCore { >diff --git a/Source/WebCore/platform/RunLoop.h b/Source/WebCore/platform/RunLoop.h >index b7f01bc..76f7938 100644 >--- a/Source/WebCore/platform/RunLoop.h >+++ b/Source/WebCore/platform/RunLoop.h >@@ -36,7 +36,7 @@ > #include <wtf/RetainPtr.h> > #include <wtf/Threading.h> > >-#if PLATFORM(GTK) >+#if PLATFORM(GTK) || PLATFORM(NIX) > #include <wtf/gobject/GRefPtr.h> > #endif > >@@ -99,7 +99,7 @@ public: > static void timerFired(RunLoop*, int ID); > int m_ID; > bool m_isRepeating; >-#elif PLATFORM(GTK) >+#elif PLATFORM(GTK) || PLATFORM(NIX) > static gboolean timerFiredCallback(RunLoop::TimerBase*); > gboolean isRepeating() const { return m_isRepeating; } > void clearTimerSource(); >@@ -159,7 +159,7 @@ private: > TimerMap m_activeTimers; > class TimerObject; > TimerObject* m_timerObject; >-#elif PLATFORM(GTK) >+#elif PLATFORM(GTK) || PLATFORM(NIX) > public: > static gboolean queueWork(RunLoop*); > GMainLoop* innermostLoop(); >diff --git a/Source/WebCore/platform/Widget.h b/Source/WebCore/platform/Widget.h >index a4a18a0..ef98c4d 100644 >--- a/Source/WebCore/platform/Widget.h >+++ b/Source/WebCore/platform/Widget.h >@@ -65,7 +65,7 @@ QT_END_NAMESPACE > typedef QObject* PlatformWidget; > #endif > >-#if PLATFORM(BLACKBERRY) >+#if PLATFORM(BLACKBERRY) || PLATFORM(NIX) > typedef void* PlatformWidget; > #endif > >diff --git a/Source/WebCore/platform/audio/FFTFrame.h b/Source/WebCore/platform/audio/FFTFrame.h >index 115c8f8..5ffb7fd 100644 >--- a/Source/WebCore/platform/audio/FFTFrame.h >+++ b/Source/WebCore/platform/audio/FFTFrame.h >@@ -67,6 +67,11 @@ struct RDFTContext; > #include <ipps.h> > #endif // USE(WEBAUDIO_IPP) > >+#if PLATFORM(NIX) >+#include <cmath> >+#include <public/WebFFTFrame.h> >+#endif >+ > #include <wtf/Forward.h> > #include <wtf/PassOwnPtr.h> > #include <wtf/Threading.h> >@@ -178,6 +183,11 @@ private: > AudioFloatArray m_imagData; > #endif // USE(WEBAUDIO_IPP) > >+#if PLATFORM(NIX) >+ void scalePlanarData(float scale); >+ OwnPtr<WebKit::WebFFTFrame> m_fftFrame; >+#endif // PLATFORM(NIX) >+ > #if USE(WEBAUDIO_OPENMAX_DL_FFT) > static OMXFFTSpec_R_F32* contextForSize(unsigned log2FFTSize); > >diff --git a/Source/WebCore/platform/audio/HRTFElevation.cpp b/Source/WebCore/platform/audio/HRTFElevation.cpp >index 4aaa1c0..5596608 100644 >--- a/Source/WebCore/platform/audio/HRTFElevation.cpp >+++ b/Source/WebCore/platform/audio/HRTFElevation.cpp >@@ -61,7 +61,7 @@ const size_t ResponseFrameSize = 256; > // The impulse responses may be resampled to a different sample-rate (depending on the audio hardware) when they are loaded. > const float ResponseSampleRate = 44100; > >-#if PLATFORM(MAC) || USE(WEBAUDIO_GSTREAMER) >+#if PLATFORM(MAC) || USE(WEBAUDIO_GSTREAMER) || PLATFORM(NIX) > #define USE_CONCATENATED_IMPULSE_RESPONSES > #endif > >diff --git a/Source/WebCore/platform/audio/nix/AudioBusNix.cpp b/Source/WebCore/platform/audio/nix/AudioBusNix.cpp >new file mode 100644 >index 0000000..aaf4607 >--- /dev/null >+++ b/Source/WebCore/platform/audio/nix/AudioBusNix.cpp >@@ -0,0 +1,85 @@ >+/* >+ * Copyright (C) 2010, 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: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+ >+#if ENABLE(WEB_AUDIO) >+ >+#include "AudioBus.h" >+ >+#include "AudioFileReader.h" >+#include <public/Platform.h> >+#include <public/WebAudioBus.h> >+#include <wtf/PassRefPtr.h> >+#include <wtf/text/StringConcatenate.h> >+#include <wtf/text/CString.h> >+ >+namespace WebCore { >+ >+PassRefPtr<AudioBus> decodeAudioFileData(const char* data, size_t size, double sampleRate) >+{ >+ WebKit::WebAudioBus webAudioBus; >+ if (WebKit::Platform::current()->loadAudioResource(&webAudioBus, data, size, sampleRate)) >+ return webAudioBus.audioBus(); >+ return PassRefPtr<AudioBus>(); >+} >+ >+PassRefPtr<AudioBus> AudioBus::loadPlatformResource(const char* name, float sampleRate) >+{ >+ String absoluteFilename(makeString(DATA_DIR, "/webaudio/resources/", name, ".wav")); >+ const WebKit::WebData& resource = WebKit::Platform::current()->loadResource(absoluteFilename.utf8().data()); >+ >+ if (resource.isEmpty()) >+ return PassRefPtr<AudioBus>(); >+ >+ // FIXME: the sampleRate parameter is ignored. It should be removed from the API. >+ RefPtr<AudioBus> audioBus = decodeAudioFileData(resource.data(), resource.size(), sampleRate); >+ >+ if (!audioBus.get()) >+ return PassRefPtr<AudioBus>(); >+ >+ // If the bus is already at the requested sample-rate then return as is. >+ if (audioBus->sampleRate() == sampleRate) >+ return audioBus.release(); >+ >+ return AudioBus::createBySampleRateConverting(audioBus.get(), false, sampleRate); >+} >+ >+PassRefPtr<AudioBus> createBusFromInMemoryAudioFile(const void* data, size_t dataSize, bool mixToMono, float sampleRate) >+{ >+ // FIXME: the sampleRate parameter is ignored. It should be removed from the API. >+ RefPtr<AudioBus> audioBus = decodeAudioFileData(static_cast<const char*>(data), dataSize, sampleRate); >+ if (!audioBus.get()) >+ return PassRefPtr<AudioBus>(); >+ >+ // If the bus needs no conversion then return as is. >+ if ((!mixToMono || audioBus->numberOfChannels() == 1) && audioBus->sampleRate() == sampleRate) >+ return audioBus.release(); >+ >+ return AudioBus::createBySampleRateConverting(audioBus.get(), mixToMono, sampleRate); >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEB_AUDIO) >diff --git a/Source/WebCore/platform/audio/nix/AudioDestinationNix.cpp b/Source/WebCore/platform/audio/nix/AudioDestinationNix.cpp >new file mode 100644 >index 0000000..5de217e >--- /dev/null >+++ b/Source/WebCore/platform/audio/nix/AudioDestinationNix.cpp >@@ -0,0 +1,164 @@ >+/* >+ * Copyright (C) 2010 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: >+ * >+ * 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" >+ >+#if ENABLE(WEB_AUDIO) >+ >+#include "AudioDestinationNix.h" >+ >+#include "AudioFIFO.h" >+#include "AudioPullFIFO.h" >+#include <public/Platform.h> >+ >+namespace WebCore { >+ >+// Buffer size at which the web audio engine will render. >+const unsigned renderBufferSize = 128; >+ >+// Size of the FIFO >+const size_t fifoSize = 8192; >+ >+// Factory method: Chromium-implementation >+PassOwnPtr<AudioDestination> AudioDestination::create(AudioIOCallback& callback, const String& inputDeviceId, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate) >+{ >+ return adoptPtr(new AudioDestinationNix(callback, inputDeviceId, numberOfInputChannels, numberOfOutputChannels, sampleRate)); >+} >+ >+AudioDestinationNix::AudioDestinationNix(AudioIOCallback& callback, const String&, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate) >+ : m_callback(callback) >+ , m_numberOfOutputChannels(numberOfOutputChannels) >+ , m_inputBus(AudioBus::create(numberOfInputChannels, renderBufferSize)) >+ , m_renderBus(AudioBus::create(numberOfOutputChannels, renderBufferSize, false)) >+ , m_sampleRate(sampleRate) >+ , m_isPlaying(false) >+{ >+ // Use the optimal buffer size recommended by the audio backend. >+ m_callbackBufferSize = WebKit::Platform::current()->audioHardwareBufferSize(); >+ >+ // Quick exit if the requested size is too large. >+ ASSERT(m_callbackBufferSize + renderBufferSize <= fifoSize); >+ if (m_callbackBufferSize + renderBufferSize > fifoSize) >+ return; >+ >+ m_audioDevice = adoptPtr(WebKit::Platform::current()->createAudioDevice(m_callbackBufferSize, numberOfInputChannels, numberOfOutputChannels, sampleRate, this)); >+ ASSERT(m_audioDevice); >+ >+ // Create a FIFO to handle the possibility of the callback size >+ // not being a multiple of the render size. If the FIFO already >+ // contains enough data, the data will be provided directly. >+ // Otherwise, the FIFO will call the provider enough times to >+ // satisfy the request for data. >+ m_fifo = adoptPtr(new AudioPullFIFO(*this, numberOfOutputChannels, fifoSize, renderBufferSize)); >+ >+ // Input buffering. >+ m_inputFifo = adoptPtr(new AudioFIFO(numberOfInputChannels, fifoSize)); >+ >+ // If the callback size does not match the render size, then we need to buffer some >+ // extra silence for the input. Otherwise, we can over-consume the input FIFO. >+ if (m_callbackBufferSize != renderBufferSize) { >+ // FIXME: handle multi-channel input and don't hard-code to stereo. >+ RefPtr<AudioBus> silence = AudioBus::create(2, renderBufferSize); >+ m_inputFifo->push(silence.get()); >+ } >+} >+ >+AudioDestinationNix::~AudioDestinationNix() >+{ >+ stop(); >+} >+ >+void AudioDestinationNix::start() >+{ >+ if (!m_isPlaying && m_audioDevice) { >+ m_audioDevice->start(); >+ m_isPlaying = true; >+ } >+} >+ >+void AudioDestinationNix::stop() >+{ >+ if (m_isPlaying && m_audioDevice) { >+ m_audioDevice->stop(); >+ m_isPlaying = false; >+ } >+} >+ >+float AudioDestination::hardwareSampleRate() >+{ >+ return static_cast<float>(WebKit::Platform::current()->audioHardwareSampleRate()); >+} >+ >+unsigned long AudioDestination::maxChannelCount() >+{ >+ return static_cast<float>(WebKit::Platform::current()->audioHardwareOutputChannels()); >+} >+ >+void AudioDestinationNix::render(const WebKit::WebVector<float*>& sourceData, const WebKit::WebVector<float*>& audioData, size_t numberOfFrames) >+{ >+ bool isNumberOfChannelsGood = audioData.size() == m_numberOfOutputChannels; >+ if (!isNumberOfChannelsGood) { >+ ASSERT_NOT_REACHED(); >+ return; >+ } >+ >+ bool isBufferSizeGood = numberOfFrames == m_callbackBufferSize; >+ if (!isBufferSizeGood) { >+ ASSERT_NOT_REACHED(); >+ return; >+ } >+ >+ // Buffer optional live input. >+ if (sourceData.size() >= 2) { >+ // FIXME: handle multi-channel input and don't hard-code to stereo. >+ RefPtr<AudioBus> wrapperBus = AudioBus::create(2, numberOfFrames, false); >+ wrapperBus->setChannelMemory(0, sourceData[0], numberOfFrames); >+ wrapperBus->setChannelMemory(1, sourceData[1], numberOfFrames); >+ m_inputFifo->push(wrapperBus.get()); >+ } >+ >+ for (unsigned i = 0; i < m_numberOfOutputChannels; ++i) >+ m_renderBus->setChannelMemory(i, audioData[i], numberOfFrames); >+ >+ m_fifo->consume(m_renderBus.get(), numberOfFrames); >+} >+ >+void AudioDestinationNix::provideInput(AudioBus* bus, size_t framesToProcess) >+{ >+ RefPtr<AudioBus> sourceBus; >+ if (m_inputFifo->framesInFifo() >= framesToProcess) { >+ m_inputFifo->consume(m_inputBus.get(), framesToProcess); >+ sourceBus = m_inputBus; >+ } >+ >+ m_callback.render(sourceBus.get(), bus, framesToProcess); >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEB_AUDIO) >diff --git a/Source/WebCore/platform/audio/nix/AudioDestinationNix.h b/Source/WebCore/platform/audio/nix/AudioDestinationNix.h >new file mode 100644 >index 0000000..1656f5c >--- /dev/null >+++ b/Source/WebCore/platform/audio/nix/AudioDestinationNix.h >@@ -0,0 +1,79 @@ >+/* >+ * Copyright (C) 2010 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: >+ * >+ * 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 AudioDestinationNix_h >+#define AudioDestinationNix_h >+ >+#include "AudioBus.h" >+#include "AudioDestination.h" >+#include "AudioIOCallback.h" >+#include "AudioSourceProvider.h" >+#include <public/WebAudioDevice.h> >+#include <public/WebVector.h> >+ >+namespace WebCore { >+ >+class AudioFIFO; >+class AudioPullFIFO; >+ >+// An AudioDestination using Chromium's audio system >+ >+class AudioDestinationNix : public AudioDestination, public WebKit::WebAudioDevice::RenderCallback, public AudioSourceProvider { >+public: >+ AudioDestinationNix(AudioIOCallback&, const String& inputDeviceId, unsigned numberOfInputChannels, unsigned numberOfOutputChannels, float sampleRate); >+ virtual ~AudioDestinationNix(); >+ >+ virtual void start(); >+ virtual void stop(); >+ bool isPlaying() { return m_isPlaying; } >+ >+ float sampleRate() const { return m_sampleRate; } >+ >+ // WebKit::WebAudioDevice::RenderCallback >+ virtual void render(const WebKit::WebVector<float*>& sourceData, const WebKit::WebVector<float*>& audioData, size_t numberOfFrames); >+ >+ // WebCore::AudioSourceProvider >+ virtual void provideInput(AudioBus*, size_t framesToProcess); >+ >+private: >+ AudioIOCallback& m_callback; >+ unsigned m_numberOfOutputChannels; >+ RefPtr<AudioBus> m_inputBus; >+ RefPtr<AudioBus> m_renderBus; >+ float m_sampleRate; >+ bool m_isPlaying; >+ OwnPtr<WebKit::WebAudioDevice> m_audioDevice; >+ size_t m_callbackBufferSize; >+ >+ OwnPtr<AudioFIFO> m_inputFifo; >+ OwnPtr<AudioPullFIFO> m_fifo; >+}; >+ >+} // namespace WebCore >+ >+#endif // AudioDestinationNix_h >diff --git a/Source/WebCore/platform/audio/nix/FFTFrameNix.cpp b/Source/WebCore/platform/audio/nix/FFTFrameNix.cpp >new file mode 100644 >index 0000000..a05feaa >--- /dev/null >+++ b/Source/WebCore/platform/audio/nix/FFTFrameNix.cpp >@@ -0,0 +1,133 @@ >+/* >+ * Copyright (C) 2013-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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" >+ >+#if ENABLE(WEB_AUDIO) >+#include "FFTFrame.h" >+#include "VectorMath.h" >+#include <public/Platform.h> >+#include <public/WebFFTFrame.h> >+ >+ >+namespace WebCore { >+ >+FFTFrame::FFTFrame(unsigned fftSize) >+ : m_FFTSize(fftSize) >+ , m_log2FFTSize(static_cast<unsigned>(log2(fftSize))) >+{ >+ m_fftFrame = adoptPtr(WebKit::Platform::current()->createFFTFrame(fftSize)); >+} >+ >+FFTFrame::FFTFrame(const FFTFrame& frame) >+ : m_FFTSize(frame.m_FFTSize) >+ , m_log2FFTSize(frame.m_log2FFTSize) >+{ >+ m_fftFrame = adoptPtr(WebKit::Platform::current()->createFFTFrame(frame.m_fftFrame.get())); >+} >+ >+FFTFrame::~FFTFrame() >+{ >+ m_fftFrame.release(); >+} >+ >+void FFTFrame::multiply(const FFTFrame& frame) >+{ >+ if (!m_fftFrame) >+ return; >+ >+ m_fftFrame->multiply(*frame.m_fftFrame); >+ >+ // Scale accounts the peculiar scaling of vecLib on the Mac. >+ // This ensures the right scaling all the way back to inverse FFT. >+ // FIXME: if we change the scaling on the Mac then this scale >+ // factor will need to change too. >+ scalePlanarData(0.5f); >+} >+ >+// Provides time domain samples in argument "data". Frame will store the transformed data. >+void FFTFrame::doFFT(const float* data) >+{ >+ if (!m_fftFrame) >+ return; >+ >+ m_fftFrame->doFFT(data); >+ >+ scalePlanarData(2.0f); >+} >+ >+// Calculates inverse transform from the stored data, putting the results in argument 'data'. >+void FFTFrame::doInverseFFT(float* data) >+{ >+ if (!m_fftFrame) >+ return; >+ >+ m_fftFrame->doInverseFFT(data); >+ >+ // Scale so that a forward then inverse FFT yields exactly the original data. >+ const float scale = 1.0 / (2 * m_FFTSize); >+ for (unsigned i = 0; i < m_FFTSize; ++i) >+ data[i] = scale * data[i]; >+} >+ >+void FFTFrame::initialize() >+{ >+} >+ >+void FFTFrame::cleanup() >+{ >+} >+ >+void FFTFrame::scalePlanarData(float scale) >+{ >+ float* realP = m_fftFrame->realData(); >+ float* imagP = m_fftFrame->imagData(); >+ >+ const unsigned framesToProcess = m_fftFrame->frequencyDomainSampleCount(); >+ >+ for (unsigned i = 0; i < framesToProcess; ++i) { >+ realP[i] *= scale; >+ imagP[i] *= scale; >+ } >+} >+ >+float* FFTFrame::realData() const >+{ >+ if (!m_fftFrame) >+ return 0; >+ >+ return const_cast<float*>(m_fftFrame->realData()); >+} >+ >+float* FFTFrame::imagData() const >+{ >+ if (!m_fftFrame) >+ return 0; >+ >+ return const_cast<float*>(m_fftFrame->imagData()); >+} >+ >+} // namespace WebCore >+ >+#endif // ENABLE(WEB_AUDIO) >diff --git a/Source/WebCore/platform/cairo/WidgetBackingStore.h b/Source/WebCore/platform/cairo/WidgetBackingStore.h >index a7220be..d40bfbb 100644 >--- a/Source/WebCore/platform/cairo/WidgetBackingStore.h >+++ b/Source/WebCore/platform/cairo/WidgetBackingStore.h >@@ -39,6 +39,8 @@ namespace WebCore { > typedef GtkWidget* PlatformWidget; > #elif PLATFORM(EFL) > typedef Evas_Object* PlatformWidget; >+#elif PLATFORM(NIX) >+typedef void* PlatformWidget; > #endif > > class WidgetBackingStore { >diff --git a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h >index 83c2e004..8c8f3c7 100644 >--- a/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h >+++ b/Source/WebCore/platform/graphics/ANGLEWebKitBridge.h >@@ -29,7 +29,7 @@ > #include <wtf/text/CString.h> > #include <wtf/text/WTFString.h> > >-#if !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(BLACKBERRY) && !PLATFORM(QT) && !PLATFORM(WIN) >+#if !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(BLACKBERRY) && !PLATFORM(QT) && !PLATFORM(WIN) && !PLATFORM(NIX) > #include "ANGLE/ShaderLang.h" > #elif PLATFORM(WIN) > #include "GLSLANG/ShaderLang.h" >diff --git a/Source/WebCore/platform/graphics/FontPlatformData.h b/Source/WebCore/platform/graphics/FontPlatformData.h >index 32969f0..4c05e8f 100644 >--- a/Source/WebCore/platform/graphics/FontPlatformData.h >+++ b/Source/WebCore/platform/graphics/FontPlatformData.h >@@ -29,7 +29,7 @@ > #include "qt/FontPlatformData.h" > #elif USE(WINGDI) > #include "wince/FontPlatformData.h" >-#elif PLATFORM(EFL) || PLATFORM(GTK) >+#elif PLATFORM(EFL) || PLATFORM(GTK) || PLATFORM(NIX) > #include "freetype/FontPlatformData.h" > #else > >diff --git a/Source/WebCore/platform/graphics/GraphicsContext3D.cpp b/Source/WebCore/platform/graphics/GraphicsContext3D.cpp >index ce0776f..fa96941 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext3D.cpp >+++ b/Source/WebCore/platform/graphics/GraphicsContext3D.cpp >@@ -1474,7 +1474,7 @@ unsigned GraphicsContext3D::getChannelBitsByFormat(GC3Denum format) > } > } > >-#if !PLATFORM(BLACKBERRY) && !PLATFORM(QT) && !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(MAC) && !PLATFORM(WIN) >+#if !PLATFORM(BLACKBERRY) && !PLATFORM(QT) && !PLATFORM(GTK) && !PLATFORM(EFL) && !PLATFORM(MAC) && !PLATFORM(WIN) && !PLATFORM(NIX) > PlatformGraphicsContext3D GraphicsContext3D::platformGraphicsContext3D() const > { > return NullPlatformGraphicsContext3D; >diff --git a/Source/WebCore/platform/graphics/GraphicsContext3D.h b/Source/WebCore/platform/graphics/GraphicsContext3D.h >index 2c8f06d..ea22459 100644 >--- a/Source/WebCore/platform/graphics/GraphicsContext3D.h >+++ b/Source/WebCore/platform/graphics/GraphicsContext3D.h >@@ -47,7 +47,7 @@ > #undef VERSION > #endif > >-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) >+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX) > #include "ANGLEWebKitBridge.h" > #endif > >@@ -64,7 +64,7 @@ class QGLContext; > class QOpenGLContext; > class QSurface; > QT_END_NAMESPACE >-#elif PLATFORM(GTK) || PLATFORM(EFL) >+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(NIX) > typedef unsigned int GLuint; > #endif > >@@ -491,14 +491,14 @@ public: > #else > PlatformGraphicsContext3D platformGraphicsContext3D(); > Platform3DObject platformTexture() const; >-#if USE(ACCELERATED_COMPOSITING) >+#if USE(ACCELERATED_COMPOSITING) > PlatformLayer* platformLayer() const; > #endif > #endif > > bool makeContextCurrent(); > >-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) >+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX) > // With multisampling on, blit from multisampleFBO to regular FBO. > void prepareTexture(); > #endif >@@ -923,7 +923,7 @@ private: > // Destination data will have no gaps between rows. > static bool packPixels(const uint8_t* sourceData, DataFormat sourceDataFormat, unsigned width, unsigned height, unsigned sourceUnpackAlignment, unsigned destinationFormat, unsigned destinationType, AlphaOp, void* destinationData, bool flipY); > >-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) >+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX) > // Take into account the user's requested context creation attributes, > // in particular stencil and antialias, and determine which could or > // could not be honored based on the capabilities of the OpenGL >@@ -944,7 +944,7 @@ private: > > bool reshapeFBOs(const IntSize&); > void resolveMultisamplingIfNecessary(const IntRect& = IntRect()); >-#if (PLATFORM(QT) || PLATFORM(EFL)) && USE(GRAPHICS_SURFACE) >+#if (PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(NIX)) && USE(GRAPHICS_SURFACE) > void createGraphicsSurfaces(const IntSize&); > #endif > >@@ -961,7 +961,7 @@ private: > void* m_context; > #endif > >-#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) >+#if PLATFORM(MAC) || PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(BLACKBERRY) || PLATFORM(WIN) || PLATFORM(NIX) > struct SymbolInfo { > SymbolInfo() > : type(0) >@@ -1020,7 +1020,7 @@ private: > ANGLEWebKitBridge m_compiler; > #endif > >-#if PLATFORM(BLACKBERRY) || (PLATFORM(QT) && defined(QT_OPENGL_ES_2)) || ((PLATFORM(GTK) || PLATFORM(EFL)) && USE(OPENGL_ES_2)) >+#if PLATFORM(BLACKBERRY) || (PLATFORM(QT) && defined(QT_OPENGL_ES_2)) || ((PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(NIX)) && USE(OPENGL_ES_2)) > friend class Extensions3DOpenGLES; > OwnPtr<Extensions3DOpenGLES> m_extensions; > #else >diff --git a/Source/WebCore/platform/graphics/OpenGLESShims.h b/Source/WebCore/platform/graphics/OpenGLESShims.h >index c06b67c..7256f41 100644 >--- a/Source/WebCore/platform/graphics/OpenGLESShims.h >+++ b/Source/WebCore/platform/graphics/OpenGLESShims.h >@@ -26,7 +26,7 @@ > #ifndef OpenGLESShims_h > #define OpenGLESShims_h > >-#if PLATFORM(BLACKBERRY) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) >+#if PLATFORM(BLACKBERRY) || PLATFORM(QT) || PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX) > #define glBindFramebufferEXT glBindFramebuffer > #define glFramebufferTexture2DEXT glFramebufferTexture2D > #define glBindRenderbufferEXT glBindRenderbuffer >diff --git a/Source/WebCore/platform/graphics/OpenGLShims.cpp b/Source/WebCore/platform/graphics/OpenGLShims.cpp >index de7bebd..81940a8 100644 >--- a/Source/WebCore/platform/graphics/OpenGLShims.cpp >+++ b/Source/WebCore/platform/graphics/OpenGLShims.cpp >@@ -26,6 +26,10 @@ > #include <dlfcn.h> > #endif > >+#if PLATFORM(NIX) && USE(EGL) >+#include <EGL/egl.h> >+#endif >+ > #include <wtf/text/CString.h> > #include <wtf/text/WTFString.h> > >@@ -42,6 +46,11 @@ static void* getProcAddress(const char* procName) > { > return reinterpret_cast<void*>(QOpenGLContext::currentContext()->getProcAddress(procName)); > } >+#elif PLATFORM(NIX) && USE(EGL) >+static void* getProcAddress(const char* procName) >+{ >+ return reinterpret_cast<void*>(eglGetProcAddress(procName)); >+} > #else > typedef void* (*glGetProcAddressType) (const char* procName); > static void* getProcAddress(const char* procName) >@@ -99,7 +108,7 @@ static void* lookupOpenGLFunctionAddress(const char* functionName, bool* success > return target; > } > >-#if PLATFORM(QT) && defined(QT_OPENGL_ES_2) >+#if (PLATFORM(QT) && defined(QT_OPENGL_ES_2)) || (PLATFORM(NIX) && USE(OPENGL_ES_2)) > > // With Angle only EGL/GLES2 extensions are available through eglGetProcAddress, not the regular standardized functions. > #define ASSIGN_FUNCTION_TABLE_ENTRY(FunctionName, success) \ >diff --git a/Source/WebCore/platform/graphics/OpenGLShims.h b/Source/WebCore/platform/graphics/OpenGLShims.h >index 8f79421..a73099f 100644 >--- a/Source/WebCore/platform/graphics/OpenGLShims.h >+++ b/Source/WebCore/platform/graphics/OpenGLShims.h >@@ -25,6 +25,8 @@ > #include <qopenglfunctions.h> > #include <QOpenGLContext> > #include <QSurface> >+#elif PLATFORM(NIX) && USE(OPENGL_ES_2) >+#include <GLES2/gl2.h> > #else > #include <GL/gl.h> > #include <GL/glext.h> >diff --git a/Source/WebCore/platform/graphics/PlatformLayer.h b/Source/WebCore/platform/graphics/PlatformLayer.h >index 183673b..c5a694f 100644 >--- a/Source/WebCore/platform/graphics/PlatformLayer.h >+++ b/Source/WebCore/platform/graphics/PlatformLayer.h >@@ -50,7 +50,7 @@ namespace WebCore { > typedef ClutterActor PlatformLayer; > }; > #endif >-#elif PLATFORM(EFL) >+#elif PLATFORM(EFL) || PLATFORM(NIX) > #if USE(TEXTURE_MAPPER) > namespace WebCore { > class TextureMapperPlatformLayer; >diff --git a/Source/WebCore/platform/graphics/cairo/GLContext.cpp b/Source/WebCore/platform/graphics/cairo/GLContext.cpp >index 81c21c7..8ea1058 100644 >--- a/Source/WebCore/platform/graphics/cairo/GLContext.cpp >+++ b/Source/WebCore/platform/graphics/cairo/GLContext.cpp >@@ -19,7 +19,7 @@ > #include "config.h" > #include "GLContext.h" > >-#if USE(OPENGL) >+#if USE(OPENGL) || USE(OPENGL_ES_2) > > #include "GLContextEGL.h" > #include "GLContextGLX.h" >@@ -153,6 +153,7 @@ PassOwnPtr<GLContext> GLContext::createContextForWindow(uint64_t windowHandle, G > } > #endif > >+#if !PLATFORM(NIX) > #if USE(GLX) > if (OwnPtr<GLContext> glxContext = GLContextGLX::createContext(windowHandle, sharingContext)) > return glxContext.release(); >@@ -161,6 +162,7 @@ PassOwnPtr<GLContext> GLContext::createContextForWindow(uint64_t windowHandle, G > if (OwnPtr<GLContext> eglContext = GLContextEGL::createContext(windowHandle, sharingContext)) > return eglContext.release(); > #endif >+#endif > return nullptr; > } > >diff --git a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp >index aa7fec1..d671e7a 100644 >--- a/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp >+++ b/Source/WebCore/platform/graphics/cairo/GraphicsContext3DPrivate.cpp >@@ -27,6 +27,10 @@ > #include "PlatformContextCairo.h" > #include <wtf/OwnArrayPtr.h> > >+#if PLATFORM(NIX) && USE(EGL) >+#include "GLContextFromCurrentEGL.h" >+#endif >+ > #if USE(OPENGL_ES_2) > #include <GLES2/gl2.h> > #include <GLES2/gl2ext.h> >@@ -56,6 +60,9 @@ GraphicsContext3DPrivate::GraphicsContext3DPrivate(GraphicsContext3D* context, G > m_glContext = GLContext::createOffscreenContext(GLContext::sharingContext()); > break; > case GraphicsContext3D::RenderToCurrentGLContext: >+#if PLATFORM(NIX) && USE(EGL) >+ m_glContext = GLContextFromCurrentEGL::createFromCurrentGLContext(); >+#endif > break; > case GraphicsContext3D::RenderDirectlyToHostWindow: > ASSERT_NOT_REACHED(); >diff --git a/Source/WebCore/platform/graphics/egl/GLContextFromCurrentEGL.cpp b/Source/WebCore/platform/graphics/egl/GLContextFromCurrentEGL.cpp >new file mode 100644 >index 0000000..bfb6ef1 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/egl/GLContextFromCurrentEGL.cpp >@@ -0,0 +1,64 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 "GLContextFromCurrentEGL.h" >+ >+#include "OpenGLShims.h" >+ >+namespace WebCore { >+ >+PassOwnPtr<GLContextFromCurrentEGL> GLContextFromCurrentEGL::createFromCurrentGLContext() >+{ >+ if (!initialize()) >+ return nullptr; >+ return adoptPtr(new GLContextFromCurrentEGL()); >+} >+ >+GLContextFromCurrentEGL::GLContextFromCurrentEGL() >+ : m_display(eglGetCurrentDisplay()) >+ , m_surface(eglGetCurrentSurface(EGL_DRAW)) >+ , m_context(eglGetCurrentContext()) >+{ >+} >+ >+bool GLContextFromCurrentEGL::makeContextCurrent() >+{ >+ GLContext::makeContextCurrent(); >+ return eglMakeCurrent(m_display, m_surface, m_surface, m_context); >+} >+ >+bool GLContextFromCurrentEGL::initialize() >+{ >+ static bool initialized = false; >+ static bool success = true; >+ if (!initialized) { >+ success = initializeOpenGLShims(); >+ initialized = true; >+ } >+ return success; >+} >+ >+} // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/egl/GLContextFromCurrentEGL.h b/Source/WebCore/platform/graphics/egl/GLContextFromCurrentEGL.h >new file mode 100644 >index 0000000..95efc9f >--- /dev/null >+++ b/Source/WebCore/platform/graphics/egl/GLContextFromCurrentEGL.h >@@ -0,0 +1,68 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 GLContextFromCurrentEGL_h >+#define GLContextFromCurrentEGL_h >+ >+#include "GLContext.h" >+#include <EGL/egl.h> >+ >+namespace WebCore { >+ >+class GLContextFromCurrentEGL : public GLContext { >+ WTF_MAKE_NONCOPYABLE(GLContextFromCurrentEGL); >+public: >+ // TODO: Add support for Offscreen buffers. >+ static PassOwnPtr<GLContextFromCurrentEGL> createFromCurrentGLContext(); >+ >+ virtual bool makeContextCurrent(); >+ >+ // These are not used by Nix. >+ virtual void swapBuffers() { } >+ virtual IntSize defaultFrameBufferSize() { return IntSize(); } >+ virtual cairo_device_t* cairoDevice() { return 0; } >+ >+ // TODO: This is not used in GLContext interface, it's used by >+ // GLContextGLX only as an implementation detail. >+ virtual bool canRenderToDefaultFramebuffer() { return false; } >+ >+ // TODO: Used only as a key in HashMaps, see if we can change WebKit code to not >+ // rely on this anymore (at least in our platform). >+ virtual PlatformGraphicsContext3D platformContext() { return this; } >+ virtual void waitNative() { return; } >+ >+private: >+ static bool initialize(); >+ >+ GLContextFromCurrentEGL(); >+ >+ EGLDisplay m_display; >+ EGLSurface m_surface; >+ EGLContext m_context; >+}; >+ >+} // namespace WebCore >+ >+#endif // GLContextFromCurrentEGL_h >diff --git a/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp b/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp >index a2d591b..4a79a0c 100644 >--- a/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp >+++ b/Source/WebCore/platform/graphics/freetype/FontPlatformDataFreeType.cpp >@@ -31,7 +31,7 @@ > #include <fontconfig/fcfreetype.h> > #include <wtf/text/WTFString.h> > >-#if !PLATFORM(EFL) >+#if !PLATFORM(EFL) && !PLATFORM(NIX) > #include <gdk/gdk.h> > #endif > >diff --git a/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowNix.cpp b/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowNix.cpp >new file mode 100644 >index 0000000..a6679d1 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/gstreamer/PlatformVideoWindowNix.cpp >@@ -0,0 +1,43 @@ >+/* >+ * Copyright (C) 2010 Samsung Electronics >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 "PlatformVideoWindow.h" >+#if USE(GSTREAMER) && !defined(GST_API_VERSION_1) >+ >+#include "NotImplemented.h" >+ >+using namespace WebCore; >+ >+PlatformVideoWindow::PlatformVideoWindow() >+{ >+ notImplemented(); >+} >+ >+PlatformVideoWindow::~PlatformVideoWindow() >+{ >+ notImplemented(); >+} >+ >+void PlatformVideoWindow::prepareForOverlay(GstMessage*) >+{ >+} >+ >+#endif // USE(GSTREAMER) && !defined(GST_API_VERSION_1) >diff --git a/Source/WebCore/platform/graphics/nix/IconNix.cpp b/Source/WebCore/platform/graphics/nix/IconNix.cpp >new file mode 100644 >index 0000000..5d3f8d3 >--- /dev/null >+++ b/Source/WebCore/platform/graphics/nix/IconNix.cpp >@@ -0,0 +1,52 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 "Icon.h" >+ >+#include "GraphicsContext.h" >+#include "NotImplemented.h" >+#include <wtf/PassRefPtr.h> >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+Icon::~Icon() >+{ >+} >+ >+PassRefPtr<Icon> Icon::createIconForFiles(const Vector<String>&) >+{ >+ notImplemented(); >+ return 0; >+} >+ >+void Icon::paint(GraphicsContext*, const IntRect&) >+{ >+ notImplemented(); >+} >+ >+} >diff --git a/Source/WebCore/platform/graphics/nix/ImageNix.cpp b/Source/WebCore/platform/graphics/nix/ImageNix.cpp >new file mode 100644 >index 0000000..be0b24b >--- /dev/null >+++ b/Source/WebCore/platform/graphics/nix/ImageNix.cpp >@@ -0,0 +1,63 @@ >+/* >+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. >+ * Copyright (C) 2008 Kenneth Rohde Christiansen. All rights reserved. >+ * Copyright (C) 2009-2010 ProFUSION embedded systems >+ * Copyright (C) 2009-2010 Samsung Electronics >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 "Image.h" >+ >+#include "BitmapImage.h" >+#include "SharedBuffer.h" >+ >+namespace WebCore { >+ >+void BitmapImage::invalidatePlatformData() >+{ >+} >+ >+static PassRefPtr<SharedBuffer> loadResourceSharedBufferFallback() >+{ >+ return SharedBuffer::create(); // TODO: fallback image? >+} >+ >+static PassRefPtr<SharedBuffer> loadResourceSharedBuffer(const char* name) >+{ >+ RefPtr<SharedBuffer> buffer = SharedBuffer::createWithContentsOfFile(makeString(DATA_DIR "/webkit-1.0/images/", name, ".png")); >+ if (buffer) >+ return buffer.release(); >+ return loadResourceSharedBufferFallback(); >+} >+ >+PassRefPtr<Image> Image::loadPlatformResource(const char* name) >+{ >+ RefPtr<BitmapImage> img = BitmapImage::create(); >+ RefPtr<SharedBuffer> buffer = loadResourceSharedBuffer(name); >+ img->setData(buffer.release(), true); >+ return img.release(); >+} >+ >+} >diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp >index 0905c92..070c3fb 100644 >--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp >+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.cpp >@@ -35,7 +35,7 @@ > #if PLATFORM(MAC) > #include "ANGLE/ShaderLang.h" > #include <OpenGL/gl.h> >-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) >+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) || PLATFORM(NIX) > #include "OpenGLShims.h" > #endif > >@@ -65,7 +65,7 @@ Platform3DObject Extensions3DOpenGL::createVertexArrayOES() > { > m_context->makeContextCurrent(); > GLuint array = 0; >-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)) || PLATFORM(WIN) >+#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)) > if (isVertexArrayObjectSupported()) > glGenVertexArrays(1, &array); > #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object >@@ -80,7 +80,7 @@ void Extensions3DOpenGL::deleteVertexArrayOES(Platform3DObject array) > return; > > m_context->makeContextCurrent(); >-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN)) >+#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)) > if (isVertexArrayObjectSupported()) > glDeleteVertexArrays(1, &array); > #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object >@@ -94,7 +94,7 @@ GC3Dboolean Extensions3DOpenGL::isVertexArrayOES(Platform3DObject array) > return GL_FALSE; > > m_context->makeContextCurrent(); >-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN)) >+#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)) > if (isVertexArrayObjectSupported()) > return glIsVertexArray(array); > #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object >@@ -106,7 +106,7 @@ GC3Dboolean Extensions3DOpenGL::isVertexArrayOES(Platform3DObject array) > void Extensions3DOpenGL::bindVertexArrayOES(Platform3DObject array) > { > m_context->makeContextCurrent(); >-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN)) >+#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)) > if (isVertexArrayObjectSupported()) > glBindVertexArray(array); > #elif defined(GL_APPLE_vertex_array_object) && GL_APPLE_vertex_array_object >@@ -160,7 +160,7 @@ bool Extensions3DOpenGL::supportsExtension(const String& name) > > // GL_OES_vertex_array_object > if (name == "GL_OES_vertex_array_object") { >-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL)) >+#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(NIX)) > return m_availableExtensions.contains("GL_ARB_vertex_array_object"); > #else > return m_availableExtensions.contains("GL_APPLE_vertex_array_object"); >@@ -205,7 +205,7 @@ String Extensions3DOpenGL::getExtensions() > return String(reinterpret_cast<const char*>(::glGetString(GL_EXTENSIONS))); > } > >-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN)) >+#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) ||PLATFORM(NIX)) > bool Extensions3DOpenGL::isVertexArrayObjectSupported() > { > static const bool supportsVertexArrayObject = supports("GL_OES_vertex_array_object"); >diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h >index f9d69e9..4c0e0bc 100644 >--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h >+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGL.h >@@ -60,7 +60,7 @@ protected: > > virtual bool supportsExtension(const WTF::String&); > virtual String getExtensions(); >-#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN)) >+#if (PLATFORM(GTK) || PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(WIN) || PLATFORM(NIX)) > private: > bool isVertexArrayObjectSupported(); > #endif >diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp >index f413a67..b0f7f9e 100644 >--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp >+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLCommon.cpp >@@ -42,7 +42,7 @@ > #include <GLES2/gl2ext.h> > #elif PLATFORM(MAC) > #include <OpenGL/gl.h> >-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) >+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) || PLATFORM(NIX) > #include "OpenGLShims.h" > #endif > >diff --git a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h >index 21ec2e5..e3ac1ec 100644 >--- a/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h >+++ b/Source/WebCore/platform/graphics/opengl/Extensions3DOpenGLES.h >@@ -69,6 +69,11 @@ typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint loc > typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GC3Dsizei bufSize, GLint *params); > #endif > >+#if PLATFORM(NIX) && USE(OPENGL_ES_2) && !GL_IMG_multisampled_render_to_texture >+// on rPi, PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG is called PFNGLCLIPPLANEXIMG. >+typedef PFNGLCLIPPLANEXIMG PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMG; >+#endif >+ > namespace WebCore { > > class Extensions3DOpenGLES : public Extensions3DOpenGLCommon { >diff --git a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp >index fbdca0e..e7df94d 100644 >--- a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp >+++ b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGL.cpp >@@ -42,7 +42,7 @@ > > #if PLATFORM(MAC) > #include <OpenGL/gl.h> >-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) >+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) || PLATFORM(NIX) > #include "OpenGLShims.h" > #endif > >diff --git a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp >index 89d2b3f..4d7de53 100644 >--- a/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp >+++ b/Source/WebCore/platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp >@@ -59,7 +59,7 @@ > #include "OpenGLESShims.h" > #elif PLATFORM(MAC) > #include <OpenGL/gl.h> >-#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) >+#elif PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(QT) || PLATFORM(WIN) || PLATFORM(NIX) > #include "OpenGLShims.h" > #endif > >@@ -221,7 +221,7 @@ void GraphicsContext3D::reshape(int width, int height) > if (width == m_currentWidth && height == m_currentHeight) > return; > >-#if (PLATFORM(QT) || PLATFORM(EFL)) && USE(GRAPHICS_SURFACE) >+#if (PLATFORM(QT) || PLATFORM(EFL) || PLATFORM(NIX)) && USE(GRAPHICS_SURFACE) > ::glFlush(); // Make sure all GL calls have been committed before resizing. > createGraphicsSurfaces(IntSize(width, height)); > #endif >diff --git a/Source/WebCore/platform/graphics/texmap/TextureMapper.h b/Source/WebCore/platform/graphics/texmap/TextureMapper.h >index 6ec6757..d3c05e6 100644 >--- a/Source/WebCore/platform/graphics/texmap/TextureMapper.h >+++ b/Source/WebCore/platform/graphics/texmap/TextureMapper.h >@@ -28,7 +28,7 @@ > #define TEXMAP_OPENGL_ES_2 > #endif > #endif >-#if (PLATFORM(GTK) || PLATFORM(EFL)) && USE(OPENGL_ES_2) >+#if (PLATFORM(GTK) || PLATFORM(EFL) || PLATFORM(NIX)) && USE(OPENGL_ES_2) > #define TEXMAP_OPENGL_ES_2 > #endif > >diff --git a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h >index 7fa92ad..a719da7 100644 >--- a/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h >+++ b/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsScene.h >@@ -206,4 +206,3 @@ private: > > #endif // CoordinatedGraphicsScene_h > >- >diff --git a/Source/WebCore/platform/nix/CursorNix.cpp b/Source/WebCore/platform/nix/CursorNix.cpp >new file mode 100644 >index 0000000..177ef0c >--- /dev/null >+++ b/Source/WebCore/platform/nix/CursorNix.cpp >@@ -0,0 +1,120 @@ >+/* >+ * Copyright (C) 2006 Dirk Mueller <mueller@kde.org> >+ * Copyright (C) 2006 George Staikos <staikos@kde.org> >+ * Copyright (C) 2006 Charles Samuels <charles@kde.org> >+ * Copyright (C) 2008 Holger Hans Peter Freyther >+ * Copyright (C) 2008 Kenneth Rohde Christiansen >+ * Copyright (C) 2009-2010 ProFUSION embedded systems >+ * Copyright (C) 2009-2010 Samsung Electronics >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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" >+ >+namespace WebCore { >+ >+Cursor::Cursor(const Cursor& other) >+ : m_type(other.m_type) >+ , m_image(other.m_image) >+ , m_hotSpot(other.m_hotSpot) >+ , m_platformCursor(other.m_platformCursor) >+{ >+} >+ >+Cursor::~Cursor() >+{ >+} >+ >+Cursor& Cursor::operator=(const Cursor& other) >+{ >+ m_type = other.m_type; >+ m_image = other.m_image; >+ m_hotSpot = other.m_hotSpot; >+ m_platformCursor = other.m_platformCursor; >+ return *this; >+} >+ >+static const char* cursorString(Cursor::Type type) >+{ >+ static const char* cursorStrings[] = { >+ "cursor/pointer", >+ "cursor/cross", >+ "cursor/hand", >+ "cursor/i_beam", >+ "cursor/wait", >+ "cursor/help", >+ "cursor/east_resize", >+ "cursor/north_resize", >+ "cursor/north_east_resize", >+ "cursor/north_west_resize", >+ "cursor/south_resize", >+ "cursor/south_east_resize", >+ "cursor/south_west_resize", >+ "cursor/west_resize", >+ "cursor/north_south_resize", >+ "cursor/east_west_resize", >+ "cursor/north_east_south_west_resize", >+ "cursor/north_west_south_east_resize", >+ "cursor/column_resize", >+ "cursor/row_resize", >+ "cursor/middle_panning", >+ "cursor/east_panning", >+ "cursor/north_panning", >+ "cursor/north_east_panning", >+ "cursor/north_west_panning", >+ "cursor/south_panning", >+ "cursor/south_east_panning", >+ "cursor/south_west_panning", >+ "cursor/west_panning", >+ "cursor/move", >+ "cursor/vertical_text", >+ "cursor/cell", >+ "cursor/context_menu", >+ "cursor/alias", >+ "cursor/progress", >+ "cursor/no_drop", >+ "cursor/copy", >+ "cursor/none", >+ "cursor/not_allowed", >+ "cursor/zoom_in", >+ "cursor/zoom_out", >+ "cursor/grab", >+ "cursor/grabbing", >+ ""}; // FIXME: Just return "" for custom type. We don't support it now. >+ return cursorStrings[type]; >+} >+ >+void Cursor::ensurePlatformCursor() const >+{ >+ if (m_platformCursor) >+ return; >+ m_platformCursor = cursorString(m_type); >+} >+ >+} >diff --git a/Source/WebCore/platform/nix/DragDataNix.cpp b/Source/WebCore/platform/nix/DragDataNix.cpp >new file mode 100644 >index 0000000..9ffb698 >--- /dev/null >+++ b/Source/WebCore/platform/nix/DragDataNix.cpp >@@ -0,0 +1,93 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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" >+ >+namespace WebCore { >+ >+bool DragData::canSmartReplace() const >+{ >+ return false; >+} >+ >+bool DragData::containsColor() const >+{ >+ return false; >+} >+ >+bool DragData::containsFiles() const >+{ >+ return false; >+} >+ >+unsigned DragData::numberOfFiles() const >+{ >+ return 0; >+} >+ >+void DragData::asFilenames(Vector<String>&) const >+{ >+} >+ >+bool DragData::containsPlainText() const >+{ >+ return false; >+} >+ >+String DragData::asPlainText(Frame*) const >+{ >+ return String(); >+} >+ >+Color DragData::asColor() const >+{ >+ return Color(); >+} >+ >+bool DragData::containsCompatibleContent() const >+{ >+ return false; >+} >+ >+bool DragData::containsURL(Frame*, FilenameConversionPolicy) const >+{ >+ return false; >+} >+ >+String DragData::asURL(Frame*, FilenameConversionPolicy, String*) const >+{ >+ return String(); >+} >+ >+PassRefPtr<DocumentFragment> DragData::asFragment(Frame*, PassRefPtr<Range>, bool, bool&) const >+{ >+ return 0; >+} >+ >+} >diff --git a/Source/WebCore/platform/nix/DragImageNix.cpp b/Source/WebCore/platform/nix/DragImageNix.cpp >new file mode 100644 >index 0000000..ddac861 >--- /dev/null >+++ b/Source/WebCore/platform/nix/DragImageNix.cpp >@@ -0,0 +1,70 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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*, RespectImageOrientationEnum) >+{ >+ notImplemented(); >+ return 0; >+} >+ >+DragImageRef createDragImageIconForCachedImage(CachedImage*) >+{ >+ notImplemented(); >+ return 0; >+} >+ >+} >diff --git a/Source/WebCore/platform/nix/ErrorsNix.cpp b/Source/WebCore/platform/nix/ErrorsNix.cpp >new file mode 100644 >index 0000000..f7704ad >--- /dev/null >+++ b/Source/WebCore/platform/nix/ErrorsNix.cpp >@@ -0,0 +1,110 @@ >+/* >+ * Copyright (C) 2012 Intel Corporation. All rights reserved. >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "ErrorsNix.h" >+ >+#include "DocumentLoader.h" >+#include "Frame.h" >+#include "PrintContext.h" >+#include "ResourceError.h" >+#include "ResourceRequest.h" >+#include "ResourceResponse.h" >+ >+namespace WebCore { >+ >+ResourceError cancelledError(const ResourceRequest& request) >+{ >+ return ResourceError(errorDomainNetwork, NetworkErrorCancelled, request.url().string(), "Load request cancelled"); >+} >+ >+ResourceError blockedError(const ResourceRequest& request) >+{ >+ return ResourceError(errorDomainPolicy, PolicyErrorCannotUseRestrictedPort, request.url().string(), "Not allowed to use restricted network port"); >+} >+ >+ResourceError cannotShowURLError(const ResourceRequest& request) >+{ >+ return ResourceError(errorDomainPolicy, PolicyErrorCannotShowURL, request.url().string(), "URL cannot be shown"); >+} >+ >+ResourceError interruptedForPolicyChangeError(const ResourceRequest& request) >+{ >+ return ResourceError(errorDomainPolicy, PolicyErrorFrameLoadInterruptedByPolicyChange, request.url().string(), "Frame load was interrupted"); >+} >+ >+ResourceError cannotShowMIMETypeError(const ResourceResponse& response) >+{ >+ return ResourceError(errorDomainPolicy, PolicyErrorCannotShowMimeType, response.url().string(), "Content with the specified MIME type cannot be shown"); >+} >+ >+ResourceError fileDoesNotExistError(const ResourceResponse& response) >+{ >+ return ResourceError(errorDomainNetwork, NetworkErrorFileDoesNotExist, response.url().string(), "File does not exist"); >+} >+ >+ResourceError pluginWillHandleLoadError(const ResourceResponse& response) >+{ >+ return ResourceError(errorDomainPlugin, PluginErrorWillHandleLoad, response.url().string(), "Plugin will handle load"); >+} >+ >+ResourceError downloadNetworkError(const ResourceError& networkError) >+{ >+ return ResourceError(errorDomainDownload, DownloadErrorNetwork, networkError.failingURL(), networkError.localizedDescription()); >+} >+ >+ResourceError downloadCancelledByUserError(const ResourceResponse& response) >+{ >+ return ResourceError(errorDomainDownload, DownloadErrorCancelledByUser, response.url().string(), "User cancelled the download"); >+} >+ >+ResourceError downloadDestinationError(const ResourceResponse& response, const String& errorMessage) >+{ >+ return ResourceError(errorDomainDownload, DownloadErrorDestination, response.url().string(), errorMessage); >+} >+ >+ResourceError printError(const PrintContext* printContext, const String& errorMessage) >+{ >+ DocumentLoader* documentLoader = printContext->frame()->loader()->documentLoader(); >+ >+ return ResourceError(errorDomainPrint, PrintErrorGeneral, documentLoader ? documentLoader->url() : KURL(), errorMessage); >+} >+ >+ResourceError printerNotFoundError(const PrintContext* printContext) >+{ >+ DocumentLoader* documentLoader = printContext->frame()->loader()->documentLoader(); >+ >+ return ResourceError(errorDomainPrint, PrintErrorPrinterNotFound, documentLoader ? documentLoader->url() : KURL(), "Printer not found"); >+} >+ >+ResourceError invalidPageRangeToPrint(const PrintContext* printContext) >+{ >+ DocumentLoader* documentLoader = printContext->frame()->loader()->documentLoader(); >+ >+ return ResourceError(errorDomainPrint, PrintErrorInvalidPageRange, documentLoader ? documentLoader->url() : KURL(), "Invalid page range"); >+} >+ >+} // namespace WebCore >diff --git a/Source/WebCore/platform/nix/ErrorsNix.h b/Source/WebCore/platform/nix/ErrorsNix.h >new file mode 100644 >index 0000000..1d1980a >--- /dev/null >+++ b/Source/WebCore/platform/nix/ErrorsNix.h >@@ -0,0 +1,100 @@ >+/* >+ * Copyright (C) 2012 Intel Corporation. All rights reserved. >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#ifndef ErrorsNix_h >+#define ErrorsNix_h >+ >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+class PrintContext; >+class ResourceError; >+class ResourceRequest; >+class ResourceResponse; >+ >+static const char errorDomainNetwork[] = "WebKitNetworkError"; >+static const char errorDomainPolicy[] = "WebKitPolicyError"; >+static const char errorDomainPlugin[] = "WebKitPluginError"; >+static const char errorDomainDownload[] = "WebKitDownloadError"; >+static const char errorDomainPrint[] = "WebKitPrintError"; >+ >+enum NetworkError { >+ NetworkErrorFailed = 399, >+ NetworkErrorTransport = 300, >+ NetworkErrorUnknownProtocol = 301, >+ NetworkErrorCancelled = 302, >+ NetworkErrorFileDoesNotExist = 303 >+}; >+ >+// Sync'd with Mac's WebKit Errors at: >+// Source/WebKit/mac/Misc/WebKitErrors[Private].h >+enum PolicyError { >+ PolicyErrorFailed = 199, >+ PolicyErrorCannotShowMimeType = 100, >+ PolicyErrorCannotShowURL = 101, >+ PolicyErrorFrameLoadInterruptedByPolicyChange = 102, >+ PolicyErrorCannotUseRestrictedPort = 103 >+}; >+ >+enum PluginError { >+ PluginErrorFailed = 299, >+ PluginErrorCannotFindPlugin = 200, >+ PluginErrorCannotLoadPlugin = 201, >+ PluginErrorJavaUnavailable = 202, >+ PluginErrorConnectionCancelled = 203, >+ PluginErrorWillHandleLoad = 204 >+}; >+ >+enum DownloadError { >+ DownloadErrorNetwork = 499, >+ DownloadErrorCancelledByUser = 400, >+ DownloadErrorDestination = 401 >+}; >+ >+enum PrintError { >+ PrintErrorGeneral = 599, >+ PrintErrorPrinterNotFound = 500, >+ PrintErrorInvalidPageRange = 501 >+}; >+ >+ResourceError cancelledError(const ResourceRequest&); >+ResourceError blockedError(const ResourceRequest&); >+ResourceError cannotShowURLError(const ResourceRequest&); >+ResourceError interruptedForPolicyChangeError(const ResourceRequest&); >+ResourceError cannotShowMIMETypeError(const ResourceResponse&); >+ResourceError fileDoesNotExistError(const ResourceResponse&); >+ResourceError pluginWillHandleLoadError(const ResourceResponse&); >+ResourceError downloadNetworkError(const ResourceError&); >+ResourceError downloadCancelledByUserError(const ResourceResponse&); >+ResourceError downloadDestinationError(const ResourceResponse&, const String& errorMessage); >+ResourceError printError(const PrintContext*, const String& errorMessage); >+ResourceError printerNotFoundError(const PrintContext*); >+ResourceError invalidPageRangeToPrint(const PrintContext*); >+ >+} >+ >+#endif // ErrorsNix_h >diff --git a/Source/WebCore/platform/nix/FileSystemNix.cpp b/Source/WebCore/platform/nix/FileSystemNix.cpp >new file mode 100644 >index 0000000..e6ff198 >--- /dev/null >+++ b/Source/WebCore/platform/nix/FileSystemNix.cpp >@@ -0,0 +1,341 @@ >+/* >+ * Copyright (C) 2007, 2009 Holger Hans Peter Freyther >+ * Copyright (C) 2008 Collabora, Ltd. >+ * Copyright (C) 2008 Apple Inc. All rights reserved. >+ * Portions Copyright (c) 2010 Motorola Mobility, 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 "FileSystem.h" >+ >+#include "FileMetadata.h" >+#include "UUID.h" >+#include <gio/gio.h> >+#include <glib.h> >+#include <glib/gstdio.h> >+#include <wtf/gobject/GOwnPtr.h> >+#include <wtf/gobject/GRefPtr.h> >+#include <wtf/gobject/GlibUtilities.h> >+#include <wtf/text/CString.h> >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+/* On linux file names are just raw bytes, so also strings that cannot be encoded in any way >+ * are valid file names. This mean that we cannot just store a file name as-is in a String >+ * but we have to escape it. >+ * On Windows the GLib file name encoding is always UTF-8 so we can optimize this case. */ >+String filenameToString(const char* filename) >+{ >+ if (!filename) >+ return String(); >+ >+ GOwnPtr<gchar> escapedString(g_uri_escape_string(filename, "/:", false)); >+ return escapedString.get(); >+} >+ >+CString fileSystemRepresentation(const String& path) >+{ >+ GOwnPtr<gchar> filename(g_uri_unescape_string(path.utf8().data(), 0)); >+ return filename.get(); >+} >+ >+// Converts a string to something suitable to be displayed to the user. >+String filenameForDisplay(const String& string) >+{ >+ CString filename = fileSystemRepresentation(string); >+ GOwnPtr<gchar> display(g_filename_to_utf8(filename.data(), 0, 0, 0, 0)); >+ if (!display) >+ return string; >+ >+ return String::fromUTF8(display.get()); >+} >+ >+bool fileExists(const String& path) >+{ >+ bool result = false; >+ CString filename = fileSystemRepresentation(path); >+ >+ if (!filename.isNull()) >+ result = g_file_test(filename.data(), G_FILE_TEST_EXISTS); >+ >+ return result; >+} >+ >+bool deleteFile(const String& path) >+{ >+ bool result = false; >+ CString filename = fileSystemRepresentation(path); >+ >+ if (!filename.isNull()) >+ result = g_remove(filename.data()) == 0; >+ >+ return result; >+} >+ >+bool deleteEmptyDirectory(const String& path) >+{ >+ bool result = false; >+ CString filename = fileSystemRepresentation(path); >+ >+ if (!filename.isNull()) >+ result = g_rmdir(filename.data()) == 0; >+ >+ return result; >+} >+ >+bool getFileSize(const String& path, long long& resultSize) >+{ >+ CString filename = fileSystemRepresentation(path); >+ if (filename.isNull()) >+ return false; >+ >+ GStatBuf statResult; >+ gint result = g_stat(filename.data(), &statResult); >+ if (result != 0) >+ return false; >+ >+ resultSize = statResult.st_size; >+ return true; >+} >+ >+bool getFileModificationTime(const String& path, time_t& modifiedTime) >+{ >+ CString filename = fileSystemRepresentation(path); >+ if (filename.isNull()) >+ return false; >+ >+ GStatBuf statResult; >+ gint result = g_stat(filename.data(), &statResult); >+ if (result != 0) >+ return false; >+ >+ modifiedTime = statResult.st_mtime; >+ return true; >+ >+} >+ >+bool getFileMetadata(const String& path, FileMetadata& metadata) >+{ >+ CString filename = fileSystemRepresentation(path); >+ if (filename.isNull()) >+ return false; >+ >+ struct stat statResult; >+ gint result = g_stat(filename.data(), &statResult); >+ if (result) >+ return false; >+ >+ metadata.modificationTime = statResult.st_mtime; >+ metadata.length = statResult.st_size; >+ metadata.type = S_ISDIR(statResult.st_mode) ? FileMetadata::TypeDirectory : FileMetadata::TypeFile; >+ return true; >+ >+} >+ >+String pathByAppendingComponent(const String& path, const String& component) >+{ >+ if (path.endsWith(G_DIR_SEPARATOR_S)) >+ return path + component; >+ else >+ return path + G_DIR_SEPARATOR_S + component; >+} >+ >+bool makeAllDirectories(const String& path) >+{ >+ CString filename = fileSystemRepresentation(path); >+ if (filename.isNull()) >+ return false; >+ >+ gint result = g_mkdir_with_parents(filename.data(), S_IRWXU); >+ >+ return result == 0; >+} >+ >+String homeDirectoryPath() >+{ >+ return filenameToString(g_get_home_dir()); >+} >+ >+String pathGetFileName(const String& pathName) >+{ >+ if (pathName.isEmpty()) >+ return pathName; >+ >+ CString tmpFilename = fileSystemRepresentation(pathName); >+ GOwnPtr<gchar> baseName(g_path_get_basename(tmpFilename.data())); >+ return String::fromUTF8(baseName.get()); >+} >+ >+CString applicationDirectoryPath() >+{ >+ CString path = getCurrentExecutablePath(); >+ if (!path.isNull()) >+ return path; >+ >+ // If the above fails, check the PATH env variable. >+ GOwnPtr<char> currentExePath(g_find_program_in_path(g_get_prgname())); >+ if (!currentExePath.get()) >+ return CString(); >+ >+ GOwnPtr<char> dirname(g_path_get_dirname(currentExePath.get())); >+ return dirname.get(); >+} >+ >+CString sharedResourcesPath() >+{ >+ static CString cachedPath; >+ if (!cachedPath.isNull()) >+ return cachedPath; >+ >+ GOwnPtr<gchar> dataPath(g_build_filename(DATA_DIR, "webkitnix", NULL)); >+ >+ cachedPath = dataPath.get(); >+ return cachedPath; >+} >+ >+uint64_t getVolumeFreeSizeForPath(const char* path) >+{ >+ GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(path)); >+ GRefPtr<GFileInfo> fileInfo = adoptGRef(g_file_query_filesystem_info(file.get(), G_FILE_ATTRIBUTE_FILESYSTEM_FREE, 0, 0)); >+ if (!fileInfo) >+ return 0; >+ >+ return g_file_info_get_attribute_uint64(fileInfo.get(), G_FILE_ATTRIBUTE_FILESYSTEM_FREE); >+} >+ >+String directoryName(const String& path) >+{ >+ /* No null checking needed */ >+ GOwnPtr<char> dirname(g_path_get_dirname(fileSystemRepresentation(path).data())); >+ return String::fromUTF8(dirname.get()); >+} >+ >+Vector<String> listDirectory(const String& path, const String& filter) >+{ >+ Vector<String> entries; >+ >+ CString filename = fileSystemRepresentation(path); >+ GDir* dir = g_dir_open(filename.data(), 0, 0); >+ if (!dir) >+ return entries; >+ >+ GPatternSpec *pspec = g_pattern_spec_new((filter.utf8()).data()); >+ while (const char* name = g_dir_read_name(dir)) { >+ if (!g_pattern_match_string(pspec, name)) >+ continue; >+ >+ GOwnPtr<gchar> entry(g_build_filename(filename.data(), name, NULL)); >+ entries.append(filenameToString(entry.get())); >+ } >+ g_pattern_spec_free(pspec); >+ g_dir_close(dir); >+ >+ return entries; >+} >+ >+String openTemporaryFile(const String& prefix, PlatformFileHandle& handle) >+{ >+ GOwnPtr<gchar> filename(g_strdup_printf("%s%s", prefix.utf8().data(), createCanonicalUUIDString().utf8().data())); >+ GOwnPtr<gchar> tempPath(g_build_filename(g_get_tmp_dir(), filename.get(), NULL)); >+ GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(tempPath.get())); >+ >+ handle = g_file_create_readwrite(file.get(), G_FILE_CREATE_NONE, 0, 0); >+ if (!isHandleValid(handle)) >+ return String(); >+ return String::fromUTF8(tempPath.get()); >+} >+ >+PlatformFileHandle openFile(const String& path, FileOpenMode mode) >+{ >+ CString fsRep = fileSystemRepresentation(path); >+ if (fsRep.isNull()) >+ return invalidPlatformFileHandle; >+ >+ GRefPtr<GFile> file = adoptGRef(g_file_new_for_path(fsRep.data())); >+ GFileIOStream* ioStream = 0; >+ if (mode == OpenForRead) >+ ioStream = g_file_open_readwrite(file.get(), 0, 0); >+ else if (mode == OpenForWrite) { >+ if (g_file_test(fsRep.data(), static_cast<GFileTest>(G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR))) >+ ioStream = g_file_open_readwrite(file.get(), 0, 0); >+ else >+ ioStream = g_file_create_readwrite(file.get(), G_FILE_CREATE_NONE, 0, 0); >+ } >+ >+ return ioStream; >+} >+ >+void closeFile(PlatformFileHandle& handle) >+{ >+ if (!isHandleValid(handle)) >+ return; >+ >+ g_io_stream_close(G_IO_STREAM(handle), 0, 0); >+ g_object_unref(handle); >+ handle = invalidPlatformFileHandle; >+} >+ >+long long seekFile(PlatformFileHandle handle, long long offset, FileSeekOrigin origin) >+{ >+ GSeekType seekType = G_SEEK_SET; >+ switch (origin) { >+ case SeekFromBeginning: >+ seekType = G_SEEK_SET; >+ break; >+ case SeekFromCurrent: >+ seekType = G_SEEK_CUR; >+ break; >+ case SeekFromEnd: >+ seekType = G_SEEK_END; >+ break; >+ default: >+ ASSERT_NOT_REACHED(); >+ } >+ >+ if (!g_seekable_seek(G_SEEKABLE(g_io_stream_get_input_stream(G_IO_STREAM(handle))), >+ offset, seekType, 0, 0)) >+ return -1; >+ return g_seekable_tell(G_SEEKABLE(g_io_stream_get_input_stream(G_IO_STREAM(handle)))); >+} >+ >+int writeToFile(PlatformFileHandle handle, const char* data, int length) >+{ >+ gsize bytesWritten; >+ g_output_stream_write_all(g_io_stream_get_output_stream(G_IO_STREAM(handle)), >+ data, length, &bytesWritten, 0, 0); >+ return bytesWritten; >+} >+ >+int readFromFile(PlatformFileHandle handle, char* data, int length) >+{ >+ GOwnPtr<GError> error; >+ do { >+ gssize bytesRead = g_input_stream_read(g_io_stream_get_input_stream(G_IO_STREAM(handle)), >+ data, length, 0, &error.outPtr()); >+ if (bytesRead >= 0) >+ return bytesRead; >+ } while (error && error->code == G_FILE_ERROR_INTR); >+ return -1; >+} >+ >+bool unloadModule(PlatformModule module) >+{ >+ return g_module_close(module); >+} >+} >diff --git a/Source/WebCore/platform/nix/GamepadsNix.cpp b/Source/WebCore/platform/nix/GamepadsNix.cpp >new file mode 100644 >index 0000000..b1a2839 >--- /dev/null >+++ b/Source/WebCore/platform/nix/GamepadsNix.cpp >@@ -0,0 +1,64 @@ >+/* >+ * Copyright (C) 2011, 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: >+ * >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND >+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE >+ * ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE >+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL >+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR >+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER >+ * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT >+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY >+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH >+ * DAMAGE. >+ */ >+ >+#include "config.h" >+#include "Gamepads.h" >+ >+#if ENABLE(GAMEPAD) >+ >+#include "GamepadList.h" >+ >+#include <public/Platform.h> >+ >+namespace WebCore { >+ >+class GamepadList; >+ >+void sampleGamepads(GamepadList* into) >+{ >+ WebKit::WebGamepads gamepads; >+ >+ WebKit::Platform::current()->sampleGamepads(gamepads); >+ >+ for (unsigned i = 0; i < WebKit::WebGamepads::itemsLengthCap; ++i) { >+ WebKit::WebGamepad& webGamepad = gamepads.items[i]; >+ if (i < gamepads.length && webGamepad.connected) { >+ RefPtr<Gamepad> gamepad = into->item(i); >+ if (!gamepad) >+ gamepad = Gamepad::create(); >+ gamepad->id(webGamepad.id); >+ gamepad->index(i); >+ gamepad->timestamp(webGamepad.timestamp); >+ gamepad->axes(webGamepad.axesLength, webGamepad.axes); >+ gamepad->buttons(webGamepad.buttonsLength, webGamepad.buttons); >+ into->set(i, gamepad); >+ } else >+ into->set(i, 0); >+ } >+} >+ >+} >+ >+#endif >diff --git a/Source/WebCore/platform/nix/LanguageNix.cpp b/Source/WebCore/platform/nix/LanguageNix.cpp >new file mode 100644 >index 0000000..d9707c1 >--- /dev/null >+++ b/Source/WebCore/platform/nix/LanguageNix.cpp >@@ -0,0 +1,62 @@ >+/* >+ * Copyright (C) 2003, 2006 Apple Computer, Inc. All rights reserved. >+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia >+ * Copyright (C) 2009-2010 ProFUSION embedded systems >+ * Copyright (C) 2009-2010 Samsung Electronics >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 "Language.h" >+ >+#include <locale.h> >+#include <wtf/Vector.h> >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+static String platformLanguage() >+{ >+ char* localeDefault = setlocale(LC_CTYPE, 0); >+ >+ if (!localeDefault) >+ return String("c"); >+ >+ String locale = String(localeDefault); >+ locale.replace('_', '-'); >+ size_t position = locale.find('.'); >+ if (position != notFound) >+ locale = locale.left(position); >+ >+ return locale; >+} >+ >+Vector<String> platformUserPreferredLanguages() >+{ >+ Vector<String> userPreferredLanguages; >+ userPreferredLanguages.append(platformLanguage()); >+ return userPreferredLanguages; >+} >+ >+} >diff --git a/Source/WebCore/platform/nix/LocalizedStringsNix.cpp b/Source/WebCore/platform/nix/LocalizedStringsNix.cpp >new file mode 100644 >index 0000000..2810111 >--- /dev/null >+++ b/Source/WebCore/platform/nix/LocalizedStringsNix.cpp >@@ -0,0 +1,611 @@ >+/* >+ * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. >+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com >+ * Copyright (C) 2007 Holger Hans Peter Freyther >+ * Copyright (C) 2008 Christian Dywan <christian@imendio.com> >+ * Copyright (C) 2008 Nuanti Ltd. >+ * Copyright (C) 2008 INdT Instituto Nokia de Tecnologia >+ * Copyright (C) 2009-2010 ProFUSION embedded systems >+ * Copyright (C) 2009-2010 Samsung Electronics >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 "LocalizedStrings.h" >+ >+#include "NotImplemented.h" >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+String submitButtonDefaultLabel() >+{ >+ return String::fromUTF8("Submit"); >+} >+ >+String inputElementAltText() >+{ >+ return String::fromUTF8("Submit"); >+} >+ >+String resetButtonDefaultLabel() >+{ >+ return String::fromUTF8("Reset"); >+} >+ >+String defaultDetailsSummaryText() >+{ >+ return String::fromUTF8("Details"); >+} >+ >+String searchableIndexIntroduction() >+{ >+ return String::fromUTF8("This is a searchable index. Enter search keywords: "); >+} >+ >+String fileButtonChooseFileLabel() >+{ >+ return String::fromUTF8("Choose File"); >+} >+ >+String fileButtonChooseMultipleFilesLabel() >+{ >+ return String::fromUTF8("Choose Files"); >+} >+ >+String fileButtonNoFileSelectedLabel() >+{ >+ return String::fromUTF8("No file selected"); >+} >+ >+String fileButtonNoFilesSelectedLabel() >+{ >+ return String::fromUTF8("No files selected"); >+} >+ >+String contextMenuItemTagOpenLinkInNewWindow() >+{ >+ return String::fromUTF8("Open Link in New Window"); >+} >+ >+String contextMenuItemTagDownloadLinkToDisk() >+{ >+ return String::fromUTF8("Download Linked File"); >+} >+ >+String contextMenuItemTagCopyLinkToClipboard() >+{ >+ return String::fromUTF8("Copy Link Location"); >+} >+ >+String contextMenuItemTagOpenImageInNewWindow() >+{ >+ return String::fromUTF8("Open Image in New Window"); >+} >+ >+String contextMenuItemTagDownloadVideoToDisk() >+{ >+ return String::fromUTF8("Download Video"); >+} >+ >+String contextMenuItemTagDownloadAudioToDisk() >+{ >+ return String::fromUTF8("Download Audio"); >+} >+ >+String contextMenuItemTagDownloadImageToDisk() >+{ >+ return String::fromUTF8("Save Image As"); >+} >+ >+String contextMenuItemTagCopyImageToClipboard() >+{ >+ return String::fromUTF8("Copy Image"); >+} >+ >+String contextMenuItemTagCopyImageUrlToClipboard() >+{ >+ return String::fromUTF8("Copy Image Address"); >+} >+ >+String contextMenuItemTagOpenVideoInNewWindow() >+{ >+ return String::fromUTF8("Open Video in New Window"); >+} >+ >+String contextMenuItemTagOpenAudioInNewWindow() >+{ >+ return String::fromUTF8("Open Audio in New Window"); >+} >+ >+String contextMenuItemTagCopyVideoLinkToClipboard() >+{ >+ return String::fromUTF8("Copy Video Link Location"); >+} >+ >+String contextMenuItemTagCopyAudioLinkToClipboard() >+{ >+ return String::fromUTF8("Copy Audio Link Location"); >+} >+ >+String contextMenuItemTagToggleMediaControls() >+{ >+ return String::fromUTF8("Toggle Media Controls"); >+} >+ >+String contextMenuItemTagToggleMediaLoop() >+{ >+ return String::fromUTF8("Toggle Media Loop Playback"); >+} >+ >+String contextMenuItemTagEnterVideoFullscreen() >+{ >+ return String::fromUTF8("Switch Video to Fullscreen"); >+} >+ >+String contextMenuItemTagMediaPlay() >+{ >+ return String::fromUTF8("Play"); >+} >+ >+String contextMenuItemTagMediaPause() >+{ >+ return String::fromUTF8("Pause"); >+} >+ >+String contextMenuItemTagMediaMute() >+{ >+ return String::fromUTF8("Mute"); >+} >+ >+String contextMenuItemTagOpenFrameInNewWindow() >+{ >+ return String::fromUTF8("Open Frame in New Window"); >+} >+ >+String contextMenuItemTagCopy() >+{ >+ static String stockLabel = String::fromUTF8("Copy"); >+ return stockLabel; >+} >+ >+String contextMenuItemTagDelete() >+{ >+ static String stockLabel = String::fromUTF8("Delete"); >+ return stockLabel; >+} >+ >+String contextMenuItemTagSelectAll() >+{ >+ static String stockLabel = String::fromUTF8("Select All"); >+ return stockLabel; >+} >+ >+String contextMenuItemTagUnicode() >+{ >+ return String::fromUTF8("Insert Unicode Control Character"); >+} >+ >+String contextMenuItemTagInputMethods() >+{ >+ return String::fromUTF8("Input Methods"); >+} >+ >+String contextMenuItemTagGoBack() >+{ >+ static String stockLabel = String::fromUTF8("Go Back"); >+ return stockLabel; >+} >+ >+String contextMenuItemTagGoForward() >+{ >+ static String stockLabel = String::fromUTF8("Go Forward"); >+ return stockLabel; >+} >+ >+String contextMenuItemTagStop() >+{ >+ static String stockLabel = String::fromUTF8("Stop"); >+ return stockLabel; >+} >+ >+String contextMenuItemTagReload() >+{ >+ return String::fromUTF8("Reload"); >+} >+ >+String contextMenuItemTagCut() >+{ >+ static String stockLabel = String::fromUTF8("Cut"); >+ return stockLabel; >+} >+ >+String contextMenuItemTagPaste() >+{ >+ static String stockLabel = String::fromUTF8("Paste"); >+ return stockLabel; >+} >+ >+String contextMenuItemTagNoGuessesFound() >+{ >+ return String::fromUTF8("No Guesses Found"); >+} >+ >+String contextMenuItemTagIgnoreSpelling() >+{ >+ return String::fromUTF8("Ignore Spelling"); >+} >+ >+String contextMenuItemTagLearnSpelling() >+{ >+ return String::fromUTF8("Learn Spelling"); >+} >+ >+String contextMenuItemTagSearchWeb() >+{ >+ return String::fromUTF8("Search the Web"); >+} >+ >+String contextMenuItemTagLookUpInDictionary(const String&) >+{ >+ return String::fromUTF8("Look Up in Dictionary"); >+} >+ >+String contextMenuItemTagOpenLink() >+{ >+ return String::fromUTF8("Open Link"); >+} >+ >+String contextMenuItemTagIgnoreGrammar() >+{ >+ return String::fromUTF8("Ignore Grammar"); >+} >+ >+String contextMenuItemTagSpellingMenu() >+{ >+ return String::fromUTF8("Spelling and Grammar"); >+} >+ >+String contextMenuItemTagShowSpellingPanel(bool show) >+{ >+ return String::fromUTF8(show ? "Show Spelling and Grammar" : "Hide Spelling and Grammar"); >+} >+ >+String contextMenuItemTagCheckSpelling() >+{ >+ return String::fromUTF8("Check Document Now"); >+} >+ >+String contextMenuItemTagCheckSpellingWhileTyping() >+{ >+ return String::fromUTF8("Check Spelling While _Typing"); >+} >+ >+String contextMenuItemTagCheckGrammarWithSpelling() >+{ >+ return String::fromUTF8("Check Grammar With Spelling"); >+} >+ >+String contextMenuItemTagFontMenu() >+{ >+ return String::fromUTF8("Font"); >+} >+ >+String contextMenuItemTagBold() >+{ >+ static String stockLabel = String::fromUTF8("Bold"); >+ return stockLabel; >+} >+ >+String contextMenuItemTagItalic() >+{ >+ static String stockLabel = String::fromUTF8("Italic"); >+ return stockLabel; >+} >+ >+String contextMenuItemTagUnderline() >+{ >+ static String stockLabel = String::fromUTF8("Underline"); >+ return stockLabel; >+} >+ >+String contextMenuItemTagOutline() >+{ >+ return String::fromUTF8("Outline"); >+} >+ >+String contextMenuItemTagInspectElement() >+{ >+ return String::fromUTF8("Inspect Element"); >+} >+ >+String contextMenuItemTagRightToLeft() >+{ >+ return String(); >+} >+ >+String contextMenuItemTagLeftToRight() >+{ >+ return String(); >+} >+ >+String contextMenuItemTagWritingDirectionMenu() >+{ >+ return String(); >+} >+ >+String contextMenuItemTagTextDirectionMenu() >+{ >+ return String(); >+} >+ >+String contextMenuItemTagDefaultDirection() >+{ >+ return String(); >+} >+ >+String searchMenuNoRecentSearchesText() >+{ >+ return String::fromUTF8("No recent searches"); >+} >+ >+String searchMenuRecentSearchesText() >+{ >+ return String::fromUTF8("Recent searches"); >+} >+ >+String searchMenuClearRecentSearchesText() >+{ >+ return String::fromUTF8("Clear recent searches"); >+} >+ >+String AXDefinitionListTermText() >+{ >+ return String::fromUTF8("term"); >+} >+ >+String AXDefinitionListDefinitionText() >+{ >+ return String::fromUTF8("definition"); >+} >+ >+String AXFooterRoleDescriptionText() >+{ >+ return String::fromUTF8("footer"); >+} >+ >+String AXButtonActionVerb() >+{ >+ return String::fromUTF8("press"); >+} >+ >+String AXRadioButtonActionVerb() >+{ >+ return String::fromUTF8("select"); >+} >+ >+String AXTextFieldActionVerb() >+{ >+ return String::fromUTF8("activate"); >+} >+ >+String AXCheckedCheckBoxActionVerb() >+{ >+ return String::fromUTF8("uncheck"); >+} >+ >+String AXUncheckedCheckBoxActionVerb() >+{ >+ return String::fromUTF8("check"); >+} >+ >+String AXLinkActionVerb() >+{ >+ return String::fromUTF8("jump"); >+} >+ >+String unknownFileSizeText() >+{ >+ return String::fromUTF8("Unknown"); >+} >+ >+String imageTitle(const String&, const IntSize&) >+{ >+ notImplemented(); >+ return String(); >+} >+ >+#if ENABLE(VIDEO) >+String localizedMediaControlElementString(const String& name) >+{ >+ notImplemented(); >+ return String(); >+} >+ >+String localizedMediaControlElementHelpText(const String& name) >+{ >+ notImplemented(); >+ return String(); >+} >+ >+String localizedMediaTimeDescription(float time) >+{ >+ notImplemented(); >+ return String(); >+} >+#endif >+ >+String mediaElementLoadingStateText() >+{ >+ return String::fromUTF8("Loading..."); >+} >+ >+String mediaElementLiveBroadcastStateText() >+{ >+ return String::fromUTF8("Live Broadcast"); >+} >+ >+String validationMessagePatternMismatchText() >+{ >+ return String::fromUTF8("pattern mismatch"); >+} >+ >+String validationMessageRangeOverflowText(const String&) >+{ >+ return String::fromUTF8("range overflow"); >+} >+ >+String validationMessageRangeUnderflowText(const String&) >+{ >+ return String::fromUTF8("range underflow"); >+} >+ >+String validationMessageStepMismatchText(const String&, const String&) >+{ >+ return String::fromUTF8("step mismatch"); >+} >+ >+String validationMessageTooLongText(int, int) >+{ >+ return String::fromUTF8("too long"); >+} >+ >+String validationMessageTypeMismatchText() >+{ >+ return String::fromUTF8("type mismatch"); >+} >+ >+String validationMessageTypeMismatchForEmailText() >+{ >+ return String::fromUTF8("type mismatch"); >+} >+ >+String validationMessageTypeMismatchForMultipleEmailText() >+{ >+ return String::fromUTF8("type mismatch"); >+} >+ >+String validationMessageTypeMismatchForURLText() >+{ >+ return String::fromUTF8("type mismatch"); >+} >+ >+String validationMessageValueMissingText() >+{ >+ return String::fromUTF8("value missing"); >+} >+ >+String validationMessageValueMissingForCheckboxText() >+{ >+ notImplemented(); >+ return validationMessageValueMissingText(); >+} >+ >+String validationMessageValueMissingForFileText() >+{ >+ notImplemented(); >+ return validationMessageValueMissingText(); >+} >+ >+String validationMessageValueMissingForMultipleFileText() >+{ >+ notImplemented(); >+ return validationMessageValueMissingText(); >+} >+ >+String validationMessageValueMissingForRadioText() >+{ >+ notImplemented(); >+ return validationMessageValueMissingText(); >+} >+ >+String validationMessageValueMissingForSelectText() >+{ >+ notImplemented(); >+ return validationMessageValueMissingText(); >+} >+ >+String missingPluginText() >+{ >+ return String::fromUTF8("missing plugin"); >+} >+ >+String AXMenuListPopupActionVerb() >+{ >+ return String(); >+} >+ >+String AXMenuListActionVerb() >+{ >+ return String(); >+} >+ >+String multipleFileUploadText(unsigned numberOfFiles) >+{ >+ return String::number(numberOfFiles) + String::fromUTF8(" files"); >+} >+ >+String crashedPluginText() >+{ >+ return String::fromUTF8("plugin crashed"); >+} >+ >+String blockedPluginByContentSecurityPolicyText() >+{ >+ notImplemented(); >+ return String(); >+} >+ >+String insecurePluginVersionText() >+{ >+ notImplemented(); >+ return String(); >+} >+ >+String inactivePluginText() >+{ >+ notImplemented(); >+ return String(); >+} >+ >+String unacceptableTLSCertificate() >+{ >+ return String::fromUTF8("Unacceptable TLS certificate"); >+} >+ >+String localizedString(const char* key) >+{ >+ return String::fromUTF8(key, strlen(key)); >+} >+ >+String validationMessageBadInputForNumberText() >+{ >+ notImplemented(); >+ return validationMessageTypeMismatchText(); >+} >+ >+String snapshottedPlugInLabelTitle() { return String(); } >+String snapshottedPlugInLabelSubtitle() { return String(); } >+ >+} >diff --git a/Source/WebCore/platform/nix/MIMETypeRegistryNix.cpp b/Source/WebCore/platform/nix/MIMETypeRegistryNix.cpp >new file mode 100644 >index 0000000..33a5868 >--- /dev/null >+++ b/Source/WebCore/platform/nix/MIMETypeRegistryNix.cpp >@@ -0,0 +1,97 @@ >+/* >+ * Copyright (C) 2006 Zack Rusin <zack@kde.org> >+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. >+ * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) >+ * Copyright (C) 2008 Torch Mobile Inc. http://www.torchmobile.com/ >+ * Copyright (C) 2009-2010 ProFUSION embedded systems >+ * Copyright (C) 2009-2010 Samsung Electronics >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 <wtf/Assertions.h> >+#include <wtf/MainThread.h> >+ >+namespace WebCore { >+ >+struct ExtensionMap { >+ const char* extension; >+ const char* mimeType; >+}; >+ >+static const ExtensionMap extensionMap[] = { >+ { "bmp", "image/bmp" }, >+ { "css", "text/css" }, >+ { "gif", "image/gif" }, >+ { "html", "text/html" }, >+ { "htm", "text/html" }, >+ { "ico", "image/x-icon" }, >+ { "jpeg", "image/jpeg" }, >+ { "jpg", "image/jpeg" }, >+ { "js", "application/x-javascript" }, >+ { "mng", "video/x-mng" }, >+ { "pbm", "image/x-portable-bitmap" }, >+ { "pgm", "image/x-portable-graymap" }, >+ { "pdf", "application/pdf" }, >+ { "png", "image/png" }, >+ { "ppm", "image/x-portable-pixmap" }, >+ { "rss", "application/rss+xml" }, >+ { "svg", "image/svg+xml" }, >+ { "text", "text/plain" }, >+ { "tif", "image/tiff" }, >+ { "tiff", "image/tiff" }, >+ { "txt", "text/plain" }, >+ { "xbm", "image/x-xbitmap" }, >+ { "xml", "text/xml" }, >+ { "xpm", "image/x-xpm" }, >+ { "xsl", "text/xsl" }, >+ { "xhtml", "application/xhtml+xml" }, >+ { "wml", "text/vnd.wap.wml" }, >+ { "wmlc", "application/vnd.wap.wmlc" }, >+ { 0, 0 } >+}; >+ >+String MIMETypeRegistry::getMIMETypeForExtension(const String &ext) >+{ >+ ASSERT(isMainThread()); >+ >+ String s = ext.lower(); >+ const ExtensionMap *e = extensionMap; >+ while (e->extension) { >+ if (s == e->extension) >+ return e->mimeType; >+ ++e; >+ } >+ >+ return String(); >+} >+ >+bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&) >+{ >+ return false; >+} >+ >+} >diff --git a/Source/WebCore/platform/nix/NixKeyboardUtilities.cpp b/Source/WebCore/platform/nix/NixKeyboardUtilities.cpp >new file mode 100644 >index 0000000..5e2514c >--- /dev/null >+++ b/Source/WebCore/platform/nix/NixKeyboardUtilities.cpp >@@ -0,0 +1,204 @@ >+/* >+ * Copyright (C) 2011 Samsung Electronics >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 "NixKeyboardUtilities.h" >+ >+#include "KeyboardEvent.h" >+#include "WindowsKeyboardCodes.h" >+#include <wtf/HashMap.h> >+#include <wtf/text/StringHash.h> >+#include <wtf/text/WTFString.h> >+ >+namespace WebCore { >+ >+typedef HashMap<String, String> KeyMap; >+typedef HashMap<String, int> WindowsKeyMap; >+typedef HashMap<int, const char*> KeyCommandMap; >+ >+static KeyMap& keyMap() >+{ >+ DEFINE_STATIC_LOCAL(KeyMap, keyMap, ()); >+ return keyMap; >+} >+ >+static WindowsKeyMap& windowsKeyMap() >+{ >+ DEFINE_STATIC_LOCAL(WindowsKeyMap, windowsKeyMap, ()); >+ return windowsKeyMap; >+} >+ >+static KeyCommandMap& keyDownCommandsMap() >+{ >+ DEFINE_STATIC_LOCAL(KeyCommandMap, keyDownCommandsMap, ()); >+ return keyDownCommandsMap; >+} >+ >+static KeyCommandMap& keyPressCommandsMap() >+{ >+ DEFINE_STATIC_LOCAL(KeyCommandMap, keyPressCommandsMap, ()); >+ return keyPressCommandsMap; >+} >+ >+static inline void addCharactersToKeyMap(const char from, const char to) >+{ >+ for (char c = from; c <= to; c++) >+ keyMap().set(String(&c, 1), String::format("U+%04X", c)); >+} >+ >+static inline void addCharactersToWinKeyMap(const char from, const char to, const int baseCode) >+{ >+ int i = 0; >+ for (char c = from; c <= to; c++, i++) >+ windowsKeyMap().set(String(&c, 1), baseCode + i); >+} >+ >+static const unsigned CtrlKey = 1 << 0; >+static const unsigned AltKey = 1 << 1; >+static const unsigned ShiftKey = 1 << 2; >+ >+struct KeyDownEntry { >+ unsigned virtualKey; >+ unsigned modifiers; >+ const char* name; >+}; >+ >+struct KeyPressEntry { >+ unsigned charCode; >+ unsigned modifiers; >+ const char* name; >+}; >+ >+static const KeyDownEntry keyDownEntries[] = { >+ { VK_LEFT, 0, "MoveLeft" }, >+ { VK_LEFT, ShiftKey, "MoveLeftAndModifySelection" }, >+ { VK_LEFT, CtrlKey, "MoveWordLeft" }, >+ { VK_LEFT, CtrlKey | ShiftKey, "MoveWordLeftAndModifySelection" }, >+ { VK_RIGHT, 0, "MoveRight" }, >+ { VK_RIGHT, ShiftKey, "MoveRightAndModifySelection" }, >+ { VK_RIGHT, CtrlKey, "MoveWordRight" }, >+ { VK_RIGHT, CtrlKey | ShiftKey, "MoveWordRightAndModifySelection" }, >+ { VK_UP, 0, "MoveUp" }, >+ { VK_UP, ShiftKey, "MoveUpAndModifySelection" }, >+ { VK_PRIOR, ShiftKey, "MovePageUpAndModifySelection" }, >+ { VK_DOWN, 0, "MoveDown" }, >+ { VK_DOWN, ShiftKey, "MoveDownAndModifySelection" }, >+ { VK_NEXT, ShiftKey, "MovePageDownAndModifySelection" }, >+ { VK_PRIOR, 0, "MovePageUp" }, >+ { VK_NEXT, 0, "MovePageDown" }, >+ { VK_HOME, 0, "MoveToBeginningOfLine" }, >+ { VK_HOME, ShiftKey, "MoveToBeginningOfLineAndModifySelection" }, >+ { VK_HOME, CtrlKey, "MoveToBeginningOfDocument" }, >+ { VK_HOME, CtrlKey | ShiftKey, "MoveToBeginningOfDocumentAndModifySelection" }, >+ >+ { VK_END, 0, "MoveToEndOfLine" }, >+ { VK_END, ShiftKey, "MoveToEndOfLineAndModifySelection" }, >+ { VK_END, CtrlKey, "MoveToEndOfDocument" }, >+ { VK_END, CtrlKey | ShiftKey, "MoveToEndOfDocumentAndModifySelection" }, >+ >+ { VK_BACK, 0, "DeleteBackward" }, >+ { VK_BACK, ShiftKey, "DeleteBackward" }, >+ { VK_DELETE, 0, "DeleteForward" }, >+ { VK_BACK, CtrlKey, "DeleteWordBackward" }, >+ { VK_DELETE, CtrlKey, "DeleteWordForward" }, >+ >+ { 'B', CtrlKey, "ToggleBold" }, >+ { 'I', CtrlKey, "ToggleItalic" }, >+ >+ { VK_ESCAPE, 0, "Cancel" }, >+ { VK_OEM_PERIOD, CtrlKey, "Cancel" }, >+ { VK_TAB, 0, "InsertTab" }, >+ { VK_TAB, ShiftKey, "InsertBacktab" }, >+ { VK_RETURN, 0, "InsertNewline" }, >+ { VK_RETURN, CtrlKey, "InsertNewline" }, >+ { VK_RETURN, AltKey, "InsertNewline" }, >+ { VK_RETURN, AltKey | ShiftKey, "InsertNewline" }, >+}; >+ >+static const KeyPressEntry keyPressEntries[] = { >+ { '\t', 0, "InsertTab" }, >+ { '\t', ShiftKey, "InsertBacktab" }, >+ { '\r', 0, "InsertNewline" }, >+ { '\r', CtrlKey, "InsertNewline" }, >+ { '\r', AltKey, "InsertNewline" }, >+ { '\r', AltKey | ShiftKey, "InsertNewline" }, >+}; >+ >+static void createKeyDownCommandMap() >+{ >+ for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyDownEntries); ++i) >+ keyDownCommandsMap().set(keyDownEntries[i].modifiers << 16 | keyDownEntries[i].virtualKey, keyDownEntries[i].name); >+} >+ >+static void createKeyPressCommandMap() >+{ >+ for (size_t i = 0; i < WTF_ARRAY_LENGTH(keyPressEntries); ++i) >+ keyPressCommandsMap().set(keyPressEntries[i].modifiers << 16 | keyPressEntries[i].charCode, keyPressEntries[i].name); >+} >+ >+const char* getKeyDownCommandName(const KeyboardEvent* event) >+{ >+ unsigned modifiers = 0; >+ if (event->shiftKey()) >+ modifiers |= ShiftKey; >+ if (event->altKey()) >+ modifiers |= AltKey; >+ if (event->ctrlKey()) >+ modifiers |= CtrlKey; >+ >+ int mapKey = modifiers << 16 | event->keyCode(); >+ if (!mapKey) >+ return 0; >+ >+ if (keyDownCommandsMap().isEmpty()) >+ createKeyDownCommandMap(); >+ >+ return keyDownCommandsMap().get(mapKey); >+} >+ >+const char* getKeyPressCommandName(const KeyboardEvent* event) >+{ >+ unsigned modifiers = 0; >+ if (event->shiftKey()) >+ modifiers |= ShiftKey; >+ if (event->altKey()) >+ modifiers |= AltKey; >+ if (event->ctrlKey()) >+ modifiers |= CtrlKey; >+ >+ int mapKey = modifiers << 16 | event->charCode(); >+ if (!mapKey) >+ return 0; >+ >+ if (keyPressCommandsMap().isEmpty()) >+ createKeyPressCommandMap(); >+ >+ return keyPressCommandsMap().get(mapKey); >+} >+ >+} // namespace WebCore >diff --git a/Source/WebCore/platform/nix/NixKeyboardUtilities.h b/Source/WebCore/platform/nix/NixKeyboardUtilities.h >new file mode 100644 >index 0000000..c25610c >--- /dev/null >+++ b/Source/WebCore/platform/nix/NixKeyboardUtilities.h >@@ -0,0 +1,45 @@ >+/* >+ * Copyright (C) 2011 Samsung Electronics >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 NixKeyboardUtilities_h >+#define NixKeyboardUtilities_h >+ >+namespace WTF { >+class String; >+} >+ >+namespace WebCore { >+ >+class KeyboardEvent; >+ >+const char* getKeyDownCommandName(const KeyboardEvent*); >+const char* getKeyPressCommandName(const KeyboardEvent*); >+ >+} // namespace WebCore >+ >+#endif // NixKeyboardUtilities_h >diff --git a/Source/WebCore/platform/nix/PasteboardNix.cpp b/Source/WebCore/platform/nix/PasteboardNix.cpp >new file mode 100644 >index 0000000..f83cdf7 >--- /dev/null >+++ b/Source/WebCore/platform/nix/PasteboardNix.cpp >@@ -0,0 +1,161 @@ >+/* >+ * Copyright (C) 2007 Holger Hans Peter Freyther >+ * Copyright (C) 2007 Alp Toker <alp@atoker.com> >+ * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia >+ * Copyright (C) 2009-2010 ProFUSION embedded systems >+ * Copyright (C) 2009-2010 Samsung Electronics >+ * Copyright (C) 2013 Nokia Corporation and/or its subsidiary(-ies) >+ * >+ * This library is free software; you can redistribute it and/or >+ * modify it under the terms of the GNU Lesser 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 >+ * Lesser General Public License for more details. >+ * >+ * You should have received a copy of the GNU Lesser General Public >+ * License along with this library; if not, write to the Free Software >+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >+ */ >+ >+#include "config.h" >+#include "Pasteboard.h" >+ >+#include "DocumentFragment.h" >+#include "NotImplemented.h" >+#include <wtf/text/StringHash.h> >+ >+namespace WebCore { >+ >+Pasteboard* Pasteboard::generalPasteboard() >+{ >+ static Pasteboard* pasteboard = new Pasteboard(); >+ return pasteboard; >+} >+ >+Pasteboard::Pasteboard() >+{ >+ notImplemented(); >+} >+ >+void Pasteboard::writePlainText(const String&, SmartReplaceOption) >+{ >+ notImplemented(); >+} >+ >+void Pasteboard::writeSelection(Range*, bool, Frame*, ShouldSerializeSelectedTextForClipboard) >+{ >+ notImplemented(); >+} >+ >+void Pasteboard::writeURL(const KURL&, const String&, Frame*) >+{ >+ notImplemented(); >+} >+ >+void Pasteboard::writeImage(Node*, const KURL&, const String&) >+{ >+ notImplemented(); >+} >+ >+void Pasteboard::writeClipboard(Clipboard*) >+{ >+ notImplemented(); >+} >+ >+void Pasteboard::clear() >+{ >+ notImplemented(); >+} >+ >+bool Pasteboard::canSmartReplace() >+{ >+ notImplemented(); >+ return false; >+} >+ >+PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame*, PassRefPtr<Range>, bool, bool&) >+{ >+ notImplemented(); >+ return 0; >+} >+ >+String Pasteboard::plainText(Frame*) >+{ >+ notImplemented(); >+ return String(); >+} >+ >+PassOwnPtr<Pasteboard> Pasteboard::createForCopyAndPaste() >+{ >+ return adoptPtr(new Pasteboard); >+} >+ >+PassOwnPtr<Pasteboard> Pasteboard::createPrivate() >+{ >+ return createForCopyAndPaste(); >+} >+ >+#if ENABLE(DRAG_SUPPORT) >+PassOwnPtr<Pasteboard> Pasteboard::createForDragAndDrop() >+{ >+ return createForCopyAndPaste(); >+} >+ >+PassOwnPtr<Pasteboard> Pasteboard::createForDragAndDrop(const DragData&) >+{ >+ return createForCopyAndPaste(); >+} >+#endif >+ >+bool Pasteboard::hasData() >+{ >+ notImplemented(); >+ return false; >+} >+ >+void Pasteboard::clear(const String&) >+{ >+ notImplemented(); >+} >+ >+String Pasteboard::readString(const String&) >+{ >+ notImplemented(); >+ return String(); >+} >+ >+bool Pasteboard::writeString(const String&, const String&) >+{ >+ notImplemented(); >+ return false; >+} >+ >+ListHashSet<String> Pasteboard::types() >+{ >+ notImplemented(); >+ return ListHashSet<String>(); >+} >+ >+Vector<String> Pasteboard::readFilenames() >+{ >+ notImplemented(); >+ return Vector<String>(); >+} >+ >+#if ENABLE(DRAG_SUPPORT) >+void Pasteboard::setDragImage(DragImageRef, const IntPoint&) >+{ >+ notImplemented(); >+} >+#endif >+ >+void Pasteboard::writePasteboard(const Pasteboard&) >+{ >+ notImplemented(); >+} >+ >+} >diff --git a/Source/WebCore/platform/nix/PlatformKeyboardEventNix.cpp b/Source/WebCore/platform/nix/PlatformKeyboardEventNix.cpp >new file mode 100644 >index 0000000..2d0ef6c >--- /dev/null >+++ b/Source/WebCore/platform/nix/PlatformKeyboardEventNix.cpp >@@ -0,0 +1,69 @@ >+/* >+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org> >+ * Copyright (C) 2008 Diego Hidalgo C. Gonzalez >+ * Copyright (C) 2009-2010 ProFUSION embedded systems >+ * Copyright (C) 2009-2010 Samsung Electronics >+ * Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 "PlatformKeyboardEvent.h" >+ >+#include "NotImplemented.h" >+#include "TextEncoding.h" >+#include <stdio.h> >+#include <wtf/CurrentTime.h> >+ >+namespace WebCore { >+ >+void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool) >+{ >+ ASSERT(m_type == KeyDown); >+ m_type = type; >+ >+ if (type == PlatformEvent::RawKeyDown) { >+ m_text = String(); >+ m_unmodifiedText = String(); >+ } else { >+ m_keyIdentifier = String(); >+ m_windowsVirtualKeyCode = 0; >+ } >+} >+ >+bool PlatformKeyboardEvent::currentCapsLockState() >+{ >+ notImplemented(); >+ return false; >+} >+ >+void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) >+{ >+ notImplemented(); >+ shiftKey = false; >+ ctrlKey = false; >+ altKey = false; >+ metaKey = false; >+} >+ >+} >diff --git a/Source/WebCore/platform/nix/PlatformScreenNix.cpp b/Source/WebCore/platform/nix/PlatformScreenNix.cpp >new file mode 100644 >index 0000000..b8dc2f0 >--- /dev/null >+++ b/Source/WebCore/platform/nix/PlatformScreenNix.cpp >@@ -0,0 +1,85 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 "PlatformScreen.h" >+ >+#include "NotImplemented.h" >+#include "FloatRect.h" >+#include <wtf/text/WTFString.h> >+#include "Widget.h" >+ >+#include <wtf/text/CString.h> >+ >+namespace WebCore { >+ >+int screenHorizontalDPI(Widget*) >+{ >+ notImplemented(); >+ return 0; >+} >+ >+int screenVerticalDPI(Widget*) >+{ >+ notImplemented(); >+ return 0; >+} >+ >+int screenDepth(Widget*) >+{ >+ notImplemented(); >+ return 0; >+} >+ >+int screenDepthPerComponent(Widget*) >+{ >+ notImplemented(); >+ return 0; >+} >+ >+bool screenIsMonochrome(Widget*) >+{ >+ notImplemented(); >+ return false; >+} >+ >+FloatRect screenRect(Widget*) >+{ >+ notImplemented(); >+ return FloatRect(0, 0, 1024, 768); >+} >+ >+FloatRect screenAvailableRect(Widget* widget) >+{ >+ notImplemented(); >+ return screenRect(widget); >+} >+ >+void screenColorProfile(ColorProfile&) >+{ >+ notImplemented(); >+} >+ >+} >diff --git a/Source/WebCore/platform/nix/RenderThemeNix.cpp b/Source/WebCore/platform/nix/RenderThemeNix.cpp >new file mode 100644 >index 0000000..99107ac >--- /dev/null >+++ b/Source/WebCore/platform/nix/RenderThemeNix.cpp >@@ -0,0 +1,441 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 "RenderThemeNix.h" >+ >+#include "InputTypeNames.h" >+#include "PaintInfo.h" >+#include "PlatformContextCairo.h" >+#include "public/WebCanvas.h" >+#include "public/WebThemeEngine.h" >+#include "public/WebRect.h" >+#include "public/Platform.h" >+#if ENABLE(PROGRESS_ELEMENT) >+#include "RenderProgress.h" >+#endif >+#if ENABLE(METER_ELEMENT) >+#include "RenderMeter.h" >+#include "HTMLMeterElement.h" >+#endif >+ >+namespace WebCore { >+ >+static const unsigned defaultButtonBackgroundColor = 0xffdddddd; >+ >+static void setSizeIfAuto(RenderStyle* style, const IntSize& size) >+{ >+ if (style->width().isIntrinsicOrAuto()) >+ style->setWidth(Length(size.width(), Fixed)); >+ if (style->height().isAuto()) >+ style->setHeight(Length(size.height(), Fixed)); >+} >+ >+Color toColor(const WebKit::WebColor& color) >+{ >+ return WebCore::Color(RGBA32(color)); >+} >+ >+static WebKit::WebThemeEngine* themeEngine() >+{ >+ return WebKit::Platform::current()->themeEngine(); >+} >+ >+static WebKit::WebCanvas* webCanvas(const PaintInfo& info) >+{ >+ return info.context->platformContext()->cr(); >+} >+ >+PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page*) >+{ >+ return RenderThemeNix::create(); >+} >+ >+PassRefPtr<RenderTheme> RenderThemeNix::create() >+{ >+ return adoptRef(new RenderThemeNix); >+} >+ >+RenderThemeNix::RenderThemeNix() >+ : RenderTheme() >+{ >+} >+ >+RenderThemeNix::~RenderThemeNix() >+{ >+ >+} >+ >+String RenderThemeNix::extraDefaultStyleSheet() >+{ >+ return themeEngine()->extraDefaultStyleSheet(); >+} >+ >+String RenderThemeNix::extraQuirksStyleSheet() >+{ >+ return themeEngine()->extraQuirksStyleSheet(); >+} >+ >+String RenderThemeNix::extraPlugInsStyleSheet() >+{ >+ return themeEngine()->extraPlugInsStyleSheet(); >+} >+ >+Color RenderThemeNix::platformActiveSelectionBackgroundColor() const >+{ >+ return toColor(themeEngine()->activeSelectionBackgroundColor()); >+} >+ >+Color RenderThemeNix::platformInactiveSelectionBackgroundColor() const >+{ >+ return toColor(themeEngine()->inactiveSelectionBackgroundColor()); >+} >+ >+Color RenderThemeNix::platformActiveSelectionForegroundColor() const >+{ >+ return toColor(themeEngine()->activeSelectionForegroundColor()); >+} >+ >+Color RenderThemeNix::platformInactiveSelectionForegroundColor() const >+{ >+ return toColor(themeEngine()->inactiveSelectionForegroundColor()); >+} >+ >+Color RenderThemeNix::platformActiveListBoxSelectionBackgroundColor() const >+{ >+ return toColor(themeEngine()->activeListBoxSelectionBackgroundColor()); >+} >+ >+Color RenderThemeNix::platformInactiveListBoxSelectionBackgroundColor() const >+{ >+ return toColor(themeEngine()->inactiveListBoxSelectionBackgroundColor()); >+} >+ >+Color RenderThemeNix::platformActiveListBoxSelectionForegroundColor() const >+{ >+ return toColor(themeEngine()->activeListBoxSelectionForegroundColor()); >+} >+ >+Color RenderThemeNix::platformInactiveListBoxSelectionForegroundColor() const >+{ >+ return toColor(themeEngine()->inactiveListBoxSelectionForegroundColor()); >+} >+ >+Color RenderThemeNix::platformActiveTextSearchHighlightColor() const >+{ >+ return toColor(themeEngine()->activeTextSearchHighlightColor()); >+} >+ >+Color RenderThemeNix::platformInactiveTextSearchHighlightColor() const >+{ >+ return toColor(themeEngine()->inactiveTextSearchHighlightColor()); >+} >+ >+Color RenderThemeNix::platformFocusRingColor() const >+{ >+ return toColor(themeEngine()->focusRingColor()); >+} >+ >+#if ENABLE(TOUCH_EVENTS) >+Color RenderThemeNix::platformTapHighlightColor() const >+{ >+ return toColor(themeEngine()->tapHighlightColor()); >+} >+#endif >+ >+void RenderThemeNix::systemFont(WebCore::CSSValueID, FontDescription&) const >+{ >+} >+ >+static WebKit::WebThemeEngine::State getWebThemeState(const RenderTheme* theme, const RenderObject* o) >+{ >+ if (!theme->isEnabled(o)) >+ return WebKit::WebThemeEngine::StateDisabled; >+ if (theme->isPressed(o)) >+ return WebKit::WebThemeEngine::StatePressed; >+ if (theme->isHovered(o)) >+ return WebKit::WebThemeEngine::StateHover; >+ >+ return WebKit::WebThemeEngine::StateNormal; >+} >+ >+bool RenderThemeNix::paintButton(RenderObject* o, const PaintInfo& i, const IntRect& rect) >+{ >+ WebKit::WebThemeEngine::ButtonExtraParams extraParams; >+ extraParams.isDefault = isDefault(o); >+ extraParams.hasBorder = true; >+ extraParams.backgroundColor = defaultButtonBackgroundColor; >+ if (o->hasBackground()) >+ extraParams.backgroundColor = o->style()->visitedDependentColor(CSSPropertyBackgroundColor).rgb(); >+ >+ themeEngine()->paintButton(webCanvas(i), getWebThemeState(this, o), WebKit::WebRect(rect), extraParams); >+ return false; >+} >+ >+bool RenderThemeNix::paintTextField(RenderObject* o, const PaintInfo& i, const IntRect& rect) >+{ >+ // WebThemeEngine does not handle border rounded corner and background image >+ // so return true to draw CSS border and background. >+ if (o->style()->hasBorderRadius() || o->style()->hasBackgroundImage()) >+ return true; >+ >+ themeEngine()->paintTextField(webCanvas(i), getWebThemeState(this, o), WebKit::WebRect(rect)); >+ return false; >+} >+ >+bool RenderThemeNix::paintTextArea(RenderObject* o, const PaintInfo& i, const IntRect& rect) >+{ >+ return paintTextField(o, i, rect); >+} >+ >+bool RenderThemeNix::paintCheckbox(RenderObject* o, const PaintInfo& i, const IntRect& rect) >+{ >+ WebKit::WebThemeEngine::ButtonExtraParams extraParams; >+ extraParams.checked = isChecked(o); >+ extraParams.indeterminate = isIndeterminate(o); >+ >+ themeEngine()->paintCheckbox(webCanvas(i), getWebThemeState(this, o), WebKit::WebRect(rect), extraParams); >+ return false; >+} >+ >+void RenderThemeNix::setCheckboxSize(RenderStyle* style) const >+{ >+ // If the width and height are both specified, then we have nothing to do. >+ if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto()) >+ return; >+ >+ IntSize size = themeEngine()->getCheckboxSize(); >+ setSizeIfAuto(style, size); >+} >+ >+bool RenderThemeNix::paintRadio(RenderObject* o, const PaintInfo& i, const IntRect& rect) >+{ >+ WebKit::WebThemeEngine::ButtonExtraParams extraParams; >+ extraParams.checked = isChecked(o); >+ extraParams.indeterminate = isIndeterminate(o); >+ >+ themeEngine()->paintRadio(webCanvas(i), getWebThemeState(this, o), WebKit::WebRect(rect), extraParams); >+ return false; >+} >+ >+void RenderThemeNix::setRadioSize(RenderStyle* style) const >+{ >+ // If the width and height are both specified, then we have nothing to do. >+ if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto()) >+ return; >+ >+ IntSize size = themeEngine()->getRadioSize(); >+ setSizeIfAuto(style, size); >+} >+ >+bool RenderThemeNix::paintMenuList(RenderObject* o, const PaintInfo& i, const IntRect& rect) >+{ >+ themeEngine()->paintMenuList(webCanvas(i), getWebThemeState(this, o), WebKit::WebRect(rect)); >+ return false; >+} >+ >+void RenderThemeNix::adjustMenuListStyle(StyleResolver*, RenderStyle* style, Element*) const >+{ >+ style->resetBorder(); >+ style->setWhiteSpace(PRE); >+ >+ int paddingTop = 0; >+ int paddingLeft = 0; >+ int paddingBottom = 0; >+ int paddingRight = 0; >+ themeEngine()->getMenuListPadding(paddingTop, paddingLeft, paddingBottom, paddingRight); >+ style->setPaddingTop(Length(paddingTop, Fixed)); >+ style->setPaddingRight(Length(paddingRight, Fixed)); >+ style->setPaddingBottom(Length(paddingBottom, Fixed)); >+ style->setPaddingLeft(Length(paddingLeft, Fixed)); >+} >+ >+#if ENABLE(PROGRESS_ELEMENT) >+void RenderThemeNix::adjustProgressBarStyle(StyleResolver*, RenderStyle* style, Element *) const >+{ >+ style->setBoxShadow(nullptr); >+} >+ >+bool RenderThemeNix::paintProgressBar(RenderObject* o, const PaintInfo& i, const IntRect& rect) >+{ >+ RenderProgress* renderProgress = toRenderProgress(o); >+ WebKit::WebThemeEngine::ProgressBarExtraParams extraParams; >+ extraParams.isDeterminate = renderProgress->isDeterminate(); >+ extraParams.position = renderProgress->position(); >+ extraParams.animationProgress = renderProgress->animationProgress(); >+ extraParams.animationStartTime = renderProgress->animationStartTime(); >+ themeEngine()->paintProgressBar(webCanvas(i), getWebThemeState(this, o), WebKit::WebRect(rect), extraParams); >+ >+ return false; >+} >+ >+double RenderThemeNix::animationRepeatIntervalForProgressBar(RenderProgress*) const >+{ >+ return themeEngine()->getAnimationRepeatIntervalForProgressBar(); >+} >+ >+double RenderThemeNix::animationDurationForProgressBar(RenderProgress*) const >+{ >+ return themeEngine()->getAnimationDurationForProgressBar(); >+} >+#endif >+ >+bool RenderThemeNix::paintSliderTrack(RenderObject* object, const PaintInfo& info, const IntRect& rect) >+{ >+ themeEngine()->paintSliderTrack(webCanvas(info), getWebThemeState(this, object), rect); >+#if ENABLE(DATALIST_ELEMENT) >+ paintSliderTicks(object, info, rect); >+#endif >+ return false; >+} >+ >+void RenderThemeNix::adjustSliderTrackStyle(StyleResolver*, RenderStyle* style, Element*) const >+{ >+ style->setBoxShadow(nullptr); >+} >+ >+bool RenderThemeNix::paintSliderThumb(RenderObject* object, const PaintInfo& info, const IntRect& rect) >+{ >+ themeEngine()->paintSliderThumb(webCanvas(info), getWebThemeState(this, object), rect); >+ >+ return false; >+} >+ >+void RenderThemeNix::adjustSliderThumbStyle(StyleResolver* styleResolver, RenderStyle* style, Element* element) const >+{ >+ RenderTheme::adjustSliderThumbStyle(styleResolver, style, element); >+ style->setBoxShadow(nullptr); >+} >+ >+const int SLIDER_THUMB_WIDTH = 10; >+const int SLIDER_THUMB_HEIGHT = 20; >+ >+void RenderThemeNix::adjustSliderThumbSize(RenderStyle* style, Element*) const >+{ >+ ControlPart part = style->appearance(); >+ if (part == SliderThumbVerticalPart) { >+ style->setWidth(Length(SLIDER_THUMB_WIDTH, Fixed)); >+ style->setHeight(Length(SLIDER_THUMB_HEIGHT, Fixed)); >+ } else if (part == SliderThumbHorizontalPart) { >+ style->setWidth(Length(SLIDER_THUMB_WIDTH, Fixed)); >+ style->setHeight(Length(SLIDER_THUMB_HEIGHT, Fixed)); >+ } >+} >+ >+#if ENABLE(DATALIST_ELEMENT) >+IntSize RenderThemeNix::sliderTickSize() const >+{ >+ return IntSize(1, 6); >+} >+ >+int RenderThemeNix::sliderTickOffsetFromTrackCenter() const >+{ >+ return -12; >+} >+ >+LayoutUnit RenderThemeNix::sliderTickSnappingThreshold() const >+{ >+ return 5; >+} >+ >+bool RenderThemeNix::supportsDataListUI(const AtomicString& type) const >+{ >+ return type == InputTypeNames::range(); >+} >+#endif >+ >+void RenderThemeNix::adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle* style, Element*) const >+{ >+ style->resetBorder(); >+ style->setWhiteSpace(PRE); >+ >+ int paddingTop = 0; >+ int paddingLeft = 0; >+ int paddingBottom = 0; >+ int paddingRight = 0; >+ themeEngine()->getInnerSpinButtonPadding(paddingTop, paddingLeft, paddingBottom, paddingRight); >+ style->setPaddingTop(Length(paddingTop, Fixed)); >+ style->setPaddingRight(Length(paddingRight, Fixed)); >+ style->setPaddingBottom(Length(paddingBottom, Fixed)); >+ style->setPaddingLeft(Length(paddingLeft, Fixed)); >+} >+ >+bool RenderThemeNix::paintInnerSpinButton(RenderObject* o, const PaintInfo& i, const IntRect& rect) >+{ >+ WebKit::WebThemeEngine::InnerSpinButtonExtraParams extraParams; >+ extraParams.spinUp = isSpinUpButtonPartPressed(o); >+ extraParams.readOnly = isReadOnlyControl(o); >+ >+ themeEngine()->paintInnerSpinButton(webCanvas(i), getWebThemeState(this, o), WebKit::WebRect(rect), extraParams); >+ return false; >+} >+ >+#if ENABLE(METER_ELEMENT) >+void RenderThemeNix::adjustMeterStyle(StyleResolver*, RenderStyle* style, Element*) const >+{ >+ style->setBoxShadow(nullptr); >+} >+ >+IntSize RenderThemeNix::meterSizeForBounds(const RenderMeter*, const IntRect& bounds) const >+{ >+ return bounds.size(); >+} >+ >+bool RenderThemeNix::supportsMeter(ControlPart part) const >+{ >+ switch (part) { >+ case RelevancyLevelIndicatorPart: >+ case DiscreteCapacityLevelIndicatorPart: >+ case RatingLevelIndicatorPart: >+ case MeterPart: >+ case ContinuousCapacityLevelIndicatorPart: >+ return true; >+ default: >+ return false; >+ } >+} >+ >+bool RenderThemeNix::paintMeter(RenderObject* o, const PaintInfo& i, const IntRect& rect) >+{ >+ if (!o->isMeter()) >+ return true; >+ >+ RenderMeter* renderMeter = toRenderMeter(o); >+ HTMLMeterElement* e = renderMeter->meterElement(); >+ WebKit::WebThemeEngine::MeterExtraParams extraParams; >+ extraParams.min = e->min(); >+ extraParams.max = e->max(); >+ extraParams.value = e->value(); >+ extraParams.low = e->low(); >+ extraParams.high = e->high(); >+ extraParams.optimum = e->optimum(); >+ >+ themeEngine()->paintMeter(webCanvas(i), getWebThemeState(this, o), rect, extraParams); >+ >+ return false; >+} >+#endif >+ >+} >diff --git a/Source/WebCore/platform/nix/RenderThemeNix.h b/Source/WebCore/platform/nix/RenderThemeNix.h >new file mode 100644 >index 0000000..f3936a9 >--- /dev/null >+++ b/Source/WebCore/platform/nix/RenderThemeNix.h >@@ -0,0 +1,128 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 RenderThemeNix_h >+#define RenderThemeNix_h >+ >+#include "RenderTheme.h" >+ >+namespace WebCore { >+ >+class RenderThemeNix : public RenderTheme { >+public: >+ static PassRefPtr<RenderTheme> create(); >+ >+ virtual ~RenderThemeNix(); >+ >+ virtual String extraDefaultStyleSheet(); >+ virtual String extraQuirksStyleSheet(); >+ virtual String extraPlugInsStyleSheet(); >+ >+ virtual void systemFont(WebCore::CSSValueID cssValueId, FontDescription&) const OVERRIDE; >+ >+#if ENABLE(PROGRESS_ELEMENT) >+ // Returns the repeat interval of the animation for the progress bar. >+ virtual double animationRepeatIntervalForProgressBar(RenderProgress*) const OVERRIDE; >+ // Returns the duration of the animation for the progress bar. >+ virtual double animationDurationForProgressBar(RenderProgress*) const OVERRIDE; >+#endif >+ >+#if ENABLE(METER_ELEMENT) >+ virtual IntSize meterSizeForBounds(const RenderMeter*, const IntRect&) const OVERRIDE; >+ virtual bool supportsMeter(ControlPart) const OVERRIDE; >+#endif >+ >+protected: >+ // The platform selection color. >+ virtual Color platformActiveSelectionBackgroundColor() const; >+ virtual Color platformInactiveSelectionBackgroundColor() const; >+ virtual Color platformActiveSelectionForegroundColor() const; >+ virtual Color platformInactiveSelectionForegroundColor() const; >+ >+ virtual Color platformActiveListBoxSelectionBackgroundColor() const; >+ virtual Color platformInactiveListBoxSelectionBackgroundColor() const; >+ virtual Color platformActiveListBoxSelectionForegroundColor() const; >+ virtual Color platformInactiveListBoxSelectionForegroundColor() const; >+ >+ // Highlighting colors for TextMatches. >+ virtual Color platformActiveTextSearchHighlightColor() const; >+ virtual Color platformInactiveTextSearchHighlightColor() const; >+ >+ virtual Color platformFocusRingColor() const; >+ >+#if ENABLE(TOUCH_EVENTS) >+ virtual Color platformTapHighlightColor() const; >+#endif >+ >+ virtual bool paintButton(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; >+ virtual bool paintTextField(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; >+ virtual bool paintTextArea(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; >+ >+ virtual bool paintCheckbox(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; >+ virtual void setCheckboxSize(RenderStyle*) const OVERRIDE; >+ >+ virtual bool paintRadio(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; >+ virtual void setRadioSize(RenderStyle*) const OVERRIDE; >+ >+ virtual bool paintMenuList(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; >+ virtual void adjustMenuListStyle(StyleResolver*, RenderStyle*, Element*) const OVERRIDE; >+ virtual bool paintMenuListButton(RenderObject* o, const PaintInfo& i, const IntRect& r) OVERRIDE { return paintMenuList(o, i, r); } >+ >+ virtual void adjustInnerSpinButtonStyle(StyleResolver*, RenderStyle*, Element*) const OVERRIDE; >+ virtual bool paintInnerSpinButton(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; >+ >+#if ENABLE(PROGRESS_ELEMENT) >+ virtual void adjustProgressBarStyle(StyleResolver*, RenderStyle*, Element*) const OVERRIDE; >+ virtual bool paintProgressBar(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; >+#endif >+ >+#if ENABLE(METER_ELEMENT) >+ virtual void adjustMeterStyle(StyleResolver*, RenderStyle*, Element*) const OVERRIDE; >+ virtual bool paintMeter(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; >+#endif >+ >+ virtual bool paintSliderTrack(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; >+ virtual void adjustSliderTrackStyle(StyleResolver*, RenderStyle*, Element*) const OVERRIDE; >+ >+ virtual bool paintSliderThumb(RenderObject*, const PaintInfo&, const IntRect&) OVERRIDE; >+ virtual void adjustSliderThumbStyle(StyleResolver*, RenderStyle*, Element*) const OVERRIDE; >+ >+ virtual void adjustSliderThumbSize(RenderStyle*, Element*) const OVERRIDE; >+ >+#if ENABLE(DATALIST_ELEMENT) >+ virtual IntSize sliderTickSize() const OVERRIDE; >+ virtual int sliderTickOffsetFromTrackCenter() const OVERRIDE; >+ virtual LayoutUnit sliderTickSnappingThreshold() const OVERRIDE; >+ >+ virtual bool supportsDataListUI(const AtomicString&) const OVERRIDE; >+#endif >+ >+private: >+ RenderThemeNix(); >+}; >+ >+} >+ >+#endif // RenderThemeNix_h >diff --git a/Source/WebCore/platform/nix/RunLoopNix.cpp b/Source/WebCore/platform/nix/RunLoopNix.cpp >new file mode 100644 >index 0000000..071b679 >--- /dev/null >+++ b/Source/WebCore/platform/nix/RunLoopNix.cpp >@@ -0,0 +1,170 @@ >+/* >+ * Copyright (C) 2010 Apple Inc. All rights reserved. >+ * Portions Copyright (c) 2010 Motorola Mobility, Inc. All rights reserved. >+ * >+ * Redistribution and use in source and binary forms, with or without >+ * modification, are permitted provided that the following conditions >+ * are met: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' >+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, >+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS >+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR >+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF >+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS >+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN >+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) >+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF >+ * THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include "RunLoop.h" >+ >+#include <glib.h> >+ >+#include <wtf/MainThread.h> >+ >+namespace WebCore { >+ >+RunLoop::RunLoop() >+{ >+ // g_main_context_default() doesn't add an extra reference. >+ m_runLoopContext = isMainThread() ? g_main_context_default() : adoptGRef(g_main_context_new()); >+ ASSERT(m_runLoopContext); >+ GRefPtr<GMainLoop> innermostLoop = adoptGRef(g_main_loop_new(m_runLoopContext.get(), FALSE)); >+ ASSERT(innermostLoop); >+ m_runLoopMainLoops.append(innermostLoop); >+} >+ >+RunLoop::~RunLoop() >+{ >+ for (int i = m_runLoopMainLoops.size() - 1; i >= 0; --i) { >+ if (!g_main_loop_is_running(m_runLoopMainLoops[i].get())) >+ continue; >+ g_main_loop_quit(m_runLoopMainLoops[i].get()); >+ } >+} >+ >+void RunLoop::run() >+{ >+ RunLoop* mainRunLoop = RunLoop::current(); >+ GMainLoop* innermostLoop = mainRunLoop->innermostLoop(); >+ if (!g_main_loop_is_running(innermostLoop)) { >+ g_main_loop_run(innermostLoop); >+ return; >+ } >+ >+ // Create and run a nested loop if the innermost one was already running. >+ GMainLoop* nestedMainLoop = g_main_loop_new(0, FALSE); >+ mainRunLoop->pushNestedMainLoop(nestedMainLoop); >+ g_main_loop_run(nestedMainLoop); >+ mainRunLoop->popNestedMainLoop(); >+} >+ >+GMainLoop* RunLoop::innermostLoop() >+{ >+ // The innermost main loop should always be there. >+ ASSERT(!m_runLoopMainLoops.isEmpty()); >+ return m_runLoopMainLoops[0].get(); >+} >+ >+void RunLoop::pushNestedMainLoop(GMainLoop* nestedLoop) >+{ >+ // The innermost main loop should always be there. >+ ASSERT(!m_runLoopMainLoops.isEmpty()); >+ m_runLoopMainLoops.append(adoptGRef(nestedLoop)); >+} >+ >+void RunLoop::popNestedMainLoop() >+{ >+ // The innermost main loop should always be there. >+ ASSERT(!m_runLoopMainLoops.isEmpty()); >+ m_runLoopMainLoops.removeLast(); >+} >+ >+void RunLoop::stop() >+{ >+ // The innermost main loop should always be there. >+ ASSERT(!m_runLoopMainLoops.isEmpty()); >+ GRefPtr<GMainLoop> lastMainLoop = m_runLoopMainLoops.last(); >+ if (g_main_loop_is_running(lastMainLoop.get())) >+ g_main_loop_quit(lastMainLoop.get()); >+} >+ >+gboolean RunLoop::queueWork(RunLoop* runLoop) >+{ >+ runLoop->performWork(); >+ return FALSE; >+} >+ >+void RunLoop::wakeUp() >+{ >+ GRefPtr<GSource> source = adoptGRef(g_idle_source_new()); >+ g_source_set_priority(source.get(), G_PRIORITY_DEFAULT); >+ g_source_set_callback(source.get(), reinterpret_cast<GSourceFunc>(&RunLoop::queueWork), this, 0); >+ g_source_attach(source.get(), m_runLoopContext.get()); >+ >+ g_main_context_wakeup(m_runLoopContext.get()); >+} >+ >+RunLoop::TimerBase::TimerBase(RunLoop* runLoop) >+ : m_runLoop(runLoop) >+ , m_timerSource(0) >+{ >+} >+ >+RunLoop::TimerBase::~TimerBase() >+{ >+ stop(); >+} >+ >+void RunLoop::TimerBase::clearTimerSource() >+{ >+ m_timerSource = 0; >+} >+ >+gboolean RunLoop::TimerBase::timerFiredCallback(RunLoop::TimerBase* timer) >+{ >+ GSource* currentTimerSource = timer->m_timerSource.get(); >+ bool isRepeating = timer->isRepeating(); >+ // This can change the timerSource by starting a new timer within the callback. >+ if (!isRepeating && currentTimerSource == timer->m_timerSource.get()) >+ timer->clearTimerSource(); >+ >+ timer->fired(); >+ return isRepeating; >+} >+ >+void RunLoop::TimerBase::start(double fireInterval, bool repeat) >+{ >+ if (m_timerSource) >+ stop(); >+ >+ m_timerSource = adoptGRef(g_timeout_source_new(static_cast<guint>(fireInterval * 1000))); >+ m_isRepeating = repeat; >+ g_source_set_callback(m_timerSource.get(), reinterpret_cast<GSourceFunc>(&RunLoop::TimerBase::timerFiredCallback), this, 0); >+ g_source_attach(m_timerSource.get(), m_runLoop->m_runLoopContext.get()); >+} >+ >+void RunLoop::TimerBase::stop() >+{ >+ if (!m_timerSource) >+ return; >+ >+ g_source_destroy(m_timerSource.get()); >+ clearTimerSource(); >+} >+ >+bool RunLoop::TimerBase::isActive() const >+{ >+ return m_timerSource; >+} >+ >+} // namespace WebCore >diff --git a/Source/WebCore/platform/nix/ScrollbarThemeNix.cpp b/Source/WebCore/platform/nix/ScrollbarThemeNix.cpp >new file mode 100644 >index 0000000..d24bab4 >--- /dev/null >+++ b/Source/WebCore/platform/nix/ScrollbarThemeNix.cpp >@@ -0,0 +1,58 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 "ScrollbarThemeNix.h" >+ >+#include "NotImplemented.h" >+#include <stdio.h> >+ >+namespace WebCore { >+ >+ScrollbarTheme* ScrollbarTheme::nativeTheme() >+{ >+ static ScrollbarThemeNix theme; >+ return &theme; >+} >+ >+ScrollbarThemeNix::~ScrollbarThemeNix() >+{ >+} >+ >+int ScrollbarThemeNix::scrollbarThickness(ScrollbarControlSize) >+{ >+ return 0; // we paint on top >+} >+ >+void ScrollbarThemeNix::registerScrollbar(ScrollbarThemeClient*) >+{ >+} >+ >+void ScrollbarThemeNix::unregisterScrollbar(ScrollbarThemeClient*) >+{ >+} >+ >+} >+ >diff --git a/Source/WebCore/platform/nix/ScrollbarThemeNix.h b/Source/WebCore/platform/nix/ScrollbarThemeNix.h >new file mode 100644 >index 0000000..bae7688 >--- /dev/null >+++ b/Source/WebCore/platform/nix/ScrollbarThemeNix.h >@@ -0,0 +1,45 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 ScrollbarThemeNix_h >+#define ScrollbarThemeNix_h >+ >+#include "ScrollbarTheme.h" >+ >+namespace WebCore { >+ >+class ScrollbarThemeNix : public ScrollbarTheme { >+public: >+ virtual ~ScrollbarThemeNix(); >+ >+ virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar); >+ >+ virtual void registerScrollbar(ScrollbarThemeClient*); >+ virtual void unregisterScrollbar(ScrollbarThemeClient*); >+}; >+ >+} >+#endif // ScrollbarThemeNix_h >+ >diff --git a/Source/WebCore/platform/nix/SharedTimerNix.cpp b/Source/WebCore/platform/nix/SharedTimerNix.cpp >new file mode 100644 >index 0000000..9486c31 >--- /dev/null >+++ b/Source/WebCore/platform/nix/SharedTimerNix.cpp >@@ -0,0 +1,73 @@ >+/* >+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. >+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com >+ * 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 "SharedTimer.h" >+ >+#include <wtf/Assertions.h> >+#include <wtf/CurrentTime.h> >+#define GDK_PRIORITY_REDRAW (G_PRIORITY_HIGH_IDLE + 20) >+#include <glib.h> >+ >+namespace WebCore { >+ >+static guint sharedTimer; >+static void (*sharedTimerFiredFunction)(); >+ >+void setSharedTimerFiredFunction(void (*f)()) >+{ >+ sharedTimerFiredFunction = f; >+} >+ >+static gboolean timeout_cb(gpointer) >+{ >+ if (sharedTimerFiredFunction) >+ sharedTimerFiredFunction(); >+ return FALSE; >+} >+ >+void setSharedTimerFireInterval(double interval) >+{ >+ ASSERT(sharedTimerFiredFunction); >+ >+ guint intervalInMS = static_cast<guint>(interval * 1000); >+ >+ stopSharedTimer(); >+ sharedTimer = g_timeout_add_full(GDK_PRIORITY_REDRAW, intervalInMS, timeout_cb, 0, 0); >+} >+ >+void stopSharedTimer() >+{ >+ if (sharedTimer == 0) >+ return; >+ >+ gboolean removedSource = g_source_remove(sharedTimer); >+ ASSERT_UNUSED(removedSource, removedSource); >+ sharedTimer = 0; >+} >+ >+} >diff --git a/Source/WebCore/platform/nix/SoundNix.cpp b/Source/WebCore/platform/nix/SoundNix.cpp >new file mode 100644 >index 0000000..de1bbef >--- /dev/null >+++ b/Source/WebCore/platform/nix/SoundNix.cpp >@@ -0,0 +1,38 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 "Sound.h" >+ >+#include "NotImplemented.h" >+ >+namespace WebCore { >+ >+void systemBeep() >+{ >+ notImplemented(); >+} >+ >+} >diff --git a/Source/WebCore/platform/nix/TemporaryLinkStubs.cpp b/Source/WebCore/platform/nix/TemporaryLinkStubs.cpp >new file mode 100644 >index 0000000..a630f8b >--- /dev/null >+++ b/Source/WebCore/platform/nix/TemporaryLinkStubs.cpp >@@ -0,0 +1,47 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 "KURL.h" >+#include "NotImplemented.h" >+#include "SSLKeyGenerator.h" >+ >+using namespace WebCore; >+ >+namespace WebCore { >+ >+void getSupportedKeySizes(Vector<String>&) >+{ >+ notImplemented(); >+} >+ >+String signedPublicKeyAndChallengeString(unsigned, const String&, const KURL&) >+{ >+ return String(); >+} >+ >+} >+ >diff --git a/Source/WebCore/platform/nix/WidgetNix.cpp b/Source/WebCore/platform/nix/WidgetNix.cpp >new file mode 100644 >index 0000000..18d3097 >--- /dev/null >+++ b/Source/WebCore/platform/nix/WidgetNix.cpp >@@ -0,0 +1,98 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 "Widget.h" >+ >+#include "ChromeClient.h" >+#include "Cursor.h" >+#include "Frame.h" >+#include "FrameView.h" >+#include "GraphicsContext.h" >+#include "IntRect.h" >+#include "NotImplemented.h" >+#include "Page.h" >+ >+namespace WebCore { >+ >+Widget::Widget(PlatformWidget widget) >+ : m_parent(0) >+ , m_widget(0) >+ , m_selfVisible(false) >+ , m_parentVisible(false) >+ , m_frame(0, 0, 0, 0) >+{ >+ init(widget); >+} >+ >+Widget::~Widget() >+{ >+ ASSERT(!parent()); >+} >+ >+IntRect Widget::frameRect() const >+{ >+ return m_frame; >+} >+ >+void Widget::setFrameRect(const IntRect& rect) >+{ >+ m_frame = rect; >+ Widget::frameRectsChanged(); >+} >+ >+void Widget::setFocus(bool) >+{ >+} >+ >+void Widget::setCursor(const Cursor& cursor) >+{ >+ ScrollView* view = root(); >+ if (!view) >+ return; >+ view->hostWindow()->setCursor(cursor); >+} >+ >+void Widget::show() >+{ >+ notImplemented(); >+} >+ >+void Widget::hide() >+{ >+ notImplemented(); >+} >+ >+void Widget::paint(GraphicsContext*, const IntRect&) >+{ >+ notImplemented(); >+} >+ >+void Widget::setIsSelected(bool) >+{ >+ notImplemented(); >+} >+ >+} >diff --git a/Source/WebCore/platform/nix/support/WebAudioBus.cpp b/Source/WebCore/platform/nix/support/WebAudioBus.cpp >new file mode 100644 >index 0000000..8499991 >--- /dev/null >+++ b/Source/WebCore/platform/nix/support/WebAudioBus.cpp >@@ -0,0 +1,147 @@ >+/* >+ * Copyright (C) 2010, 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: >+ * 1. Redistributions of source code must retain the above copyright >+ * notice, this list of conditions and the following disclaimer. >+ * 2. Redistributions in binary form must reproduce the above copyright >+ * notice, this list of conditions and the following disclaimer in the >+ * documentation and/or other materials provided with the distribution. >+ * >+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY >+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED >+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE >+ * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY >+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES >+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; >+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON >+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS >+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >+ */ >+ >+#include "config.h" >+#include <public/WebAudioBus.h> >+ >+#if ENABLE(WEB_AUDIO) >+#include "AudioBus.h" >+#else >+namespace WebCore { >+class AudioBus { >+}; >+} // namespace WebCore >+#endif >+ >+#include <wtf/OwnPtr.h> >+#include <wtf/PassOwnPtr.h> >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+class WebAudioBusPrivate { >+public: >+ WebAudioBusPrivate(PassRefPtr<WebCore::AudioBus> audioBus) >+ : m_audioBus(audioBus) >+ {} >+ >+ RefPtr<WebCore::AudioBus> m_audioBus; >+}; >+ >+void WebAudioBus::initialize(unsigned numberOfChannels, size_t length, double sampleRate) >+{ >+#if ENABLE(WEB_AUDIO) >+ if (m_d) >+ delete m_d; >+ m_d = new WebAudioBusPrivate(WebCore::AudioBus::create(numberOfChannels, length)); >+ m_d->m_audioBus->setSampleRate(sampleRate); >+#else >+ ASSERT_NOT_REACHED(); >+#endif >+} >+ >+void WebAudioBus::resizeSmaller(size_t newLength) >+{ >+#if ENABLE(WEB_AUDIO) >+ ASSERT(m_d); >+ if (m_d) { >+ ASSERT(newLength <= length()); >+ m_d->m_audioBus->resizeSmaller(newLength); >+ } >+#else >+ ASSERT_NOT_REACHED(); >+#endif >+} >+ >+void WebAudioBus::reset() >+{ >+#if ENABLE(WEB_AUDIO) >+ delete m_d; >+ m_d = 0; >+#else >+ ASSERT_NOT_REACHED(); >+#endif >+} >+ >+unsigned WebAudioBus::numberOfChannels() const >+{ >+#if ENABLE(WEB_AUDIO) >+ if (!m_d) >+ return 0; >+ return m_d->m_audioBus->numberOfChannels(); >+#else >+ ASSERT_NOT_REACHED(); >+ return 0; >+#endif >+} >+ >+size_t WebAudioBus::length() const >+{ >+#if ENABLE(WEB_AUDIO) >+ if (!m_d) >+ return 0; >+ return m_d->m_audioBus->length(); >+#else >+ ASSERT_NOT_REACHED(); >+ return 0; >+#endif >+} >+ >+double WebAudioBus::sampleRate() const >+{ >+#if ENABLE(WEB_AUDIO) >+ if (!m_d) >+ return 0; >+ return m_d->m_audioBus->sampleRate(); >+#else >+ ASSERT_NOT_REACHED(); >+ return 0; >+#endif >+} >+ >+float* WebAudioBus::channelData(unsigned channelIndex) >+{ >+#if ENABLE(WEB_AUDIO) >+ if (!m_d) >+ return 0; >+ ASSERT(channelIndex < numberOfChannels()); >+ return m_d->m_audioBus->channel(channelIndex)->mutableData(); >+#else >+ ASSERT_NOT_REACHED(); >+ return 0; >+#endif >+} >+ >+PassRefPtr<AudioBus> WebAudioBus::audioBus() >+{ >+#if ENABLE(WEB_AUDIO) >+ return m_d->m_audioBus; >+#else >+ ASSERT_NOT_REACHED(); >+ return nullptr; >+#endif >+} >+ >+} // namespace WebKit >diff --git a/Source/WebCore/platform/nix/support/WebData.cpp b/Source/WebCore/platform/nix/support/WebData.cpp >new file mode 100644 >index 0000000..c4c4f69 >--- /dev/null >+++ b/Source/WebCore/platform/nix/support/WebData.cpp >@@ -0,0 +1,103 @@ >+/* >+ * 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 <public/WebData.h> >+ >+#include "SharedBuffer.h" >+ >+using namespace WebCore; >+ >+namespace WebKit { >+ >+class WebDataPrivate : public SharedBuffer { >+}; >+ >+void WebData::reset() >+{ >+ if (m_private) { >+ m_private->deref(); >+ m_private = 0; >+ } >+} >+ >+void WebData::assign(const WebData& other) >+{ >+ WebDataPrivate* p = const_cast<WebDataPrivate*>(other.m_private); >+ if (p) >+ p->ref(); >+ assign(p); >+} >+ >+void WebData::assign(const char* data, size_t size) >+{ >+ assign(static_cast<WebDataPrivate*>( >+ SharedBuffer::create(data, size).leakRef())); >+} >+ >+size_t WebData::size() const >+{ >+ if (!m_private) >+ return 0; >+ return const_cast<WebDataPrivate*>(m_private)->size(); >+} >+ >+const char* WebData::data() const >+{ >+ if (!m_private) >+ return 0; >+ return const_cast<WebDataPrivate*>(m_private)->data(); >+} >+ >+WebData::WebData(const PassRefPtr<SharedBuffer>& buffer) >+ : m_private(static_cast<WebDataPrivate*>(buffer.leakRef())) >+{ >+} >+ >+WebData& WebData::operator=(const PassRefPtr<SharedBuffer>& buffer) >+{ >+ assign(static_cast<WebDataPrivate*>(buffer.leakRef())); >+ return *this; >+} >+ >+WebData::operator PassRefPtr<SharedBuffer>() const >+{ >+ return PassRefPtr<SharedBuffer>(const_cast<WebDataPrivate*>(m_private)); >+} >+ >+void WebData::assign(WebDataPrivate* p) >+{ >+ // p is already ref'd for us by the caller >+ if (m_private) >+ m_private->deref(); >+ m_private = p; >+} >+ >+} // namespace WebKit >diff --git a/Source/WebCore/platform/text/nix/TextBreakIteratorInternalICUNix.cpp b/Source/WebCore/platform/text/nix/TextBreakIteratorInternalICUNix.cpp >new file mode 100644 >index 0000000..77fa773 >--- /dev/null >+++ b/Source/WebCore/platform/text/nix/TextBreakIteratorInternalICUNix.cpp >@@ -0,0 +1,41 @@ >+/* >+ * Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+ * >+ * 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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 "TextBreakIteratorInternalICU.h" >+ >+namespace WebCore { >+ >+const char* currentSearchLocaleID() >+{ >+ return ""; >+} >+ >+const char* currentTextBreakLocaleID() >+{ >+ return "en_us"; >+} >+ >+} >diff --git a/Source/WebCore/plugins/PluginPackage.cpp b/Source/WebCore/plugins/PluginPackage.cpp >index d2b6f52..f9e2219 100644 >--- a/Source/WebCore/plugins/PluginPackage.cpp >+++ b/Source/WebCore/plugins/PluginPackage.cpp >@@ -177,7 +177,7 @@ PassRefPtr<PluginPackage> PluginPackage::createPackageFromCache(const String& pa > } > #endif > >-#if defined(XP_UNIX) >+#if defined(XP_UNIX) && !PLATFORM(NIX) > void PluginPackage::determineQuirks(const String& mimeType) > { > if (MIMETypeRegistry::isJavaAppletMIMEType(mimeType)) { >diff --git a/Source/WebCore/plugins/PluginView.cpp b/Source/WebCore/plugins/PluginView.cpp >index 618b368..7cffa7e 100644 >--- a/Source/WebCore/plugins/PluginView.cpp >+++ b/Source/WebCore/plugins/PluginView.cpp >@@ -831,7 +831,7 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p > , m_wmPrintHDC(0) > , m_haveUpdatedPluginWidget(false) > #endif >-#if (PLATFORM(QT) && OS(WINDOWS)) || PLATFORM(EFL) >+#if (PLATFORM(QT) && OS(WINDOWS)) || PLATFORM(EFL) || PLATFORM(NIX) > , m_window(0) > #endif > #if defined(XP_MACOSX) >diff --git a/Source/WebCore/plugins/PluginView.h b/Source/WebCore/plugins/PluginView.h >index a81bd0a..327760f 100644 >--- a/Source/WebCore/plugins/PluginView.h >+++ b/Source/WebCore/plugins/PluginView.h >@@ -383,7 +383,7 @@ namespace WebCore { > bool m_haveUpdatedPluginWidget; > #endif > >-#if ((PLATFORM(GTK) || PLATFORM(QT)) && OS(WINDOWS)) || PLATFORM(EFL) >+#if ((PLATFORM(GTK) || PLATFORM(QT)) && OS(WINDOWS)) || PLATFORM(EFL) || PLATFORM(NIX) > // On Mac OSX and Qt/Windows the plugin does not have its own native widget, > // but is using the containing window as its reference for positioning/painting. > PlatformPluginWidget m_window; >diff --git a/Source/WebCore/plugins/PluginViewNone.cpp b/Source/WebCore/plugins/PluginViewNone.cpp >index 0c945fb..498ab76 100644 >--- a/Source/WebCore/plugins/PluginViewNone.cpp >+++ b/Source/WebCore/plugins/PluginViewNone.cpp >@@ -132,7 +132,7 @@ void PluginView::handleFocusOutEvent() > // ports using PluginView, but until then, if new functions like this are > // added, please make sure they have the proper platform #ifs so that changes > // do not break ports who compile both this file and PluginView.cpp. >-#if PLATFORM(MAC) || PLATFORM(EFL) || (OS(WINCE) && !PLATFORM(QT)) || (PLATFORM(QT) && !OS(WINCE)) >+#if PLATFORM(MAC) || PLATFORM(EFL) || (OS(WINCE) && !PLATFORM(QT)) || (PLATFORM(QT) && !OS(WINCE)) || PLATFORM(NIX) > #if ENABLE(NETSCAPE_PLUGIN_API) > void PluginView::keepAlive(NPP) > { >diff --git a/Source/cmake/FindEGL.cmake b/Source/cmake/FindEGL.cmake >index 526c5ba..93a144c 100644 >--- a/Source/cmake/FindEGL.cmake >+++ b/Source/cmake/FindEGL.cmake >@@ -35,3 +35,5 @@ find_library(EGL_LIBRARY NAMES ${EGL_NAMES}) > > include(FindPackageHandleStandardArgs) > FIND_PACKAGE_HANDLE_STANDARD_ARGS(EGL DEFAULT_MSG EGL_INCLUDE_DIR EGL_LIBRARY) >+ >+MARK_AS_ADVANCED(EGL_INCLUDE_DIR EGL_LIBRARY) >diff --git a/Source/cmake/FindOpenGLES2.cmake b/Source/cmake/FindOpenGLES2.cmake >new file mode 100644 >index 0000000..5574dda >--- /dev/null >+++ b/Source/cmake/FindOpenGLES2.cmake >@@ -0,0 +1,25 @@ >+# Try to find OpenGLES2. Once done this will define: >+# OPENGLES2_FOUND >+# OPENGLES2_INCLUDE_DIRS >+# OPENGLES2_LIBRARIES >+# OPENGLES2_DEFINITIONS >+ >+FIND_PACKAGE(PkgConfig) >+ >+PKG_CHECK_MODULES(PC_OPENGLES2 glesv2) >+ >+IF (PC_OPENGLES2_FOUND) >+ SET(OPENGLES2_INCLUDE_DIRS ${PC_OPENGLES2_INCLUDE_DIRS}) >+ SET(OPENGLES2_DEFINITIONS ${PC_OPENGLES2_CFLAGS_OTHER}) >+ELSE () >+ FIND_PATH(OPENGLES2_INCLUDE_DIRS NAMES GLES2/gl2.h) >+ENDIF () >+ >+FIND_LIBRARY(OPENGLES2_LIBRARIES GLESv2 >+ HINTS ${PC_OPENGLES2_LIBRARY_DIRS} ${PC_OPENGLES2_LIBDIR} >+) >+ >+INCLUDE(FindPackageHandleStandardArgs) >+FIND_PACKAGE_HANDLE_STANDARD_ARGS(OpenGLES2 DEFAULT_MSG OPENGLES2_LIBRARIES OPENGLES2_INCLUDE_DIRS) >+ >+MARK_AS_ADVANCED(OPENGLES2_INCLUDE_DIRS OPENGLES2_LIBRARY) >diff --git a/Source/cmake/OptionsCommon.cmake b/Source/cmake/OptionsCommon.cmake >index 0acbcfc..294e228 100644 >--- a/Source/cmake/OptionsCommon.cmake >+++ b/Source/cmake/OptionsCommon.cmake >@@ -1,8 +1,16 @@ >-add_definitions(-DBUILDING_WITH_CMAKE=1) >-add_definitions(-DHAVE_CONFIG_H=1) >+# Nix doesn't use cmakeconfig.h >+if (NOT PORT STREQUAL "Nix") >+ add_definitions(-DBUILDING_WITH_CMAKE=1) >+ add_definitions(-DHAVE_CONFIG_H=1) >+endif () >+ > > if (WTF_OS_UNIX) > add_definitions(-DXP_UNIX) >+ #TODO: check for X11 target >+ if (NOT PORT STREQUAL "Nix") >+ add_definitions(-DMOZ_X11) >+ endif () > endif (WTF_OS_UNIX) > > # CODE_GENERATOR_PREPROCESSOR_WITH_LINEMARKERS only matters with GCC >= 4.7.0. Since this >diff --git a/Source/cmake/OptionsNix.cmake b/Source/cmake/OptionsNix.cmake >new file mode 100644 >index 0000000..dc1a823 >--- /dev/null >+++ b/Source/cmake/OptionsNix.cmake >@@ -0,0 +1,148 @@ >+# Nix uses a different way to set/unset default features based on WK bug 110717 (not yet landed). >+# So the implementation, i.e. the next two macros, was moved to here to keep a minimal as possible >+# interference on other ports until some day when/if bug 110717 get landed. >+ >+# Compute and set default values for feature defines >+macro(WEBKIT_OPTION_DEFAULTS _port) >+ # Use the preprocessor to get the default values for feature defines >+ EXEC_PROGRAM("gcc -E -P -dM -DBUILDING_${_port}__ -I ${CMAKE_SOURCE_DIR}/Source/WTF ${CMAKE_SOURCE_DIR}/Source/WTF/wtf/Platform.h | grep '^#define ENABLE_\\w\\+ [01]$' | cut -d' ' -f2-3 | sort" OUTPUT_VARIABLE DEFINITIONS) >+ string(REGEX MATCHALL "([^\n]+|[^\n]+$)" DEFINITIONS_LIST ${DEFINITIONS}) >+ >+ foreach (DEFINITION ${DEFINITIONS_LIST}) >+ string(REGEX REPLACE "^([^ ]+) ([^ ]+)$" "\\1" DEFINITION_NAME "${DEFINITION}") >+ string(REGEX REPLACE "^([^ ]+) ([^ ]+)$" "\\2" DEFINITION_VALUE "${DEFINITION}") >+ WEBKIT_OPTION_DEFINE(${DEFINITION_NAME} "Toggle ${DEFINITION_NAME}" ${DEFINITION_VALUE}) >+ option(${DEFINITION_NAME} "Toggle ${DEFINITION_NAME}" ${DEFINITION_VALUE}) >+ endforeach () >+endmacro() >+ >+# Show WebKit options summary and add -DFOOBAR to each option with a value different from the default value. >+macro(PROCESS_WEBKIT_OPTIONS) >+ message(STATUS "Enabled features:") >+ >+ set(_MAX_FEATURE_LENGTH 0) >+ foreach (_name ${_WEBKIT_AVAILABLE_OPTIONS}) >+ string(LENGTH ${_name} _NAME_LENGTH) >+ if (_NAME_LENGTH GREATER _MAX_FEATURE_LENGTH) >+ set(_MAX_FEATURE_LENGTH ${_NAME_LENGTH}) >+ endif () >+ endforeach () >+ >+ set(_SHOULD_PRINT_POINTS OFF) >+ foreach (_name ${_WEBKIT_AVAILABLE_OPTIONS}) >+ string(LENGTH ${_name} _NAME_LENGTH) >+ >+ set(_MESSAGE " ${_name} ") >+ >+ if (_SHOULD_PRINT_POINTS) >+ foreach (IGNORE RANGE ${_NAME_LENGTH} ${_MAX_FEATURE_LENGTH}) >+ set(_MESSAGE "${_MESSAGE} ") >+ endforeach () >+ set(_SHOULD_PRINT_POINTS OFF) >+ else () >+ foreach (IGNORE RANGE ${_NAME_LENGTH} ${_MAX_FEATURE_LENGTH}) >+ set(_MESSAGE "${_MESSAGE}.") >+ endforeach () >+ set(_SHOULD_PRINT_POINTS ON) >+ endif () >+ >+ if (${_name}) >+ list(APPEND FEATURE_DEFINES ${_name}) >+ set(FEATURE_DEFINES_WITH_SPACE_SEPARATOR "${FEATURE_DEFINES_WITH_SPACE_SEPARATOR} ${_name}") >+ endif () >+ >+ set(_MESSAGE "${_MESSAGE} ${${_name}}") >+ message(STATUS "${_MESSAGE}") >+ endforeach () >+ >+ # Add add_definitions to values different from the defaults >+ foreach (_name ${_WEBKIT_AVAILABLE_OPTIONS}) >+ # Convert values from ON/OFF to 1/0 because >+ # CMake says "1 EQUAL ON" is false. >+ if (${_WEBKIT_AVAILABLE_OPTIONS_INITALVALUE_${_name}}) >+ set(_a 1) >+ else () >+ set(_a 0) >+ endif () >+ if (${${_name}}) >+ set(_b 1) >+ else () >+ set(_b 0) >+ endif () >+ if (NOT _a EQUAL _b) >+ add_definitions("-D${_name}=${_b}") >+ endif () >+ endforeach () >+endmacro() >+ >+ >+set(PROJECT_VERSION_MAJOR 0) >+set(PROJECT_VERSION_MINOR 1) >+set(PROJECT_VERSION_PATCH 0) >+set(PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}) >+ >+if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") >+ # Use -femit-struct-debug-baseonly to reduce the size of WebCore static library >+ set(CMAKE_CXX_FLAGS_DEBUG "-g -femit-struct-debug-baseonly" CACHE STRING "Flags used by the compiler during debug builds." FORCE) >+endif () >+ >+set(SHARED_CORE OFF) >+set(ENABLE_WEBKIT OFF) >+set(ENABLE_WEBKIT2 OFF) >+set(ENABLE_TOOLS OFF) >+ >+set(WebKit2_OUTPUT_NAME WebKitNix) >+ >+add_definitions(-DBUILDING_NIX__=1) >+ >+find_package(Cairo 1.12.8 REQUIRED) >+find_package(Fontconfig 2.8.0 REQUIRED) >+find_package(Freetype REQUIRED) >+find_package(GLIB 2.36.0 REQUIRED COMPONENTS gio gobject gmodule gthread) >+find_package(HarfBuzz) >+find_package(ICU REQUIRED) >+find_package(JPEG REQUIRED) >+find_package(LibXml2 2.6 REQUIRED) >+find_package(LibXslt 1.1.7 REQUIRED) >+find_package(PNG REQUIRED) >+find_package(Sqlite REQUIRED) >+find_package(Threads REQUIRED) >+find_package(ZLIB REQUIRED) >+ >+# Variables that must exists on CMake space >+# to keep common CMake files working as desired for us >+set(WTF_USE_ICU_UNICODE ON) >+set(WTF_USE_LEVELDB ON) >+set(ENABLE_API_TESTS OFF) >+ >+WEBKIT_OPTION_DEFAULTS("NIX") >+WEBKIT_OPTION_DEFINE(WTF_USE_OPENGL_ES_2 "Use EGL + OpenGLES2" OFF) >+WEBKIT_OPTION_DEFINE(WTF_USE_CURL "Use libCurl as network backend" OFF) >+ >+if (WTF_USE_CURL) >+ find_package(CURL REQUIRED) >+ set(REQUIRED_NETWORK libcurl) >+else () >+ find_package(LibSoup 2.42.0 REQUIRED) >+ set(REQUIRED_NETWORK libsoup-2.4) >+endif () >+ >+if (WTF_USE_OPENGL_ES_2) >+ find_package(OpenGLES2 REQUIRED) >+ find_package(EGL REQUIRED) >+ set(WTF_USE_EGL ON) >+ add_definitions(-DWTF_USE_OPENGL_ES_2=1) >+else () >+ find_package(X11 REQUIRED) >+ find_package(OpenGL REQUIRED) >+ add_definitions(-DHAVE_GLX=1) >+endif () >+ >+if (NOT ENABLE_SVG) >+ set(ENABLE_SVG_FONTS OFF) >+endif () >+ >+PROCESS_WEBKIT_OPTIONS() >+ >+ >+ >diff --git a/Tools/Scripts/build-dumprendertree b/Tools/Scripts/build-dumprendertree >index 1ff75f7..91f5482 100755 >--- a/Tools/Scripts/build-dumprendertree >+++ b/Tools/Scripts/build-dumprendertree >@@ -70,7 +70,7 @@ if (isAppleMacWebKit()) { > } elsif (isAppleWinWebKit()) { > my $drtSolutionPath = "DumpRenderTree.vcxproj/DumpRenderTree.sln"; > $result = buildVisualStudioProject($drtSolutionPath, $clean); >-} elsif (isQt() || isGtk() || isEfl()) { >+} elsif (isQt() || isGtk() || isEfl() || isNix()) { > # Qt, Gtk and EFL build everything in one shot. No need to build anything here. > $result = 0; > } else { >diff --git a/Tools/Scripts/build-webkit b/Tools/Scripts/build-webkit >index e3dd919..f52245d 100755 >--- a/Tools/Scripts/build-webkit >+++ b/Tools/Scripts/build-webkit >@@ -36,7 +36,7 @@ use File::Basename; > use File::Find; > use File::Spec; > use FindBin; >-use Getopt::Long qw(:config pass_through); >+use Getopt::Long qw(:config pass_through no_auto_abbrev); > use lib $FindBin::Bin; > use webkitdirs; > use webkitperl::FeatureList qw(getFeatureOptionList); >@@ -62,6 +62,8 @@ my $noWebKit1 = 0; > my $noWebKit2 = 0; > my $coverageSupport = 0; > my $startTime = time(); >+my $curl = 0; >+my $opengles2 = 0; > > my @features = getFeatureOptionList(); > >@@ -87,6 +89,38 @@ if (isQt()) { > } > } > >+# Update defaults for the Nix port >+if (isNix()) { >+ # Instead of use FeatureList.pm to list enabled features, tell the compiler to >+ # parse Source/WTF/wtf/Platform.h and get the default values of all feature flags >+ # from the result. >+ my $portDefine = "BUILDING_".uc(cmakeBasedPortName())."__"; >+ my $definitions = `gcc -E -P -dM -D$portDefine -I Source/WTF Source/WTF/wtf/Platform.h | grep '^#define ENABLE_\\w\\+ \[01\]\$' | cut -d' ' -f2-3`; >+ >+ my %featureDefaults; >+ foreach (split(/\n/, $definitions)) { >+ my @macroDefinition = split(/ /); >+ $featureDefaults{$macroDefinition[0]} = $macroDefinition[1]; >+ } >+ >+ @features = (); >+ foreach (sort keys %featureDefaults) { >+ next if (!/^ENABLE/); >+ my $optionName = lc $_; >+ $optionName =~ s/^enable_//; >+ $optionName =~ s/_/-/g; >+ my $descName = $optionName; >+ $descName =~ s/-/ /g; >+ >+ push @features, { >+ option => $optionName, >+ desc => "Toggle $descName support", >+ define => $_, >+ default => $featureDefaults{$_} >+ }; >+ } >+} >+ > # Additional environment parameters > push @ARGV, split(/ /, $ENV{'BUILD_WEBKIT_ARGS'}) if ($ENV{'BUILD_WEBKIT_ARGS'}); > >@@ -116,6 +150,7 @@ Usage: $programName [options] [options to pass to build system] > > --blackberry Build the BlackBerry port on Mac/Linux > --efl Build the EFL port >+ --nix Build the Nix port > --gtk Build the GTK+ port > --qt Build the Qt port > --wincairo Build using Cairo (rather than CoreGraphics) on Windows >@@ -137,6 +172,9 @@ Usage: $programName [options] [options to pass to build system] > --no-webkit1 Omit WebKit1 code from the build (Qt/EFL/GTK only) > --no-webkit2 Omit WebKit2 code from the build > >+ --curl Use libCurl as network backend (Nix only) >+ --opengles2 Use EGL and OpenGLES2 instead of GLX (Nix only) >+ > EOF > > my %options = ( >@@ -152,6 +190,8 @@ my %options = ( > 'no-webkit1' => \$noWebKit1, > 'no-webkit2' => \$noWebKit2, > 'coverage' => \$coverageSupport, >+ 'curl' => \$curl, >+ 'opengles2' => \$opengles2, > ); > > # Build usage text and options list from features >@@ -273,6 +313,24 @@ if (isInspectorFrontend()) { > > my $result = 0; > >+if (isNix()) { >+ if ($noWebKit2) { >+ print STDERR "Nix is a WebKit2 port, you can't disable WebKit2 on it!\n"; >+ exit 1; >+ } >+ >+ # By default we build using all of the available CPUs. >+ $makeArgs .= ($makeArgs ? " " : "") . "-j" . numberOfCPUs() if $makeArgs !~ /-j\s*\d+/; >+ $cmakeArgs = "-DWTF_USE_CURL=ON " . $cmakeArgs if $curl; >+ $cmakeArgs = "-DWTF_USE_OPENGL_ES_2=ON " . $cmakeArgs if $opengles2; >+ >+ # We remove CMakeCache to avoid the bots to reuse cached flags when >+ # we enable new features. This forces a reconfiguration. >+ removeCMakeCache(); >+ >+ buildCMakeProjectOrExit($clean, "Nix", $prefixPath, $makeArgs, (cmakeBasedPortArguments(), cMakeArgsFromFeatures()), $cmakeArgs); >+} >+ > if (isEfl()) { > # By default we build using all of the available CPUs. > $makeArgs .= ($makeArgs ? " " : "") . "-j" . numberOfCPUs() if $makeArgs !~ /-j\s*\d+/; >diff --git a/Tools/Scripts/build-webkittestrunner b/Tools/Scripts/build-webkittestrunner >index e5b2354..c8a342b 100755 >--- a/Tools/Scripts/build-webkittestrunner >+++ b/Tools/Scripts/build-webkittestrunner >@@ -63,7 +63,7 @@ if (isAppleMacWebKit()) { > $result = buildXCodeProject("WebKitTestRunner", $clean, XcodeOptions(), @ARGV); > } elsif (isAppleWinWebKit()) { > $result = buildVisualStudioProject("WebKitTestRunner.sln", $clean); >-} elsif (isQt() || isGtk() || isEfl()) { >+} elsif (isQt() || isGtk() || isEfl() || isNix()) { > # Qt and GTK+ build everything in one shot. No need to build anything here. > $result = 0; > } else { >diff --git a/Tools/Scripts/run-javascriptcore-tests b/Tools/Scripts/run-javascriptcore-tests >index 8b79f25..44829ff 100755 >--- a/Tools/Scripts/run-javascriptcore-tests >+++ b/Tools/Scripts/run-javascriptcore-tests >@@ -57,6 +57,10 @@ my @testsToSkip = ( > "ecma/Date/15.9.5.14.js", > "ecma/Date/15.9.5.31-1.js", > "ecma/Date/15.9.5.34-1.js", >+ # Tests failing when running in BRT timezone >+ "ecma/Date/15.9.5.28-1.js", >+ "ecma/Date/15.9.5.29-1.js", >+ "ecma/Date/15.9.5.35-1.js", > ); > > my $jsDriverArgs = "-L " . join(" ", @testsToSkip); >diff --git a/Tools/Scripts/run-launcher b/Tools/Scripts/run-launcher >index 66886fe..e839b5a 100755 >--- a/Tools/Scripts/run-launcher >+++ b/Tools/Scripts/run-launcher >@@ -73,6 +73,12 @@ if (isQt()) { > unshift(@ARGV, ("--gtk", "run")); > } > >+ if (isNix()) { >+ unshift(@ARGV, catdir($launcherPath, "bin", "MiniBrowser")); >+ $launcherPath = catdir(sourceDir(), "Tools", "jhbuild", "jhbuild-wrapper"); >+ unshift(@ARGV, ("--nix", "run")); >+ } >+ > if (isEfl()) { > if (isWK2()) { > unshift(@ARGV, catdir($launcherPath, "bin", "MiniBrowser")); >diff --git a/Tools/Scripts/run-nix-tests b/Tools/Scripts/run-nix-tests >new file mode 100755 >index 0000000..6798e10 >--- /dev/null >+++ b/Tools/Scripts/run-nix-tests >@@ -0,0 +1,44 @@ >+#!/usr/bin/perl -w >+# Copyright (C) 2012 Intel Corporation. All rights reserved. >+# Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+# >+# 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 Intel Corporation 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. >+ >+use strict; >+use FindBin; >+use lib $FindBin::Bin; >+use webkitdirs; >+ >+setConfiguration(); >+ >+# Manually add this for jhbuildWrapperPrefixIfNeeded(). >+push(@ARGV, "--nix"); >+ >+# Tell CTest to dump gtest output in case of failure. >+$ENV{CTEST_OUTPUT_ON_FAILURE} = "1"; >+ >+buildCMakeProjectOrExit(0, "Nix", undef, "test", cmakeBasedPortArguments()); >diff --git a/Tools/Scripts/run-webkit-tests b/Tools/Scripts/run-webkit-tests >index fd507e4..dc6ffbd 100755 >--- a/Tools/Scripts/run-webkit-tests >+++ b/Tools/Scripts/run-webkit-tests >@@ -90,6 +90,8 @@ if (isQt()) { > push(@ARGV, "--gtk"); > } elsif (isEfl()) { > push(@ARGV, "--efl"); >+} elsif (isNix()) { >+ push(@ARGV, "--nix"); > } elsif (isWinCairo()) { > push(@ARGV, "--wincairo"); > } >diff --git a/Tools/Scripts/update-webkit-libs-jhbuild b/Tools/Scripts/update-webkit-libs-jhbuild >index a148887..a0775ab 100755 >--- a/Tools/Scripts/update-webkit-libs-jhbuild >+++ b/Tools/Scripts/update-webkit-libs-jhbuild >@@ -23,15 +23,17 @@ use Getopt::Long; > > my $platformEfl = 0; > my $platformGtk = 0; >+my $platformNix = 0; > > my $getOptionsResult = GetOptions( > 'efl' => \$platformEfl, >- 'gtk' => \$platformGtk >+ 'gtk' => \$platformGtk, >+ 'nix' => \$platformNix > ); > > my $platform = ""; > if (!$getOptionsResult) { >- die "No platform specified for " . basename($0) .". Use --gtk or --efl.\n"; >+ die "No platform specified for " . basename($0) .". Use --gtk, --efl or --nix.\n"; > } else { > if ($platformEfl) { > $platform = "efl"; >@@ -39,6 +41,9 @@ if (!$getOptionsResult) { > if ($platformGtk) { > $platform = "gtk"; > } >+ if ($platformNix) { >+ $platform = "nix"; >+ } > } > > sub getMD5HashForFile($) >@@ -118,7 +123,7 @@ delete $ENV{AR_FLAGS} if exists $ENV{AR_FLAGS}; > > chdir(relativeScriptsDir() . "/../jhbuild") or die $!; > >-my %prettyPlatform = ( "efl" => "EFL", "gtk" => "GTK+" ); >+my %prettyPlatform = ( "efl" => "EFL", "gtk" => "GTK+", "nix" => "Nix" ); > > if (-e getJhbuildPath() && jhbuildConfigurationChanged()) { > cleanJhbuild(); >diff --git a/Tools/Scripts/update-webkitnix-libs b/Tools/Scripts/update-webkitnix-libs >new file mode 100755 >index 0000000..53f36bd >--- /dev/null >+++ b/Tools/Scripts/update-webkitnix-libs >@@ -0,0 +1,24 @@ >+#!/usr/bin/perl -w >+# Copyright (C) 2012 Intel Corporation >+# Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+# >+# This library is free software; you can redistribute it and/or >+# modify it under the terms of the GNU Lesser 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 >+# Lesser General Public License for more details. >+# >+# You should have received a copy of the GNU Lesser General Public >+# License along with this library; if not, write to the Free Software >+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >+ >+use FindBin; >+use lib $FindBin::Bin; >+use webkitdirs; >+ >+my $scriptsDir = relativeScriptsDir(); >+system("perl", "$scriptsDir/update-webkit-libs-jhbuild", "--nix") == 0 or die $!; >diff --git a/Tools/Scripts/webkitdirs.pm b/Tools/Scripts/webkitdirs.pm >index b4a5528..768fb1d 100755 >--- a/Tools/Scripts/webkitdirs.pm >+++ b/Tools/Scripts/webkitdirs.pm >@@ -95,6 +95,7 @@ my $isGtk; > my $isWinCE; > my $isWinCairo; > my $isEfl; >+my $isNix; > my $isBlackBerry; > my $isInspectorFrontend; > my $isWK2; >@@ -322,7 +323,7 @@ sub determineArchitecture > $architecture = 'armv7'; > } > } >- } elsif (isEfl()) { >+ } elsif (isEfl() || isNix()) { > my $host_processor = ""; > $host_processor = `cmake --system-information | grep CMAKE_SYSTEM_PROCESSOR`; > if ($host_processor =~ m/^CMAKE_SYSTEM_PROCESSOR \"([^"]+)\"/) { >@@ -332,13 +333,13 @@ sub determineArchitecture > } > } > >- if (!$architecture && (isGtk() || isAppleMacWebKit() || isEfl())) { >+ if (!$architecture && (isGtk() || isAppleMacWebKit() || isEfl() || isNix())) { > # Fall back to output of `arch', if it is present. > $architecture = `arch`; > chomp $architecture; > } > >- if (!$architecture && (isGtk() || isAppleMacWebKit() || isEfl())) { >+ if (!$architecture && (isGtk() || isAppleMacWebKit() || isEfl() || isNix())) { > # Fall back to output of `uname -m', if it is present. > $architecture = `uname -m`; > chomp $architecture; >@@ -387,6 +388,7 @@ sub argumentsForConfiguration() > push(@args, '--qt') if isQt(); > push(@args, '--gtk') if isGtk(); > push(@args, '--efl') if isEfl(); >+ push(@args, '--nix') if isNix(); > push(@args, '--wincairo') if isWinCairo(); > push(@args, '--wince') if isWinCE(); > push(@args, '--blackberry') if isBlackBerry(); >@@ -530,7 +532,7 @@ sub productDir > sub jscProductDir > { > my $productDir = productDir(); >- $productDir .= "/bin" if (isQt() || isEfl()); >+ $productDir .= "/bin" if (isQt() || isEfl() || isNix()); > $productDir .= "/Programs" if isGtk(); > > return $productDir; >@@ -846,6 +848,9 @@ sub builtDylibPathForName > } > return "$configurationProductDir/lib/libewebkit.so"; > } >+ if (isNix()) { >+ return "$configurationProductDir/lib/libWebKitNix.so"; >+ } > if (isWinCE()) { > return "$configurationProductDir/$libraryName"; > } >@@ -989,8 +994,8 @@ sub determineIsQt() > return; > } > >- # The presence of QTDIR only means Qt if --gtk or --efl or --blackberry or --wincairo are not on the command-line >- if (isGtk() || isEfl() || isBlackBerry() || isWinCairo()) { >+ if (isGtk() || isEfl() || isBlackBerry() || isWinCairo() || isNix()) { >+ # The presence of QTDIR only means Qt if --gtk or --efl or --blackberry or --wincairo or --nix are not on the command-line > $isQt = 0; > return; > } >@@ -1141,6 +1146,17 @@ sub isEfl() > return $isEfl; > } > >+sub determineIsNix() >+{ >+ return if defined($isNix); >+ $isNix = checkForArgumentAndRemoveFromARGV("--nix"); >+} >+ >+sub isNix() >+{ >+ determineIsNix(); >+ return $isNix; >+} > sub isGtk() > { > determineIsGtk(); >@@ -1279,7 +1295,7 @@ sub isCrossCompilation() > > sub isAppleWebKit() > { >- return !(isQt() or isGtk() or isEfl() or isWinCE() or isBlackBerry()); >+ return !(isQt() or isGtk() or isEfl() or isWinCE() or isBlackBerry() or isNix()); > } > > sub isAppleMacWebKit() >@@ -1454,7 +1470,7 @@ sub relativeScriptsDir() > sub launcherPath() > { > my $relativeScriptsPath = relativeScriptsDir(); >- if (isGtk() || isQt() || isEfl() || isWinCE()) { >+ if (isGtk() || isQt() || isEfl() || isWinCE() || isNix()) { > return "$relativeScriptsPath/run-launcher"; > } elsif (isAppleWebKit()) { > return "$relativeScriptsPath/run-safari"; >@@ -1473,6 +1489,8 @@ sub launcherName() > return "EWebLauncher/MiniBrowser"; > } elsif (isWinCE()) { > return "WinCELauncher"; >+ } elsif (isNix()) { >+ return "MiniBrowser"; > } > } > >@@ -1499,7 +1517,7 @@ sub checkRequiredSystemConfig > print "http://developer.apple.com/tools/xcode\n"; > print "*************************************************************\n"; > } >- } elsif (isGtk() or isQt() or isEfl()) { >+ } elsif (isGtk() or isQt() or isEfl() or isNix()) { > my @cmds = qw(bison gperf); > if (isQt() and isWindows()) { > push @cmds, "win_flex"; >@@ -1694,7 +1712,7 @@ sub copyInspectorFrontendFiles > $inspectorResourcesDirPath = $productDir . "/WebCore.framework/Resources/inspector"; > } elsif (isAppleWinWebKit()) { > $inspectorResourcesDirPath = $productDir . "/WebKit.resources/inspector"; >- } elsif (isQt() || isGtk()) { >+ } elsif (isQt() || isGtk() || isNix()) { > my $prefix = $ENV{"WebKitInstallationPrefix"}; > $inspectorResourcesDirPath = (defined($prefix) ? $prefix : "/usr/share") . "/webkit-1.0/webinspector"; > } elsif (isEfl()) { >@@ -2035,6 +2053,8 @@ sub jhbuildWrapperPrefixIfNeeded() > push(@prefix, "--efl"); > } elsif (isGtk()) { > push(@prefix, "--gtk"); >+ } elsif (isNix()) { >+ push(@prefix, "--nix"); > } > push(@prefix, "run"); > >@@ -2129,6 +2149,9 @@ sub buildCMakeProjectOrExit($$$$@) > system("perl", "$sourceDir/Tools/Scripts/update-webkitefl-libs") == 0 or die $!; > } > >+ if (isNix() && checkForArgumentAndRemoveFromARGV("--update-nix")) { >+ system("perl", "$sourceDir/Tools/Scripts/update-webkitnix-libs") == 0 or die $!; >+ } > > $returnCode = exitStatus(generateBuildSystemFromCMakeProject($port, $prefixPath, @cmakeArgs)); > exit($returnCode) if $returnCode; >@@ -2152,6 +2175,7 @@ sub cmakeBasedPortName() > return "BlackBerry" if isBlackBerry(); > return "Efl" if isEfl(); > return "WinCE" if isWinCE(); >+ return "Nix" if isNix(); > return ""; > } > >diff --git a/Tools/Scripts/webkitpy/common/config/ports.py b/Tools/Scripts/webkitpy/common/config/ports.py >index 0c20dae..c611283 100644 >--- a/Tools/Scripts/webkitpy/common/config/ports.py >+++ b/Tools/Scripts/webkitpy/common/config/ports.py >@@ -70,6 +70,7 @@ class DeprecatedPort(object): > "qt-wk2": QtWK2Port, > "efl": EflPort, > "efl-wk2": EflWK2Port, >+ "nix": NixPort > } > default_port = { > "Windows": WinPort, >@@ -230,3 +231,13 @@ class EflWK2Port(DeprecatedPort): > command.append("--no-webkit1") > command.append(super(EflWK2Port, self).makeArgs()) > return command >+ >+class NixPort(DeprecatedPort): >+ port_flag_name = "nix" >+ >+ def build_webkit_command(self, build_style=None): >+ command = super(NixPort, self).build_webkit_command(build_style=build_style) >+ command.append("--nix") >+ command.append("--update-nix") >+ command.append(super(NixPort, self).makeArgs()) >+ return command >diff --git a/Tools/Scripts/webkitpy/port/factory.py b/Tools/Scripts/webkitpy/port/factory.py >index e9f1465..8039159 100644 >--- a/Tools/Scripts/webkitpy/port/factory.py >+++ b/Tools/Scripts/webkitpy/port/factory.py >@@ -42,6 +42,8 @@ def platform_options(use_globs=False): > optparse.make_option('--efl', action='store_const', dest='platform', > const=('efl*' if use_globs else 'efl'), > help=('Alias for --platform=efl*' if use_globs else 'Alias for --platform=efl')), >+ optparse.make_option('--nix', action='store_const', dest='platform', >+ const=('nix'), help=('Alias for --platform=nix')), > optparse.make_option('--gtk', action='store_const', dest='platform', > const=('gtk*' if use_globs else 'gtk'), > help=('Alias for --platform=gtk*' if use_globs else 'Alias for --platform=gtk')), >@@ -75,6 +77,7 @@ def _builder_options(builder_name): > class PortFactory(object): > PORT_CLASSES = ( > 'efl.EflPort', >+ 'nix.NixPort', > 'gtk.GtkPort', > 'mac.MacPort', > 'mock_drt.MockDRTPort', >diff --git a/Tools/Scripts/webkitpy/port/nix.py b/Tools/Scripts/webkitpy/port/nix.py >new file mode 100644 >index 0000000..35da0c8 >--- /dev/null >+++ b/Tools/Scripts/webkitpy/port/nix.py >@@ -0,0 +1,119 @@ >+# Copyright (C) 2011 ProFUSION Embedded Systems. All rights reserved. >+# Copyright (C) 2011 Samsung Electronics. All rights reserved. >+# Copyright (C) 2012 Intel Corporation >+# Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+# >+# 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. >+# >+# 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. >+ >+"""WebKit Nix implementation of the Port interface.""" >+ >+import os >+ >+from webkitpy.layout_tests.models.test_configuration import TestConfiguration >+from webkitpy.port.base import Port >+from webkitpy.port.pulseaudio_sanitizer import PulseAudioSanitizer >+ >+ >+class NixPort(Port): >+ port_name = 'nix' >+ >+ def _wk2_port_name(self): >+ return 'nix' >+ >+ @classmethod >+ def determine_full_port_name(cls, host, options, port_name): >+ """Determine the port name based on host and options values.""" >+ # Currently the only "port" instance supported by Nix is "nix". Reimplementing >+ # this method avoids changing port name to nix-wk2, which is the default >+ # behavior in base.py. >+ return port_name >+ >+ def __init__(self, *args, **kwargs): >+ super(NixPort, self).__init__(*args, **kwargs) >+ >+ self._jhbuild_wrapper_path = self.path_from_webkit_base('Tools', 'nix', 'run-with-jhbuild') >+ >+ self.set_option_default('wrapper', self._jhbuild_wrapper_path) >+ self.set_option_default('webkit_test_runner', True) >+ self.webprocess_cmd_prefix = self.get_option('webprocess_cmd_prefix') >+ >+ self._pulseaudio_sanitizer = PulseAudioSanitizer() >+ >+ def _port_flag_for_scripts(self): >+ return "--nix" >+ >+ def setup_test_run(self): >+ self._pulseaudio_sanitizer.unload_pulseaudio_module() >+ >+ def setup_environ_for_server(self, server_name=None): >+ env = super(NixPort, self).setup_environ_for_server(server_name) >+ # If DISPLAY environment variable is unset in the system >+ # e.g. on build bot, remove DISPLAY variable from the dictionary >+ if not 'DISPLAY' in os.environ: >+ del env['DISPLAY'] >+ env['TEST_RUNNER_INJECTED_BUNDLE_FILENAME'] = self._build_path('lib', 'libTestRunnerInjectedBundle.so') >+ env['TEST_RUNNER_PLUGIN_PATH'] = self._build_path('lib') >+ if self.webprocess_cmd_prefix: >+ env['WEB_PROCESS_CMD_PREFIX'] = self.webprocess_cmd_prefix >+ >+ return env >+ >+ def default_timeout_ms(self): >+ # Tests run considerably slower under gdb >+ # or valgrind. >+ if self.get_option('webprocess_cmd_prefix'): >+ return 350 * 1000 >+ return super(NixPort, self).default_timeout_ms() >+ >+ def clean_up_test_run(self): >+ super(NixPort, self).clean_up_test_run() >+ self._pulseaudio_sanitizer.restore_pulseaudio_module() >+ >+ def _generate_all_test_configurations(self): >+ return [TestConfiguration(version=self._version, architecture='x86', build_type=build_type) for build_type in self.ALL_BUILD_TYPES] >+ >+ def _path_to_driver(self): >+ return self._build_path('bin', self.driver_name()) >+ >+ def _path_to_image_diff(self): >+ return self._build_path('bin', 'ImageDiff') >+ >+ def _image_diff_command(self, *args, **kwargs): >+ return [self._jhbuild_wrapper_path] + super(NixPort, self)._image_diff_command(*args, **kwargs) >+ >+ def _search_paths(self): >+ return [ self.port_name ] >+ >+ def show_results_html_file(self, results_filename): >+ run_launcher_args = ["file://%s" % results_filename] >+ self._run_script("run-launcher", run_launcher_args) >+ >+ def _port_specific_expectations_files(self): >+ paths = self._search_paths() >+ if self.get_option('webkit_test_runner'): >+ paths.append('wk2') >+ return list(([self._filesystem.join(self._webkit_baseline_path(p), 'TestExpectations') for p in paths])) >+ >+ def default_baseline_search_path(self): >+ return map(self._webkit_baseline_path, ['nix', 'wk2']) >diff --git a/Tools/Scripts/webkitpy/port/nix_unittest.py b/Tools/Scripts/webkitpy/port/nix_unittest.py >new file mode 100644 >index 0000000..a21dfff >--- /dev/null >+++ b/Tools/Scripts/webkitpy/port/nix_unittest.py >@@ -0,0 +1,70 @@ >+# Copyright (C) 2012-2013 Nokia Corporation and/or its subsidiary(-ies). >+# >+# 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 THE COPYRIGHT HOLDERS ``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 HOLDERS 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. >+ >+import unittest >+import os >+from copy import deepcopy >+ >+from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2 >+from webkitpy.common.system.outputcapture import OutputCapture >+from webkitpy.common.system.systemhost_mock import MockSystemHost >+from webkitpy.port import port_testcase >+from webkitpy.port.nix import NixPort >+from webkitpy.tool.mocktool import MockOptions >+ >+ >+class NixPortTest(port_testcase.PortTestCase): >+ port_name = 'nix' >+ port_maker = NixPort >+ search_paths_cases = [ >+ {'search_paths':['nix', 'wk2'], 'os_name':'linux'} >+ ] >+ expectation_files_cases = [ >+ {'search_paths':['', 'nix', 'wk2'], 'os_name':'linux'} >+ ] >+ >+ def _assert_search_path(self, search_paths, os_name): >+ host = MockSystemHost(os_name=os_name) >+ port = self.make_port(port_name=self.port_name, host=host, options=MockOptions(webkit_test_runner=True)) >+ absolute_search_paths = map(port._webkit_baseline_path, search_paths) >+ >+ self.assertEquals(port.baseline_search_path(), absolute_search_paths) >+ >+ def _assert_expectations_files(self, search_paths, os_name): >+ host = MockSystemHost(os_name=os_name) >+ port = self.make_port(port_name=self.port_name, host=host, options=MockOptions(webkit_test_runner=True)) >+ self.assertEquals(port.expectations_files(), search_paths) >+ >+ def test_baseline_search_path(self): >+ for case in self.search_paths_cases: >+ self._assert_search_path(**case) >+ >+ def test_expectations_files(self): >+ for case in self.expectation_files_cases: >+ expectations_case = deepcopy(case) >+ expectations_case['search_paths'] = map(lambda path: '/mock-checkout/LayoutTests/TestExpectations' if not path else '/mock-checkout/LayoutTests/platform/%s/TestExpectations' % (path), expectations_case['search_paths']) >+ self._assert_expectations_files(**expectations_case) >+ >+ def test_default_timeout_ms(self): >+ self.assertEqual(self.make_port(options=MockOptions(configuration='Release')).default_timeout_ms(), 80000) >+ self.assertEqual(self.make_port(options=MockOptions(configuration='Debug')).default_timeout_ms(), 80000) >diff --git a/Tools/jhbuild/jhbuild-wrapper b/Tools/jhbuild/jhbuild-wrapper >index 9d3a87b..a3a755b 100755 >--- a/Tools/jhbuild/jhbuild-wrapper >+++ b/Tools/jhbuild/jhbuild-wrapper >@@ -95,6 +95,8 @@ def determine_platform(): > return "efl"; > if '--gtk' in sys.argv: > return "gtk"; >+ if '--nix' in sys.argv: >+ return "nix"; > raise ValueError('No platform specified for jhbuild-wrapper.') > > >diff --git a/Tools/nix/common.py b/Tools/nix/common.py >new file mode 100644 >index 0000000..ef8357e >--- /dev/null >+++ b/Tools/nix/common.py >@@ -0,0 +1,32 @@ >+#!/usr/bin/env python >+# Copyright (C) 2011 Igalia S.L. >+# Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+# >+# This library is free software; you can redistribute it and/or >+# modify it under the terms of the GNU Lesser 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 >+# Lesser General Public License for more details. >+# >+# You should have received a copy of the GNU Lesser General Public >+# License along with this library; if not, write to the Free Software >+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >+ >+import os >+ >+script_dir = None >+ >+ >+def script_path(*args): >+ global script_dir >+ if not script_dir: >+ script_dir = os.path.join(os.path.dirname(__file__), '..', 'Scripts') >+ return os.path.join(*(script_dir,) + args) >+ >+ >+def top_level_path(*args): >+ return os.path.join(*((script_path('..', '..'),) + args)) >diff --git a/Tools/nix/jhbuild.modules b/Tools/nix/jhbuild.modules >new file mode 100644 >index 0000000..8798c0e >--- /dev/null >+++ b/Tools/nix/jhbuild.modules >@@ -0,0 +1,127 @@ >+<?xml version="1.0"?> >+<!DOCTYPE moduleset SYSTEM "moduleset.dtd"> >+<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?> >+<moduleset> >+ >+ <metamodule id="webkitnix-testing-dependencies"> >+ <dependencies> >+ <dep package="cairo"/> >+ <dep package="fonts"/> >+ <dep package="fontconfig"/> >+ <dep package="freetype6"/> >+ <dep package="harfbuzz"/> >+ <dep package="glib"/> >+ <dep package="glib-networking"/> >+ <dep package="libsoup"/> >+ </dependencies> >+ </metamodule> >+ >+ <repository type="tarball" name="github.com" >+ href="https://github.com"/> >+ <repository type="tarball" name="sourceware.org" >+ href="ftp://sourceware.org"/> >+ <repository type="tarball" name="ftp.gnome.org" >+ href="http://ftp.gnome.org"/> >+ <repository type="git" name="git.gnome.org" >+ href="git://git.gnome.org/"/> >+ <repository type="tarball" name="cairographics.org" >+ href="http://cairographics.org"/> >+ <repository type="tarball" name="freedesktop.org" >+ href="http://www.freedesktop.org"/> >+ >+ <autotools id="cairo" autogen-sh="configure"> >+ <dependencies> >+ <dep package="fontconfig"/> >+ <dep package="pixman"/> >+ </dependencies> >+ <branch module="releases/cairo-1.12.8.tar.xz" version="1.12.8" >+ repo="cairographics.org" >+ hash="sha256:8fbb6fc66117ab4100bad830cb4479497e53c6f3facb98bf05c8d298554ebdd9" >+ md5sum="8b3dcade859c44fb7e56fc68edfe9a45"> >+ </branch> >+ </autotools> >+ >+ <autotools id="pixman" autogen-sh="configure" >+ autogenargs="--enable-gtk=no"> >+ <branch module="snapshots/pixman-0.29.2.tar.gz" version="0.29.2" >+ repo="cairographics.org" >+ hash="sha256:4c4e92143a4557a4617b80caf0a58ccb012d8293741e75389037cd5133b335db" >+ md5sum="8f5795ea98cadd7b7f12e4b373500eef"> >+ </branch> >+ </autotools> >+ >+ <autotools id="fonts" >+ skip-autogen="true"> >+ <branch module="downloads/mrobinson/webkitgtk-test-fonts/webkitgtk-test-fonts-0.0.3.tar.gz" version="0.0.3" >+ repo="github.com" >+ hash="sha256:4a0a01f00855997cdcc7201f164b33a4e4144e8eadf40a5e542a1c448e035de5" >+ md5sum="10e74de1a8ba961d9037994d427b1dd2" size="16981642"> >+ </branch> >+ </autotools> >+ >+ <autotools id="libffi" autogen-sh="configure"> >+ <branch module="/pub/libffi/libffi-3.0.11.tar.gz" version="3.0.11" >+ repo="sourceware.org" >+ hash="sha256:70bfb01356360089aa97d3e71e3edf05d195599fd822e922e50d46a0055a6283" >+ md5sum="f69b9693227d976835b4857b1ba7d0e3"/> >+ </autotools> >+ >+ <tarball id="freetype6"> >+ <source href="download.savannah.gnu.org/releases/freetype/freetype-2.4.2.tar.bz2" version="2.4.2" >+ hash="sha256:9a987aef8c50d9bcfdfdc9f012f8bd0de6095cc1a5524e62c1a037deb8dacbfe" >+ md5sum="647ee8ed266f9a4117c8d0a4855b3d3e" /> >+ </tarball> >+ >+ <autotools id="glib" >+ autogen-sh="configure" >+ autogenargs="--disable-dtrace"> >+ <dependencies> >+ <dep package="libffi"/> >+ </dependencies> >+ <branch module="/pub/GNOME/sources/glib/2.36/glib-2.36.0.tar.xz" version="2.36.0" >+ repo="ftp.gnome.org" >+ hash="sha256:455a8abe8692c5174bcc7ffa15b96a7521a2f2f9fb47594405927c35cb9bb227"/> >+ </autotools> >+ >+ <autotools id="glib-networking"> >+ <dependencies> >+ <dep package="glib"/> >+ </dependencies> >+ <branch module="/pub/GNOME/sources/glib-networking/2.33/glib-networking-2.33.2.tar.xz" version="2.33.2" >+ repo="ftp.gnome.org" >+ hash="sha256:e298cff3935eb752be290bbf734e457f1870bdb5370ee292606e6040a82074e7" >+ md5sum="5abb364f2a0babe2ec1e3a6d59f69043"/> >+ </autotools> >+ >+ <autotools id="libsoup" >+ autogenargs="--without-gnome --disable-introspection"> >+ <dependencies> >+ <dep package="glib-networking"/> >+ </dependencies> >+ <branch module="/pub/GNOME/sources/libsoup/2.42/libsoup-2.42.0.tar.xz" version="2.42.0" >+ repo="ftp.gnome.org" >+ hash="sha256:9e0e7eb5d3f7401ccf521fbc289fc1fa0923b7c7833729e2ed7696f7b848893e" >+ md5sum="a632a38d2983c2a88679672d00940128"/> >+ </autotools> >+ >+ <autotools id="fontconfig" autogen-sh="configure"> >+ <dependencies> >+ <dep package="freetype6"/> >+ </dependencies> >+ <branch module="software/fontconfig/release/fontconfig-2.8.0.tar.gz" version="2.8.0" >+ repo="freedesktop.org" >+ hash="sha256:fa2a1c6eea654d9fce7a4b1220f10c99cdec848dccaf1625c01f076b31382335" >+ md5sum="77e15a92006ddc2adbb06f840d591c0e"> >+ </branch> >+ </autotools> >+ >+ <autotools id="harfbuzz" autogen-sh="configure"> >+ <branch module="software/harfbuzz/release/harfbuzz-0.9.14.tar.bz2" version="0.9.14" >+ checkoutdir="harfbuzz-0.9.14" >+ repo="freedesktop.org" >+ hash="sha256:d07c0ffdbbbfdfbb6c65e73fe9c76466e87dbf04b094cbd0abf5fd7d571a4004" >+ md5sum="7e1990b79060e98e2d31f677a0ac9eed"> >+ </branch> >+ </autotools> >+ >+</moduleset> >diff --git a/Tools/nix/jhbuildrc b/Tools/nix/jhbuildrc >new file mode 100644 >index 0000000..f293926 >--- /dev/null >+++ b/Tools/nix/jhbuildrc >@@ -0,0 +1,71 @@ >+#!/usr/bin/env python >+# Copyright (C) 2011 Igalia S.L. >+# Copyright (C) 2012 Intel Corporation >+# Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+# >+# This library is free software; you can redistribute it and/or >+# modify it under the terms of the GNU Lesser 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 >+# Lesser General Public License for more details. >+# >+# You should have received a copy of the GNU Lesser General Public >+# License along with this library; if not, write to the Free Software >+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >+ >+import multiprocessing >+import sys >+ >+__nix_tools_directory = os.path.abspath(os.path.dirname(__file__)) >+sys.path = [__nix_tools_directory] + sys.path >+import common >+ >+build_policy = 'updated' >+ >+# FIXME: move shared parts into ../jhbuild folder. >+ >+__moduleset_file_uri = 'file://' + os.path.join(__nix_tools_directory, 'jhbuild.modules') >+__extra_modulesets = os.environ.get("WEBKIT_EXTRA_MODULESETS", "").split(",") >+moduleset = [ __moduleset_file_uri, ] >+if __extra_modulesets != ['']: >+ moduleset.extend(__extra_modulesets) >+ >+__extra_modules = os.environ.get("WEBKIT_EXTRA_MODULES", "").split(",") >+modules = [ 'webkitnix-testing-dependencies', ] >+if __extra_modules != ['']: >+ modules.extend(__extra_modules) >+ >+if os.environ.has_key('WEBKITOUTPUTDIR'): >+ checkoutroot = os.path.abspath(os.path.join(os.environ['WEBKITOUTPUTDIR'], 'Dependencies', 'Source')) >+ prefix = os.path.abspath(os.path.join(os.environ['WEBKITOUTPUTDIR'], 'Dependencies', 'Root')) >+else: >+ checkoutroot = os.path.abspath(common.top_level_path('WebKitBuild','Dependencies', 'Source')) >+ prefix = os.path.abspath(common.top_level_path('WebKitBuild','Dependencies', 'Root')) >+ >+nonotify = True >+notrayicon = True >+if 'MAKEFLAGS' not in os.environ: >+ os.environ['MAKEFLAGS'] = '-j%d' % multiprocessing.cpu_count() >+ >+# Use system libraries while building. >+if use_lib64: >+ _libdir = 'lib64' >+else: >+ _libdir = 'lib' >+addpath('PKG_CONFIG_PATH', os.path.join(os.sep, 'usr', _libdir, 'pkgconfig')) >+addpath('PKG_CONFIG_PATH', os.path.join(os.sep, 'usr', 'share', 'pkgconfig')) >+ >+addpath('XDG_DATA_DIRS', '/usr/share') >+addpath('XDG_CONFIG_DIRS', '/etc/xdg') >+ >+# Avoid overlapping search path CMAKE warning on 64bit systems. >+if (use_lib64): >+ addpath('CMAKE_PREFIX_PATH', os.path.join(os.sep, prefix, 'lib64')) >+else: >+ addpath('CMAKE_PREFIX_PATH', prefix) >+ >+partial_build = False >diff --git a/Tools/nix/run-with-jhbuild b/Tools/nix/run-with-jhbuild >new file mode 100755 >index 0000000..859f2e2 >--- /dev/null >+++ b/Tools/nix/run-with-jhbuild >@@ -0,0 +1,26 @@ >+#!/usr/bin/env python >+# Copyright (C) 2011 Igalia S.L. >+# Copyright (C) 2012 Intel Corporation >+# Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies). >+# >+# This library is free software; you can redistribute it and/or >+# modify it under the terms of the GNU Lesser 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 >+# Lesser General Public License for more details. >+# >+# You should have received a copy of the GNU Lesser General Public >+# License along with this library; if not, write to the Free Software >+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA >+ >+import common >+import os >+import sys >+ >+ >+jhbuild_wrapper = common.top_level_path('Tools', 'jhbuild', 'jhbuild-wrapper') >+os.execve(jhbuild_wrapper, [jhbuild_wrapper, '--nix', 'run'] + sys.argv[1:], os.environ)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 117658
: 205427