/* gcc -I/home/mofie/dev/imendio_projects/librsvg_trunk/include/librsvg-2 -Wall -g librsvg_test.c -o librsvg_test `pkg-config --cflags gtk+-2.0` `pkg-config --libs gtk+-2.0 librsvg-2.0` */

#include <librsvg/rsvg.h>

int main( int   argc,
          char *argv[] )
{
	RsvgHandle *rsvg;
	RsvgDimensionData data;
	
	char *id = "svg";
	char *file = "librsvg.svg";

	if (argc > 1)
		id = argv[1];
	if (argc > 2)
		file = argv[2];
	
	if (argc != 1 && argc != 2)
		printf ("Usage: librsvg_test <id> <file>\n");


	printf ("Parameter(%d): %s - %s\n", argc, id, file);

	// runs
	printf("YEAH\n");

    	rsvg_init ();
    
	rsvg = rsvg_handle_new_from_file (file, NULL);

	if (!rsvg_handle_get_dimensions_sub (rsvg, &data, id))
		printf ("FAILED\n");

	printf ("Size of rect: %d %d\n", data.width, data.height);

	rsvg_handle_get_dimensions (rsvg, &data);
	printf ("Size of rect: %d %d\n", data.width, data.height);

	g_object_unref (rsvg);

    	return 0;
}
