
I've been working on XPath and a C++ DOM wrapper for Repr for a few weeks now. I should start to have stuff checked in very soon. I have been using the w3c specs, so that any scripts will be "proper". I have the dom.h interface , a default DOM impl, and I am starting on a Repr impl. I already have an XPath parser working. I need to get the DOM tree in place, to test it.
I think xpath will be pretty cool, if it turns out to work correctly. It will make addressing items in the repr tree from a script very easy, such as xpath.setAttribute("/mydrawing/ball@...510...", "red");
My desire for DOM/xpath comes from the "other side" of the SVG document. I want to bind the Javascript engine to the document, so that <script> nodes in the document can be executable, making the drawing dynamic. The DOM&Xpath stuff should be generic enough, so that scripts from either the Inkscape side, or the document side, should be able to manipulate the document with equal ease.
A couple of the guys have been wanting to use Swig for a generic scripting interface to Inkscape, so that Python, Perl, {your script here} can be easily added to Inkscape. And fortunately, Python is the language bound by default.
So you might try working on that side of the scripting task, and we can build the bridge toward each other and meet in the middle, and get this thing done a lot sooner.
( Heh. "repr wrapper" ) ;)
Bob
David Turner wrote:
I want to add Python support to Inkscape.
From what I read, this should be a script extension. However, extensions don't seem to show up for me. Are they disabled? Do I need to do something special? Am I looking in the wrong place?
My theory was to implement a svgdom interface (+ maybesome extensions to support inkscape's stars and the like) to the sprepr, so python extensions can be used in any program which supports svgdom. Is this reasonable? Should there be a C++ DOM interface, which I just wrap in Python, or can I just get the sprepr into Python and then use pure Python to wrap it in DOM (easier for me, probably)?