Code

Filters. New custom predefined filters (all ABCs, Neon draw, Color shilf, Silhouette...
[inkscape.git] / src / extension / internal / svgz.cpp
1 /*
2  * Code to handle compressed SVG loading and saving. Almost identical to svg
3  * routines, but separated for simpler extension maintenance.
4  *
5  * Authors:
6  *   Lauris Kaplinski <lauris@kaplinski.com>
7  *   Ted Gould <ted@gould.cx>
8  *   Jon A. Cruz <jon@joncruz.org>
9  *
10  * Copyright (C) 2002-2005 Authors
11  *
12  * Released under GNU GPL, read the file 'COPYING' for more information
13  */
15 #ifdef HAVE_CONFIG_H
16 # include <config.h>
17 #endif
18 #include "svgz.h"
19 #include "extension/system.h"
21 namespace Inkscape {
22 namespace Extension {
23 namespace Internal {
25 #include "clear-n_.h"
27 /**
28     \return   None
29     \brief    What would an SVG editor be without loading/saving SVG
30               files.  This function sets that up.
32     For each module there is a call to Inkscape::Extension::build_from_mem
33     with a rather large XML file passed in.  This is a constant string
34     that describes the module.  At the end of this call a module is
35     returned that is basically filled out.  The one thing that it doesn't
36     have is the key function for the operation.  And that is linked at
37     the end of each call.
38 */
39 void
40 Svgz::init(void)
41 {
42     Inkscape::Extension::Extension * ext;
44     /* SVGZ in */
45     ext = Inkscape::Extension::build_from_mem(
46         "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
47             "<name>" N_("SVGZ Input") "</name>\n"
48             "<id>" SP_MODULE_KEY_INPUT_SVGZ "</id>\n"
49             "<dependency type=\"extension\">" SP_MODULE_KEY_INPUT_SVG "</dependency>\n"
50             "<input>\n"
51                 "<extension>.svgz</extension>\n"
52                 "<mimetype>image/svg+xml-compressed</mimetype>\n"
53                 "<filetypename>" N_("Compressed Inkscape SVG (*.svgz)") "</filetypename>\n"
54                 "<filetypetooltip>" N_("SVG file format compressed with GZip") "</filetypetooltip>\n"
55                 "<output_extension>" SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE "</output_extension>\n"
56             "</input>\n"
57         "</inkscape-extension>", new Svgz());
59         /* SVGZ out Inkscape */
60     ext = Inkscape::Extension::build_from_mem(
61         "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
62             "<name>" N_("SVGZ Output") "</name>\n"
63             "<id>" SP_MODULE_KEY_OUTPUT_SVGZ_INKSCAPE "</id>\n"
64             "<output>\n"
65                 "<extension>.svgz</extension>\n"
66                 "<mimetype>image/x-inkscape-svg-compressed</mimetype>\n"
67                 "<filetypename>" N_("Compressed Inkscape SVG (*.svgz)") "</filetypename>\n"
68                 "<filetypetooltip>" N_("Inkscape's native file format compressed with GZip") "</filetypetooltip>\n"
69                 "<dataloss>false</dataloss>\n"
70             "</output>\n"
71         "</inkscape-extension>", new Svgz());
73         /* SVGZ out */
74     ext = Inkscape::Extension::build_from_mem(
75         "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
76             "<name>" N_("SVGZ Output") "</name>\n"
77             "<id>" SP_MODULE_KEY_OUTPUT_SVGZ "</id>\n"
78             "<output>\n"
79                 "<extension>.svgz</extension>\n"
80                 "<mimetype>image/svg+xml-compressed</mimetype>\n"
81                 "<filetypename>" N_("Compressed plain SVG (*.svgz)") "</filetypename>\n"
82                 "<filetypetooltip>" N_("Scalable Vector Graphics format compressed with GZip") "</filetypetooltip>\n"
83             "</output>\n"
84         "</inkscape-extension>\n", new Svgz());
86     return;
87 }
90 } } }  // namespace inkscape, module, implementation
92 /*
93   Local Variables:
94   mode:c++
95   c-file-style:"stroustrup"
96   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
97   indent-tabs-mode:nil
98   fill-column:99
99   End:
100 */
101 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :