Title: [283876] trunk
Revision
283876
Author
[email protected]
Date
2021-10-10 10:36:14 -0700 (Sun, 10 Oct 2021)

Log Message

[WPE] Expose WKTextCheckerSetContinuousSpellCheckingEnabled and use it from WKTR
https://bugs.webkit.org/show_bug.cgi?id=231446

Patch by Michael Catanzaro <[email protected]> on 2021-10-10
Reviewed by Philippe Normand.

Source/WebKit:

This is to avoid WKTR needing to poke WebKit internals to turn on spellchecking.

* PlatformGTK.cmake:
* PlatformWPE.cmake:
* SourcesGTK.txt:
* SourcesWPE.txt:
* UIProcess/API/C/glib/WKTextCheckerGLib.cpp: Renamed from Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp.
(WKTextCheckerSetClient):
(WKTextCheckerContinuousSpellCheckingEnabledStateChanged):
(WKTextCheckerGrammarCheckingEnabledStateChanged):
(WKTextCheckerCheckSpelling):
(WKTextCheckerChangeSpellingToWord):
(WKTextCheckerSetSpellCheckingLanguages):
(WKTextCheckerSetContinuousSpellCheckingEnabled):
* UIProcess/API/C/glib/WKTextCheckerGLib.h: Renamed from Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.h.
* UIProcess/gtk/WebTextChecker.h:
* UIProcess/gtk/WebTextCheckerClient.h:

Tools:

* WebKitTestRunner/gtk/TestControllerGtk.cpp:
* WebKitTestRunner/gtk/UIScriptControllerGtk.cpp:
* WebKitTestRunner/gtk/main.cpp:
* WebKitTestRunner/wpe/UIScriptControllerWPE.cpp:
(WTR::UIScriptControllerWPE::setContinuousSpellCheckingEnabled):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (283875 => 283876)


--- trunk/Source/WebKit/ChangeLog	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Source/WebKit/ChangeLog	2021-10-10 17:36:14 UTC (rev 283876)
@@ -1,3 +1,28 @@
+2021-10-10  Michael Catanzaro  <[email protected]>
+
+        [WPE] Expose WKTextCheckerSetContinuousSpellCheckingEnabled and use it from WKTR
+        https://bugs.webkit.org/show_bug.cgi?id=231446
+
+        Reviewed by Philippe Normand.
+
+        This is to avoid WKTR needing to poke WebKit internals to turn on spellchecking.
+
+        * PlatformGTK.cmake:
+        * PlatformWPE.cmake:
+        * SourcesGTK.txt:
+        * SourcesWPE.txt:
+        * UIProcess/API/C/glib/WKTextCheckerGLib.cpp: Renamed from Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp.
+        (WKTextCheckerSetClient):
+        (WKTextCheckerContinuousSpellCheckingEnabledStateChanged):
+        (WKTextCheckerGrammarCheckingEnabledStateChanged):
+        (WKTextCheckerCheckSpelling):
+        (WKTextCheckerChangeSpellingToWord):
+        (WKTextCheckerSetSpellCheckingLanguages):
+        (WKTextCheckerSetContinuousSpellCheckingEnabled):
+        * UIProcess/API/C/glib/WKTextCheckerGLib.h: Renamed from Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.h.
+        * UIProcess/gtk/WebTextChecker.h:
+        * UIProcess/gtk/WebTextCheckerClient.h:
+
 2021-10-09  Simon Fraser  <[email protected]>
 
         Run smooth scroll animations on the scrolling thread

Modified: trunk/Source/WebKit/PlatformGTK.cmake (283875 => 283876)


--- trunk/Source/WebKit/PlatformGTK.cmake	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Source/WebKit/PlatformGTK.cmake	2021-10-10 17:36:14 UTC (rev 283876)
@@ -426,6 +426,7 @@
     "${WEBKIT_DIR}/Shared/linux"
     "${WEBKIT_DIR}/Shared/soup"
     "${WEBKIT_DIR}/UIProcess/API/C/cairo"
