? 336090.patch
? compile
? depcomp
? fspot-logo.svg
? include.png
? include.svg
? rsvg-convert
? window.svg
? doc/rsvg.interfaces
? doc/rsvg.prerequisites
? doc/tmpl/rsvg-cairo.sgml
Index: Makefile.am
===================================================================
RCS file: /cvs/gnome/librsvg/Makefile.am,v
retrieving revision 1.86
diff -u -p -u -r1.86 Makefile.am
--- Makefile.am	5 Feb 2006 21:06:00 -0000	1.86
+++ Makefile.am	28 Mar 2006 03:16:31 -0000
@@ -99,7 +99,6 @@ LDADDS =				\
 	$(LIBGSF_LIBS)			\
 	$(LIBCROCO_LIBS)		\
 	$(LIBRSVG_LIBS) 		\
-	$(POPT_LIBS)			\
 	$(top_builddir)/librsvg-2.la
 
 bin_SCRIPTS=rsvg
Index: configure.in
===================================================================
RCS file: /cvs/gnome/librsvg/configure.in,v
retrieving revision 1.143
diff -u -p -u -r1.143 configure.in
--- configure.in	16 Mar 2006 21:46:21 -0000	1.143
+++ configure.in	28 Mar 2006 03:16:31 -0000
@@ -4,18 +4,16 @@ dnl ====================================
 
 FONTCONFIG_REQUIRED=1.0.1	dnl Same as in Pango, ???
 GDK_PIXBUF_REQUIRED=1.3.7
-GLIB_REQUIRED=2.0.0
+GLIB_REQUIRED=2.11.0
 LIBXML_REQUIRED=2.4.7
 CAIRO_REQUIRED=1.0.2
 PANGOFT2_REQUIRED=1.2.0
-POPT_REQUIRED=1.5
 
 AC_SUBST(GDK_PIXBUF_REQUIRED)
 AC_SUBST(GLIB_REQUIRED)
 AC_SUBST(CAIRO_REQUIRED)
 AC_SUBST(LIBXML_REQUIRED)
 AC_SUBST(PANGOFT2_REQUIRED)
-AC_SUBST(POPT_REQUIRED)
 
 dnl ===========================================================================
 
@@ -96,13 +94,6 @@ AC_SUBST(LIBRSVG_CFLAGS)
 
 dnl ===========================================================================
 
