[EFL] Platform support for WebSpeech feature.
authork.czech@samsung.com <k.czech@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jun 2014 12:13:34 +0000 (12:13 +0000)
committerk.czech@samsung.com <k.czech@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Jun 2014 12:13:34 +0000 (12:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=116438

Reviewed by Csaba Osztrogonác.

.:
Add ENABLE_SPEECH_SYNTHESIS flag to have Speech Synthesis in EFL.

* Source/cmake/OptionsEfl.cmake:
* Source/cmake/WebKitFeatures.cmake:

Source/WebCore:
It's a first step of adding support for Speech Synthesis in EFL port.
Just stub out required API and support for compilation.

* CMakeLists.txt:
* PlatformEfl.cmake:
* PlatformGTK.cmake: Added some idls to not break GTK build.
* platform/PlatformSpeechSynthesizer.h:
* platform/efl/PlatformSpeechSynthesisProviderEfl.cpp: Added.
(WebCore::PlatformSpeechSynthesisProviderEfl::PlatformSpeechSynthesisProviderEfl):
(WebCore::PlatformSpeechSynthesisProviderEfl::~PlatformSpeechSynthesisProviderEfl):
(WebCore::PlatformSpeechSynthesisProviderEfl::initializeVoiceList):
(WebCore::PlatformSpeechSynthesisProviderEfl::pause):
(WebCore::PlatformSpeechSynthesisProviderEfl::resume):
(WebCore::PlatformSpeechSynthesisProviderEfl::speak):
(WebCore::PlatformSpeechSynthesisProviderEfl::cancel):
* platform/efl/PlatformSpeechSynthesisProviderEfl.h: Added.
* platform/efl/PlatformSpeechSynthesizerEfl.cpp: Added.
(WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
(WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer):
(WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
(WebCore::PlatformSpeechSynthesizer::pause):
(WebCore::PlatformSpeechSynthesizer::resume):
(WebCore::PlatformSpeechSynthesizer::speak):
(WebCore::PlatformSpeechSynthesizer::cancel):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@170288 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/PlatformEfl.cmake
Source/WebCore/PlatformGTK.cmake
Source/WebCore/platform/PlatformSpeechSynthesizer.h
Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.cpp [new file with mode: 0644]
Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.h [new file with mode: 0644]
Source/WebCore/platform/efl/PlatformSpeechSynthesizerEfl.cpp [new file with mode: 0644]
Source/cmake/OptionsEfl.cmake
Source/cmake/WebKitFeatures.cmake

index c2d1e06..80cf3f0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2014-06-23  Krzysztof Czech  <k.czech@samsung.com>
+
+        [EFL] Platform support for WebSpeech feature.
+        https://bugs.webkit.org/show_bug.cgi?id=116438
+
+        Reviewed by Csaba Osztrogonác.
+
+        Add ENABLE_SPEECH_SYNTHESIS flag to have Speech Synthesis in EFL.
+
+        * Source/cmake/OptionsEfl.cmake:
+        * Source/cmake/WebKitFeatures.cmake:
+
 2014-06-23  Philippe Normand  <pnormand@igalia.com>
 
         Unreviewed, GTK build fix after r170266.
index 2b4866d..d580fdd 100644 (file)
@@ -16,6 +16,7 @@ set(WebCore_INCLUDE_DIRECTORIES
     "${WEBCORE_DIR}/Modules/plugins"
     "${WEBCORE_DIR}/Modules/proximity"
     "${WEBCORE_DIR}/Modules/quota"
+    "${WEBCORE_DIR}/Modules/speech"
     "${WEBCORE_DIR}/Modules/vibration"
     "${WEBCORE_DIR}/Modules/webaudio"
     "${WEBCORE_DIR}/Modules/webdatabase"
@@ -247,6 +248,12 @@ set(WebCore_IDL_FILES
 
     Modules/proximity/DeviceProximityEvent.idl
 
+    Modules/speech/DOMWindowSpeechSynthesis.idl
+    Modules/speech/SpeechSynthesis.idl
+    Modules/speech/SpeechSynthesisEvent.idl
+    Modules/speech/SpeechSynthesisUtterance.idl
+    Modules/speech/SpeechSynthesisVoice.idl
+
     Modules/vibration/NavigatorVibration.idl
 
     Modules/webaudio/AnalyserNode.idl
@@ -881,6 +888,12 @@ set(WebCore_SOURCES
     Modules/proximity/DeviceProximityController.cpp
     Modules/proximity/DeviceProximityEvent.cpp
 
+    Modules/speech/DOMWindowSpeechSynthesis.cpp
+    Modules/speech/SpeechSynthesis.cpp
+    Modules/speech/SpeechSynthesisEvent.cpp
+    Modules/speech/SpeechSynthesisUtterance.cpp
+    Modules/speech/SpeechSynthesisVoice.cpp
+
     Modules/vibration/NavigatorVibration.cpp
     Modules/vibration/Vibration.cpp
 
@@ -1972,6 +1985,9 @@ set(WebCore_SOURCES
     platform/MemoryPressureHandler.cpp
     platform/NotImplemented.cpp
     platform/PlatformEvent.cpp
+    platform/PlatformSpeechSynthesisUtterance.cpp
+    platform/PlatformSpeechSynthesisVoice.cpp
+    platform/PlatformSpeechSynthesizer.cpp
     platform/PlatformStrategies.cpp
     platform/RemoteCommandListener.cpp
     platform/SystemSleepListener.cpp
index bcd9621..e4a6fa3 100644 (file)
@@ -1,3 +1,35 @@
+2014-06-23  Krzysztof Czech  <k.czech@samsung.com>
+
+        [EFL] Platform support for WebSpeech feature.
+        https://bugs.webkit.org/show_bug.cgi?id=116438
+
+        Reviewed by Csaba Osztrogonác.
+
+        It's a first step of adding support for Speech Synthesis in EFL port.
+        Just stub out required API and support for compilation.
+
+        * CMakeLists.txt:
+        * PlatformEfl.cmake:
+        * PlatformGTK.cmake: Added some idls to not break GTK build.
+        * platform/PlatformSpeechSynthesizer.h:
+        * platform/efl/PlatformSpeechSynthesisProviderEfl.cpp: Added.
+        (WebCore::PlatformSpeechSynthesisProviderEfl::PlatformSpeechSynthesisProviderEfl):
+        (WebCore::PlatformSpeechSynthesisProviderEfl::~PlatformSpeechSynthesisProviderEfl):
+        (WebCore::PlatformSpeechSynthesisProviderEfl::initializeVoiceList):
+        (WebCore::PlatformSpeechSynthesisProviderEfl::pause):
+        (WebCore::PlatformSpeechSynthesisProviderEfl::resume):
+        (WebCore::PlatformSpeechSynthesisProviderEfl::speak):
+        (WebCore::PlatformSpeechSynthesisProviderEfl::cancel):
+        * platform/efl/PlatformSpeechSynthesisProviderEfl.h: Added.
+        * platform/efl/PlatformSpeechSynthesizerEfl.cpp: Added.
+        (WebCore::PlatformSpeechSynthesizer::PlatformSpeechSynthesizer):
+        (WebCore::PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer):
+        (WebCore::PlatformSpeechSynthesizer::initializeVoiceList):
+        (WebCore::PlatformSpeechSynthesizer::pause):
+        (WebCore::PlatformSpeechSynthesizer::resume):
+        (WebCore::PlatformSpeechSynthesizer::speak):
+        (WebCore::PlatformSpeechSynthesizer::cancel):
+
 2014-06-23  Jeongeun Kim  <je_julie.kim@samsung.com>
 
         Make it clear to get m_svgExtensions using svgExtensions().
index 9b4a7df..675b1d1 100644 (file)
@@ -437,3 +437,10 @@ if (ENABLE_ACCESSIBILITY)
         ${ATK_LIBRARIES}
     )
 endif ()
+
+if (ENABLE_SPEECH_SYNTHESIS)
+    list(APPEND WebCore_SOURCES
+        platform/efl/PlatformSpeechSynthesizerEfl.cpp
+        platform/efl/PlatformSpeechSynthesisProviderEfl.cpp
+    )
+endif ()
index 2d152c9..9d4f01c 100644 (file)
@@ -564,6 +564,12 @@ list(APPEND GObjectDOMBindingsUnstable_IDL_FILES
     Modules/quota/StorageInfo.idl
     Modules/quota/StorageQuota.idl
 
+    Modules/speech/DOMWindowSpeechSynthesis.idl
+    Modules/speech/SpeechSynthesis.idl
+    Modules/speech/SpeechSynthesisEvent.idl
+    Modules/speech/SpeechSynthesisUtterance.idl
+    Modules/speech/SpeechSynthesisVoice.idl
+
     Modules/webdatabase/Database.idl
 
     css/DOMWindowCSS.idl
index 3c1d860..0b49fd4 100644 (file)
 OBJC_CLASS WebSpeechSynthesisWrapper;
 #endif
 
+#if PLATFORM(EFL)
+namespace WebCore {
+class PlatformSpeechSynthesisProviderEfl;
+}
+#endif
+
 namespace WebCore {
 
 enum SpeechBoundary {
@@ -86,6 +92,9 @@ private:
 #if PLATFORM(COCOA)
     RetainPtr<WebSpeechSynthesisWrapper> m_platformSpeechWrapper;
 #endif
+#if PLATFORM(EFL)
+    std::unique_ptr<PlatformSpeechSynthesisProviderEfl> m_platformSpeechWrapper;
+#endif
 };
     
 } // namespace WebCore
diff --git a/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.cpp b/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.cpp
new file mode 100644 (file)
index 0000000..d1a66e7
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ *
+ * 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 HOLDER 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 "PlatformSpeechSynthesisProviderEfl.h"
+
+#if ENABLE(SPEECH_SYNTHESIS)
+
+#include <NotImplemented.h>
+#include <PlatformSpeechSynthesisUtterance.h>
+#include <PlatformSpeechSynthesisVoice.h>
+#include <PlatformSpeechSynthesizer.h>
+
+namespace WebCore {
+
+PlatformSpeechSynthesisProviderEfl::PlatformSpeechSynthesisProviderEfl(PlatformSpeechSynthesizer* platformSpeechSynthesizer)
+    : m_platformSpeechSynthesizer(platformSpeechSynthesizer)
+{
+}
+
+PlatformSpeechSynthesisProviderEfl::~PlatformSpeechSynthesisProviderEfl()
+{
+}
+
+void PlatformSpeechSynthesisProviderEfl::initializeVoiceList(Vector<RefPtr<PlatformSpeechSynthesisVoice>>& voiceList)
+{
+    UNUSED_PARAM(voiceList);
+    notImplemented();
+}
+
+void PlatformSpeechSynthesisProviderEfl::pause()
+{
+    notImplemented();
+}
+
+void PlatformSpeechSynthesisProviderEfl::resume()
+{
+    notImplemented();
+}
+
+void PlatformSpeechSynthesisProviderEfl::speak(PassRefPtr<PlatformSpeechSynthesisUtterance> utterance)
+{
+    UNUSED_PARAM(utterance);
+    notImplemented();
+}
+
+void PlatformSpeechSynthesisProviderEfl::cancel()
+{
+    notImplemented();
+}
+
+} // namespace WebCore
+
+#endif
diff --git a/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.h b/Source/WebCore/platform/efl/PlatformSpeechSynthesisProviderEfl.h
new file mode 100644 (file)
index 0000000..318f6d8
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ *
+ * 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 HOLDER 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 PlatformSpeechSynthesisProviderEfl_h
+#define PlatformSpeechSynthesisProviderEfl_h
+
+#if ENABLE(SPEECH_SYNTHESIS)
+
+#include <wtf/PassRefPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class PlatformSpeechSynthesizer;
+class PlatformSpeechSynthesisUtterance;
+class PlatformSpeechSynthesisVoice;
+
+class PlatformSpeechSynthesisProviderEfl {
+public:
+    explicit PlatformSpeechSynthesisProviderEfl(PlatformSpeechSynthesizer*);
+    ~PlatformSpeechSynthesisProviderEfl();
+
+    void initializeVoiceList(Vector<RefPtr<PlatformSpeechSynthesisVoice>>&);
+    void pause();
+    void resume();
+    void speak(PassRefPtr<PlatformSpeechSynthesisUtterance>);
+    void cancel();
+private:
+    PlatformSpeechSynthesizer* m_platformSpeechSynthesizer;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(SPEECH_SYNTHESIS)
+
+#endif // PlatformSpeechSynthesisProviderEfl_h
diff --git a/Source/WebCore/platform/efl/PlatformSpeechSynthesizerEfl.cpp b/Source/WebCore/platform/efl/PlatformSpeechSynthesizerEfl.cpp
new file mode 100644 (file)
index 0000000..c6bade1
--- /dev/null
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2014 Samsung Electronics
+ *
+ * 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 HOLDER 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 "PlatformSpeechSynthesizer.h"
+
+#if ENABLE(SPEECH_SYNTHESIS)
+
+#include <PlatformSpeechSynthesisProviderEfl.h>
+#include <PlatformSpeechSynthesisUtterance.h>
+#include <PlatformSpeechSynthesisVoice.h>
+
+namespace WebCore {
+
+PlatformSpeechSynthesizer::PlatformSpeechSynthesizer(PlatformSpeechSynthesizerClient* client)
+    : m_voiceListIsInitialized(false)
+    , m_speechSynthesizerClient(client)
+    , m_platformSpeechWrapper(std::make_unique<PlatformSpeechSynthesisProviderEfl>(this))
+
+{
+}
+
+PlatformSpeechSynthesizer::~PlatformSpeechSynthesizer()
+{
+}
+
+void PlatformSpeechSynthesizer::initializeVoiceList()
+{
+    m_platformSpeechWrapper->initializeVoiceList(m_voiceList);
+}
+
+void PlatformSpeechSynthesizer::pause()
+{
+    m_platformSpeechWrapper->pause();
+}
+
+void PlatformSpeechSynthesizer::resume()
+{
+    m_platformSpeechWrapper->resume();
+}
+
+void PlatformSpeechSynthesizer::speak(PassRefPtr<PlatformSpeechSynthesisUtterance> utterance)
+{
+    m_platformSpeechWrapper->speak(utterance);
+}
+
+void PlatformSpeechSynthesizer::cancel()
+{
+    m_platformSpeechWrapper->cancel();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(SPEECH_SYNTHESIS)
index ccad931..aa72226 100644 (file)
@@ -85,6 +85,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_RESOLUTION_MEDIA_QUERY ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_REQUEST_ANIMATION_FRAME ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SECCOMP_FILTERS OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SHARED_WORKERS ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPEECH_SYNTHESIS OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SPELLCHECK ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TEMPLATE_ELEMENT ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS ON)
@@ -285,6 +286,10 @@ else ()
     add_definitions(-DHAVE_ACCESSIBILITY=0)
 endif ()
 
+if (ENABLE_SPEECH_SYNTHESIS)
+    add_definitions(-DENABLE_SPEECH_SYNTHESIS=1)
+endif ()
+
 if (ENABLE_FTL_JIT)
     find_package(LLVM REQUIRED)
     find_package(LIBCXXABI REQUIRED)
index 8ceecae..fa50485 100644 (file)
@@ -102,6 +102,7 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_SCRIPTED_SPEECH "Toggle Scripted Speech API support" OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_SECCOMP_FILTERS "Toggle Linux seccomp filters for the WebProcess support" OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_SHARED_WORKERS "Toggle SharedWorkers support" OFF)
+    WEBKIT_OPTION_DEFINE(ENABLE_SPEECH_SYNTHESIS "Toggle Speech Synthesis API support)" OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_SPELLCHECK "Toggle Spellchecking support (requires Enchant)" OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_SQL_DATABASE "Toggle SQL Database Support" ON)
     WEBKIT_OPTION_DEFINE(ENABLE_SVG_FONTS "Toggle SVG fonts support (imples SVG support)" ON)