Comment 1 for bug 1359471

Revision history for this message
Tony Manero (ased) wrote :

It looks to me that extensions principles are deeply neglected in inkscape.
Missing functionality (understanding today as bug):
- full filename of currently edited file is not known in script extensions
- missing info about selected nodes of each object in case if applicable, extensions cannot modify selected nodes
- informations about selected objects are passed in extension in random order, correct ordering requires full svg scanning
- very poor one way data transfer between inkscape and extension, there is no way to fill data specified in extension .inx file
  with selected objects data if needed

Possible solution is to use two phase model:
- inkscape first call extension with name of .inx file and .svg file
- extension fill/modify proper data into .inx data objects and output .inx file to stdout
- inkscape offer dialog with data from this .inx to user
- after that inkscape can call extension with modified .inx file and .svg file and output .svg file
On python side only inkex.py should be modified to keep all current extension working as before

Besides more data may be transfered to extensions as part of .inx file:
- full pathname of edited file
- selected nodes of each selected objects if relevant
- saved status
- and maybe other time consuming data: bounding boxes, transformation matrices with inverted matrices of each object ...

One motivation is eg. cutter machine, where one need to specify for each object the size and type of used cutter.
When user selects object and calls cutter_setup script one need to know about actually used cutter
somewhere stored as attribute in svg file so user can change it for another. Currently there is no way
to offer user current data from svg file.