+    "${WEBKIT_DIR}/UIProcess/API/C/glib"
     "${WEBKIT_DIR}/UIProcess/API/C/gtk"
     "${WEBKIT_DIR}/UIProcess/API/glib"
     "${WEBKIT_DIR}/UIProcess/API/gtk${GTK_API_VERSION}"

Modified: trunk/Source/WebKit/PlatformWPE.cmake (283875 => 283876)


--- trunk/Source/WebKit/PlatformWPE.cmake	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Source/WebKit/PlatformWPE.cmake	2021-10-10 17:36:14 UTC (rev 283876)
@@ -285,6 +285,7 @@
     "${WEBKIT_DIR}/Shared/libwpe"
     "${WEBKIT_DIR}/Shared/soup"
     "${WEBKIT_DIR}/UIProcess/API/C/cairo"
+    "${WEBKIT_DIR}/UIProcess/API/C/glib"
     "${WEBKIT_DIR}/UIProcess/API/C/wpe"
     "${WEBKIT_DIR}/UIProcess/API/glib"
     "${WEBKIT_DIR}/UIProcess/API/wpe"

Modified: trunk/Source/WebKit/SourcesGTK.txt (283875 => 283876)


--- trunk/Source/WebKit/SourcesGTK.txt	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Source/WebKit/SourcesGTK.txt	2021-10-10 17:36:14 UTC (rev 283876)
@@ -115,7 +115,8 @@
 UIProcess/API/C/WKGrammarDetail.cpp
 UIProcess/API/C/WKViewportAttributes.cpp
 
-UIProcess/API/C/gtk/WKTextCheckerGtk.cpp
+UIProcess/API/C/glib/WKTextCheckerGLib.cpp
+
 UIProcess/API/C/gtk/WKView.cpp
 
 UIProcess/API/glib/APIContentRuleListStoreGLib.cpp @no-unify

Modified: trunk/Source/WebKit/SourcesWPE.txt (283875 => 283876)


--- trunk/Source/WebKit/SourcesWPE.txt	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Source/WebKit/SourcesWPE.txt	2021-10-10 17:36:14 UTC (rev 283876)
@@ -108,6 +108,8 @@
 UIProcess/API/C/WKGrammarDetail.cpp
 UIProcess/API/C/WKViewportAttributes.cpp
 
+UIProcess/API/C/glib/WKTextCheckerGLib.cpp
+
 UIProcess/API/C/wpe/WKView.cpp
 
 UIProcess/API/glib/APIContentRuleListStoreGLib.cpp @no-unify

Copied: trunk/Source/WebKit/UIProcess/API/C/glib/WKTextCheckerGLib.cpp (from rev 283875, trunk/Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp) (0 => 283876)


--- trunk/Source/WebKit/UIProcess/API/C/glib/WKTextCheckerGLib.cpp	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/C/glib/WKTextCheckerGLib.cpp	2021-10-10 17:36:14 UTC (rev 283876)
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WKTextCheckerGLib.h"
+
+#include "TextChecker.h"
+#include "WKAPICast.h"
+#include "WebPageProxy.h"
+
+#if PLATFORM(GTK)
+#include "WebTextChecker.h"
+#endif
+
+using namespace WebKit;
+
+#if PLATFORM(GTK)
+
+void WKTextCheckerSetClient(const WKTextCheckerClientBase* wkClient)
+{
+    if (wkClient && wkClient->version)
+        return;
+    WebTextChecker::singleton()->setClient(wkClient);
+}
+
+void WKTextCheckerContinuousSpellCheckingEnabledStateChanged(bool enabled)
+{
+    WebTextChecker::singleton()->continuousSpellCheckingEnabledStateChanged(enabled);
+}
+
+void WKTextCheckerGrammarCheckingEnabledStateChanged(bool enabled)
+{
+    WebTextChecker::singleton()->grammarCheckingEnabledStateChanged(enabled);
+}
+
+void WKTextCheckerCheckSpelling(WKPageRef page, bool startBeforeSelection)
+{
+    WebTextChecker::singleton()->checkSpelling(toImpl(page), startBeforeSelection);
+}
+
+void WKTextCheckerChangeSpellingToWord(WKPageRef page, WKStringRef word)
+{
+    WebTextChecker::singleton()->changeSpellingToWord(toImpl(page), toWTFString(word));
+}
+
+void WKTextCheckerSetSpellCheckingLanguages(const char* const* languages)
+{
+#if ENABLE(SPELLCHECK)
+    Vector<String> spellCheckingLanguages;
+    for (size_t i = 0; languages[i]; ++i)
+        spellCheckingLanguages.append(String::fromUTF8(languages[i]));
+    WebKit::TextChecker::setSpellCheckingLanguages(spellCheckingLanguages);
+#endif
+}
+
+#endif // PLATFORM(GTK)
+
+void WKTextCheckerSetContinuousSpellCheckingEnabled(bool enabled)
+{
+    WebKit::TextChecker::setContinuousSpellCheckingEnabled(enabled);
+}

