Drop GSF support

Update GIO req to 2.24, and just always use GIO for gzip support.
parent 82d43441
......@@ -89,7 +89,6 @@ librsvg_@RSVG_API_MAJOR_VERSION@_la_CPPFLAGS = \
librsvg_@RSVG_API_MAJOR_VERSION@_la_CFLAGS = \
$(LIBRSVG_CFLAGS) \
$(LIBCROCO_CFLAGS) \
$(LIBGSF_CFLAGS) \
$(AM_CFLAGS)
librsvg_@RSVG_API_MAJOR_VERSION@_la_LDFLAGS = -version-info @RSVG_LT_VERSION_INFO@ -export-dynamic -no-undefined -export-symbols $(srcdir)/librsvg.def $(AM_LDFLAGS)
......@@ -97,7 +96,6 @@ librsvg_@RSVG_API_MAJOR_VERSION@_la_LDFLAGS = -version-info @RSVG_LT_VERSION_INF
librsvg_@RSVG_API_MAJOR_VERSION@_la_LIBADD = \
$(LIBRSVG_LIBS) \
$(LIBCROCO_LIBS) \
$(LIBGSF_LIBS) \
$(libm)
librsvgincdir = $(includedir)/librsvg-$(RSVG_API_VERSION)/librsvg
......@@ -123,7 +121,6 @@ rsvg_convert_CPPFLAGS = \
rsvg_convert_CFLAGS =\
$(LIBRSVG_CFLAGS) \
$(LIBCROCO_CFLAGS) \
$(LIBGSF_CFLAGS) \
$(AM_CFLAGS)
rsvg_convert_LDFLAGS = $(AM_LDFLAGS)
......@@ -132,7 +129,6 @@ rsvg_convert_LDADD = \
$(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la \
$(LIBRSVG_LIBS) \
$(LIBCROCO_LIBS) \
$(LIBGSF_LIBS) \
$(GTHREAD_LIBS) \
$(libm)
......@@ -149,7 +145,6 @@ rsvg_view_CFLAGS =\
$(GTK2_CFLAGS) \
$(LIBRSVG_CFLAGS) \
$(LIBCROCO_CFLAGS) \
$(LIBGSF_CFLAGS) \
$(AM_CFLAGS)
rsvg_view_LDFLAGS =
......@@ -159,7 +154,6 @@ rsvg_view_LDADD = \
$(GTK2_LIBS) \
$(LIBRSVG_LIBS) \
$(LIBCROCO_LIBS) \
$(LIBGSF_LIBS) \
$(GTHREAD_LIBS) \
$(libm)
......@@ -176,7 +170,6 @@ rsvg_view_3_CFLAGS =\
$(GTK3_CFLAGS) \
$(LIBRSVG_CFLAGS) \
$(LIBCROCO_CFLAGS) \
$(LIBGSF_CFLAGS) \
$(AM_CFLAGS)
rsvg_view_3_LDFLAGS =
......@@ -186,7 +179,6 @@ rsvg_view_3_LDADD = \
$(GTK3_LIBS) \
$(LIBRSVG_LIBS) \
$(LIBCROCO_LIBS) \
$(LIBGSF_LIBS) \
$(GTHREAD_LIBS) \
$(libm)
......
......@@ -31,7 +31,7 @@ AC_SUBST([RSVG_API_VERSION_U],[AS_TR_SH([$RSVG_API_VERSION])])
dnl ===========================================================================
GLIB_REQUIRED=2.12.0
GIO_REQUIRED=2.16.0
GIO_REQUIRED=2.24.0
LIBXML_REQUIRED=2.4.7
CAIRO_REQUIRED=1.2.0
PANGOCAIRO_REQUIRED=1.10.0
......@@ -108,58 +108,6 @@ PKG_CHECK_MODULES([GTHREAD],[gthread-2.0 >= $GLIB_REQUIRED])
dnl ===========================================================================
# Using GIO 2.24 we support reading .svg.gz data
svgz_warning=
AC_MSG_CHECKING([whether gio 2.24 is available])
PKG_CHECK_EXISTS([gio-2.0 >= 2.24.0],[have_gio_2_24=yes],[have_gio_2_24=no])
AC_MSG_RESULT([$have_gio_2_24])
AC_SUBST([HAVE_GIO_2_24],[$have_gio_2_24])
if test "$have_gio_2_24" = "yes"; then
svgz_define=1
test_svgz=true
else
LIBGSF_CFLAGS=""
LIBGSF_LIBS=""
LIBGSFPKG=""
test_svgz=true
AC_ARG_WITH(svgz,[ --with-svgz Use libgsf for run-time decompression],[
if test "x$withval" = "xno"; then
test_svgz=false
fi
])
if test "x$test_svgz" = "xtrue"; then
PKG_CHECK_MODULES(LIBGSF,[libgsf-1 >= 1.6.0], test_svgz=true, test_svgz=false)
fi
if test "x$test_svgz" = "xtrue"; then
svgz_define=1
AC_DEFINE([HAVE_GSF],[1],[Define if using libgsf])
LIBGSFPKG="libgsf-1"
else
svgz_define=0
AC_MSG_WARN([SVGZ support disabled, as requested (Use --with-svgz to enable)])
fi
AC_SUBST(LIBGSFPKG)
AC_SUBST(LIBGSF_CFLAGS)
AC_SUBST(LIBGSF_LIBS)
fi # have_gio_2_24
if test "$test_svgz" != "true"; then
svgz_warning="You are building without libgsf support. LibRSVG will not be able to handle GZipped SVGs, as is required per the SVG specification. If you are a library vendor or distributor, you are doing the world a disservice and should strongly consider shipping libgsf."
fi
AC_SUBST([SVGZ_SUPPORTED],[$test_svgz])
AC_SUBST([LIBRSVG_HAVE_SVGZ],[$svgz_define])
dnl ===========================================================================
LIBCROCO_CFLAGS=""
LIBCROCO_LIBS=""
LIBCROCOPKG=""
......@@ -401,14 +349,9 @@ librsvg-$VERSION
GTK 3.0: ${have_gtk_3}
Build GTK 2.0 theme engine: ${enable_gtk_theme}
Build miscellaenous tools: ${build_misc_tools}
Handle svgz files: ${test_svgz}
Use libcroco for css parsing: ${test_croco}
"
if test "x$croco_warning" != "x"; then
AC_MSG_RESULT([$croco_warning]);
fi
if test "x$svgz_warning" != "x"; then
AC_MSG_NOTICE([$svgz_warning]);
fi
......@@ -112,7 +112,6 @@ GTKDOC_CFLAGS = \
-I$(top_srcdir) \
-I$(top_builddir) \
$(LIBRSVG_CFLAGS) \
$(LIBGSF_CFLAGS) \
$(LIBCROCO_CFLAGS) \
$(GTK_CFLAGS) \
$(GDK_X11_CFLAGS) \
......@@ -123,7 +122,6 @@ GTKDOC_CFLAGS = \
GTKDOC_LIBS = \
$(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la \
$(LIBRSVG_LIBS) \
$(LIBGSF_LIBS) \
$(GTHREAD_LIBS) \
$(LIBCROCO_LIBS) \
$(GTK_LIBS)
......
......@@ -18,7 +18,6 @@ libpixbufloader_svg_la_CFLAGS = \
$(GDK_PIXBUF_CFLAGS) \
$(LIBRSVG_CFLAGS) \
$(LIBCROCO_CFLAGS) \
$(LIBGSF_CFLAGS) \
$(AM_CFLASG)
libpixbufloader_svg_la_LDFLAGS = -avoid-version -module $(AM_LDFLAGS)
......@@ -27,8 +26,7 @@ libpixbufloader_svg_la_LIBADD = \
$(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la \
$(GDK_PIXBUF_LIBS) \
$(LIBRSVG_LIBS) \
$(LIBCROCO_LIBS) \
$(LIBGSF_LIBS)
$(LIBCROCO_LIBS)
if PLATFORM_WIN32
libpixbufloader_svg_la_LDFLAGS += -no-undefined
......
......@@ -240,17 +240,13 @@ fill_info (GdkPixbufFormat *info)
"image/svg-xml",
"image/vnd.adobe.svg+xml",
"text/xml-svg",
#if LIBRSVG_CHECK_FEATURE(SVGZ)
"image/svg+xml-compressed",
#endif
NULL
};
static gchar *extensions[] = {
"svg",
#if LIBRSVG_CHECK_FEATURE(SVGZ)
"svgz",
"svg.gz",
#endif
NULL
};
......
......@@ -28,7 +28,6 @@ libsvg_la_CFLAGS = \
$(GTK2_CFLAGS) \
$(LIBRSVG_CFLAGS) \
$(LIBCROCO_CFLAGS) \
$(LIBGSF_CFLAGS) \
$(AM_CFLAGS)
libsvg_la_LDFLAGS = -avoid-version -module $(AM_LDFLAGS)
......@@ -36,8 +35,7 @@ libsvg_la_LIBADD = \
$(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la \
$(GTK2_LIBS) \
$(LIBRSVG_LIBS) \
$(LIBCROCO_LIBS) \
$(LIBGSF_LIBS)
$(LIBCROCO_LIBS)
if PLATFORM_WIN32
libsvg_la_LDFLAGS += -no-undefined
......
......@@ -11,7 +11,7 @@
(LIBRSVG_MAJOR_VERSION == (major) && LIBRSVG_MINOR_VERSION > (minor)) || \
(LIBRSVG_MAJOR_VERSION == (major) && LIBRSVG_MINOR_VERSION == (minor) && LIBRSVG_MICRO_VERSION >= (micro)))
#define LIBRSVG_HAVE_SVGZ (@LIBRSVG_HAVE_SVGZ@)
#define LIBRSVG_HAVE_SVGZ (TRUE)
#define LIBRSVG_HAVE_CSS (@LIBRSVG_HAVE_CSS@)
#define LIBRSVG_CHECK_FEATURE(FEATURE) (defined(LIBRSVG_HAVE_##FEATURE) && LIBRSVG_HAVE_##FEATURE)
......
......@@ -3,7 +3,7 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
svgz_supported=@SVGZ_SUPPORTED@
svgz_supported=true
css_supported=@CSS_SUPPORTED@
Name: librsvg
......
......@@ -3,7 +3,7 @@ exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
svgz_supported=@SVGZ_SUPPORTED@
svgz_supported=true
css_supported=@CSS_SUPPORTED@
Name: librsvg
......
......@@ -43,17 +43,12 @@
#include <libxml/parser.h>
#include <libxml/parserInternals.h>
#include <gio/gio.h>
#include <math.h>
#include <string.h>
#include <stdarg.h>
#ifdef HAVE_GSF
#include <gsf/gsf-input-gzip.h>
#include <gsf/gsf-input-memory.h>
#include <gsf/gsf-output-memory.h>
#include <gsf/gsf-utils.h>
#endif
#include "rsvg-path.h"
#include "rsvg-paint-server.h"
#include "rsvg-xml.h"
......@@ -1715,28 +1710,15 @@ rsvg_handle_write (RsvgHandle * handle, const guchar * buf, gsize count, GError
/* test for GZ marker. todo: store the first 2 bytes in the odd circumstance that someone calls
* write() in 1 byte increments */
if ((count >= 2) && (buf[0] == (guchar) 0x1f) && (buf[1] == (guchar) 0x8b)) {
#if GLIB_CHECK_VERSION (2, 24, 0)
priv->data_input_stream = g_memory_input_stream_new ();
#elif defined (HAVE_GSF)
priv->gzipped_data = GSF_OUTPUT (gsf_output_memory_new ());
#else
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
"GZip compressed SVG not supported");
return FALSE;
#endif
}
}
#if GLIB_CHECK_VERSION (2, 24, 0)
if (priv->data_input_stream) {
g_memory_input_stream_add_data ((GMemoryInputStream *) priv->data_input_stream,
g_memdup (buf, count), count, (GDestroyNotify) g_free);
return TRUE;
}
#elif defined (HAVE_GSF)
if (priv->gzipped_data)
return gsf_output_write (handle->priv->gzipped_data, count, buf);
#endif
return rsvg_handle_write_impl (handle, buf, count, error);
}
......@@ -1763,7 +1745,6 @@ rsvg_handle_close (RsvgHandle * handle, GError ** error)
if (priv->is_closed)
return TRUE;
#if GLIB_CHECK_VERSION (2, 24, 0)
if (priv->data_input_stream) {
GConverter *converter;
GInputStream *stream;
......@@ -1780,49 +1761,6 @@ rsvg_handle_close (RsvgHandle * handle, GError ** error)
return ret;
}
#elif defined(HAVE_GSF)
if (priv->gzipped_data) {
GsfInput *gzip;
const guchar *bytes;
gsize size;
gsize remaining;
bytes = gsf_output_memory_get_bytes (GSF_OUTPUT_MEMORY (priv->gzipped_data));
size = gsf_output_size (priv->gzipped_data);
gzip =
GSF_INPUT (gsf_input_gzip_new
(GSF_INPUT (gsf_input_memory_new (bytes, size, FALSE)), error));
remaining = gsf_input_remaining (gzip);
while ((size = MIN (remaining, 1024)) > 0) {
guint8 const *buf;
/* write to parent */
buf = gsf_input_read (gzip, size, NULL);
if (!buf) {
/* an error occured, so bail */
g_warning (_("rsvg_gz_handle_close_impl: gsf_input_read returned NULL"));
break;
}
rsvg_handle_write_impl (handle, buf, size, error);
/* if we didn't manage to lower remaining number of bytes,
* something is wrong, and we should avoid an endless loop */
if (remaining == ((gsize) gsf_input_remaining (gzip))) {
g_warning (_
("rsvg_gz_handle_close_impl: write_impl didn't lower the input_remaining count"));
break;
}
remaining = gsf_input_remaining (gzip);
}
g_object_unref (gzip);
/* close parent */
gsf_output_close (priv->gzipped_data);
g_object_unref (priv->gzipped_data);
priv->gzipped_data = NULL;
}
#endif /* GIO >= 2.24.0 */
return rsvg_handle_close_impl (handle, error);
}
......@@ -2018,10 +1956,6 @@ rsvg_init (void)
{
g_type_init ();
#ifdef HAVE_GSF
gsf_init ();
#endif
xmlInitParser ();
}
......@@ -2034,10 +1968,6 @@ rsvg_init (void)
void
rsvg_term (void)
{
#ifdef HAVE_GSF
gsf_shutdown ();
#endif
xmlCleanupParser ();
}
......
......@@ -81,11 +81,7 @@ instance_init (RsvgHandle * self)
self->priv->treebase = NULL;
self->priv->finished = 0;
#if GLIB_CHECK_VERSION (2, 24, 0)
self->priv->data_input_stream = NULL;
#elif defined(HAVE_GSF)
self->priv->gzipped_data = NULL;
#endif
self->priv->first_write = TRUE;
self->priv->is_disposed = FALSE;
......@@ -138,7 +134,6 @@ instance_dispose (GObject * instance)
if (self->priv->base_uri)
g_free (self->priv->base_uri);
#if GLIB_CHECK_VERSION (2, 24, 0)
if (self->priv->base_gfile) {
g_object_unref (self->priv->base_gfile);
self->priv->base_gfile = NULL;
......@@ -147,12 +142,6 @@ instance_dispose (GObject * instance)
g_object_unref (self->priv->data_input_stream);
self->priv->data_input_stream = NULL;
}
#elif defined(HAVE_GSF)
if (self->priv->gzipped_data) {
g_object_unref (self->priv->gzipped_data);
self->priv->gzipped_data = NULL;
}
#endif
chain:
rsvg_parent_class->dispose (instance);
......
......@@ -170,11 +170,7 @@ struct RsvgHandlePrivate {
gboolean in_loop; /* see get_dimension() */
gboolean first_write;
#if GLIB_CHECK_VERSION (2, 24, 0)
GInputStream *data_input_stream; /* for rsvg_handle_write of svgz data */
#elif defined(HAVE_GSF)
void *gzipped_data; /* really a GsfOutput */
#endif
};
typedef struct {
......
......@@ -11,7 +11,6 @@ endif
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
$(LIBGSF_CFLAGS) \
$(LIBCROCO_CFLAGS) \
$(LIBRSVG_CFLAGS) \
$(GTK_CFLAGS) \
......@@ -22,7 +21,6 @@ INCLUDES = \
DEPS = $(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la \
librsvg_tools_main.la
LDADDS = \
$(LIBGSF_LIBS) \
$(GLIB_LIBS) \
$(LIBCROCO_LIBS) \
$(LIBRSVG_LIBS) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment