Hi, On Fr, 2007-03-09 at 23:45 +0100, Andreas Köhler wrote: > On Sa, 2007-03-03 at 21:14 +1100, Chris wrote: > > To work with my system Fiesty libgoffice-0-3 0.3.5-1ubuntu1 I needed to > > change src/gnome-utils/gnc-html-graph-gog.c to use cairo. > > Attached is a patch I've wrapped these with HAVE_CAIRO. I've not > > attepted any automake foo the set HAVE_CAIRO. > A slimmed down version of your patch with with autoconf foo has been > committed as r15704.
2.0.5 does not seem to have this problem, just because it cannot handle GOffice >= 0.3 (with libgoffice-0.3.pc) anyway and always uses the internal copy. If we ever want to change this, I think the attached patch will do the equivalent to r15704. -- andi5
diff --git a/configure.in b/configure.in index 6a86aac..212e0c7 100644 --- a/configure.in +++ b/configure.in @@ -1890,6 +1890,12 @@ then AM_CONDITIONAL(WITH_GNOME, false) AM_CONDITIONAL(WITH_WIN32, false) + saved_CPPFLAGS="${CPPFLAGS}" + CPPFLAGS="${GOFFICE_CFLAGS} ${CPPFLAGS}" + AC_CHECK_HEADER(goffice/graph/gog-renderer-cairo.h, + [AC_DEFINE(GOFFICE_WITH_CAIRO,1,[GOffice has been built with cairo support])]) + CPPFLAGS="${saved_CPPFLAGS}" + fi ### -goffice-0.0.4 diff --git a/src/bin/generate-gnc-script b/src/bin/generate-gnc-script diff --git a/src/bin/overrides/gnucash-make-guids b/src/bin/overrides/gnucash-make-guids diff --git a/src/engine/iso-currencies-to-c b/src/engine/iso-currencies-to-c diff --git a/src/gnc-test-env b/src/gnc-test-env diff --git a/src/gnome-utils/gnc-html-graph-gog.c b/src/gnome-utils/gnc-html-graph-gog.c index c5c4a03..94f5568 100644 --- a/src/gnome-utils/gnc-html-graph-gog.c +++ b/src/gnome-utils/gnc-html-graph-gog.c @@ -35,7 +35,11 @@ #include <goffice/goffice.h> #include <goffice/graph/gog-graph.h> #include <goffice/graph/gog-object.h> -#include <goffice/graph/gog-renderer-pixbuf.h> +#ifdef GOFFICE_WITH_CAIRO +# include <goffice/graph/gog-renderer-cairo.h> +#else +# include <goffice/graph/gog-renderer-pixbuf.h> +#endif #include <goffice/graph/gog-renderer-gnome-print.h> #include <goffice/graph/gog-style.h> #include <goffice/graph/gog-styled-object.h> @@ -160,7 +164,11 @@ static void add_pixbuf_graph_widget( GtkHTMLEmbedded *eb, GogObject *graph ) { GtkWidget *widget; +#ifdef GOFFICE_WITH_CAIRO + GogRendererCairo *cairo_renderer; +#else GogRendererPixbuf *pixbuf_renderer; +#endif GdkPixbuf *buf; gboolean update_status; @@ -182,12 +190,22 @@ add_pixbuf_graph_widget( GtkHTMLEmbedded *eb, GogObject *graph ) } #endif // 0 +#ifdef GOFFICE_WITH_CAIRO + cairo_renderer = GOG_RENDERER_CAIRO (g_object_new (GOG_RENDERER_CAIRO_TYPE, + "model", graph, + NULL)); + update_status = gog_renderer_cairo_update (cairo_renderer, + eb->width, eb->height, 1.0); + buf = gog_renderer_cairo_get_pixbuf (cairo_renderer); +#else pixbuf_renderer = GOG_RENDERER_PIXBUF (g_object_new (GOG_RENDERER_PIXBUF_TYPE, "model", graph, NULL)); update_status = gog_renderer_pixbuf_update (pixbuf_renderer, eb->width, eb->height, 1.0); buf = gog_renderer_pixbuf_get (pixbuf_renderer); +#endif /* GOFFICE_WITH_CAIRO */ + widget = gtk_image_new_from_pixbuf (buf); gtk_widget_set_size_request (widget, eb->width, eb->height); gtk_widget_show_all (widget);
_______________________________________________ gnucash-devel mailing list gnucash-devel@gnucash.org https://lists.gnucash.org/mailman/listinfo/gnucash-devel