Copied: trunk/Source/WebKit/UIProcess/API/C/glib/WKTextCheckerGLib.h (from rev 283875, trunk/Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.h) (0 => 283876)


--- trunk/Source/WebKit/UIProcess/API/C/glib/WKTextCheckerGLib.h	                        (rev 0)
+++ trunk/Source/WebKit/UIProcess/API/C/glib/WKTextCheckerGLib.h	2021-10-10 17:36:14 UTC (rev 283876)
@@ -0,0 +1,99 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include <WebKit/WKBase.h>
+#include <WebKit/WKTextChecker.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT void WKTextCheckerSetTestingMode(bool enabled);
+
+#if PLATFORM(GTK)
+
+// TextChecker Client
+typedef bool (*WKTextCheckerContinousSpellCheckingAllowed)(const void *clientInfo);
+typedef bool (*WKTextCheckerContinousSpellCheckingEnabled)(const void *clientInfo);
+typedef void (*WKTextCheckerSetContinousSpellCheckingEnabled)(bool enabled, const void *clientInfo);
+typedef bool (*WKTextCheckerGrammarCheckingEnabled)(const void *clientInfo);
+typedef void (*WKTextCheckerSetGrammarCheckingEnabled)(bool enabled, const void *clientInfo);
+typedef uint64_t (*WKTextCheckerUniqueSpellDocumentTag)(WKPageRef page, const void *clientInfo);
+typedef void (*WKTextCheckerCloseSpellDocumentWithTag)(uint64_t tag, const void *clientInfo);
+typedef void (*WKTextCheckerCheckSpellingOfString)(uint64_t tag, WKStringRef text, int32_t* misspellingLocation, int32_t* misspellingLength, const void *clientInfo);
+typedef void (*WKTextCheckerCheckGrammarOfString)(uint64_t tag, WKStringRef text, WKArrayRef* grammarDetails, int32_t* badGrammarLocation, int32_t* badGrammarLength, const void *clientInfo);
+typedef bool (*WKTextCheckerSpellingUIIsShowing)(const void *clientInfo);
+typedef void (*WKTextCheckerToggleSpellingUIIsShowing)(const void *clientInfo);
+typedef void (*WKTextCheckerUpdateSpellingUIWithMisspelledWord)(uint64_t tag, WKStringRef misspelledWord, const void *clientInfo);
+typedef void (*WKTextCheckerUpdateSpellingUIWithGrammarString)(uint64_t tag, WKStringRef badGrammarPhrase, WKGrammarDetailRef grammarDetail, const void *clientInfo);
+typedef WKArrayRef (*WKTextCheckerGuessesForWord)(uint64_t tag, WKStringRef word, const void *clientInfo);
+typedef void (*WKTextCheckerLearnWord)(uint64_t tag, WKStringRef word, const void *clientInfo);
+typedef void (*WKTextCheckerIgnoreWord)(uint64_t tag, WKStringRef word, const void *clientInfo);
+
+typedef struct WKTextCheckerClientBase {
+    int                                                                     version;
+    const void *                                                            clientInfo;
+} WKTextCheckerClientBase;
+
+typedef struct WKTextCheckerClientV0 {
+    WKTextCheckerClientBase                                                 base;
+
+    WKTextCheckerContinousSpellCheckingAllowed                              continuousSpellCheckingAllowed;
+    WKTextCheckerContinousSpellCheckingEnabled                              continuousSpellCheckingEnabled;
+    WKTextCheckerSetContinousSpellCheckingEnabled                           setContinuousSpellCheckingEnabled;
+    WKTextCheckerGrammarCheckingEnabled                                     grammarCheckingEnabled;
+    WKTextCheckerSetGrammarCheckingEnabled                                  setGrammarCheckingEnabled;
+    WKTextCheckerUniqueSpellDocumentTag                                     uniqueSpellDocumentTag;
+    WKTextCheckerCloseSpellDocumentWithTag                                  closeSpellDocumentWithTag;
+    WKTextCheckerCheckSpellingOfString                                      checkSpellingOfString;
+    WKTextCheckerCheckGrammarOfString                                       checkGrammarOfString;
+    WKTextCheckerSpellingUIIsShowing                                        spellingUIIsShowing;
+    WKTextCheckerToggleSpellingUIIsShowing                                  toggleSpellingUIIsShowing;
+    WKTextCheckerUpdateSpellingUIWithMisspelledWord                         updateSpellingUIWithMisspelledWord;
+    WKTextCheckerUpdateSpellingUIWithGrammarString                          updateSpellingUIWithGrammarString;
+    WKTextCheckerGuessesForWord                                             guessesForWord;
+    WKTextCheckerLearnWord                                                  learnWord;
+    WKTextCheckerIgnoreWord                                                 ignoreWord;
+} WKTextCheckerClientV0;
+
+WK_EXPORT void WKTextCheckerSetClient(const WKTextCheckerClientBase* client);
+
+WK_EXPORT void WKTextCheckerContinuousSpellCheckingEnabledStateChanged(bool);
+WK_EXPORT void WKTextCheckerGrammarCheckingEnabledStateChanged(bool);
+
+WK_EXPORT void WKTextCheckerCheckSpelling(WKPageRef page, bool startBeforeSelection);
+WK_EXPORT void WKTextCheckerChangeSpellingToWord(WKPageRef page, WKStringRef word);
+
+WK_EXPORT void WKTextCheckerSetSpellCheckingLanguages(const char* const* languages);
+
+#endif // PLATFORM(GTK)
+
+WK_EXPORT void WKTextCheckerSetContinuousSpellCheckingEnabled(bool);
+
+#ifdef __cplusplus
+}
+#endif

