Logo Search packages:      
Sourcecode: inkscape version File versions

SPObject * Inkscape::next_layer ( SPObject root,
SPObject layer 
)

Finds the next layer under root, relative to layer in depth-first order.

Returns:
NULL if there are no further layers under root

Definition at line 110 of file layer-fns.cpp.

References first_descendant_layer(), and next_sibling_layer().

Referenced by Inkscape::LayerVerb::perform().

                                                      {
    using std::find_if;

    g_return_val_if_fail(layer != NULL, NULL);

    SPObject *sibling(next_sibling_layer(layer));
    if (sibling) {
        SPObject *descendant(first_descendant_layer(sibling));
        if (descendant) {
            return descendant;
        } else {
            return sibling;
        }
    } else {
        SPObject *parent=SP_OBJECT_PARENT(layer);
        if ( parent != root ) {
            return parent;
        } else {
            return NULL;
        }
    }
}


Generated by  Doxygen 1.6.0   Back to index