/* DrawStrategy - Implementation of a basic draw strategy Copyright (C) Lumiera.org 2010, Stefan Kangas cr, TimelineViewWindow* const window) const { REQUIRE (cr); REQUIRE (window); int x = window->time_to_x(entity.getBegin()); int width = window->time_to_x( entity.getEnd()) - window->time_to_x(entity.getBegin()); // Draw a rectangle for the entity // TODO: get height from the timeline::Entity cr->rectangle(x, 1, width, 100-2); // if (entity.getSelected()) cr->set_source(Cairo::SolidPattern::create_rgb (0.4, 0.4, 0.8)); // else // cr->set_source(Cairo::SolidPattern::create_rgb (0.4, 0.4, 0.4)); cr->fill_preserve(); cr->set_source_rgb(0.25, 0.25, 0.25); cr->stroke(); // Show the entities name cr->rectangle(x, 1, width, 100-2); cr->clip(); cr->move_to (x + 3, 12); cr->set_source_rgb (1.0, 1.0, 1.0); cr->set_font_size (9); cr->show_text (entity.getName()); } }}} // namespace gui::widgets::timeline