Deleted: trunk/Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp (283875 => 283876)


--- trunk/Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp	2021-10-10 17:36:14 UTC (rev 283876)
@@ -1,76 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "WKTextCheckerGtk.h"
-
-#include "TextChecker.h"
-#include "WKAPICast.h"
-#include "WebPageProxy.h"
-#include "WebTextChecker.h"
-
-using namespace WebKit;
-
-void WKTextCheckerSetClient(const WKTextCheckerClientBase* wkClient)
-{
-    if (wkClient && wkClient->version)
-        return;
-    WebTextChecker::singleton()->setClient(wkClient);
-}
-
-void WKTextCheckerContinuousSpellCheckingEnabledStateChanged(bool enabled)
-{
-    WebTextChecker::singleton()->continuousSpellCheckingEnabledStateChanged(enabled);
-}
-
-void WKTextCheckerGrammarCheckingEnabledStateChanged(bool enabled)
-{
-    WebTextChecker::singleton()->grammarCheckingEnabledStateChanged(enabled);
-}
-
-void WKTextCheckerCheckSpelling(WKPageRef page, bool startBeforeSelection)
-{
-    WebTextChecker::singleton()->checkSpelling(toImpl(page), startBeforeSelection);
-}
-
-void WKTextCheckerChangeSpellingToWord(WKPageRef page, WKStringRef word)
-{
-    WebTextChecker::singleton()->changeSpellingToWord(toImpl(page), toWTFString(word));
-}
-
-void WKTextCheckerSetSpellCheckingLanguages(const char* const* languages)
-{
-#if ENABLE(SPELLCHECK)
-    Vector<String> spellCheckingLanguages;
-    for (size_t i = 0; languages[i]; ++i)
-        spellCheckingLanguages.append(String::fromUTF8(languages[i]));
-    WebKit::TextChecker::setSpellCheckingLanguages(spellCheckingLanguages);
-#endif
-}
-
-void WKTextCheckerSetContinuousSpellCheckingEnabled(bool enabled)
-{
-    WebKit::TextChecker::setContinuousSpellCheckingEnabled(enabled);
-}

