From 20efd536d04574d105bc8814af4a79cb4e9031e6 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 26 Jan 2000 00:04:14 +0000 Subject: Example contact printing style. Not used yet. 2000-01-25 Christopher James Lahey * addressbook/printing/smallbook.ecps: Example contact printing style. Not used yet. * addressbook/printing/e-contact-print.glade: A glade file for editing contact printing styles. Not used yet. * addressbook/printing/test-print.c: Test file for printing. * addressbook/printing/e-contact-print.c, addressbook/printing/e-contact-print.h, addressbook/printing/e-contact-print-types.h, addressbook/printing/Makefile.am, addressbook/printing/.cvsignore: New files for contact printing support. * addressbook/Makefile.am (SUBDIRS): Add printing. * configure.in: Check for gnome-print. Build the addressbook/printing Makefile. svn path=/trunk/; revision=1634 --- addressbook/printing/.cvsignore | 7 + addressbook/printing/Makefile.am | 33 + addressbook/printing/e-contact-print-types.h | 66 + addressbook/printing/e-contact-print.c | 372 +++++ addressbook/printing/e-contact-print.glade | 1992 ++++++++++++++++++++++++++ addressbook/printing/e-contact-print.h | 31 + addressbook/printing/smallbook.ecps | 32 + addressbook/printing/test-print.c | 80 ++ 8 files changed, 2613 insertions(+) create mode 100644 addressbook/printing/.cvsignore create mode 100644 addressbook/printing/Makefile.am create mode 100644 addressbook/printing/e-contact-print-types.h create mode 100644 addressbook/printing/e-contact-print.c create mode 100644 addressbook/printing/e-contact-print.glade create mode 100644 addressbook/printing/e-contact-print.h create mode 100644 addressbook/printing/smallbook.ecps create mode 100644 addressbook/printing/test-print.c (limited to 'addressbook/printing') diff --git a/addressbook/printing/.cvsignore b/addressbook/printing/.cvsignore new file mode 100644 index 0000000000..cd61db27f2 --- /dev/null +++ b/addressbook/printing/.cvsignore @@ -0,0 +1,7 @@ +.deps +.libs +Makefile +Makefile.in +*.lo +*.la +contact-print-test \ No newline at end of file diff --git a/addressbook/printing/Makefile.am b/addressbook/printing/Makefile.am new file mode 100644 index 0000000000..4fabafafd3 --- /dev/null +++ b/addressbook/printing/Makefile.am @@ -0,0 +1,33 @@ + +CPPFLAGS = \ + -DEVOLUTION_GLADEDIR=\""$(gladedir)"\" \ + -DDATADIR=\""$(datadir)"\" \ + $(GNOME_PRINT_CFLAGS) + +INCLUDES = \ + $(GNOME_INCLUDEDIR) + +noinst_LIBRARIES = \ + libecontactprint.a + +libecontactprint_a_SOURCES = \ + e-contact-print.c \ + e-contact-print.h \ + e-contact-print-types.h + +noinst_PROGRAMS = \ + contact-print-test + +contact_print_test_SOURCES = \ + test-print.c + +contact_print_test_LDADD = \ + $(EXTRA_GNOME_LIBS) \ + libecontactprint.a \ + $(GNOME_PRINT_LIBS) + +gladedir = $(datadir)/evolution/glade + +#glade_DATA = \ +# e-contact-print.glade + diff --git a/addressbook/printing/e-contact-print-types.h b/addressbook/printing/e-contact-print-types.h new file mode 100644 index 0000000000..a59ff32c5e --- /dev/null +++ b/addressbook/printing/e-contact-print-types.h @@ -0,0 +1,66 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * e-contact-print-types.h + * Copyright (C) 2000 Helix Code, Inc. + * Author: Chris Lahey + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef E_CONTACT_PRINT_TYPES_H +#define E_CONTACT_PRINT_TYPES_H + +#include +#include + +typedef struct _EContactPrintStyle EContactPrintStyle; + +struct _EContactPrintStyle +{ + gchar *title; + gboolean sections_start_new_page; + guint num_columns; + guint blank_forms; + gboolean letter_tabs; + gboolean letter_headings; + GnomeFont *headings_font; + GnomeFont *body_font; + gboolean print_using_grey; + gint paper_type; + gdouble paper_width; + gdouble paper_height; + gint paper_source; + gdouble top_margin; + gdouble left_margin; + gdouble bottom_margin; + gdouble right_margin; + gint page_size; + gdouble page_width; + gdouble page_height; + gboolean orientation_portrait; + GnomeFont *header_font; + gchar *left_header; + gchar *center_header; + gchar *right_header; + GnomeFont *footer_font; + gchar *left_footer; + gchar *center_footer; + gchar *right_footer; + gboolean reverse_on_even_pages; +}; + +#endif /* E_CONTACT_PRINT_TYPES_H */ + diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c new file mode 100644 index 0000000000..482ccb6104 --- /dev/null +++ b/addressbook/printing/e-contact-print.c @@ -0,0 +1,372 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * e-contact-print.c + * Copyright (C) 2000 Helix Code, Inc. + * Author: Chris Lahey + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + + +#include "e-contact-print.h" +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct _EContactPrintContext EContactPrintContext; + +struct _EContactPrintContext +{ + GnomePrintContext *pc; + GnomePrintMaster *master; + gdouble x; + gdouble y; + EContactPrintStyle *style; + gboolean first_section; +}; + +static void +e_contact_output(GnomePrintContext *pc, GnomeFont *font, double x, double y, gchar *text) +{ + gnome_print_gsave(pc); + gnome_print_setfont(pc, font); + y -= gnome_font_get_ascender(font); + gnome_print_moveto(pc, x, y); + gnome_print_show(pc, text); + gnome_print_grestore(pc); +} + +static void +e_contact_output_and_advance(EContactPrintContext *ctxt, GnomeFont *font, double x, gchar *text) +{ + ctxt->y -= .1 * font->size; + e_contact_output(ctxt->pc, font, x, ctxt->y, text); + ctxt->y -= gnome_font_get_ascender(font) - gnome_font_get_descender(font); + ctxt->y -= .1 * font->size; +} + +static void +e_contact_rectangle(GnomePrintContext *pc, + gdouble x0, + gdouble y0, + gdouble x1, + gdouble y1, + gdouble r, + gdouble g, + gdouble b) +{ + gnome_print_gsave(pc); + gnome_print_setrgbcolor(pc, r, g, b); + gnome_print_moveto(pc, x0, y0); + gnome_print_lineto(pc, x1, y0); + gnome_print_lineto(pc, x1, y1); + gnome_print_lineto(pc, x0, y1); + gnome_print_lineto(pc, x0, y0); + gnome_print_fill(pc); + gnome_print_grestore(pc); +} + +static gchar *e_card_get_string(void *card, gchar *key) +{ + return key; +} + +static gchar *e_card_get_string_fileas(void *card) +{ + return "Lahey, Chris"; +} + +static void +e_contact_print_letter_heading (EContactPrintContext *ctxt, gchar *character) +{ + gdouble ascender, descender; + gdouble width; + + width = gnome_font_get_width_string(ctxt->style->headings_font, "m "); + ascender = gnome_font_get_ascender(ctxt->style->headings_font); + descender = gnome_font_get_descender(ctxt->style->headings_font); + gnome_print_gsave( ctxt->pc ); + e_contact_rectangle( ctxt->pc, ctxt->x, ctxt->y, ctxt->x + width, ctxt->y - (ctxt->style->headings_font->size + 6), 0, 0, 0); + gnome_print_setrgbcolor(ctxt->pc, 1, 1, 1); + ctxt->y -= 4; + e_contact_output(ctxt->pc, ctxt->style->headings_font, ctxt->x + (width - gnome_font_get_width_string(ctxt->style->headings_font, character))/ 2, ctxt->y, character); + ctxt->y -= ascender - descender; + ctxt->y -= 2; + ctxt->y -= 3; + gnome_print_grestore( ctxt->pc ); +} + +static double +e_contact_get_letter_tab_width (EContactPrintContext *ctxt) +{ + return gnome_font_get_width_string(ctxt->style->body_font, "123") + ctxt->style->body_font->size / 5; +} + +static double +e_contact_get_letter_heading_height (EContactPrintContext *ctxt) +{ + return ctxt->style->headings_font->size * 2; +} + +static void +e_contact_start_new_page(EContactPrintContext *ctxt) +{ + ctxt->x = ctxt->style->left_margin * 72; + ctxt->y = (ctxt->style->page_height - ctxt->style->top_margin) * 72; + gnome_print_showpage(ctxt->pc); +} + +static double +e_contact_get_card_size(void *card, EContactPrintContext *ctxt, GList *shown_fields) +{ + double height = 0; + height += ctxt->style->headings_font->size; + for(; shown_fields; shown_fields = g_list_next(shown_fields)) { + gchar *field = e_card_get_string(card, shown_fields->data); + gchar *start = field; + gchar *text; + gchar *temp; + for( text = start, temp = strchr(text, '\n'); temp; text = temp + 1, temp = strchr(text, '\n')) { + height += ctxt->style->body_font->size; + } + height += ctxt->style->body_font->size; + } + return height; +} + + +static void +e_contact_print_card (void *card, EContactPrintContext *ctxt, GList *shown_fields) +{ + gnome_print_gsave(ctxt->pc); + ctxt->y -= 2; + e_contact_rectangle(ctxt->pc, ctxt->x, ctxt->y + 2, ctxt->x + (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin) * 72, ctxt->y - (gnome_font_get_ascender(ctxt->style->headings_font) - gnome_font_get_descender(ctxt->style->headings_font)) - 2, .85, .85, .85); + e_contact_output(ctxt->pc, ctxt->style->headings_font, ctxt->x + 2, ctxt->y, e_card_get_string_fileas(card)); + ctxt->y -= gnome_font_get_ascender(ctxt->style->headings_font) - gnome_font_get_descender(ctxt->style->headings_font); + ctxt->y -= 2; + + for(; shown_fields; shown_fields = g_list_next(shown_fields)) { + double xoff = 0; + gchar *field = e_card_get_string(card, shown_fields->data); + ctxt->y -= .1 * ctxt->style->body_font->size; + e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, shown_fields->data); + xoff += gnome_font_get_width_string(ctxt->style->body_font, shown_fields->data); + e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, ": "); + xoff += gnome_font_get_width_string(ctxt->style->body_font, ": "); + if (strchr(field, '\n')) { + gchar *start = g_strdup(field); + gchar *text; + gchar *temp; + for( text = start, temp = strchr(text, '\n'); temp; text = temp + 1, temp = strchr(text, '\n')) { + *temp = 0; + e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, text); + ctxt->y -= gnome_font_get_ascender(ctxt->style->body_font) - gnome_font_get_descender(ctxt->style->body_font); + ctxt->y -= .2 * ctxt->style->body_font->size; + xoff = 0; + } + e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, text); + ctxt->y -= gnome_font_get_ascender(ctxt->style->body_font) - gnome_font_get_descender(ctxt->style->body_font); + ctxt->y -= .1 * ctxt->style->body_font->size; + g_free(text); + } else { + e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, field); + ctxt->y -= gnome_font_get_ascender(ctxt->style->body_font) - gnome_font_get_descender(ctxt->style->body_font); + ctxt->y -= .1 * ctxt->style->body_font->size; + } + } + gnome_print_grestore(ctxt->pc); +} + +static void +e_contact_do_print (void *book, EContactPrintContext *ctxt, GList *shown_fields) +{ + gchar *character = NULL; + gchar first_page_character = 'a' - 1; + void *card = NULL; + int i; + gdouble page_height = 72 * (ctxt->style->page_height - ctxt->style->top_margin - ctxt->style->bottom_margin); + gdouble page_width = 72 * (ctxt->style->page_width - ctxt->style->left_margin - ctxt->style->right_margin); + ctxt->y = (ctxt->style->page_height - ctxt->style->top_margin) * 72; + ctxt->x = (ctxt->style->left_margin) * 72; + if ( ctxt->style->letter_tabs ) + page_width -= e_contact_get_letter_tab_width(ctxt); + /* + for(card = e_book_get_first(book); card; card = e_book_get_next(book)) { + */ + for (i=0; i < 40; i++) { + gchar *file_as = e_card_get_string_fileas(card); + if ( ctxt->style->letter_headings && file_as && (!character || *character != tolower(*file_as)) ) { + if (ctxt->style->sections_start_new_page) + e_contact_start_new_page(ctxt); + else if (ctxt->y - e_contact_get_letter_heading_height(ctxt) - e_contact_get_card_size(card, ctxt, shown_fields) < ctxt->style->bottom_margin * 72) + e_contact_start_new_page(ctxt); + if (!character) + character = g_strdup(" "); + *character = tolower(*file_as); + e_contact_print_letter_heading(ctxt, character); + ctxt->first_section = FALSE; + } + if (ctxt->y - e_contact_get_card_size(card, ctxt, shown_fields) < ctxt->style->bottom_margin * 72) { + e_contact_start_new_page(ctxt); + e_contact_print_letter_heading(ctxt, character); + } + e_contact_print_card(card, ctxt, shown_fields); + } + gnome_print_showpage(ctxt->pc); + gnome_print_context_close(ctxt->pc); + g_free(character); +} + +static void +e_contact_build_style(EContactPrintStyle *style) +{ + xmlDocPtr styledoc; + style->title = ""; + style->sections_start_new_page = FALSE; + style->num_columns = 1; + style->blank_forms = 2; + style->letter_tabs = TRUE; + style->letter_headings = TRUE; + style->headings_font = gnome_font_new("Helvetica-Bold", 8); + style->body_font = gnome_font_new("Helvetica", 6); + style->print_using_grey = TRUE; + style->paper_type = 0; + style->paper_width = 8.5; + style->paper_height = 11; + style->paper_source = 0; + style->top_margin = .5; + style->left_margin = .5; + style->bottom_margin = .5; + style->right_margin = .5; + style->page_size = 0; + style->page_width = 2.75; + style->page_height = 4.25; +#if 0 + style->page_width = 4.25; + style->page_height = 5.5; +#endif + style->orientation_portrait = FALSE; + style->header_font = gnome_font_new("Helvetica", 6); + style->left_header = ""; + style->center_header = ""; + style->right_header = ""; + style->footer_font = gnome_font_new("Helvetica", 6); + style->left_footer = ""; + style->center_footer = ""; + style->right_footer = ""; + style->reverse_on_even_pages = FALSE; + + styledoc = xmlParseFile("smallbook.ecps"); + if (styledoc) { +#if 0 + xmlNodePtr stylenode = xmlDocGetRootElement(styledoc); +#endif + xmlFreeDoc(styledoc); + } +} + +static gint +e_contact_print_close(GnomeDialog *dialog, gpointer data) +{ + return FALSE; +} + +static void +e_contact_print_button(GnomeDialog *dialog, gint button, gpointer data) +{ + EContactPrintContext ctxt; + EContactPrintStyle style; + GnomePrintMaster *master; + GtkWidget *preview; + GnomePrintContext *pc; + void *book = gtk_object_get_data(GTK_OBJECT(dialog), "book"); + GList *shown_fields = gtk_object_get_data(GTK_OBJECT(dialog), "shown_fields"); + switch( button ) { + case GNOME_PRINT_PRINT: + master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) ); + pc = gnome_print_master_get_context( master ); + e_contact_build_style(&style); + + ctxt.x = 0; + ctxt.y = 0; + ctxt.style = &style; + ctxt.master = master; + ctxt.first_section = TRUE; + + ctxt.pc = gnome_print_multipage_new_from_sizes(pc, + 72 * style.paper_width, + 72 * style.paper_height, + 72 * style.page_width, + 72 * style.page_height); + + e_contact_do_print(book, &ctxt, shown_fields); + gnome_print_master_print(master); + gtk_object_unref(GTK_OBJECT(ctxt.pc)); + gtk_object_unref(GTK_OBJECT(master)); + gnome_dialog_close(dialog); + break; + case GNOME_PRINT_PREVIEW: + master = gnome_print_master_new_from_dialog( GNOME_PRINT_DIALOG(dialog) ); + pc = gnome_print_master_get_context( master ); + e_contact_build_style(&style); + + ctxt.x = 0; + ctxt.y = 0; + ctxt.style = &style; + ctxt.master = master; + ctxt.first_section = TRUE; + + ctxt.pc = gnome_print_multipage_new_from_sizes(pc, + 72 * style.paper_width, + 72 * style.paper_height, + 72 * style.page_width, + 72 * style.page_height); + + e_contact_do_print(book, &ctxt, shown_fields); + preview = GTK_WIDGET(gnome_print_master_preview_new(master, "Print Preview")); + gtk_widget_show_all(preview); + gtk_object_unref(GTK_OBJECT(ctxt.pc)); + gtk_object_unref(GTK_OBJECT(master)); + break; + case GNOME_PRINT_CANCEL: + gnome_dialog_close(dialog); + break; + } +} + +GtkWidget * +e_contact_print_dialog_new(void *book, GList *shown_fields) +{ + GtkWidget *dialog; + + + dialog = gnome_print_dialog_new("Print cards", GNOME_PRINT_DIALOG_RANGE | GNOME_PRINT_DIALOG_COPIES); + gnome_print_dialog_construct_range_any(GNOME_PRINT_DIALOG(dialog), GNOME_PRINT_RANGE_ALL | GNOME_PRINT_RANGE_SELECTION, + NULL, NULL, NULL); + + gtk_object_set_data(GTK_OBJECT(dialog), "book", book); + gtk_object_set_data(GTK_OBJECT(dialog), "shown_fields", shown_fields); + gtk_signal_connect(GTK_OBJECT(dialog), + "clicked", e_contact_print_button, NULL); + gtk_signal_connect(GTK_OBJECT(dialog), + "close", e_contact_print_close, NULL); + return dialog; +} diff --git a/addressbook/printing/e-contact-print.glade b/addressbook/printing/e-contact-print.glade new file mode 100644 index 0000000000..23088d889e --- /dev/null +++ b/addressbook/printing/e-contact-print.glade @@ -0,0 +1,1992 @@ + + + + + Printing + printing + False + False + False + + + + GnomeDialog + print-edit-style + Page Setup: + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_NONE + False + False + False + False + False + False + + + GtkVBox + GnomeDialog:vbox + dialog-vbox1 + False + 8 + + 4 + True + True + + + + GtkVBox + vbox1 + False + 5 + + 0 + True + True + + + + GtkHBox + hbox2 + 5 + False + 16 + + 0 + True + True + + + + GtkLabel + label8 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + entry1 + True + False + True + 0 + + + 0 + False + False + + + + + + GtkNotebook + notebook1 + True + True + True + GTK_POS_TOP + False + 2 + 2 + False + + 0 + True + True + + + + GtkVBox + vbox2 + 5 + False + 5 + + + GtkAlignment + alignment1 + 0.5 + 0.5 + 0 + 0 + + 0 + True + True + + + + GtkFrame + frame5 + + 0 + GTK_SHADOW_ETCHED_IN + + + Placeholder + + + + + + GtkHBox + hbox1 + True + 7 + + 0 + True + True + + + + GtkFrame + frame6 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkAlignment + alignment4 + 0 + 0 + 0 + 0 + + + GtkTable + table1 + 8 + 6 + 5 + False + 0 + 0 + + + GtkLabel + label5 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 4 + 5 + 0 + 0 + False + False + False + False + True + True + + + + + GtkLabel + label4 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + + + + GtkAlignment + alignment2 + 0 + 0.5 + 0 + 0 + + 1 + 5 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + + + GtkRadioButton + radiobutton1 + True + + True + True + + + + + GtkCheckButton + checkbutton1 + True + + False + True + + 1 + 5 + 4 + 5 + 0 + 0 + False + False + False + False + True + True + + + + + GtkCheckButton + checkbutton2 + True + + False + True + + 1 + 5 + 5 + 6 + 0 + 0 + False + False + False + False + True + True + + + + + GtkAlignment + alignment3 + 0 + 0.5 + 0 + 0 + + 1 + 5 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + + GtkRadioButton + radiobutton2 + True + + False + True + + + + + GtkLabel + label6 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 3 + 2 + 3 + 0 + 2 + False + False + False + False + True + True + + + + + GtkLabel + label7 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 3 + 3 + 4 + 0 + 2 + False + False + False + False + True + True + + + + + GtkAlignment + alignment6 + 0 + 0.5 + 0 + 0 + + 3 + 4 + 3 + 4 + 0 + 2 + False + False + False + False + True + True + + + + GtkSpinButton + spinbutton2 + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 2 + 0 + 100 + 1 + 10 + 10 + + + + + GtkAlignment + alignment5 + 0 + 0.5 + 0 + 0 + + 3 + 4 + 2 + 3 + 0 + 2 + False + False + False + False + True + True + + + + GtkSpinButton + spinbutton1 + 45 + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 1 + 0 + 100 + 1 + 10 + 10 + + + + + + + + GtkVBox + vbox3 + False + 8 + + 0 + True + True + + + + GtkFrame + frame7 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkTable + table2 + 8 + 2 + 2 + False + 13 + 8 + + + GtkAlignment + alignment7 + 0.5 + 1 + 1 + 0 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + + GtkButton + button6 + True + + + + + + GtkAlignment + alignment8 + 0.5 + 1 + 1 + 0 + + 1 + 2 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + + + GtkButton + button5 + 90 + True + + + + + + GtkVBox + vbox4 + False + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + True + False + False + False + True + True + + + + GtkLabel + label10 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + entry3 + 100 + True + True + True + 0 + 10 pt. Tahoma + + 0 + False + False + + + + + + GtkVBox + vbox5 + False + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + True + False + False + False + True + True + + + + GtkLabel + label9 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + entry2 + 100 + True + True + True + 0 + 8 pt. Tahoma + + 0 + False + False + + + + + + + + GtkFrame + frame8 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkCheckButton + checkbutton3 + True + + False + True + + + + + + + + GtkLabel + Notebook:tab + label1 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkHBox + hbox3 + True + 0 + + + GtkVBox + vbox6 + False + 0 + + 0 + True + True + + + + GtkFrame + frame9 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkVBox + vbox16 + 10 + False + 0 + + + GtkVBox + vbox17 + False + 0 + + 0 + True + True + + + + GtkLabel + label21 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkScrolledWindow + scrolledwindow1 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkCList + clist1 + True + 1 + 80 + GTK_SELECTION_SINGLE + False + GTK_SHADOW_IN + + + GtkLabel + CList:title + label26 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + GtkVBox + vbox18 + False + 0 + + 0 + True + True + + + + GtkLabel + label24 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkHBox + hbox5 + True + 0 + + 0 + True + True + + + + GtkLabel + label27 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + entry9 + 1 + True + True + True + 0 + + + 0 + True + True + + + + + GtkLabel + label28 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + entry10 + 1 + True + True + True + 0 + + + 0 + True + True + + + + + + + GtkVBox + vbox19 + False + 0 + + 0 + True + True + + + + GtkLabel + label25 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkCombo + combo1 + False + True + False + True + False + + + 0 + False + False + + + + GtkEntry + GtkCombo:entry + combo-entry1 + True + True + True + 0 + + + + + + + + + GtkFrame + frame10 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkTable + table4 + 15 + 2 + 4 + True + 6 + 9 + + + GtkLabel + label29 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + True + False + False + True + True + + + + + GtkLabel + label30 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + True + False + False + True + True + + + + + GtkLabel + label31 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 2 + 3 + 0 + 1 + 0 + 0 + False + True + False + False + True + True + + + + + GtkEntry + entry11 + 1 + True + True + True + 0 + + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + GtkEntry + entry12 + 1 + True + True + True + 0 + + + 3 + 4 + 0 + 1 + 0 + 0 + True + False + False + False + True + False + + + + + GtkEntry + entry13 + 1 + True + True + True + 0 + + + 3 + 4 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkEntry + entry14 + 1 + True + True + True + 0 + + + 1 + 2 + 1 + 2 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label32 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 2 + 3 + 1 + 2 + 0 + 0 + False + True + False + False + True + True + + + + + + + + GtkVBox + vbox7 + False + 0 + + 0 + True + True + + + + GtkFrame + frame11 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkVBox + vbox8 + 10 + False + 0 + + + GtkVBox + vbox20 + False + 0 + + 0 + True + True + + + + GtkLabel + label33 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkScrolledWindow + scrolledwindow2 + GTK_POLICY_ALWAYS + GTK_POLICY_ALWAYS + GTK_UPDATE_CONTINUOUS + GTK_UPDATE_CONTINUOUS + + 0 + True + True + + + + GtkCList + clist2 + True + 1 + 80 + GTK_SELECTION_SINGLE + False + GTK_SHADOW_IN + + + GtkLabel + CList:title + label35 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + + GtkVBox + vbox21 + False + 0 + + 0 + True + True + + + + GtkLabel + label34 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkHBox + hbox6 + True + 0 + + 0 + True + True + + + + GtkLabel + label36 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + entry15 + 1 + True + True + True + 0 + + + 0 + True + True + + + + + GtkLabel + label37 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + entry16 + 1 + True + True + True + 0 + + + 0 + True + True + + + + + + + + + GtkFrame + frame12 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + True + True + + + + GtkHBox + hbox4 + False + 10 + + + Placeholder + + + + GtkVBox + vbox9 + False + 5 + + 0 + True + True + + + + GtkAlignment + alignment9 + 0 + 1 + 0 + 0 + + 0 + True + True + + + + GtkRadioButton + radiobutton3 + True + + False + True + + + + + GtkAlignment + alignment10 + 0 + 0 + 0 + 0 + + 0 + True + True + + + + GtkRadioButton + radiobutton4 + True + + False + True + + + + + + + + + + GtkLabel + Notebook:tab + label2 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + vbox10 + 8 + False + 0 + + + GtkTable + table5 + 4 + 3 + True + 4 + 4 + + 0 + True + True + + + + GtkAlignment + alignment15 + 0 + 1 + 0 + 0 + + 1 + 2 + 2 + 3 + 0 + 0 + False + False + False + False + True + True + + + + GtkButton + button11 + True + + + + + + GtkText + text10 + 50 + True + False + + + 0 + 1 + 1 + 2 + 0 + 0 + False + True + False + False + True + True + + + + + GtkText + text11 + 50 + True + False + + + 2 + 3 + 1 + 2 + 0 + 0 + True + False + False + False + True + True + + + + + GtkText + text12 + 50 + True + False + + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + + + GtkText + text13 + 50 + True + False + + + 0 + 1 + 3 + 4 + 0 + 0 + False + True + False + False + True + True + + + + + GtkText + text14 + 5 + True + False + + + 1 + 2 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + + + + + GtkText + text15 + 50 + True + False + + + 2 + 3 + 3 + 4 + 0 + 0 + False + False + False + False + True + True + + + + + GtkAlignment + alignment16 + 0.5 + 1 + 1 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + True + False + False + False + True + True + + + + GtkVBox + vbox14 + False + 0 + + + GtkLabel + label14 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + entry7 + True + True + True + 0 + + + 0 + False + False + + + + + + + GtkAlignment + alignment17 + 0.5 + 1 + 1 + 0 + + 0 + 1 + 2 + 3 + 0 + 0 + True + False + False + False + True + True + + + + GtkVBox + vbox15 + False + 0 + + + GtkLabel + label15 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + False + False + + + + + GtkEntry + entry8 + True + True + True + 0 + + + 0 + False + False + + + + + + + GtkAlignment + alignment14 + 0 + 1 + 0 + 0 + + 2 + 3 + 0 + 1 + 0 + 0 + False + False + False + False + True + True + + + + GtkButton + button10 + True + + + + + + + GtkHBox + hbox7 + False + 0 + + 0 + False + True + + + + GtkToolbar + toolbar1 + GTK_ORIENTATION_HORIZONTAL + GTK_TOOLBAR_ICONS + 5 + GTK_TOOLBAR_SPACE_EMPTY + GTK_RELIEF_NORMAL + True + + 0 + True + False + + + + Placeholder + + + + Placeholder + + + + Placeholder + + + + Placeholder + + + + Placeholder + + + + + + GtkCheckButton + checkbutton4 + True + + False + True + + 0 + False + False + + + + + + GtkLabel + Notebook:tab + label3 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + + + GtkHButtonBox + GnomeDialog:action_area + dialog-action_area1 + GTK_BUTTONBOX_END + 8 + 85 + 27 + 7 + 0 + + 0 + False + True + GTK_PACK_END + + + + GtkButton + button1 + True + True + GNOME_STOCK_BUTTON_OK + + + + GtkButton + button2 + True + True + GNOME_STOCK_BUTTON_APPLY + + + + GtkButton + button3 + True + True + GNOME_STOCK_BUTTON_CANCEL + + + + + + diff --git a/addressbook/printing/e-contact-print.h b/addressbook/printing/e-contact-print.h new file mode 100644 index 0000000000..c0688c7273 --- /dev/null +++ b/addressbook/printing/e-contact-print.h @@ -0,0 +1,31 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * e-reflow.c + * Copyright (C) 2000 Helix Code, Inc. + * Author: Chris Lahey + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef E_CONTACT_PRINT_H +#define E_CONTACT_PRINT_H + +#include +#include "e-contact-print-types.h" + +GtkWidget *e_contact_print_dialog_new(void *book, GList *shown_fields); + +#endif /* E_CONTACT_PRINT_H */ diff --git a/addressbook/printing/smallbook.ecps b/addressbook/printing/smallbook.ecps new file mode 100644 index 0000000000..91c65a495b --- /dev/null +++ b/addressbook/printing/smallbook.ecps @@ -0,0 +1,32 @@ + diff --git a/addressbook/printing/test-print.c b/addressbook/printing/test-print.c new file mode 100644 index 0000000000..2ee396d37d --- /dev/null +++ b/addressbook/printing/test-print.c @@ -0,0 +1,80 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* + * test-print.c + * Copyright (C) 2000 Helix Code, Inc. + * Author: Chris Lahey + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "config.h" + +#include +#include +#include "e-contact-print.h" + +/* This is a horrible thing to do, but it is just a test. */ +GtkWidget *print; + +static gint test_close(GnomeDialog *dialog, gpointer data) +{ + exit(0); + return 1; +} + +static void about_callback( GtkWidget *widget, gpointer data ) +{ + + const gchar *authors[] = + { + "Christopher James Lahey ", + NULL + }; + + GtkWidget *about = + gnome_about_new ( _( "Contact Print Test" ), VERSION, + _( "Copyright (C) 2000, Helix Code, Inc." ), + authors, + _( "This should test the contact print code" ), + NULL); + gtk_widget_show (about); +} + +int main( int argc, char *argv[] ) +{ + GList *shown_fields = NULL; + + /* bindtextdomain (PACKAGE, GNOMELOCALEDIR); + textdomain (PACKAGE);*/ + + gnome_init( "Contact Print Test", VERSION, argc, argv); + + glade_gnome_init (); + + shown_fields = g_list_append(shown_fields, "First field"); + shown_fields = g_list_append(shown_fields, "Second field"); + shown_fields = g_list_append(shown_fields, "Third field"); + shown_fields = g_list_append(shown_fields, "Fourth field"); + + print = e_contact_print_dialog_new(NULL, shown_fields); + gtk_widget_show_all(print); + gtk_signal_connect(GTK_OBJECT(print), "close", test_close, NULL); + + gtk_main(); + + /* Not reached. */ + return 0; +} -- cgit v1.2.3