Using extensions to modify visibility attribute

Discussion about writing code for Inkscape.
ludocracy
Posts: 1
Joined: Fri Jun 20, 2014 4:04 am

Using extensions to modify visibility attribute

Postby ludocracy » Fri Jun 20, 2014 4:42 am

I'm coming at this from a very different field (Info. Arch.) so bear with me. I am trying to align images with a highly configurable knowledgebase where C parameters/variables are used to control what content is shown or hidden. Simply put, I need users to be able to open an .svg, select an arbitrary list of image elements, group them into a layer, then set its @visibility to a NON-SVG-VALID string e.g. "parameter < 3" (i.e. that layer will only be visible if the value of parameter is less than 3). An external tool will parse the resulting file to resolve those statements into "visible" or "hidden". It would also need to set all subobjects to "inherit" any time their parent has a visibility attribute value.

I see that Inkscape has a layer creation dialog box. I want to add a third field allowing the user to enter their parameter expression. Additionally, Inkscape would have to refer to a custom .xsd that allows CDATA in @visibility for the resulting file to be valid. Can this be done or will I have to modify the source code directly?

Return to “Programming”