From 154165799998cb2cb7491bbd97b0511943a0228e Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 21 Feb 2009 01:59:56 +0000 Subject: Move files from the src/dialogs/ directory to the places where they should be. Build libinkscape.a - should reduce link time. (bzr r7337) --- src/dialogs/xml-tree.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/dialogs/xml-tree.cpp') diff --git a/src/dialogs/xml-tree.cpp b/src/dialogs/xml-tree.cpp index 65ae9a8a3..cf3599517 100644 --- a/src/dialogs/xml-tree.cpp +++ b/src/dialogs/xml-tree.cpp @@ -22,7 +22,6 @@ #include "../document.h" #include "../event-context.h" #include "helper/window.h" -#include "in-dt-coordsys.h" #include "../inkscape.h" #include "../interface.h" #include "macros.h" @@ -142,6 +141,7 @@ static void cmd_set_attr(GtkObject *object, gpointer data); static gboolean sp_xml_tree_key_press(GtkWidget *widget, GdkEventKey *event); +static bool in_dt_coordsys(SPObject const &item); /* * \brief Sets the XML status bar when the tree is selected. @@ -1574,6 +1574,31 @@ void cmd_unindent_node(GtkObject */*object*/, gpointer /*data*/) } // end of cmd_unindent_node() +/** Returns true iff \a item is suitable to be included in the selection, in particular + whether it has a bounding box in the desktop coordinate system for rendering resize handles. + + Descendents of nodes (markers etc.) return false, for example. +*/ +bool in_dt_coordsys(SPObject const &item) +{ + /* Definition based on sp_item_i2doc_affine. */ + SPObject const *child = &item; + g_return_val_if_fail(child != NULL, false); + for(;;) { + if (!SP_IS_ITEM(child)) { + return false; + } + SPObject const * const parent = SP_OBJECT_PARENT(child); + if (parent == NULL) { + break; + } + child = parent; + } + g_assert(SP_IS_ROOT(child)); + /* Relevance: Otherwise, I'm not sure whether to return true or false. */ + return true; +} + /* Local Variables: -- cgit v1.2.3