struct _EvPresentationTimerPrivate
{
- cairo_surface_t *surface;
+ guint page;
+ guint pages;
};
#define EV_PRESENTATION_TIMER_GET_PRIVATE(object) \
static gboolean
ev_presentation_timer_draw(GtkWidget *timer, cairo_t *cr)
{
- cairo_set_source_rgb(cr, 0, 0, 0);
- cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
+ EvPresentationTimer *ev_timer = EV_PRESENTATION_TIMER(timer);
+ GtkAllocation allocation;
+ gtk_widget_get_allocation (timer, &allocation);
+ //cairo_translate(cr,allocation.x,allocation.y);
+ 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);
+ cairo_set_font_size (cr, 40);
+ guint pos = (allocation.width/ev_timer->priv->pages)*ev_timer->priv->page;
+ cairo_move_to (cr, pos, 40);
+ cairo_show_text (cr, "Disziplin ist Macht.");
- cairo_move_to(cr, 10.0, 50.0);
- cairo_show_text(cr, "Disziplin ist Macht.");
return FALSE;
}
+void
+ev_presentation_timer_set_pages (EvPresentationTimer *ev_timer, guint pages)
+{
+ ev_timer->priv->pages = pages;
+}
+
+void
+ev_presentation_timer_set_page (EvPresentationTimer *ev_timer, guint page)
+{
+ ev_timer->priv->page = page;
+ gtk_widget_queue_draw(GTK_WIDGET(ev_timer));
+}
+
static void
ev_presentation_timer_init (EvPresentationTimer *ev_timer)
{
-// ev_timer->priv = EV_DSCWINDOW_GET_PRIVATE (ev_timer);
+ ev_timer->priv = EV_PRESENTATION_TIMER_GET_PRIVATE (ev_timer);
+ ev_timer->priv->page = 0;
+ ev_timer->priv->pages = 0;
}
static void