Deleted: trunk/Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.h (283875 => 283876)


--- trunk/Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.h	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Source/WebKit/UIProcess/API/C/gtk/WKTextCheckerGtk.h	2021-10-10 17:36:14 UTC (rev 283876)
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2011 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
- * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
- * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
- * THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WKTextCheckerGtk_h
-#define WKTextCheckerGtk_h
-
-#include <WebKit/WKBase.h>
-#include <WebKit/WKTextChecker.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-WK_EXPORT void WKTextCheckerSetTestingMode(bool enabled);
-
-// TextChecker Client
-typedef bool (*WKTextCheckerContinousSpellCheckingAllowed)(const void *clientInfo);
-typedef bool (*WKTextCheckerContinousSpellCheckingEnabled)(const void *clientInfo);
-typedef void (*WKTextCheckerSetContinousSpellCheckingEnabled)(bool enabled, const void *clientInfo);
-typedef bool (*WKTextCheckerGrammarCheckingEnabled)(const void *clientInfo);
-typedef void (*WKTextCheckerSetGrammarCheckingEnabled)(bool enabled, const void *clientInfo);
-typedef uint64_t (*WKTextCheckerUniqueSpellDocumentTag)(WKPageRef page, const void *clientInfo);
-typedef void (*WKTextCheckerCloseSpellDocumentWithTag)(uint64_t tag, const void *clientInfo);
-typedef void (*WKTextCheckerCheckSpellingOfString)(uint64_t tag, WKStringRef text, int32_t* misspellingLocation, int32_t* misspellingLength, const void *clientInfo);
-typedef void (*WKTextCheckerCheckGrammarOfString)(uint64_t tag, WKStringRef text, WKArrayRef* grammarDetails, int32_t* badGrammarLocation, int32_t* badGrammarLength, const void *clientInfo);
-typedef bool (*WKTextCheckerSpellingUIIsShowing)(const void *clientInfo);
-typedef void (*WKTextCheckerToggleSpellingUIIsShowing)(const void *clientInfo);
-typedef void (*WKTextCheckerUpdateSpellingUIWithMisspelledWord)(uint64_t tag, WKStringRef misspelledWord, const void *clientInfo);
-typedef void (*WKTextCheckerUpdateSpellingUIWithGrammarString)(uint64_t tag, WKStringRef badGrammarPhrase, WKGrammarDetailRef grammarDetail, const void *clientInfo);
-typedef WKArrayRef (*WKTextCheckerGuessesForWord)(uint64_t tag, WKStringRef word, const void *clientInfo);
-typedef void (*WKTextCheckerLearnWord)(uint64_t tag, WKStringRef word, const void *clientInfo);
-typedef void (*WKTextCheckerIgnoreWord)(uint64_t tag, WKStringRef word, const void *clientInfo);
-
-typedef struct WKTextCheckerClientBase {
-    int                                                                     version;
-    const void *                                                            clientInfo;
-} WKTextCheckerClientBase;
-
-typedef struct WKTextCheckerClientV0 {
-    WKTextCheckerClientBase                                                 base;
-
-    WKTextCheckerContinousSpellCheckingAllowed                              continuousSpellCheckingAllowed;
-    WKTextCheckerContinousSpellCheckingEnabled                              continuousSpellCheckingEnabled;
-    WKTextCheckerSetContinousSpellCheckingEnabled                           setContinuousSpellCheckingEnabled;
-    WKTextCheckerGrammarCheckingEnabled                                     grammarCheckingEnabled;
-    WKTextCheckerSetGrammarCheckingEnabled                                  setGrammarCheckingEnabled;
-    WKTextCheckerUniqueSpellDocumentTag                                     uniqueSpellDocumentTag;
-    WKTextCheckerCloseSpellDocumentWithTag                                  closeSpellDocumentWithTag;
-    WKTextCheckerCheckSpellingOfString                                      checkSpellingOfString;
-    WKTextCheckerCheckGrammarOfString                                       checkGrammarOfString;
-    WKTextCheckerSpellingUIIsShowing                                        spellingUIIsShowing;
-    WKTextCheckerToggleSpellingUIIsShowing                                  toggleSpellingUIIsShowing;
-    WKTextCheckerUpdateSpellingUIWithMisspelledWord                         updateSpellingUIWithMisspelledWord;
-    WKTextCheckerUpdateSpellingUIWithGrammarString                          updateSpellingUIWithGrammarString;
-    WKTextCheckerGuessesForWord                                             guessesForWord;
-    WKTextCheckerLearnWord                                                  learnWord;
-    WKTextCheckerIgnoreWord                                                 ignoreWord;
-} WKTextCheckerClientV0;
-
-WK_EXPORT void WKTextCheckerSetClient(const WKTextCheckerClientBase* client);
-
-WK_EXPORT void WKTextCheckerContinuousSpellCheckingEnabledStateChanged(bool);
-WK_EXPORT void WKTextCheckerGrammarCheckingEnabledStateChanged(bool);
-
-WK_EXPORT void WKTextCheckerCheckSpelling(WKPageRef page, bool startBeforeSelection);
-WK_EXPORT void WKTextCheckerChangeSpellingToWord(WKPageRef page, WKStringRef word);
-
-WK_EXPORT void WKTextCheckerSetSpellCheckingLanguages(const char* const* languages);
-WK_EXPORT void WKTextCheckerSetContinuousSpellCheckingEnabled(bool);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif

