aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-callbacks.c
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-12-12 07:07:22 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-12-12 07:07:22 +0800
commitd91cf0898122e1bac8742665b439fd98ceaa015f (patch)
tree69ecba04eb25889d89e0c2f5ef85824a288bc4f9 /mail/mail-callbacks.c
parent3e70bbe666c1ea68383315c0659aee3757f18cd3 (diff)
downloadgsoc2013-evolution-d91cf0898122e1bac8742665b439fd98ceaa015f.tar.gz
gsoc2013-evolution-d91cf0898122e1bac8742665b439fd98ceaa015f.tar.zst
gsoc2013-evolution-d91cf0898122e1bac8742665b439fd98ceaa015f.zip
Fixed for mail_content_loaded's new signature.
2001-12-11 Jon Trowbridge <trow@ximian.com> * mail-identify.c (mail_identify_mime_part): Fixed for mail_content_loaded's new signature. * mail-format.c (attachment_header): Don't convert URLs, etc. if we are printing. (write_address): Don't convert addresses to mailto: links if we are printing. (write_one_text_plain_chunk): Add a printing flag, that we pass along to mail_text_write. (handle_text_plain): Pass our printing flag to write_one_text_plain_chunk. (mail_get_message_rfc822): Don't unneccesarily convert URLs. (mail_content_loaded): Add a GtkHTML parameter. * mail-display.c (mail_display_initialize_gtkhtml): Added. Breaks all of the signal hookups out of mail_display_new. (mail_display_new): Call mail_display_initialize_gtkhtml. (mail_text_write): Don't convert URLs, etc., if we are printing. Lots of other changes to pass around GtkHTML/GtkHTMLStream objects. * mail-callbacks.c (do_mail_print): Call mail_display_initialize_gtkhtml on our GtkHTML object. * folder-browser.c (update_status_bar): Make the status bar more useful when you have a large number of hidden messages. svn path=/trunk/; revision=14997
Diffstat (limited to 'mail/mail-callbacks.c')
-rw-r--r--mail/mail-callbacks.c42
1 files changed, 35 insertions, 7 deletions
diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c
index 8a5429b3e6..637c01c17f 100644
--- a/mail/mail-callbacks.c
+++ b/mail/mail-callbacks.c
@@ -2326,11 +2326,31 @@ providers_config (BonoboUIComponent *uih, void *user_data, const char *path)
}
}
-/*
- * FIXME: This routine could be made generic, by having a closure
- * function plus data, and having the whole process be taken care
- * of for you
- */
+#define HEADER_HEIGHT 1.1
+#define FOOTER_HEIGHT 1.1
+
+static void
+header_print_cb (GtkHTML *html, GnomePrintContext *print_context,
+ double x, double y, double width, double height, gpointer user_data)
+{
+#if 0
+ gnome_print_setlinewidth (print_context, 12);
+ gnome_print_setrgbcolor (print_context, 1.0, 0.0, 0.0);
+
+ gnome_print_newpath (print_context);
+ gnome_print_moveto (print_context, x, y);
+ gnome_print_lineto (print_context, x+width, y+height);
+ gnome_print_strokepath (print_context);
+#endif
+}
+
+static void
+footer_print_cb (GtkHTML *html, GnomePrintContext *print_context,
+ double x, double y, double width, double height, gpointer user_data)
+{
+
+}
+
static void
do_mail_print (FolderBrowser *fb, gboolean preview)
{
@@ -2375,6 +2395,7 @@ do_mail_print (FolderBrowser *fb, gboolean preview)
print_context = gnome_print_master_get_context (print_master);
html = GTK_HTML (gtk_html_new ());
+ mail_display_initialize_gtkhtml (fb->mail_display, html);
/* Set our 'printing' flag to true and render. This causes us
to ignoring any adjustments we made to accomodate the
@@ -2383,11 +2404,17 @@ do_mail_print (FolderBrowser *fb, gboolean preview)
mail_display_render (fb->mail_display, html);
gtk_html_print_set_master (html, print_master);
+
+#if 0
+ gtk_html_print_with_header_footer (html, print_context,
+ HEADER_HEIGHT, FOOTER_HEIGHT,
+ header_print_cb, footer_print_cb,
+ NULL);
+#endif
gtk_html_print (html, print_context);
fb->mail_display->printing = FALSE;
- gtk_object_unref (GTK_OBJECT (html));
gnome_print_master_close (print_master);
if (preview){
@@ -2405,7 +2432,8 @@ do_mail_print (FolderBrowser *fb, gboolean preview)
_("Printing of message failed"));
}
}
- gtk_object_unref (GTK_OBJECT (print_master));
+
+ /* FIXME: We are leaking the GtkHTML object */
}
/* This is pretty evil. FolderBrowser's API should be extended to allow these sorts of