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

static void sp_gradient_modified ( SPObject object,
guint  flags 
) [static]

Callback for modified event.

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

References SPObject::emitModified(), SPObject::mflags, sp_gradient_ensure_colors(), and sp_gradient_invalidate_vector().

Referenced by sp_gradient_class_init().

{
    SPGradient *gr = SP_GRADIENT(object);

    if (flags & SP_OBJECT_CHILD_MODIFIED_FLAG) {
        sp_gradient_invalidate_vector(gr);
    }

    if (flags & SP_OBJECT_STYLE_MODIFIED_FLAG) {
        sp_gradient_ensure_colors(gr);
    }

    if (flags & SP_OBJECT_MODIFIED_FLAG) flags |= SP_OBJECT_PARENT_MODIFIED_FLAG;
    flags &= SP_OBJECT_MODIFIED_CASCADE;

    // FIXME: climb up the ladder of hrefs
    GSList *l = NULL;
    for (SPObject *child = sp_object_first_child(object) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
        g_object_ref(G_OBJECT(child));
        l = g_slist_prepend(l, child);
    }
    l = g_slist_reverse(l);
    while (l) {
        SPObject *child = SP_OBJECT(l->data);
        l = g_slist_remove(l, child);
        if (flags || (child->mflags & (SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_CHILD_MODIFIED_FLAG))) {
            child->emitModified(flags);
        }
        g_object_unref(G_OBJECT(child));
    }
}


Generated by  Doxygen 1.6.0   Back to index