Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

static void sp_root_build ( SPObject object,
SPDocument document,
Inkscape::XML::Node repr 
) [static]

Fills in the data for an SPObject from its Inkscape::XML::Node object. It fills in data such as version, x, y, width, height, etc. It then calls the object's parent class object's build function.

Definition at line 144 of file sp-root.cpp.

References Inkscape::XML::Node::attribute(), SPRoot::defs, Geom::identity(), Inkscape::XML::Node::setAttribute(), and sp_object_read_attr().

Referenced by sp_root_class_init().

{
    SPGroup *group = (SPGroup *) object;
    SPRoot *root = (SPRoot *) object;

    if ( !object->repr->attribute("version") ) {
        repr->setAttribute("version", SVG_VERSION);
    }

    sp_object_read_attr(object, "version");
    sp_object_read_attr(object, "inkscape:version");
    /* It is important to parse these here, so objects will have viewport build-time */
    sp_object_read_attr(object, "x");
    sp_object_read_attr(object, "y");
    sp_object_read_attr(object, "width");
    sp_object_read_attr(object, "height");
    sp_object_read_attr(object, "viewBox");
    sp_object_read_attr(object, "preserveAspectRatio");
    sp_object_read_attr(object, "onload");

    if (((SPObjectClass *) parent_class)->build)
        (* ((SPObjectClass *) parent_class)->build) (object, document, repr);

    /* Search for first <defs> node */
    for (SPObject *o = sp_object_first_child(SP_OBJECT(group)) ; o != NULL; o = SP_OBJECT_NEXT(o) ) {
        if (SP_IS_DEFS(o)) {
            root->defs = SP_DEFS(o);
            break;
        }
    }

    // clear transform, if any was read in - SVG does not allow transform= on <svg>
    SP_ITEM(object)->transform = Geom::identity();
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index