+// browse tree and resize SIZE_BY_CONTENT node
+void size_by_content (Area *a)
+{
+ // children node are resized before its parent
+ GSList *l;
+ for (l = a->list; l ; l = l->next)
+ size_by_content(l->data);
+
+ // calculate current area's size
+ if (a->resize && a->size_mode == SIZE_BY_CONTENT) {
+ a->resize = 0;
+
+ // if 'size' changed then 'resize = 1' on the parent
+ a->_resize(a);
+ ((Area*)a->parent)->resize = 1;
+ }
+}
+
+
+// browse tree and resize SIZE_BY_LAYOUT node
+void size_by_layout (Area *a)
+{
+ // parent node is resized before its children
+
+ // calculate current area's size
+ if (a->resize && a->size_mode == SIZE_BY_LAYOUT) {
+ a->resize = 0;
+
+ // if 'size' changed then 'resize = 1' on the parent
+ //if (a->_resize(a))
+ //a->parent->resize = 1;
+ }
+
+ GSList *l;
+ for (l = a->list; l ; l = l->next)
+ size_by_layout(l->data);
+}
+