[evolution/wip-webkit2] Fix compilation of WK2 WebExtensions



commit f4df8004ef0214662fe9aeac03269aa77dafb329
Author: Tomas Popela <tpopela redhat com>
Date:   Fri Oct 18 13:23:20 2013 +0200

    Fix compilation of WK2 WebExtensions

 configure.ac                             |    1 +
 e-util/e-dom-utils.c                     |    2 +-
 e-util/e-dom-utils.h                     |   11 +--------
 web-extensions/Makefile.am               |   28 ++++++++++++++------------
 web-extensions/evolution-web-extension.c |   32 ++++++++++++++++++++++++++++-
 5 files changed, 49 insertions(+), 25 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index a8b9d68..a24ddc9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1568,6 +1568,7 @@ plugins/pst-import/Makefile
 plugins/publish-calendar/Makefile
 plugins/save-calendar/Makefile
 plugins/templates/Makefile
+web-extensions/Makefile
 smime/Makefile
 smime/lib/Makefile
 smime/gui/Makefile
diff --git a/e-util/e-dom-utils.c b/e-util/e-dom-utils.c
index 3a3e293..3847488 100644
--- a/e-util/e-dom-utils.c
+++ b/e-util/e-dom-utils.c
@@ -89,7 +89,7 @@ document_has_selection (WebKitDOMDocument *document)
                return FALSE;
 
        dom_selection = webkit_dom_dom_window_get_selection (dom_window);
-       if (!WEBKIT_DOM_IS_DOM_SELECTION (dom_selection)
+       if (!WEBKIT_DOM_IS_DOM_SELECTION (dom_selection))
                return FALSE;
 
        if (webkit_dom_dom_selection_get_range_count (dom_selection) == 0)
diff --git a/e-util/e-dom-utils.h b/e-util/e-dom-utils.h
index 0936c94..960b677 100644
--- a/e-util/e-dom-utils.h
+++ b/e-util/e-dom-utils.h
@@ -16,15 +16,8 @@
  *
  */
 
-/* This is intended to serve as a common base class for all HTML viewing
- * needs in Evolution.  Currently based on GtkHTML, the idea is to wrap
- * the GtkHTML API enough that we no longer have to make direct calls to
- * it.  This should help smooth the transition to WebKit/GTK+.
- *
- * This class handles basic tasks like mouse hovers over links, clicked
- * links, and servicing URI requests asynchronously via GIO. */
-
-#if !defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)
+#if (!defined (__E_UTIL_H_INSIDE__) && !defined (LIBEUTIL_COMPILATION)) && \
+       !defined (WEBEXTENSIONS_COMPILATION)
 #error "Only <e-util/e-util.h> should be included directly."
 #endif
 
diff --git a/web-extensions/Makefile.am b/web-extensions/Makefile.am
index 93d31d1..b4d7714 100644
--- a/web-extensions/Makefile.am
+++ b/web-extensions/Makefile.am
@@ -1,20 +1,22 @@
-webextension_LTLIBRARIES = libevolutionwebextension.la
+webextensions_LTLIBRARIES = libevolutionwebextension.la
 
-libevolutionwebextension_la_SOURCES = \
-       evolution-web-extension.c \
-       evolution-web-extension.h \
-       $(top_srcdir)/e-utils/e-dom-utils.c \
-       $(top_srcdir)/e-utils/e-dom-utils.h
+libevolutionwebextension_la_SOURCES =                  \
+       evolution-web-extension.c                       \
+       evolution-web-extension.h                       \
+       $(top_srcdir)/e-util/e-dom-utils.c              \
+       $(top_srcdir)/e-util/e-dom-utils.h
 
-libevolutionwebextension_la_CPPFLAGS = \
-       -I$(top_srcdir)/e-util \
-       $(AM_CPPFLAGS)
-
-libevolutionwebextension_la_CFLAGS = \
+libevolutionwebextension_la_CPPFLAGS =                 \
+       -DWEBEXTENSIONS_COMPILATION                     \
+       -DEVOLUTION_IMAGESDIR=\"${imagesdir}\"          \
+       -I$(top_srcdir)/e-util                          \
+       $(GNOME_PLATFORM_CFLAGS)                        \
+       $(AM_CPPFLAGS)                                  \
        $(WEB_EXTENSIONS_CFLAGS)
 
-libevolutionwebextension_la_LIBADD = \
+libevolutionwebextension_la_LIBADD =                   \
+       $(GNOME_PLATFORM_LIBS)                          \
        $(WEB_EXTENSIONS_LIBS)
 
-libevolutionwebextension_la_LDFLAGS = \
+libevolutionwebextension_la_LDFLAGS =                  \
        -module -avoid-version -no-undefined
diff --git a/web-extensions/evolution-web-extension.c b/web-extensions/evolution-web-extension.c
index 9c4fc76..733e119 100644
--- a/web-extensions/evolution-web-extension.c
+++ b/web-extensions/evolution-web-extension.c
@@ -16,14 +16,17 @@
  *
  */
 
-#include "config.h"
 #include "evolution-web-extension.h"
 
 #include <gio/gio.h>
 #include <gtk/gtk.h>
-#include <libsoup/soup.h>
 #include <webkit2/webkit-web-extension.h>
 
+#include "../e-util/e-dom-utils.h"
+
+/* FIXME Clean it */
+static GDBusConnection *dbus_connection;
+
 static const char introspection_xml[] =
 "<node>"
 "  <interface name='org.gnome.Evolution.WebExtension'>"
@@ -58,15 +61,37 @@ static const char introspection_xml[] =
 "  </interface>"
 "</node>";
 
+static gboolean
+web_page_send_request (WebKitWebPage *web_page,
+                       WebKitURIRequest *request,
+                       WebKitURIResponse *redirected_response,
+                       gpointer user_data)
+{
+       return FALSE;
+}
+
+static void
+web_page_document_loaded (WebKitWebPage *web_page,
+                          gpointer user_data)
+{
+
+}
+
 static void
 web_page_created_callback (WebKitWebExtension *extension,
                            WebKitWebPage *web_page,
                            gpointer user_data)
 {
        g_signal_connect_object (
+               web_page, "send-request",
+               G_CALLBACK (web_page_send_request),
+               NULL, 0);
+
+       g_signal_connect_object (
                web_page, "document-loaded",
                G_CALLBACK (web_page_document_loaded),
                NULL, 0);
+
 }
 
 static WebKitWebPage *
@@ -221,6 +246,9 @@ bus_acquired_cb (GDBusConnection *connection,
        }
 }
 
+/* Forward declaration */
+G_MODULE_EXPORT void webkit_web_extension_initialize (WebKitWebExtension *extension);
+
 G_MODULE_EXPORT void
 webkit_web_extension_initialize (WebKitWebExtension *extension)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]