Code

add xfig import from patch 1436952
authorbuliabyak <buliabyak@users.sourceforge.net>
Thu, 23 Feb 2006 21:07:44 +0000 (21:07 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Thu, 23 Feb 2006 21:07:44 +0000 (21:07 +0000)
share/extensions/Makefile.am
share/extensions/fig2svg.sh [new file with mode: 0755]
share/extensions/fig_input.inx [new file with mode: 0644]

index 67d86bca8b640bcce0153b5209cd8d55c6363ac5..475a415990477960efe4868360559644a47afe43 100644 (file)
@@ -45,7 +45,9 @@ extensions = \
        embedimage.py \
        extractimage.py \
        svg_and_media_zip_output.py \
-       dxf_outlines.py
+       dxf_outlines.py \
+       fig2svg.sh \
+       fig_input.inx
 
 otherstuff =
 
diff --git a/share/extensions/fig2svg.sh b/share/extensions/fig2svg.sh
new file mode 100755 (executable)
index 0000000..81c6bc8
--- /dev/null
@@ -0,0 +1,10 @@
+#! /bin/sh
+rc=0
+TMPDIR="${TMPDIR-/tmp}"
+TEMPFILENAME=`mktemp 2>/dev/null || echo "$TMPDIR/tmp-fig$$.svg"`
+
+fig2dev -L svg "$1" "${TEMPFILENAME}" > /dev/null 2>&1 || rc=1
+
+cat < "${TEMPFILENAME}" || rc=1
+rm -f "${TEMPFILENAME}"
+exit $rc
diff --git a/share/extensions/fig_input.inx b/share/extensions/fig_input.inx
new file mode 100644 (file)
index 0000000..afd76ee
--- /dev/null
@@ -0,0 +1,16 @@
+<inkscape-extension>
+    <_name>XFIG Input</_name>
+    <id>org.inkscape.input.fig</id>
+    <dependency type="executable" location="path">fig2dev</dependency>
+    <dependency type="executable" location="extensions">fig2svg.sh</dependency>
+    <input>
+        <extension>.fig</extension>
+        <mimetype>image/x-xfig</mimetype>
+        <_filetypename>XFIG Graphic File (*.fig)</_filetypename>
+        <_filetypetooltip>Open files saved with XFIG</_filetypetooltip>
+        <output_extension>org.inkscape.output.fig</output_extension>
+    </input>
+    <script>
+        <command reldir="extensions">fig2svg.sh</command>
+    </script>
+</inkscape-extension>