[librsvg] Drop GSF support
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg] Drop GSF support
- Date: Mon, 7 Nov 2011 19:28:17 +0000 (UTC)
commit 59a3fed362fd70e29452fce58d8324cc00e7cc7e
Author: Christian Persch <chpe gnome org>
Date: Sat Oct 22 19:03:27 2011 +0200
Drop GSF support
Update GIO req to 2.24, and just always use GIO for gzip support.
Makefile.am | 8 ----
configure.in | 59 +--------------------------------
doc/Makefile.am | 2 -
gdk-pixbuf-loader/Makefile.am | 4 +--
gdk-pixbuf-loader/io-svg.c | 4 --
gtk-engine/Makefile.am | 4 +--
librsvg-features.h.in | 2 +-
librsvg-uninstalled.pc.in | 2 +-
librsvg.pc.in | 2 +-
rsvg-base.c | 74 +---------------------------------------
rsvg-gobject.c | 11 ------
rsvg-private.h | 4 --
tools/Makefile.am | 2 -
13 files changed, 8 insertions(+), 170 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index d0a367d..6d6f112 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -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)
diff --git a/configure.in b/configure.in
index e39b4c3..2cf5e90 100644
--- a/configure.in
+++ b/configure.in
@@ -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
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 8a3b472..dcccdce 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -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)
diff --git a/gdk-pixbuf-loader/Makefile.am b/gdk-pixbuf-loader/Makefile.am
index 06ce6c8..18c5b80 100644
--- a/gdk-pixbuf-loader/Makefile.am
+++ b/gdk-pixbuf-loader/Makefile.am
@@ -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
diff --git a/gdk-pixbuf-loader/io-svg.c b/gdk-pixbuf-loader/io-svg.c
index 539b11b..dac8f4e 100644
--- a/gdk-pixbuf-loader/io-svg.c
+++ b/gdk-pixbuf-loader/io-svg.c
@@ -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
};
diff --git a/gtk-engine/Makefile.am b/gtk-engine/Makefile.am
index 09ee4aa..4668f24 100644
--- a/gtk-engine/Makefile.am
+++ b/gtk-engine/Makefile.am
@@ -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
diff --git a/librsvg-features.h.in b/librsvg-features.h.in
index 32c87d7..6787c5a 100644
--- a/librsvg-features.h.in
+++ b/librsvg-features.h.in
@@ -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)
diff --git a/librsvg-uninstalled.pc.in b/librsvg-uninstalled.pc.in
index b46c041..2e6fca1 100644
--- a/librsvg-uninstalled.pc.in
+++ b/librsvg-uninstalled.pc.in
@@ -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
diff --git a/librsvg.pc.in b/librsvg.pc.in
index 372f199..d2783a6 100644
--- a/librsvg.pc.in
+++ b/librsvg.pc.in
@@ -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
diff --git a/rsvg-base.c b/rsvg-base.c
index 064398c..d2784f7 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -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 ();
}
diff --git a/rsvg-gobject.c b/rsvg-gobject.c
index 3b158a5..61d85b0 100644
--- a/rsvg-gobject.c
+++ b/rsvg-gobject.c
@@ -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);
diff --git a/rsvg-private.h b/rsvg-private.h
index a17aa9f..5efe904 100644
--- a/rsvg-private.h
+++ b/rsvg-private.h
@@ -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 {
diff --git a/tools/Makefile.am b/tools/Makefile.am
index b5cdaf2..95b0b55 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -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) \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]