From 1114b54c7136d1f1f5850bab79937512c977acc5 Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Tue, 14 Jan 2014 14:17:10 +0000 Subject: [PATCH] Tiling2: Added a useful debugging function. --- src/modules/tiling/window_tree.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/modules/tiling/window_tree.c b/src/modules/tiling/window_tree.c index 29beffc9c..69cb37778 100644 --- a/src/modules/tiling/window_tree.c +++ b/src/modules/tiling/window_tree.c @@ -275,3 +275,28 @@ tiling_window_tree_apply(Window_Tree *root, Evas_Coord x, Evas_Coord y, { _tiling_window_tree_level_apply(root, x, y, w, h, 0); } + +void +tiling_window_tree_dump(Window_Tree *root, int level) +{ + int i; + + if (!root) + return; + + for (i = 0 ; i < level ; i++) + printf(" "); + + if (root->children) + printf("\\-"); + else + printf("|-"); + + printf("%f\n", root->weight); + + Window_Tree *itr; + EINA_INLIST_FOREACH(root->children, itr) + { + tiling_window_tree_dump(itr, level + 1); + } +}