/***************************************************************************
                           qtsvg.cpp
                           -------------------
    copyright            : (C) 2004 by Jos van den Oever
    email                : jos@vandenoever.info
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
#include <q3picture.h>
#include <qapplication.h>
#include <iostream>
using std::cerr;
using std::endl;

/* this simple program reads svg files with the qt library and saves them
   again. The idea was that this would remove unrecognized tags and yield
   svg tailored for use with Qt. Unfortunately, the images are distorted by
   using this method.
   In short, Qt's SVG support sucks!
*/

int
main(int argc, char **argv) {
	QApplication a(argc, argv);
	bool ok = true;
	for (short i=1; i<argc; ++i) {
		Q3Picture p;
		if (p.load(argv[i], "svg")) {
			if (!p.save(argv[i], "svg")) {
				cerr << "could not write to file '" << argv[i]
					<< "'" << endl;
				ok = false;
			}
		} else {
			cerr << "could not read file '" << argv[i] << "'"
				<< endl;
			ok = false;
		}
	}
	return (ok) ?0 :1;
}
		
