", bg_frame, bg_body);
photo = e_contact_get (contact, E_CONTACT_PHOTO);
if (!photo)
photo = e_contact_get (contact, E_CONTACT_LOGO);
if (photo) {
int calced_width = MAX_COMPACT_IMAGE_DIMENSION, calced_height = MAX_COMPACT_IMAGE_DIMENSION;
GdkPixbufLoader *loader = gdk_pixbuf_loader_new ();
GdkPixbuf *pixbuf;
/* figure out if we need to downscale the
image here. we don't scale the pixbuf
itself, just insert width/height tags in
the html */
gdk_pixbuf_loader_write (loader, photo->data.inlined.data, photo->data.inlined.length, NULL);
gdk_pixbuf_loader_close (loader, NULL);
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
if (pixbuf)
g_object_ref (pixbuf);
g_object_unref (loader);
if (pixbuf) {
int max_dimension;
calced_width = gdk_pixbuf_get_width (pixbuf);
calced_height = gdk_pixbuf_get_height (pixbuf);
max_dimension = calced_width;
if (max_dimension < calced_height)
max_dimension = calced_height;
if (max_dimension > MAX_COMPACT_IMAGE_DIMENSION) {
calced_width *= ((float)MAX_COMPACT_IMAGE_DIMENSION / max_dimension);
calced_height *= ((float)MAX_COMPACT_IMAGE_DIMENSION / max_dimension);
}
}
g_object_unref (pixbuf);
gtk_html_stream_printf (html_stream, "",
calced_width, calced_height);
e_contact_photo_free (photo);
}
gtk_html_stream_printf (html_stream, " | \n");
str = e_contact_get_const (contact, E_CONTACT_FILE_AS);
if (str) {
html = e_text_to_html (str, 0);
gtk_html_stream_printf (html_stream, "%s", html);
g_free (html);
}
else {
str = e_contact_get_const (contact, E_CONTACT_FULL_NAME);
if (str) {
html = e_text_to_html (str, 0);
gtk_html_stream_printf (html_stream, "%s", html);
g_free (html);
}
}
gtk_html_stream_write (html_stream, " ", 4);
if (e_contact_get (contact, E_CONTACT_IS_LIST)) {
GList *email_list;
GList *l;
gtk_html_stream_printf (html_stream, "");
gtk_html_stream_printf (html_stream, "%s: | ", _("List Members"));
email_list = e_contact_get (contact, E_CONTACT_EMAIL);
for (l = email_list; l; l = l->next) {
if (l->data) {
html = e_text_to_html (l->data, 0);
gtk_html_stream_printf (html_stream, "%s, ", html);
g_free (html);
}
}
gtk_html_stream_printf (html_stream, " | ");
}
else {
gboolean comma = FALSE;
str = e_contact_get_const (contact, E_CONTACT_TITLE);
if (str) {
html = e_text_to_html (str, 0);
gtk_html_stream_printf (html_stream, "%s: %s ", _("Job Title"), str);
g_free (html);
}
#define print_email() { \
html = eab_parse_qp_email_to_html (str); \
\
if (!html) \
html = e_text_to_html (str, 0); \
\
gtk_html_stream_printf (html_stream, "%s%s", comma ? ", " : "", html); \
g_free (html); \
comma = TRUE; \
}
gtk_html_stream_printf (html_stream, "%s: ", _("Email"));
str = e_contact_get_const (contact, E_CONTACT_EMAIL_1);
if (str)
print_email ();
str = e_contact_get_const (contact, E_CONTACT_EMAIL_2);
if (str)
print_email ();
str = e_contact_get_const (contact, E_CONTACT_EMAIL_3);
if (str)
print_email ();
gtk_html_stream_write (html_stream, " ", 4);
#undef print_email
str = e_contact_get_const (contact, E_CONTACT_HOMEPAGE_URL);
if (str) {
html = e_text_to_html (str, E_TEXT_TO_HTML_CONVERT_URLS);
gtk_html_stream_printf (html_stream, "%s: %s ",
_("Home page"), html);
g_free (html);
}
str = e_contact_get_const (contact, E_CONTACT_BLOG_URL);
if (str) {
html = e_text_to_html (str, E_TEXT_TO_HTML_CONVERT_URLS);
gtk_html_stream_printf (html_stream, "%s: %s ",
_("Blog"), html);
}
}
gtk_html_stream_printf (html_stream, " |