
On Wed, 2004-08-11 at 00:53, Anatoly Podlesnuk wrote:
Can you explain how to install external extension in inkscape?
I have binary (for example "spalah"). It can receive SVG file through STDIN or file (for example spalah < /path/file.svg spalah /path/file.svg ) and print it to STDOUT
Cool, this is exactly what you need.
The questions.
- How can it receive filename (file.swf) from ExportDialog?
It will receive it on the command line when it is called. It will be from the save dialog though, the export dialog hasn't been tied into the extensions stuff yet.
- Binary must save file.swf or print it to STDOUT?
STDOUT please.
- Where to place spalah.inkmod and spalah? Can I place it to $HOME/.inkscape?
Unfortunately not, it has to be in /usr/share/inkscape/extensions - this may vary depending on your installation. If there aren't a bunch of other .inkmod files there, you're in the wrong place :)
<inkscape-extension> <name>Macromedia Flash Export</name> <id>org.inkscape.input.sk</id> <input> <extension>.swf</extension> <mimetype>application/x-shockwave-flash</mimetype> <filetypename>Macromedia Flash (*.swf)</filetypename> <filetypetooltip>Export to Macromedia Flash</filetypetooltip> </input> <script> <command reldir="extensions">spalah</command> <check reldir="extensions">spalah</check> </script> </inkscape-extension>
It looks like you've got the basics, but from what you're describing you'll want to be an 'output' extension instead of an 'input' one like you have there now. Just change the '<input></input>' tags to '<output></output>'. The data in the middle is the same for both of those.
Also, the extension will come up as disabled if it can't find spalah in this case. It will be looking for it with the <check> that is in there. You could probably leave that out for testing, that way could put a full path in the 'command' tag (i.e. <command>/home/ted/devel/spalah/test32/spalah</command>)
- "<id>org.inkscape.input.sk</id>" what I have to write here?
This is a unique identifier. Really, you could put anything that you want in here as long as it is unique. What we've done is used the Java style naming just to get a reasonable chance at uniqueness. This is the domain of who is publishing the extension backwards, and then some ordering that they like. The ones that we're shipping with Inkscape we've made them all org.inkscape.<type of extension>.<short description>.
I hope that helps, and I'm excited about being able to make flash files! If you have more questions, feel free to ask.
--Ted