Bulia tells me there will soon be an extensions menu. I'm interested in writing some extensions in Perl. My motivation is to scratch my own itch, but some of the stuff I write might be of interest to other users as well. So far I've just been writing Perl scripts to manipulate SVG files, and running them from the command line. Is there an API for extensions yet? The simplest thing would probably be to do it through a shell, and provide a way to hook the command-line options and arguments up to a dialog box in the GUI. There would need to be provisions for internationalization, and for error reporting (including errors resulting from not having the right Perl modules installed).
However, since Inkscape runs on Windows, running it in a shell might not work. Is the Extensions menu envisioned as a Unix-only feature? It seems like it would be quite complicated to implement such a thing on a cross-platform basis. It's easy to write the scripts to be platform-independent, but, e.g., most Windows users aren't going to have Active State Perl installed, and even if you embedded a Perl interpreter in Inkscape, that would only work for Perl, and there would still be the issue of libraries. Even if you told Windows users they were required to install Perl and a certain set of libraries, it would also be complex to try to write the glue between Inkscape and Perl in a platform-independent way. And my experience from writing a cross-platform Perl app is that it's a lot of work in terms of testing and code maintenance, much more than writing a Unix-only app.
As soon as we figure out how to add the makefiles, we will have Python and Perl interpreters embedded in Inkscape via c++. I have been working on this recently, with the goal of being able to script Inkscape itself. Thus the need to work in the same address space.
This is not the same as the extensions stuff, since it has a different purpose. But it should be useful for launching scripts without requiring a shell or pipe. We could maybe merge some of the code.
Basically, it is setup like this: Inkscape--->InkscapeScript--->{perl or python}--->InkscapeBinding--->Inkscape
Hopefully we will have this tied in with the automake tree so that we can start defining parts of InkscapeBinding, which will hopefully be a thin scriptable wrapper of all things Inkscape.
Nor it this the same as the Ecma scripting stuff (<script> nodes on the page itself), which has been stalled recently, and which I promise to make some progress on soon.
If someone who is good with the automake stuff can hook up /src/extensions/script with the rest of the automake tree, I would greatly appreciate it. Makefile.tmp shows the calls necessary to coax Perl and Python to reveal their necessary flags.
Bob
Ben Crowell wrote:
Bulia tells me there will soon be an extensions menu. I'm interested in writing some extensions in Perl. My motivation is to scratch my own itch, but some of the stuff I write might be of interest to other users as well. So far I've just been writing Perl scripts to manipulate SVG files, and running them from the command line. Is there an API for extensions yet? The simplest thing would probably be to do it through a shell, and provide a way to hook the command-line options and arguments up to a dialog box in the GUI. There would need to be provisions for internationalization, and for error reporting (including errors resulting from not having the right Perl modules installed).
However, since Inkscape runs on Windows, running it in a shell might not work. Is the Extensions menu envisioned as a Unix-only feature? It seems like it would be quite complicated to implement such a thing on a cross-platform basis. It's easy to write the scripts to be platform-independent, but, e.g., most Windows users aren't going to have Active State Perl installed, and even if you embedded a Perl interpreter in Inkscape, that would only work for Perl, and there would still be the issue of libraries. Even if you told Windows users they were required to install Perl and a certain set of libraries, it would also be complex to try to write the glue between Inkscape and Perl in a platform-independent way. And my experience from writing a cross-platform Perl app is that it's a lot of work in terms of testing and code maintenance, much more than writing a Unix-only app.
SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel
On Mon, 13 Dec 2004, Ben Crowell wrote:
Bulia tells me there will soon be an extensions menu. I'm interested in writing some extensions in Perl. My motivation is to scratch my own itch, but some of the stuff I write might be of interest to other users as well. So far I've just been writing Perl scripts to manipulate SVG files, and running them from the command line.
Cool!
Is there an API for extensions yet? The simplest thing would probably be to do it through a shell, and provide a way to hook the command-line options and arguments up to a dialog box in the GUI. There would need to be provisions for internationalization, and for error reporting (including errors resulting from not having the right Perl modules installed).
I put together a really crude proposal for an API (it's written up somewhere if you're curious), but it's still highly preliminary right now. Bob's work on embedding Perl/Python interpreters is probably closest to fruition. However there is already an existing mechanism for simple STDIN/STDOUT type scripts you could look at taking advantage of right now. I don't think it's very well documented but perhaps looking at the other extensions can give enough clues. If not just ask questions. :-)
However, since Inkscape runs on Windows, running it in a shell might not work.
Possibly, but I think it should be solvable.
Is the Extensions menu envisioned as a Unix-only feature?
No
It seems like it would be quite complicated to implement such a thing on a cross-platform basis. It's easy to write
Cross-platform is always complicated. We do it anyway though. :-)
the scripts to be platform-independent, but, e.g., most Windows users aren't going to have Active State Perl installed, and even if you embedded a Perl interpreter in Inkscape, that would only work for Perl, and there would still be the issue of libraries. Even if you told Windows users they were required to install Perl and a certain set of libraries, it would also be complex to try to write the glue between Inkscape and Perl in a platform-independent way. And my experience from writing a cross-platform Perl app is that it's a lot of work in terms of testing and code maintenance, much more than writing a Unix-only app.
Yup, all excellent and very true points. We don't have very good dependency tracking for perl code, especially on Windows, and you're right that the platform issues in the perl code itself can be a hinderance. But we try to do it anyway, and those users that put in the effort to get things working on their system can benefit from the tools. If you run into platform-dependencies in the Perl code, send a bug report or patch.
Bryce
participants (3)
-
Ben Crowell
-
Bob Jamison
-
Bryce Harrington