In my experiments with the code, I need some basic information on how an object is assigned its color parameters. Consider the following steps: 1. Draw a circle. Fill it with red color. 2. Draw a rectangle. Fill it with green. (both are solid colors right now)
What would be happening in the memory/inkscape process ? a.) Will the inkscape process update the svg document side-by-side which will contain some style information ?
OR
b.) Is a linked list of objects updated in the memory which shall store the color properties for the circle and rectangle objects (along with other related parameters ofcourse, like stroke, style, etc.)?
If you can give an idea on what files in the code handle these aforementioned steps, it will be great. The wiki's section on InkscapeColor does not help at all.
I suppose the above question points to a more generic question ! " How are objects handled in Inkscape (while drawing) ?" Are they objects in the memory ? Perhaps grouping them just groups those objects under a group in a linked list or something like that ?
Looking for quick answers. Thankyou.
Take a look at link [1], there are 2 representations - an XML representation, and a GObject based representation. "Each document has an object tree and an XML tree. Changes in the XML tree are automatically propagated to the object tree via observers"
Whilst running Inkscape you can track the XML tree representation from Edit->XML Editor. Select a rectangle and you should see a "svg:rect" node selected in the XML Editor.
From there you should see all the rect's attributes including a style attribute (such as fill:#803300;stroke:#aa8800) for the colors.
For source code take a look at class SPObject (src/sp-object.h), and classes derived from SPObject like SPRect (src/sp-rect.h)
"SPObject is an abstract base class of all of the document nodes at theSVG document level. Each SPObject subclass implements a certain SVG element node type..... "
[1]http://wiki.inkscape.org/wiki/index.php/Architectural_overview
participants (2)
-
Arshdeep Singh
-
John Smith