]> www.fi.muni.cz Git - evince.git/blob - shell/ev-presentation-timer.c
[dualscreen] timer skeleton
[evince.git] / shell / ev-presentation-timer.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8; c-indent-level: 8 -*- */
2 /* this file is part of evince, a gnome document viewer
3  *
4  *
5  *  Author:
6  *    Lukas Bezdicka <255993@mail.muni.cz>
7  *
8  * Evince is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * Evince is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  */
22
23 #ifdef HAVE_CONFIG_H
24 #include "config.h"
25 #endif
26
27 #include <cairo.h>
28 #include <glib/gi18n.h>
29 #include <gtk/gtk.h>
30 #include <math.h>
31
32 #include "ev-presentation-timer.h"
33
34 struct _EvPresentationTimerPrivate
35 {
36         cairo_surface_t *surface;
37 };
38
39 #define EV_PRESENTATION_TIMER_GET_PRIVATE(object) \
40         (G_TYPE_INSTANCE_GET_PRIVATE ((object), EV_TYPE_PRESENTATION_TIMER, EvPresentationTimerPrivate))
41
42 G_DEFINE_TYPE (EvPresentationTimer, ev_presentation_timer, GTK_TYPE_DRAWING_AREA);
43
44
45 static gboolean
46 ev_presentation_timer_draw(GtkWidget *timer, cairo_t *cr)
47 {
48   cairo_set_source_rgb(cr, 0, 0, 0);
49   cairo_select_font_face(cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
50       CAIRO_FONT_WEIGHT_NORMAL);
51   cairo_set_font_size(cr, 40.0);
52
53   cairo_move_to(cr, 10.0, 50.0);
54   cairo_show_text(cr, "Disziplin ist Macht.");
55
56         return FALSE;
57 }
58
59 static void
60 ev_presentation_timer_init (EvPresentationTimer *ev_timer)
61 {
62 //      ev_timer->priv = EV_DSCWINDOW_GET_PRIVATE (ev_timer);
63 }
64
65 static void
66 ev_presentation_timer_class_init (EvPresentationTimerClass *klass)
67 {
68         GObjectClass    *object_class = G_OBJECT_CLASS (klass);
69         GtkWidgetClass  *widget_class = GTK_WIDGET_CLASS (klass);
70         //GtkDrawingAreaClass     *drawing_area_class = GTK_DRAWING_AREA_CLASS (klass);
71         g_type_class_add_private (object_class, sizeof (EvPresentationTimerPrivate));
72         widget_class->draw = ev_presentation_timer_draw;
73
74         /*object_class->finalize = ev_presentation_timer_finalize;*/
75 }
76
77 GtkWidget *
78 ev_presentation_timer_new (void)
79 {
80         EvPresentationTimer     *ev_timer;
81
82         ev_timer = g_object_new (EV_TYPE_PRESENTATION_TIMER, NULL);
83         return GTK_WIDGET (ev_timer);
84 }