Changeset 97385 in webkit


Ignore:
Timestamp:
Oct 13, 2011, 12:36:34 PM (14 years ago)
Author:
commit-queue@webkit.org
Message:

Implement TextChecker for WebKit2 GTK+
https://bugs.webkit.org/show_bug.cgi?id=68548

Patch by Ravi Phaneendra Kasibhatla <ravi.kasibhatla@motorola.com> on 2011-10-13
Reviewed by Anders Carlsson.

Added implementation for all functions in TextCheckerGtk.cpp removing earlier stubbed implementations.
Moved couple of API earlier specific to win port to common section and added stubbed implementation
of the same for remaining ports of Qt, Efl and Mac.

  • GNUmakefile.am: Added TextChecker implementation files.
  • UIProcess/TextChecker.h: Moved spellCheckingEnabled and grammarCheckingEnabled API outside of win port.
  • UIProcess/efl/TextCheckerEfl.cpp: Stubbed implementation of API which was moved outside win port.
  • UIProcess/gtk/TextCheckerGtk.cpp: Implementation of all TextChecker API.

(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):
(WebKit::TextChecker::spellingUIIsShowing):
(WebKit::TextChecker::toggleSpellingUIIsShowing):
(WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
(WebKit::TextChecker::updateSpellingUIWithGrammarString):
(WebKit::TextChecker::getGuessesForWord):
(WebKit::TextChecker::learnWord):
(WebKit::TextChecker::ignoreWord):

  • UIProcess/mac/TextCheckerMac.mm: Implementation of API which was moved outside win port.
  • UIProcess/qt/TextCheckerQt.cpp: Stubbed implementation of API which was moved outside win port.
Location:
trunk/Source/WebKit2
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r97375 r97385  
     12011-10-13  Ravi Phaneendra Kasibhatla  <ravi.kasibhatla@motorola.com>
     2
     3        Implement TextChecker for WebKit2 GTK+
     4        https://bugs.webkit.org/show_bug.cgi?id=68548
     5
     6        Reviewed by Anders Carlsson.
     7
     8        Added implementation for all functions in TextCheckerGtk.cpp removing earlier stubbed implementations.
     9        Moved couple of API earlier specific to win port to common section and added stubbed implementation
     10        of the same for remaining ports of Qt, Efl and Mac.
     11
     12        * GNUmakefile.am: Added TextChecker implementation files.
     13        * UIProcess/TextChecker.h: Moved spellCheckingEnabled and grammarCheckingEnabled API outside of win port.
     14        * UIProcess/efl/TextCheckerEfl.cpp: Stubbed implementation of API which was moved outside win port.
     15        * UIProcess/gtk/TextCheckerGtk.cpp: Implementation of all TextChecker API.
     16        (WebKit::TextChecker::state):
     17        (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
     18        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
     19        (WebKit::TextChecker::setGrammarCheckingEnabled):
     20        (WebKit::TextChecker::continuousSpellCheckingEnabledStateChanged):
     21        (WebKit::TextChecker::grammarCheckingEnabledStateChanged):
     22        (WebKit::TextChecker::uniqueSpellDocumentTag):
     23        (WebKit::TextChecker::closeSpellDocumentWithTag):
     24        (WebKit::TextChecker::checkSpellingOfString):
     25        (WebKit::TextChecker::checkGrammarOfString):
     26        (WebKit::TextChecker::spellingUIIsShowing):
     27        (WebKit::TextChecker::toggleSpellingUIIsShowing):
     28        (WebKit::TextChecker::updateSpellingUIWithMisspelledWord):
     29        (WebKit::TextChecker::updateSpellingUIWithGrammarString):
     30        (WebKit::TextChecker::getGuessesForWord):
     31        (WebKit::TextChecker::learnWord):
     32        (WebKit::TextChecker::ignoreWord):
     33        * UIProcess/mac/TextCheckerMac.mm: Implementation of API which was moved outside win port.
     34        * UIProcess/qt/TextCheckerQt.cpp: Stubbed implementation of API which was moved outside win port.
     35
    1362011-10-13  Jesus Sanchez-Palencia  <jesus.palencia@openbossa.org>
    237
  • trunk/Source/WebKit2/GNUmakefile.am

    r97226 r97385  
    4949        $(WebKit2)/UIProcess/API/C/WKFrame.h \
    5050        $(WebKit2)/UIProcess/API/C/WKFramePolicyListener.h \
     51        $(WebKit2)/UIProcess/API/C/WKGrammarDetail.h \
    5152        $(WebKit2)/UIProcess/API/C/WKHitTestResult.h \
    5253        $(WebKit2)/UIProcess/API/C/WKInspector.h \
     
    6667        $(WebKit2)/UIProcess/API/C/WKProtectionSpaceTypes.h \
    6768        $(WebKit2)/UIProcess/API/C/WKResourceCacheManager.h \
     69        $(WebKit2)/UIProcess/API/C/WKTextChecker.h \
    6870        $(WebKit2)/UIProcess/API/cpp/WKRetainPtr.h
    6971
     
    433435        Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.cpp \
    434436        Source/WebKit2/UIProcess/API/C/WKFramePolicyListener.h \
     437        Source/WebKit2/UIProcess/API/C/WKGrammarDetail.cpp \
     438        Source/WebKit2/UIProcess/API/C/WKGrammarDetail.h \
    435439        Source/WebKit2/UIProcess/API/C/WKHitTestResult.cpp \
    436440        Source/WebKit2/UIProcess/API/C/WKHitTestResult.h \
     
    465469        Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.h \
    466470        Source/WebKit2/UIProcess/API/C/WKResourceCacheManager.cpp \
     471        Source/WebKit2/UIProcess/API/C/WKTextChecker.h \
     472        Source/WebKit2/UIProcess/API/C/WKTextChecker.cpp \
    467473        Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h \
    468474        Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h \
     
    583589        Source/WebKit2/UIProcess/WebGeolocationProvider.cpp \
    584590        Source/WebKit2/UIProcess/WebGeolocationProvider.h \
     591        Source/WebKit2/UIProcess/WebGrammarDetail.cpp \
     592        Source/WebKit2/UIProcess/WebGrammarDetail.h \
    585593        Source/WebKit2/UIProcess/WebHistoryClient.cpp \
    586594        Source/WebKit2/UIProcess/WebHistoryClient.h \
     
    618626        Source/WebKit2/UIProcess/WebResourceLoadClient.cpp \
    619627        Source/WebKit2/UIProcess/WebResourceLoadClient.h \
     628        Source/WebKit2/UIProcess/WebTextChecker.cpp \
     629        Source/WebKit2/UIProcess/WebTextChecker.h \
     630        Source/WebKit2/UIProcess/WebTextCheckerClient.cpp \
     631        Source/WebKit2/UIProcess/WebTextCheckerClient.h \
    620632        Source/WebKit2/UIProcess/WebUIClient.cpp \
    621633        Source/WebKit2/UIProcess/WebUIClient.h \
  • trunk/Source/WebKit2/UIProcess/TextChecker.h

    r95901 r97385  
    5555    static bool substitutionsPanelIsShowing();
    5656    static void toggleSubstitutionsPanelIsShowing();
    57 #elif PLATFORM(WIN)
     57#endif
     58
    5859    static void continuousSpellCheckingEnabledStateChanged(bool);
    5960    static void grammarCheckingEnabledStateChanged(bool);
    60 #endif
    61 
    6261    static int64_t uniqueSpellDocumentTag(WebPageProxy*);
    6362    static void closeSpellDocumentWithTag(int64_t);
  • trunk/Source/WebKit2/UIProcess/efl/TextCheckerEfl.cpp

    r95901 r97385  
    5454
    5555void TextChecker::setGrammarCheckingEnabled(bool)
     56{
     57    notImplemented();
     58}
     59
     60void TextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled)
     61{
     62    notImplemented();
     63}
     64
     65void TextChecker::grammarCheckingEnabledStateChanged(bool enabled)
    5666{
    5767    notImplemented();
  • trunk/Source/WebKit2/UIProcess/gtk/TextCheckerGtk.cpp

    r95901 r97385  
    2929
    3030#include "TextCheckerState.h"
    31 #include <WebCore/NotImplemented.h>
     31#include "WebTextChecker.h"
    3232
    3333using namespace WebCore;
     
    3939const TextCheckerState& TextChecker::state()
    4040{
    41     notImplemented();
     41    static bool didInitializeState;
     42    if (didInitializeState)
     43        return textCheckerState;
     44
     45    WebTextCheckerClient& client = WebTextChecker::shared()->client();
     46    textCheckerState.isContinuousSpellCheckingEnabled = client.continuousSpellCheckingEnabled();
     47    textCheckerState.isGrammarCheckingEnabled =  client.grammarCheckingEnabled();
     48
     49    didInitializeState = true;
     50
    4251    return textCheckerState;
    4352}
    44 
     53 
    4554bool TextChecker::isContinuousSpellCheckingAllowed()
    4655{
    47     notImplemented();
    48     return false;
     56    return WebTextChecker::shared()->client().continuousSpellCheckingAllowed();
    4957}
    5058
    5159void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellCheckingEnabled)
    5260{
    53     notImplemented();
     61    if (state().isContinuousSpellCheckingEnabled == isContinuousSpellCheckingEnabled)
     62        return;
     63    textCheckerState.isContinuousSpellCheckingEnabled = isContinuousSpellCheckingEnabled;
     64    WebTextChecker::shared()->client().setContinuousSpellCheckingEnabled(isContinuousSpellCheckingEnabled);
    5465}
    5566
    5667void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled)
    5768{
    58     notImplemented();
     69    if (state().isGrammarCheckingEnabled == isGrammarCheckingEnabled)
     70        return;
     71    textCheckerState.isGrammarCheckingEnabled = isGrammarCheckingEnabled;
     72    WebTextChecker::shared()->client().setGrammarCheckingEnabled(isGrammarCheckingEnabled);
    5973}
    6074
    61 int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
     75void TextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled)
    6276{
    63     notImplemented();
    64     return 0;
     77    textCheckerState.isContinuousSpellCheckingEnabled = enabled;
    6578}
    6679
    67 void TextChecker::closeSpellDocumentWithTag(int64_t)
     80void TextChecker::grammarCheckingEnabledStateChanged(bool enabled)
    6881{
    69     notImplemented();
     82    textCheckerState.isGrammarCheckingEnabled = enabled;
    7083}
    7184
    72 void TextChecker::checkSpellingOfString(int64_t, const UChar*, uint32_t, int32_t&, int32_t&)
     85int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy* page)
    7386{
    74     notImplemented();
     87    return WebTextChecker::shared()->client().uniqueSpellDocumentTag(page);
    7588}
    7689
    77 void TextChecker::checkGrammarOfString(int64_t, const UChar*, uint32_t, Vector<WebCore::GrammarDetail>&, int32_t&, int32_t&)
     90void TextChecker::closeSpellDocumentWithTag(int64_t tag)
    7891{
    79     notImplemented();
     92    WebTextChecker::shared()->client().closeSpellDocumentWithTag(tag);
     93}
     94
     95void TextChecker::checkSpellingOfString(int64_t spellDocumentTag, const UChar* text, uint32_t length, int32_t& misspellingLocation, int32_t& misspellingLength)
     96{
     97    WebTextChecker::shared()->client().checkSpellingOfString(spellDocumentTag, String(text, length), misspellingLocation, misspellingLength);
     98}
     99
     100void TextChecker::checkGrammarOfString(int64_t spellDocumentTag, const UChar* text, uint32_t length, Vector<WebCore::GrammarDetail>& grammarDetails, int32_t& badGrammarLocation, int32_t& badGrammarLength)
     101{
     102    WebTextChecker::shared()->client().checkGrammarOfString(spellDocumentTag, String(text, length), grammarDetails, badGrammarLocation, badGrammarLength);
    80103}
    81104
    82105bool TextChecker::spellingUIIsShowing()
    83106{
    84     notImplemented();
    85     return false;
     107    return WebTextChecker::shared()->client().spellingUIIsShowing();
    86108}
    87109
    88110void TextChecker::toggleSpellingUIIsShowing()
    89111{
    90     notImplemented();
     112    WebTextChecker::shared()->client().toggleSpellingUIIsShowing();
    91113}
    92114
    93 void TextChecker::updateSpellingUIWithMisspelledWord(int64_t, const String&)
     115void TextChecker::updateSpellingUIWithMisspelledWord(int64_t spellDocumentTag, const String& misspelledWord)
    94116{
    95     notImplemented();
     117    WebTextChecker::shared()->client().updateSpellingUIWithMisspelledWord(spellDocumentTag, misspelledWord);
    96118}
    97119
    98 void TextChecker::updateSpellingUIWithGrammarString(int64_t, const String&, const GrammarDetail&)
     120void TextChecker::updateSpellingUIWithGrammarString(int64_t spellDocumentTag, const String& badGrammarPhrase, const GrammarDetail& grammarDetail)
    99121{
    100     notImplemented();
     122    WebTextChecker::shared()->client().updateSpellingUIWithGrammarString(spellDocumentTag, badGrammarPhrase, grammarDetail);
    101123}
    102124
    103125void TextChecker::getGuessesForWord(int64_t spellDocumentTag, const String& word, const String& context, Vector<String>& guesses)
    104126{
    105     notImplemented();
     127    WebTextChecker::shared()->client().guessesForWord(spellDocumentTag, word, guesses);
    106128}
    107129
    108 void TextChecker::learnWord(int64_t, const String&)
     130void TextChecker::learnWord(int64_t spellDocumentTag, const String& word)
    109131{
    110     notImplemented();
     132    WebTextChecker::shared()->client().learnWord(spellDocumentTag, word);
    111133}
    112134
    113135void TextChecker::ignoreWord(int64_t spellDocumentTag, const String& word)
    114136{
    115     notImplemented();
     137    WebTextChecker::shared()->client().ignoreWord(spellDocumentTag, word);
    116138}
    117139
  • trunk/Source/WebKit2/UIProcess/mac/TextCheckerMac.mm

    r95901 r97385  
    214214}
    215215
     216void TextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled)
     217{
     218    textCheckerState.isContinuousSpellCheckingEnabled = enabled;
     219}
     220
     221void TextChecker::grammarCheckingEnabledStateChanged(bool enabled)
     222{
     223    textCheckerState.isGrammarCheckingEnabled = enabled;
     224}
     225
    216226int64_t TextChecker::uniqueSpellDocumentTag(WebPageProxy*)
    217227{
  • trunk/Source/WebKit2/UIProcess/qt/TextCheckerQt.cpp

    r95901 r97385  
    5656
    5757void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled)
     58{
     59    notImplemented();
     60}
     61
     62void TextChecker::continuousSpellCheckingEnabledStateChanged(bool enabled)
     63{
     64    notImplemented();
     65}
     66
     67void TextChecker::grammarCheckingEnabledStateChanged(bool enabled)
    5868{
    5969    notImplemented();
Note: See TracChangeset for help on using the changeset viewer.