aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-10-02 12:26:03 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-10-02 12:26:03 +0800
commit060d4b7e0a682d2e70a5275d8db1ea2f5fb488cc (patch)
treef06ea98eef1d84162a0059bf0df3357179d22267 /mail
parent14cc184b53748a8dd504755415ea0f460073dedf (diff)
downloadgsoc2013-evolution-060d4b7e0a682d2e70a5275d8db1ea2f5fb488cc.tar
gsoc2013-evolution-060d4b7e0a682d2e70a5275d8db1ea2f5fb488cc.tar.gz
gsoc2013-evolution-060d4b7e0a682d2e70a5275d8db1ea2f5fb488cc.tar.bz2
gsoc2013-evolution-060d4b7e0a682d2e70a5275d8db1ea2f5fb488cc.tar.lz
gsoc2013-evolution-060d4b7e0a682d2e70a5275d8db1ea2f5fb488cc.tar.xz
gsoc2013-evolution-060d4b7e0a682d2e70a5275d8db1ea2f5fb488cc.tar.zst
gsoc2013-evolution-060d4b7e0a682d2e70a5275d8db1ea2f5fb488cc.zip
turn off blocking writes. (efh_format_timeout): don't do a htmlbegin on
2003-10-01 Not Zed <NotZed@Ximian.com> * em-format-html.c (efh_init): turn off blocking writes. (efh_format_timeout): don't do a htmlbegin on the page yet, it'll be handled by em-html-stream when it has data, to reduce flicker. (efh_format_do): close the main gtkhtml stream as soon as we're done writing the body. any sub-jobs should be using frames etc. (efh_text_plain): dont write a table around the text, try to reduce flickering. layout may be out now though. * em-html-stream.c (emhs_sync_write): if we have no html_stream yet, begin a new one. svn path=/trunk/; revision=22784
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog13
-rw-r--r--mail/em-format-html.c24
-rw-r--r--mail/em-html-stream.c7
3 files changed, 28 insertions, 16 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 95b53c41b9..cb716bbcd3 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,16 @@
+2003-10-01 Not Zed <NotZed@Ximian.com>
+
+ * em-format-html.c (efh_init): turn off blocking writes.
+ (efh_format_timeout): don't do a htmlbegin on the page yet, it'll
+ be handled by em-html-stream when it has data, to reduce flicker.
+ (efh_format_do): close the main gtkhtml stream as soon as we're
+ done writing the body. any sub-jobs should be using frames etc.
+ (efh_text_plain): dont write a table around the text, try to
+ reduce flickering. layout may be out now though.
+
+ * em-html-stream.c (emhs_sync_write): if we have no html_stream
+ yet, begin a new one.
+
2003-09-30 Rodney Dawes <dobey@ximian.com>
* em-format-html-print.c: Use "Sans Regular" instead of "Helvetica"
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 32f763311d..63f7f7f695 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -119,7 +119,7 @@ efh_init(GObject *o)
efh->priv->text_inline_parts = g_hash_table_new(NULL, NULL);
efh->html = (GtkHTML *)gtk_html_new();
- gtk_html_set_blocking (efh->html, TRUE);
+ gtk_html_set_blocking(efh->html, FALSE);
g_object_ref(efh->html);
gtk_object_sink((GtkObject *)efh->html);
@@ -609,10 +609,10 @@ efh_text_plain(EMFormatHTML *efh, CamelStream *stream, CamelMimePart *part, EMFo
type = camel_mime_part_get_content_type(newpart);
if (camel_content_type_is (type, "text", "plain")) {
- camel_stream_write_string(stream, "<table><tr><td><tt>\n");
+ camel_stream_write_string(stream, "<tt>\n");
em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, camel_medium_get_content_object((CamelMedium *)newpart));
camel_stream_flush((CamelStream *)filtered_stream);
- camel_stream_write_string(stream, "</tt></td></tr></table>\n");
+ camel_stream_write_string(stream, "</tt>\n");
} else {
em_format_part((EMFormat *)efh, stream, newpart);
}
@@ -1086,7 +1086,11 @@ static void efh_format_do(struct _mail_msg *mm)
em_format_format_source((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMimePart *)m->message);
else
em_format_format_message((EMFormat *)m->format, (CamelStream *)m->estream, m->message);
- camel_stream_flush((CamelStream *)m->estream);
+
+ camel_stream_write_string((CamelStream *)m->estream, "</body>\n</html>\n");
+ camel_stream_close((CamelStream *)m->estream);
+ camel_object_unref(m->estream);
+ m->estream = NULL;
puri_level = ((EMFormat *)m->format)->pending_uri_level;
base = ((EMFormat *)m->format)->base;
@@ -1117,20 +1121,11 @@ static void efh_format_do(struct _mail_msg *mm)
camel_url_free(job->base);
g_free(job);
- /* incase anything got added above, force it through */
- camel_stream_flush((CamelStream *)m->estream);
-
g_mutex_lock(m->format->priv->lock);
}
g_mutex_unlock(m->format->priv->lock);
d(printf("out of jobs, done\n"));
- camel_stream_write_string((CamelStream *)m->estream, "</body>\n</html>\n");
-
- camel_stream_close((CamelStream *)m->estream);
- camel_object_unref(m->estream);
- m->estream = NULL;
-
((EMFormat *)m->format)->pending_uri_level = puri_level;
}
@@ -1198,7 +1193,8 @@ efh_format_timeout(struct _format_msg *m)
gtk_html_stream_close(hstream, GTK_HTML_STREAM_OK);
mail_msg_free(m);
} else {
- hstream = gtk_html_begin(efh->html);
+ /*hstream = gtk_html_begin(efh->html);*/
+ hstream = NULL;
m->estream = (EMHTMLStream *)em_html_stream_new(efh->html, hstream);
if (p->last_part == m->message) {
diff --git a/mail/em-html-stream.c b/mail/em-html-stream.c
index e50d6caee0..f55365d7c7 100644
--- a/mail/em-html-stream.c
+++ b/mail/em-html-stream.c
@@ -105,9 +105,12 @@ emhs_sync_write(CamelStream *stream, const char *buffer, size_t n)
{
EMHTMLStream *emhs = EM_HTML_STREAM (stream);
- if (emhs->html_stream == NULL)
+ if (emhs->html == NULL)
return -1;
+ if (emhs->html_stream == NULL)
+ emhs->html_stream = gtk_html_begin(emhs->html);
+
gtk_html_stream_write(emhs->html_stream, buffer, n);
return (ssize_t) n;
@@ -162,7 +165,7 @@ em_html_stream_new(struct _GtkHTML *html, struct _GtkHTMLStream *html_stream)
g_object_ref(html);
new->destroy_id = g_signal_connect(html, "destroy", G_CALLBACK(emhs_gtkhtml_destroy), new);
- em_sync_stream_set_buffer_size(&new->sync, 4096);
+ em_sync_stream_set_buffer_size(&new->sync, 8192);
return (CamelStream *)new;
}