- cairo_set_source_rgb(cr, 0, 0, 0);
- cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
- CAIRO_FONT_WEIGHT_NORMAL);
- cairo_set_font_size(cr, 40.0);
+ EvPresentationTimer *ev_timer = EV_PRESENTATION_TIMER(timer);
+ GtkAllocation allocation;
+ gtk_widget_get_allocation (timer, &allocation);
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_set_line_width (cr, 5);
+ guint pos = (allocation.width/ev_timer->priv->pages)*ev_timer->priv->page;
+ cairo_move_to (cr,pos,2);
+ cairo_line_to (cr,pos,allocation.height);
+ cairo_stroke (cr);
+ if(ev_timer->priv->running && ev_timer->priv->time > 0 && ev_timer->priv->remaining > 0)
+ {
+ gdouble progress = ev_presentation_timer_progress (ev_timer->priv->time, ev_timer->priv->remaining)*(allocation.width);
+ cairo_rectangle (cr, allocation.width-progress, 10, (allocation.width-(allocation.width-progress))-10, allocation.height-5);
+ cairo_stroke_preserve (cr);
+ cairo_fill(cr);
+ }
+ return FALSE;
+}
+
+static gboolean
+timeout_cb (gpointer data)
+{
+ EvPresentationTimer *ev_timer = EV_PRESENTATION_TIMER(data);
+ ev_timer->priv->remaining--;