Modified: trunk/Source/WebKit/UIProcess/gtk/WebTextChecker.h (283875 => 283876)


--- trunk/Source/WebKit/UIProcess/gtk/WebTextChecker.h	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Source/WebKit/UIProcess/gtk/WebTextChecker.h	2021-10-10 17:36:14 UTC (rev 283876)
@@ -26,7 +26,7 @@
 #pragma once
 
 #include "APIObject.h"
-#include "WKTextCheckerGtk.h"
+#include "WKTextCheckerGLib.h"
 #include "WebTextCheckerClient.h"
 #include <wtf/Forward.h>
 

Modified: trunk/Source/WebKit/UIProcess/gtk/WebTextCheckerClient.h (283875 => 283876)


--- trunk/Source/WebKit/UIProcess/gtk/WebTextCheckerClient.h	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Source/WebKit/UIProcess/gtk/WebTextCheckerClient.h	2021-10-10 17:36:14 UTC (rev 283876)
@@ -26,7 +26,7 @@
 #pragma once
 
 #include "APIClient.h"
-#include "WKTextCheckerGtk.h"
+#include "WKTextCheckerGLib.h"
 #include <WebCore/TextCheckerClient.h>
 #include <wtf/Forward.h>
 

Modified: trunk/Tools/ChangeLog (283875 => 283876)


