+ part_cache.insert_special(part);
+}
+
+void Widget::render(GL::Renderer &renderer) const
+{
+ if(!style)
+ throw logic_error(format("Attempt to render a widget with null style (class=\"%s\", style_name=\"%s\")", get_class(), style_name));
+
+ GL::Renderer::Push _push(renderer);
+ renderer.transform(GL::Matrix::translation(geom.x, geom.y, 0));
+ const PartCache::PartList &parts = part_cache.get_parts();
+ for(PartCache::PartList::const_iterator i=parts.begin(); i!=parts.end(); ++i)
+ {
+ if(i->mesh && i->texture)
+ {
+ renderer.set_texture(i->texture);
+ i->mesh->draw(renderer);
+ }
+ else if(i->part)
+ render_special(*i->part, renderer);
+ }
+}
+
+void Widget::pointer_enter()
+{
+ set_state(HOVER);
+}
+
+void Widget::pointer_leave()
+{
+ clear_state(HOVER);
+}
+
+void Widget::touch_press(int x, int y, unsigned finger)
+{
+ if(finger==0)
+ button_press(x, y, 1);
+}
+
+void Widget::touch_release(int x, int y, unsigned finger)
+{
+ if(finger==0)
+ button_release(x, y, 1);
+}
+
+void Widget::touch_motion(int x, int y, unsigned finger)
+{
+ if(finger==0)
+ pointer_motion(x, y);
+}
+
+void Widget::focus_in()
+{
+ set_state(FOCUS);