summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1ecc906)
raw | patch | inline | side by side (parent: 1ecc906)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 29 Dec 2008 05:25:23 +0000 (05:25 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Mon, 29 Dec 2008 05:25:23 +0000 (05:25 +0000) |
src/selection-chemistry.cpp | patch | blob | history | |
src/selection-chemistry.h | patch | blob | history |
index f1bb46167de8e2bbd8d3e77ef370b5d2be4a8e91..de8662cc3ad5f37f1c5db8b91e3d43b9b33ca6f7 100644 (file)
_("Ungroup"));
}
+/** Replace all groups in the list with their member objects, recursively; returns a new list, frees old */
+GSList *
+sp_degroup_list (GSList *items)
+{
+ GSList *out = NULL;
+ bool has_groups = false;
+ for (GSList *item = items; item; item = item->next) {
+ if (!SP_IS_GROUP(item->data)) {
+ out = g_slist_prepend(out, item->data);
+ } else {
+ has_groups = true;
+ GSList *members = sp_item_group_item_list (SP_GROUP(item->data));
+ for (GSList *member = members; member; member = member->next) {
+ out = g_slist_prepend(out, member->data);
+ }
+ g_slist_free (members);
+ }
+ }
+ out = g_slist_reverse (out);
+ g_slist_free (items);
+
+ if (has_groups) { // recurse if we unwrapped a group - it may have contained others
+ out = sp_degroup_list (out);
+ }
+
+ return out;
+}
+
+
+/** If items in the list have a common parent, return it, otherwise return NULL */
static SPGroup *
sp_item_list_common_parent_group(GSList const *items)
{
index 15b6f2057799e44d61453da8236e62fe55c7e57a..770f368535e94d315f7869599e9ce5465af1f1ff 100644 (file)
void unhide_all(SPDesktop *dt);
void unhide_all_in_all_layers(SPDesktop *dt);
-/* selection cycling */
+GSList *sp_degroup_list (GSList *items);
+/* selection cycling */
typedef enum
{
SP_CYCLE_SIMPLE,