--- trunk/Tools/ChangeLog	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Tools/ChangeLog	2021-10-10 17:36:14 UTC (rev 283876)
@@ -1,3 +1,16 @@
+2021-10-10  Michael Catanzaro  <[email protected]>
+
+        [WPE] Expose WKTextCheckerSetContinuousSpellCheckingEnabled and use it from WKTR
+        https://bugs.webkit.org/show_bug.cgi?id=231446
+
+        Reviewed by Philippe Normand.
+
+        * WebKitTestRunner/gtk/TestControllerGtk.cpp:
+        * WebKitTestRunner/gtk/UIScriptControllerGtk.cpp:
+        * WebKitTestRunner/gtk/main.cpp:
+        * WebKitTestRunner/wpe/UIScriptControllerWPE.cpp:
+        (WTR::UIScriptControllerWPE::setContinuousSpellCheckingEnabled):
+
 2021-10-09  Beth Dakin  <[email protected]>
 
         Pull modifier key extraction into TestRunnerShared

Modified: trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp (283875 => 283876)


--- trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Tools/WebKitTestRunner/gtk/TestControllerGtk.cpp	2021-10-10 17:36:14 UTC (rev 283876)
@@ -28,7 +28,7 @@
 #include "TestController.h"
 
 #include "PlatformWebView.h"
-#include <WebKit/WKTextCheckerGtk.h>
+#include <WebKit/WKTextCheckerGLib.h>
 #include <gtk/gtk.h>
 #include <wtf/Platform.h>
 #include <wtf/RunLoop.h>

Modified: trunk/Tools/WebKitTestRunner/gtk/UIScriptControllerGtk.cpp (283875 => 283876)


--- trunk/Tools/WebKitTestRunner/gtk/UIScriptControllerGtk.cpp	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Tools/WebKitTestRunner/gtk/UIScriptControllerGtk.cpp	2021-10-10 17:36:14 UTC (rev 283876)
@@ -31,7 +31,7 @@
 #include "TestController.h"
 #include "UIScriptContext.h"
 #include <_javascript_Core/OpaqueJSString.h>
-#include <WebKit/WKTextCheckerGtk.h>
+#include <WebKit/WKTextCheckerGLib.h>
 #include <WebKit/WKViewPrivate.h>
 #include <gtk/gtk.h>
 #include <wtf/RunLoop.h>

Modified: trunk/Tools/WebKitTestRunner/gtk/main.cpp (283875 => 283876)


--- trunk/Tools/WebKitTestRunner/gtk/main.cpp	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Tools/WebKitTestRunner/gtk/main.cpp	2021-10-10 17:36:14 UTC (rev 283876)
@@ -27,7 +27,7 @@
 
 #include "TestController.h"
 #include <WebCore/GtkVersioning.h>
-#include <WebKit/WKTextCheckerGtk.h>
+#include <WebKit/WKTextCheckerGLib.h>
 #include <wtf/glib/GRefPtr.h>
 
 int main(int argc, char** argv)

Modified: trunk/Tools/WebKitTestRunner/wpe/UIScriptControllerWPE.cpp (283875 => 283876)


--- trunk/Tools/WebKitTestRunner/wpe/UIScriptControllerWPE.cpp	2021-10-10 16:05:45 UTC (rev 283875)
+++ trunk/Tools/WebKitTestRunner/wpe/UIScriptControllerWPE.cpp	2021-10-10 17:36:14 UTC (rev 283876)
@@ -29,9 +29,9 @@
 #include "EventSenderProxy.h"
 #include "PlatformWebView.h"
 #include "TestController.h"
-#include "TextChecker.h"
 #include "UIScriptContext.h"
 #include <_javascript_Core/OpaqueJSString.h>
+#include <WebKit/WKTextCheckerGLib.h>
 #include <wtf/RunLoop.h>
 
 namespace WTR {
@@ -53,7 +53,7 @@
 
 void UIScriptControllerWPE::setContinuousSpellCheckingEnabled(bool enabled)
 {
-    WebKit::TextChecker::setContinuousSpellCheckingEnabled(enabled);
+    WKTextCheckerSetContinuousSpellCheckingEnabled(enabled);
 }
 
 void UIScriptControllerWPE::copyText(JSStringRef)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to