goffice r2060 - in trunk: . goffice/graph goffice/utils
- From: jbrefort svn gnome org
- To: svn-commits-list gnome org
- Subject: goffice r2060 - in trunk: . goffice/graph goffice/utils
- Date: Fri, 18 Apr 2008 18:14:40 +0100 (BST)
Author: jbrefort
Date: Fri Apr 18 17:14:40 2008
New Revision: 2060
URL: http://svn.gnome.org/viewvc/goffice?rev=2060&view=rev
Log:
2008-04-18 Jean Brefort <jean brefort normalesup org>
* configure.in: add a test for cairo_ps_surface_set_eps.
* goffice/graph/gog-graph.c:
(gog_graph_get_supported_image_formats): add EPS if cairo supports it.
* goffice/graph/gog-renderer.c: (gog_renderer_export_image): ditto.
* goffice/utils/go-image.h: ditto.
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/configure.in
trunk/goffice/graph/gog-graph.c
trunk/goffice/graph/gog-renderer.c
trunk/goffice/utils/go-image.h
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Fri Apr 18 17:14:40 2008
@@ -2,6 +2,7 @@
Jean:
* Don't try to use invalide data in box-plots. [#527249]
+ * Add EPS export for charts if cairo supports.
Jody:
* Enable the use of dolt.
Modified: trunk/configure.in
==============================================================================
--- trunk/configure.in (original)
+++ trunk/configure.in Fri Apr 18 17:14:40 2008
@@ -382,7 +382,7 @@
SAVE_LIBS=$LIBS
LIBS="$GOFFICE_LIBS $LIBS"
-AC_CHECK_FUNCS(cairo_surface_set_fallback_resolution)
+AC_CHECK_FUNCS(cairo_surface_set_fallback_resolution cairo_ps_surface_set_eps)
LIBS=$SAVE_LIBS
SAVE_CFLAGS=$CFLAGS
Modified: trunk/goffice/graph/gog-graph.c
==============================================================================
--- trunk/goffice/graph/gog-graph.c (original)
+++ trunk/goffice/graph/gog-graph.c Fri Apr 18 17:14:40 2008
@@ -1019,6 +1019,9 @@
gog_graph_get_supported_image_formats (void)
{
static GOImageFormat supported_formats[] = {
+#ifdef HAVE_CAIRO_PS_SURFACE_SET_EPS
+ GO_IMAGE_FORMAT_EPS,
+#endif
#ifdef GOG_RENDERER_CAIRO_WITH_PS
GO_IMAGE_FORMAT_PS,
#endif
Modified: trunk/goffice/graph/gog-renderer.c
==============================================================================
--- trunk/goffice/graph/gog-renderer.c (original)
+++ trunk/goffice/graph/gog-renderer.c Fri Apr 18 17:14:40 2008
@@ -1450,6 +1450,7 @@
gog_graph_get_size (rend->model, &width_in_pts, &height_in_pts);
switch (format) {
+ case GO_IMAGE_FORMAT_EPS:
case GO_IMAGE_FORMAT_PDF:
case GO_IMAGE_FORMAT_PS:
case GO_IMAGE_FORMAT_SVG:
@@ -1497,6 +1498,21 @@
g_warning ("[GogRendererCairo::export_image] cairo SVG backend missing");
return FALSE;
#endif
+ case GO_IMAGE_FORMAT_EPS:
+ rend->marker_as_surface = FALSE;
+#ifdef HAVE_CAIRO_PS_SURFACE_SET_EPS
+ surface = cairo_ps_surface_create_for_stream
+ (_cairo_write_func,
+ output, width_in_pts, height_in_pts);
+ cairo_ps_surface_set_eps (surface, TRUE);
+#ifdef HAVE_CAIRO_SURFACE_SET_FALLBACK_RESOLUTION
+ cairo_surface_set_fallback_resolution (surface, x_dpi, y_dpi);
+#endif
+ break;
+#else
+ g_warning ("[GogRendererCairo::export_image] cairo EPS backend missing");
+ return FALSE;
+#endif
default:
break;
}
Modified: trunk/goffice/utils/go-image.h
==============================================================================
--- trunk/goffice/utils/go-image.h (original)
+++ trunk/goffice/utils/go-image.h Fri Apr 18 17:14:40 2008
@@ -38,6 +38,7 @@
GO_IMAGE_FORMAT_PS,
GO_IMAGE_FORMAT_EMF,
GO_IMAGE_FORMAT_WMF,
+ GO_IMAGE_FORMAT_EPS,
GO_IMAGE_FORMAT_UNKNOWN
} GOImageFormat;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]