diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-05-31 22:24:14 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-06-01 00:01:49 +0800 |
commit | 4f01d3d1823fd8d7b53919b03ff44cc46ad92b77 (patch) | |
tree | 93b7541b92635862399d7783cb2fed77cee74ef5 | |
parent | 3d9b0002c5802e3d8c3a426221bfb5294691326e (diff) | |
download | gsoc2013-evolution-4f01d3d1823fd8d7b53919b03ff44cc46ad92b77.tar.gz gsoc2013-evolution-4f01d3d1823fd8d7b53919b03ff44cc46ad92b77.tar.zst gsoc2013-evolution-4f01d3d1823fd8d7b53919b03ff44cc46ad92b77.zip |
Keep chipping away at direct GtkHTML usage.
EMFormatHTML now holds a sealed EWebView instead of a public GtkHTML,
accessible through em_format_html_get_web_view().
Rename e_mail_reader_get_html_display() to e_mail_reader_get_formatter()
and have it return an EMFormatHTML instead of an EMFormatHTMLDisplay,
since that's usually the type you want (or else an EMFormat, but never
an EMFormatHTMLDisplay).
-rw-r--r-- | mail/e-mail-browser.c | 35 | ||||
-rw-r--r-- | mail/e-mail-reader-utils.c | 52 | ||||
-rw-r--r-- | mail/e-mail-reader.c | 130 | ||||
-rw-r--r-- | mail/e-mail-reader.h | 8 | ||||
-rw-r--r-- | mail/em-format-html-display.c | 23 | ||||
-rw-r--r-- | mail/em-format-html-print.c | 15 | ||||
-rw-r--r-- | mail/em-format-html.c | 78 | ||||
-rw-r--r-- | mail/em-format-html.h | 5 | ||||
-rw-r--r-- | mail/em-utils.c | 8 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-backend.c | 8 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-content.c | 37 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-actions.c | 20 | ||||
-rw-r--r-- | modules/mail/e-mail-shell-view-private.c | 6 | ||||
-rw-r--r-- | plugins/audio-inline/Makefile.am | 1 | ||||
-rw-r--r-- | plugins/image-inline/image-inline.c | 13 | ||||
-rw-r--r-- | plugins/mail-to-task/mail-to-task.c | 12 |
16 files changed, 246 insertions, 205 deletions
diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c index ca582ccd35..e076585755 100644 --- a/mail/e-mail-browser.c +++ b/mail/e-mail-browser.c @@ -49,7 +49,7 @@ struct _EMailBrowserPrivate { EFocusTracker *focus_tracker; EShellBackend *shell_backend; GtkActionGroup *action_group; - EMFormatHTMLDisplay *html_display; + EMFormatHTMLDisplay *formatter; GtkWidget *main_menu; GtkWidget *main_toolbar; @@ -239,10 +239,11 @@ static void mail_browser_message_selected_cb (EMailBrowser *browser, const gchar *uid) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; CamelMessageInfo *info; CamelFolder *folder; EMailReader *reader; + EWebView *web_view; const gchar *title; if (uid == NULL) @@ -250,7 +251,8 @@ mail_browser_message_selected_cb (EMailBrowser *browser, reader = E_MAIL_READER (browser); folder = e_mail_reader_get_folder (reader); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); + web_view = em_format_html_get_web_view (formatter); info = camel_folder_get_message_info (folder, uid); @@ -262,8 +264,7 @@ mail_browser_message_selected_cb (EMailBrowser *browser, title = _("(No Subject)"); gtk_window_set_title (GTK_WINDOW (browser), title); - gtk_widget_grab_focus ( - GTK_WIDGET (((EMFormatHTML *) html_display)->html)); + gtk_widget_grab_focus (GTK_WIDGET (web_view)); camel_folder_free_message_info (folder, info); } @@ -425,9 +426,9 @@ mail_browser_dispose (GObject *object) priv->action_group = NULL; } - if (priv->html_display != NULL) { - g_object_unref (priv->html_display); - priv->html_display = NULL; + if (priv->formatter != NULL) { + g_object_unref (priv->formatter); + priv->formatter = NULL; } if (priv->main_menu != NULL) { @@ -463,8 +464,8 @@ mail_browser_dispose (GObject *object) static void mail_browser_constructed (GObject *object) { - EMFormatHTMLDisplay *html_display; EMailBrowserPrivate *priv; + EMFormatHTML *formatter; EMailReader *reader; EShellBackend *shell_backend; EShell *shell; @@ -500,10 +501,10 @@ mail_browser_constructed (GObject *object) priv->ui_manager = ui_manager; domain = GETTEXT_PACKAGE; - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); e_shell_watch_window (shell, GTK_WINDOW (object)); - web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); + web_view = em_format_html_get_web_view (formatter); /* The message list is a widget, but it is not shown in the browser. * Unfortunately, the widget is inseparable from its model, and the @@ -602,7 +603,7 @@ mail_browser_constructed (GObject *object) g_signal_connect_swapped ( search_bar, "changed", - G_CALLBACK (em_format_redraw), priv->html_display); + G_CALLBACK (em_format_redraw), priv->formatter); /* Bind GObject properties to GConf keys. */ @@ -653,14 +654,14 @@ mail_browser_get_hide_deleted (EMailReader *reader) return !e_mail_browser_get_show_deleted (browser); } -static EMFormatHTMLDisplay * -mail_browser_get_html_display (EMailReader *reader) +static EMFormatHTML * +mail_browser_get_formatter (EMailReader *reader) { EMailBrowserPrivate *priv; priv = E_MAIL_BROWSER_GET_PRIVATE (reader); - return priv->html_display; + return EM_FORMAT_HTML (priv->formatter); } static GtkWidget * @@ -795,8 +796,8 @@ static void mail_browser_iface_init (EMailReaderIface *iface) { iface->get_action_group = mail_browser_get_action_group; + iface->get_formatter = mail_browser_get_formatter; iface->get_hide_deleted = mail_browser_get_hide_deleted; - iface->get_html_display = mail_browser_get_html_display; iface->get_message_list = mail_browser_get_message_list; iface->get_popup_menu = mail_browser_get_popup_menu; iface->get_shell_backend = mail_browser_get_shell_backend; @@ -814,7 +815,7 @@ mail_browser_init (EMailBrowser *browser) browser->priv = E_MAIL_BROWSER_GET_PRIVATE (browser); browser->priv->action_group = gtk_action_group_new ("mail-browser"); - browser->priv->html_display = em_format_html_display_new (); + browser->priv->formatter = em_format_html_display_new (); bridge = gconf_bridge_get (); prefix = "/apps/evolution/mail/mail_browser"; diff --git a/mail/e-mail-reader-utils.c b/mail/e-mail-reader-utils.c index 9d798d92c9..f50aea7636 100644 --- a/mail/e-mail-reader-utils.c +++ b/mail/e-mail-reader-utils.c @@ -131,7 +131,7 @@ void e_mail_reader_mark_as_read (EMailReader *reader, const gchar *uid) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; CamelFolder *folder; guint32 mask, set; guint32 flags; @@ -140,14 +140,14 @@ e_mail_reader_mark_as_read (EMailReader *reader, g_return_if_fail (uid != NULL); folder = e_mail_reader_get_folder (reader); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); flags = camel_folder_get_message_flags (folder, uid); if (!(flags & CAMEL_MESSAGE_SEEN)) { CamelMimeMessage *message; - message = ((EMFormat *) html_display)->message; + message = EM_FORMAT (formatter)->message; em_utils_handle_receipt (folder, uid, message); } @@ -278,7 +278,7 @@ void e_mail_reader_print (EMailReader *reader, GtkPrintOperationAction action) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; EMFormatHTMLPrint *html_print; CamelFolder *folder; GPtrArray *uids; @@ -293,13 +293,11 @@ e_mail_reader_print (EMailReader *reader, if (uids->len != 1) goto exit; - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); - html_print = em_format_html_print_new ( - (EMFormatHTML *) html_display, action); + html_print = em_format_html_print_new (formatter, action); em_format_merge_handler ( - (EMFormat *) html_print, - (EMFormat *) html_display); + EM_FORMAT (html_print), EM_FORMAT (formatter)); em_format_html_print_message (html_print, folder, uids->pdata[0]); g_object_unref (html_print); @@ -354,13 +352,12 @@ void e_mail_reader_reply_to_message (EMailReader *reader, gint reply_mode) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; GtkWidget *message_list; CamelMimeMessage *new_message; CamelMimeMessage *src_message; CamelFolder *folder; EWebView *web_view; - GtkHTML *html; struct _camel_header_raw *header; const gchar *uid; gchar *selection = NULL; @@ -372,9 +369,8 @@ e_mail_reader_reply_to_message (EMailReader *reader, g_return_if_fail (E_IS_MAIL_READER (reader)); - html_display = e_mail_reader_get_html_display (reader); - html = ((EMFormatHTML *) html_display)->html; - web_view = E_WEB_VIEW (html); + formatter = e_mail_reader_get_formatter (reader); + web_view = em_format_html_get_web_view (formatter); folder = e_mail_reader_get_folder (reader); message_list = e_mail_reader_get_message_list (reader); @@ -385,15 +381,14 @@ e_mail_reader_reply_to_message (EMailReader *reader, if (!e_web_view_is_selection_active (web_view)) goto whole_message; - selection = gtk_html_get_selection_html (html, &length); + selection = gtk_html_get_selection_html (GTK_HTML (web_view), &length); if (selection == NULL || *selection == '\0') goto whole_message; if (!html_contains_nonwhitespace (selection, length)) goto whole_message; - src_message = - CAMEL_MIME_MESSAGE (((EMFormat *) html_display)->message); + src_message = CAMEL_MIME_MESSAGE (EM_FORMAT (formatter)->message); new_message = camel_mime_message_new (); /* Filter out "content-*" headers. */ @@ -424,7 +419,7 @@ e_mail_reader_reply_to_message (EMailReader *reader, whole_message: em_utils_reply_to_message ( - folder, uid, NULL, reply_mode, (EMFormat *) html_display); + folder, uid, NULL, reply_mode, EM_FORMAT (formatter)); } void @@ -679,24 +674,18 @@ headers_changed_cb (GConfClient *client, GConfEntry *entry, EMailReader *reader) { - EMFormat *emf; - EMFormatHTMLDisplay *emfhd; + EMFormatHTML *formatter; GSList *header_config_list, *p; g_return_if_fail (client != NULL); g_return_if_fail (reader != NULL); - emfhd = e_mail_reader_get_html_display (reader); - if (!emfhd) - return; - - emf = EM_FORMAT (emfhd); - g_return_if_fail (emf != NULL); + formatter = e_mail_reader_get_formatter (reader); header_config_list = gconf_client_get_list ( client, "/apps/evolution/mail/display/headers", GCONF_VALUE_STRING, NULL); - em_format_clear_headers (emf); + em_format_clear_headers (EM_FORMAT (formatter)); for (p = header_config_list; p; p = g_slist_next(p)) { EMailReaderHeader *h; gchar *xml = (gchar *)p->data; @@ -704,20 +693,21 @@ headers_changed_cb (GConfClient *client, h = e_mail_reader_header_from_xml (xml); if (h && h->enabled) em_format_add_header ( - emf, h->name, EM_FORMAT_HEADER_BOLD); + EM_FORMAT (formatter), + h->name, EM_FORMAT_HEADER_BOLD); e_mail_reader_header_free (h); } if (!header_config_list) - em_format_default_headers (emf); + em_format_default_headers (EM_FORMAT (formatter)); g_slist_foreach (header_config_list, (GFunc) g_free, NULL); g_slist_free (header_config_list); /* force a redraw */ - if (emf->message) - em_format_redraw (emf); + if (EM_FORMAT (formatter)->message) + em_format_redraw (EM_FORMAT (formatter)); } static void diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 5475c405ff..9c300fc411 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -156,7 +156,7 @@ action_add_to_address_book_cb (GtkAction *action, { EShell *shell; EShellBackend *shell_backend; - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; CamelInternetAddress *cia; EWebView *web_view; CamelURL *curl; @@ -165,10 +165,10 @@ action_add_to_address_book_cb (GtkAction *action, /* This action is defined in EMailDisplay. */ - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); shell_backend = e_mail_reader_get_shell_backend (reader); - web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); + web_view = em_format_html_get_web_view (formatter); uri = e_web_view_get_selected_uri (web_view); g_return_if_fail (uri != NULL); @@ -205,17 +205,17 @@ action_mail_charset_cb (GtkRadioAction *action, GtkRadioAction *current, EMailReader *reader) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; const gchar *charset; if (action != current) return; - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); charset = g_object_get_data (G_OBJECT (action), "charset"); /* Charset for "Default" action will be NULL. */ - em_format_set_charset (EM_FORMAT (html_display), charset); + em_format_set_charset (EM_FORMAT (formatter), charset); } static void @@ -355,38 +355,38 @@ static void action_mail_flag_clear_cb (GtkAction *action, EMailReader *reader) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; CamelFolder *folder; GtkWindow *window; GPtrArray *uids; folder = e_mail_reader_get_folder (reader); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); uids = e_mail_reader_get_selected_uids (reader); window = e_mail_reader_get_window (reader); em_utils_flag_for_followup_clear (window, folder, uids); - em_format_redraw (EM_FORMAT (html_display)); + em_format_redraw (EM_FORMAT (formatter)); } static void action_mail_flag_completed_cb (GtkAction *action, EMailReader *reader) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; CamelFolder *folder; GtkWindow *window; GPtrArray *uids; folder = e_mail_reader_get_folder (reader); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); uids = e_mail_reader_get_selected_uids (reader); window = e_mail_reader_get_window (reader); em_utils_flag_for_followup_completed (window, folder, uids); - em_format_redraw (EM_FORMAT (html_display)); + em_format_redraw (EM_FORMAT (formatter)); } static void @@ -494,11 +494,11 @@ static void action_mail_load_images_cb (GtkAction *action, EMailReader *reader) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); - em_format_html_load_images (EM_FORMAT_HTML (html_display)); + em_format_html_load_images (formatter); } static void @@ -934,24 +934,24 @@ static void action_mail_show_all_headers_cb (GtkToggleAction *action, EMailReader *reader) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; em_format_mode_t mode; - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); if (gtk_toggle_action_get_active (action)) mode = EM_FORMAT_ALLHEADERS; else mode = EM_FORMAT_NORMAL; - em_format_set_mode (EM_FORMAT (html_display), mode); + em_format_set_mode (EM_FORMAT (formatter), mode); } static void action_mail_show_source_cb (GtkAction *action, EMailReader *reader) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; EShellBackend *shell_backend; CamelFolder *folder; GtkWidget *browser; @@ -967,8 +967,8 @@ action_mail_show_source_cb (GtkAction *action, browser = e_mail_browser_new (shell_backend); reader = E_MAIL_READER (browser); - html_display = e_mail_reader_get_html_display (reader); - em_format_set_mode (EM_FORMAT (html_display), EM_FORMAT_SOURCE); + formatter = e_mail_reader_get_formatter (reader); + em_format_set_mode (EM_FORMAT (formatter), EM_FORMAT_SOURCE); e_mail_reader_set_folder (reader, folder, folder_uri); e_mail_reader_set_message (reader, uids->pdata[0]); gtk_widget_show (browser); @@ -1021,11 +1021,11 @@ static void action_mail_zoom_100_cb (GtkAction *action, EMailReader *reader) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; EWebView *web_view; - html_display = e_mail_reader_get_html_display (reader); - web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); + formatter = e_mail_reader_get_formatter (reader); + web_view = em_format_html_get_web_view (formatter); e_web_view_zoom_100 (web_view); } @@ -1034,11 +1034,11 @@ static void action_mail_zoom_in_cb (GtkAction *action, EMailReader *reader) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; EWebView *web_view; - html_display = e_mail_reader_get_html_display (reader); - web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); + formatter = e_mail_reader_get_formatter (reader); + web_view = em_format_html_get_web_view (formatter); e_web_view_zoom_in (web_view); } @@ -1047,11 +1047,11 @@ static void action_mail_zoom_out_cb (GtkAction *action, EMailReader *reader) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; EWebView *web_view; - html_display = e_mail_reader_get_html_display (reader); - web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); + formatter = e_mail_reader_get_formatter (reader); + web_view = em_format_html_get_web_view (formatter); e_web_view_zoom_out (web_view); } @@ -1060,7 +1060,7 @@ static void action_search_folder_recipient_cb (GtkAction *action, EMailReader *reader) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; EWebView *web_view; CamelURL *curl; const gchar *folder_uri; @@ -1069,9 +1069,9 @@ action_search_folder_recipient_cb (GtkAction *action, /* This action is defined in EMailDisplay. */ folder_uri = e_mail_reader_get_folder_uri (reader); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); - web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); + web_view = em_format_html_get_web_view (formatter); uri = e_web_view_get_selected_uri (web_view); g_return_if_fail (uri != NULL); @@ -1098,7 +1098,7 @@ static void action_search_folder_sender_cb (GtkAction *action, EMailReader *reader) { - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; EWebView *web_view; CamelURL *curl; const gchar *folder_uri; @@ -1107,9 +1107,9 @@ action_search_folder_sender_cb (GtkAction *action, /* This action is defined in EMailDisplay. */ folder_uri = e_mail_reader_get_folder_uri (reader); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); - web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); + web_view = em_format_html_get_web_view (formatter); uri = e_web_view_get_selected_uri (web_view); g_return_if_fail (uri != NULL); @@ -1791,7 +1791,7 @@ mail_reader_message_loaded_cb (CamelFolder *folder, { EMailReader *reader = user_data; EMailReaderPrivate *priv; - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; GtkWidget *message_list; EShellBackend *shell_backend; EShellSettings *shell_settings; @@ -1813,7 +1813,7 @@ mail_reader_message_loaded_cb (CamelFolder *folder, return; } - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); message_list = e_mail_reader_get_message_list (reader); shell_backend = e_mail_reader_get_shell_backend (reader); @@ -1822,7 +1822,7 @@ mail_reader_message_loaded_cb (CamelFolder *folder, cursor_uid = MESSAGE_LIST (message_list)->cursor_uid; - web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); + web_view = em_format_html_get_web_view (formatter); /* If the user picked a different message in the time it took * to fetch this message, then don't bother rendering it. */ @@ -1843,7 +1843,7 @@ mail_reader_message_loaded_cb (CamelFolder *folder, (EEventTarget *) target); em_format_format ( - EM_FORMAT (html_display), folder, message_uid, message); + EM_FORMAT (formatter), folder, message_uid, message); /* Reset the shell view icon. */ e_shell_event (shell, "mail-icon", (gpointer) "evolution-mail"); @@ -1903,7 +1903,7 @@ static gboolean mail_reader_message_selected_timeout_cb (EMailReader *reader) { EMailReaderPrivate *priv; - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; GtkWidget *message_list; EWebView *web_view; CamelFolder *folder; @@ -1916,27 +1916,27 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader) folder = e_mail_reader_get_folder (reader); parent_store = camel_folder_get_parent_store (folder); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); message_list = e_mail_reader_get_message_list (reader); cursor_uid = MESSAGE_LIST (message_list)->cursor_uid; - format_uid = EM_FORMAT (html_display)->uid; + format_uid = EM_FORMAT (formatter)->uid; - web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); + web_view = em_format_html_get_web_view (formatter); if (MESSAGE_LIST (message_list)->last_sel_single) { GtkWidget *widget; - gboolean html_display_visible; + gboolean web_view_visible; gboolean selected_uid_changed; /* Decide whether to download the full message now. */ - widget = GTK_WIDGET (EM_FORMAT_HTML (html_display)->html); + widget = GTK_WIDGET (web_view); - html_display_visible = gtk_widget_get_mapped (widget); + web_view_visible = gtk_widget_get_mapped (widget); selected_uid_changed = g_strcmp0 (cursor_uid, format_uid); - if (html_display_visible && selected_uid_changed) { + if (web_view_visible && selected_uid_changed) { gint op_id; gchar *string; gboolean store_async; @@ -1964,7 +1964,7 @@ mail_reader_message_selected_timeout_cb (EMailReader *reader) priv->retrieving_message_operation_id = op_id; } } else { - em_format_format (EM_FORMAT (html_display), NULL, NULL, NULL); + em_format_format (EM_FORMAT (formatter), NULL, NULL, NULL); priv->restoring_message_selection = FALSE; } @@ -2067,7 +2067,7 @@ mail_reader_set_folder (EMailReader *reader, const gchar *folder_uri) { EMailReaderPrivate *priv; - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; CamelFolder *previous_folder; GtkWidget *message_list; const gchar *previous_folder_uri; @@ -2075,7 +2075,7 @@ mail_reader_set_folder (EMailReader *reader, priv = E_MAIL_READER_GET_PRIVATE (reader); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); message_list = e_mail_reader_get_message_list (reader); previous_folder = e_mail_reader_get_folder (reader); @@ -2093,7 +2093,7 @@ mail_reader_set_folder (EMailReader *reader, em_utils_folder_is_outbox (folder, folder_uri) || em_utils_folder_is_sent (folder, folder_uri)); - em_format_format (EM_FORMAT (html_display), NULL, NULL, NULL); + em_format_format (EM_FORMAT (formatter), NULL, NULL, NULL); priv->folder_was_just_selected = (folder != NULL); @@ -2556,7 +2556,7 @@ e_mail_reader_init (EMailReader *reader) EShell *shell; EShellBackend *shell_backend; EShellSettings *shell_settings; - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; EMenuToolAction *menu_tool_action; EWebView *web_view; GtkActionGroup *action_group; @@ -2569,14 +2569,14 @@ e_mail_reader_init (EMailReader *reader) g_return_if_fail (E_IS_MAIL_READER (reader)); action_group = e_mail_reader_get_action_group (reader); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); message_list = e_mail_reader_get_message_list (reader); shell_backend = e_mail_reader_get_shell_backend (reader); shell = e_shell_backend_get_shell (shell_backend); shell_settings = e_shell_get_shell_settings (shell); - web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); + web_view = em_format_html_get_web_view (formatter); /* The "mail-forward" action is special: it uses a GtkMenuToolButton * for its toolbar item type. So we have to create it separately. */ @@ -2930,30 +2930,30 @@ e_mail_reader_get_action_group (EMailReader *reader) return iface->get_action_group (reader); } -gboolean -e_mail_reader_get_hide_deleted (EMailReader *reader) +EMFormatHTML * +e_mail_reader_get_formatter (EMailReader *reader) { EMailReaderIface *iface; - g_return_val_if_fail (E_IS_MAIL_READER (reader), FALSE); + g_return_val_if_fail (E_IS_MAIL_READER (reader), NULL); iface = E_MAIL_READER_GET_IFACE (reader); - g_return_val_if_fail (iface->get_hide_deleted != NULL, FALSE); + g_return_val_if_fail (iface->get_formatter != NULL, NULL); - return iface->get_hide_deleted (reader); + return iface->get_formatter (reader); } -EMFormatHTMLDisplay * -e_mail_reader_get_html_display (EMailReader *reader) +gboolean +e_mail_reader_get_hide_deleted (EMailReader *reader) { EMailReaderIface *iface; - g_return_val_if_fail (E_IS_MAIL_READER (reader), NULL); + g_return_val_if_fail (E_IS_MAIL_READER (reader), FALSE); iface = E_MAIL_READER_GET_IFACE (reader); - g_return_val_if_fail (iface->get_html_display != NULL, NULL); + g_return_val_if_fail (iface->get_hide_deleted != NULL, FALSE); - return iface->get_html_display (reader); + return iface->get_hide_deleted (reader); } GtkWidget * diff --git a/mail/e-mail-reader.h b/mail/e-mail-reader.h index 0b8f30d825..b493cff98f 100644 --- a/mail/e-mail-reader.h +++ b/mail/e-mail-reader.h @@ -29,7 +29,7 @@ #include <gtk/gtk.h> #include <camel/camel.h> -#include <mail/em-format-html-display.h> +#include <mail/em-format-html.h> #include <shell/e-shell-backend.h> /* Standard GObject macros */ @@ -84,9 +84,8 @@ struct _EMailReaderIface { GtkActionGroup * (*get_action_group) (EMailReader *reader); + EMFormatHTML * (*get_formatter) (EMailReader *reader); gboolean (*get_hide_deleted) (EMailReader *reader); - EMFormatHTMLDisplay * - (*get_html_display) (EMailReader *reader); GtkWidget * (*get_message_list) (EMailReader *reader); GtkMenu * (*get_popup_menu) (EMailReader *reader); GPtrArray * (*get_selected_uids) (EMailReader *reader); @@ -115,9 +114,8 @@ GtkAction * e_mail_reader_get_action (EMailReader *reader, const gchar *action_name); GtkActionGroup * e_mail_reader_get_action_group (EMailReader *reader); +EMFormatHTML * e_mail_reader_get_formatter (EMailReader *reader); gboolean e_mail_reader_get_hide_deleted (EMailReader *reader); -EMFormatHTMLDisplay * - e_mail_reader_get_html_display (EMailReader *reader); GtkWidget * e_mail_reader_get_message_list (EMailReader *reader); GtkMenu * e_mail_reader_get_popup_menu (EMailReader *reader); GPtrArray * e_mail_reader_get_selected_uids (EMailReader *reader); diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index 422d5d23cc..db13260157 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -610,14 +610,14 @@ efhd_class_init (EMFormatHTMLDisplayClass *class) static void efhd_init (EMFormatHTMLDisplay *efhd) { - GtkHTML *html; + EWebView *web_view; - html = EM_FORMAT_HTML (efhd)->html; + web_view = em_format_html_get_web_view (EM_FORMAT_HTML (efhd)); efhd->priv = EM_FORMAT_HTML_DISPLAY_GET_PRIVATE (efhd); e_mail_display_set_formatter ( - E_MAIL_DISPLAY (html), EM_FORMAT_HTML (efhd)); + E_MAIL_DISPLAY (web_view), EM_FORMAT_HTML (efhd)); /* we want to convert url's etc */ EM_FORMAT_HTML (efhd)->text_html_flags |= @@ -785,6 +785,7 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje EAttachmentView *view; EAttachmentStore *store; EAttachment *attachment; + EWebView *web_view; GtkWidget *widget; gpointer parent; EMFormat *emf = (EMFormat *) efh; @@ -821,7 +822,8 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje e_attachment_set_encrypted (attachment, info->encrypt); e_attachment_set_can_show (attachment, info->handle != NULL); - parent = gtk_widget_get_toplevel (GTK_WIDGET (efh->html)); + web_view = em_format_html_get_web_view (efh); + parent = gtk_widget_get_toplevel (GTK_WIDGET (web_view)); parent = gtk_widget_is_toplevel (parent) ? parent : NULL; view = em_format_html_display_get_attachment_view (efhd); @@ -876,12 +878,15 @@ efhd_bar_resize (EMFormatHTML *efh, { EMFormatHTMLDisplayPrivate *priv; GtkAllocation allocation; + EWebView *web_view; GtkWidget *widget; gint width; priv = EM_FORMAT_HTML_DISPLAY_GET_PRIVATE (efh); - widget = GTK_WIDGET (efh->html); + web_view = em_format_html_get_web_view (efh); + + widget = GTK_WIDGET (web_view); gtk_widget_get_allocation (widget, &allocation); width = allocation.width - 12; @@ -955,9 +960,11 @@ efhd_optional_button_show (GtkWidget *widget, GtkWidget *w) static void efhd_resize (GtkWidget *w, GtkAllocation *event, EMFormatHTML *efh) { + EWebView *web_view; GtkAllocation allocation; - gtk_widget_get_allocation (GTK_WIDGET (efh->html), &allocation); + web_view = em_format_html_get_web_view (efh); + gtk_widget_get_allocation (GTK_WIDGET (web_view), &allocation); gtk_widget_set_size_request (w, allocation.width - 48, 250); } @@ -972,6 +979,7 @@ efhd_attachment_optional(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPOb GtkAllocation allocation; GtkTextBuffer *buffer; GByteArray *byte_array; + EWebView *web_view; /* FIXME: handle default shown case */ d(printf("adding attachment button/content for optional rendering\n")); @@ -1041,7 +1049,8 @@ efhd_attachment_optional(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPOb gtk_box_pack_start(GTK_BOX (vbox), scroll, TRUE, TRUE, 6); gtk_widget_show (GTK_WIDGET(view)); - gtk_widget_get_allocation (GTK_WIDGET (efh->html), &allocation); + web_view = em_format_html_get_web_view (efh); + gtk_widget_get_allocation (GTK_WIDGET (web_view), &allocation); gtk_widget_set_size_request (scroll, allocation.width - 48, 250); g_signal_connect (scroll, "size_allocate", G_CALLBACK(efhd_resize), efh); gtk_widget_show (scroll); diff --git a/mail/em-format-html-print.c b/mail/em-format-html-print.c index 954254552c..e660602e46 100644 --- a/mail/em-format-html-print.c +++ b/mail/em-format-html-print.c @@ -65,16 +65,15 @@ static void efhp_init (GObject *o) { EMFormatHTMLPrint *efhp = (EMFormatHTMLPrint *)o; - GtkWidget *html = (GtkWidget *)efhp->parent.html; + EWebView *web_view; - /* ?? */ - gtk_widget_set_name(html, "EvolutionMailPrintHTMLWidget"); + web_view = em_format_html_get_web_view (EM_FORMAT_HTML (efhp)); /* gtk widgets don't like to be realized outside top level widget so we put new html widget into gtk window */ efhp->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - gtk_container_add (GTK_CONTAINER (efhp->window), html); - gtk_widget_realize (html); + gtk_container_add (GTK_CONTAINER (efhp->window), GTK_WIDGET (web_view)); + gtk_widget_realize (GTK_WIDGET (web_view)); efhp->parent.show_icon = FALSE; ((EMFormat *)efhp)->print = TRUE; } @@ -190,12 +189,16 @@ static void emfhp_complete (EMFormatHTMLPrint *efhp) { GtkPrintOperation *operation; + EWebView *web_view; GError *error = NULL; + web_view = em_format_html_get_web_view (EM_FORMAT_HTML (efhp)); + operation = e_print_operation_new (); gtk_html_print_operation_run ( - efhp->parent.html, operation, efhp->action, NULL, + GTK_HTML (web_view), + operation, efhp->action, NULL, (GtkHTMLPrintCalcHeight) NULL, (GtkHTMLPrintCalcHeight) efhp_calc_footer_height, (GtkHTMLPrintDrawFunc) NULL, diff --git a/mail/em-format-html.c b/mail/em-format-html.c index b88ba2802d..5454394e49 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -48,6 +48,7 @@ #include "e-util/e-util-private.h" #include "e-util/e-util.h" #include "e-util/e-extensible.h" +#include "misc/e-web-view.h" #include <gtkhtml/gtkhtml.h> #include <gtkhtml/gtkhtml-stream.h> @@ -77,6 +78,8 @@ struct _EMFormatHTMLCache { }; struct _EMFormatHTMLPrivate { + EWebView *web_view; + CamelMimeMessage *last_part; /* not reffed, DO NOT dereference */ volatile gint format_id; /* format thread id */ guint format_timeout_id; @@ -109,7 +112,8 @@ enum { PROP_ONLY_LOCAL_PHOTOS, PROP_SHOW_SENDER_PHOTO, PROP_SHOW_REAL_DATE, - PROP_TEXT_COLOR + PROP_TEXT_COLOR, + PROP_WEB_VIEW }; static void efh_url_requested(GtkHTML *html, const gchar *url, GtkHTMLStream *handle, EMFormatHTML *efh); @@ -156,7 +160,7 @@ efh_format_exec (struct _format_msg *m) gint cancelled = FALSE; CamelURL *base; - if (m->format->html == NULL) + if (m->format->priv->web_view == NULL) return; format = EM_FORMAT (m->format); @@ -213,7 +217,7 @@ efh_format_exec (struct _format_msg *m) /* This is an implicit check to see if the gtkhtml has been destroyed */ if (!cancelled) - cancelled = m->format->html == NULL; + cancelled = m->format->priv->web_view == NULL; /* Now do an explicit check for user cancellation */ if (!cancelled) @@ -296,8 +300,11 @@ efh_format_timeout(struct _format_msg *m) GtkHTMLStream *hstream; EMFormatHTML *efh = m->format; struct _EMFormatHTMLPrivate *p = efh->priv; + EWebView *web_view; + + web_view = em_format_html_get_web_view (m->format); - if (m->format->html == NULL) { + if (web_view == NULL) { mail_msg_unref(m); return FALSE; } @@ -326,7 +333,7 @@ efh_format_timeout(struct _format_msg *m) } if (m->message == NULL) { - hstream = gtk_html_begin(efh->html); + hstream = gtk_html_begin (GTK_HTML (web_view)); gtk_html_stream_close(hstream, GTK_HTML_STREAM_OK); mail_msg_unref(m); p->last_part = NULL; @@ -334,13 +341,14 @@ efh_format_timeout(struct _format_msg *m) efh->state = EM_FORMAT_HTML_STATE_RENDERING; if (p->last_part != m->message) { - hstream = gtk_html_begin (efh->html); + hstream = gtk_html_begin (GTK_HTML (web_view)); gtk_html_stream_printf (hstream, "<h5>%s</h5>", _("Formatting Message...")); gtk_html_stream_close (hstream, GTK_HTML_STREAM_OK); } hstream = NULL; - m->estream = (EMHTMLStream *)em_html_stream_new(efh->html, hstream); + m->estream = (EMHTMLStream *)em_html_stream_new ( + GTK_HTML (web_view), hstream); if (p->last_part == m->message) { em_html_stream_set_flags (m->estream, @@ -385,9 +393,9 @@ efh_gtkhtml_destroy(GtkHTML *html, EMFormatHTML *efh) if (efh->priv->format_id != -1) mail_msg_cancel(efh->priv->format_id); - if (efh->html != NULL) { - g_object_unref (efh->html); - efh->html = NULL; + if (efh->priv->web_view != NULL) { + g_object_unref (efh->priv->web_view); + efh->priv->web_view = NULL; } } @@ -573,6 +581,12 @@ efh_get_property (GObject *object, &color); g_value_set_boxed (value, &color); return; + + case PROP_WEB_VIEW: + g_value_set_object ( + value, em_format_html_get_web_view ( + EM_FORMAT_HTML (object))); + return; } G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); @@ -586,7 +600,7 @@ efh_finalize (GObject *object) /* FIXME: check for leaked stuff */ em_format_html_clear_pobject (efh); - efh_gtkhtml_destroy (efh->html, efh); + efh_gtkhtml_destroy (GTK_HTML (efh->priv->web_view), efh); g_hash_table_destroy (efh->priv->text_inline_parts); @@ -606,7 +620,7 @@ efh_format_clone (EMFormat *emf, /* How to sub-class ? Might need to adjust api ... */ - if (efh->html == NULL) + if (efh->priv->web_view == NULL) return; d(printf("efh_format called\n")); @@ -761,7 +775,7 @@ efh_class_init (EMFormatHTMLClass *class) format_class->format_secure = efh_format_secure; format_class->busy = efh_busy; - class->html_widget_type = GTK_TYPE_HTML; + class->html_widget_type = E_TYPE_WEB_VIEW; g_object_class_install_property ( object_class, @@ -879,6 +893,16 @@ efh_class_init (EMFormatHTMLClass *class) GDK_TYPE_COLOR, G_PARAM_READWRITE)); + g_object_class_install_property ( + object_class, + PROP_WEB_VIEW, + g_param_spec_object ( + "web-view", + "Web View", + NULL, + E_TYPE_WEB_VIEW, + G_PARAM_READABLE)); + /* cache expiry - 2 hour access, 1 day max */ pathname = g_build_filename ( e_get_user_data_dir (), "cache", NULL); @@ -894,7 +918,7 @@ static void efh_init (EMFormatHTML *efh, EMFormatHTMLClass *class) { - GtkHTML *html; + EWebView *web_view; GdkColor *color; efh->priv = EM_FORMAT_HTML_GET_PRIVATE (efh); @@ -908,19 +932,21 @@ efh_init (EMFormatHTML *efh, (GDestroyNotify) NULL, (GDestroyNotify) efh_free_cache); - html = g_object_new (class->html_widget_type, NULL); - efh->html = g_object_ref_sink (html); + web_view = g_object_new (class->html_widget_type, NULL); + efh->priv->web_view = g_object_ref_sink (web_view); - gtk_html_set_blocking (html, FALSE); - gtk_html_set_caret_first_focus_anchor (html, EFM_MESSAGE_START_ANAME); - gtk_html_set_default_content_type (html, "text/html; charset=utf-8"); - gtk_html_set_editable (html, FALSE); + gtk_html_set_blocking (GTK_HTML (web_view), FALSE); + gtk_html_set_caret_first_focus_anchor ( + GTK_HTML (web_view), EFM_MESSAGE_START_ANAME); + gtk_html_set_default_content_type ( + GTK_HTML (web_view), "text/html; charset=utf-8"); + e_web_view_set_editable (web_view, FALSE); g_signal_connect ( - html, "url-requested", + web_view, "url-requested", G_CALLBACK (efh_url_requested), efh); g_signal_connect ( - html, "object-requested", + web_view, "object-requested", G_CALLBACK (efh_object_requested), efh); color = &efh->priv->colors[EM_FORMAT_HTML_COLOR_BODY]; @@ -988,6 +1014,14 @@ em_format_html_get_type (void) return type; } +EWebView * +em_format_html_get_web_view (EMFormatHTML *efh) +{ + g_return_val_if_fail (EM_IS_FORMAT_HTML (efh), NULL); + + return efh->priv->web_view; +} + void em_format_html_load_images (EMFormatHTML *efh) { diff --git a/mail/em-format-html.h b/mail/em-format-html.h index 26a6671cea..4e9b315765 100644 --- a/mail/em-format-html.h +++ b/mail/em-format-html.h @@ -30,7 +30,7 @@ #include <em-format/em-format.h> #include <mail/mail-config.h> -#include <gtkhtml/gtkhtml.h> +#include <misc/e-web-view.h> #include <gtkhtml/gtkhtml-embedded.h> /* Standard GObject macros */ @@ -195,8 +195,6 @@ struct _EMFormatHTML { EMFormat parent; EMFormatHTMLPrivate *priv; - GtkHTML *html; - GQueue pending_object_list; GSList *headers; @@ -217,6 +215,7 @@ struct _EMFormatHTMLClass { }; GType em_format_html_get_type (void); +EWebView * em_format_html_get_web_view (EMFormatHTML *efh); void em_format_html_load_images (EMFormatHTML *efh); void em_format_html_get_color (EMFormatHTML *efh, EMFormatHTMLColorType type, diff --git a/mail/em-utils.c b/mail/em-utils.c index ed6cef3779..3485e55818 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -367,10 +367,10 @@ em_utils_flag_for_followup (EMailReader *reader, CamelFolder *folder, GPtrArray *uids) { - EMFormatHTMLDisplay *html_display; + EShell *shell; EShellSettings *shell_settings; EShellBackend *shell_backend; - EShell *shell; + EMFormatHTML *formatter; GtkWidget *editor; GtkWindow *window; CamelTag *tags; @@ -454,8 +454,8 @@ em_utils_flag_for_followup (EMailReader *reader, camel_folder_thaw (folder); camel_tag_list_free (&tags); - html_display = e_mail_reader_get_html_display (reader); - em_format_redraw (EM_FORMAT (html_display)); + formatter = e_mail_reader_get_formatter (reader); + em_format_redraw (EM_FORMAT (formatter)); exit: /* XXX We shouldn't be freeing this. */ diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c index 5c16a34b21..ecb11e769d 100644 --- a/modules/mail/e-mail-shell-backend.c +++ b/modules/mail/e-mail-shell-backend.c @@ -781,13 +781,17 @@ static void mbox_create_preview_cb (GObject *preview, GtkWidget **preview_widget) { EMFormatHTMLDisplay *format; + EWebView *web_view; g_return_if_fail (preview != NULL); g_return_if_fail (preview_widget != NULL); format = em_format_html_display_new (); - g_object_set_data_full (preview, "mbox-imp-formatter", format, g_object_unref); - *preview_widget = GTK_WIDGET (EM_FORMAT_HTML (format)->html); + g_object_set_data_full ( + preview, "mbox-imp-formatter", format, g_object_unref); + web_view = em_format_html_get_web_view (EM_FORMAT_HTML (format)); + + *preview_widget = GTK_WIDGET (web_view); } static void diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c index d029b469b3..5d5ee14e3a 100644 --- a/modules/mail/e-mail-shell-content.c +++ b/modules/mail/e-mail-shell-content.c @@ -57,7 +57,7 @@ struct _EMailShellContentPrivate { GtkWidget *message_list; GtkWidget *search_bar; - EMFormatHTMLDisplay *html_display; + EMFormatHTMLDisplay *formatter; GalViewInstance *view_instance; GtkOrientation orientation; @@ -370,9 +370,9 @@ mail_shell_content_dispose (GObject *object) priv->search_bar = NULL; } - if (priv->html_display != NULL) { - g_object_unref (priv->html_display); - priv->html_display = NULL; + if (priv->formatter != NULL) { + g_object_unref (priv->formatter); + priv->formatter = NULL; } if (priv->view_instance != NULL) { @@ -400,7 +400,7 @@ mail_shell_content_constructed (GObject *object) EWebView *web_view; priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (object); - priv->html_display = em_format_html_display_new (); + priv->formatter = em_format_html_display_new (); /* Chain up to parent's constructed() method. */ G_OBJECT_CLASS (parent_class)->constructed (object); @@ -410,7 +410,8 @@ mail_shell_content_constructed (GObject *object) shell_window = e_shell_view_get_shell_window (shell_view); shell_backend = e_shell_view_get_shell_backend (shell_view); - web_view = E_WEB_VIEW (EM_FORMAT_HTML (priv->html_display)->html); + web_view = em_format_html_get_web_view ( + EM_FORMAT_HTML (priv->formatter)); /* Build content widgets. */ @@ -457,7 +458,7 @@ mail_shell_content_constructed (GObject *object) g_signal_connect_swapped ( search_bar, "changed", - G_CALLBACK (em_format_redraw), priv->html_display); + G_CALLBACK (em_format_redraw), priv->formatter); /* Load the view instance. */ @@ -504,24 +505,24 @@ mail_shell_content_get_action_group (EMailReader *reader) return E_SHELL_WINDOW_ACTION_GROUP_MAIL (shell_window); } -static gboolean -mail_shell_content_get_hide_deleted (EMailReader *reader) +static EMFormatHTML * +mail_shell_content_get_formatter (EMailReader *reader) { - EMailShellContent *mail_shell_content; + EMailShellContentPrivate *priv; - mail_shell_content = E_MAIL_SHELL_CONTENT (reader); + priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); - return !e_mail_shell_content_get_show_deleted (mail_shell_content); + return EM_FORMAT_HTML (priv->formatter); } -static EMFormatHTMLDisplay * -mail_shell_content_get_html_display (EMailReader *reader) +static gboolean +mail_shell_content_get_hide_deleted (EMailReader *reader) { - EMailShellContentPrivate *priv; + EMailShellContent *mail_shell_content; - priv = E_MAIL_SHELL_CONTENT_GET_PRIVATE (reader); + mail_shell_content = E_MAIL_SHELL_CONTENT (reader); - return priv->html_display; + return !e_mail_shell_content_get_show_deleted (mail_shell_content); } static GtkWidget * @@ -736,8 +737,8 @@ static void mail_shell_content_reader_init (EMailReaderIface *iface) { iface->get_action_group = mail_shell_content_get_action_group; + iface->get_formatter = mail_shell_content_get_formatter; iface->get_hide_deleted = mail_shell_content_get_hide_deleted; - iface->get_html_display = mail_shell_content_get_html_display; iface->get_message_list = mail_shell_content_get_message_list; iface->get_popup_menu = mail_shell_content_get_popup_menu; iface->get_shell_backend = mail_shell_content_get_shell_backend; diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c index 63b5b4f400..720f2da87e 100644 --- a/modules/mail/e-mail-shell-view-actions.c +++ b/modules/mail/e-mail-shell-view-actions.c @@ -594,11 +594,11 @@ action_mail_smart_backward_cb (GtkAction *action, EShellSettings *shell_settings; EMailShellSidebar *mail_shell_sidebar; EMFolderTree *folder_tree; - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; EMailReader *reader; GtkWidget *message_list; GtkToggleAction *toggle_action; - GtkHTML *html; + EWebView *web_view; gboolean caret_mode; gboolean magic_spacebar; @@ -613,7 +613,7 @@ action_mail_smart_backward_cb (GtkAction *action, folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar); reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); message_list = e_mail_reader_get_message_list (reader); magic_spacebar = e_shell_settings_get_boolean ( @@ -622,9 +622,9 @@ action_mail_smart_backward_cb (GtkAction *action, toggle_action = GTK_TOGGLE_ACTION (ACTION (MAIL_CARET_MODE)); caret_mode = gtk_toggle_action_get_active (toggle_action); - html = EM_FORMAT_HTML (html_display)->html; + web_view = em_format_html_get_web_view (formatter); - if (e_web_view_scroll_backward (E_WEB_VIEW (html))) + if (e_web_view_scroll_backward (web_view)) return; if (caret_mode || !magic_spacebar) @@ -660,11 +660,11 @@ action_mail_smart_forward_cb (GtkAction *action, EShellSettings *shell_settings; EMailShellSidebar *mail_shell_sidebar; EMFolderTree *folder_tree; - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; EMailReader *reader; GtkWidget *message_list; GtkToggleAction *toggle_action; - GtkHTML *html; + EWebView *web_view; gboolean caret_mode; gboolean magic_spacebar; @@ -679,7 +679,7 @@ action_mail_smart_forward_cb (GtkAction *action, folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar); reader = E_MAIL_READER (mail_shell_view->priv->mail_shell_content); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); message_list = e_mail_reader_get_message_list (reader); magic_spacebar = e_shell_settings_get_boolean ( @@ -688,9 +688,9 @@ action_mail_smart_forward_cb (GtkAction *action, toggle_action = GTK_TOGGLE_ACTION (ACTION (MAIL_CARET_MODE)); caret_mode = gtk_toggle_action_get_active (toggle_action); - html = EM_FORMAT_HTML (html_display)->html; + web_view = em_format_html_get_web_view (formatter); - if (e_web_view_scroll_forward (E_WEB_VIEW (html))) + if (e_web_view_scroll_forward (web_view)) return; if (caret_mode || !magic_spacebar) diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 42394b2f53..b3e856fdee 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -419,7 +419,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) EShellTaskbar *shell_taskbar; EShellWindow *shell_window; EShellSearchbar *searchbar; - EMFormatHTMLDisplay *html_display; + EMFormatHTML *formatter; EMFolderTree *folder_tree; EActionComboBox *combo_box; ERuleContext *context; @@ -462,7 +462,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) priv->mail_shell_sidebar = g_object_ref (shell_sidebar); reader = E_MAIL_READER (shell_content); - html_display = e_mail_reader_get_html_display (reader); + formatter = e_mail_reader_get_formatter (reader); message_list = e_mail_reader_get_message_list (reader); mail_shell_sidebar = E_MAIL_SHELL_SIDEBAR (shell_sidebar); @@ -480,7 +480,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view) folder_tree, "sensitive", combo_box, "sensitive"); - web_view = E_WEB_VIEW (EM_FORMAT_HTML (html_display)->html); + web_view = em_format_html_get_web_view (formatter); g_signal_connect_swapped ( folder_tree, "folder-selected", diff --git a/plugins/audio-inline/Makefile.am b/plugins/audio-inline/Makefile.am index 8d7501a444..1696ecd101 100644 --- a/plugins/audio-inline/Makefile.am +++ b/plugins/audio-inline/Makefile.am @@ -14,6 +14,7 @@ plugin_LTLIBRARIES = liborg-gnome-audio-inline.la liborg_gnome_audio_inline_la_CPPFLAGS = \ $(AM_CPPFLAGS) \ -I$(top_srcdir) \ + -I$(top_srcdir)/widgets \ $(GNOME_PLATFORM_CFLAGS) \ $(EVOLUTION_MAIL_CFLAGS) \ $(GSTREAMER_CFLAGS) diff --git a/plugins/image-inline/image-inline.c b/plugins/image-inline/image-inline.c index 21688dbf94..5548948f1a 100644 --- a/plugins/image-inline/image-inline.c +++ b/plugins/image-inline/image-inline.c @@ -233,15 +233,15 @@ size_allocate_cb (GtkHTMLEmbedded *embedded, ImageInlinePObject *image_object) { GtkAllocation image_allocation; - GtkWidget *widget; + EWebView *web_view; gint pixbuf_width; gint pixbuf_height; gint widget_width; gint widget_height; gdouble zoom = 1.0; - widget = GTK_WIDGET (image_object->object.format->html); - gtk_widget_get_allocation (widget, &image_allocation); + web_view = em_format_html_get_web_view (image_object->object.format); + gtk_widget_get_allocation (GTK_WIDGET (web_view), &image_allocation); widget_width = image_allocation.width - 12; pixbuf_width = gdk_pixbuf_get_width (image_object->pixbuf); @@ -264,10 +264,10 @@ mouse_wheel_scroll_cb (GtkWidget *image_view, { GtkOrientation orientation; GtkScrollType scroll_type; - GtkHTML *html; + EWebView *web_view; gint steps = 2; - html = image_object->object.format->html; + web_view = em_format_html_get_web_view (image_object->object.format); switch (direction) { case GDK_SCROLL_UP: @@ -296,7 +296,8 @@ mouse_wheel_scroll_cb (GtkWidget *image_view, while (steps > 0) { g_signal_emit_by_name ( - html, "scroll", orientation, scroll_type, 2.0, NULL); + web_view, "scroll", + orientation, scroll_type, 2.0, NULL); steps--; } } diff --git a/plugins/mail-to-task/mail-to-task.c b/plugins/mail-to-task/mail-to-task.c index f2e3f98435..e16999584e 100644 --- a/plugins/mail-to-task/mail-to-task.c +++ b/plugins/mail-to-task/mail-to-task.c @@ -893,18 +893,18 @@ text_contains_nonwhitespace (const gchar *text, gint len) static gchar * get_selected_text (EMailReader *reader) { - EMFormatHTMLDisplay *html_display; - GtkHTML *html; + EMFormatHTML *formatter; + EWebView *web_view; gchar *text = NULL; gint len; - html_display = e_mail_reader_get_html_display (reader); - html = EM_FORMAT_HTML (html_display)->html; + formatter = e_mail_reader_get_formatter (reader); + web_view = em_format_html_get_web_view (formatter); - if (!gtk_html_command (html, "is-selection-active")) + if (!e_web_view_is_selection_active (web_view)) return NULL; - text = gtk_html_get_selection_plain_text (html, &len); + text = gtk_html_get_selection_plain_text (GTK_HTML (web_view), &len); if (text == NULL || !text_contains_nonwhitespace (text, len)) { g_free (text); |