fixed handling of librsvg API change, based on a patch by S. Mukund (bug

2005-12-19  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/svg.c: fixed handling of librsvg API change,
	based on a patch by S. Mukund (bug #314400).
This commit is contained in:
Sven Neumann
2005-12-19 12:36:27 +00:00
committed by Sven Neumann
parent b5044904b9
commit b53e627eb9
2 changed files with 26 additions and 14 deletions

View File

@ -1,3 +1,8 @@
2005-12-19 Sven Neumann <sven@gimp.org>
* plug-ins/common/svg.c: fixed handling of librsvg API change,
based on a patch by S. Mukund (bug #314400).
2005-12-18 Manish Singh <yosh@gimp.org>
* plug-ins/script-fu/siod-wrapper.c: Finish the reverting here.

View File

@ -417,6 +417,25 @@ load_set_size_callback (gint *width,
}
}
static RsvgHandle *
load_rsvg_handle_new (gdouble xres,
gdouble yres)
{
RsvgHandle *handle = rsvg_handle_new ();
#if (((LIBRSVG_MAJOR_VERSION == 2) && (LIBRSVG_MINOR_VERSION == 13) && \
((LIBRSVG_MICRO_VERSION == 0) || \
(LIBRSVG_MICRO_VERSION == 1) || \
(LIBRSVG_MICRO_VERSION == 2))) || \
((LIBRSVG_MAJOR_VERSION == 2) && (LIBRSVG_MINOR_VERSION == 11) && \
(LIBRSVG_MICRO_VERSION == 0)))
rsvg_handle_set_dpi (handle, xres, yres);
#else
rsvg_handle_set_dpi_x_y (handle, xres, yres);
#endif
return handle;
}
/* This function renders a pixbuf from an SVG file according to vals. */
static GdkPixbuf *
@ -436,13 +455,7 @@ load_rsvg_pixbuf (const gchar *filename,
g_io_channel_set_encoding (io, NULL, NULL);
handle = rsvg_handle_new ();
#if (LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION < 99)
rsvg_handle_set_dpi_x_y (handle, vals->resolution, vals->resolution);
#else
rsvg_handle_set_dpi (handle, vals->resolution, vals->resolution);
#endif
handle = load_rsvg_handle_new (vals->resolution, vals->resolution);
rsvg_handle_set_size_callback (handle, load_set_size_callback, vals, NULL);
@ -538,13 +551,7 @@ load_rsvg_size (const gchar *filename,
g_io_channel_set_encoding (io, NULL, NULL);
handle = rsvg_handle_new ();
#if (LIBRSVG_MAJOR_VERSION == 2 && LIBRSVG_MINOR_VERSION < 99)
rsvg_handle_set_dpi_x_y (handle, vals->resolution, vals->resolution);
#else
rsvg_handle_set_dpi (handle, vals->resolution, vals->resolution);
#endif
handle = load_rsvg_handle_new (vals->resolution, vals->resolution);
rsvg_handle_set_size_callback (handle, load_get_size_callback, vals, NULL);