Logo Search packages:      
Sourcecode: inkscape version File versions

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

Reads the Inkscape::XML::Node, and initializes SPFeBlend variables. For this to get called, our name must be associated with a repr via "sp_object_type_register". Best done through sp-object-repr.cpp's repr_name_entries array.

Definition at line 97 of file blend.cpp.

References SPObject::parent, Inkscape::XML::Node::setAttribute(), sp_filter_name_for_image(), sp_filter_primitive_name_previous_out(), and sp_object_read_attr().

{
    SPFeBlend *blend = SP_FEBLEND(object);

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

    /*LOAD ATTRIBUTES FROM REPR HERE*/
    sp_object_read_attr(object, "mode");
    sp_object_read_attr(object, "in2");

    /* Unlike normal in, in2 is required attribute. Make sure, we can call
     * it by some name. */
    if (blend->in2 == Inkscape::Filters::NR_FILTER_SLOT_NOT_SET ||
        blend->in2 == Inkscape::Filters::NR_FILTER_UNNAMED_SLOT)
    {
        SPFilter *parent = SP_FILTER(object->parent);
        blend->in2 = sp_filter_primitive_name_previous_out(blend);
        repr->setAttribute("in2", sp_filter_name_for_image(parent, blend->in2));
    }
}


Generated by  Doxygen 1.6.0   Back to index