[evolution/wip-webkit2] Remove unnecessary WebKit variable from extensions API.



commit f6f318475a4b8db410fc770af2ad6fda31cba23d
Author: Tomas Popela <tpopela redhat com>
Date:   Tue Nov 19 11:36:32 2013 +0100

    Remove unnecessary WebKit variable from extensions API.

 mail/e-mail-display-popup-extension.c              |    5 +--
 mail/e-mail-display-popup-extension.h              |    7 +----
 mail/e-mail-display.c                              |   26 ++++++++++----------
 .../e-mail-display-popup-prefer-plain.c            |    3 +-
 .../e-mail-display-popup-text-highlight.c          |    3 +-
 5 files changed, 19 insertions(+), 25 deletions(-)
---
diff --git a/mail/e-mail-display-popup-extension.c b/mail/e-mail-display-popup-extension.c
index d84a9ca..f13b367 100644
--- a/mail/e-mail-display-popup-extension.c
+++ b/mail/e-mail-display-popup-extension.c
@@ -40,8 +40,7 @@ e_mail_display_popup_extension_default_init (EMailDisplayPopupExtensionInterface
  * on every extension so that they can add their items to the menu.
  */
 void
-e_mail_display_popup_extension_update_actions (EMailDisplayPopupExtension *extension,
-                                               WebKitHitTestResult *context)
+e_mail_display_popup_extension_update_actions (EMailDisplayPopupExtension *extension)
 {
        EMailDisplayPopupExtensionInterface *iface;
 
@@ -50,5 +49,5 @@ e_mail_display_popup_extension_update_actions (EMailDisplayPopupExtension *exten
        iface = E_MAIL_DISPLAY_POPUP_EXTENSION_GET_INTERFACE (extension);
        g_return_if_fail (iface->update_actions != NULL);
 
-       iface->update_actions (extension, context);
+       iface->update_actions (extension);
 }
diff --git a/mail/e-mail-display-popup-extension.h b/mail/e-mail-display-popup-extension.h
index d694778..c26b5ae 100644
--- a/mail/e-mail-display-popup-extension.h
+++ b/mail/e-mail-display-popup-extension.h
@@ -20,7 +20,6 @@
 #define E_MAIL_DISPLAY_POPUP_EXTENSION_H
 
 #include <glib-object.h>
-#include <webkit2/webkit2.h>
 
 /* Standard GObject macros */
 #define E_TYPE_MAIL_DISPLAY_POPUP_EXTENSION \
@@ -49,15 +48,13 @@ typedef struct _EMailDisplayPopupExtensionInterface EMailDisplayPopupExtensionIn
 struct _EMailDisplayPopupExtensionInterface {
        GTypeInterface parent_interface;
 
-       void    (*update_actions)               (EMailDisplayPopupExtension *extension,
-                                                WebKitHitTestResult *context);
+       void    (*update_actions)               (EMailDisplayPopupExtension *extension);
 };
 
 GType          e_mail_display_popup_extension_get_type (void);
 
 void           e_mail_display_popup_extension_update_actions
-                                                       (EMailDisplayPopupExtension *extension,
-                                                        WebKitHitTestResult *context);
+                                                       (EMailDisplayPopupExtension *extension);
 
 G_END_DECLS
 
diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c
index 2adff5f..4c45196 100644
--- a/mail/e-mail-display.c
+++ b/mail/e-mail-display.c
@@ -1099,17 +1099,15 @@ mail_display_style_updated (GtkWidget *widget)
                style_updated (widget);
 }
 
-static void
-mail_display_mouse_target_changed_cb (EMailDisplay *display,
-                                      WebKitHitTestResult *hit_test_result,
-                                      guint modifiers,
-                                      gpointer user_data)
+static gboolean
+mail_display_button_press_event (GtkWidget *widget,
+                                 GdkEventButton *event)
 {
-       EWebView *web_view = E_WEB_VIEW (display);
+       EWebView *web_view = E_WEB_VIEW (widget);
        GList *list, *link;
 
-       if (!(modifiers & GDK_BUTTON3_MASK))
-               return;
+       if (event->button != 3)
+               goto chainup;
 
        list = e_extensible_list_extensions (
                E_EXTENSIBLE (web_view), E_TYPE_EXTENSION);
@@ -1120,9 +1118,14 @@ mail_display_mouse_target_changed_cb (EMailDisplay *display,
                        continue;
 
                e_mail_display_popup_extension_update_actions (
-                       E_MAIL_DISPLAY_POPUP_EXTENSION (extension), hit_test_result);
+                       E_MAIL_DISPLAY_POPUP_EXTENSION (extension));
        }
        g_list_free (list);
+
+chainup:
+       /* Chain up to parent's button_press_event() method. */
+       return GTK_WIDGET_CLASS (e_mail_display_parent_class)->
+               button_press_event (widget, event);
 }
 
 static gchar *
@@ -1308,6 +1311,7 @@ e_mail_display_class_init (EMailDisplayClass *class)
        widget_class = GTK_WIDGET_CLASS (class);
        widget_class->realize = mail_display_realize;
        widget_class->style_updated = mail_display_style_updated;
+       widget_class->button_press_event = mail_display_button_press_event;
 
        web_view_class = E_WEB_VIEW_CLASS (class);
        web_view_class->redirect_uri = mail_display_redirect_uri;
@@ -1603,10 +1607,6 @@ e_mail_display_init (EMailDisplay *display)
                display, "notify::uri",
                G_CALLBACK (mail_display_uri_changed), NULL);
 #endif
-       g_signal_connect (
-               display, "mouse-target-changed",
-               G_CALLBACK (mail_display_mouse_target_changed_cb), NULL);
-
        display->priv->settings = g_settings_new ("org.gnome.evolution.mail");
        g_signal_connect_swapped (
                display->priv->settings , "changed::monospace-font",
diff --git a/modules/prefer-plain/e-mail-display-popup-prefer-plain.c 
b/modules/prefer-plain/e-mail-display-popup-prefer-plain.c
index 1b53e71..abe2f44 100644
--- a/modules/prefer-plain/e-mail-display-popup-prefer-plain.c
+++ b/modules/prefer-plain/e-mail-display-popup-prefer-plain.c
@@ -296,8 +296,7 @@ create_group (EMailDisplayPopupExtension *extension)
 }
 
 static void
-mail_display_popup_prefer_plain_update_actions (EMailDisplayPopupExtension *extension,
-                                                WebKitHitTestResult *context)
+mail_display_popup_prefer_plain_update_actions (EMailDisplayPopupExtension *extension)
 {
        EMailDisplay *display;
        GtkAction *action;
diff --git a/modules/text-highlight/e-mail-display-popup-text-highlight.c 
b/modules/text-highlight/e-mail-display-popup-text-highlight.c
index 98536ea..59ea5d1 100644
--- a/modules/text-highlight/e-mail-display-popup-text-highlight.c
+++ b/modules/text-highlight/e-mail-display-popup-text-highlight.c
@@ -344,8 +344,7 @@ create_group (EMailDisplayPopupExtension *extension)
 }
 
 static void
-update_actions (EMailDisplayPopupExtension *extension,
-                WebKitHitTestResult *context)
+update_actions (EMailDisplayPopupExtension *extension)
 {
        EMailDisplay *display;
        EMailDisplayPopupTextHighlight *th_extension;


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