+ set_pointer_focus(0);
+}
+
+void Container::touch_press(int x, int y, unsigned finger)
+{
+ if(Widget *child = get_pointer_target(x, y, true))
+ {
+ // TODO track focus for each finger separately
+ if(!touch_focus)
+ touch_focus = child;
+
+ const Geometry &cgeom = child->get_geometry();
+ child->touch_press(x-cgeom.x, y-cgeom.y, finger);
+ }
+}
+
+void Container::touch_release(int x, int y, unsigned finger)
+{
+ if(Widget *child = get_pointer_target(x, y, true))
+ {
+ // TODO track focus for each finger separately
+ if(child==touch_focus)
+ touch_focus = 0;
+
+ const Geometry &cgeom = child->get_geometry();
+ child->touch_release(x-cgeom.x, y-cgeom.y, finger);
+ }
+}
+
+void Container::touch_motion(int x, int y, unsigned finger)
+{
+ if(Widget *child = get_pointer_target(x, y, true))
+ {
+ const Geometry &cgeom = child->get_geometry();
+ child->touch_motion(x-cgeom.x, y-cgeom.y, finger);
+ }
+}
+
+bool Container::key_press(unsigned key, unsigned mod)
+{
+ if(input_focus && input_focus->is_enabled())
+ return input_focus->key_press(key, mod);
+ else
+ return false;
+}
+
+bool Container::key_release(unsigned key, unsigned mod)
+{
+ if(input_focus && input_focus->is_enabled())
+ return input_focus->key_release(key, mod);
+ else
+ return false;
+}
+
+bool Container::character(wchar_t ch)
+{
+ if(input_focus && input_focus->is_enabled())
+ return input_focus->character(ch);
+ else
+ return false;
+}
+
+void Container::focus_in()
+{
+ if(saved_input_focus && saved_input_focus->get_parent()==this)
+ set_input_focus(saved_input_focus);
+ Widget::focus_in();
+}
+
+void Container::focus_out()
+{
+ saved_input_focus = input_focus;
+ set_input_focus(0);
+ Widget::focus_out();
+}
+
+bool Container::navigate(Navigation nav)
+{
+ if(input_focus && input_focus->is_enabled())
+ return input_focus->navigate(nav);
+ else
+ return false;
+}
+
+void Container::animate(const Time::TimeDelta &dt)
+{
+ for(list<Child *>::iterator i=children.begin(); i!=children.end(); ++i)
+ {
+ const Time::TimeDelta &child_iv = (*i)->widget->get_animation_interval();
+ if(!child_iv)
+ continue;
+
+ (*i)->time_since_animate += dt;
+ if((*i)->time_since_animate>=child_iv)
+ {
+ Time::TimeDelta child_dt = (*i)->time_since_animate;
+ (*i)->time_since_animate = min((*i)->time_since_animate-child_iv, child_iv);
+ (*i)->widget->animate(child_dt);
+ }
+ }