aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html-display.c
diff options
context:
space:
mode:
authorHarry Lu <harry.lu@sun.com>2005-02-08 11:50:38 +0800
committerHarry Lu <haip@src.gnome.org>2005-02-08 11:50:38 +0800
commitc0c618e5a7aeb6d1130760669ee8936e7f896458 (patch)
treeb9b6777acf311b02b28ea0798f1f04fd610b1a7b /mail/em-format-html-display.c
parent80f47d42b88b901c3234f923ce50eaa785397e4b (diff)
downloadgsoc2013-evolution-c0c618e5a7aeb6d1130760669ee8936e7f896458.tar
gsoc2013-evolution-c0c618e5a7aeb6d1130760669ee8936e7f896458.tar.gz
gsoc2013-evolution-c0c618e5a7aeb6d1130760669ee8936e7f896458.tar.bz2
gsoc2013-evolution-c0c618e5a7aeb6d1130760669ee8936e7f896458.tar.lz
gsoc2013-evolution-c0c618e5a7aeb6d1130760669ee8936e7f896458.tar.xz
gsoc2013-evolution-c0c618e5a7aeb6d1130760669ee8936e7f896458.tar.zst
gsoc2013-evolution-c0c618e5a7aeb6d1130760669ee8936e7f896458.zip
Fix for 72275. try to bring up menu for preivew html object.
2005-02-07 Harry Lu <harry.lu@sun.com> Fix for 72275. * em-folder-view.c: (emfv_popup_menu): try to bring up menu for preivew html object. (emfv_format_popup_event): handle event == NULL case. * em-format-html-display.c: (em_format_html_display_popup_menu): New function to popup context menu. * em-format-html-display.h: add new function declaration. svn path=/trunk/; revision=28744
Diffstat (limited to 'mail/em-format-html-display.c')
-rw-r--r--mail/em-format-html-display.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 8175b29df8..6f74fa0495 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -612,6 +612,41 @@ efhd_html_button_press_event (GtkWidget *widget, GdkEventButton *event, EMFormat
return res;
}
+gboolean
+em_format_html_display_popup_menu (EMFormatHTMLDisplay *efhd)
+{
+ GtkHTML *html;
+ HTMLEngine *e;
+ HTMLObject *obj;
+ const char *url;
+ gboolean res = FALSE;
+ gint offset;
+ EMFormatPURI *puri = NULL;
+ char *uri = NULL;
+
+ html = efhd->formathtml.html;
+ e = html->engine;
+ if (!efhd->caret_mode)
+ obj = html_engine_get_focus_object (e, &offset);
+ else {
+ obj = e->cursor->object;
+ offset = e->cursor->offset;
+ }
+
+ if ( obj != NULL
+ && ((url = html_object_get_src(obj)) != NULL
+ || (url = html_object_get_url(obj, offset)) != NULL)) {
+ uri = gtk_html_get_url_object_relative(html, obj, url);
+ puri = em_format_find_puri((EMFormat *)efhd, uri);
+ }
+
+ g_signal_emit((GtkObject *)efhd, efhd_signals[EFHD_POPUP_EVENT], 0, NULL, uri, puri?puri->part:NULL, &res);
+
+ g_free(uri);
+
+ return res;
+}
+
static void
efhd_html_link_clicked (GtkHTML *html, const char *url, EMFormatHTMLDisplay *efhd)
{