[anjal] More for new renderer.



commit a87ad2739de9b0a5e0b7338e0131caf98f80e488
Author: Srinivasa Ragavan <sragavan novell com>
Date:   Wed Jun 17 17:39:07 2009 +0530

    More for new renderer.

 src/em-format-mail.c |   19 ++++++++++++++++++-
 src/em-format-mail.h |    5 ++++-
 2 files changed, 22 insertions(+), 2 deletions(-)
---
diff --git a/src/em-format-mail.c b/src/em-format-mail.c
index c323241..3791d34 100644
--- a/src/em-format-mail.c
+++ b/src/em-format-mail.c
@@ -1432,6 +1432,8 @@ efh_format_timeout(struct _format_msg *m)
 	} else {
 		efh->state = EM_FORMAT_MAIL_STATE_RENDERING;
 		m->estream = mail_message_view_create_webstream(mail_message_view_create_webview (efh->msg_view, efh->body), efh->body);
+		efh->header_stream = mail_message_view_create_webstream(mail_message_view_create_webview (efh->msg_view, efh->wheaders), efh->wheaders);
+
 #if 0
 		if (p->last_part != m->message) {
 			hstream = gtk_html_begin (efh->html);
@@ -2108,6 +2110,20 @@ static void efh_format_message(EMFormat *emf, CamelStream *stream, CamelMimePart
 	/* Hide headers of the first message. We render them differently. How about for Evolution ?*/
 	if (!efh->hide_headers && emf->message != (CamelMimeMessage *)part)
 		efh_format_headers(efh, stream, (CamelMedium *)part);
+	if (!efh->hide_headers && emf->message == (CamelMimeMessage *) part) {
+		CamelStream *lstream = efh->header_stream;
+		camel_stream_printf(lstream,
+			    "<!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"
+			    "<body bgcolor =\"#%06x\" text=\"#%06x\" marginwidth=6 marginheight=6>\n",
+			    efh->body_colour & 0xffffff,
+			    efh->header_colour & 0xffffff);		
+		efh_format_headers(efh, lstream, (CamelMedium *)part);
+		camel_stream_write_string(lstream, "</body></html>");
+		camel_stream_close (lstream);
+		efh->header_stream = NULL;
+
+	}
 
 #if 1
 	handle = em_format_find_handler(emf, "x-evolution/message/post-header");
@@ -2182,8 +2198,9 @@ efh_busy(EMFormat *emf)
 }
 
 void
-em_format_mail_set_message_view (EMFormatMail *efw, struct _MailMessageView *mmv, GtkWidget *body)
+em_format_mail_set_message_view (EMFormatMail *efw, struct _MailMessageView *mmv, GtkWidget *body, GtkWidget *headers)
 {
 	efw->msg_view = mmv;
 	efw->body = body;
+	efw->wheaders = headers;
 }
diff --git a/src/em-format-mail.h b/src/em-format-mail.h
index e6141ca..f2b167d 100644
--- a/src/em-format-mail.h
+++ b/src/em-format-mail.h
@@ -217,6 +217,8 @@ struct _EMFormatMail {
 
 	GtkWidget *msg_view;
 	GtkWidget *body;
+	GtkWidget *wheaders;
+	CamelStream *header_stream;
 
 	EDList pending_object_list;
 
@@ -286,7 +288,8 @@ void		em_format_mail_job_queue	(EMFormatMail *efh,
 						 EMFormatMailJob *job);
 void 		em_format_mail_set_message_view (EMFormatMail *efw, 
 						 struct _MailMessageView *mmv, 
-						 GtkWidget *body);
+						 GtkWidget *body,
+						 GtkWidget *headers);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]