Skip to content

Commit

Permalink
Bump requirements to libspectre 0.2.0. Fixes bug #507705.
Browse files Browse the repository at this point in the history
2008-01-13  Carlos Garcia Campos  <carlosgc@gnome.org>
	* configure.ac:
	* backend/dvi/cairo-device.c: (dvi_cairo_draw_ps):
	* backend/ps/ev-spectre.c: (ps_document_render):
	Bump requirements to libspectre 0.2.0. Fixes bug #507705.

svn path=/trunk/; revision=2816
  • Loading branch information
Carlos Garcia Campos authored and Carlos Garcia Campos committed Jan 13, 2008
1 parent 9fa3616 commit 4207c30
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 15 deletions.
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2008-01-13 Carlos Garcia Campos <carlosgc@gnome.org>

* configure.ac:
* backend/dvi/cairo-device.c: (dvi_cairo_draw_ps):
* backend/ps/ev-spectre.c: (ps_document_render):

Bump requirements to libspectre 0.2.0. Fixes bug #507705.

2008-01-04 Carlos Garnacho <carlosg@gnome.org>

* shell/ev-transition-animation.c (ev_transition_animation_fade)
Expand Down
24 changes: 12 additions & 12 deletions backend/dvi/cairo-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ dvi_cairo_draw_ps (DviContext *dvi,
unsigned char *data = NULL;
int row_length;
SpectreDocument *psdoc;
SpectrePage *page;
SpectreRenderContext *rc;
int w, h;
SpectreStatus status;
cairo_surface_t *image;

Expand All @@ -148,24 +148,24 @@ dvi_cairo_draw_ps (DviContext *dvi,
spectre_document_free (psdoc);
return;
}

page = spectre_document_get_page (psdoc, 0);
if (!page) {
spectre_document_free (psdoc);
return;
}

spectre_document_get_page_size (psdoc, &w, &h);

rc = spectre_render_context_new ();
spectre_render_context_set_page_size (rc, width, height);
spectre_page_render (page, rc, &data, &row_length);
status = spectre_page_status (page);
spectre_render_context_free (rc);
spectre_render_context_set_scale (rc,
(double)width / w,
(double)height / h);
spectre_document_render_full (psdoc, rc, &data, &row_length);
status = spectre_document_status (psdoc);

spectre_page_free (page);
spectre_render_context_free (rc);
spectre_document_free (psdoc);

if (status) {
g_warning ("Error rendering PS document %s: %s\n",
filename, spectre_status_to_string (status));
free (data);

return;
}

Expand Down
4 changes: 3 additions & 1 deletion backend/ps/ev-spectre.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,9 @@ ps_document_render (EvDocument *document,
rotation = (rc->rotation + get_page_rotation (ps_page)) % 360;

src = spectre_render_context_new ();
spectre_render_context_set_page_size (src, width, height);
spectre_render_context_set_scale (src,
(gdouble)width / width_points,
(gdouble)height / height_points);
spectre_render_context_set_rotation (src, rotation);
spectre_page_render (ps_page, src, &data, &stride);
spectre_render_context_free (src);
Expand Down
5 changes: 3 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -261,9 +261,10 @@ fi

AM_CONDITIONAL(ENABLE_PDF, test x$enable_pdf = xyes)
dnl ================== end of pdf checks ============================================
SPECTRE_REQUIRED=0.2.0

dnl libspectre (used by ps and dvi backends)
PKG_CHECK_MODULES(SPECTRE, libspectre,have_spectre=yes,have_spectre=no)
PKG_CHECK_MODULES(SPECTRE, libspectre >= $SPECTRE_REQUIRED,have_spectre=yes,have_spectre=no)
AM_CONDITIONAL(HAVE_SPECTRE, test x$have_spectre = xyes)
if test "x$have_spectre" = "xyes"; then
AC_DEFINE([HAVE_SPECTRE], [1], [Have libpectre])
Expand All @@ -285,7 +286,7 @@ if test x$enable_ps = xyes; then
GS_VERSION=`gs --version | head -n 1 | sed 's/\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'`
AC_MSG_RESULT(found $GS_VERSION)
if test "$GS_VERSION" -lt "7"; then
AC_MSG_WARN([PS support is disabled since libspectre or Ghostscript (version >= 7) are needed])
AC_MSG_WARN([PS support is disabled since libspectre (version >= $SPECTRE_REQUIRED) or Ghostscript (version >= 7) are needed])
enable_ps=no
else
AC_ARG_WITH(gs-aa-params,
Expand Down

0 comments on commit 4207c30

Please sign in to comment.