/*
* This is the code that moves all of the SVG loading and saving into
* the module format. Really Inkscape is built to handle these formats
* internally, so this is just calling those internal functions.
*
* Authors:
* Lauris Kaplinski <lauris@kaplinski.com>
* Ted Gould <ted@gould.cx>
* Jon A. Cruz <jon@joncruz.org>
* Abhishek Sharma
*
* Copyright (C) 2002-2003 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "sp-object.h"
#include "svg.h"
#include "file.h"
#include <vector>
#include "xml/attribute-record.h"
#include "xml/simple-document.h"
#include "sp-root.h"
#include "document.h"
#ifdef WITH_GNOME_VFS
# include <libgnomevfs/gnome-vfs.h>
#endif
namespace Inkscape {
namespace Extension {
namespace Internal {
#include "clear-n_.h"
/*
* Removes all sodipodi and inkscape elements and attributes from an xml tree.
* used to make plain svg output.
*/
{
if (repr) {
}
}
// Can't change the set we're interating over while we are iterating.
for ( std::vector<gchar const*>::iterator it = attrsRemoved.begin(); it != attrsRemoved.end(); ++it ) {
}
}
} else {
}
}
for ( std::vector<Inkscape::XML::Node *>::iterator it = nodesRemoved.begin(); it != nodesRemoved.end(); ++it ) {
}
}
}
/**
\return None
files. This function sets that up.
For each module there is a call to Inkscape::Extension::build_from_mem
with a rather large XML file passed in. This is a constant string
that describes the module. At the end of this call a module is
returned that is basically filled out. The one thing that it doesn't
have is the key function for the operation. And that is linked at
the end of each call.
*/
void
{
/* SVG in */
"<input>\n"
"<extension>.svg</extension>\n"
"</input>\n"
"</inkscape-extension>", new Svg());
/* SVG out Inkscape */
"<output>\n"
"<extension>.svg</extension>\n"
"<mimetype>image/x-inkscape-svg</mimetype>\n"
"<dataloss>false</dataloss>\n"
"</output>\n"
"</inkscape-extension>", new Svg());
/* SVG out */
"<output>\n"
"<extension>.svg</extension>\n"
"<filetypetooltip>" N_("Scalable Vector Graphics format as defined by the W3C") "</filetypetooltip>\n"
"</output>\n"
"</inkscape-extension>", new Svg());
#ifdef WITH_GNOME_VFS
#endif
return;
}
#ifdef WITH_GNOME_VFS
static gchar *
{
g_warning( "Error converting filename to locale encoding.");
}
if (result != GNOME_VFS_OK) {
}
while (result == GNOME_VFS_OK) {
}
}
#endif
/**
\return A new document just for you!
\brief This function takes in a filename of a SVG document and
turns it into a SPDocument.
\param mod Module to use
\param uri The path to the file (UTF-8)
This function is really simple, it just calls sp_document_new...
*/
{
#ifdef WITH_GNOME_VFS
// Use built-in loader instead of VFS for this
}
return NULL;
}
return doc;
#else
#endif
}
/**
\return None
\brief This is the function that does all of the SVG saves in
Inkscape. It detects whether it should do a Inkscape
namespace save internally.
\param mod Extension to use.
\param doc Document to save.
\param uri The filename to save the file to.
This function first checks its parameters, and makes sure that
we're getting good data. It also checks the module ID of the
incoming module to figure out whether this save should include
the Inkscape namespace stuff or not. The result of that comparison
is stored in the exportExtensions variable.
If there is not to be Inkscape name spaces a new document is created
without. (I think, I'm not sure on this code)
All of the internally referenced imageins are also set to relative
paths in the file. And the file is saved.
This really needs to be fleshed out more, but I don't quite understand
all of this code. I just stole it.
*/
void
{
if (!exportExtensions) {
// We make a duplicate document so we don't prune the in-use document
// and loose data. Perhaps the user intends to save as inkscape-svg next.
// Comments and PI nodes are not included in this duplication
// TODO: Move this code into xml/document.h and duplicate rdoc instead of root.
// Get a new xml repr for the svg root node
// Add the duplicated svg node as the document's rdoc
}
}
if (!exportExtensions) {
}
return;
}
} } } /* namespace inkscape, module, implementation */
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :