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

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

Virtual build: set gradient attributes from its associated repr.

Definition at line 407 of file sp-gradient.cpp.

References Inkscape::XML::Node::attribute(), SPGradient::has_stops, Inkscape::XML::Node::setAttribute(), and sp_object_read_attr().

Referenced by classInit().

{
    SPGradient *gradient = SP_GRADIENT(object);

    // Work-around in case a swatch had been marked for immediate collection:
    if ( repr->attribute("osb:paint") && repr->attribute("inkscape:collect") ) {
        repr->setAttribute("inkscape:collect", 0);
    }

    if (((SPObjectClass *) gradient_parent_class)->build) {
        (* ((SPObjectClass *) gradient_parent_class)->build)(object, document, repr);
    }

    for ( SPObject *ochild = sp_object_first_child(object); ochild; ochild = ochild->next ) {
        if (SP_IS_STOP(ochild)) {
            gradient->has_stops = TRUE;
            break;
        }
    }

    sp_object_read_attr(object, "gradientUnits");
    sp_object_read_attr(object, "gradientTransform");
    sp_object_read_attr(object, "spreadMethod");
    sp_object_read_attr(object, "xlink:href");
    sp_object_read_attr(object, "osb:paint");

    /* Register ourselves */
    sp_document_add_resource(document, "gradient", 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