Diff
Modified: trunk/Source/WebKit/gtk/ChangeLog (88630 => 88631)
--- trunk/Source/WebKit/gtk/ChangeLog 2011-06-13 06:38:38 UTC (rev 88630)
+++ trunk/Source/WebKit/gtk/ChangeLog 2011-06-13 08:56:53 UTC (rev 88631)
@@ -1,3 +1,15 @@
+2011-06-13 Carlos Garcia Campos <cgar...@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Export an API similar to WebKit1
+ https://bugs.webkit.org/show_bug.cgi?id=57820
+
+ * GNUmakefile.am: Add webkitwebviewcommon.h to public header list.
+ * webkit/webkitwebview.h: Move declarations common to WebKit2 to
+ webkitwebviewcommon.h.
+ * webkit/webkitwebviewcommon.h: Added.
+
2011-06-12 Adam Barth <aba...@webkit.org>
Reviewed by Alexey Proskuryakov.
Modified: trunk/Source/WebKit/gtk/GNUmakefile.am (88630 => 88631)
--- trunk/Source/WebKit/gtk/GNUmakefile.am 2011-06-13 06:38:38 UTC (rev 88630)
+++ trunk/Source/WebKit/gtk/GNUmakefile.am 2011-06-13 08:56:53 UTC (rev 88631)
@@ -137,7 +137,8 @@
$(srcdir)/Source/WebKit/gtk/webkit/webkitwebresource.h \
$(srcdir)/Source/WebKit/gtk/webkit/webkitwebsettings.h \
$(srcdir)/Source/WebKit/gtk/webkit/webkitwebwindowfeatures.h \
- $(srcdir)/Source/WebKit/gtk/webkit/webkitwebview.h
+ $(srcdir)/Source/WebKit/gtk/webkit/webkitwebview.h \
+ $(srcdir)/Source/WebKit/gtk/webkit/webkitwebviewcommon.h
webkitgtk_built_h_api += \
Source/WebKit/gtk/webkit/webkitversion.h
Modified: trunk/Source/WebKit/gtk/webkit/webkitwebview.h (88630 => 88631)
--- trunk/Source/WebKit/gtk/webkit/webkitwebview.h 2011-06-13 06:38:38 UTC (rev 88630)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebview.h 2011-06-13 08:56:53 UTC (rev 88631)
@@ -32,6 +32,7 @@
#include <webkit/webkitwebframe.h>
#include <webkit/webkitwebhistoryitem.h>
#include <webkit/webkitwebsettings.h>
+#include <webkit/webkitwebviewcommon.h>
G_BEGIN_DECLS
@@ -153,16 +154,7 @@
void (*_webkit_reserved2) (void);
};
-WEBKIT_API GType
-webkit_web_view_get_type (void);
-
-WEBKIT_API GtkWidget *
-webkit_web_view_new (void);
-
WEBKIT_API G_CONST_RETURN gchar *
-webkit_web_view_get_title (WebKitWebView *webView);
-
-WEBKIT_API G_CONST_RETURN gchar *
webkit_web_view_get_uri (WebKitWebView *webView);
WEBKIT_API void
@@ -187,16 +179,10 @@
webkit_web_view_can_go_forward (WebKitWebView *webView);
WEBKIT_API void
-webkit_web_view_go_back (WebKitWebView *webView);
-
-WEBKIT_API void
webkit_web_view_go_back_or_forward (WebKitWebView *webView,
gint steps);
WEBKIT_API void
-webkit_web_view_go_forward (WebKitWebView *webView);
-
-WEBKIT_API void
webkit_web_view_stop_loading (WebKitWebView *webView);
WEBKIT_API void
@@ -210,10 +196,6 @@
webkit_web_view_reload_bypass_cache (WebKitWebView *webView);
WEBKIT_API void
-webkit_web_view_load_uri (WebKitWebView *webView,
- const gchar *uri);
-
-WEBKIT_API void
webkit_web_view_load_string (WebKitWebView *webView,
const gchar *content,
const gchar *mime_type,
Added: trunk/Source/WebKit/gtk/webkit/webkitwebviewcommon.h (0 => 88631)
--- trunk/Source/WebKit/gtk/webkit/webkitwebviewcommon.h (rev 0)
+++ trunk/Source/WebKit/gtk/webkit/webkitwebviewcommon.h 2011-06-13 08:56:53 UTC (rev 88631)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2007, 2008 Alp Toker <a...@atoker.com>
+ * Copyright (C) 2008 Collabora Ltd.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef webkitwebviewcommon_h
+#define webkitwebviewcommon_h
+
+G_BEGIN_DECLS
+
+WEBKIT_API GType
+webkit_web_view_get_type (void);
+
+WEBKIT_API GtkWidget *
+webkit_web_view_new (void);
+
+WEBKIT_API G_CONST_RETURN gchar *
+webkit_web_view_get_title (WebKitWebView *webView);
+
+WEBKIT_API void
+webkit_web_view_go_back (WebKitWebView *webView);
+
+WEBKIT_API void
+webkit_web_view_go_forward (WebKitWebView *webView);
+
+WEBKIT_API void
+webkit_web_view_load_uri (WebKitWebView *webView,
+ const gchar *uri);
+
+G_END_DECLS
+
+#endif
Modified: trunk/Source/WebKit2/ChangeLog (88630 => 88631)
--- trunk/Source/WebKit2/ChangeLog 2011-06-13 06:38:38 UTC (rev 88630)
+++ trunk/Source/WebKit2/ChangeLog 2011-06-13 08:56:53 UTC (rev 88631)
@@ -1,3 +1,29 @@
+2011-06-13 Carlos Garcia Campos <cgar...@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Export an API similar to WebKit1
+ https://bugs.webkit.org/show_bug.cgi?id=57820
+
+ Add first implementation of WebKitWebView, a class with the same
+ API than webkit1, that wraps the C API to provide a high level
+ WebKit2 API for GTK port.
+
+ * GNUmakefile.am: Add new files to compilation.
+ * UIProcess/API/gtk/WebKitWebView.cpp: Added.
+ (webkit_web_view_init):
+ (webkit_web_view_class_init):
+ (webkit_web_view_new):
+ (webkit_web_view_load_uri):
+ (webkit_web_view_go_back):
+ (webkit_web_view_go_forward):
+ * UIProcess/API/gtk/WebKitWebView.h: Added.
+ * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+ (webkitWebViewBaseCreate):
+ (webkitWebViewBaseCreateWebPage):
+ * UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
+ * UIProcess/API/gtk/webkit/webkit.h: Added.
+
2011-06-12 Adam Barth <aba...@webkit.org>
Reviewed by Alexey Proskuryakov.
Modified: trunk/Source/WebKit2/GNUmakefile.am (88630 => 88631)
--- trunk/Source/WebKit2/GNUmakefile.am 2011-06-13 06:38:38 UTC (rev 88630)
+++ trunk/Source/WebKit2/GNUmakefile.am 2011-06-13 08:56:53 UTC (rev 88631)
@@ -65,7 +65,9 @@
$(WebKit2)/UIProcess/API/C/WKProtectionSpaceTypes.h \
$(WebKit2)/UIProcess/API/C/WKResourceCacheManager.h \
$(WebKit2)/UIProcess/API/cpp/WKRetainPtr.h \
- $(WebKit2)/UIProcess/API/gtk/WebKitWebViewBase.h
+ $(WebKit2)/UIProcess/API/gtk/WebKitWebView.h \
+ $(WebKit2)/UIProcess/API/gtk/WebKitWebViewBase.h \
+ $(WebKit2)/UIProcess/API/gtk/webkit/webkit.h
nodist_libwebkit2gtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
$(webkit2_built_sources)
@@ -360,9 +362,12 @@
Source/WebKit2/UIProcess/API/cpp/WKRetainPtr.h \
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h \
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h \
+ Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp \
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.h \
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp \
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h \
+ Source/WebKit2/UIProcess/API/gtk/webkit/webkit.h \
Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.cpp \
Source/WebKit2/UIProcess/Authentication/AuthenticationChallengeProxy.h \
Source/WebKit2/UIProcess/Authentication/AuthenticationDecisionListener.cpp \
Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (0 => 88631)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp 2011-06-13 08:56:53 UTC (rev 88631)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2011 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "WebKitWebView.h"
+
+#include "NotImplemented.h"
+#include "WebKitWebViewBasePrivate.h"
+#include "WebPageProxy.h"
+#include <WebKit2/WKBase.h>
+#include <WebKit2/WKURL.h>
+
+using namespace WebKit;
+using namespace WebCore;
+
+G_DEFINE_TYPE(WebKitWebView, webkit_web_view, WEBKIT_TYPE_WEB_VIEW_BASE)
+
+static void webkit_web_view_init(WebKitWebView* webView)
+{
+ webkitWebViewBaseCreateWebPage(WEBKIT_WEB_VIEW_BASE(webView), WKContextGetSharedProcessContext(), 0);
+}
+
+static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
+{
+}
+
+// Public API.
+GtkWidget* webkit_web_view_new()
+{
+ return GTK_WIDGET(WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, NULL)));
+}
+
+void webkit_web_view_load_uri(WebKitWebView* webView, const gchar* uri)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+ g_return_if_fail(uri);
+
+ WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
+ WKPageLoadURL(toAPI(page), WKURLCreateWithUTF8CString(uri));
+}
+
+void webkit_web_view_go_back(WebKitWebView* webView)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+
+ WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
+ WKPageGoBack(toAPI(page));
+}
+
+void webkit_web_view_go_forward(WebKitWebView* webView)
+{
+ g_return_if_fail(WEBKIT_IS_WEB_VIEW(webView));
+
+ WebPageProxy* page = webkitWebViewBaseGetPage(WEBKIT_WEB_VIEW_BASE(webView));
+ WKPageGoForward(toAPI(page));
+}
Added: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h (0 => 88631)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebView.h 2011-06-13 08:56:53 UTC (rev 88631)
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2007 Holger Hans Peter Freyther
+ * Copyright (C) 2007, 2008 Alp Toker <a...@atoker.com>
+ * Copyright (C) 2008 Collabora Ltd.
+ * Copyright (C) 2011 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef WebKitWebView_h
+#define WebKitWebView_h
+
+#include <WebKit2/WebKitWebViewBase.h>
+#include <webkit/webkitdefines.h>
+#include <webkit/webkitwebviewcommon.h>
+
+G_BEGIN_DECLS
+
+#define WEBKIT_TYPE_WEB_VIEW (webkit_web_view_get_type())
+#define WEBKIT_WEB_VIEW(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_WEB_VIEW, WebKitWebView))
+#define WEBKIT_WEB_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_WEB_VIEW, WebKitWebViewClass))
+#define WEBKIT_IS_WEB_VIEW(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_WEB_VIEW))
+#define WEBKIT_IS_WEB_VIEW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_WEB_VIEW))
+#define WEBKIT_WEB_VIEW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_WEB_VIEW, WebKitWebViewClass))
+
+typedef struct _WebKitWebViewPrivate WebKitWebViewPrivate;
+
+struct _WebKitWebView {
+ WebKitWebViewBase parent;
+
+ /*< private >*/
+ WebKitWebViewPrivate *priv;
+};
+
+struct _WebKitWebViewClass {
+ WebKitWebViewBaseClass parent;
+
+ /* Padding for future expansion */
+ void (*_webkit_reserved0) (void);
+ void (*_webkit_reserved1) (void);
+ void (*_webkit_reserved2) (void);
+ void (*_webkit_reserved3) (void);
+ void (*_webkit_reserved4) (void);
+ void (*_webkit_reserved5) (void);
+ void (*_webkit_reserved6) (void);
+ void (*_webkit_reserved7) (void);
+};
+
+G_END_DECLS
+
+#endif
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp (88630 => 88631)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp 2011-06-13 06:38:38 UTC (rev 88630)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp 2011-06-13 08:56:53 UTC (rev 88631)
@@ -337,11 +337,7 @@
WebKitWebViewBase* webkitWebViewBaseCreate(WebContext* context, WebPageGroup* pageGroup)
{
WebKitWebViewBase* webkitWebViewBase = WEBKIT_WEB_VIEW_BASE(g_object_new(WEBKIT_TYPE_WEB_VIEW_BASE, NULL));
- WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
-
- priv->pageProxy = context->createWebPage(priv->pageClient.get(), pageGroup);
- priv->pageProxy->initializeWebPage();
-
+ webkitWebViewBaseCreateWebPage(webkitWebViewBase, toAPI(context), toAPI(pageGroup));
return webkitWebViewBase;
}
@@ -355,6 +351,14 @@
return webkitWebViewBase->priv->pageProxy.get();
}
+void webkitWebViewBaseCreateWebPage(WebKitWebViewBase* webkitWebViewBase, WKContextRef context, WKPageGroupRef pageGroup)
+{
+ WebKitWebViewBasePrivate* priv = webkitWebViewBase->priv;
+
+ priv->pageProxy = toImpl(context)->createWebPage(priv->pageClient.get(), toImpl(pageGroup));
+ priv->pageProxy->initializeWebPage();
+}
+
void webkitWebViewBaseSetTooltipText(WebKitWebViewBase* webViewBase, const char* tooltip)
{
#if GTK_CHECK_VERSION(2, 12, 0)
Modified: trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h (88630 => 88631)
--- trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h 2011-06-13 06:38:38 UTC (rev 88630)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h 2011-06-13 08:56:53 UTC (rev 88631)
@@ -30,6 +30,7 @@
#include "WebKitWebViewBase.h"
#include "WebPageProxy.h"
+#include <WebKit2/WebKit2.h>
using namespace WebKit;
@@ -41,6 +42,8 @@
WebPageProxy* webkitWebViewBaseGetPage(WebKitWebViewBase*);
+void webkitWebViewBaseCreateWebPage(WebKitWebViewBase*, WKContextRef, WKPageGroupRef);
+
void webkitWebViewBaseSetTooltipText(WebKitWebViewBase*, const char*);
G_END_DECLS
Added: trunk/Source/WebKit2/UIProcess/API/gtk/webkit/webkit.h (0 => 88631)
--- trunk/Source/WebKit2/UIProcess/API/gtk/webkit/webkit.h (rev 0)
+++ trunk/Source/WebKit2/UIProcess/API/gtk/webkit/webkit.h 2011-06-13 08:56:53 UTC (rev 88631)
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2011 Igalia S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __WEBKIT_H__
+#define __WEBKIT_H__
+
+#include <WebKit2/WebKit2.h>
+#include <WebKit2/WebKitWebViewBase.h>
+#include <WebKit2/WebKitWebView.h>
+
+#endif /* __WEBKIT_H__ */
Modified: trunk/Tools/ChangeLog (88630 => 88631)
--- trunk/Tools/ChangeLog 2011-06-13 06:38:38 UTC (rev 88630)
+++ trunk/Tools/ChangeLog 2011-06-13 08:56:53 UTC (rev 88631)
@@ -1,3 +1,18 @@
+2011-06-13 Carlos Garcia Campos <cgar...@igalia.com>
+
+ Reviewed by Martin Robinson.
+
+ [GTK] Export an API similar to WebKit1
+ https://bugs.webkit.org/show_bug.cgi?id=57820
+
+ Build GtkLauncher2 for WebKit2. It's actually the same GtkLauncher
+ code, but linking to libwebkit2gtk.
+
+ * GNUmakefile.am:
+ * GtkLauncher/main.c:
+ (createBrowser):
+ (main):
+
2011-06-12 MORITA Hajime <morr...@google.com>
Unreviewed, rolling out r88625.
Modified: trunk/Tools/GNUmakefile.am (88630 => 88631)
--- trunk/Tools/GNUmakefile.am 2011-06-13 06:38:38 UTC (rev 88630)
+++ trunk/Tools/GNUmakefile.am 2011-06-13 08:56:53 UTC (rev 88631)
@@ -3,7 +3,32 @@
Programs/GtkLauncher \
Programs/ImageDiff
+if ENABLE_WEBKIT2
+noinst_PROGRAMS += \
+ Programs/GtkLauncher2
+endif
+
# GtkLauncher
+gtklauncher_sources = \
+ Tools/GtkLauncher/main.c
+
+gtklauncher_cflags = \
+ -fno-strict-aliasing \
+ $(global_cflags) \
+ $(GTK_CFLAGS) \
+ $(LIBSOUP_CFLAGS)
+
+gtklauncher_ldadd = \
+ libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
+ $(GTK_LIBS) \
+ $(GLIB_LIBS) \
+ $(LIBSOUP_LIBS) \
+ $(WINMM_LIBS)
+
+gtklauncher_ldflags = \
+ -no-fast-install \
+ -no-install
+
Programs_GtkLauncher_CPPFLAGS = \
-I$(srcdir)/Source/WebKit/gtk \
-I$(srcdir)/Source/WebCore/platform/network/soup/cache/ \
@@ -13,27 +38,47 @@
$(_javascript_core_cppflags)
Programs_GtkLauncher_SOURCES = \
- Tools/GtkLauncher/main.c
+ $(gtklauncher_sources)
Programs_GtkLauncher_CFLAGS = \
-ansi \
- -fno-strict-aliasing \
- $(global_cflags) \
- $(GTK_CFLAGS) \
- $(LIBSOUP_CFLAGS)
+ $(gtklauncher_cflags)
Programs_GtkLauncher_LDADD = \
- libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
- $(GTK_LIBS) \
- $(GLIB_LIBS) \
- $(LIBSOUP_LIBS) \
- $(WINMM_LIBS)
+ $(gtklauncher_ldadd)
Programs_GtkLauncher_LDFLAGS = \
- -no-fast-install \
- -no-install
+ $(gtklauncher_ldflags)
+if ENABLE_WEBKIT2
+Programs_GtkLauncher2_CPPFLAGS = \
+ -I$(srcdir)/Source \
+ -I$(top_builddir)/DerivedSources/WebKit2/include \
+ -I$(srcdir)/Source/WebKit2/UIProcess/API/gtk \
+ -I$(top_builddir)/Source/WebKit2/UIProcess/API/gtk \
+ -I$(srcdir)/Source/WebKit/gtk \
+ -I$(top_builddir)/Source/WebKit/gtk \
+ -I$(top_builddir)/DerivedSources \
+ $(global_cppflags) \
+ $(_javascript_core_cppflags)
+
+Programs_GtkLauncher2_SOURCES = \
+ $(gtklauncher_sources)
+
+Programs_GtkLauncher2_CFLAGS = \
+ -DWEBKIT2=\"1\" \
+ $(gtklauncher_cflags)
+
+Programs_GtkLauncher2_LDADD = \
+ libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
+ $(gtklauncher_ldadd)
+
+Programs_GtkLauncher2_LDFLAGS = \
+ $(gtklauncher_ldflags)
+
+endif
+
# libWebCoreInternals
# We must split off the window.internals implementation into a separate
# convenience library because it requires a different include path order
@@ -190,6 +235,11 @@
Programs/GtkLauncher \
Programs/ImageDiff
+if ENABLE_WEBKIT2
+CLEANFILES += \
+ Programs/GtkLauncher2
+endif
+
if TARGET_X11
# Build TestNetscapePlugin only for X11
Modified: trunk/Tools/GtkLauncher/main.c (88630 => 88631)
--- trunk/Tools/GtkLauncher/main.c 2011-06-13 06:38:38 UTC (rev 88630)
+++ trunk/Tools/GtkLauncher/main.c 2011-06-13 08:56:53 UTC (rev 88631)
@@ -39,6 +39,7 @@
webkit_web_view_load_uri(webView, uri);
}
+#ifndef WEBKIT2
static void updateTitle(GtkWindow* window, WebKitWebView* webView)
{
GString *string = g_string_new(webkit_web_view_get_title(webView));
@@ -80,6 +81,7 @@
{
updateTitle(GTK_WINDOW(window), webView);
}
+#endif
static void destroyCb(GtkWidget* widget, GtkWidget* window)
{
@@ -97,6 +99,7 @@
webkit_web_view_go_forward(webView);
}
+#ifndef WEBKIT2
static WebKitWebView*
createWebViewCb(WebKitWebView* webView, WebKitWebFrame* web_frame, GtkWidget* window)
{
@@ -117,6 +120,7 @@
gtk_widget_destroy(window);
return TRUE;
}
+#endif
static GtkWidget* createBrowser(GtkWidget* window, GtkWidget* uriEntry, GtkWidget* statusbar, WebKitWebView* webView)
{
@@ -125,6 +129,7 @@
gtk_container_add(GTK_CONTAINER(scrolledWindow), GTK_WIDGET(webView));
+#ifndef WEBKIT2
g_signal_connect(webView, "notify::title", G_CALLBACK(notifyTitleCb), window);
g_signal_connect(webView, "notify::load-status", G_CALLBACK(notifyLoadStatusCb), uriEntry);
g_signal_connect(webView, "notify::progress", G_CALLBACK(notifyProgressCb), window);
@@ -132,6 +137,7 @@
g_signal_connect(webView, "create-web-view", G_CALLBACK(createWebViewCb), window);
g_signal_connect(webView, "web-view-ready", G_CALLBACK(webViewReadyCb), window);
g_signal_connect(webView, "close-web-view", G_CALLBACK(closeWebViewCb), window);
+#endif
return scrolledWindow;
}
@@ -239,6 +245,7 @@
if (!g_thread_supported())
g_thread_init(NULL);
+#ifndef WEBKIT2
#ifdef SOUP_TYPE_PROXY_RESOLVER_DEFAULT
soup_session_add_feature_by_type(webkit_get_default_session(), SOUP_TYPE_PROXY_RESOLVER_DEFAULT);
#else
@@ -249,6 +256,7 @@
soup_uri_free(proxyUri);
}
#endif
+#endif
main_window = createWindow(&webView);