diff options
author | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-03-06 17:38:42 +0800 |
---|---|---|
committer | Bertrand Guiheneuf <bertrand@src.gnome.org> | 2000-03-06 17:38:42 +0800 |
commit | 7c164f12b9ae13cd2f7e068b1b8626701ab8390f (patch) | |
tree | 4027d784956aee7e7b28b78b563edcb639645cd5 /mail/html-stream.c | |
parent | ffad0d32ceef317c2995378f654e8214629948f0 (diff) | |
download | gsoc2013-evolution-7c164f12b9ae13cd2f7e068b1b8626701ab8390f.tar gsoc2013-evolution-7c164f12b9ae13cd2f7e068b1b8626701ab8390f.tar.gz gsoc2013-evolution-7c164f12b9ae13cd2f7e068b1b8626701ab8390f.tar.bz2 gsoc2013-evolution-7c164f12b9ae13cd2f7e068b1b8626701ab8390f.tar.lz gsoc2013-evolution-7c164f12b9ae13cd2f7e068b1b8626701ab8390f.tar.xz gsoc2013-evolution-7c164f12b9ae13cd2f7e068b1b8626701ab8390f.tar.zst gsoc2013-evolution-7c164f12b9ae13cd2f7e068b1b8626701ab8390f.zip |
More changes than a man can remember.
The UI works now.
svn path=/trunk/; revision=2074
Diffstat (limited to 'mail/html-stream.c')
-rw-r--r-- | mail/html-stream.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/mail/html-stream.c b/mail/html-stream.c index d3028dcdcd..31afe4bd25 100644 --- a/mail/html-stream.c +++ b/mail/html-stream.c @@ -1,3 +1,4 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* * html-stream.c: A CamelStream class that feeds data into a GtkHTML widget * @@ -34,12 +35,32 @@ static gint html_stream_write (CamelStream *stream, const gchar *buffer, gint n) { HTMLStream *html_stream = HTML_STREAM (stream); - - gtk_html_write (html_stream->gtk_html, html_stream->gtk_html_stream, buffer, n); + + if (html_stream->gtk_html_stream) + gtk_html_write (html_stream->gtk_html, html_stream->gtk_html_stream, buffer, n); + else + n = 0; return n; } +/* + * CamelStream::Reset method + * + * Reset the html widget that is, prepare it + * for a new display + */ +static void +html_stream_reset (CamelStream *stream) +{ + HTMLStream *html_stream = HTML_STREAM (stream); + + if (html_stream->gtk_html_stream) + gtk_html_end (html_stream->gtk_html, html_stream->gtk_html_stream, GTK_HTML_STREAM_OK); + + html_stream->gtk_html_stream = gtk_html_begin (html_stream->gtk_html, ""); +} + /* * CamelStream::available method * @@ -68,6 +89,7 @@ html_stream_close (CamelStream *stream) HTMLStream *html_stream = HTML_STREAM (stream); gtk_html_end (html_stream->gtk_html, html_stream->gtk_html_stream, GTK_HTML_STREAM_OK); + html_stream->gtk_html_stream = NULL; } static void @@ -86,6 +108,7 @@ html_stream_class_init (GtkObjectClass *object_class) stream_class->read = html_stream_read; stream_class->write = html_stream_write; + stream_class->reset = html_stream_reset; stream_class->available = html_stream_available; stream_class->eos = html_stream_eos; stream_class->close = html_stream_close; |