On Dec 31, 2009, at 12:25 AM, Donn wrote:
> I *wish* Inkscape could allow Python to hook-into the UI so that we could
> write our own tools (like those along the left) and control things like node
> handles and events and keyboard shortcuts etc.
> AFAIK the only interface between Python and Inkscape is vis 'extensions' (or
> whatever they call them) where you get to open a dialogue (you can design) and
> act on elements (or make new ones). But it's a kind of one-to-one operation,
> not at all the same as a tool or widget or interactive dialogue (like
> fill/stroke) like a timeline widget would be.
FYI a long term desire has been to give extensions a live connection to the document being edited. For the technologies involved the base approach would be to expose a live DOM interface (including DOM events) that the language of the plugin/extension could poke at directly. We've gotten much internal work done to allow for that, and seem to be on track to address at least the basics sometime this year.
Since we're looking at that for the document, exposing a live DOM connection for the UI itself appears to be a simple way to give extension authors a consistent API to work with both the document *and* the main application GUI. It also can give an extension full GUI widgets without that extension needing to support any GUI code directly itself.
I've discussed this with several others in the SVG community, including people in the W3C SVG working group, and they've mentioned that not only does it seem like an approach that will be functional, but also as a very appropriate solution for SVG.
Oh, and to get an idea of the Inkscape-hosted UI widgets, just look at the existing parameters support via .inx files that Inkscape gives plugins. Simply have a declarative UI description of the parameters your extension needs and then Inkscape does the rest. That will most likely be hooked in and expanded.