aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/printing
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-11-10 10:54:37 +0800
committerChris Lahey <clahey@src.gnome.org>2000-11-10 10:54:37 +0800
commit2ad0db845a7e2991ca2bf7f1018d2bd78aad1768 (patch)
tree2117e866a9ccbbde31b7ab7e0f66d2fd0a2c60f4 /addressbook/printing
parent3e041d400f772154ec7ff97d0e097a6f7bb4b98e (diff)
downloadgsoc2013-evolution-2ad0db845a7e2991ca2bf7f1018d2bd78aad1768.tar
gsoc2013-evolution-2ad0db845a7e2991ca2bf7f1018d2bd78aad1768.tar.gz
gsoc2013-evolution-2ad0db845a7e2991ca2bf7f1018d2bd78aad1768.tar.bz2
gsoc2013-evolution-2ad0db845a7e2991ca2bf7f1018d2bd78aad1768.tar.lz
gsoc2013-evolution-2ad0db845a7e2991ca2bf7f1018d2bd78aad1768.tar.xz
gsoc2013-evolution-2ad0db845a7e2991ca2bf7f1018d2bd78aad1768.tar.zst
gsoc2013-evolution-2ad0db845a7e2991ca2bf7f1018d2bd78aad1768.zip
Require gal 0.2.99.1.
2000-11-09 Christopher James Lahey <clahey@helixcode.com> * configure.in: Require gal 0.2.99.1. From addressbook/ChangeLog: 2000-11-09 Christopher James Lahey <clahey@helixcode.com> * backend/pas/pas-backend-ldap.c: Fixed a warning. * gui/component/addressbook.c: Put in gal view menus for testing purposes. * printing/e-contact-print-envelope.c: Fixed up envelope printing a bit. Added code for printing return addresses. svn path=/trunk/; revision=6529
Diffstat (limited to 'addressbook/printing')
-rw-r--r--addressbook/printing/e-contact-print-envelope.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/addressbook/printing/e-contact-print-envelope.c b/addressbook/printing/e-contact-print-envelope.c
index 5a2c695582..d6fbfdc5db 100644
--- a/addressbook/printing/e-contact-print-envelope.c
+++ b/addressbook/printing/e-contact-print-envelope.c
@@ -31,7 +31,7 @@
#define ENVELOPE_HEIGHT (72.0 * 4.0)
-#define ENVELOPE_WIDTH (72.0 * 10.0)
+#define ENVELOPE_WIDTH (72.0 * 9.5)
typedef struct {
int start;
@@ -129,7 +129,7 @@ e_contact_print_envelope_close(GnomeDialog *dialog, gpointer data)
}
static void
-ecpe_print(GnomePrintContext *pc, ECard *ecard)
+ecpe_print(GnomePrintContext *pc, ECard *ecard, gboolean as_return)
{
ECardSimple *card = e_card_simple_new(ecard);
char *address;
@@ -144,10 +144,18 @@ ecpe_print(GnomePrintContext *pc, ECard *ecard)
address = e_card_simple_get(card, E_CARD_SIMPLE_FIELD_ADDRESS_BUSINESS);
linelist = ecpe_break(address);
- font = gnome_font_new("Helvetica", 12);
- ecpe_linelist_dimensions(font, address, linelist, &x, &y);
- x = (ENVELOPE_WIDTH - x) / 2;
- y = (ENVELOPE_HEIGHT - y) / 2;
+ if (as_return)
+ font = gnome_font_new("Helvetica", 9);
+ else
+ font = gnome_font_new("Helvetica", 12);
+ ecpe_linelist_dimensions(font, address, linelist, NULL, &y);
+ if (as_return) {
+ x = 36;
+ y = ENVELOPE_HEIGHT - 36;
+ } else {
+ x = ENVELOPE_WIDTH / 2;
+ y = (ENVELOPE_HEIGHT - y) / 2;
+ }
ecpe_linelist_print(pc, font, address, linelist, x, y);
gtk_object_unref(GTK_OBJECT(font));
g_free(linelist);
@@ -175,7 +183,7 @@ e_contact_print_envelope_button(GnomeDialog *dialog, gint button, gpointer data)
master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) );
pc = gnome_print_master_get_context( master );
- ecpe_print(pc, card);
+ ecpe_print(pc, card, FALSE);
gnome_print_master_print(master);
gnome_dialog_close(dialog);
@@ -184,7 +192,7 @@ e_contact_print_envelope_button(GnomeDialog *dialog, gint button, gpointer data)
master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) );
pc = gnome_print_master_get_context( master );
- ecpe_print(pc, card);
+ ecpe_print(pc, card, FALSE);
preview = GTK_WIDGET(gnome_print_master_preview_new(master, "Print Preview"));
gtk_widget_show_all(preview);