Hi inkscape-devels,
I've been lurking for a while, but didn't introduce myself yet.
I'm Fernando Lucchesi, and I am at my third year studying Computer Engineering at Unicamp, Brazil. I am a member of the CS/CE Students' Union of Unicamp(CACo), where my role is roughly to do "graphical stuff", almost always using inkscape. That includes posters[1], t-shirts, etc.
Since I rely on Inkscape so much, it was about time I got to contribute with some code. For that, I am willing to participate on this year's GSoC.
(I realize that only using Inkscape doesn't mean I can hack it, but it means I want to see it get even better)
Last year, I was playing with SVG/JSONP trying to make a widget to show the cafeteria menu[2]. While doing that, I realized that the javascript support could use some love. Searching a little, I've found this blueprint: https://blueprints.launchpad.net/inkscape/+spec/scripting-ui
So I would like to work at something along those lines.
I've chatted a little at the Inkscape Brazil mailing list, and already got some pointers. These are the ideas so far:
-Enhance "Object properties > interactivity" by replacing the text boxes with combo boxes containing every javascript function/method available. To do that, it would be necessary to parse both external and embedded scripts.
-Open embedded scripts on an external editor (perhaps blocking the svg edition while doing that). It would be a way to follow the unix philosophy of using the best tool for every job (inkscape - graphics; vim/emacs/some ide - code).
That script list would be located at "document properties > scripting", under the external scripts.
As Aurium pointed out, the name of the tmp file would have to be meaningful not to scare the user, so perhaps using the script id could be an option. Also, the way to create new scripts would be at the same interface, you'd just need to define the script name/id at its creation.
-At the same place there could be a list of svg elements using script events.
-We could encourage people to use .js files for scripts, since it is good practice to separate the structure from the action (like with html/js).
The problem, however, is that by doing that there would be 2+ files instead of a single svg, making the distribution more difficult.
As a way to solve that, inkscape could have an option to automatically embed external scripts, so there would be only one file. There should be some config regarding scripts on another server (so you don't save a static version of JSONP data, for example).
Then, there would be the opposite direction, taking the embedded scripts out to the corresponding .js files. This wouldn't be restricted to scripts previously inserted by inkscape, but all embedded scripts.
The name of each file to be created would be asked, except for those that came from a .js in the first place, since its name would be saved on the tag. Another option is to use the id defined by the other interface instead of asking.
So, how could this fit into a GSoC project?
(I'm yet to send the 2 patches, but I've already pulled the code from bazaar, successfully compiled it and am having a look at the bugs at launchpad).
[1]: http://www.students.ic.unicamp.br/~ra091187/etc/reuniao.png [2]: http://www.students.ic.unicamp.br/~ra091187/teste/bandeco.svg
participants (1)
-
Fernando Lucchesi