-AC_CHECK_LIB(popt, poptParseArgvString, [POPT_LIBS="-lpopt"],
-AC_MSG_ERROR([popt 1.5 or newer is required to build librsvg.
-You can download the latest version from ftp://ftp.rpm.org/pub/rpm/dist/rpm-4.0.x/]))
-AC_SUBST(POPT_LIBS)
-
-dnl ===========================================================================
-
 LIBGSF_CFLAGS=""
 LIBGSF_LIBS=""
 
@@ -221,7 +212,7 @@ else
 fi
 
 have_gtk=no
-PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 1.3.12, have_gtk=yes,
+PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.6.0, have_gtk=yes,
 		       have_gtk=no)
 
 GTK_VERSION=
Index: rsvg-convert.c
===================================================================
RCS file: /cvs/gnome/librsvg/rsvg-convert.c,v
retrieving revision 1.12
diff -u -p -u -r1.12 rsvg-convert.c
--- rsvg-convert.c	19 Mar 2006 16:39:40 -0000	1.12
+++ rsvg-convert.c	28 Mar 2006 03:16:31 -0000
@@ -31,7 +31,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <popt.h>
 
 #include "rsvg.h"
 #include "rsvg-cairo.h"
@@ -110,9 +109,9 @@ rsvg_cairo_write_func (void *closure,
 }
 
 int
-main (int argc, const char **argv)
+main (int argc, char **argv)
 {
-	poptContext popt_context;
+	GOptionContext *g_option_context;
 	double x_zoom = 1.0;
 	double y_zoom = 1.0;
 	double zoom = 1.0;
@@ -127,24 +126,8 @@ main (int argc, const char **argv)
 	char * base_uri = NULL;
 	gboolean using_stdin = FALSE;
 
-	struct poptOption options_table[] = {
-		{ "dpi-x",   'd',  POPT_ARG_DOUBLE, &dpi_x,    0, N_("pixels per inch [optional; defaults to 90dpi]"), N_("<float>") },
-		{ "dpi-y",   'p',  POPT_ARG_DOUBLE, &dpi_y,    0, N_("pixels per inch [optional; defaults to 90dpi]"), N_("<float>") },
-		{ "x-zoom",  'x',  POPT_ARG_DOUBLE, &x_zoom,   0, N_("x zoom factor [optional; defaults to 1.0]"), N_("<float>") },
-		{ "y-zoom",  'y',  POPT_ARG_DOUBLE, &y_zoom,   0, N_("y zoom factor [optional; defaults to 1.0]"), N_("<float>") },
-		{ "zoom",    'z',  POPT_ARG_DOUBLE, &zoom,     0, N_("zoom factor [optional; defaults to 1.0]"), N_("<float>") },
-		{ "width",   'w',  POPT_ARG_INT,    &width,    0, N_("width [optional; defaults to the SVG's width]"), N_("<int>") },
-		{ "height",  'h',  POPT_ARG_INT,    &height,   0, N_("height [optional; defaults to the SVG's height]"), N_("<int>") },		
-		{ "format",  'f',  POPT_ARG_STRING, &format,   0, N_("save format [optional; defaults to 'png']"), N_("[png, pdf, ps, svg]") },
-		{ "output",  'o',  POPT_ARG_STRING, &output,   0, N_("output filename [optional; defaults to stdout]"), NULL },
-		{ "keep-aspect-ratio", 'a', POPT_ARG_NONE, &keep_aspect_ratio, 0, N_("whether to preserve the aspect ratio [optional; defaults to FALSE]"), NULL },
-		{ "version", 'v',  POPT_ARG_NONE,   &bVersion, 0, N_("show version information"), NULL },
-		{ "base-uri", 'b', POPT_ARG_STRING, &base_uri, 0, N_("base uri"), NULL },
-		POPT_AUTOHELP
-		POPT_TABLEEND
-	};
-	int c, i;
-	const char * const *args;
+	int i;
+	char **args;
 	gint n_args = 0;
 	RsvgHandle *rsvg;
 	cairo_surface_t *surface = NULL;
@@ -152,15 +135,35 @@ main (int argc, const char **argv)
 	RsvgDimensionData dimensions;
 	FILE * output_file = stdout;
 
-	popt_context = poptGetContext ("rsvg-cairo", argc, argv, options_table, 0);
-	poptSetOtherOptionHelp (popt_context, _("[OPTIONS...]"));
+	GOptionEntry options_table[] = {
+		{ "dpi-x",   'd',  0, G_OPTION_ARG_DOUBLE, &dpi_x,    N_("pixels per inch [optional; defaults to 90dpi]"), N_("<float>") },
+		{ "dpi-y",   'p',  0, G_OPTION_ARG_DOUBLE, &dpi_y,    N_("pixels per inch [optional; defaults to 90dpi]"), N_("<float>") },
+		{ "x-zoom",  'x',  0, G_OPTION_ARG_DOUBLE, &x_zoom,   N_("x zoom factor [optional; defaults to 1.0]"), N_("<float>") },
+		{ "y-zoom",  'y',  0, G_OPTION_ARG_DOUBLE, &y_zoom,   N_("y zoom factor [optional; defaults to 1.0]"), N_("<float>") },
+		{ "zoom",    'z',  0, G_OPTION_ARG_DOUBLE, &zoom,     N_("zoom factor [optional; defaults to 1.0]"), N_("<float>") },
+		{ "width",   'w',  0, G_OPTION_ARG_INT,    &width,    N_("width [optional; defaults to the SVG's width]"), N_("<int>") },
+		{ "height",  'h',  0, G_OPTION_ARG_INT,    &height,   N_("height [optional; defaults to the SVG's height]"), N_("<int>") },		
+		{ "format",  'f',  0, G_OPTION_ARG_STRING, &format,   N_("save format [optional; defaults to 'png']"), N_("[png, pdf, ps, svg]") },
+		{ "output",  'o',  0, G_OPTION_ARG_STRING, &output,   N_("output filename [optional; defaults to stdout]"), NULL },
+		{ "keep-aspect-ratio", 'a', 0, G_OPTION_ARG_NONE, &keep_aspect_ratio, N_("whether to preserve the aspect ratio [optional; defaults to FALSE]"), NULL },
+		{ "version", 'v',  0, G_OPTION_ARG_NONE,   &bVersion, N_("show version information"), NULL },
+		{ "base-uri", 'b', 0, G_OPTION_ARG_STRING, &base_uri, N_("base uri"), NULL },
+		{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &args, NULL,  N_("[FILE...]") },
+		{ NULL }
+	};
+
+	g_option_context = g_option_context_new (_("- SVG Converter"));
+	g_option_context_add_main_entries (g_option_context, options_table, NULL);
+	g_option_context_set_help_enabled (g_option_context, TRUE);
+	if(!g_option_context_parse (g_option_context, &argc, &argv, NULL)) {
+		exit(1);
+	}
 
-	c = poptGetNextOpt (popt_context);
-	args = poptGetArgs (popt_context);
+	g_option_context_free (g_option_context);
 
 	if (bVersion != 0)
 		{
-		    printf (_("rsvg-cairo version %s\n"), VERSION);
+		    printf (_("rsvg-convert version %s\n"), VERSION);
 			return 0;
 		}
 
@@ -308,7 +311,6 @@ main (int argc, const char **argv)
 
 	fclose (output_file);
 
-	poptFreeContext (popt_context);
 	rsvg_term();
 
 	return 0;
Index: test-display.c
===================================================================
RCS file: /cvs/gnome/librsvg/test-display.c,v
retrieving revision 1.42
diff -u -p -u -r1.42 test-display.c
--- test-display.c	5 Feb 2006 16:57:05 -0000	1.42
+++ test-display.c	28 Mar 2006 03:16:32 -0000
@@ -22,7 +22,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <popt.h>
 
 #include <gtk/gtk.h>
 #include <gdk/gdk.h>
@@ -670,7 +669,7 @@ int 
 main (int argc, char **argv)
 {
 	GError * err = NULL;
-	poptContext popt_context;
+	GOptionContext *g_option_context;
 	double x_zoom = 1.0;
 	double y_zoom = 1.0;
 	double dpi_x = -1.0;
@@ -688,39 +687,43 @@ main (int argc, char **argv)
 
 	struct RsvgSizeCallbackData size_data;
 
-	struct poptOption options_table[] = 
+	char **args;
+	gint n_args = 0;
+
+	GOptionEntry options_table[] = 
 		{
 #ifdef ENABLE_XEMBED
-			{ "xid",         'i',  POPT_ARG_INT,    &xid,         0, N_("XWindow ID [for X11 embedding]"), N_("<int>") },
+			{ "xid",         'i',  0, G_OPTION_ARG_INT,    &xid,         N_("XWindow ID [for X11 embedding]"), N_("<int>") },
 #endif
-			{ "stdin",       's',  POPT_ARG_NONE,   &from_stdin,  0, N_("Read from stdin instead of a file"), NULL },
-			{ "dpi-x",       'd',  POPT_ARG_DOUBLE, &dpi_x,       0, N_("Set the # of Pixels Per Inch"), N_("<float>") },
-			{ "dpi-y",       'p',  POPT_ARG_DOUBLE, &dpi_y,       0, N_("Set the # of Pixels Per Inch"), N_("<float>") },
-			{ "x-zoom",      'x',  POPT_ARG_DOUBLE, &x_zoom,      0, N_("Set the x zoom factor"), N_("<float>") },
-			{ "y-zoom",      'y',  POPT_ARG_DOUBLE, &y_zoom,      0, N_("Set the y zoom factor"), N_("<float>") },
-			{ "width",       'w',  POPT_ARG_INT,    &width,       0, N_("Set the image's width"), N_("<int>") },
-			{ "height",      'h',  POPT_ARG_INT,    &height,      0, N_("Set the image's height"), N_("<int>") },
-			{ "bg-color",    'b',  POPT_ARG_STRING, &bg_color,    0, N_("Set the image background color (default: transparent)"), N_("<string>") },
-			{ "base-uri",    'u',  POPT_ARG_STRING, &base_uri,    0, N_("Set the base URI (default: none)"), N_("<string>") },
-			{ "keep-aspect", 'k',  POPT_ARG_NONE,   &bKeepAspect, 0, N_("Preserve the image's aspect ratio"), NULL },
-			{ "version",     'v',  POPT_ARG_NONE,   &bVersion,    0, N_("Show version information"), NULL },
-			POPT_AUTOHELP
-			POPT_TABLEEND
+			{ "stdin",       's',  0, G_OPTION_ARG_NONE,   &from_stdin,  N_("Read from stdin instead of a file"), NULL },
+			{ "dpi-x",       'd',  0, G_OPTION_ARG_DOUBLE, &dpi_x,       N_("Set the # of Pixels Per Inch"), N_("<float>") },
+			{ "dpi-y",       'p',  0, G_OPTION_ARG_DOUBLE, &dpi_y,       N_("Set the # of Pixels Per Inch"), N_("<float>") },
+			{ "x-zoom",      'x',  0, G_OPTION_ARG_DOUBLE, &x_zoom,      N_("Set the x zoom factor"), N_("<float>") },
+			{ "y-zoom",      'y',  0, G_OPTION_ARG_DOUBLE, &y_zoom,      N_("Set the y zoom factor"), N_("<float>") },
+			{ "width",       'w',  0, G_OPTION_ARG_INT,    &width,       N_("Set the image's width"), N_("<int>") },
+			{ "height",      'h',  0, G_OPTION_ARG_INT,    &height,      N_("Set the image's height"), N_("<int>") },
+			{ "bg-color",    'b',  0, G_OPTION_ARG_STRING, &bg_color,    N_("Set the image background color (default: transparent)"), N_("<string>") },
+			{ "base-uri",    'u',  0, G_OPTION_ARG_STRING, &base_uri,    N_("Set the base URI (default: none)"), N_("<string>") },
+			{ "keep-aspect", 'k',  0, G_OPTION_ARG_NONE,   &bKeepAspect, N_("Preserve the image's aspect ratio"), NULL },
+			{ "version",     'v',  0, G_OPTION_ARG_NONE,   &bVersion,    N_("Show version information"), NULL },
+			{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &args, NULL,  N_("[FILE...]") },
+			{ NULL }
 		};
-	int c;
-	const char * const *args;
-	gint n_args = 0;
     
 	info.pixbuf = NULL;
 	info.svg_bytes = NULL;
 	info.window = NULL;
 	info.popup_menu = NULL;
 
-	popt_context = poptGetContext ("rsvg-view", argc, (const char **)argv, options_table, 0);
-	poptSetOtherOptionHelp (popt_context, _("[OPTIONS...] [file.svg]"));
-	
-	c = poptGetNextOpt (popt_context);
-	args = poptGetArgs (popt_context);
+	g_option_context = g_option_context_new ("- SVG Viewer");
+	g_option_context_add_main_entries (g_option_context, options_table, NULL);
+	g_option_context_add_group (g_option_context, gtk_get_option_group (TRUE));
+	g_option_context_set_help_enabled (g_option_context, TRUE);
+	if(!g_option_context_parse (g_option_context, &argc, &argv, NULL)) {
+		exit(1);
+	}
+
+	g_option_context_free (g_option_context);
 	
 	if (bVersion != 0)
 		{
@@ -736,13 +739,11 @@ main (int argc, char **argv)
   
 	if ((!from_stdin) && (n_args != 1))
 		{
-			poptPrintHelp (popt_context, stderr, 0);
-			poptFreeContext (popt_context);
+			g_print (_("No files specified, and not using --stdin\n"));
 			return 1;
 		}
 	
-	/* initialize gtk+ */
-	gtk_init (&argc, &argv) ;
+	/* initialize gtk+ and rsvg */
 	rsvg_init ();
 
 	rsvg_set_default_dpi_x_y (dpi_x, dpi_y);
@@ -793,9 +794,8 @@ main (int argc, char **argv)
 				{
 					if (ferror (stdin))
 						{
-							g_critical (_("Error reading\n"));
+							g_print (_("Error reading\n"));
 							g_byte_array_free (info.svg_bytes, TRUE);
-							poptFreeContext (popt_context);
 							fclose(stdin);
 							
 							return 1;
@@ -810,15 +810,11 @@ main (int argc, char **argv)
 
 	if(!info.svg_bytes || !info.svg_bytes->len)
 		{
-			g_critical (_("Couldn't open %s\n"), args[0]);
-			poptFreeContext (popt_context);
-
+			g_print (_("Couldn't open %s\n"), args[0]);
 			return 1;
 		}
 
 	info.base_uri = base_uri;
-
-	poptFreeContext (popt_context);
 
 	info.pixbuf = rsvg_pixbuf_from_data_with_size_data (info.svg_bytes->data, info.svg_bytes->len, &size_data, base_uri, &err);
 
Index: test-performance.c
===================================================================
RCS file: /cvs/gnome/librsvg/test-performance.c,v
retrieving revision 1.4
diff -u -p -u -r1.4 test-performance.c
--- test-performance.c	25 Sep 2004 15:47:32 -0000	1.4
+++ test-performance.c	28 Mar 2006 03:16:32 -0000
@@ -28,17 +28,17 @@
 #include <glib.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <popt.h>
 
 #include "rsvg.h"
+#include "rsvg-private.h"
 
 int
-main (int argc, const char **argv)
+main (int argc, char **argv)
 {
 	int         i, count = 10;
 	GTimer     *timer;
 
-	poptContext popt_context;
+	GOptionContext *g_option_context;
 	double x_zoom = 1.0;
 	double y_zoom = 1.0;
 	double dpi = -1.0;
@@ -46,35 +46,30 @@ main (int argc, const char **argv)
 	int height = -1;
 	int bVersion = 0;
 
-	struct poptOption options_table[] = {
-		{ "dpi"   ,  'd',  POPT_ARG_DOUBLE, NULL, 0, "pixels per inch", "<float>" },
-		{ "x-zoom",  'x',  POPT_ARG_DOUBLE, NULL, 0, "x zoom factor", "<float>" },
-		{ "y-zoom",  'y',  POPT_ARG_DOUBLE, NULL, 0, "y zoom factor", "<float>" },
-		{ "width",   'w',  POPT_ARG_INT,    NULL, 0, "width", "<int>" },
-		{ "height",  'h',  POPT_ARG_INT,    NULL, 0, "height", "<int>" },
-		{ "count",   'c',  POPT_ARG_INT,    NULL, 0, "number of times to render the SVG", "<int>" },
-		{ "version", 'v',  POPT_ARG_NONE,   NULL, 0, "show version information", NULL },
-		POPT_AUTOHELP
-		POPT_TABLEEND
-	};
-	int c;
-	const char * const *args;
+	char **args;
 	gint n_args = 0;
 	GdkPixbuf *pixbuf;
 
-	options_table[0].arg = &dpi;
-	options_table[1].arg = &x_zoom;
-	options_table[2].arg = &y_zoom;
-	options_table[3].arg = &width;
-	options_table[4].arg = &height;
-	options_table[5].arg = &count;
-	options_table[6].arg = &bVersion;
+	GOptionEntry options_table[] = {
+		{ "dpi"   ,  'd',  0, G_OPTION_ARG_DOUBLE, &dpi,      "pixels per inch", "<float>" },
+		{ "x-zoom",  'x',  0, G_OPTION_ARG_DOUBLE, &x_zoom,   "x zoom factor", "<float>" },
+		{ "y-zoom",  'y',  0, G_OPTION_ARG_DOUBLE, &y_zoom,   "y zoom factor", "<float>" },
+		{ "width",   'w',  0, G_OPTION_ARG_INT,    &width,    "width", "<int>" },
+		{ "height",  'h',  0, G_OPTION_ARG_INT,    &height,   "height", "<int>" },
+		{ "count",   'c',  0, G_OPTION_ARG_INT,    &count,    "number of times to render the SVG", "<int>" },
+		{ "version", 'v',  0, G_OPTION_ARG_NONE,   &bVersion, "show version information", NULL },
+		{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &args, NULL,  N_("[FILE...]") },
+		{ NULL }
+	};
 
-	popt_context = poptGetContext ("test-performance", argc, argv, options_table, 0);
-	poptSetOtherOptionHelp(popt_context, "[OPTIONS...] file.svg");
+	g_option_context = g_option_context_new (_("- SVG Performance Test"));
+	g_option_context_add_main_entries (g_option_context, options_table, NULL);
+	g_option_context_set_help_enabled (g_option_context, TRUE);
+	if(!g_option_context_parse (g_option_context, &argc, &argv, NULL)) {
+		exit(1);
+	}
 
-	c = poptGetNextOpt (popt_context);
-	args = poptGetArgs (popt_context);
+	g_option_context_free (g_option_context);
 
 	if (bVersion != 0)
 		{
@@ -88,8 +83,7 @@ main (int argc, const char **argv)
 
 	if (n_args != 1)
 		{
-			poptPrintHelp (popt_context, stderr, 0);
-			poptFreeContext (popt_context);
+			g_print (_("Must specify a SVG file\n"));
 			return 1;
 		}
 
