From 35a96bde514a8897f6f0fcc41c5833bf63df2e2a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:29:01 +0200 Subject: Adding upstream version 1.0.2. Signed-off-by: Daniel Baumann --- src/extension/internal/svgz.cpp | 99 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 src/extension/internal/svgz.cpp (limited to 'src/extension/internal/svgz.cpp') diff --git a/src/extension/internal/svgz.cpp b/src/extension/internal/svgz.cpp new file mode 100644 index 0000000..ea00f94 --- /dev/null +++ b/src/extension/internal/svgz.cpp @@ -0,0 +1,99 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * Code to handle compressed SVG loading and saving. Almost identical to svg + * routines, but separated for simpler extension maintenance. + * + * Authors: + * Lauris Kaplinski + * Ted Gould + * Jon A. Cruz + * + * Copyright (C) 2002-2005 Authors + * + * Released under GNU GPL v2+, read the file 'COPYING' for more information. + */ + +#include "svgz.h" +#include "extension/extension.h" +#include "extension/system.h" + +namespace Inkscape { +namespace Extension { +namespace Internal { + +#include "clear-n_.h" + +/** + \return None + \brief What would an SVG editor be without loading/saving SVG + 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 +Svgz::init() +{ + /* SVGZ in */ + Inkscape::Extension::build_from_mem( + "\n" + "" N_("SVGZ Input") "\n" + "" SP_MODULE_KEY_INPUT_SVGZ "\n" + "" SP_MODULE_KEY_INPUT_SVG "\n" + SVG_COMMON_INPUT_PARAMS + "\n" + ".svgz\n" + "image/svg+xml-compressed\n" + "" N_("Compressed Inkscape SVG (*.svgz)") "\n" + "" N_("SVG file format compressed with GZip") "\n" + "" SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE "\n" + "\n" + "", new Svgz()); + + /* SVGZ out Inkscape */ + Inkscape::Extension::build_from_mem( + "\n" + "" N_("SVGZ Output") "\n" + "" SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE "\n" + "\n" + ".svgz\n" + "image/x-inkscape-svg-compressed\n" + "" N_("Compressed Inkscape SVG (*.svgz)") "\n" + "" N_("Inkscape's native file format compressed with GZip") "\n" + "false\n" + "\n" + "", new Svgz()); + + /* SVGZ out */ + Inkscape::Extension::build_from_mem( + "\n" + "" N_("SVGZ Output") "\n" + "" SP_MODULE_KEY_OUTPUT_SVGZ "\n" + "\n" + ".svgz\n" + "image/svg+xml-compressed\n" + "" N_("Compressed plain SVG (*.svgz)") "\n" + "" N_("Scalable Vector Graphics format compressed with GZip") "\n" + "\n" + "\n", new Svgz()); + + 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 : -- cgit v1.2.3