Inkscape
Vector Graphics Editor
|
OpenDocument <drawing> input and output. More...
#include <odf.h>
Public Member Functions | |
bool | check (Inkscape::Extension::Extension *module) override |
Make sure that we are in the database. | |
void | save (Inkscape::Extension::Output *mod, SPDocument *doc, char const *filename) override |
Descends into the SVG tree, mapping things to ODF when appropriate. | |
![]() | |
Implementation ()=default | |
virtual | ~Implementation ()=default |
virtual bool | load (Inkscape::Extension::Extension *) |
virtual void | unload (Inkscape::Extension::Extension *) |
virtual ImplementationDocumentCache * | newDocCache (Inkscape::Extension::Extension *, SPDesktop *) |
Create a new document cache object. | |
virtual bool | cancelProcessing () |
virtual void | commitDocument () |
virtual std::unique_ptr< SPDocument > | new_from_template (Inkscape::Extension::Template *) |
virtual void | get_template_presets (const Template *tmod, TemplatePresets &presets) const |
virtual void | resize_to_template (Inkscape::Extension::Template *tmod, SPDocument *doc, SPPage *page) |
virtual bool | match_template_size (Inkscape::Extension::Template *tmod, double width, double height) |
virtual std::unique_ptr< SPDocument > | open (Inkscape::Extension::Input *module, char const *filename, bool is_importing) |
Open a file. | |
virtual void | save (Inkscape::Extension::Output *, SPDocument *, gchar const *) |
Find out information about the file. | |
virtual void | export_raster (Inkscape::Extension::Output *module, const SPDocument *doc, std::string const &png_file, gchar const *filename) |
Convert from PNG to raster format. | |
virtual Gtk::Widget * | prefs_effect (Inkscape::Extension::Effect *module, SPDesktop *desktop, sigc::signal< void()> *changeSignal, ImplementationDocumentCache *docCache) |
Find out information about the file. | |
virtual void | effect (Inkscape::Extension::Effect *, ExecutionEnv *, SPDesktop *, ImplementationDocumentCache *) |
virtual void | effect (Inkscape::Extension::Effect *, ExecutionEnv *, SPDocument *document) |
virtual bool | apply_filter (Inkscape::Extension::Effect *module, SPItem *item) |
virtual unsigned | setup (Inkscape::Extension::Print *) |
virtual unsigned | set_preview (Inkscape::Extension::Print *) |
virtual unsigned | begin (Inkscape::Extension::Print *, SPDocument *) |
virtual unsigned | finish (Inkscape::Extension::Print *) |
virtual bool | textToPath (Inkscape::Extension::Print *) |
Tell the printing engine whether text should be text or path. | |
virtual bool | fontEmbedded (Inkscape::Extension::Print *) |
Get "fontEmbedded" param, i.e. | |
virtual unsigned | bind (Inkscape::Extension::Print *, Geom::Affine const &, float) |
virtual unsigned | release (Inkscape::Extension::Print *) |
virtual unsigned | fill (Inkscape::Extension::Print *, Geom::PathVector const &, Geom::Affine const &, SPStyle const *, Geom::OptRect const &, Geom::OptRect const &, Geom::OptRect const &) |
virtual unsigned | stroke (Inkscape::Extension::Print *, Geom::PathVector const &, Geom::Affine const &, SPStyle const *, Geom::OptRect const &, Geom::OptRect const &, Geom::OptRect const &) |
virtual unsigned | image (Inkscape::Extension::Print *, unsigned char *, unsigned int, unsigned int, unsigned int, Geom::Affine const &, SPStyle const *) |
virtual unsigned | text (Inkscape::Extension::Print *, char const *, Geom::Point const &, SPStyle const *) |
virtual void | processPath (Inkscape::XML::Node *) |
virtual void | setDetachBase (bool detach) |
If detach = true, when saving to a file, don't store URIs relative to the filename. | |
Static Public Member Functions | |
static void | init () |
This is the definition of PovRay output. | |
Private Member Functions | |
void | reset () |
Resets class to its pristine condition, ready to use again. | |
void | preprocess (ZipFile &zf, SPDocument *doc, Inkscape::XML::Node *node) |
FIRST PASS. | |
bool | writeManifest (ZipFile &zf) |
Writes the manifest. | |
bool | writeMeta (ZipFile &zf) |
This writes the document meta information to meta.xml. | |
bool | writeStyle (ZipFile &zf) |
bool | processStyle (SPItem *item, const Glib::ustring &id, const Glib::ustring &gradientNameFill, const Glib::ustring &gradientNameStroke, Glib::ustring &output) |
bool | processGradient (SPItem *item, const Glib::ustring &id, Geom::Affine &tf, Glib::ustring &gradientName, Glib::ustring &output, bool checkFillGradient=true) |
bool | writeStyleHeader (Writer &outs) |
Write the header for the content.xml file. | |
bool | writeStyleFooter (Writer &outs) |
Write the footer for the style.xml file. | |
bool | writeContentHeader (Writer &outs) |
Write the header for the content.xml file. | |
bool | writeContentFooter (Writer &outs) |
Write the footer for the content.xml file. | |
bool | writeTree (Writer &couts, Writer &souts, SPDocument *doc, Inkscape::XML::Node *node) |
SECOND PASS. | |
bool | writeContent (ZipFile &zf, SPDocument *doc) |
Write the content.xml file. | |
Private Attributes | |
std::string | docBaseUri |
std::map< Glib::ustring, Glib::ustring > | metadata |
std::map< Glib::ustring, Glib::ustring > | styleLookupTable |
std::vector< StyleInfo > | styleTable |
std::map< Glib::ustring, Glib::ustring > | gradientLookupTable |
std::vector< GradientInfo > | gradientTable |
std::map< Glib::ustring, Glib::ustring > | imageTable |
OpenDocument <drawing> input and output.
This is an an entry in the extensions mechanism to begin to enable the inputting and outputting of OpenDocument Format (ODF) files from within Inkscape. Although the initial implementations will be very lossy do to the differences in the models of SVG and ODF, they will hopefully improve greatly with time.
http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html
|
overridevirtual |
Make sure that we are in the database.
Reimplemented from Inkscape::Extension::Implementation::Implementation.
|
static |
This is the definition of PovRay output.
This function just calls the extension system with the memory allocated XML that describes the data.
Definition at line 2083 of file odf.cpp.
References Inkscape::Extension::build_from_mem().
Referenced by Inkscape::Extension::init().
|
private |
FIRST PASS.
Method descends into the repr tree, converting image, style, and gradient info into forms compatible in ODF.
Definition at line 994 of file odf.cpp.
References child, docBaseUri, Inkscape::XML::Node::firstChild(), Inkscape::Extension::Internal::gatherText(), Inkscape::Extension::Internal::getAttribute(), SPDocument::getObjectByRepr(), imageTable, metadata, Inkscape::XML::Node::name(), ZipFile::newEntry(), node, preprocess(), and ZipEntry::setUncompressedData().
Referenced by preprocess(), and save().
|
private |
Definition at line 1400 of file odf.cpp.
References buf, Inkscape::Extension::Internal::GradientInfo::cx, Inkscape::Extension::Internal::GradientInfo::cy, SPItem::documentVisualBounds(), Inkscape::Extension::Internal::GradientInfo::equals(), SPStyle::fill, SPGradient::getFirstStop(), SPStop::getNextStop(), SPGradient::getVector(), gradientLookupTable, gradientTable, gs, item, Inkscape::Extension::Internal::GradientInfo::name, Inkscape::Extension::Internal::GradientInfo::stops, SPStyle::stroke, Inkscape::Extension::Internal::GradientInfo::style, SPObject::style, Inkscape::Extension::Internal::GradientInfo::x1, Inkscape::Extension::Internal::GradientInfo::x2, Inkscape::Extension::Internal::GradientInfo::y1, and Inkscape::Extension::Internal::GradientInfo::y2.
Referenced by writeTree().
|
private |
Definition at line 1274 of file odf.cpp.
References buf, Inkscape::Extension::Internal::StyleInfo::equals(), Inkscape::Extension::Internal::StyleInfo::fill, SPStyle::fill, SPStyle::fill_opacity, Inkscape::Extension::Internal::StyleInfo::fillColor, Inkscape::Extension::Internal::StyleInfo::fillOpacity, item, Inkscape::Extension::Internal::StyleInfo::name, Inkscape::Extension::Internal::StyleInfo::stroke, SPStyle::stroke, SPStyle::stroke_opacity, SPStyle::stroke_width, Inkscape::Extension::Internal::StyleInfo::strokeColor, Inkscape::Extension::Internal::StyleInfo::strokeOpacity, Inkscape::Extension::Internal::StyleInfo::strokeWidth, SPObject::style, styleLookupTable, and styleTable.
Referenced by writeTree().
|
private |
Resets class to its pristine condition, ready to use again.
Definition at line 2030 of file odf.cpp.
References gradientLookupTable, gradientTable, imageTable, metadata, styleLookupTable, and styleTable.
Referenced by save().
|
override |
Descends into the SVG tree, mapping things to ODF when appropriate.
Definition at line 2044 of file odf.cpp.
References docBaseUri, Inkscape::URI::from_dirname(), SPDocument::getDocumentBase(), SPDocument::getReprRoot(), preprocess(), reset(), Inkscape::URI::str(), writeContent(), ZipFile::writeFile(), writeManifest(), and writeMeta().
|
private |
Write the content.xml file.
Writes the namespace headers, then calls writeTree().
Definition at line 1969 of file odf.cpp.
References ZipEntry::finish(), Inkscape::IO::BufferOutputStream::getBuffer(), SPDocument::getReprRoot(), ZipFile::newEntry(), ZipEntry::setUncompressedData(), writeContentFooter(), writeContentHeader(), writeStyleFooter(), writeStyleHeader(), and writeTree().
Referenced by save().
|
private |
Write the footer for the content.xml file.
Definition at line 1951 of file odf.cpp.
References Inkscape::IO::Writer::writeString().
Referenced by writeContent().
|
private |
Write the header for the content.xml file.
Definition at line 1884 of file odf.cpp.
References Inkscape::IO::Writer::printf(), and Inkscape::IO::Writer::writeString().
Referenced by writeContent().
|
private |
Writes the manifest.
Currently it only changes according to the file names of images packed into the zip file.
Definition at line 1066 of file odf.cpp.
References Inkscape::IO::OutputStreamWriter::close(), ZipEntry::finish(), Inkscape::IO::get_file_extension(), Inkscape::IO::BufferOutputStream::getBuffer(), imageTable, ZipFile::newEntry(), Inkscape::IO::BasicWriter::printf(), ZipEntry::setUncompressedData(), and Inkscape::IO::BasicWriter::writeString().
Referenced by save().
|
private |
This writes the document meta information to meta.xml.
Definition at line 1124 of file odf.cpp.
References buf, Inkscape::IO::OutputStreamWriter::close(), ZipEntry::finish(), Inkscape::IO::BufferOutputStream::getBuffer(), metadata, name, ZipFile::newEntry(), Inkscape::IO::BasicWriter::printf(), ZipEntry::setUncompressedData(), Inkscape::version_string, Inkscape::IO::BasicWriter::writeString(), and Inkscape::IO::BasicWriter::writeUString().
Referenced by save().
|
private |
|
private |
Write the footer for the style.xml file.
TODO: add default document style here
Definition at line 1836 of file odf.cpp.
References Inkscape::IO::Writer::writeString().
Referenced by writeContent().
|
private |
Write the header for the content.xml file.
Definition at line 1773 of file odf.cpp.
References Inkscape::IO::Writer::printf(), and Inkscape::IO::Writer::writeString().
Referenced by writeContent().
|
private |
SECOND PASS.
This is the main SPObject tree output to ODF.
Definition at line 1566 of file odf.cpp.
References Inkscape::Extension::Internal::analyzeTransform(), child, Inkscape::XML::Node::firstChild(), Inkscape::Extension::Internal::formatTransform(), Inkscape::Extension::Internal::getAttribute(), SPDocument::getObjectByRepr(), Inkscape::Extension::Internal::getODFBoundingBox(), Inkscape::Extension::Internal::getODFItemTransform(), Inkscape::Extension::Internal::getODFTransform(), imageTable, item, Inkscape::XML::Node::name(), Inkscape::XML::Node::next(), node, Inkscape::IO::Writer::printf(), processGradient(), processStyle(), styleLookupTable, te_get_layout(), Inkscape::Extension::Internal::writePath(), Inkscape::IO::Writer::writeString(), writeTree(), Inkscape::IO::Writer::writeUString(), Geom::X, Geom::Point::x(), Geom::Y, and Geom::Point::y().
Referenced by writeContent(), and writeTree().
|
private |
Definition at line 267 of file odf.h.
Referenced by preprocess(), and save().
|
private |
Definition at line 286 of file odf.h.
Referenced by processGradient(), and reset().
|
private |
Definition at line 288 of file odf.h.
Referenced by processGradient(), and reset().
|
private |
Definition at line 291 of file odf.h.
Referenced by preprocess(), reset(), writeManifest(), and writeTree().
|
private |
Definition at line 272 of file odf.h.
Referenced by preprocess(), reset(), and writeMeta().
|
private |
Definition at line 281 of file odf.h.
Referenced by processStyle(), reset(), and writeTree().
|
private |
Definition at line 283 of file odf.h.
Referenced by processStyle(), and reset().