svg.cpp revision 7e3c59e50c57dd75009d244e1493d54a72c805b5
163N/A * This is the code that moves all of the SVG loading and saving into 163N/A * the module format. Really Inkscape is built to handle these formats 163N/A * internally, so this is just calling those internal functions. 163N/A * Lauris Kaplinski <lauris@kaplinski.com> 163N/A * Ted Gould <ted@gould.cx> 163N/A * Jon A. Cruz <jon@joncruz.org> 163N/A * Copyright (C) 2002-2003 Authors 163N/A * Released under GNU GPL, read the file 'COPYING' for more information 163N/A // Can't change the set we're interating over while we are iterating. 163N/A files. This function sets that up. 163N/A For each module there is a call to Inkscape::Extension::build_from_mem 163N/A with a rather large XML file passed in. This is a constant string 211N/A that describes the module. At the end of this call a module is 163N/A returned that is basically filled out. The one thing that it doesn't 163N/A have is the key function for the operation. And that is linked at 211N/A "<name>" N_(
"SVG Input")
"</name>\n" 163N/A "<extension>.svg</extension>\n" 163N/A "<filetypename>" N_(
"Scalable Vector Graphic (*.svg)")
"</filetypename>\n" 163N/A "<filetypetooltip>" N_(
"Inkscape native file format and W3C standard")
"</filetypetooltip>\n" "<name>" N_(
"SVG Output Inkscape")
"</name>\n" "<extension>.svg</extension>\n" "<filetypename>" N_(
"Inkscape SVG (*.svg)")
"</filetypename>\n" "<filetypetooltip>" N_(
"SVG format with Inkscape extensions")
"</filetypetooltip>\n" "<dataloss>false</dataloss>\n" "</inkscape-extension>",
new Svg());
"<name>" N_(
"SVG Output")
"</name>\n" "<extension>.svg</extension>\n" "<filetypename>" N_(
"Plain SVG (*.svg)")
"</filetypename>\n" "<filetypetooltip>" N_(
"Scalable Vector Graphics format as defined by the W3C")
"</filetypetooltip>\n" "</inkscape-extension>",
new Svg());
g_warning(
"Error converting filename to locale encoding.");
\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 uri The path to the file (UTF-8) This function is really simple, it just calls sp_document_new... // Use built-in loader instead of VFS for this g_warning(
"Error: Could not open file '%s' with VFS\n",
uri);
\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. } } }
/* namespace inkscape, module, implementation */ c-file-style:"stroustrup" c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :