WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
changed ewk_text_checker_setting to ewk_text_checker_settings (plural)
spelling-implementation-wk2-efl.patch (text/plain), 61.21 KB, created by
Grzegorz Czajkowski
on 2012-09-24 07:08:14 PDT
(
hide
)
Description:
changed ewk_text_checker_setting to ewk_text_checker_settings (plural)
Filename:
MIME Type:
Creator:
Grzegorz Czajkowski
Created:
2012-09-24 07:08:14 PDT
Size:
61.21 KB
patch
obsolete
>diff --git a/ChangeLog b/ChangeLog >index 431f632..b0afe76 100644 >--- a/ChangeLog >+++ b/ChangeLog >@@ -1,3 +1,15 @@ >+2012-09-24 Grzegorz Czajkowski <g.czajkowski@samsung.com>, Michal Roj <m.roj@sasmung.com> >+ >+ [WK2][EFL] Implementation of spellchecking feature. >+ https://bugs.webkit.org/show_bug.cgi?id=91854 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Enable spellchecking feature for WK2-Efl. >+ >+ * Source/cmake/FindEnchant.cmake: Added. >+ * Source/cmake/OptionsEfl.cmake: Define SPELLCHECK macro. >+ > 2012-09-24 Vivek Galatage <vivekgalatage@gmail.com> > > Web Inspector: implement testing harness for pure protocol tests. >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 33db5ef..cb805d1 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,13 @@ >+2012-09-24 Grzegorz Czajkowski <g.czajkowski@samsung.com>, Michal Roj <m.roj@samsung.com> >+ >+ [WK2][EFL] Implementation of spellchecking feature. >+ https://bugs.webkit.org/show_bug.cgi?id=91854 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * PlatformEfl.cmake: >+ Add enchant-related compiler flags: header paths and the library flag. >+ > 2012-09-24 Pavel Feldman <pfeldman@chromium.org> > > Web Inspector:EXC_BAD_ACCESS upon closing page with node highlighted >diff --git a/Source/WebCore/PlatformEfl.cmake b/Source/WebCore/PlatformEfl.cmake >index 70d68d7..4de4894 100644 >--- a/Source/WebCore/PlatformEfl.cmake >+++ b/Source/WebCore/PlatformEfl.cmake >@@ -82,6 +82,7 @@ LIST(APPEND WebCore_SOURCES > platform/PlatformStrategies.cpp > platform/posix/FileSystemPOSIX.cpp > platform/text/efl/TextBreakIteratorInternalICUEfl.cpp >+ platform/text/enchant/TextCheckerEnchant.cpp > ) > > IF (ENABLE_BATTERY_STATUS) >@@ -329,3 +330,11 @@ IF (ENABLE_WEB_AUDIO) > ADD_DEFINITIONS(-DUNINSTALLED_AUDIO_RESOURCES_DIR="${WEBCORE_DIR}/platform/audio/resources") > ENDIF () > >+IF (ENABLE_SPELLCHECK) >+ LIST(APPEND WebCore_INCLUDE_DIRECTORIES >+ ${ENCHANT_INCLUDE_DIRS} >+ ) >+ LIST(APPEND WebCore_LIBRARIES >+ ${ENCHANT_LIBRARIES} >+ ) >+ENDIF() >diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog >index 3bc85dc..8c3a98e 100644 >--- a/Source/WebKit2/ChangeLog >+++ b/Source/WebKit2/ChangeLog >@@ -1,3 +1,121 @@ >+2012-09-24 Grzegorz Czajkowski <g.czajkowski@samsung.com>, Michal Roj <m.roj@samsung.com> >+ >+ Implementation of spellchecking feature. >+ https://bugs.webkit.org/show_bug.cgi?id=91854 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add spelling implementation for WebKit2-EFL that is based on Enchant library. >+ >+ Additionally the patch provides API to overwrite the default WebKit spellchecker implementation >+ as Enchant library doesn't ensure grammar checking. >+ Application is able to overwrite it (both grammar and spell checking) by defining >+ its own implementation and setting appropriate callback functions. >+ >+ * PlatformEfl.cmake: >+ Add enchant-related compiler flags: header paths and the library flag. >+ >+ * UIProcess/API/efl/EWebKit2.h: >+ Add files that contain the API to the main WebKit2-EFL's header to be available for applications. >+ >+ * UIProcess/API/efl/WebKitTextChecker.cpp: Added. >+ Implement callbacks functions of WKTextChecker. >+ >+ (WebKit): >+ (WebKit::isContinuousSpellCheckingAllowed): >+ (WebKit::isContinuousSpellCheckingEnabled): >+ (WebKit::setContinuousSpellCheckingEnabled): >+ (WebKit::isGrammarCheckingEnabled): >+ (WebKit::setGrammarCheckingEnabled): >+ (WebKit::uniqueSpellDocumentTag): >+ (WebKit::closeSpellDocumentWithTag): >+ (WebKit::checkSpellingOfString): >+ (WebKit::checkGrammarOfString): >+ (WebKit::spellingUIIsShowing): >+ (WebKit::toggleSpellingUIIsShowing): >+ (WebKit::updateSpellingUIWithMisspelledWord): >+ (WebKit::updateSpellingUIWithGrammarString): >+ (WebKit::guessesForWord): >+ (WebKit::learnWord): >+ (WebKit::ignoreWord): >+ Those methods are directly given as callback functions for WKTextChecker's client. >+ They choose between WebKit's spelling implementation and client's ones. >+ >+ (WebKit::availableSpellCheckingLanguages): >+ (WebKit::updateSpellCheckingLanguages): >+ (WebKit::loadedSpellCheckingLanguages): >+ They are used by ewk_text_checker_settings.cpp file and allow to do not >+ expose 'm_textCheckerEnchant'. >+ >+ * UIProcess/API/efl/WebKitTextChecker.h: Added. >+ Define the functions which chooses between client's implementation of spelling and the WebKit one. >+ >+ (WebKit): >+ * UIProcess/API/efl/ewk_context.cpp: >+ (_Ewk_Context::_Ewk_Context): >+ Initialize spellchecker feature. >+ >+ * UIProcess/API/efl/ewk_text_checker.cpp: Added. >+ (ewkTextChecker): >+ Get the client's callback functions. >+ >+ * UIProcess/API/efl/ewk_text_checker.h: Added. >+ Define API to set the client's own spelling implementation. >+ >+ * UIProcess/API/efl/ewk_text_checker_private.h: Added. >+ (_Ewk_Text_Checker): >+ Define struct with client's callbacks responisble for spelling. >+ >+ * UIProcess/API/efl/ewk_text_checker_settings.cpp: Added. >+ (idlerGrammarCheckingChanged): >+ (idlerSpellCheckingLanguagesSet): >+ The application is notified about spelling settings change (they may be changed >+ through context menu option) on idler to do not block WebKit. >+ >+ (spellCheckingLanguagesSet): >+ The dictionaries are requested on idler to do not block WebKit. >+ >+ (ewk_text_checker_settings_continuous_spell_checking_changed_cb_set): >+ (ewk_text_checker_settings_grammar_checking_changed_cb_set): >+ Set the callback functions used to notify the client when the spelling settings >+ were changed by WebKit. >+ >+ (ewk_text_checker_settings_enable_continuous_spell_checking_get): >+ (ewk_text_checker_settings_enable_continuous_spell_checking_set): >+ API to set/get the continuous spell checking. >+ >+ (ewk_text_checker_settings_enable_grammar_checking_get): >+ (ewk_text_checker_settings_enable_grammar_checking_set): >+ API to set/get the grammar checking. >+ >+ (ewk_text_checker_settings_available_spell_checking_languages_get): >+ (ewk_text_checker_settings_spell_checking_languages_set): >+ (ewk_text_checker_settings_spell_checking_languages_get): >+ API to set/get languages to use by WebKit implementation based on Enchant library. >+ >+ * UIProcess/API/efl/ewk_text_checker_settings.h: Added. >+ Add API for manipulating spell checker feature. >+ >+ * UIProcess/efl/TextCheckerEfl.cpp: >+ (WebKit::TextChecker::state): >+ (WebKit::TextChecker::isContinuousSpellCheckingAllowed): >+ (WebKit::TextChecker::setContinuousSpellCheckingEnabled): >+ (WebKit::TextChecker::setGrammarCheckingEnabled): >+ (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged): >+ (WebKit::TextChecker::grammarCheckingEnabledStateChanged): >+ (WebKit::TextChecker::uniqueSpellDocumentTag): >+ (WebKit::TextChecker::closeSpellDocumentWithTag): >+ (WebKit::TextChecker::checkSpellingOfString): >+ (WebKit::TextChecker::checkGrammarOfString): Remove WebCore namaspace as it's already defined for the whole file. >+ (WebKit::TextChecker::spellingUIIsShowing): >+ (WebKit::TextChecker::toggleSpellingUIIsShowing): >+ (WebKit::TextChecker::updateSpellingUIWithMisspelledWord): >+ (WebKit::TextChecker::updateSpellingUIWithGrammarString): >+ (WebKit::TextChecker::getGuessesForWord): >+ (WebKit::TextChecker::learnWord): >+ (WebKit::TextChecker::ignoreWord): >+ Those call WKTextChecker client methods. >+ > 2012-09-24 Byungwoo Lee <bw80.lee@samsung.com> > > [EFL][WK2] Change the install path for libewk2UnitTestInjectedBundleSample.so. >diff --git a/Source/WebKit2/PlatformEfl.cmake b/Source/WebKit2/PlatformEfl.cmake >index e772e38..31f8850 100644 >--- a/Source/WebKit2/PlatformEfl.cmake >+++ b/Source/WebKit2/PlatformEfl.cmake >@@ -40,6 +40,7 @@ LIST(APPEND WebKit2_SOURCES > UIProcess/API/efl/NetworkInfoProvider.cpp > UIProcess/API/efl/PageClientImpl.cpp > UIProcess/API/efl/VibrationProvider.cpp >+ UIProcess/API/efl/WebKitTextChecker.cpp > UIProcess/API/efl/ewk_back_forward_list.cpp > UIProcess/API/efl/ewk_back_forward_list_item.cpp > UIProcess/API/efl/ewk_context.cpp >@@ -54,6 +55,8 @@ LIST(APPEND WebKit2_SOURCES > UIProcess/API/efl/ewk_navigation_policy_decision.cpp > UIProcess/API/efl/ewk_popup_menu_item.cpp > UIProcess/API/efl/ewk_settings.cpp >+ UIProcess/API/efl/ewk_text_checker.cpp >+ UIProcess/API/efl/ewk_text_checker_settings.cpp > UIProcess/API/efl/ewk_url_request.cpp > UIProcess/API/efl/ewk_url_response.cpp > UIProcess/API/efl/ewk_url_scheme_request.cpp >@@ -121,6 +124,7 @@ LIST(APPEND WebKit2_INCLUDE_DIRECTORIES > "${WEBCORE_DIR}/platform/efl" > "${WEBCORE_DIR}/platform/graphics/cairo" > "${WEBCORE_DIR}/platform/network/soup" >+ "${WEBCORE_DIR}/platform/text/enchant" > "${WEBCORE_DIR}/svg/graphics" > "${WEBKIT2_DIR}/Shared/efl" > "${WEBKIT2_DIR}/Shared/soup" >@@ -224,6 +228,8 @@ SET (EWebKit2_HEADERS > "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_popup_menu_item.h" > "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_settings.h" > "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_touch.h" >+ "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_text_checker.h" >+ "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_text_checker_settings.h" > "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_url_request.h" > "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_url_response.h" > "${CMAKE_CURRENT_SOURCE_DIR}/UIProcess/API/efl/ewk_url_scheme_request.h" >@@ -327,3 +333,12 @@ IF (ENABLE_INSPECTOR) > PATTERN "*.gif" > PATTERN "*.png") > ENDIF () >+ >+IF (ENABLE_SPELLCHECK) >+ LIST(APPEND WebKit2_INCLUDE_DIRECTORIES >+ ${ENCHANT_INCLUDE_DIRS} >+ ) >+ LIST(APPEND WebKit2_LIBRARIES >+ ${ENCHANT_LIBRARIES} >+ ) >+ENDIF() >diff --git a/Source/WebKit2/UIProcess/API/efl/EWebKit2.h b/Source/WebKit2/UIProcess/API/efl/EWebKit2.h >index 13efab1..f876e22 100644 >--- a/Source/WebKit2/UIProcess/API/efl/EWebKit2.h >+++ b/Source/WebKit2/UIProcess/API/efl/EWebKit2.h >@@ -41,6 +41,8 @@ > #include "ewk_popup_menu_item.h" > #include "ewk_settings.h" > #include "ewk_touch.h" >+#include "ewk_text_checker.h" >+#include "ewk_text_checker_settings.h" > #include "ewk_url_request.h" > #include "ewk_url_response.h" > #include "ewk_url_scheme_request.h" >diff --git a/Source/WebKit2/UIProcess/API/efl/WebKitTextChecker.cpp b/Source/WebKit2/UIProcess/API/efl/WebKitTextChecker.cpp >new file mode 100644 >index 0000000..ca7b434 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/WebKitTextChecker.cpp >@@ -0,0 +1,188 @@ >+/* >+ * Copyright (C) 2012 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 "WebKitTextChecker.h" >+ >+#if ENABLE(SPELLCHECK) >+ >+#include "NotImplemented.h" >+#include "WKAPICast.h" >+#include "WKMutableArray.h" >+#include "WKRetainPtr.h" >+#include "WebPageProxy.h" >+#include "WebString.h" >+#include "ewk_text_checker_private.h" >+#include "ewk_text_checker_settings.h" >+#include <Eina.h> >+#include <wtf/OwnPtr.h> >+#include <wtf/text/CString.h> >+ >+namespace WebKit { >+ >+static OwnPtr<WebCore::TextCheckerEnchant> textCheckerEnchant = WebCore::TextCheckerEnchant::create(); >+static Ewk_Text_Checker* ewkTextCheckerCallback = ewkTextChecker(); >+ >+bool isContinuousSpellCheckingAllowed(const void*) >+{ >+ notImplemented(); >+ // This method is not called by WebKit2/WebCore. Just keep it for API compatibility. >+ return false; >+} >+ >+bool isContinuousSpellCheckingEnabled(const void*) >+{ >+ return ewk_text_checker_settings_enable_continuous_spell_checking_get(); >+} >+ >+void setContinuousSpellCheckingEnabled(bool enabled, const void*) >+{ >+ ewk_text_checker_settings_enable_continuous_spell_checking_set(enabled); >+} >+ >+bool isGrammarCheckingEnabled(const void*) >+{ >+ return ewk_text_checker_settings_enable_grammar_checking_get(); >+} >+ >+void setGrammarCheckingEnabled(bool enabled, const void*) >+{ >+ ewk_text_checker_settings_enable_grammar_checking_set(enabled); >+} >+ >+uint64_t uniqueSpellDocumentTag(WKPageRef page, const void*) >+{ >+ if (ewkTextCheckerCallback->unique_spell_document_tag_get) >+ return ewkTextCheckerCallback->unique_spell_document_tag_get(toImpl(page)->viewWidget()); >+ >+ return 0; >+} >+ >+void closeSpellDocumentWithTag(uint64_t tag, const void*) >+{ >+ if (ewkTextCheckerCallback->unique_spell_document_tag_close) >+ ewkTextCheckerCallback->unique_spell_document_tag_close(tag); >+} >+ >+void checkSpellingOfString(uint64_t tag, WKStringRef text, int32_t* misspellingLocation, int32_t* misspellingLength, const void*) >+{ >+ if (ewkTextCheckerCallback->string_spelling_check) >+ ewkTextCheckerCallback->string_spelling_check(tag, toImpl(text)->string().utf8().data(), misspellingLocation, misspellingLength); >+ else >+ textCheckerEnchant->checkSpellingOfString(toImpl(text)->string(), *misspellingLocation, *misspellingLength); >+} >+ >+void checkGrammarOfString(uint64_t, WKStringRef, WKArrayRef*, int32_t*, int32_t*, const void*) >+{ >+ // FIXME: call client's function. >+ notImplemented(); >+} >+ >+bool spellingUIIsShowing(const void*) >+{ >+ if (ewkTextCheckerCallback->ui_spelling_status_get) >+ return ewkTextCheckerCallback->ui_spelling_status_get(); >+ >+ return false; >+} >+ >+void toggleSpellingUIIsShowing(const void*) >+{ >+ if (ewkTextCheckerCallback->ui_spelling_status_toggle) >+ ewkTextCheckerCallback->ui_spelling_status_toggle(); >+} >+ >+void updateSpellingUIWithMisspelledWord(uint64_t tag, WKStringRef misspelledWord, const void*) >+{ >+ if (ewkTextCheckerCallback->ui_spelling_misspelled_word_update) >+ ewkTextCheckerCallback->ui_spelling_misspelled_word_update(tag, toImpl(misspelledWord)->string().utf8().data()); >+} >+ >+void updateSpellingUIWithGrammarString(uint64_t, WKStringRef, WKGrammarDetailRef, const void*) >+{ >+ // FIXME: call client's function. >+ notImplemented(); >+} >+ >+WKArrayRef guessesForWord(uint64_t tag, WKStringRef word, const void*) >+{ >+ WKMutableArrayRef suggestionsForWord = WKMutableArrayCreate(); >+ >+ if (ewkTextCheckerCallback->word_guesses_get) { >+ Eina_List* list = ewkTextCheckerCallback->word_guesses_get(tag, toImpl(word)->string().utf8().data()); >+ void* item; >+ >+ EINA_LIST_FREE(list, item) { >+ WKRetainPtr<WKStringRef> suggestion(AdoptWK, WKStringCreateWithUTF8CString(static_cast<char*>(item))); >+ WKArrayAppendItem(suggestionsForWord, suggestion.get()); >+ free(item); >+ } >+ >+ } else { >+ Vector<String> guesses = textCheckerEnchant->getGuessesForWord(toImpl(word)->string()); >+ size_t numberOfGuesses = guesses.size(); >+ for (size_t i = 0; i < numberOfGuesses; ++i) { >+ WKRetainPtr<WKStringRef> suggestion(AdoptWK, WKStringCreateWithUTF8CString(guesses[i].utf8().data())); >+ WKArrayAppendItem(suggestionsForWord, suggestion.get()); >+ } >+ } >+ >+ return suggestionsForWord; >+} >+ >+void learnWord(uint64_t tag, WKStringRef word, const void*) >+{ >+ if (ewkTextCheckerCallback->word_learn) >+ ewkTextCheckerCallback->word_learn(tag, toImpl(word)->string().utf8().data()); >+ else >+ textCheckerEnchant->learnWord(toImpl(word)->string()); >+} >+ >+void ignoreWord(uint64_t tag, WKStringRef word, const void*) >+{ >+ if (ewkTextCheckerCallback->word_ignore) >+ ewkTextCheckerCallback->word_ignore(tag, toImpl(word)->string().utf8().data()); >+ else >+ textCheckerEnchant->ignoreWord(toImpl(word)->string()); >+} >+ >+Vector<String> availableSpellCheckingLanguages() >+{ >+ return textCheckerEnchant->availableSpellCheckingLanguages(); >+} >+ >+void updateSpellCheckingLanguages(const Vector<String>& languages) >+{ >+ textCheckerEnchant->updateSpellCheckingLanguages(languages); >+} >+ >+Vector<String> loadedSpellCheckingLanguages() >+{ >+ return textCheckerEnchant->loadedSpellCheckingLanguages(); >+} >+ >+} // namespace WebKit >+ >+#endif // ENABLE(SPELLCHECK) >diff --git a/Source/WebKit2/UIProcess/API/efl/WebKitTextChecker.h b/Source/WebKit2/UIProcess/API/efl/WebKitTextChecker.h >new file mode 100644 >index 0000000..0874d2d >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/WebKitTextChecker.h >@@ -0,0 +1,70 @@ >+/* >+ * Copyright (C) 2012 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 WebKitTextChecker_h >+#define WebKitTextChecker_h >+ >+#if ENABLE(SPELLCHECK) >+ >+#include "TextCheckerEnchant.h" >+#include "WKArray.h" >+#include "WKPage.h" >+#include "WKString.h" >+ >+namespace WebKit { >+ >+// The functions mainly choose between client's implementation of spelling and the WebKit one. >+ >+// Callbacks required by WKTextChecker. >+bool isContinuousSpellCheckingAllowed(const void* clientInfo); >+bool isContinuousSpellCheckingEnabled(const void* clientInfo); >+void setContinuousSpellCheckingEnabled(bool enabled, const void* clientInfo); >+bool isGrammarCheckingEnabled(const void* clientInfo); >+void setGrammarCheckingEnabled(bool enabled, const void* clientInfo); >+ >+uint64_t uniqueSpellDocumentTag(WKPageRef page, const void* clientInfo); >+void closeSpellDocumentWithTag(uint64_t tag, const void* clientInfo); >+ >+void checkSpellingOfString(uint64_t tag, WKStringRef text, int32_t* misspellingLocation, int32_t* misspellingLength, const void* clientInfo); >+void checkGrammarOfString(uint64_t tag, WKStringRef text, WKArrayRef* grammarDetails, int32_t* badGrammarLocation, int32_t* badGrammarLength, const void* clientInfo); >+ >+bool spellingUIIsShowing(const void* clientInfo); >+void toggleSpellingUIIsShowing(const void* clientInfo); >+void updateSpellingUIWithMisspelledWord(uint64_t tag, WKStringRef misspelledWord, const void* clientInfo); >+void updateSpellingUIWithGrammarString(uint64_t tag, WKStringRef badGrammarPhrase, WKGrammarDetailRef grammarDetail, const void* clientInfo); >+ >+WKArrayRef guessesForWord(uint64_t tag, WKStringRef word, const void* clientInfo); >+void learnWord(uint64_t tag, WKStringRef word, const void* clientInfo); >+void ignoreWord(uint64_t tag, WKStringRef word, const void* clientInfo); >+ >+// Enchant's helper. >+Vector<String> availableSpellCheckingLanguages(); >+void updateSpellCheckingLanguages(const Vector<String>& languages); >+Vector<String> loadedSpellCheckingLanguages(); >+ >+} // namespace WebKit >+ >+#endif // ENABLE(SPELLCHECK) >+#endif // WebKitTextChecker_h >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp >index b34ff77..e947772 100644 >--- a/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_context.cpp >@@ -38,6 +38,10 @@ > #include <WebCore/FileSystem.h> > #include <wtf/HashMap.h> > #include <wtf/text/WTFString.h> >+#if ENABLE(SPELLCHECK) >+#include "ewk_text_checker_private.h" >+#include "ewk_text_checker_settings.h" >+#endif > > using namespace WebCore; > using namespace WebKit; >@@ -103,6 +107,12 @@ struct _Ewk_Context { > #endif > ewk_context_request_manager_client_attach(this); > ewk_context_download_client_attach(this); >+#if ENABLE(SPELLCHECK) >+ ewk_text_checker_client_attach(); >+ if (ewk_text_checker_settings_enable_continuous_spell_checking_get()) >+ ewk_text_checker_settings_spell_checking_languages_set(0); >+#endif >+ > } > > ~_Ewk_Context() >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_text_checker.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker.cpp >new file mode 100644 >index 0000000..5f02423 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker.cpp >@@ -0,0 +1,129 @@ >+/* >+ * Copyright (C) 2012 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 "ewk_text_checker.h" >+ >+#if ENABLE(SPELLCHECK) >+#include "WKTextChecker.h" >+#include "WebKitTextChecker.h" >+#include "ewk_text_checker_private.h" >+ >+using namespace WebKit; >+ >+// Initializes client's functions to @c 0 to be sure that they are not defined. >+static Ewk_Text_Checker ewkTextCheckerCallback = { >+ 0, // unique_spell_document_tag_get >+ 0, // unique_spell_document_tag_close >+ 0, // string_spelling_check >+ 0, // ui_spelling_status_get >+ 0, // ui_toggle_spelling_status_get >+ 0, // ui_spelling_misspelled_word_update >+ 0, // word_guesses_get >+ 0, // word_learn >+ 0 // word_ignore >+}; >+ >+#define EWK_TEXT_CHECKER_CALLBACK_SET(TYPE_NAME, NAME) \ >+void ewk_text_checker_##NAME##_cb_set(TYPE_NAME cb) \ >+{ \ >+ ewkTextCheckerCallback.NAME = cb; \ >+} >+ >+/** >+ * Attaches spellchecker feature. >+ * >+ * @internal >+ * >+ * The default spellchecker feature is based on Enchant library. >+ * Client may use own implementation of spellchecker previously set >+ * through the callback functions. >+ */ >+void ewk_text_checker_client_attach() >+{ >+ static bool didInitializeTextCheckerClient = false; >+ if (didInitializeTextCheckerClient) >+ return; >+ >+ WKTextCheckerClient textCheckerClient = { >+ kWKTextCheckerClientCurrentVersion, >+ 0, // clientInfo >+ isContinuousSpellCheckingAllowed, >+ isContinuousSpellCheckingEnabled, >+ setContinuousSpellCheckingEnabled, >+ isGrammarCheckingEnabled, >+ setGrammarCheckingEnabled, >+ uniqueSpellDocumentTag, >+ closeSpellDocumentWithTag, >+ checkSpellingOfString, >+ checkGrammarOfString, >+ spellingUIIsShowing, >+ toggleSpellingUIIsShowing, >+ updateSpellingUIWithMisspelledWord, >+ updateSpellingUIWithGrammarString, >+ guessesForWord, >+ learnWord, >+ ignoreWord >+ }; >+ WKTextCheckerSetClient(&textCheckerClient); >+ >+ didInitializeTextCheckerClient = true; >+} >+ >+/* >+ * Gets to the client's callbacks. >+ * >+ * @internal >+ * >+ * The client't callbacks are not defined by default. >+ * If the client hasn't set the callback, the corresponding callback will >+ * return @c 0 and the default WebKit implementation will be used for this >+ * functionality. >+ * >+ * @return the struct with the client's callbacks. >+ */ >+Ewk_Text_Checker* ewkTextChecker() >+{ >+ return &ewkTextCheckerCallback; >+} >+ >+#else >+ >+// Defines an empty API to do not break build. >+#define EWK_TEXT_CHECKER_CALLBACK_SET(TYPE_NAME, NAME) \ >+void ewk_text_checker_##NAME##_cb_set(TYPE_NAME) \ >+{ \ >+} >+#endif // ENABLE(SPELLCHECK) >+ >+EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_Unique_Spell_Document_Tag_Get, unique_spell_document_tag_get) >+EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_Unique_Spell_Document_Tag_Close, unique_spell_document_tag_close) >+EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_String_Spelling_Check, string_spelling_check) >+EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_UI_Spelling_Status_Get, ui_spelling_status_get) >+EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_UI_Spelling_Status_Toggle, ui_spelling_status_toggle) >+EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_UI_Spelling_Misspelled_Word_Update, ui_spelling_misspelled_word_update) >+EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_Word_Guesses_Get, word_guesses_get) >+EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_Word_Learn, word_learn) >+EWK_TEXT_CHECKER_CALLBACK_SET(Ewk_Text_Checker_Word_Ignore, word_ignore) >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_text_checker.h b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker.h >new file mode 100644 >index 0000000..b9150de >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker.h >@@ -0,0 +1,197 @@ >+/* >+ * Copyright (C) 2012 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. >+ */ >+ >+/** >+ * @file ewk_text_checker.h >+ * @brief Provides API to overwrite the default WebKit spellchecker implementation. >+ * >+ * There is one spellchecker object per application and it's disabled by default. >+ * It allows to check spelling in the editable areas. >+ * If application wants to enable the feature, API from @a ewk_text_checker_setting.h >+ * should be used. >+ * >+ * The default WebKit spellchecker implementation is based on the Enchant library. >+ * It doesn't ensure grammar checking. Application is able to overwrite the default >+ * WebKit spellchecker implementation by defining its own implementation and setting >+ * appropriate callback functions. >+ */ >+ >+#ifndef ewk_text_checker_h >+#define ewk_text_checker_h >+ >+#include <Evas.h> >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+/** >+ * Defines a type name for the callback function to return a tag (identifier) which is guaranteed to be unique. >+ * >+ * Unique tags help to avoid collisions with other objects that are checked for spelling mistakes. >+ * >+ * @param o the view object to get unique tag >+ * >+ * @return unique tag for the given @a o view object >+ */ >+typedef uint64_t (*Ewk_Text_Checker_Unique_Spell_Document_Tag_Get)(const Evas_Object *o); >+ >+/** >+ * Defines a type name for the callback function to close the prviously set tag. >+ * >+ * This callback will notify the receiver that the user has finished with the tagged document. >+ * >+ * @param tag the tag to be closed >+ */ >+typedef void (*Ewk_Text_Checker_Unique_Spell_Document_Tag_Close)(uint64_t tag); >+ >+/** >+ * Defines a type name for the callback function to search for a misspelled words in the given string. >+ * >+ * @param tag unique tag to notify the spell checker which document that @a text is associated, >+ * in most cases not necessarily, just for ignored word, >+ * @c 0 can be passed in for text not associated with a particular document >+ * @param text the text containing the words to spellcheck >+ * @param misspelling_location a pointer to store the beginning of the misspelled @a text, @c -1 if the @a text is correct >+ * @param misspelling_length a pointer to store the length of misspelled @a text, @c 0 if the @a text is correct >+ */ >+typedef void (*Ewk_Text_Checker_String_Spelling_Check)(uint64_t tag, const char *text, int32_t *misspelling_location, int32_t *misspelling_length); >+ >+/** >+ * Defines a type name for the callback function to get the status of UI Spelling. >+ * >+ * @return @c EINA_TRUE if the UI Spelling is shown, @c EINA_FALSE if it's hidden >+ */ >+typedef Eina_Bool (*Ewk_Text_Checker_UI_Spelling_Status_Get)(void); >+ >+/** >+ * Defines a type name for the callback function to toggle the UI Spelling. >+ */ >+typedef void (*Ewk_Text_Checker_UI_Spelling_Status_Toggle)(void); >+ >+/** >+ * Defines a type name for the callback function to update the UI Spelling for the misspelled word. >+ * >+ * @param tag unique tag to notify the spell checker which document that the misspelled word is associated, >+ * @param misspelled_word the misspelled word >+ */ >+typedef void (*Ewk_Text_Checker_UI_Spelling_Misspelled_Word_Update)(uint64_t tag, const char *misspelled_word); >+ >+/** >+ * Defines a type name for the callback function to get a list of suggested spellings for a misspelled @a word. >+ * >+ * @param tag unique tag to notify the spell checker which document that @a text is associated, >+ * @c 0 can be passed for text not associated with a particular document >+ * @param word the word to get guesses >+ * @return a list of dynamically allocated strings (as char*) and >+ * caller is responsible for destroying them. >+ */ >+typedef Eina_List *(*Ewk_Text_Checker_Word_Guesses_Get)(uint64_t tag, const char *word); >+ >+/** >+ * Sets a callback function to add the word to the spell checker dictionary. >+ * >+ * @param tag unique tag to notify the spell checker which document that @a text is associated, >+ * @c 0 can be passed for text not associated with a particular document >+ * @param word the word to add >+ */ >+typedef void (*Ewk_Text_Checker_Word_Learn)(uint64_t tag, const char *word); >+ >+/** >+ * Sets a callback function to tell the spell checker to ignore a given word. >+ * >+ * @param tag unique tag to notify the spell checker which document that @a text is associated, >+ * @c 0 can be passed for text not associated with a particular document >+ * @param word the word to ignore >+ */ >+typedef void (*Ewk_Text_Checker_Word_Ignore)(uint64_t tag, const char *word); >+ >+/** >+ * Sets a callback function to get a unique spell document tag. >+ * >+ * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation >+ */ >+EAPI void ewk_text_checker_unique_spell_document_tag_get_cb_set(Ewk_Text_Checker_Unique_Spell_Document_Tag_Get cb); >+ >+/** >+ * Sets a callback function to close a unique spell document tag. >+ * >+ * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation >+ */ >+EAPI void ewk_text_checker_unique_spell_document_tag_close_cb_set(Ewk_Text_Checker_Unique_Spell_Document_Tag_Close cb); >+ >+/** >+ * Sets a callback function to search for a misspelled words in the given string. >+ * >+ * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation >+ */ >+EAPI void ewk_text_checker_string_spelling_check_cb_set(Ewk_Text_Checker_String_Spelling_Check cb); >+ >+/** >+ * Sets a callback function to get the status of UI Spelling. >+ * >+ * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation >+ */ >+EAPI void ewk_text_checker_ui_spelling_status_get_cb_set(Ewk_Text_Checker_UI_Spelling_Status_Get cb); >+ >+/** >+ * Sets a callback function to toggle the UI Spelling. >+ * >+ * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation >+ */ >+EAPI void ewk_text_checker_ui_spelling_status_toggle_cb_set(Ewk_Text_Checker_UI_Spelling_Status_Toggle cb); >+ >+/** >+ * Sets a callback function to update the UI Spelling for the misspelled word. >+ * >+ * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation >+ */ >+EAPI void ewk_text_checker_ui_spelling_misspelled_word_update_cb_set(Ewk_Text_Checker_UI_Spelling_Misspelled_Word_Update cb); >+ >+/** >+ * Sets a callback function to get an array of suggested spellings for a misspelled word. >+ * >+ * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation >+ */ >+EAPI void ewk_text_checker_word_guesses_get_cb_set(Ewk_Text_Checker_Word_Guesses_Get cb); >+ >+/** >+ * Sets a callback function to add the word to the spell checker dictionary. >+ * >+ * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation >+ */ >+EAPI void ewk_text_checker_word_learn_cb_set(Ewk_Text_Checker_Word_Learn cb); >+ >+/** >+ * Sets a callback function to tell the spell checker to ignore a given word. >+ * >+ * @param cb a new callback to set or @c NULL to restore the default WebKit callback implementation >+ */ >+EAPI void ewk_text_checker_word_ignore_cb_set(Ewk_Text_Checker_Word_Ignore cb); >+ >+#ifdef __cplusplus >+} >+#endif >+#endif // ewk_text_checker_h >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_private.h b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_private.h >new file mode 100644 >index 0000000..60e419b >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_private.h >@@ -0,0 +1,56 @@ >+/* >+ * Copyright (C) 2012 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 ewk_text_checker_private_h >+#define ewk_text_checker_private_h >+ >+#if ENABLE(SPELLCHECK) >+#include "ewk_text_checker.h" >+ >+/** >+ * @brief Structure that keeps client's callback functions. >+ * >+ * @internal >+ */ >+struct _Ewk_Text_Checker { >+ Ewk_Text_Checker_Unique_Spell_Document_Tag_Get unique_spell_document_tag_get; >+ Ewk_Text_Checker_Unique_Spell_Document_Tag_Close unique_spell_document_tag_close; >+ Ewk_Text_Checker_String_Spelling_Check string_spelling_check; >+ Ewk_Text_Checker_UI_Spelling_Status_Get ui_spelling_status_get; >+ Ewk_Text_Checker_UI_Spelling_Status_Toggle ui_spelling_status_toggle; >+ Ewk_Text_Checker_UI_Spelling_Misspelled_Word_Update ui_spelling_misspelled_word_update; >+ Ewk_Text_Checker_Word_Guesses_Get word_guesses_get; >+ Ewk_Text_Checker_Word_Learn word_learn; >+ Ewk_Text_Checker_Word_Ignore word_ignore; >+}; >+typedef _Ewk_Text_Checker Ewk_Text_Checker; >+ >+Ewk_Text_Checker* ewkTextChecker(); >+ >+// Makes it visible for WTR. >+EAPI void ewk_text_checker_client_attach(); >+ >+#endif // ENABLE(SPELLCHECK) >+#endif // ewk_text_checker_private_h >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_settings.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_settings.cpp >new file mode 100644 >index 0000000..d2a32b5 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_settings.cpp >@@ -0,0 +1,182 @@ >+/* >+ * Copyright (C) 2012 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 "ewk_text_checker_settings.h" >+ >+#if ENABLE(SPELLCHECK) >+#include "WKTextChecker.h" >+#include "WebKitTextChecker.h" >+#include <Ecore.h> >+#include <wtf/Vector.h> >+#include <wtf/text/CString.h> >+ >+using namespace WebKit; >+ >+static struct { >+ bool enableContinuousSpellChecking : 1; >+ bool enableGrammarChecking : 1; >+ struct { >+ Ewk_Text_Checker_Settings_Continuous_Spell_Checking_Changed continuousSpellCheckingChanged; >+ Ewk_Text_Checker_Settings_Grammar_Checking_Changed grammarCheckingChanged; >+ } settingsChangedCallbacks; >+ Vector<String> spellCheckingLanguages; >+} ewkTextCheckerSettings = { false, false, {0, 0}, Vector<String>() }; >+ >+static Eina_Bool idlerContinuousSpellCheckingChanged(void*) >+{ >+ if (ewkTextCheckerSettings.settingsChangedCallbacks.continuousSpellCheckingChanged) >+ ewkTextCheckerSettings.settingsChangedCallbacks.continuousSpellCheckingChanged( >+ ewkTextCheckerSettings.enableContinuousSpellChecking); >+ >+ return ECORE_CALLBACK_CANCEL; >+} >+ >+static Eina_Bool idlerGrammarCheckingChanged(void*) >+{ >+ if (ewkTextCheckerSettings.settingsChangedCallbacks.grammarCheckingChanged) >+ ewkTextCheckerSettings.settingsChangedCallbacks.grammarCheckingChanged( >+ ewkTextCheckerSettings.enableGrammarChecking); >+ >+ return ECORE_CALLBACK_CANCEL; >+} >+ >+static Eina_Bool idlerSpellCheckingLanguagesSet(void*) >+{ >+ // FIXME: Consider to delegate calling of this method in WebProcess to do not delay/block UIProcess. >+ updateSpellCheckingLanguages(ewkTextCheckerSettings.spellCheckingLanguages); >+ return ECORE_CALLBACK_CANCEL; >+} >+ >+static void spellCheckingLanguagesSet(const Vector<String>& newLanguages) >+{ >+ ewkTextCheckerSettings.spellCheckingLanguages = newLanguages; >+ ecore_idler_add(idlerSpellCheckingLanguagesSet, 0); >+} >+#endif // ENABLE(SPELLCHECK) >+ >+void ewk_text_checker_settings_continuous_spell_checking_changed_cb_set(Ewk_Text_Checker_Settings_Continuous_Spell_Checking_Changed callback) >+{ >+#if ENABLE(SPELLCHECK) >+ ewkTextCheckerSettings.settingsChangedCallbacks.continuousSpellCheckingChanged = callback; >+#endif >+} >+ >+void ewk_text_checker_settings_grammar_checking_changed_cb_set(Ewk_Text_Checker_Settings_Grammar_Checking_Changed callback) >+{ >+#if ENABLE(SPELLCHECK) >+ ewkTextCheckerSettings.settingsChangedCallbacks.grammarCheckingChanged = callback; >+#endif >+} >+ >+Eina_Bool ewk_text_checker_settings_enable_continuous_spell_checking_get() >+{ >+#if ENABLE(SPELLCHECK) >+ return ewkTextCheckerSettings.enableContinuousSpellChecking; >+#else >+ return false; >+#endif >+} >+ >+void ewk_text_checker_settings_enable_continuous_spell_checking_set(Eina_Bool enable) >+{ >+#if ENABLE(SPELLCHECK) >+ enable = !!enable; >+ if (ewkTextCheckerSettings.enableContinuousSpellChecking != enable) { >+ ewkTextCheckerSettings.enableContinuousSpellChecking = enable; >+ >+ WKTextCheckerContinuousSpellCheckingEnabledStateChanged(enable); >+ >+ // Sets default language if user didn't specify any. >+ if (enable && loadedSpellCheckingLanguages().isEmpty()) >+ spellCheckingLanguagesSet(Vector<String>()); >+ >+ if (ewkTextCheckerSettings.settingsChangedCallbacks.continuousSpellCheckingChanged) >+ ecore_idler_add(idlerContinuousSpellCheckingChanged, 0); >+ } >+#endif >+} >+ >+Eina_Bool ewk_text_checker_settings_enable_grammar_checking_get() >+{ >+#if ENABLE(SPELLCHECK) >+ return ewkTextCheckerSettings.enableGrammarChecking; >+#else >+ return false; >+#endif >+} >+ >+void ewk_text_checker_settings_enable_grammar_checking_set(Eina_Bool enable) >+{ >+#if ENABLE(SPELLCHECK) >+ enable = !!enable; >+ if (ewkTextCheckerSettings.enableGrammarChecking != enable) { >+ ewkTextCheckerSettings.enableGrammarChecking = enable; >+ >+ WKTextCheckerGrammarCheckingEnabledStateChanged(enable); >+ >+ if (ewkTextCheckerSettings.settingsChangedCallbacks.grammarCheckingChanged) >+ ecore_idler_add(idlerGrammarCheckingChanged, 0); >+ } >+#endif >+} >+ >+Eina_List* ewk_text_checker_settings_available_spell_checking_languages_get() >+{ >+ Eina_List* listOflanguages = 0; >+#if ENABLE(SPELLCHECK) >+ Vector<String> languages = availableSpellCheckingLanguages(); >+ size_t numberOfLanuages = languages.size(); >+ >+ for (size_t i = 0; i < numberOfLanuages; ++i) >+ listOflanguages = eina_list_append(listOflanguages, eina_stringshare_add(languages[i].utf8().data())); >+ >+#endif >+ return listOflanguages; >+} >+ >+void ewk_text_checker_settings_spell_checking_languages_set(const char* languages) >+{ >+#if ENABLE(SPELLCHECK) >+ Vector<String> newLanguages; >+ String::fromUTF8(languages).split(',', newLanguages); >+ >+ spellCheckingLanguagesSet(newLanguages); >+#endif >+} >+ >+Eina_List* ewk_text_checker_settings_spell_checking_languages_get() >+{ >+ Eina_List* listOflanguages = 0; >+#if ENABLE(SPELLCHECK) >+ Vector<String> languages = loadedSpellCheckingLanguages(); >+ size_t numberOfLanuages = languages.size(); >+ >+ for (size_t i = 0; i < numberOfLanuages; ++i) >+ listOflanguages = eina_list_append(listOflanguages, eina_stringshare_add(languages[i].utf8().data())); >+ >+#endif >+ return listOflanguages; >+} >diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_settings.h b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_settings.h >new file mode 100644 >index 0000000..4785840 >--- /dev/null >+++ b/Source/WebKit2/UIProcess/API/efl/ewk_text_checker_settings.h >@@ -0,0 +1,167 @@ >+/* >+ * Copyright (C) 2012 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. >+ */ >+ >+/** >+ * @file ewk_text_checker_setting.h >+ * @brief API for manipulating spell checker feature. >+ */ >+ >+#ifndef ewk_text_checker_setting_h >+#define ewk_text_checker_setting_h >+ >+#include <Eina.h> >+ >+#ifdef __cplusplus >+extern "C" { >+#endif >+ >+/** >+ * Creates a type name for the callback function used to notify the client when >+ * the continuous spell checking setting was changed by WebKit. >+ * >+ * @param @c EINA_TRUE if continuous spell checking is enabled or @ EINA_FALSE if it's disabled >+ */ >+typedef void (*Ewk_Text_Checker_Settings_Continuous_Spell_Checking_Changed)(Eina_Bool enable); >+ >+/** >+ * Sets a callback function used to notify the client when >+ * the grammar checking setting was changed by WebKit. >+ * >+ * @param @c EINA_TRUE if grammar checking is enabled or @ EINA_FALSE if it's disabled >+ */ >+typedef void (*Ewk_Text_Checker_Settings_Grammar_Checking_Changed)(Eina_Bool enable); >+ >+/** >+ * Sets a callback function used to notify the client when >+ * the continuous spell checking setting was changed by WebKit. >+ * >+ * Specifying of this callback is needed if the application wants to receive notifications >+ * once WebKit changes this setting. >+ * If the application is not interested, this callback is not set. >+ * Changing of this setting at the WebKit level can be made as a result of modifying >+ * options in a Context Menu by a user. >+ * >+ * @param cb a new callback function to set or @c NULL to invalidate the previous one >+ */ >+EAPI void ewk_text_checker_settings_continuous_spell_checking_changed_cb_set(Ewk_Text_Checker_Settings_Continuous_Spell_Checking_Changed cb); >+ >+/** >+ * Sets a callback function used to notify the client when >+ * the grammar checking setting was changed by WebKit. >+ * >+ * Specifying of this callback is needed if the application wants to receive notifications >+ * once WebKit changes this setting. >+ * If the application is not interested, this callback is not set. >+ * Changing of this setting at the WebKit level can be made as a result of modifying >+ * options in a Context Menu by a user. >+ * >+ * @param cb a new callback function to set or @c NULL to invalidate the previous one >+ */ >+EAPI void ewk_text_checker_settings_grammar_checking_changed_cb_set(Ewk_Text_Checker_Settings_Grammar_Checking_Changed cb); >+ >+/** >+ * Queries if continuous spell checking is enabled. >+ * >+ * @return @c EINA_TRUE if continuous spell checking is enabled or @c EINA_FALSE if it's disabled >+ */ >+EAPI Eina_Bool ewk_text_checker_settings_enable_continuous_spell_checking_get(void); >+ >+/** >+ * Enables/disables continuous spell checking. >+ * >+ * Additionally, this function calls a callback function (if defined) to notify >+ * the client about the change of the setting. >+ * This feature is disabled by default. >+ * >+ * @see ewk_text_checker_setting_continuous_spell_checking_changed_cb_set >+ * >+ * @param enable @c EINA_TRUE to enable continuous spell checking or @c EINA_FALSE to disable >+ */ >+EAPI void ewk_text_checker_settings_enable_continuous_spell_checking_set(Eina_Bool enable); >+ >+/** >+ * Queries if grammar checking is enabled. >+ * >+ * Application may overwrite webkit grammar checking implementation by setting callback functions >+ * @see ewk_text_checker.h >+ * >+ * @return @c EINA_TRUE if grammar checking is enabled or @c EINA_FALSE if it's disabled >+ */ >+EAPI Eina_Bool ewk_text_checker_settings_enable_grammar_checking_get(void); >+ >+/** >+ * Enables/disables grammar checking. >+ * >+ * Additionally, this function calls a callback function (if defined) to notify >+ * the client about the change of the setting. >+ * This feature is disabled and is not supported by WebKit-EFL by default. >+ * >+ * @see ewk_text_checker_setting_grammar_checking_changed_cb_set >+ * >+ * @param enable @c EINA_TRUE to enable grammar checking or @c EINA_FALSE to disable >+ */ >+EAPI void ewk_text_checker_settings_enable_grammar_checking_set(Eina_Bool enable); >+ >+/* >+ * Gets the the list of all available and installed spell checking languages to use. >+ * >+ * @see ewk_text_checker_setting_spell_checking_languages_set >+ * >+ * @return the list with available spell checking languages, or @c NULL on failure >+ * the Eina_List and its items should be freed after, use eina_stringshare_del() >+ */ >+EAPI Eina_List *ewk_text_checker_settings_available_spell_checking_languages_get(void); >+ >+/** >+ * Sets @a languages as the list of languages to use by default WebKit >+ * implementation of spellchecker feature with Enchant library support. >+ * >+ * If @languages is @c NULL, the default language is used. >+ * If the default language can not be determined then any available dictionary will be used. >+ * >+ * @note This function invalidates the previously set languages. >+ * The dictionaries are requested asynchronously. >+ * >+ * @param languages a list of comma (',') separated language codes >+ * of the form 'en_US', ie, language_VARIANT, may be @c NULL. >+ */ >+EAPI void ewk_text_checker_settings_spell_checking_languages_set(const char *languages); >+ >+/* >+ * Gets the the list of the spell checking languages in use. >+ * >+ * @see ewk_text_checker_setting_available_spell_checking_languages_get >+ * @see ewk_text_checker_setting_spell_checking_languages_set >+ * >+ * @return the list with the spell checking languages in use, >+ * the Eina_List and its items should be freed after, use eina_stringshare_del() >+ */ >+EAPI Eina_List *ewk_text_checker_settings_spell_checking_languages_get(void); >+ >+#ifdef __cplusplus >+} >+#endif >+ >+#endif // ewk_text_checker_setting_h >diff --git a/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp b/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp >index 75a8a99..599dc56 100644 >--- a/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp >+++ b/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp >@@ -1,5 +1,7 @@ > /* >- * Copyright (C) 2011 Samsung Electronics >+ * Copyright (C) 2012 Samsung Electronics >+ * 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 >@@ -27,7 +29,9 @@ > #include "TextChecker.h" > > #include "TextCheckerState.h" >-#include <WebCore/NotImplemented.h> >+#if ENABLE(SPELLCHECK) >+#include "WebTextChecker.h" >+#endif > > using namespace WebCore; > >@@ -37,91 +41,144 @@ static TextCheckerState textCheckerState; > > const TextCheckerState& TextChecker::state() > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ static bool didInitializeState = false; >+ if (didInitializeState) >+ return textCheckerState; >+ >+ WebTextCheckerClient& client = WebTextChecker::shared()->client(); >+ textCheckerState.isContinuousSpellCheckingEnabled = client.continuousSpellCheckingEnabled(); >+ textCheckerState.isGrammarCheckingEnabled = client.grammarCheckingEnabled(); >+ >+ didInitializeState = true; >+#endif > return textCheckerState; > } > > bool TextChecker::isContinuousSpellCheckingAllowed() > { >- notImplemented(); >- return false; >+#if ENABLE(SPELLCHECK) >+ return WebTextChecker::shared()->client().continuousSpellCheckingAllowed(); >+#else >+ return false; >+#endif > } > >-void TextChecker::setContinuousSpellCheckingEnabled(bool) >+void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellCheckingEnabled) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ if (state().isContinuousSpellCheckingEnabled == isContinuousSpellCheckingEnabled) >+ return; >+ >+ textCheckerState.isContinuousSpellCheckingEnabled = isContinuousSpellCheckingEnabled; >+ WebTextChecker::shared()->client().setContinuousSpellCheckingEnabled(isContinuousSpellCheckingEnabled); >+#endif > } > >-void TextChecker::setGrammarCheckingEnabled(bool) >+void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ if (state().isGrammarCheckingEnabled == isGrammarCheckingEnabled) >+ return; >+ >+ textCheckerState.isGrammarCheckingEnabled = isGrammarCheckingEnabled; >+ WebTextChecker::shared()->client().setGrammarCheckingEnabled(isGrammarCheckingEnabled); >+#endif > } > >-void TextChecker::continuousSpellCheckingEnabledStateChanged(bool /*enabled*/) >+void TextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ textCheckerState.isContinuousSpellCheckingEnabled = enabled; >+#endif > } > >-void TextChecker::grammarCheckingEnabledStateChanged(bool /*enabled*/) >+void TextChecker::grammarCheckingEnabledStateChanged(bool enabled) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ textCheckerState.isGrammarCheckingEnabled = enabled; >+#endif > } > >-int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*) >+int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy* page) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ return WebTextChecker::shared()->client().uniqueSpellDocumentTag(page); >+#else > return 0; >+#endif > } > >-void TextChecker::closeSpellDocumentWithTag(int64_t) >+void TextChecker::closeSpellDocumentWithTag(int64_t tag) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ WebTextChecker::shared()->client().closeSpellDocumentWithTag(tag); >+#endif > } > >-void TextChecker::checkSpellingOfString(int64_t, const UChar*, uint32_t, int32_t&, int32_t&) >+void TextChecker::checkSpellingOfString(int64_t spellDocumentTag, const UChar* text, uint32_t length, int32_t& misspellingLocation, int32_t& misspellingLength) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ WebTextChecker::shared()->client().checkSpellingOfString(spellDocumentTag, String(text, length), misspellingLocation, misspellingLength); >+#endif > } > >-void TextChecker::checkGrammarOfString(int64_t, const UChar*, uint32_t, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&) >+void TextChecker::checkGrammarOfString(int64_t spellDocumentTag, const UChar* text, uint32_t length, Vector<GrammarDetail>& grammarDetails, int32_t& badGrammarLocation, int32_t& badGrammarLength) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ WebTextChecker::shared()->client().checkGrammarOfString(spellDocumentTag, String(text, length), grammarDetails, badGrammarLocation, badGrammarLength); >+#endif > } > > bool TextChecker::spellingUIIsShowing() > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ return WebTextChecker::shared()->client().spellingUIIsShowing(); >+#else > return false; >+#endif > } > > void TextChecker::toggleSpellingUIIsShowing() > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ WebTextChecker::shared()->client().toggleSpellingUIIsShowing(); >+#endif > } > >-void TextChecker::updateSpellingUIWithMisspelledWord(int64_t, const String&) >+void TextChecker::updateSpellingUIWithMisspelledWord(int64_t spellDocumentTag, const String& misspelledWord) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ WebTextChecker::shared()->client().updateSpellingUIWithMisspelledWord(spellDocumentTag, misspelledWord); >+#endif > } > >-void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String&, const GrammarDetail&) >+void TextChecker::updateSpellingUIWithGrammarString(int64_t spellDocumentTag, const String& badGrammarPhrase, const GrammarDetail& grammarDetail) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ WebTextChecker::shared()->client().updateSpellingUIWithGrammarString(spellDocumentTag, badGrammarPhrase, grammarDetail); >+#endif > } > >-void TextChecker::getGuessesForWord(int64_t, const String&, const String&, Vector<String>&) >+void TextChecker::getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& context, Vector<String>& guesses) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ WebTextChecker::shared()->client().guessesForWord(spellDocumentTag, word, guesses); >+#endif > } > >-void TextChecker::learnWord(int64_t, const String&) >+void TextChecker::learnWord(int64_t spellDocumentTag, const String& word) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ WebTextChecker::shared()->client().learnWord(spellDocumentTag, word); >+#endif > } > >-void TextChecker::ignoreWord(int64_t, const String&) >+void TextChecker::ignoreWord(int64_t spellDocumentTag, const String& word) > { >- notImplemented(); >+#if ENABLE(SPELLCHECK) >+ WebTextChecker::shared()->client().ignoreWord(spellDocumentTag, word); >+#endif > } > > } // namespace WebKit >diff --git a/Source/cmake/FindEnchant.cmake b/Source/cmake/FindEnchant.cmake >new file mode 100644 >index 0000000..d69c71c >--- /dev/null >+++ b/Source/cmake/FindEnchant.cmake >@@ -0,0 +1,43 @@ >+# - Try to find Enchant >+# Once done, this will define >+# >+# ENCHANT_INCLUDE_DIRS - the Enchant include drectories >+# ENCHANT_LIBRARIES - link these to use Enchant >+# >+# Copyright (C) 2012 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 HOLDER 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 THE COPYRIGHT HOLDER 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. >+ >+FIND_PACKAGE(PkgConfig) >+PKG_CHECK_MODULES(PC_ENCHANT enchant) >+ >+FIND_PATH(ENCHANT_INCLUDE_DIRS >+ NAMES enchant.h >+ PATHS ${PC_ENCHANT_INCLUDEDIR} >+ ${PC_ENCHANT_INCLUDE_DIRS} >+) >+ >+FIND_LIBRARY(ENCHANT_LIBRARIES >+ NAMES enchant >+ PATHS ${PC_ENCHANT_LIBDIR} >+ ${PC_ENCHANT_LIBRARY_DIRS} >+) >diff --git a/Source/cmake/OptionsEfl.cmake b/Source/cmake/OptionsEfl.cmake >index 549056a..f1eba8a 100644 >--- a/Source/cmake/OptionsEfl.cmake >+++ b/Source/cmake/OptionsEfl.cmake >@@ -168,3 +168,8 @@ IF (WTF_USE_TILED_BACKING_STORE) > FIND_PACKAGE(OpenGL REQUIRED) > ENDIF() > >+OPTION(ENABLE_SPELLCHECK "Enable spellchecking feature (requires enchant)" ON) >+IF (ENABLE_SPELLCHECK) >+ FIND_PACKAGE(Enchant REQUIRED) >+ ADD_DEFINITIONS(-DENABLE_SPELLCHECK=1) >+ENDIF()
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 91854
:
161908
|
161911
|
161930
|
161980
|
162222
|
162506
|
163324
|
163862
|
164090
|
165373
|
165377
|
165957
|
168222
|
168409
|
168421
|
168634
|
168945
|
169100