Code

moving trunk for module inkscape
[inkscape.git] / src / dialogs / in-dt-coordsys.cpp
1 #include "sp-root.h"
3 /** Returns true iff \a item is suitable to be included in the selection, in particular
4     whether it has a bounding box in the desktop coordinate system for rendering resize handles.
6     Descendents of <defs> nodes (markers etc.) return false, for example.
7 */
8 bool in_dt_coordsys(SPObject const &item)
9 {
10     /* Definition based on sp_item_i2doc_affine. */
11     SPObject const *child = &item;
12     g_return_val_if_fail(child != NULL, false);
13     for(;;) {
14         if (!SP_IS_ITEM(child)) {
15             return false;
16         }
17         SPObject const * const parent = SP_OBJECT_PARENT(child);
18         if (parent == NULL) {
19             break;
20         }
21         child = parent;
22     }
23     g_assert(SP_IS_ROOT(child));
24     /* Relevance: Otherwise, I'm not sure whether to return true or false. */
25     return true;
26 }
28 /*
29   Local Variables:
30   mode:c++
31   c-file-style:"stroustrup"
32   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
33   indent-tabs-mode:nil
34   fill-column:99
35   End:
36 */
37 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :