summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/API/C/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/API/C/gtk')
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h12
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h2
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h4
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp39
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.h41
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp5
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKView.h4
-rw-r--r--Source/WebKit2/UIProcess/API/C/gtk/WKViewPrivate.h2
8 files changed, 101 insertions, 8 deletions
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h b/Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h
index 9eb0c78ad..a06292b2e 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKAPICastGtk.h
@@ -37,6 +37,18 @@ namespace WebKit {
WK_ADD_API_MAPPING(WKViewRef, WebKitWebViewBase)
+template<>
+inline WKViewRef toAPI<>(WebKitWebViewBase* view)
+{
+ return reinterpret_cast<WKViewRef>(static_cast<void*>(view));
+}
+
+template<>
+inline WebKitWebViewBase* toImpl<>(WKViewRef view)
+{
+ return static_cast<WebKitWebViewBase*>(static_cast<void*>(const_cast<typename std::remove_const<typename std::remove_pointer<WKViewRef>::type>::type*>(view)));
+}
+
}
#endif // WKAPICastGtk_h
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h b/Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h
index a292dda11..cece1057b 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKFullScreenClientGtk.h
@@ -26,7 +26,7 @@
#ifndef WKFullScreenClientGtk_h
#define WKFullScreenClientGtk_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h b/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h
index 28242da09..2e60bc793 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKInspectorClientGtk.h
@@ -26,7 +26,7 @@
#ifndef WKInspectorClientGtk_h
#define WKInspectorClientGtk_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
@@ -37,6 +37,7 @@ typedef void (*WKInspectorClientGtkInspectorDidCloseCallback)(WKInspectorRef ins
typedef void (*WKInspectorClientGtkInspectedURLChangedCallback)(WKInspectorRef inspector, WKStringRef url, const void* clientInfo);
typedef void (*WKInspectorClientGtkDidChangeAttachedHeightCallback)(WKInspectorRef inspector, unsigned height, const void* clientInfo);
typedef void (*WKInspectorClientGtkDidChangeAttachedWidthCallback)(WKInspectorRef inspector, unsigned width, const void* clientInfo);
+typedef void (*WKInspectorClientGtkDidChangeAttachAvailabilityCallback)(WKInspectorRef inspector, bool available, const void* clientInfo);
typedef struct WKInspectorClientGtkBase {
int version;
@@ -54,6 +55,7 @@ typedef struct WKInspectorClientGtkV0 {
WKInspectorClientGtkInspectorCallback detach;
WKInspectorClientGtkDidChangeAttachedHeightCallback didChangeAttachedHeight;
WKInspectorClientGtkDidChangeAttachedWidthCallback didChangeAttachedWidth;
+ WKInspectorClientGtkDidChangeAttachAvailabilityCallback didChangeAttachAvailability;
} WKInspectorClientGtkV0;
WK_EXPORT void WKInspectorSetInspectorClientGtk(WKInspectorRef inspectorRef, const WKInspectorClientGtkBase* client);
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp b/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp
new file mode 100644
index 000000000..2924ba6db
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * 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"
+
+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
+}
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.h b/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.h
new file mode 100644
index 000000000..1f6e55a66
--- /dev/null
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKTextCheckerGtk.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2015 Igalia S.L.
+ *
+ * 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>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT void WKTextCheckerSetSpellCheckingLanguages(const char* const* languages);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* WKTextCheckerGtk_h */
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp b/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp
index 6f0c04bf2..48c41ac77 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKView.cpp
@@ -33,11 +33,10 @@
#include "WebKitWebViewBasePrivate.h"
using namespace WebKit;
-using namespace WebCore;
-WKViewRef WKViewCreate(WKContextRef contextRef, WKPageGroupRef pageGroupRef)
+WKViewRef WKViewCreate(WKPageConfigurationRef configuration)
{
- return toAPI(webkitWebViewBaseCreate(toImpl(contextRef), toImpl(pageGroupRef), nullptr));
+ return toAPI(webkitWebViewBaseCreate(*toImpl(configuration)));
}
WKPageRef WKViewGetPage(WKViewRef viewRef)
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKView.h b/Source/WebKit2/UIProcess/API/C/gtk/WKView.h
index 291dfe1b6..989ab66a2 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKView.h
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKView.h
@@ -28,13 +28,13 @@
#ifndef WKView_h
#define WKView_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {
#endif
-WK_EXPORT WKViewRef WKViewCreate(WKContextRef context, WKPageGroupRef pageGroup);
+WK_EXPORT WKViewRef WKViewCreate(WKPageConfigurationRef configuration);
WK_EXPORT WKPageRef WKViewGetPage(WKViewRef view);
diff --git a/Source/WebKit2/UIProcess/API/C/gtk/WKViewPrivate.h b/Source/WebKit2/UIProcess/API/C/gtk/WKViewPrivate.h
index 2c1b2d1f0..acabfd3af 100644
--- a/Source/WebKit2/UIProcess/API/C/gtk/WKViewPrivate.h
+++ b/Source/WebKit2/UIProcess/API/C/gtk/WKViewPrivate.h
@@ -26,7 +26,7 @@
#ifndef WKViewPrivate_h
#define WKViewPrivate_h
-#include <WebKit2/WKBase.h>
+#include <WebKit/WKBase.h>
#ifdef __cplusplus
extern "C" {