diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | acconfig.h | 1 | ||||
-rw-r--r-- | addressbook/ChangeLog | 4 | ||||
-rw-r--r-- | addressbook/printing/e-contact-print.c | 59 | ||||
-rw-r--r-- | calendar/ChangeLog | 4 | ||||
-rw-r--r-- | calendar/gui/print.c | 42 | ||||
-rw-r--r-- | configure.in | 24 | ||||
-rw-r--r-- | e-util/ChangeLog | 5 | ||||
-rw-r--r-- | e-util/e-unicode.h | 6 | ||||
-rw-r--r-- | widgets/misc/e-unicode.h | 6 |
10 files changed, 98 insertions, 59 deletions
@@ -1,3 +1,9 @@ +2000-08-30 Lauris Kaplinski <lauris@helixcode.com> + + * configure.in: AC_DEFINE(USING_GNOME_PRINT_0_20) + + * acconfig.h: #undef that + 2000-08-30 Peter Williams <peterw@helixcode.com> * configure.in: Robustify the kerberos checks. diff --git a/acconfig.h b/acconfig.h index f0323958db..1f4ba79def 100644 --- a/acconfig.h +++ b/acconfig.h @@ -20,6 +20,7 @@ #undef GPG_PATH #undef PGP5_PATH #undef PGP_PATH +#undef USING_GNOME_PRINT_0_20 /* Define this if you want to build against the development gtk */ #undef HAVE_DEVGTK diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index 8cb3b8deec..100e27bdb5 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,7 @@ +2000-08-30 Lauris Kaplinski <lauris@helixcode.com> + + * printing/e-contact-print.c: Countless small changes for gnome-print 0.21+ + 2000-08-30 Dan Winship <danw@helixcode.com> * gui/component/addressbook.oafinfo: Add a name to the minicard diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c index 00a32f0d57..63e3b674a0 100644 --- a/addressbook/printing/e-contact-print.c +++ b/addressbook/printing/e-contact-print.c @@ -31,6 +31,7 @@ #include <gnome-xml/parser.h> #include <gnome-xml/xmlmemory.h> #include <ctype.h> +#include <e-util/e-unicode.h> #include <addressbook/backend/ebook/e-book.h> #include <addressbook/backend/ebook/e-card.h> #include <addressbook/backend/ebook/e-card-simple.h> @@ -254,7 +255,7 @@ e_contact_output(GnomePrintContext *pc, GnomeFont *font, double x, double y, dou gnome_print_moveto(pc, x, y); gnome_print_show(pc, (char *)list->data); y -= gnome_font_get_descender(font); - y -= .2 * font->size; + y -= .2 * gnome_font_get_size (font); if ( first_line ) { x += gnome_font_get_width_string(font, " "); first_line = 0; @@ -270,17 +271,17 @@ e_contact_text_height(GnomePrintContext *pc, GnomeFont *font, double width, gcha { int line_count = e_contact_divide_text(pc, font, width, text, NULL); return line_count * (gnome_font_get_ascender(font) + gnome_font_get_descender(font)) + - (line_count - 1) * .2 * font->size; + (line_count - 1) * .2 * gnome_font_get_size (font); } #if 0 static void e_contact_output_and_advance(EContactPrintContext *ctxt, GnomeFont *font, double x, double width, gchar *text) { - ctxt->y -= .1 * font->size; + ctxt->y -= .1 * gnome_font_get_size (font); e_contact_output(ctxt->pc, font, x, ctxt->y, width, text); ctxt->y -= e_contact_text_height(ctxt->pc, font, width, text); - ctxt->y -= .1 * font->size; + ctxt->y -= .1 * gnome_font_get_size (font); } #endif @@ -346,7 +347,7 @@ e_contact_print_letter_tab (EContactPrintContext *ctxt) y -= tab_height; } gnome_print_grestore( ctxt->pc ); - return gnome_font_get_width_string(ctxt->style->body_font, "123") + ctxt->style->body_font->size / 5; + return gnome_font_get_width_string(ctxt->style->body_font, "123") + gnome_font_get_size (ctxt->style->body_font) / 5; } static double @@ -403,17 +404,17 @@ e_contact_get_card_size(ECardSimple *simple, EContactPrintContext *ctxt) page_width -= e_contact_get_letter_tab_width(ctxt); column_width = (page_width + 18) / ctxt->style->num_columns - 18; - height += ctxt->style->headings_font->size * .2; + height += gnome_font_get_size (ctxt->style->headings_font) * .2; - height += ctxt->style->headings_font->size * .2; + height += gnome_font_get_size (ctxt->style->headings_font) * .2; gtk_object_get(GTK_OBJECT(simple->card), "file_as", &file_as, NULL); height += e_contact_text_height(ctxt->pc, ctxt->style->headings_font, column_width - 4, file_as); - height += ctxt->style->headings_font->size * .2; + height += gnome_font_get_size (ctxt->style->headings_font) * .2; - height += ctxt->style->headings_font->size * .2; + height += gnome_font_get_size (ctxt->style->headings_font) * .2; for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST; field++) { char *string; @@ -423,11 +424,11 @@ e_contact_get_card_size(ECardSimple *simple, EContactPrintContext *ctxt) xoff += gnome_font_get_width_string(ctxt->style->body_font, e_card_simple_get_name(simple, field)); xoff += gnome_font_get_width_string(ctxt->style->body_font, ": "); height += e_contact_text_height(ctxt->pc, ctxt->style->body_font, column_width - xoff, string); - height += .2 * ctxt->style->body_font->size; + height += .2 * gnome_font_get_size (ctxt->style->body_font); } g_free(string); } - height += ctxt->style->headings_font->size * .4; + height += gnome_font_get_size (ctxt->style->headings_font) * .4; return height; } @@ -446,20 +447,20 @@ e_contact_print_card (ECardSimple *simple, EContactPrintContext *ctxt) gnome_print_gsave(ctxt->pc); - ctxt->y -= ctxt->style->headings_font->size * .2; + ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2; - ctxt->y -= ctxt->style->headings_font->size * .2; + ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2; gtk_object_get(GTK_OBJECT(simple->card), "file_as", &file_as, NULL); if (ctxt->style->print_using_grey) - e_contact_rectangle(ctxt->pc, ctxt->x, ctxt->y + ctxt->style->headings_font->size * .3, ctxt->x + column_width, ctxt->y - e_contact_text_height(ctxt->pc, ctxt->style->headings_font, column_width - 4, file_as) - ctxt->style->headings_font->size * .3, .85, .85, .85); + e_contact_rectangle(ctxt->pc, ctxt->x, ctxt->y + gnome_font_get_size (ctxt->style->headings_font) * .3, ctxt->x + column_width, ctxt->y - e_contact_text_height(ctxt->pc, ctxt->style->headings_font, column_width - 4, file_as) - gnome_font_get_size (ctxt->style->headings_font) * .3, .85, .85, .85); e_contact_output(ctxt->pc, ctxt->style->headings_font, ctxt->x + 2, ctxt->y, column_width - 4, file_as); ctxt->y -= e_contact_text_height(ctxt->pc, ctxt->style->headings_font, column_width - 4, file_as); - ctxt->y -= ctxt->style->headings_font->size * .2; + ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2; - ctxt->y -= ctxt->style->headings_font->size * .2; + ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2; for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST; field++) { char *string; @@ -472,12 +473,12 @@ e_contact_print_card (ECardSimple *simple, EContactPrintContext *ctxt) xoff += gnome_font_get_width_string(ctxt->style->body_font, ": "); e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x + xoff, ctxt->y, column_width - xoff, string); ctxt->y -= e_contact_text_height(ctxt->pc, ctxt->style->body_font, column_width - xoff, string); - ctxt->y -= .2 * ctxt->style->body_font->size; + ctxt->y -= .2 * gnome_font_get_size (ctxt->style->body_font); } g_free(string); } - ctxt->y -= ctxt->style->headings_font->size * .4; + ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .4; gnome_print_grestore(ctxt->pc); } @@ -640,9 +641,9 @@ e_contact_get_phone_list_size(ECardSimple *simple, EContactPrintContext *ctxt) double height = 0; int field; - height += ctxt->style->headings_font->size * .2; + height += gnome_font_get_size (ctxt->style->headings_font) * .2; - height += ctxt->style->headings_font->size * .2; + height += gnome_font_get_size (ctxt->style->headings_font) * .2; for(field = E_CARD_SIMPLE_FIELD_FULL_NAME; field != E_CARD_SIMPLE_FIELD_LAST; field++) { char *string; @@ -651,12 +652,12 @@ e_contact_get_phone_list_size(ECardSimple *simple, EContactPrintContext *ctxt) if ( 1 ) /* field is a phone field. */ { gchar *field = string; height += e_contact_text_height(ctxt->pc, ctxt->style->body_font, 100, field); - height += .2 * ctxt->style->body_font->size; + height += .2 * gnome_font_get_size (ctxt->style->body_font); } } g_free(string); } - height += ctxt->style->headings_font->size * .4; + height += gnome_font_get_size (ctxt->style->headings_font) * .4; return height; } @@ -677,13 +678,13 @@ e_contact_print_phone_list (ECard *card, EContactPrintContext *ctxt) gnome_print_gsave(ctxt->pc); - ctxt->y -= ctxt->style->headings_font->size * .2; + ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2; - ctxt->y -= ctxt->style->headings_font->size * .2; + ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .2; e_contact_output(ctxt->pc, ctxt->style->body_font, ctxt->x, ctxt->y, -1, e_card_get_string_fileas(card)); - xoff = column_width - 9 * ctxt->style->body_font->size; + xoff = column_width - 9 * gnome_font_get_size (ctxt->style->body_font); dotwidth = xoff - gnome_font_get_width_string(ctxt->style->body_font, e_card_get_string_fileas(card)) - gnome_font_get_width_string(ctxt->style->body_font, " "); @@ -706,10 +707,10 @@ e_contact_print_phone_list (ECard *card, EContactPrintContext *ctxt) -1, field); ctxt->y -= e_contact_text_height(ctxt->pc, ctxt->style->body_font, 100, field); - ctxt->y -= .2 * ctxt->style->body_font->size; + ctxt->y -= .2 * gnome_font_get_size (ctxt->style->body_font); } } - ctxt->y -= ctxt->style->headings_font->size * .4; + ctxt->y -= gnome_font_get_size (ctxt->style->headings_font) * .4; gnome_print_grestore(ctxt->pc); } @@ -1004,7 +1005,7 @@ e_contact_print_button(GnomeDialog *dialog, gint button, gpointer data) ctxt->type = GNOME_PRINT_PRINT; font_size = 72 * ctxt->style->page_height / 27.0 / 2.0; - ctxt->letter_heading_font = gnome_font_new(gnome_font_get_name(ctxt->style->headings_font), ctxt->style->headings_font->size * 1.5); + ctxt->letter_heading_font = gnome_font_new(gnome_font_get_name(ctxt->style->headings_font), gnome_font_get_size (ctxt->style->headings_font) * 1.5); ctxt->letter_tab_font = gnome_font_new(gnome_font_get_name(ctxt->style->headings_font), font_size); ctxt->pc = GNOME_PRINT_CONTEXT(gnome_print_multipage_new_from_sizes(pc, @@ -1039,7 +1040,7 @@ e_contact_print_button(GnomeDialog *dialog, gint button, gpointer data) ctxt->type = GNOME_PRINT_PREVIEW; font_size = 72 * ctxt->style->page_height / 27.0 / 2.0; - ctxt->letter_heading_font = gnome_font_new(gnome_font_get_name(ctxt->style->headings_font), ctxt->style->headings_font->size * 1.5); + ctxt->letter_heading_font = gnome_font_new(gnome_font_get_name(ctxt->style->headings_font), gnome_font_get_size (ctxt->style->headings_font) * 1.5); ctxt->letter_tab_font = gnome_font_new(gnome_font_get_name(ctxt->style->headings_font), font_size); ctxt->pc = GNOME_PRINT_CONTEXT(gnome_print_multipage_new_from_sizes(pc, diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 11254d2b8c..3ca3cc789d 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,7 @@ +2000-08-30 Lauris Kaplinski <lauris@helixcode.com> + + * gui/print.c: Countless small changes for gnome-print 0.21+ + 2000-08-30 Federico Mena Quintero <federico@helixcode.com> * gui/gnome-cal.h (GnomeCal): Removed unused field event_editor. diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 1554be0b96..99d60f3c92 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -29,9 +29,9 @@ #include <libgnomeprint/gnome-print-master.h> #include <libgnomeprint/gnome-print-master-preview.h> #include <libgnomeprint/gnome-print-preview.h> -#include <libgnomeprint/gnome-printer-profile.h> #include <libgnomeprint/gnome-printer-dialog.h> #include <e-util/e-dialog-widgets.h> +#include <e-util/e-unicode.h> #include <cal-util/timeutil.h> #include "calendar-commands.h" #include "gnome-cal.h" @@ -243,7 +243,7 @@ print_text(GnomePrintContext *pc, GnomeFont *font, const char *text, enum align_ x = l+((r-l)-w)/2; break; } - gnome_print_moveto(pc, x, t-font->size); + gnome_print_moveto(pc, x, t - gnome_font_get_size (font)); gnome_print_setfont(pc, font); gnome_print_setrgbcolor (pc, 0,0,0); gnome_print_show(pc, text); @@ -266,15 +266,15 @@ titled_box(GnomePrintContext *pc, const char *text, GnomeFont *font, enum align_ { if (align&ALIGN_BORDER) { gnome_print_gsave(pc); - print_border(pc, *l, *r, *t, *t-font->size-font->size*0.4, linewidth, 0.9); - print_border(pc, *l, *r, *t-font->size-font->size*0.4, *b, linewidth, -1.0); + print_border(pc, *l, *r, *t, *t-gnome_font_get_size(font)-gnome_font_get_size(font)*0.4, linewidth, 0.9); + print_border(pc, *l, *r, *t-gnome_font_get_size(font)-gnome_font_get_size(font)*0.4, *b, linewidth, -1.0); gnome_print_grestore(pc); *l+=2; *r-=2; *b+=2; } print_text(pc, font, text, align, *l, *r, *t, *b); - *t-=font->size*1.4; + *t-=gnome_font_get_size(font)*1.4; } enum datefmt { @@ -370,10 +370,10 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal, font = gnome_font_new_closest ("Times", GNOME_FONT_BOLD, 1, size*1.2); /* title font */ if (bordertitle) print_border(pc, - left, left+7*xpad, top, top-font->size*1.3, + left, left+7*xpad, top, top-gnome_font_get_size(font)*1.3, 1.0, 0.9); print_text(pc, font, buf, ALIGN_CENTRE, - left, left+7*xpad, top, top - font->size); + left, left+7*xpad, top, top - gnome_font_get_size (font)); gtk_object_unref (GTK_OBJECT (font)); font_normal = gnome_font_new_closest ("Times", GNOME_FONT_BOOK, 0, size); @@ -382,7 +382,7 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal, gnome_print_setrgbcolor (pc, 0,0,0); for (x=0;x<7;x++) { print_text(pc, font_bold, daynames[(week_starts_on_monday?x+1:x)%7], ALIGN_CENTRE, - left+x*xpad, left+(x+1)*xpad, bottom+7*ypad, bottom+7*ypad-font_bold->size); + left+x*xpad, left+(x+1)*xpad, bottom+7*ypad, bottom+7*ypad-gnome_font_get_size(font_bold)); } for (y=0;y<6;y++) { @@ -404,12 +404,12 @@ print_month_small (GnomePrintContext *pc, GnomeCalendar *gcal, print_border(pc, left+x*xpad+xpad*0.1, left+(x+1)*xpad+xpad*0.1, - bottom+(5-y)*ypad+font->size-ypad*0.15, + bottom+(5-y)*ypad+gnome_font_get_size(font)-ypad*0.15, bottom+(5-y)*ypad-ypad*0.15, -1.0, 0.75); } print_text(pc, font, buf, ALIGN_RIGHT, - left+x*xpad, left+(x+1)*xpad, bottom+(5-y)*ypad+font->size, bottom+(5-y)*ypad); + left+x*xpad, left+(x+1)*xpad, bottom+(5-y)*ypad+gnome_font_get_size(font), bottom+(5-y)*ypad); now = next; } } @@ -445,7 +445,7 @@ bound_text(GnomePrintContext *pc, GnomeFont *font, char *text, double left, doub outbuffer = g_malloc(outbufflen); outbuffendmarker = outbuffer+outbufflen-2; - top -= font->size; + top -= gnome_font_get_size (font); gnome_print_setfont (pc, font); width=0; @@ -470,7 +470,7 @@ bound_text(GnomePrintContext *pc, GnomeFont *font, char *text, double left, doub *o++=c; if (c==' ') wordstart = o; - width+=gnome_font_get_width(font, c); + width+=gnome_font_get_glyph_width(font, gnome_font_lookup_default (font, c)); if (width>maxwidth) dump=1; else @@ -488,7 +488,7 @@ bound_text(GnomePrintContext *pc, GnomeFont *font, char *text, double left, doub width = gnome_font_get_width_string_n(font, outbuffer, o-wordstart); o=outbuffer+(o-wordstart); wordstart = outbuffer; - top -= font->size; + top -= gnome_font_get_size (font); if (top<bottom) { /* too much to fit, drop the rest */ g_free(outbuffer); @@ -506,7 +506,7 @@ bound_text(GnomePrintContext *pc, GnomeFont *font, char *text, double left, doub *o=0; gnome_print_moveto(pc, left, top); gnome_print_show(pc, outbuffer); - top -= font->size; + top -= gnome_font_get_size (font); } g_free(outbuffer); return top; @@ -734,14 +734,14 @@ print_day_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence, x = left + incsmall; xend = right - inc; - if (y - font_summary->size < bottom) + if (y - gnome_font_get_size (font_summary) < bottom) break; tm = *localtime (&ei->start); strftime (buf, 100, TIME_FMT, &tm); gnome_print_moveto (pc, x + (margin - gnome_font_get_width_string (font_summary, buf)), - y - font_summary->size); + y - gnome_font_get_size (font_summary)); gnome_print_show (pc, buf); if (totime) { @@ -751,7 +751,7 @@ print_day_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence, (x + margin + inc + (margin - gnome_font_get_width_string (font_summary, buf))), - y - font_summary->size); + y - gnome_font_get_size (font_summary)); gnome_print_show (pc, buf); y = bound_text (pc, font_summary, ei->text, @@ -764,7 +764,7 @@ print_day_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence, y, yend, -margin + inc); } - y += font_summary->size - inc; + y += gnome_font_get_size (font_summary) - inc; g_free (ei); } @@ -879,9 +879,9 @@ print_month_summary (GnomePrintContext *pc, GnomeCalendar *gcal, time_t whence, format_date(today, DATE_DAYNAME, buf, 100); print_text(pc, font_days, buf, ALIGN_CENTRE, (right-left)*x/7+left, (right-left)*(x+1)/7+left, - top, top-font_days->size); + top, top-gnome_font_get_size(font_days)); } - top -= font_days->size*1.5; + top -= gnome_font_get_size(font_days)*1.5; gtk_object_unref (GTK_OBJECT (font_days)); for (y=0;y<6;y++) { @@ -953,7 +953,7 @@ print_todo_details (GnomePrintContext *pc, GnomeCalendar *gcal, time_t start, ti break; y = bound_text (pc, font_summary, ei->text, x + 2, xend, y, yend, 0); - y += font_summary->size; + y += gnome_font_get_size (font_summary); gnome_print_moveto (pc, x, y - 3); gnome_print_lineto (pc, xend, y - 3); gnome_print_stroke (pc); diff --git a/configure.in b/configure.in index f36180c04c..d360d340a6 100644 --- a/configure.in +++ b/configure.in @@ -185,17 +185,23 @@ AC_SUBST(THREADS_CFLAGS) dnl ************************************************** dnl * Print check dnl ************************************************** -AC_MSG_CHECKING(for GnomePrint libraries version 0.20) -if gnome-config --libs print > /dev/null 2>&1; then - vers=`gnome-config --modversion print | sed -e "s/gnome-print-//"` - if test "$vers" = "0.20"; then - AC_MSG_RESULT(found) +AC_MSG_CHECKING(for GnomePrint libraries version either 0.20 or later) + if gnome-config --libs print > /dev/null 2>&1; then + vers=`gnome-config --modversion print | sed -e "s/gnome-print-//" | awk 'BEGIN { FS = "."; } { print $1 * 1000 + $2;}'` + if test "$vers" -ge 20; then + if test "$vers" -ge 21; then + AC_MSG_RESULT(found >=0.21) + else + AC_MSG_RESULT(found 0.20) + AC_DEFINE(USING_GNOME_PRINT_0_20) + fi else - AC_MSG_ERROR(Please make sure you are using the released version of gnome-print-0.20. Please note that CVS HEAD versions will not work.) + AC_MSG_ERROR(Please upgrade your gnome-print to version 0.20 or later.) fi -else - AC_MSG_ERROR(Did not find GnomePrint installed. Please make sure you are using the released version of gnome-print-0.20. Please note that CVS HEAD versions will not work.) -fi + else + AC_MSG_ERROR(Did not find GnomePrint installed) + fi + GNOME_PRINT_LIBS=`gnome-config --libs print` GNOME_PRINT_CFLAGS=`gnome-config --cflags print` AC_SUBST(GNOME_PRINT_LIBS) diff --git a/e-util/ChangeLog b/e-util/ChangeLog index cf73491624..cefa882edc 100644 --- a/e-util/ChangeLog +++ b/e-util/ChangeLog @@ -1,3 +1,8 @@ +2000-08-30 Lauris Kaplinski <lauris@helixcode.com> + + * e-unicode.h: #define gnome_font_get_size and + gnome_font_get_width, if compiling with gnome-print 0.20 + 2000-08-30 Dan Winship <danw@helixcode.com> * Makefile.am (libeutil_la_LIBADD): make e-util depend on diff --git a/e-util/e-unicode.h b/e-util/e-unicode.h index 5df2932ac4..6fd9c7f5af 100644 --- a/e-util/e-unicode.h +++ b/e-util/e-unicode.h @@ -4,6 +4,12 @@ #include <sys/types.h> #include <glib.h> #include <gtk/gtk.h> +#include <config.h> + +#ifdef USING_GNOME_PRINT_0_20 +#define gnome_font_get_size(f) ((f)->size) +#define gnome_font_get_glyph_width gnome_font_get_width +#endif /* * e_utf8_strstrcase diff --git a/widgets/misc/e-unicode.h b/widgets/misc/e-unicode.h index 5df2932ac4..6fd9c7f5af 100644 --- a/widgets/misc/e-unicode.h +++ b/widgets/misc/e-unicode.h @@ -4,6 +4,12 @@ #include <sys/types.h> #include <glib.h> #include <gtk/gtk.h> +#include <config.h> + +#ifdef USING_GNOME_PRINT_0_20 +#define gnome_font_get_size(f) ((f)->size) +#define gnome_font_get_glyph_width gnome_font_get_width +#endif /* * e_utf8_strstrcase |