Inkscape
Vector Graphics Editor
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages Concepts
cdr-input.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: GPL-2.0-or-later
11/* Authors:
12 * Fridrich Strba (fridrich.strba@bluewin.ch)
13 *
14 * Copyright (C) 2012 Authors
15 *
16 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
17 */
18
19#include "cdr-input.h"
20
21#include <libcdr/libcdr.h>
22
23#include "extension/input.h"
25#include "extension/system.h"
26
28
29std::unique_ptr<SPDocument> CdrInput::open(Inkscape::Extension::Input *, char const *uri, bool)
30{
31 return rvng_open(uri, libcdr::CDRDocument::isSupported, libcdr::CDRDocument::parse);
32}
33
34#include "clear-n_.h"
35
37{
38 // clang-format off
39 /* CDR */
41 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
42 "<name>" N_("Corel DRAW Input") "</name>\n"
43 "<id>org.inkscape.input.cdr</id>\n"
44 "<input>\n"
45 "<extension>.cdr</extension>\n"
46 "<mimetype>image/x-xcdr</mimetype>\n"
47 "<filetypename>" N_("Corel DRAW 7-X4 files (*.cdr)") "</filetypename>\n"
48 "<filetypetooltip>" N_("Open files saved in Corel DRAW 7-X4") "</filetypetooltip>\n"
49 "</input>\n"
50 "</inkscape-extension>", std::make_unique<CdrInput>());
51 /* CDT */
53 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
54 "<name>" N_("Corel DRAW templates input") "</name>\n"
55 "<id>org.inkscape.input.cdt</id>\n"
56 "<input>\n"
57 "<extension>.cdt</extension>\n"
58 "<mimetype>application/x-xcdt</mimetype>\n"
59 "<filetypename>" N_("Corel DRAW 7-13 template files (*.cdt)") "</filetypename>\n"
60 "<filetypetooltip>" N_("Open files saved in Corel DRAW 7-13") "</filetypetooltip>\n"
61 "</input>\n"
62 "</inkscape-extension>", std::make_unique<CdrInput>());
63 /* CCX */
65 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
66 "<name>" N_("Corel DRAW Compressed Exchange files input") "</name>\n"
67 "<id>org.inkscape.input.ccx</id>\n"
68 "<input>\n"
69 "<extension>.ccx</extension>\n"
70 "<mimetype>application/x-xccx</mimetype>\n"
71 "<filetypename>" N_("Corel DRAW Compressed Exchange files (*.ccx)") "</filetypename>\n"
72 "<filetypetooltip>" N_("Open compressed exchange files saved in Corel DRAW") "</filetypetooltip>\n"
73 "</input>\n"
74 "</inkscape-extension>", std::make_unique<CdrInput>());
75 /* CMX */
77 "<inkscape-extension xmlns=\"" INKSCAPE_EXTENSION_URI "\">\n"
78 "<name>" N_("Corel DRAW Presentation Exchange files input") "</name>\n"
79 "<id>org.inkscape.input.cmx</id>\n"
80 "<input>\n"
81 "<extension>.cmx</extension>\n"
82 "<mimetype>application/x-xcmx</mimetype>\n"
83 "<filetypename>" N_("Corel DRAW Presentation Exchange files (*.cmx)") "</filetypename>\n"
84 "<filetypetooltip>" N_("Open presentation exchange files saved in Corel DRAW") "</filetypetooltip>\n"
85 "</input>\n"
86 "</inkscape-extension>", std::make_unique<CdrInput>());
87 // clang-format on
88}
89
90} // namespace Inkscape::Extension::Internal
91
92/*
93 Local Variables:
94 mode:c++
95 c-file-style:"stroustrup"
96 c-file-offsets:((innamespace . 0)(inline-open . 0))
97 indent-tabs-mode:nil
98 fill-column:99
99 End:
100*/
101// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :
This code abstracts the libwpg interfaces into the Inkscape input extension interface.
std::unique_ptr< SPDocument > open(Inkscape::Extension::Input *mod, char const *uri, bool is_importing) override
Open a file.
Definition cdr-input.cpp:29
A way to clear the N_ macro, which is defined as an inline function.
std::unique_ptr< SPDocument > rvng_open(char const *uri, bool(*is_supported)(RVNGInputStream *), bool(*parse)(RVNGInputStream *, RVNGDrawingInterface *))
void build_from_mem(gchar const *buffer, std::unique_ptr< Implementation::Implementation > in_imp)
Create a module from a buffer holding an XML description.
Definition system.cpp:471
Common import dialog for .cdr and .vss files.