Code

cdr import via uniconvertor
authorbuliabyak <buliabyak@users.sourceforge.net>
Sat, 29 Sep 2007 01:47:14 +0000 (01:47 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Sat, 29 Sep 2007 01:47:14 +0000 (01:47 +0000)
share/extensions/Makefile.am
share/extensions/cdr2svg.sh [new file with mode: 0755]
share/extensions/cdr_input.inx [new file with mode: 0644]

index fedc580e2b15d9a2c108e01536ee8354ba2a6659..0dfcd1d1a51f92d4ae1f6ba68628f28e45bd1113 100644 (file)
@@ -14,6 +14,7 @@ moduledir = $(datadir)/inkscape/extensions
 extensions = \
        addnodes.py \
        bezmisc.py \
+       cdr2svg.sh\
        chardataeffect.py\
        color_brighter.py\
        color_custom.py\
@@ -113,6 +114,7 @@ modules = \
        ai_input.inx \
        ai_output.inx \
        aisvg.inx \
+       cdr_input.inx\
        color_brighter.inx\
        color_custom.inx \
        color_darker.inx\
diff --git a/share/extensions/cdr2svg.sh b/share/extensions/cdr2svg.sh
new file mode 100755 (executable)
index 0000000..73059a6
--- /dev/null
@@ -0,0 +1,11 @@
+#! /bin/sh
+rc=0
+TMPDIR="${TMPDIR-/tmp}"
+TEMPFILENAME=`mktemp 2>/dev/null || echo "$TMPDIR/$$"`
+TEMPFILENAME=${TEMPFILENAME}.svg
+
+uniconv "$1" "${TEMPFILENAME}" > /dev/null 2>&1 || rc=1
+
+cat < "${TEMPFILENAME}" || rc=1
+rm -f "${TEMPFILENAME}"
+exit $rc
diff --git a/share/extensions/cdr_input.inx b/share/extensions/cdr_input.inx
new file mode 100644 (file)
index 0000000..640f482
--- /dev/null
@@ -0,0 +1,16 @@
+<inkscape-extension>
+    <_name>Corel Draw Input</_name>
+    <id>org.inkscape.input.cdr</id>
+    <dependency type="executable" location="path">uniconv</dependency>
+    <dependency type="executable" location="extensions">cdr2svg.sh</dependency>
+    <input>
+        <extension>.cdr</extension>
+        <mimetype>image/x-xcdr</mimetype>
+        <_filetypename>Corel Draw document (*.cdr)</_filetypename>
+        <_filetypetooltip>Open files saved from Corel Draw</_filetypetooltip>
+        <output_extension>org.inkscape.output.cdr</output_extension>
+    </input>
+    <script>
+        <command reldir="extensions">cdr2svg.sh</command>
+    </script>
+</inkscape-extension>