Lines Matching refs:layer

21 #include "layer-fns.h"
34 /** Finds the next sibling layer for a \a layer
38 SPObject *next_sibling_layer(SPObject *layer) {
42 layer->getNext(), NULL, &is_layer
46 /** Finds the previous sibling layer for a \a layer
50 SPObject *previous_sibling_layer(SPObject *layer) {
54 layer->parent->firstChild(), layer, &is_layer
57 return ( sibling != layer ) ? sibling : NULL;
60 /** Finds the first child of a \a layer
62 * @returns NULL if layer has no sublayers
64 SPObject *first_descendant_layer(SPObject *layer) {
68 while (layer) {
69 layer = find_if<SPObject::SiblingIterator>(
70 layer->firstChild(), NULL, &is_layer
72 if (layer) {
73 first_descendant = layer;
80 /** Finds the last (topmost) child of a \a layer
82 * @returns NULL if layer has no sublayers
84 SPObject *last_child_layer(SPObject *layer) {
88 layer->firstChild(), NULL, &is_layer
92 SPObject *last_elder_layer(SPObject *root, SPObject *layer) {
96 while ( layer != root ) {
97 SPObject *sibling(previous_sibling_layer(layer));
102 layer = layer->parent;
110 /** Finds the next layer under \a root, relative to \a layer in
115 SPObject *next_layer(SPObject *root, SPObject *layer) {
118 g_return_val_if_fail(layer != NULL, NULL);
121 SPObject *sibling = next_sibling_layer(layer);
129 } else if ( layer->parent != root ) {
130 result = layer->parent;
137 /** Finds the previous layer under \a root, relative to \a layer in
142 SPObject *previous_layer(SPObject *root, SPObject *layer) {
145 g_return_val_if_fail(layer != NULL, NULL);
148 SPObject *child = last_child_layer(layer);
151 } else if ( layer != root ) {
152 SPObject *sibling = previous_sibling_layer(layer);
156 result = last_elder_layer(root, layer->parent);
164 * Creates a new layer. Advances to the next layer id indicated
166 * that id with attribute inkscape:groupmode='layer', and finally
167 * appends the new group object to \a root after object \a layer.
169 * \pre \a root should be either \a layer or an ancestor of it
171 SPObject *create_layer(SPObject *root, SPObject *layer, LayerRelativePosition position) {
178 id = g_strdup_printf("layer%d", layer_suffix++);
183 repr->setAttribute("inkscape:groupmode", "layer");
188 root = layer;
189 SPObject *child_layer = Inkscape::last_child_layer(layer);
191 layer = child_layer;
195 if ( root == layer ) {
198 Inkscape::XML::Node *layer_repr = layer->getRepr();