Thanks for the quick reply! Thoughts inline:
On 26 June 2013 15:37, Martin Owens <doctormo@...400...> wrote:
On Wed, 2013-06-26 at 15:28 +0100, Eric Greveson wrote:
- Changes made to the document in the extension are not reflected in
Inkscape.
Dbus is asyncronous; you wouldn't be working on a local copy of the document, but instead you would be pulling the strings on inkscape's API effecting the document directly. No passing back and forth of xml, no syncing (as such).
I understand that DBus is asynchronous (which is great), but the existing extensions aren't! My point is that if you decide to make a DBus call half-way through an effect script which also modifies the document XML in the traditional inkex.Effect way, then all of the "changes" that have been made to the XML are still only local changes within the script's in-memory representation of the SVG. The DBus call will then happily be made on the main Inkscape document as it looked before the script started to execute (i.e. the script's changes are not yet known to Inkscape).
- What is the status of DBus on Windows or Mac? Would the scripting
improvements be available in standard installs on all operating systems?
From 2010 http://inkscape.13.x6.nabble.com/Inkscape-amp-Dbus-td2856124.html I share your concern. Although I feel getting solid functionality done to proof it's utility is more important than waiting for platform compatibility. When the scripts demand the support will come IMO.
Interesting. Will bear that in mind.
Perhaps I should consider writing my Python script outside of Inkscape, and sending the commands via DBus from this external Python script, as this would seemingly solve my current problem.
I don't know if Inkscape runs headless, it might (for web-server renderings?). Regardless, it should be a simple process to enable and experiment. I'd love to hear your experiences if you do try the api.
There's a --without-gui (or -z) switch that takes a special codepath in main.cpp (sp_main_console) (this path is also invoked if certain other command-line args are passed to Inkscape). However I'm not sure if it's working properly with verbs: I need to investigate this further (it's possible that I'm doing something wrong). Web-server renderings is exactly my use case! :)