+void Widget::set_enabled(bool e)
+{
+ set_state(DISABLED, (e ? NORMAL : DISABLED));
+}
+
+void Widget::set_state(State mask, State bits)
+{
+ State old_state = state;
+ state = (state&~mask)|bits;
+ if(style && style->compare_states(old_state, state))
+ mark_rebuild();
+}
+
+void Widget::set_animation_interval(const Time::TimeDelta &iv)
+{
+ if(iv<Time::zero)
+ throw invalid_argument("Widget::set_animation_interval");
+
+ anim_interval = iv;
+ signal_request_animation.emit(anim_interval);
+}
+
+void Widget::stop_animation()
+{
+ set_animation_interval(Time::zero);
+}
+
+void Widget::mark_rebuild()
+{
+ if(rebuild_needed)
+ return;
+
+ rebuild_needed = true;
+ signal_rebuild_needed.emit();
+}
+
+void Widget::rebuild_hierarchy()
+{
+ if(rebuild_needed)
+ {
+ rebuild_needed = false;
+ rebuild();
+ }
+}
+
+void Widget::rebuild()