aboutsummaryrefslogtreecommitdiffstats
path: root/modules/mail/e-mail-shell-content.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-05-31 22:24:14 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-06-01 00:01:49 +0800
commit4f01d3d1823fd8d7b53919b03ff44cc46ad92b77 (patch)
tree93b7541b92635862399d7783cb2fed77cee74ef5 /modules/mail/e-mail-shell-content.c
parent3d9b0002c5802e3d8c3a426221bfb5294691326e (diff)
downloadgsoc2013-evolution-4f01d3d1823fd8d7b53919b03ff44cc46ad92b77.tar
gsoc2013-evolution-4f01d3d1823fd8d7b53919b03ff44cc46ad92b77.tar.gz
gsoc2013-evolution-4f01d3d1823fd8d7b53919b03ff44cc46ad92b77.tar.bz2
gsoc2013-evolution-4f01d3d1823fd8d7b53919b03ff44cc46ad92b77.tar.lz
gsoc2013-evolution-4f01d3d1823fd8d7b53919b03ff44cc46ad92b77.tar.xz
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).
Diffstat (limited to 'modules/mail/e-mail-shell-content.c')
-rw-r--r--modules/mail/e-mail-shell-content.c37
1 files changed, 19 insertions, 18 deletions
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;