Drawing connectors in Inkscape
It’s time to start blogging about this project more actively I think. David Yip, one of the other Inkscape SoCers is putting me to shame. Haven’t seen any blogging from the other two SoC people yet though.
I feel like there has been a lot of paperwork in the last couple of weeks. Some non-US students (like myself) have started to call this Google thing the “Summer of Tax Code” because there has been so much confusion and discussion over taxation issues. It’s ironic how hard it is to give away money. Along with this mound of stuff to organise (most of it is done) I’ve just had to organise PhD progress reports and just now paperwork for conference travel (more in the next post). I think it’s taking me six forms to get to this conference, and that’s before I look at airfares, or conference registration…
Inkscape hacking is much more fun!
For SoC I am doing two things. Firstly, cleaning up and releasing as a LGPL library some code I have written to do incremental object-avoiding connector routing. The cleaning up and interface fixes (from where it was originally tied to my research code) is mostly done. I’ll probably create a Sourceforge project for the library very shortly. I’m thinking I’ll call it libavoid. The code will be added (and probably worked on) within the Inkscape codebase, since we definitely don’t want to add something so new as a dependency. It’ll also have it’s own CVS repository on Sorceforge since this was part of my proposal and it’s been written with the intention that othe software like Dia might want to make use of it.
The second part of my SoC stuff is adding connector capablities to Inkscape (and integrating with the library code). At the moment I have added a new context to Inkscape where connectors can be drawn and interacted with. I’m working on the code for creating connectors and changing their connections. My plan is to have the ability to create new basic straight connectors that follow shapes, as well as an interfact to detach/reconnect them to different objects for the time of the release when this stuff can be added to CVS. Then we can discuss some of the behaviour specifics for connectors and their GUI interface.
The code for updating connectors as a result of shapes moving is already in the codebase and was written some time ago by Peter Moulder, though there was never an interface created for working with them. There seem to be several issues (i.e., bugs) with this at present, so that wikl have to be looked at too.
I’ve found it quite time consuming working out how to do things at the canvas level within Inkscape. Its not that it’s been frustrating, it hasn’t, it just takes a while to figure things out when you’re unfamiliar with the codebase, and you’re not working on a surface feature that allows you to ignore large sections of code. Actually, once I work out the correct way to do things it often turns out that the solution is quite elegant, i.e., it’s been though that someone would later want to do this thing, or something similar is being done somewhere else in the code, so the framework is there. The new gradient tool handles code has been really useful for lifting ideas from. I get the feeling my work up until now would have been much harder without their example.