aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-display.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/mail-display.c')
-rw-r--r--mail/mail-display.c48
1 files changed, 31 insertions, 17 deletions
diff --git a/mail/mail-display.c b/mail/mail-display.c
index 4746c348aa..437f4bb11e 100644
--- a/mail/mail-display.c
+++ b/mail/mail-display.c
@@ -1346,6 +1346,33 @@ clear_data (CamelObject *object, gpointer event_data, gpointer user_data)
g_datalist_clear (&data);
}
+void
+mail_display_render (MailDisplay *md, GtkHTML *html)
+{
+ GtkHTMLStream *stream;
+
+ g_return_if_fail (IS_MAIL_DISPLAY (md));
+ g_return_if_fail (GTK_IS_HTML (html));
+
+ stream = gtk_html_begin (html);
+
+ mail_html_write (html, stream,
+ "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n"
+ "<html>\n"
+ "<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\">\n</head>\n");
+ mail_html_write (html, stream, "<body marginwidth=0 marginheight=0>\n");
+
+ if (md->current_message) {
+ if (md->display_style == MAIL_CONFIG_DISPLAY_SOURCE)
+ mail_format_raw_message (md->current_message, md, html, stream);
+ else
+ mail_format_mime_message (md->current_message, md, html, stream);
+ }
+
+ mail_html_write (html, stream, "</body></html>\n");
+ gtk_html_end (html, stream, GTK_HTML_STREAM_OK);
+}
+
/**
* mail_display_redisplay:
* @mail_display: the mail display object
@@ -1363,25 +1390,12 @@ mail_display_redisplay (MailDisplay *md, gboolean unscroll)
md->redisplay_counter++;
/* printf ("md %p redisplay %d\n", md, md->redisplay_counter); */
- md->stream = gtk_html_begin (GTK_HTML (md->html));
if (!unscroll) {
/* This is a hack until there's a clean way to do this. */
GTK_HTML (md->html)->engine->newPage = FALSE;
}
-
- mail_html_write (md->html, md->stream, "<!doctype html public \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n<html>\n<head>\n<meta name=\"generator\" content=\"Evolution Mail Component\">\n</head>\n");
- mail_html_write (md->html, md->stream, "<body marginwidth=0 marginheight=0>\n");
-
- if (md->current_message) {
- if (md->display_style == MAIL_CONFIG_DISPLAY_SOURCE)
- mail_format_raw_message (md->current_message, md);
- else
- mail_format_mime_message (md->current_message, md);
- }
-
- mail_html_write (md->html, md->stream, "</body></html>\n");
- gtk_html_end (md->html, md->stream, GTK_HTML_STREAM_OK);
- md->stream = NULL;
+
+ mail_display_render (md, md->html);
}
@@ -1459,7 +1473,6 @@ mail_display_init (GtkObject *object)
mail_display->scroll = NULL;
mail_display->html = NULL;
mail_display->redisplay_counter = 0;
- mail_display->stream = NULL;
mail_display->last_active = NULL;
mail_display->idle_id = 0;
mail_display->selection = NULL;
@@ -1469,6 +1482,8 @@ mail_display_init (GtkObject *object)
mail_display->invisible = gtk_invisible_new ();
mail_display->display_style = mail_config_get_message_display_style ();
+
+ mail_display->printing = FALSE;
}
static void
@@ -2100,7 +2115,6 @@ mail_display_new (void)
mail_display->scroll = E_SCROLL_FRAME (scroll);
mail_display->html = GTK_HTML (html);
- mail_display->stream = NULL;
mail_display->last_active = NULL;
mail_display->data = g_new0 (GData *, 1);
g_datalist_init (mail_display->data);
orrect ports that were abusing the FORBIDDEN variable and replace withseanc2003-02-071-1/+1 * Update to 4.0.0.sobomax2002-04-195-39/+264 * Update to 3.2.2.sobomax2001-09-103-2/+4 * Update to 3.2.1.sobomax2001-09-053-2/+10 * Update to 3.2.0.sobomax2001-08-293-116/+23 * Mark it FORBIDDEN for PARALLEL_PACKAGE_BUILD case -- hang.asami2001-08-291-0/+4 * Update to 3.1.0.sobomax2001-04-233-13/+98 * Make all files fetchable.sobomax2001-04-091-0/+1 * Update to 3.0.2.sobomax2001-04-053-4/+3 * Actually update to 3.0.1. Previously announced port "update" was onlysobomax2001-01-292-2/+2 * Update to 3.0.1.sobomax2001-01-242-3/+3 * Fix typo.sobomax2001-01-081-1/+1 * Update to 3.0.0.sobomax2000-12-254-562/+44 * Update to 2.6.0.sobomax2000-11-063-39/+491 * Whitespace-only:sobomax2000-11-011-2/+2 * ${ENV} --> ${SETENV}sobomax2000-10-271-1/+1 * Let the user-defined CLASSPATH environment variable to take precedencesobomax2000-09-261-1/+2 * Update to 2.5.1.sobomax2000-08-014-13/+4 * Update to 2.5.0.sobomax2000-07-124-361/+38