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

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

Virtual build callback.

This has to be invoked immediately after creation of an SPObject. The frontend method ensures that the new object is properly attached to the document and repr; implementation then will parse all of the attributes, generate the children objects and so on. Invoking build on the SPRoot object results in creation of the whole document tree (this is, what SPDocument does after the creation of the XML tree).

See also:
sp_object_release()

Definition at line 830 of file sp-object.cpp.

References Inkscape::XML::Node::firstChild(), sp_object_attach(), sp_object_read_attr(), and sp_object_unref().

Referenced by sp_object_class_init().

{
    /* Nothing specific here */
    debug("id=%x, typename=%s", object, g_type_name_from_instance((GTypeInstance*)object));

    sp_object_read_attr(object, "xml:space");
    sp_object_read_attr(object, "inkscape:label");
    sp_object_read_attr(object, "inkscape:collect");

    for (Inkscape::XML::Node *rchild = repr->firstChild() ; rchild != NULL; rchild = rchild->next()) {
        GType type = sp_repr_type_lookup(rchild);
        if (!type) {
            continue;
        }
        SPObject *child = SP_OBJECT(g_object_new(type, 0));
        sp_object_attach(object, child, object->lastChild());
        sp_object_unref(child, NULL);
        sp_object_invoke_build(child, document, rchild, SP_OBJECT_IS_CLONED(object));
    }
}

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